@ncino/web-components 9.0.0-preview.6 → 9.0.0-preview.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.js +1 -1
- package/dist/_virtual/index.js +1 -1
- package/dist/assets/node_modules/.pnpm/ckeditor5@47.3.0/node_modules/ckeditor5/dist/ckeditor5.css +1 -0
- package/dist/components/input/gator/input-phone/input-phone.gator.js +1 -1
- package/dist/components/input-rich-text/ckeditor-config.js +1 -1
- package/dist/components/input-rich-text/input-rich-text.slds.js +2 -2
- package/dist/components/panel/gator/panel.storybook-test.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-alignment@46.1.1 → @ckeditor_ckeditor5-alignment@47.3.0}/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autoformat@46.1.1 → @ckeditor_ckeditor5-autoformat@47.3.0}/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autosave@46.1.1 → @ckeditor_ckeditor5-autosave@47.3.0}/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-basic-styles@46.1.1 → @ckeditor_ckeditor5-basic-styles@47.3.0}/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-block-quote@46.1.1 → @ckeditor_ckeditor5-block-quote@47.3.0}/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@47.3.0/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +8 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-cloud-services@46.1.1 → @ckeditor_ckeditor5-cloud-services@47.3.0}/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-code-block@46.1.1 → @ckeditor_ckeditor5-code-block@47.3.0}/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@47.3.0/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-editor-classic@46.1.1 → @ckeditor_ckeditor5-editor-classic@47.3.0}/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@47.3.0/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +3 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-enter@46.1.1 → @ckeditor_ckeditor5-enter@47.3.0}/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-essentials@46.1.1 → @ckeditor_ckeditor5-essentials@47.3.0}/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-find-and-replace@46.1.1 → @ckeditor_ckeditor5-find-and-replace@47.3.0}/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-font@46.1.1 → @ckeditor_ckeditor5-font@47.3.0}/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-heading@46.1.1 → @ckeditor_ckeditor5-heading@47.3.0}/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-highlight@46.1.1 → @ckeditor_ckeditor5-highlight@47.3.0}/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-horizontal-line@46.1.1 → @ckeditor_ckeditor5-horizontal-line@47.3.0}/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@47.3.0/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@47.3.0/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +3 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-icons@46.1.1 → @ckeditor_ckeditor5-icons@47.3.0}/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@47.3.0/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-indent@46.1.1 → @ckeditor_ckeditor5-indent@47.3.0}/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-language@46.1.1 → @ckeditor_ckeditor5-language@47.3.0}/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@47.3.0/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@47.3.0/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-markdown-gfm@46.1.1 → @ckeditor_ckeditor5-markdown-gfm@47.3.0}/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-media-embed@46.1.1 → @ckeditor_ckeditor5-media-embed@47.3.0}/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-mention@46.1.1 → @ckeditor_ckeditor5-mention@47.3.0}/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@47.3.0/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paragraph@46.1.1 → @ckeditor_ckeditor5-paragraph@47.3.0}/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@47.3.0/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-remove-format@46.1.1 → @ckeditor_ckeditor5-remove-format@47.3.0}/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-select-all@46.1.1 → @ckeditor_ckeditor5-select-all@47.3.0}/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-show-blocks@46.1.1 → @ckeditor_ckeditor5-show-blocks@47.3.0}/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-source-editing@46.1.1 → @ckeditor_ckeditor5-source-editing@47.3.0}/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@47.3.0/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-style@46.1.1 → @ckeditor_ckeditor5-style@47.3.0}/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@47.3.0/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-typing@46.1.1 → @ckeditor_ckeditor5-typing@47.3.0}/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@47.3.0/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-undo@46.1.1 → @ckeditor_ckeditor5-undo@47.3.0}/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-upload@46.1.1 → @ckeditor_ckeditor5-upload@47.3.0}/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@47.3.0/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +8 -0
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@47.3.0/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/@vitest_expect@4.0.15/node_modules/@vitest/expect/dist/index.js +58 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@4.0.15/node_modules/@vitest/pretty-format/dist/index.js +5 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.0.15/node_modules/@vitest/runner/dist/chunk-tasks.js +2 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.0.15/node_modules/@vitest/runner/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@4.0.15/node_modules/@vitest/snapshot/dist/index.js +21 -0
- package/dist/node_modules/.pnpm/@vitest_spy@4.0.15/node_modules/@vitest/spy/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/diff.js +42 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/display.js +2 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/error.js +2 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/helpers.js +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/serialize.js +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/source-map.js +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.0.15/node_modules/@vitest/utils/dist/timers.js +1 -0
- package/dist/node_modules/.pnpm/chai@6.2.1/node_modules/chai/index.js +2 -0
- package/dist/node_modules/.pnpm/tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/.pnpm/vitest@4.0.15_@types_node@24.10.1_@vitest_browser-playwright@4.0.15_@vitest_ui@4.0.15_j_0c91d94893276de308eb5b07cced5df8/node_modules/vitest/browser/context.js +1 -0
- package/dist/node_modules/.pnpm/vitest@4.0.15_@types_node@24.10.1_@vitest_browser-playwright@4.0.15_@vitest_ui@4.0.15_j_0c91d94893276de308eb5b07cced5df8/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +1 -0
- package/dist/node_modules/.pnpm/vitest@4.0.15_@types_node@24.10.1_@vitest_browser-playwright@4.0.15_@vitest_ui@4.0.15_j_0c91d94893276de308eb5b07cced5df8/node_modules/vitest/dist/chunks/utils.DvEY5TfP.js +8 -0
- package/dist/node_modules/.pnpm/vitest@4.0.15_@types_node@24.10.1_@vitest_browser-playwright@4.0.15_@vitest_ui@4.0.15_j_0c91d94893276de308eb5b07cced5df8/node_modules/vitest/dist/chunks/vi.2VT5v0um.js +11 -0
- package/dist/utils/vitest-a11y-utils.js +1 -1
- package/package.json +22 -21
- package/web-types.json +1 -1
- package/dist/_virtual/___vite-browser-external.js +0 -1
- package/dist/_virtual/__vite-browser-external.js +0 -1
- package/dist/_virtual/api-request.js +0 -1
- package/dist/_virtual/constants.js +0 -1
- package/dist/_virtual/events.js +0 -1
- package/dist/_virtual/external.js +0 -1
- package/dist/_virtual/external2.js +0 -1
- package/dist/_virtual/external3.js +0 -1
- package/dist/_virtual/external_types.js +0 -1
- package/dist/_virtual/fetch.js +0 -1
- package/dist/_virtual/figma_client.js +0 -1
- package/dist/_virtual/figma_rest_api.js +0 -1
- package/dist/_virtual/helpers.js +0 -1
- package/dist/_virtual/index10.js +0 -1
- package/dist/_virtual/index11.js +0 -1
- package/dist/_virtual/index12.js +0 -1
- package/dist/_virtual/index2.js +0 -1
- package/dist/_virtual/index3.js +0 -1
- package/dist/_virtual/index4.js +0 -1
- package/dist/_virtual/index5.js +0 -1
- package/dist/_virtual/index6.js +0 -1
- package/dist/_virtual/index7.js +0 -1
- package/dist/_virtual/index8.js +0 -1
- package/dist/_virtual/index9.js +0 -1
- package/dist/_virtual/index_common.js +0 -1
- package/dist/_virtual/index_html.js +0 -1
- package/dist/_virtual/index_html2.js +0 -1
- package/dist/_virtual/index_react.js +0 -1
- package/dist/_virtual/index_react2.js +0 -1
- package/dist/_virtual/inherits_browser.js +0 -1
- package/dist/_virtual/logging.js +0 -1
- package/dist/_virtual/main.js +0 -1
- package/dist/_virtual/main2.js +0 -1
- package/dist/_virtual/mock-interceptor.js +0 -1
- package/dist/_virtual/react.production.js +0 -1
- package/dist/_virtual/string_decoder.js +0 -1
- package/dist/_virtual/template_literal.js +0 -1
- package/dist/_virtual/types.js +0 -1
- package/dist/_virtual/updates.js +0 -1
- package/dist/_virtual/util.js +0 -1
- package/dist/_virtual/utils.js +0 -1
- package/dist/assets/node_modules/.pnpm/ckeditor5@46.1.1/node_modules/ckeditor5/dist/ckeditor5.css +0 -1
- package/dist/components/accordion/gator/base/accordion.gator.figma.js +0 -10
- package/dist/components/accordion/gator/group/accordion-group.gator.figma.js +0 -3
- package/dist/components/alert/alert.gator.figma.js +0 -7
- package/dist/components/avatar/gator/avatar.gator.figma.js +0 -9
- package/dist/components/banner/gator/banner.gator.figma.js +0 -8
- package/dist/components/boolean/boolean.gator.figma.js +0 -11
- package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.figma.js +0 -3
- package/dist/components/breadcrumbs/gator/container/breadcrumbs.gator.figma.js +0 -5
- package/dist/components/button/gator/button.gator.figma.js +0 -12
- package/dist/components/button-group/gator/button-group.gator.figma.js +0 -7
- package/dist/components/icon/gator/icon.gator.figma.js +0 -7
- package/dist/components/icon/gator/icons.gator.figma.js +0 -1
- package/dist/components/text-detail/gator/text-detail.gator.figma.js +0 -30
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +0 -8
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +0 -3
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@46.1.1/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@46.1.1/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +0 -3
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@46.1.1/node_modules/@ckeditor/ckeditor5-image/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@46.1.1/node_modules/@ckeditor/ckeditor5-link/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@46.1.1/node_modules/@ckeditor/ckeditor5-list/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@46.1.1/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@46.1.1/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@46.1.1/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@46.1.1/node_modules/@ckeditor/ckeditor5-table/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +0 -8
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js +0 -3
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js +0 -3
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/main.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/types/multipart.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/types/urlencoded.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/Decoder.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/decodeText.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/getLimit.js +0 -1
- package/dist/node_modules/.pnpm/@fastify_busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/parseParams.js +0 -3
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/client/external.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/common/fetch.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/common/logging.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/common/updates.js +0 -4
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/connect/helpers.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/html/external.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/html/index_html.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/react/external.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/dist/react/index_react.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/package.json.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.10.1_typescript@5.9.3__playwright@1.57.0_4c7b68e67853c98910921d3bcdc3c508/node_modules/@vitest/browser/context.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +0 -58
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +0 -5
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +0 -5
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +0 -21
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +0 -42
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +0 -2
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +0 -1
- package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +0 -1
- package/dist/node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js +0 -1
- package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js +0 -1
- package/dist/node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js +0 -1
- package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js +0 -1
- package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js +0 -1
- package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js +0 -1
- package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js +0 -1
- package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js +0 -1
- package/dist/node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js +0 -1
- package/dist/node_modules/.pnpm/call-bind@1.0.8/node_modules/call-bind/index.js +0 -1
- package/dist/node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js +0 -1
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +0 -2
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +0 -2
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +0 -2
- package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +0 -4
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +0 -1
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +0 -1
- package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +0 -1
- package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +0 -1
- package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/compare.js +0 -1
- package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/compareVersions.js +0 -1
- package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/index.js +0 -1
- package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/satisfies.js +0 -1
- package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/utils.js +0 -1
- package/dist/node_modules/.pnpm/compare-versions@6.1.1/node_modules/compare-versions/lib/esm/validate.js +0 -1
- package/dist/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.js +0 -1
- package/dist/node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js +0 -3
- package/dist/node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/package.json.js +0 -1
- package/dist/node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js +0 -1
- package/dist/node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js +0 -1
- package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js +0 -1
- package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js +0 -1
- package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js +0 -1
- package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js +0 -1
- package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js +0 -1
- package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js +0 -1
- package/dist/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js +0 -1
- package/dist/node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js +0 -1
- package/dist/node_modules/.pnpm/events@3.3.0/node_modules/events/events.js +0 -1
- package/dist/node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js +0 -1
- package/dist/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js +0 -1
- package/dist/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js +0 -1
- package/dist/node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js +0 -1
- package/dist/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js +0 -1
- package/dist/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -1
- package/dist/node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js +0 -1
- package/dist/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js +0 -1
- package/dist/node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js +0 -1
- package/dist/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.js +0 -1
- package/dist/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js +0 -1
- package/dist/node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js +0 -1
- package/dist/node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js +0 -1
- package/dist/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js +0 -1
- package/dist/node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js +0 -1
- package/dist/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js +0 -1
- package/dist/node_modules/.pnpm/is-arguments@1.2.0/node_modules/is-arguments/index.js +0 -1
- package/dist/node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js +0 -1
- package/dist/node_modules/.pnpm/is-generator-function@1.1.0/node_modules/is-generator-function/index.js +0 -1
- package/dist/node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js +0 -1
- package/dist/node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.js +0 -1
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +0 -2
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +0 -1
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +0 -1
- package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js +0 -1
- package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js +0 -1
- package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js +0 -1
- package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js +0 -1
- package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js +0 -1
- package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js +0 -1
- package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js +0 -1
- package/dist/node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js +0 -1
- package/dist/node_modules/.pnpm/possible-typed-array-names@1.1.0/node_modules/possible-typed-array-names/index.js +0 -1
- package/dist/node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.production.js +0 -1
- package/dist/node_modules/.pnpm/react@19.2.0/node_modules/react/index.js +0 -1
- package/dist/node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js +0 -1
- package/dist/node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js +0 -1
- package/dist/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js +0 -1
- package/dist/node_modules/.pnpm/string_decoder@1.1.1/node_modules/string_decoder/lib/string_decoder.js +0 -1
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/browser.js +0 -1
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.js +0 -1
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +0 -1
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/index.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/agent.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/abort-signal.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-connect.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-pipeline.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-request.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-stream.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/api-upgrade.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/index.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/readable.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/util.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/balanced-pool.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cache.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/cachestorage.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/symbols.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/util.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/client.js +0 -26
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/compat/dispatcher-weakref.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/constants.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/index.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/parse.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cookies/util.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/connect.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/constants.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/errors.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/request.js +0 -5
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/symbols.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/util.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/dispatcher-base.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/dispatcher.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/body.js +0 -9
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/constants.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/dataURL.js +0 -3
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/file.js +0 -3
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/formdata.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/global.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/headers.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/index.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/request.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/response.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/symbols.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/util.js +0 -2
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/webidl.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/encoding.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/filereader.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/progressevent.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/symbols.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/util.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/global.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/DecoratorHandler.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RedirectHandler.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RetryHandler.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/interceptor/redirectInterceptor.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/constants.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/llhttp/utils.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-agent.js +0 -5
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-client.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-errors.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-interceptor.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-pool.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-symbols.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/mock-utils.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/mock/pluralizer.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/node/fixed-queue.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/pool-base.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/pool-stats.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/pool.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/proxy-agent.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/timers.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/connection.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/constants.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/events.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/frame.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/receiver.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/symbols.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/util.js +0 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/websocket.js +0 -1
- package/dist/node_modules/.pnpm/util@0.12.5/node_modules/util/support/isBufferBrowser.js +0 -1
- package/dist/node_modules/.pnpm/util@0.12.5/node_modules/util/support/types.js +0 -1
- package/dist/node_modules/.pnpm/util@0.12.5/node_modules/util/util.js +0 -10
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.1_@vitest_browser@3.2.4_@vitest_ui@3_6e27007ba0535c26eedf5a22febb1842/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -1
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.1_@vitest_browser@3.2.4_@vitest_ui@3_6e27007ba0535c26eedf5a22febb1842/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -1
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.1_@vitest_browser@3.2.4_@vitest_ui@3_6e27007ba0535c26eedf5a22febb1842/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -8
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.1_@vitest_browser@3.2.4_@vitest_ui@3_6e27007ba0535c26eedf5a22febb1842/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -12
- package/dist/node_modules/.pnpm/which-typed-array@1.1.19/node_modules/which-typed-array/index.js +0 -1
- /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-watchdog@46.1.1 → @ckeditor_ckeditor5-watchdog@47.3.0}/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/ParseError.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/PhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/format.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/isObject.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/isPossible.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/isValid.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/metadata.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parse.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/es6/tools/semver-compare.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/metadata.min.json.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.30 → libphonenumber-js@1.12.31}/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-A242L54C.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-EZSQOHRI.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-JP7NCOJX.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-RP5RXKFU.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/_browser-chunks/chunk-ZUWEVLDX.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/client-logger/index.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/core-events/index.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/instrumenter/index.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@10.1.2_@testing-library_dom@10.4.1_prettier@3.6.2_react-dom@19.2.0_react@19.2.0__react@19.2.0 → storybook@10.1.4_@testing-library_dom@10.4.1_prettier@3.7.4_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/storybook/dist/test/index.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Plugin as f,Command as B}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Widget as V,toWidget as S,findOptimalInsertionRange as A}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{ButtonView as P,MenuBarMenuListItemButtonView as T}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{logWarning as I,createElement as b}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconHtml as L,IconPencil as C,IconCheck as D,IconCancel as M}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";class y extends B{refresh(){const e=this.editor.model,i=e.schema,a=e.document.selection,t=H(a);this.isEnabled=O(a,i,e),this.value=t?t.getAttribute("value")||"":null}execute(e){const i=this.editor.model,a=i.document.selection;i.change(t=>{let w;this.value!==null?w=H(a):(w=t.createElement("rawHtml"),i.insertObject(w,null,null,{setSelection:"on"})),t.setAttribute("value",e,w)})}}function O(m,e,i){const a=W(m,i);return e.checkChild(a,"rawHtml")}function W(m,e){const a=A(m,e).start.parent;return a.isEmpty&&!a.is("rootElement")?a.parent:a}function H(m){const e=m.getSelectedElement();return e&&e.is("element","rawHtml")?e:null}class z extends f{_widgetButtonViewReferences=new Set;static get pluginName(){return"HtmlEmbedEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:i=>(I("html-embed-provide-sanitize-function"),{html:i,hasChanged:!1})})}init(){const e=this.editor;e.model.schema.register("rawHtml",{inheritAllFrom:"$blockObject",allowAttributes:["value"]}),e.commands.add("htmlEmbed",new y(e)),this._setupConversion()}_setupConversion(){const e=this.editor,i=e.t,a=e.editing.view,t=this._widgetButtonViewReferences,w=e.config.get("htmlEmbed");this.editor.editing.view.on("render",()=>{for(const o of t){if(o.element&&o.element.isConnected)return;o.destroy(),t.delete(o)}},{priority:"lowest"}),e.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),e.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(o,{writer:l})=>l.createElement("rawHtml",{value:o.getCustomProperty("$rawContent")})}),e.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(o,{writer:l})=>l.createRawElement("div",{class:"raw-html-embed"},function(s){s.innerHTML=o.getAttribute("value")||""})}),e.conversion.for("editingDowncast").elementToStructure({model:{name:"rawHtml",attributes:["value"]},view:(o,{writer:l})=>{let s,n,c;const r=l.createRawElement("div",{class:"raw-html-embed__content-wrapper"},function(u){s=u,g({editor:e,domElement:u,state:n,props:c}),s.addEventListener("mousedown",()=>{if(n.isEditable){const h=e.model;h.document.selection.getSelectedElement()!==o&&h.change(R=>R.setSelection(o,"on"))}},!0)}),p={makeEditable(){n=Object.assign({},n,{isEditable:!0}),g({domElement:s,editor:e,state:n,props:c}),a.change(u=>{u.setAttribute("data-cke-ignore-events","true",r)}),s.querySelector("textarea").focus()},save(u){u!==n.getRawHtmlValue()?(e.execute("htmlEmbed",u),e.editing.view.focus()):this.cancel()},cancel(){n=Object.assign({},n,{isEditable:!1}),g({domElement:s,editor:e,state:n,props:c}),e.editing.view.focus(),a.change(u=>{u.removeAttribute("data-cke-ignore-events",r)})}};n={showPreviews:w.showPreviews,isEditable:!1,getRawHtmlValue:()=>o.getAttribute("value")||""},c={sanitizeHtml:w.sanitizeHtml,textareaPlaceholder:i("Paste raw HTML here..."),onEditClick(){p.makeEditable()},onSaveClick(u){p.save(u)},onCancelClick(){p.cancel()}};const d=l.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":i("HTML snippet"),dir:e.locale.uiLanguageDirection},r);return l.setCustomProperty("rawHtmlApi",p,d),l.setCustomProperty("rawHtml",!0,d),S(d,l,{label:i("HTML snippet"),hasSelectionHandle:!0})}});function g({editor:o,domElement:l,state:s,props:n}){l.textContent="";const c=l.ownerDocument;let r;if(s.isEditable){const d={isDisabled:!1,placeholder:n.textareaPlaceholder};r=E({domDocument:c,state:s,props:d}),l.append(r)}else if(s.showPreviews){const d={sanitizeHtml:n.sanitizeHtml};l.append(x({domDocument:c,state:s,props:d,editor:o}))}else{const d={isDisabled:!0,placeholder:n.textareaPlaceholder};l.append(E({domDocument:c,state:s,props:d}))}const p={onEditClick:n.onEditClick,onSaveClick:()=>{n.onSaveClick(r.value)},onCancelClick:n.onCancelClick};l.prepend(k({editor:o,domDocument:c,state:s,props:p}))}function k({editor:o,domDocument:l,state:s,props:n}){const c=b(l,"div",{class:"raw-html-embed__buttons-wrapper"});if(s.isEditable){const r=v(o,"save",n.onSaveClick),p=v(o,"cancel",n.onCancelClick);c.append(r.element,p.element),t.add(r).add(p)}else{const r=v(o,"edit",n.onEditClick);c.append(r.element),t.add(r)}return c}function E({domDocument:o,state:l,props:s}){const n=b(o,"textarea",{placeholder:s.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return n.disabled=s.isDisabled,n.value=l.getRawHtmlValue(),n}function x({editor:o,domDocument:l,state:s,props:n}){const c=n.sanitizeHtml(s.getRawHtmlValue()),r=s.getRawHtmlValue().length>0?i("No preview available"):i("Empty snippet content"),p=b(l,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},r),d=b(l,"div",{class:"raw-html-embed__preview-content",dir:o.locale.contentLanguageDirection}),h=l.createRange().createContextualFragment(c.html);return d.appendChild(h),b(l,"div",{class:"raw-html-embed__preview"},[p,d])}}}function v(m,e,i){const{t:a}=m.locale,t=new P(m.locale),w=m.commands.get("htmlEmbed");return t.set({class:`raw-html-embed__${e}-button`,icon:C,tooltip:!0,tooltipPosition:m.locale.uiLanguageDirection==="rtl"?"e":"w"}),t.render(),e==="edit"?(t.set({icon:C,label:a("Edit source")}),t.bind("isEnabled").to(w)):e==="save"?(t.set({icon:D,label:a("Save changes")}),t.bind("isEnabled").to(w)):t.set({icon:M,label:a("Cancel")}),t.on("execute",i),t}class F extends f{static get pluginName(){return"HtmlEmbedUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,a=e.locale.t;e.ui.componentFactory.add("htmlEmbed",()=>{const t=this._createButton(P);return t.set({tooltip:!0,label:a("Insert HTML")}),t}),e.ui.componentFactory.add("menuBar:htmlEmbed",()=>{const t=this._createButton(T);return t.set({label:a("HTML snippet")}),t})}_createButton(e){const i=this.editor,a=i.commands.get("htmlEmbed"),t=new e(i.locale);return t.set({icon:L}),t.bind("isEnabled").to(a,"isEnabled"),this.listenTo(t,"execute",()=>{i.execute("htmlEmbed"),i.editing.view.focus(),i.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()}),t}}class G extends f{static get requires(){return[z,F,V]}static get pluginName(){return"HtmlEmbed"}static get isOfficialPlugin(){return!0}}export{G as HtmlEmbed,y as HtmlEmbedCommand,z as HtmlEmbedEditing,F as HtmlEmbedUI};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{Plugin as f}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{logWarning as X,global as R,uid as x,priorities as C,CKEditorError as Q,toArray as k,isValidAttributeName as Y}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{UpcastWriter as B,HtmlDataProcessor as J,Matcher as M,StylesMap as Z}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Widget as ee,toWidget as K}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{Enter as te}from"../../../../../@ckeditor_ckeditor5-enter@46.1.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{isEqual as N}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/predicate/isEqual.js";import{mergeWith as re}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/mergeWith.js";import{startCase as ie}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/string/startCase.js";import{isPlainObject as oe}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js";import{cloneDeep as le}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeep.js";function p(s,e,t,i){e&&ne(s,e,i),t&&w(s,t,i)}function w(s,e,t){if(e.attributes)for(const[i,r]of Object.entries(e.attributes))s.setAttribute(i,r,t);e.styles&&s.setStyle(e.styles,t),e.classes&&s.addClass(e.classes,t)}function ne(s,e,t){if(e.attributes)for(const[i]of Object.entries(e.attributes))s.removeAttribute(i,t);if(e.styles)for(const i of Object.keys(e.styles))s.removeStyle(i,t);e.classes&&s.removeClass(e.classes,t)}function se(s,e){const t=le(s);let i="attributes";for(i in e)i=="classes"?t[i]=Array.from(new Set([...s[i]||[],...e[i]])):t[i]={...s[i],...e[i]};return t}function v(s,e,t,i,r){const o=e.getAttribute(t),l={};for(const n of["attributes","styles","classes"]){if(n!=i){o&&o[n]&&(l[n]=o[n]);continue}if(i=="classes"){const a=new Set(o&&o.classes||[]);r(a),a.size&&(l[n]=Array.from(a));continue}const m=new Map(Object.entries(o&&o[n]||{}));r(m),m.size&&(l[n]=Object.fromEntries(m))}Object.keys(l).length?e.is("documentSelection")?s.setSelectionAttribute(t,l):s.setAttribute(t,l,e):o&&(e.is("documentSelection")?s.removeSelectionAttribute(t):s.removeAttribute(t,e))}function me(s,e,t){for(const i of e.getItems({shallow:!0})){const r=i.getAttribute(s);r&&r.attributes&&Object.keys(r.attributes).length?Object.keys(r).length>1&&t.setAttribute(s,{attributes:r.attributes},i):t.removeAttribute(s,i)}}function ae(s){return ie(s).replace(/ /g,"")}function b(s){return`html${ae(s)}Attributes`}function V({model:s}){return(e,t)=>t.writer.createElement(s,{htmlContent:e.getCustomProperty("$rawContent")})}function ue(s,{view:e,isInline:t}){const i=s.t;return(r,{writer:o})=>{const l=i("HTML object"),n=P(e,r,o),m=r.getAttribute(b(e));o.addClass("html-object-embed__content",n),m&&w(o,m,n);const a=o.createContainerElement(t?"span":"div",{class:"html-object-embed","data-html-object-embed-label":l},n);return K(a,o,{label:l})}}function P(s,e,t){return t.createRawElement(s,null,(i,r)=>{r.setContentOf(i,e.getAttribute("htmlContent"))})}function ce({view:s,model:e,allowEmpty:t},i){return o=>{o.on(`element:${s}`,(l,n,m)=>{let a=i.processViewAttributes(n.viewItem,m);if(!(!a&&!m.consumable.test(n.viewItem,{name:!0}))){if(a=a||{},m.consumable.consume(n.viewItem,{name:!0}),n.modelRange||(n=Object.assign(n,m.convertChildren(n.viewItem,n.modelCursor))),t&&n.modelRange.isCollapsed&&Object.keys(a).length){const u=m.writer.createElement("htmlEmptyElement");if(!m.safeInsert(u,n.modelCursor))return;const c=m.getSplitParts(u);n.modelRange=m.writer.createRange(n.modelRange.start,m.writer.createPositionAfter(c[c.length-1])),m.updateConversionResult(u,n),r(u,a,m);return}for(const u of n.modelRange.getItems())r(u,a,m)}},{priority:"low"})};function r(o,l,n){if(n.schema.checkAttribute(o,e)){const m=o.getAttribute(e),a=se(l,m||{});n.writer.setAttribute(e,a,o)}}}function j({model:s,view:e},t){return(i,{writer:r,consumable:o})=>{if(!i.hasAttribute(s))return null;const l=r.createContainerElement(e),n=i.getAttribute(s);return o.consume(i,`attribute:${s}`),w(r,n,l),l.getFillerOffset=()=>null,t?K(l,r):l}}function de({priority:s,view:e}){return(t,i)=>{if(!t)return;const{writer:r}=i,o=r.createAttributeElement(e,null,{priority:s});return w(r,t,o),o}}function E({view:s},e){return t=>{t.on(`element:${s}`,(i,r,o)=>{if(!r.modelRange||r.modelRange.isCollapsed)return;const l=e.processViewAttributes(r.viewItem,o);l&&o.writer.setAttribute(b(r.viewItem.name),l,r.modelRange)},{priority:"low"})}}function F({view:s,model:e}){return t=>{t.on(`attribute:${b(s)}:${e}`,(i,r,o)=>{if(!o.consumable.consume(r.item,i.name))return;const{attributeOldValue:l,attributeNewValue:n}=r,m=o.writer,a=o.mapper.toViewElement(r.item);p(m,l,n,a)})}}const L={block:[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"horizontalLine",view:"hr"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlHr",view:"hr",isEmpty:!0,modelSchema:{inheritAllFrom:"$blockObject"}}],inline:[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref",attributeProperties:{isFormatting:!0}},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}]};class S extends f{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const e of L.block)this.registerBlockElement(e);for(const e of L.inline)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push({...e,isBlock:!0})}registerInlineElement(e){this._definitions.push({...e,isInline:!0})}extendBlockElement(e){this._extendDefinition({...e,isBlock:!0})}extendInlineElement(e){this._extendDefinition({...e,isInline:!0})}getDefinitionsForView(e,t=!1){const i=new Set;for(const r of this._getMatchingViewDefinitions(e)){if(t)for(const o of this._getReferences(r.model))i.add(o);i.add(r)}return i}getDefinitionsForModel(e){return this._definitions.filter(t=>t.model==e)}_getMatchingViewDefinitions(e){return this._definitions.filter(t=>t.view&&he(e,t.view))}*_getReferences(e){const t=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],i=this._definitions.filter(r=>r.model==e);for(const{modelSchema:r}of i)if(r)for(const o of t)for(const l of k(r[o]||[])){const n=this._definitions.filter(m=>m.model==l);for(const m of n)l!==e&&(yield*this._getReferences(m.model),yield m)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter(([,i])=>i.model==e.model);if(t.length==0){this._definitions.push(e);return}for(const[i,r]of t)this._definitions[i]=re({},r,e,(o,l)=>Array.isArray(o)?o.concat(l):void 0)}}function he(s,e){return typeof s=="string"?s===e:s instanceof RegExp?s.test(e):!1}class h extends f{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(e){super(e),this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new M,this._disallowedAttributes=new M,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[S,ee]}loadAllowedConfig(e){for(const t of e){const i=t.name||/[\s\S]+/,r=U(t);this.allowElement(i),r.forEach(o=>this.allowAttributes(o))}}loadDisallowedConfig(e){for(const t of e){const i=t.name||/[\s\S]+/,r=U(t);r.length==0?this.disallowElement(i):r.forEach(o=>this.disallowAttributes(o))}}loadAllowedEmptyElementsConfig(e){for(const t of e)this.allowEmptyElement(t)}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowEmptyElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))t.isInline&&this._dataSchema.extendInlineElement({...t,allowEmpty:!0})}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){const{consumable:i}=t;return W(e,this._disallowedAttributes,i),fe(e,W(e,this._allowedAttributes,i))}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&typeof e.appliesToBlock=="string")for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",()=>{this._fireRegisterEvent(e)},{priority:C.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)},{priority:C.highest+1})}_registerElementHandlers(){this.on("register",(e,t)=>{const i=this.editor.model.schema;if(t.isObject&&!i.isRegistered(t.model))this._registerObjectElement(t);else if(t.isBlock)this._registerBlockElement(t);else if(t.isInline)this._registerInlineElement(t);else throw new Q("data-filter-invalid-definition",null,t);e.stop()},{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const e=this.editor.model,t=e.document.selection;e.document.registerPostFixer(i=>{const r=e.document.differ.getChanges();let o=!1;const l=this._getCoupledAttributesMap();for(const n of r){if(n.type!="attribute"||n.attributeNewValue!==null)continue;const m=l.get(n.attributeKey);if(m)for(const{item:a}of n.range.getWalker())for(const u of m)a.hasAttribute(u)&&(i.removeAttribute(u,a),o=!0)}return o}),this.listenTo(t,"change:attribute",(i,{attributeKeys:r})=>{const o=new Set,l=this._getCoupledAttributesMap();for(const n of r){if(t.hasAttribute(n))continue;const m=l.get(n);if(m)for(const a of m)t.hasAttribute(a)&&o.add(a)}o.size!=0&&e.change(n=>{for(const m of o)n.removeSelectionAttribute(m)})})}_registerAssociatedHtmlAttributesPostFixer(){const e=this.editor.model;e.document.registerPostFixer(t=>{const i=e.document.differ.getChanges();let r=!1;for(const o of i)if(!(o.type!=="insert"||o.name==="$text"))for(const l of o.attributes.keys())!l.startsWith("html")||!l.endsWith("Attributes")||e.schema.checkAttribute(o.name,l)||(t.removeAttribute(l,o.position.nodeAfter),r=!0);return r})}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const t=this.editor,i=t.model.schema,r=t.conversion,{view:o,model:l}=e;i.register(l,e.modelSchema);o&&(i.extend(e.model,{allowAttributes:[b(o),"htmlContent"]}),t.data.registerRawContentMatcher({name:o}),r.for("upcast").elementToElement({view:o,model:V(e),converterPriority:C.low+2}),r.for("upcast").add(E(e,this)),r.for("editingDowncast").elementToStructure({model:{name:l,attributes:[b(o)]},view:ue(t,e)}),r.for("dataDowncast").elementToElement({model:l,view:(n,{writer:m})=>P(o,n,m)}),r.for("dataDowncast").add(F(e)))}_registerBlockElement(e){const t=this.editor,i=t.model.schema,r=t.conversion,{view:o,model:l}=e;if(!i.isRegistered(e.model)){if(!e.modelSchema||(i.register(e.model,e.modelSchema),!o))return;r.for("upcast").elementToElement({model:l,view:o,converterPriority:C.low+2}),r.for("downcast").elementToElement({model:l,view:(n,{writer:m})=>e.isEmpty?m.createEmptyElement(o):m.createContainerElement(o)})}o&&(i.extend(e.model,{allowAttributes:b(o)}),r.for("upcast").add(E(e,this)),r.for("downcast").add(F(e)))}_registerInlineElement(e){const t=this.editor,i=t.model.schema,r=t.conversion,o=e.model;if(!e.appliesToBlock&&(i.extend("$text",{allowAttributes:o}),e.attributeProperties&&i.setAttributeProperties(o,e.attributeProperties),r.for("upcast").add(ce(e,this)),r.for("downcast").attributeToElement({model:o,view:de(e)}),!!e.allowEmpty)){if(i.setAttributeProperties(o,{copyFromObject:!1}),!i.isRegistered("htmlEmptyElement")){i.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"});const l=n=>Array.from(n.getAttributeKeys()).some(m=>m.startsWith("html"));t.model.document.registerPostFixer(n=>{const m=t.model.document.differ.getChanges(),a=new Set;for(const u of m)if(u.type!=="remove"){if(u.type==="attribute"&&u.attributeNewValue===null)for(const{item:c}of u.range)c.is("element","htmlEmptyElement")&&!l(c)&&a.add(c);if(u.type==="insert"&&u.position.nodeAfter){const c=u.position.nodeAfter;for(const{item:d}of n.createRangeOn(c))d.is("element","htmlEmptyElement")&&!l(d)&&a.add(d)}}for(const u of a)n.remove(u);return a.size>0})}t.data.htmlProcessor.domConverter.registerInlineObjectMatcher(l=>l.name==e.view&&l.isEmpty&&Array.from(l.getAttributeKeys()).length?{name:!0}:null),r.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:j(e,!0)}),r.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:j(e)})}}}function W(s,e,t){const i=e.matchAll(s)||[],r=s.document.stylesProcessor;return i.reduce((o,{match:l})=>{for(const[n,m]of l.attributes||[])if(n=="style"){const a=m,u=r.getRelatedStyles(a).filter(c=>c.split("-").length>a.split("-").length).sort((c,d)=>d.split("-").length-c.split("-").length);for(const c of u)t.consume(s,{styles:[c]})&&o.styles.push(c);t.consume(s,{styles:[a]})&&o.styles.push(a)}else if(n=="class"){const a=m;t.consume(s,{classes:[a]})&&o.classes.push(a)}else t.consume(s,{attributes:[n]})&&o.attributes.push(n);return o},{attributes:[],classes:[],styles:[]})}function fe(s,{attributes:e,classes:t,styles:i}){return!e.length&&!t.length&&!i.length?null:{...e.length&&{attributes:ge(s,e)},...i.length&&{styles:be(s,i)},...t.length&&{classes:t}}}function ge(s,e){const t={};for(const i of e){const r=s.getAttribute(i);r!==void 0&&Y(i)&&(t[i]=r)}return t}function be(s,e){const t=new Z(s.document.stylesProcessor);for(const i of e){const r=s.getStyle(i);r!==void 0&&t.set(i,r)}return Object.fromEntries(t.getStylesEntries())}function D(s,e){const{name:t}=s,i=s[e];return oe(i)?Object.entries(i).map(([r,o])=>({name:t,[e]:{[r]:o}})):Array.isArray(i)?i.map(r=>({name:t,[e]:[r]})):[s]}function U(s){const{name:e,attributes:t,classes:i,styles:r}=s,o=[];return t&&o.push(...D({name:e,attributes:t},"attributes")),i&&o.push(...D({name:e,classes:i},"classes")),r&&o.push(...D({name:e,styles:r},"styles")),o}class pe extends f{static get requires(){return[h]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(h);e.on("register:pre",(t,i)=>{if(i.model!=="codeBlock")return;const r=this.editor,o=r.model.schema,l=r.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),l.for("upcast").add(we(e)),l.for("downcast").add(Ae()),t.stop()})}}function we(s){return e=>{e.on("element:code",(t,i,r)=>{const o=i.viewItem,l=o.parent;if(!l||!l.is("element","pre"))return;n(l,"htmlPreAttributes"),n(o,"htmlContentAttributes");function n(m,a){const u=s.processViewAttributes(m,r);u&&r.writer.setAttribute(a,u,i.modelRange)}},{priority:"low"})}}function Ae(){return s=>{s.on("attribute:htmlPreAttributes:codeBlock",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,n=i.mapper.toViewElement(t.item).parent;p(i.writer,r,o,n)}),s.on("attribute:htmlContentAttributes:codeBlock",(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,l=i.mapper.toViewElement(t.item);p(i.writer,r,o,l)})}}class ve extends f{static get requires(){return[h]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(h).on("register",(t,i)=>{const r=i,o=this.editor,l=o.model.schema,n=o.conversion;if(!r.paragraphLikeModel||l.isRegistered(r.model)||l.isRegistered(r.paragraphLikeModel))return;const m={model:r.paragraphLikeModel,view:r.view};l.register(r.model,r.modelSchema),l.register(m.model,{inheritAllFrom:"$block"}),n.for("upcast").elementToElement({view:r.view,model:(a,{writer:u})=>this._hasBlockContent(a)?u.createElement(r.model):u.createElement(m.model),converterPriority:C.low+.5}),n.for("downcast").elementToElement({view:r.view,model:r.model}),this._addAttributeConversion(r),n.for("downcast").elementToElement({view:m.view,model:m.model}),this._addAttributeConversion(m),t.stop()})}_hasBlockContent(e){const t=this.editor.editing.view,i=t.domConverter.blockElements;for(const r of t.createRangeIn(e).getItems())if(r.is("element")&&i.includes(r.name))return!0;return!1}_addAttributeConversion(e){const t=this.editor,i=t.conversion,r=t.plugins.get(h);t.model.schema.extend(e.model,{allowAttributes:b(e.view)}),i.for("upcast").add(E(e,r)),i.for("downcast").add(F(e))}}class ye extends f{static get requires(){return[S,te]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const t=e.config.get("heading.options");this.registerHeadingElements(e,t)}registerHeadingElements(e,t){const i=e.plugins.get(S),r=[];for(const o of t)"model"in o&&"view"in o&&(i.registerBlockElement({view:o.view,model:o.model}),r.push(o.model));i.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:r}}),i.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:r}})}}function O(s,e,t){const i=s.createRangeOn(e);for(const{item:r}of i.getWalker())if(r.is("element",t))return r}class Ee extends f{static get requires(){return[h]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(h);r.on("register:figure",()=>{i.for("upcast").add(ke(r))}),r.on("register:img",(o,l)=>{l.model!=="imageBlock"&&l.model!=="imageInline"||(t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),i.for("upcast").add(Se(r)),i.for("downcast").add(Fe()),e.plugins.has("LinkImage")&&i.for("upcast").add(Ce(r,e)),o.stop())})}}function Se(s){return e=>{e.on("element:img",(t,i,r)=>{if(!i.modelRange)return;const o=i.viewItem,l=s.processViewAttributes(o,r);l&&r.writer.setAttribute("htmlImgAttributes",l,i.modelRange)},{priority:"low"})}}function Ce(s,e){const t=e.plugins.get("ImageUtils");return i=>{i.on("element:a",(r,o,l)=>{const n=o.viewItem;if(!t.findViewImgElement(n))return;const a=o.modelCursor.parent;if(!a.is("element","imageBlock"))return;const u=s.processViewAttributes(n,l);u&&l.writer.setAttribute("htmlLinkAttributes",u,a)},{priority:"low"})}}function ke(s){return e=>{e.on("element:figure",(t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("image"))return;const l=s.processViewAttributes(o,r);l&&r.writer.setAttribute("htmlFigureAttributes",l,i.modelRange)},{priority:"low"})}}function Fe(){return s=>{e("htmlImgAttributes"),t("img","htmlImgAttributes"),t("figure","htmlFigureAttributes"),t("a","htmlLinkAttributes");function e(i){s.on(`attribute:${i}:imageInline`,(r,o,l)=>{if(!l.consumable.consume(o.item,r.name))return;const{attributeOldValue:n,attributeNewValue:m}=o,a=l.mapper.toViewElement(o.item);p(l.writer,n,m,a)},{priority:"low"})}function t(i,r){s.on(`attribute:${r}:imageBlock`,(o,l,n)=>{if(!n.consumable.test(l.item,o.name))return;const{attributeOldValue:m,attributeNewValue:a}=l,u=n.mapper.toViewElement(l.item),c=O(n.writer,u,i);c&&(p(n.writer,m,a,c),n.consumable.consume(l.item,o.name))},{priority:"low"}),i==="a"&&s.on("attribute:linkHref:imageBlock",(o,l,n)=>{if(!n.consumable.consume(l.item,"attribute:htmlLinkAttributes:imageBlock"))return;const m=n.mapper.toViewElement(l.item),a=O(n.writer,m,"a");w(n.writer,l.item.getAttribute("htmlLinkAttributes"),a)},{priority:"low"})}}}class Oe extends f{static get requires(){return[h]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const t=e.model.schema,i=e.conversion,r=this.editor.plugins.get(h),o=this.editor.plugins.get(S),l=e.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:l}),r.on("register:figure",()=>{i.for("upcast").add(Pe(r))}),r.on(`register:${l}`,(n,m)=>{m.model==="media"&&(t.extend("media",{allowAttributes:[b(l),"htmlFigureAttributes"]}),i.for("upcast").add(Te(r,l)),i.for("dataDowncast").add(Ie(l)),n.stop())})}}function Te(s,e){const t=(i,r,o)=>{const l=r.viewItem;n(l,b(e));function n(m,a){const u=s.processViewAttributes(m,o);u&&o.writer.setAttribute(a,u,r.modelRange)}};return i=>{i.on(`element:${e}`,t,{priority:"low"})}}function Pe(s){return e=>{e.on("element:figure",(t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("media"))return;const l=s.processViewAttributes(o,r);l&&r.writer.setAttribute("htmlFigureAttributes",l,i.modelRange)},{priority:"low"})}}function Ie(s){return e=>{t(s,b(s)),t("figure","htmlFigureAttributes");function t(i,r){e.on(`attribute:${r}:media`,(o,l,n)=>{if(!n.consumable.consume(l.item,o.name))return;const{attributeOldValue:m,attributeNewValue:a}=l,u=n.mapper.toViewElement(l.item),c=O(n.writer,u,i);p(n.writer,m,a,c)})}}}class $e extends f{static get requires(){return[h]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(h);e.on("register:script",(t,i)=>{const r=this.editor,o=r.model.schema,l=r.conversion;o.register("htmlScript",i.modelSchema),o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"script"}),l.for("upcast").elementToElement({view:"script",model:V(i)}),l.for("upcast").add(E(i,e)),l.for("downcast").elementToElement({model:"htmlScript",view:(n,{writer:m})=>P("script",n,m)}),l.for("downcast").add(F(i)),t.stop()})}}const _e=["width","max-width","min-width","height","min-height","max-height"];class De extends f{static get requires(){return[h]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(h),o=e.plugins.get("TableUtils");r.on("register:figure",()=>{i.for("upcast").add(Ve(r))}),r.on("register:table",(l,n)=>{n.model==="table"&&(t.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),i.for("upcast").add(Be(r)),i.for("downcast").add(Re()),e.model.document.registerPostFixer(He(e.model,o)),l.stop())})}}function He(s,e){return t=>{const i=s.document.differ.getChanges();let r=!1;for(const o of i){if(o.type!="attribute"||o.attributeKey!="headingRows")continue;const l=o.range.start.nodeAfter,n=l.getAttribute("htmlTheadAttributes"),m=l.getAttribute("htmlTbodyAttributes");n&&!o.attributeNewValue?(t.removeAttribute("htmlTheadAttributes",l),r=!0):m&&o.attributeNewValue==e.getRows(l)&&(t.removeAttribute("htmlTbodyAttributes",l),r=!0)}return r}}function Be(s){return e=>{e.on("element:table",(t,i,r)=>{if(!i.modelRange)return;const o=i.viewItem;l(o,"htmlTableAttributes");for(const n of o.getChildren())n.is("element","thead")&&l(n,"htmlTheadAttributes"),n.is("element","tbody")&&l(n,"htmlTbodyAttributes");function l(n,m){const a=s.processViewAttributes(n,r);a&&r.writer.setAttribute(m,a,i.modelRange)}},{priority:"low"})}}function Ve(s){return e=>{e.on("element:figure",(t,i,r)=>{const o=i.viewItem;if(!i.modelRange||!o.hasClass("table"))return;const l=s.processViewAttributes(o,r);l&&r.writer.setAttribute("htmlFigureAttributes",l,i.modelRange)},{priority:"low"})}}function Re(){return s=>{e("table","htmlTableAttributes"),e("figure","htmlFigureAttributes"),e("thead","htmlTheadAttributes"),e("tbody","htmlTbodyAttributes");function e(t,i){s.on(`attribute:${i}:table`,(r,o,l)=>{if(!l.consumable.test(o.item,r.name))return;const n=l.mapper.toViewElement(o.item),m=O(l.writer,n,t);if(m)if(l.consumable.consume(o.item,r.name),i==="htmlTableAttributes"&&n!==m){const a=q(o.attributeOldValue),u=q(o.attributeNewValue);p(l.writer,a.tableAttributes,u.tableAttributes,m),p(l.writer,a.figureAttributes,u.figureAttributes,n)}else p(l.writer,o.attributeOldValue,o.attributeNewValue,m)})}}}function q(s){const e={},t={...s};if(!s||!("styles"in s))return{figureAttributes:e,tableAttributes:t};t.styles={};for(const[i,r]of Object.entries(s.styles))_e.includes(i)?e.styles={...e.styles,[i]:r}:t.styles={...t.styles,[i]:r};return{figureAttributes:e,tableAttributes:t}}class xe extends f{static get requires(){return[h]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(h);e.on("register:style",(t,i)=>{const r=this.editor,o=r.model.schema,l=r.conversion;o.register("htmlStyle",i.modelSchema),o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),r.data.registerRawContentMatcher({name:"style"}),l.for("upcast").elementToElement({view:"style",model:V(i)}),l.for("upcast").add(E(i,e)),l.for("downcast").elementToElement({model:"htmlStyle",view:(n,{writer:m})=>P("style",n,m)}),l.for("downcast").add(F(i)),t.stop()})}}class Me extends f{static get requires(){return[h]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ListEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(h),o=e.plugins.get("ListEditing"),l=e.plugins.get("ListUtils"),n=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:w}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:w}),o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:w}),r.on("register",(m,a)=>{if(!n.includes(a.view)||(m.stop(),t.checkAttribute("$block","htmlLiAttributes")))return;const u=n.map(c=>b(c));t.extend("$listItem",{allowAttributes:u}),i.for("upcast").add(c=>{c.on("element:ul",H("htmlUlAttributes",r),{priority:"low"}),c.on("element:ol",H("htmlOlAttributes",r),{priority:"low"}),c.on("element:li",H("htmlLiAttributes",r),{priority:"low"})})}),o.on("postFixer",(m,{listNodes:a,writer:u})=>{for(const{node:c,previousNodeInList:d}of a)if(d){if(d.getAttribute("listType")==c.getAttribute("listType")){const g=z(d.getAttribute("listType")),A=d.getAttribute(g);!N(c.getAttribute(g),A)&&u.model.schema.checkAttribute(c,g)&&(u.setAttribute(g,A,c),m.return=!0)}if(d.getAttribute("listItemId")==c.getAttribute("listItemId")){const g=d.getAttribute("htmlLiAttributes");!N(c.getAttribute("htmlLiAttributes"),g)&&u.model.schema.checkAttribute(c,"htmlLiAttributes")&&(u.setAttribute("htmlLiAttributes",g,c),m.return=!0)}}}),o.on("postFixer",(m,{listNodes:a,writer:u})=>{for(const{node:c}of a){const d=c.getAttribute("listType");!l.isNumberedListType(d)&&c.getAttribute("htmlOlAttributes")&&(u.removeAttribute("htmlOlAttributes",c),m.return=!0),l.isNumberedListType(d)&&c.getAttribute("htmlUlAttributes")&&(u.removeAttribute("htmlUlAttributes",c),m.return=!0)}})}afterInit(){const e=this.editor;if(!e.commands.get("indentList"))return;const t=e.commands.get("indentList");this.listenTo(t,"afterExecute",(i,r)=>{e.model.change(o=>{for(const l of r){const n=z(l.getAttribute("listType"));e.model.schema.checkAttribute(l,n)&&o.setAttribute(n,{},l)}})})}}function H(s,e){return(t,i,r)=>{const o=i.viewItem;i.modelRange||Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor));const l=e.processViewAttributes(o,r);for(const n of i.modelRange.getItems({shallow:!0}))n.hasAttribute("listItemId")&&(n.hasAttribute("htmlUlAttributes")||n.hasAttribute("htmlOlAttributes")||r.writer.model.schema.checkAttribute(n,s)&&r.writer.setAttribute(s,l||{},n))}}function z(s){return s==="numbered"||s=="customNumbered"?"htmlOlAttributes":"htmlUlAttributes"}class Ne extends f{static get requires(){return[h]}static get pluginName(){return"HorizontalLineElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HorizontalLineEditing"))return;const t=e.model.schema,i=e.conversion,r=e.plugins.get(h);r.on("register:hr",(o,l)=>{l.model==="horizontalLine"&&(t.extend("horizontalLine",{allowAttributes:["htmlHrAttributes"]}),i.for("upcast").add(E(l,r)),i.for("downcast").add(je()),o.stop())})}}function je(){return s=>{s.on("attribute:htmlHrAttributes:horizontalLine",(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const{attributeOldValue:r,attributeNewValue:o}=t,l=i.mapper.toViewElement(t.item),n=O(i.writer,l,"hr");n&&(p(i.writer,r,o,n),i.consumable.consume(t.item,e.name))},{priority:"low"})}}class Le extends f{static get requires(){return[h,S]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(h),t=this.editor.plugins.get(S);e.on("register:$customElement",(i,r)=>{i.stop();const o=this.editor,l=o.model.schema,n=o.conversion,m=o.editing.view.domConverter.unsafeElements,a=o.data.htmlProcessor.domConverter.preElements;l.register(r.model,r.modelSchema),l.extend(r.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),o.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),n.for("upcast").elementToElement({view:/.*/,model:(u,c)=>{if(u.name=="$comment"||!We(u.name)||t.getDefinitionsForView(u.name).size)return null;m.includes(u.name)||m.push(u.name),a.includes(u.name)||a.push(u.name);const d=c.writer.createElement(r.model,{htmlElementName:u.name}),g=e.processViewAttributes(u,c);g&&c.writer.setAttribute("htmlCustomElementAttributes",g,d);let A;if(u.is("element","template")&&u.getCustomProperty("$rawContent"))A=u.getCustomProperty("$rawContent");else{const I=new B(u.document).createDocumentFragment(u),$=o.data.htmlProcessor.domConverter.viewToDom(I),_=$.firstChild;for(;_.firstChild;)$.appendChild(_.firstChild);_.remove(),A=o.data.htmlProcessor.htmlWriter.getHtml($)}c.writer.setAttribute("htmlContent",A,d);for(const{item:T}of o.editing.view.createRangeIn(u))c.consumable.consume(T,{name:!0});return d},converterPriority:"low"}),n.for("editingDowncast").elementToElement({model:{name:r.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(u,{writer:c})=>{const d=u.getAttribute("htmlElementName"),g=c.createRawElement(d);return u.hasAttribute("htmlCustomElementAttributes")&&w(c,u.getAttribute("htmlCustomElementAttributes"),g),g}}),n.for("dataDowncast").elementToElement({model:{name:r.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(u,{writer:c})=>{const d=u.getAttribute("htmlElementName"),g=u.getAttribute("htmlContent"),A=c.createRawElement(d,null,(T,I)=>{I.setContentOf(T,g)});return u.hasAttribute("htmlCustomElementAttributes")&&w(c,u.getAttribute("htmlCustomElementAttributes"),A),A}})})}}function We(s){try{document.createElement(s)}catch{return!1}return!0}class rt extends f{static get pluginName(){return"GeneralHtmlSupport"}static get isOfficialPlugin(){return!0}static get requires(){return[h,pe,ve,ye,Ee,Oe,$e,De,xe,Me,Ne,Le]}init(){const e=this.editor,t=e.plugins.get(h);t.loadAllowedEmptyElementsConfig(e.config.get("htmlSupport.allowEmpty")||[]),t.loadAllowedConfig(e.config.get("htmlSupport.allow")||[]),t.loadDisallowedConfig(e.config.get("htmlSupport.disallow")||[])}afterInit(){this.editor.commands.get("removeFormat")?.registerCustomAttribute(t=>t.startsWith("html")&&t.endsWith("Attributes"),me)}getGhsAttributeNameForElement(e){const t=this.editor.plugins.get("DataSchema"),i=Array.from(t.getDefinitionsForView(e,!1)),r=i.find(o=>o.isInline&&!i[0].isObject);return r?r.model:b(e)}addModelHtmlClass(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change(l=>{for(const n of y(r,i,o))v(l,n,o,"classes",m=>{for(const a of k(t))m.add(a)})})}removeModelHtmlClass(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change(l=>{for(const n of y(r,i,o))v(l,n,o,"classes",m=>{for(const a of k(t))m.delete(a)})})}setModelHtmlAttributes(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change(l=>{for(const n of y(r,i,o))v(l,n,o,"attributes",m=>{for(const[a,u]of Object.entries(t))m.set(a,u)})})}removeModelHtmlAttributes(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change(l=>{for(const n of y(r,i,o))v(l,n,o,"attributes",m=>{for(const a of k(t))m.delete(a)})})}setModelHtmlStyles(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change(l=>{for(const n of y(r,i,o))v(l,n,o,"styles",m=>{for(const[a,u]of Object.entries(t))m.set(a,u)})})}removeModelHtmlStyles(e,t,i){const r=this.editor.model,o=this.getGhsAttributeNameForElement(e);r.change(l=>{for(const n of y(r,i,o))v(l,n,o,"styles",m=>{for(const a of k(t))m.delete(a)})})}}function*y(s,e,t){if(e)if(!(Symbol.iterator in e)&&e.is("documentSelection")&&e.isCollapsed)s.schema.checkAttributeInSelection(e,t)&&(yield e);else for(const i of Ue(s,e,t))yield*i.getItems({shallow:!0})}function Ue(s,e,t){return!(Symbol.iterator in e)&&(e.is("node")||e.is("$text")||e.is("$textProxy"))?s.schema.checkAttribute(e,t)?[s.createRangeOn(e)]:[]:s.schema.getValidRanges(s.createSelection(e).getRanges(),t)}class it extends f{static get pluginName(){return"HtmlComment"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=new Map;e.data.processor.skipComments=!1,e.model.schema.addAttributeCheck((i,r)=>{if(i.endsWith("$root")&&r.startsWith("$comment"))return!0}),e.conversion.for("upcast").elementToMarker({view:"$comment",model:i=>{const o=`$comment:${x()}`,l=i.getCustomProperty("$rawContent");return t.set(o,l),o}}),e.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(i,{writer:r})=>{let o;for(const a of this.editor.model.document.getRootNames())if(o=this.editor.model.document.getRoot(a),o.hasAttribute(i.markerName))break;const l=i.markerName,n=o.getAttribute(l),m=r.createUIElement("$comment");return r.setCustomProperty("$rawContent",n,m),m}}),e.model.document.registerPostFixer(i=>{let r=!1;const o=e.model.document.differ.getChangedMarkers().filter(l=>l.name.startsWith("$comment:"));for(const l of o){const{oldRange:n,newRange:m}=l.data;if(!(n&&m&&n.root==m.root)){if(n){const a=n.root;a.hasAttribute(l.name)&&(i.removeAttribute(l.name,a),r=!0)}if(m){const a=m.root;a.rootName=="$graveyard"?(i.removeMarker(l.name),r=!0):a.hasAttribute(l.name)||(i.setAttribute(l.name,t.get(l.name)||"",a),r=!0)}}}return r}),e.data.on("set",()=>{for(const i of e.model.markers.getMarkersGroup("$comment"))this.removeHtmlComment(i.name)},{priority:"high"}),e.model.on("deleteContent",(i,[r])=>{for(const o of r.getRanges()){const l=e.model.schema.getLimitElement(o),n=e.model.createPositionAt(l,0),m=e.model.createPositionAt(l,"end");let a;n.isTouching(o.start)&&m.isTouching(o.end)?a=this.getHtmlCommentsInRange(e.model.createRange(n,m)):a=this.getHtmlCommentsInRange(o,{skipBoundaries:!0});for(const u of a)this.removeHtmlComment(u)}},{priority:"high"})}createHtmlComment(e,t){const i=x(),o=this.editor.model,l=o.document.getRoot(e.root.rootName),n=`$comment:${i}`;return o.change(m=>{const a=m.createRange(e);return m.addMarker(n,{usingOperation:!0,affectsData:!0,range:a}),m.setAttribute(n,t,l),n})}removeHtmlComment(e){const t=this.editor,i=t.model.markers.get(e);return i?(t.model.change(r=>{r.removeMarker(i)}),!0):!1}getHtmlCommentData(e){const i=this.editor.model.markers.get(e);if(!i)return null;let r="";for(const o of this.editor.model.document.getRoots())if(o.hasAttribute(e)){r=o.getAttribute(e);break}return{content:r,position:i.getStart()}}getHtmlCommentsInRange(e,{skipBoundaries:t=!1}={}){const i=!t;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter(o=>r(o,e)).map(o=>o.name);function r(o,l){const n=o.getRange().start;return(n.isAfter(l.start)||i&&n.isEqual(l.start))&&(n.isBefore(l.end)||i&&n.isEqual(l.end))}}}class qe extends J{toView(e){if(!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4)))return super.toView(e);let t="",i="";e=e.trim().replace(/<\?xml\s[^?]*\?>/i,m=>(i=m,"")),e=e.trim().replace(/^<!DOCTYPE\s[^>]*?>/i,m=>(t=m,""));const r=this._toDom(e),o=this.domConverter.domToView(r,{skipComments:this.skipComments}),l=new B(o.document);l.setCustomProperty("$fullPageDocument",r.ownerDocument.documentElement.outerHTML,o);const n=Array.from(r.ownerDocument.querySelectorAll("head style"));return l.setCustomProperty("$fullPageHeadStyles",n,o),t&&l.setCustomProperty("$fullPageDocType",t,o),i&&l.setCustomProperty("$fullPageXmlDeclaration",i,o),o}toData(e){let t=super.toData(e);const i=e.getCustomProperty("$fullPageDocument"),r=e.getCustomProperty("$fullPageDocType"),o=e.getCustomProperty("$fullPageXmlDeclaration");return i&&(t=i.replace(/<\/body\s*>/,t+"$&"),r&&(t=r+`
|
|
2
|
-
`+t),o&&(t=o+`
|
|
3
|
-
`+t)),t}}class ot extends f{static get pluginName(){return"FullPage"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("htmlSupport.fullPage",{allowRenderStylesFromHead:!1,sanitizeCss:t=>(X("css-full-page-provide-sanitize-function"),{css:t,hasChanged:!1})}),e.data.processor=new qe(e.data.viewDocument)}init(){const e=this.editor,t=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration","$fullPageHeadStyles"];e.model.schema.extend("$root",{allowAttributes:t}),e.data.on("toModel",(i,[r])=>{const o=e.model.document.getRoot();e.model.change(l=>{for(const n of t){const m=r.getCustomProperty(n);m&&l.setAttribute(n,m,o)}}),G(e)&&this._renderStylesFromHead(o)},{priority:"low"}),e.data.on("toView",(i,[r])=>{if(!r.is("rootElement"))return;const o=r,l=i.return;if(!o.hasAttribute("$fullPageDocument"))return;const n=new B(l.document);for(const m of t){const a=o.getAttribute(m);a&&n.setCustomProperty(m,a,l)}},{priority:"low"}),e.data.on("set",()=>{const i=e.model.document.getRoot();e.model.change(r=>{for(const o of t)i.hasAttribute(o)&&r.removeAttribute(o,i)})},{priority:"high"}),e.data.on("get",(i,r)=>{r[0]||(r[0]={}),r[0].trim=!1},{priority:"high"})}destroy(){super.destroy(),G(this.editor)&&this._removeStyleElementsFromDom()}_removeStyleElementsFromDom(){const e=Array.from(R.document.querySelectorAll(`[data-full-page-style-id="${this.editor.id}"]`));for(const t of e)t.remove()}_renderStyleElementsInDom(e){const t=this.editor,i=e.getAttribute("$fullPageHeadStyles");if(!i)return;const r=t.config.get("htmlSupport.fullPage.sanitizeCss");for(const o of i){o.setAttribute("data-full-page-style-id",t.id);const l=r(o.innerText);l.hasChanged&&(o.innerText=l.css),R.document.head.append(o)}}_renderStylesFromHead(e){this._removeStyleElementsFromDom(),this._renderStyleElementsInDom(e)}}function G(s){return s.config.get("htmlSupport.fullPage.allowRenderStylesFromHead")}export{pe as CodeBlockElementSupport,Le as CustomElementSupport,h as DataFilter,S as DataSchema,ve as DualContentModelElementSupport,ot as FullPage,rt as GeneralHtmlSupport,ye as HeadingElementSupport,Ne as HorizontalLineElementSupport,it as HtmlComment,qe as HtmlPageDataProcessor,Ee as ImageElementSupport,Me as ListElementSupport,Oe as MediaEmbedElementSupport,$e as ScriptElementSupport,xe as StyleElementSupport,De as TableElementSupport,L as _HTML_SUPPORT_SCHEMA_DEFINITIONS,de as _attributeToInlineHtmlSupportConverter,P as _createObjectHtmlSupportView,j as _emptyInlineModelElementToViewHtmlSupportConverter,b as _getHtmlSupportAttributeName,O as _getHtmlSupportDescendantElement,se as _mergeHtmlSupportViewElementAttributes,F as _modelToViewBlockAttributeHtmlSupportConverter,v as _modifyHtmlSupportGhsAttribute,ne as _removeHtmlSupportViewAttributes,w as _setHtmlSupportViewAttributes,ae as _toHtmlSupportPascalCase,ue as _toObjectWidgetHtmlSupportConverter,p as _updateHtmlSupportViewAttributes,ce as _viewToAttributeInlineHtmlSupportConverter,E as _viewToModelBlockAttributeHtmlSupportConverter,V as _viewToModelObjectContentHtmlSupportConverter};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Plugin as f,Command as v}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Clipboard as Xe,ClipboardPipeline as q}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{ModelLivePosition as P,ModelLiveRange as Ye,UpcastWriter as $,enableViewPlaceholder as Qe,ModelElement as et,Observer as tt}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Undo as it}from"../../../../../@ckeditor_ckeditor5-undo@46.1.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js";import{Delete as nt}from"../../../../../@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{global as V,DomEmitterMixin as st,logWarning as _,CKEditorError as ot,Collection as at,env as rt,first as H,FocusTracker as G,KeystrokeHandler as z,Rect as lt,toArray as he}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Widget as fe,WidgetToolbarRepository as ie,toWidget as ct,isWidget as mt,toWidgetEditable as ut,WidgetResize as N,calculateResizeHostAncestorWidth as pe,findOptimalInsertionRange as gt}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{SplitButtonView as Ie,createDropdown as K,MenuBarMenuView as dt,MenuBarMenuListView as ht,MenuBarMenuListItemView as ft,ButtonView as b,Dialog as pt,MenuBarMenuListItemButtonView as It,ContextualBalloon as be,CssTransitionDisablerMixin as we,clickOutsideHandler as _e,UIModel as ne,addToolbarToDropdown as bt,Notification as se,FileDialogButtonView as oe,MenuBarMenuListItemFileDialogButtonView as wt,View as R,ViewCollection as J,FocusCycler as Z,CollapsibleView as _t,submitHandler as O,LabeledFieldView as X,createLabeledInputText as ve,BalloonPanelView as vt,DropdownButtonView as yt,addListToDropdown as Et,FormRowView as ye,FormHeaderView as Ee,createLabeledInputNumber as Ct}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconImage as kt,IconCaption as St,IconImageUrl as Ut,IconObjectSizeFull as Vt,IconObjectSizeCustom as Bt,IconObjectSizeLarge as At,IconObjectSizeMedium as Tt,IconObjectSizeSmall as xt,IconTextAlternative as zt,IconImageUpload as Rt,IconObjectInline as Ce,IconObjectInlineRight as M,IconObjectInlineLeft as ke,IconObjectCenter as W,IconObjectRight as Se,IconObjectLeft as Ue,IconObjectFullWidth as Ot,IconPreviousArrow as Ve}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{FileRepository as y}from"../../../../../@ckeditor_ckeditor5-upload@46.1.1/node_modules/@ckeditor/ckeditor5-upload/dist/index.js";import{isObject as Be}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isObject.js";import{identity as C}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/identity.js";function Pt(o){return o.createContainerElement("span",{class:"image-inline"},o.createEmptyElement("img"))}function ae(o){return o.createContainerElement("figure",{class:"image"},[o.createEmptyElement("img"),o.createSlot("children")])}function Ae(o,e){const t=o.plugins.get("ImageUtils"),i=o.plugins.has("ImageInlineEditing")&&o.plugins.has("ImageBlockEditing");return a=>t.isInlineImageView(a)?i&&(a.getStyle("display")=="block"||a.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:n(a):null;function n(a){const s={name:!0};return a.hasAttribute("src")&&(s.attributes=["src"]),s}}function Y(o,e){const t=H(e.getSelectedBlocks());return!t||o.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}function B(o){return o&&o.endsWith("px")?parseInt(o):null}function A(o){const e=B(o.getStyle("width")),t=B(o.getStyle("height"));return!!(e&&t)}const Nt=/^(image|image-inline)$/;class I extends f{_domEmitter=new(st());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,n={}){const a=this.editor,s=a.model,r=s.document.selection,l=Te(a,t||r,i);e={...Object.fromEntries(r.getAttributes()),...e};for(const c in e)s.schema.checkAttribute(l,c)||delete e[c];return s.change(c=>{const{setImageSizes:m=!0}=n,u=c.createElement(l,e);return s.insertObject(u,t,null,{setSelection:"on",findOptimalPosition:!t&&l!="imageInline"?"auto":void 0}),u.parent?(m&&this.setImageNaturalSizeAttributes(u),u):null})}setImageNaturalSizeAttributes(e){const t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change(i=>{const n=new V.window.Image;this._domEmitter.listenTo(n,"load",()=>{!e.getAttribute("width")&&!e.getAttribute("height")&&this.editor.model.enqueueChange(i.batch,a=>{a.setAttribute("width",n.naturalWidth,e),a.setAttribute("height",n.naturalHeight,e)}),this._domEmitter.stopListening(n,"load")}),n.src=t}))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let n=t.parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:Nt})}isImageAllowed(){const t=this.editor.model.document.selection;return Ft(this.editor,t)&&Lt(t)}toImageWidget(e,t,i){return t.setCustomProperty("image",!0,e),ct(e,t,{label:()=>{const s=this.findViewImgElement(e).getAttribute("alt");return s?`${s} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&mt(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;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function Ft(o,e){if(Te(o,e,null)=="imageBlock"){const i=Dt(e,o.model);if(o.model.schema.checkChild(i,"imageBlock"))return!0}else if(o.model.schema.checkChild(e.focus,"imageInline"))return!0;return!1}function Lt(o){return[...o.focus.getAncestors()].every(e=>!e.is("element","imageBlock"))}function Dt(o,e){const i=gt(o,e).start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}function Te(o,e,t){const i=o.model.schema,n=o.config.get("image.insert.type");return o.plugins.has("ImageBlockEditing")?o.plugins.has("ImageInlineEditing")?t||(n==="inline"?"imageInline":n!=="auto"?"imageBlock":e.is("selection")?Y(i,e):i.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const Mt=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));class sn extends f{static get requires(){return[Xe,I,it,nt]}static get pluginName(){return"AutoImage"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document,i=e.plugins.get("ClipboardPipeline");this.listenTo(i,"inputTransformation",()=>{const n=t.selection.getFirstRange(),a=P.fromPosition(n.start);a.stickiness="toPrevious";const s=P.fromPosition(n.end);s.stickiness="toNext",t.once("change:data",()=>{this._embedImageBetweenPositions(a,s),a.detach(),s.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(V.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedImageBetweenPositions(e,t){const i=this.editor,n=new Ye(e,t),a=n.getWalker({ignoreElementEnd:!0}),s=Object.fromEntries(i.model.document.selection.getAttributes()),r=this.editor.plugins.get("ImageUtils");let l="";for(const c of a)c.item.is("$textProxy")&&(l+=c.item.data);if(l=l.trim(),!l.match(Mt)){n.detach();return}this._positionToInsert=P.fromPosition(e),this._timeoutId=setTimeout(()=>{if(!i.commands.get("insertImage").isEnabled){n.detach();return}i.model.change(u=>{this._timeoutId=null,u.remove(n),n.detach();let g;this._positionToInsert.root.rootName!=="$graveyard"&&(g=this._positionToInsert.toPosition()),r.insertImage({...s,src:l},g),this._positionToInsert.detach(),this._positionToInsert=null}),i.plugins.get("Delete").requestUndoOnBackspace()},100)}}class Wt extends v{refresh(){const i=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!i,this.isEnabled&&i.hasAttribute("alt")?this.value=i.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n=t.model,a=i.getClosestSelectedImageElement(n.document.selection);n.change(s=>{s.setAttribute("alt",e.newValue,a)})}}class jt extends f{static get requires(){return[I]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new Wt(this.editor))}}class qt extends R{focusTracker;keystrokes;labeledInput;backButtonView;saveButtonView;children;_focusables;_focusCycler;constructor(e){super(e),this.focusTracker=new G,this.keystrokes=new z,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new ye(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new J,this.keystrokes.set("Esc",(t,i)=>{this.fire("cancel"),i()}),this._focusCycler=new Z({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(),O({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,t=new b(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:Ve,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new b(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new Ee(this.locale,{label:e("Text Alternative")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){const e=this.locale.t,t=new X(this.locale,ve);return t.label=e("Text alternative"),t.class="ck-labeled-field-view_full-width",t}}function $t(o){const e=o.plugins.get("ContextualBalloon");if(o.plugins.get("ImageUtils").getClosestSelectedImageWidget(o.editing.view.document.selection)){const i=Q(o);e.updatePosition(i)}}function Q(o){const e=o.editing.view,t=vt.defaultPositions,i=o.plugins.get("ImageUtils");return{target:e.domConverter.mapViewToDom(i.getClosestSelectedImageWidget(e.document.selection)),positions:[t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast,t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast,t.viewportStickyNorth]}}class Ht extends f{_balloon;_form;static get requires(){return[be]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",i=>{const n=e.commands.get("imageTextAlternative"),a=new b(i);return a.set({label:t("Change image text alternative"),icon:zt,tooltip:!0}),a.bind("isEnabled").to(n,"isEnabled"),a.bind("isOn").to(n,"value",s=>!!s),this.listenTo(a,"execute",()=>{this._showForm()}),a})}_createForm(){const e=this.editor,i=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(we(qt))(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",()=>{n.getClosestSelectedImageWidget(i.selection)?this._isVisible&&$t(e):this._hideForm(!0)}),_e({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Q(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)}}class xe extends f{static get requires(){return[jt,Ht]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function Gt(o){const e=(t,i,n)=>{if(!n.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const a=o.findViewImgElement(i.viewItem);if(!a||!n.consumable.test(a,{name:!0}))return;n.consumable.consume(i.viewItem,{name:!0,classes:"image"});const s=n.convertItem(a,i.modelCursor),r=H(s.modelRange.getItems());if(!r){n.consumable.revert(i.viewItem,{name:!0,classes:"image"});return}n.convertChildren(i.viewItem,r),n.updateConversionResult(r,i)};return t=>{t.on("element:figure",e)}}function ze(o,e){const t=(i,n,a)=>{if(!a.consumable.consume(n.item,i.name))return;const s=a.writer,r=a.mapper.toViewElement(n.item),l=o.findViewImgElement(r);n.attributeNewValue===null?(s.removeAttribute("srcset",l),s.removeAttribute("sizes",l)):n.attributeNewValue&&(s.setAttribute("srcset",n.attributeNewValue,l),s.setAttribute("sizes","100vw",l))};return i=>{i.on(`attribute:srcset:${e}`,t)}}function T(o,e,t){const i=(n,a,s)=>{if(!s.consumable.consume(a.item,n.name))return;const r=s.writer,l=s.mapper.toViewElement(a.item),c=o.findViewImgElement(l);r.setAttribute(a.attributeKey,a.attributeNewValue||"",c)};return n=>{n.on(`attribute:${t}:${e}`,i)}}class ee extends tt{observe(e){this.listenTo(e,"load",(t,i)=>{const n=i.target;this.checkShouldIgnoreEventFromTarget(n)||n.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))}}class Kt extends v{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&_("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&_("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=he(e.source),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),a=Object.fromEntries(i.getAttributes());t.forEach((s,r)=>{const l=i.getSelectedElement();if(typeof s=="string"&&(s={src:s}),r&&l&&n.isImage(l)){const c=this.editor.model.createPositionAfter(l);n.insertImage({...s,...a},c,e.imageType)}else e.breakBlock?n.insertImage({...s,...a},i.getFirstPosition(),e.imageType):n.insertImage({...s,...a},null,e.imageType)})}}class Jt extends v{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const t=this.editor.plugins.get("ImageUtils"),i=this.editor.model.document.selection.getSelectedElement();this.isEnabled=t.isImage(i),this.value=this.isEnabled?i.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change(n=>{n.setAttribute("src",e.source,t),this.cleanupImage(n,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)}}class Re extends f{static get requires(){return[I]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(ee),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new Kt(e),n=new Jt(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",n),e.commands.add("imageInsert",i)}}class Oe extends f{static get requires(){return[I]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){const 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){const t=this.editor,i=t.plugins.get("ImageUtils"),n=e==="imageBlock"?"figure":"img";t.conversion.for("upcast").attributeToAttribute({view:{name:n,styles:{width:/.+/}},model:{key:"width",value:s=>A(s)?B(s.getStyle("width")):null}}).attributeToAttribute({view:{name:n,key:"width"},model:"width"}).attributeToAttribute({view:{name:n,styles:{height:/.+/}},model:{key:"height",value:s=>A(s)?B(s.getStyle("height")):null}}).attributeToAttribute({view:{name:n,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add(s=>{a(s,"width","width",!0,!0),a(s,"height","height",!0,!0)}),t.conversion.for("dataDowncast").add(s=>{a(s,"width","width",!1),a(s,"height","height",!1)}),t.conversion.for("upcast").add(s=>{s.on("element:img",(r,l,c)=>{const m=l.viewItem.getAttribute("width"),u=l.viewItem.getAttribute("height");m&&u&&c.consumable.consume(l.viewItem,{styles:["aspect-ratio"]})})});function a(s,r,l,c,m=!1){s.on(`attribute:${r}:${e}`,(u,g,d)=>{if(!d.consumable.consume(g.item,u.name))return;const h=d.writer,p=d.mapper.toViewElement(g.item),w=i.findViewImgElement(p);g.attributeNewValue!==null?h.setAttribute(l,g.attributeNewValue,w):h.removeAttribute(l,w);const E=g.item.getAttribute("width"),U=g.item.getAttribute("height"),te=E&&U;if(te&&m&&h.setAttribute("loading","lazy",w),g.item.hasAttribute("sources"))return;const Ze=g.item.hasAttribute("resizedWidth");e==="imageInline"&&!Ze&&!c||te&&h.setStyle("aspect-ratio",`${E}/${U}`,w)})}}}class Pe extends v{_modelElementName;constructor(e,t){super(e),this._modelElementName=t}refresh(){const t=this.editor.plugins.get("ImageUtils"),i=t.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=t.isInlineImage(i):this.isEnabled=t.isBlockImage(i)}execute(e={}){const t=this.editor,i=this.editor.model,n=t.plugins.get("ImageUtils"),a=n.getClosestSelectedImageElement(i.document.selection),s=Object.fromEntries(a.getAttributes());return!s.src&&!s.uploadId?null:i.change(r=>{const{setImageSizes:l=!0}=e,c=Array.from(i.markers).filter(g=>g.getRange().containsItem(a)),m=n.insertImage(s,i.createSelection(a,"on"),this._modelElementName,{setImageSizes:l});if(!m)return null;const u=r.createRangeOn(m);for(const g of c){const d=g.getRange(),h=d.root.rootName!="$graveyard"?d.getJoined(u,!0):u;r.updateMarker(g,{range:h})}return{oldElement:a,newElement:m}})}}class Ne extends f{static get requires(){return[I]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add(n=>{n.on("attribute:placeholder",(a,s,r)=>{if(!r.consumable.test(s.item,a.name)||!s.item.is("element","imageBlock")&&!s.item.is("element","imageInline"))return;r.consumable.consume(s.item,a.name);const l=r.writer,c=r.mapper.toViewElement(s.item),m=i.findViewImgElement(c);s.attributeNewValue?(l.addClass("image_placeholder",m),l.setStyle("background-image",`url(${s.attributeNewValue})`,m),l.setCustomProperty("editingPipeline:doNotReuseOnce",!0,m)):(l.removeClass("image_placeholder",m),l.removeStyle("background-image",m))})})}_setupLoadListener(){const e=this.editor,t=e.model,i=e.editing,n=i.view,a=e.plugins.get("ImageUtils");n.addObserver(ee),this.listenTo(n.document,"imageLoaded",(s,r)=>{const l=n.domConverter.mapDomToView(r.target);if(!l)return;const c=a.getImageWidgetFromImageView(l);if(!c)return;const m=i.mapper.toModelElement(c);!m||!m.hasAttribute("placeholder")||t.enqueueChange({isUndoable:!1},u=>{u.removeAttribute("placeholder",m)})})}}class Fe extends f{static get requires(){return[Re,Oe,I,Ne,q]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const 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 Pe(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(a,{writer:s})=>ae(s)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(a,{writer:s})=>n.toImageWidget(ae(s),s,t("image widget"))}),i.for("downcast").add(T(n,"imageBlock","src")).add(T(n,"imageBlock","alt")).add(ze(n,"imageBlock")),i.for("upcast").elementToElement({view:Ae(e,"imageBlock"),model:(a,{writer:s})=>s.createElement("imageBlock",a.hasAttribute("src")?{src:a.getAttribute("src")}:void 0)}).add(Gt(n))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils"),a=e.plugins.get("ClipboardPipeline");this.listenTo(a,"inputTransformation",(s,r)=>{const l=Array.from(r.content.getChildren());let c;if(!l.every(n.isInlineImageView))return;r.targetRanges?c=e.editing.mapper.toModelRange(r.targetRanges[0]):c=t.document.selection.getFirstRange();const m=t.createSelection(c);if(Y(t.schema,m)==="imageBlock"){const u=new $(i.document),g=l.map(d=>u.createElement("figure",{class:"image"},d));r.content=u.createDocumentFragment(g)}}),this.listenTo(a,"contentInsertion",(s,r)=>{r.method==="paste"&&t.change(l=>{const c=l.createRangeIn(r.content);for(const m of c.getItems())m.is("element","imageBlock")&&n.setImageNaturalSizeAttributes(m)})})}}class Zt extends R{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,t=[]){super(e),this.focusTracker=new G,this.keystrokes=new z,this._focusables=new J,this.children=this.createCollection(),this._focusCycler=new Z({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const i of t)this.children.add(i),this._focusables.add(i),i instanceof _t&&this._focusables.addMany(i.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),O({view:this});for(const t of this._focusables)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element);const 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()}}class S extends f{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const 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())});const n=s=>this._createToolbarComponent(s),a=s=>this._createMenuBarComponent(s);e.ui.componentFactory.add("insertImage",n),e.ui.componentFactory.add("imageInsert",n),e.ui.componentFactory.add("menuBar:insertImage",a)}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:n,menuBarButtonViewCreator:a,requiresForm:s=!1,override:r=!1}){this._integrations.has(e)&&!r&&_("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:a,formViewCreator:n,requiresForm:s})}_createToolbarComponent(e){const t=this.editor,i=e.t,n=this._prepareIntegrations();if(!n.length)return null;let a;const s=n[0];if(n.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);a=s.buttonViewCreator(!0)}else{const c=s.buttonViewCreator(!1);a=new Ie(e,c),a.tooltip=!0,a.bind("label").to(this,"isImageSelected",m=>i(m?"Replace image":"Insert image"))}const r=this.dropdownView=K(e,a),l=n.map(({observable:c})=>typeof c=="function"?c():c);return r.bind("isEnabled").toMany(l,"isEnabled",(...c)=>c.some(m=>m)),r.once("change:isOpen",()=>{const c=n.flatMap(({formViewCreator:u})=>u(n.length==1)),m=new Zt(t.locale,c);r.panelView.children.add(m)}),r}_createMenuBarComponent(e){const t=e.t,i=this._prepareIntegrations();if(!i.length)return null;const n=i.flatMap(({menuBarButtonViewCreator:r})=>r(i.length==1)),a=new dt(e),s=new ht(e);a.panelView.children.add(s),a.buttonView.set({icon:kt,label:t("Image")});for(const r of n){const l=new ft(e,a);l.children.add(r),s.items.add(l),r.delegate("execute").to(a)}return a}_prepareIntegrations(){const t=this.editor.config.get("image.insert.integrations"),i=[];if(!t.length)return _("image-insert-integrations-not-specified"),i;for(const n of t){if(!this._integrations.has(n)){["upload","assetManager","url"].includes(n)||_("image-insert-unknown-integration",{item:n});continue}i.push(this._integrations.get(n))}return i.length||_("image-insert-integrations-not-registered"),i}}class on extends f{static get requires(){return[Fe,fe,xe,S]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class Xt extends f{static get requires(){return[Re,Oe,I,Ne,q]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const 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 Pe(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(a,{writer:s})=>s.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(a,{writer:s})=>n.toImageWidget(Pt(s),s,t("image widget"))}),i.for("downcast").add(T(n,"imageInline","src")).add(T(n,"imageInline","alt")).add(ze(n,"imageInline")),i.for("upcast").elementToElement({view:Ae(e,"imageInline"),model:(a,{writer:s})=>s.createElement("imageInline",a.hasAttribute("src")?{src:a.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils"),a=e.plugins.get("ClipboardPipeline");this.listenTo(a,"inputTransformation",(s,r)=>{const l=Array.from(r.content.getChildren());let c;if(!l.every(n.isBlockImageView))return;r.targetRanges?c=e.editing.mapper.toModelRange(r.targetRanges[0]):c=t.document.selection.getFirstRange();const m=t.createSelection(c);if(Y(t.schema,m)==="imageInline"){const u=new $(i.document),g=l.map(d=>d.childCount===1?(Array.from(d.getAttributes()).forEach(h=>u.setAttribute(...h,n.findViewImgElement(d))),d.getChild(0)):d);r.content=u.createDocumentFragment(g)}}),this.listenTo(a,"contentInsertion",(s,r)=>{r.method==="paste"&&t.change(l=>{const c=l.createRangeIn(r.content);for(const m of c.getItems())m.is("element","imageInline")&&n.setImageNaturalSizeAttributes(m)})})}}class an extends f{static get requires(){return[Xt,fe,xe,S]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class Le extends f{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return e.name=="figcaption"&&t.isBlockImageView(e.parent)?{name:!0}:null}}class Yt extends v{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(Fe)){this.isEnabled=!1,this.value=!1;return}const n=e.model.document.selection,a=n.getSelectedElement();if(!a){const s=t.getCaptionFromModelSelection(n);this.isEnabled=!!s,this.value=!!s;return}this.isEnabled=i.isImage(a),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(a):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change(i=>{this.value?this._hideImageCaption(i):this._showImageCaption(i,t)})}_showImageCaption(e,t){const n=this.editor.model.document.selection,a=this.editor.plugins.get("ImageCaptionEditing"),s=this.editor.plugins.get("ImageUtils");let r=n.getSelectedElement();const l=a._getSavedCaption(r);s.isInlineImage(r)&&(this.editor.execute("imageTypeBlock"),r=n.getSelectedElement());const c=l||e.createElement("caption");e.append(c,r),t&&e.setSelection(c,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,n=t.plugins.get("ImageCaptionEditing"),a=t.plugins.get("ImageCaptionUtils");let s=i.getSelectedElement(),r;s?r=a.getCaptionFromImageModelElement(s):(r=a.getCaptionFromModelSelection(i),s=r.parent),n._saveCaption(s,r),e.setSelection(s,"on"),e.remove(r)}}class Qt extends f{static get requires(){return[I,Le]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const 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 Yt(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),a=e.t;e.conversion.for("upcast").elementToElement({view:s=>n.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;const l=r.createEditableElement("figcaption");r.setCustomProperty("imageCaption",!0,l),l.placeholder=a("Enter image caption"),Qe({view:t,element:l,keepOnFocus:!0});const c=s.parent.getAttribute("alt"),m=c?a("Caption for image: %0",[c]):a("Caption for the image");return ut(l,r,{label:m})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),n=e.commands.get("imageTypeInline"),a=e.commands.get("imageTypeBlock"),s=r=>{if(!r.return)return;const{oldElement:l,newElement:c}=r.return;if(!l)return;if(t.isBlockImage(l)){const u=i.getCaptionFromImageModelElement(l);if(u){this._saveCaption(c,u);return}}const m=this._getSavedCaption(l);m&&this._saveCaption(c,m)};n&&this.listenTo(n,"execute",s,{priority:"low"}),a&&this.listenTo(a,"execute",s,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?et.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",()=>{const a=t.document.differ.getChanges();for(const s of a){if(s.attributeKey!=="alt")continue;const r=s.range.start.nodeAfter;if(i.isBlockImage(r)){const l=n.getCaptionFromImageModelElement(r);if(!l)return;e.editing.reconvertItem(l)}}})}}class ei extends f{static get requires(){return[Le]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),n=e.t;e.ui.componentFactory.add("toggleImageCaption",a=>{const s=e.commands.get("toggleImageCaption"),r=new b(a);return r.set({icon:St,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.bind("label").to(s,"value",l=>n(l?"Toggle caption off":"Toggle caption on")),this.listenTo(r,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const l=i.getCaptionFromModelSelection(e.model.document.selection);if(l){const c=e.editing.mapper.toViewElement(l);t.scrollToTheSelection(),t.change(m=>{m.addClass("image__caption_highlighted",c)})}e.editing.view.focus()}),r})}}class rn extends f{static get requires(){return[Qt,ei]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}}function De(o){const e=o.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function ti(o){return new Promise((e,t)=>{const i=o.getAttribute("src");fetch(i).then(n=>n.blob()).then(n=>{const a=Me(n,i),r=`image.${a.replace("image/","")}`,l=new File([n],r,{type:a});e(l)}).catch(n=>n&&n.name==="TypeError"?ni(i).then(e).catch(t):t(n))})}function ii(o,e){return!o.isInlineImageView(e)||!e.getAttribute("src")?!1:!!e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||!!e.getAttribute("src").match(/^blob:/g)}function Me(o,e){return o.type?o.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}function ni(o){return si(o).then(e=>{const t=Me(e,o),n=`image.${t.replace("image/","")}`;return new File([e],n,{type:t})})}function si(o){return new Promise((e,t)=>{const i=V.document.createElement("img");i.addEventListener("load",()=>{const n=V.document.createElement("canvas");n.width=i.width,n.height=i.height,n.getContext("2d").drawImage(i,0,0),n.toBlob(s=>s?e(s):t())}),i.addEventListener("error",()=>t()),i.src=o})}class oi extends f{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const 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){const t=this.editor,i=t.locale,n=t.commands.get("uploadImage"),a=t.config.get("image.upload.types"),s=De(a),r=new e(t.locale),l=i.t;return r.set({acceptedType:a.map(c=>`image/${c}`).join(","),allowMultipleFiles:!0,label:l("Upload from computer"),icon:Rt}),r.bind("isEnabled").to(n),r.on("done",(c,m)=>{const u=Array.from(m).filter(g=>s.test(g.type));u.length&&(t.execute("uploadImage",{file:u}),t.editing.view.focus())}),r}_createToolbarButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),n=this._createButton(oe);return n.tooltip=!0,n.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",(a,s)=>e(s?a?"Replace image from computer":"Upload image from computer":"You have no image upload permissions.")),n}_createDropdownButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(oe);return i.withText=!0,i.bind("label").to(t,"isImageSelected",n=>e(n?"Replace from computer":"Upload from computer")),i.on("execute",()=>{t.dropdownView.isOpen=!1}),i}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createButton(wt);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");break}return i}}class ai extends f{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const 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)=>{const n=this.editor,a=t.item,s=a.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const r=n.plugins.get("ImageUtils"),l=n.plugins.get(y),c=s?t.attributeNewValue:null,m=this.placeholder,u=n.editing.mapper.toViewElement(a),g=i.writer;if(c=="reading"){re(u,g),le(r,m,u,g);return}if(c=="uploading"){const d=l.loaders.get(s);re(u,g),d?(ce(u,g),li(u,g,d,n.editing.view),di(r,u,g,d)):le(r,m,u,g);return}c=="complete"&&l.loaders.get(s)&&mi(u,g,n.editing.view),ci(u,g),ce(u,g),ri(u,g)}}function re(o,e){o.hasClass("ck-appear")||e.addClass("ck-appear",o)}function ri(o,e){e.removeClass("ck-appear",o)}function le(o,e,t,i){t.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",t);const n=o.findViewImgElement(t);n.getAttribute("src")!==e&&i.setAttribute("src",e,n),We(t,"placeholder")||i.insert(i.createPositionAfter(n),gi(i))}function ce(o,e){o.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",o),je(o,e,"placeholder")}function li(o,e,t,i){const n=ui(e);e.insert(e.createPositionAt(o,"end"),n),t.on("change:uploadedPercent",(a,s,r)=>{i.change(l=>{l.setStyle("width",r+"%",n)})})}function ci(o,e){je(o,e,"progressBar")}function mi(o,e,t){const i=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(o,"end"),i),setTimeout(()=>{t.change(n=>n.remove(n.createRangeOn(i)))},3e3)}function ui(o){const e=o.createUIElement("div",{class:"ck-progress-bar"});return o.setCustomProperty("progressBar",!0,e),e}function gi(o){const e=o.createUIElement("div",{class:"ck-upload-placeholder-loader"});return o.setCustomProperty("placeholder",!0,e),e}function We(o,e){for(const t of o.getChildren())if(t.getCustomProperty(e))return t}function je(o,e,t){const i=We(o,t);i&&e.remove(e.createRangeOn(i))}function di(o,e,t,i){if(i.data){const n=o.findViewImgElement(e);t.setAttribute("src",i.data,n)}}class hi extends v{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=he(e.file),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),a=Object.fromEntries(i.getAttributes());t.forEach((s,r)=>{const l=i.getSelectedElement();if(r&&l&&n.isImage(l)){const c=this.editor.model.createPositionAfter(l);this._uploadImage(s,a,c)}else this._uploadImage(s,a)})}_uploadImage(e,t,i){const n=this.editor,s=n.plugins.get(y).createLoader(e),r=n.plugins.get("ImageUtils");s&&r.insertImage({...t,uploadId:s.id},i)}}class fi extends f{static get requires(){return[y,se,q,I]}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(){const e=this.editor,t=e.model.document,i=e.conversion,n=e.plugins.get(y),a=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),r=De(e.config.get("image.upload.types")),l=new hi(e);e.commands.add("uploadImage",l),e.commands.add("imageUpload",l),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add(c=>c.on("element:img",(m,u,g)=>{if(!g.consumable.test(u.viewItem,{attributes:["data-ck-upload-id"]}))return;const d=u.viewItem.getAttribute("data-ck-upload-id");if(!d)return;const[h]=Array.from(u.modelRange.getItems({shallow:!0})),p=n.loaders.get(d);h&&(g.writer.setAttribute("uploadId",d,h),g.consumable.consume(u.viewItem,{attributes:["data-ck-upload-id"]}),p&&p.data&&g.writer.setAttribute("uploadStatus",p.status,h))},{priority:"low"})),this.listenTo(e.editing.view.document,"clipboardInput",(c,m)=>{if(pi(m.dataTransfer))return;const u=Array.from(m.dataTransfer.files).filter(d=>d?r.test(d.type):!1);if(!u.length)return;if(c.stop(),e.model.change(d=>{m.targetRanges&&d.setSelection(m.targetRanges.map(h=>e.editing.mapper.toModelRange(h))),e.execute("uploadImage",{file:u})}),!e.commands.get("uploadImage").isAccessAllowed){const d=e.plugins.get("Notification"),h=e.locale.t;d.showWarning(h("You have no image upload permissions."),{namespace:"image"})}}),this.listenTo(s,"inputTransformation",(c,m)=>{const u=Array.from(e.editing.view.createRangeIn(m.content)).map(d=>d.item).filter(d=>ii(a,d)&&!d.getAttribute("uploadProcessed")).map(d=>({promise:ti(d),imageElement:d}));if(!u.length)return;const g=new $(e.editing.view.document);for(const d of u){g.setAttribute("uploadProcessed",!0,d.imageElement);const h=n.createLoader(d.promise);h&&(g.setAttribute("src","",d.imageElement),g.setAttribute("uploadId",h.id,d.imageElement))}}),e.editing.view.document.on("dragover",(c,m)=>{m.preventDefault()}),t.on("change",()=>{const c=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),m=new Set;for(const u of c)if(u.type=="insert"&&u.name!="$text"){const g=u.position.nodeAfter,d=u.position.root.rootName=="$graveyard";for(const h of Ii(e,g)){const p=h.getAttribute("uploadId");if(!p)continue;const w=n.loaders.get(p);if(!w){!d&&this._uploadedImages.has(p)&&e.model.enqueueChange({isUndoable:!1},E=>{E.setAttribute("uploadStatus","complete",h),this.fire("uploadComplete",{data:this._uploadedImages.get(p),imageElement:h})});continue}d?m.has(p)||Array.from(this._uploadImageElements.get(p)).every(U=>U.root.rootName=="$graveyard")&&w.abort():(m.add(p),this._uploadImageElements.has(p)?this._uploadImageElements.get(p).add(h):this._uploadImageElements.set(p,new Set([h])),w.status=="idle"&&this._readAndUpload(w))}}}),this.on("uploadComplete",(c,{imageElement:m,data:u})=>{const g=u.urls?u.urls:u;this.editor.model.change(d=>{d.setAttribute("src",g.default,m),this._parseAndSetSrcsetAttributeOnImage(g,m,d),a.setImageNaturalSizeAttributes(m)})},{priority:"low"})}afterInit(){const 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){const t=this.editor,i=t.model,n=t.locale.t,a=t.plugins.get(y),s=t.plugins.get(se),r=t.plugins.get("ImageUtils"),l=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},m=>{const u=l.get(e.id);for(const g of u)m.setAttribute("uploadStatus","reading",g)}),e.read().then(()=>{const m=e.upload();t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Uploading image"));for(const u of l.get(e.id)){if(rt.isSafari){const g=t.editing.mapper.toViewElement(u),d=r.findViewImgElement(g);t.editing.view.once("render",()=>{if(!d.parent)return;const h=t.editing.view.domConverter.mapViewToDom(d.parent);if(!h)return;const p=h.style.display;h.style.display="none",h._ckHack=h.offsetHeight,h.style.display=p})}i.enqueueChange({isUndoable:!1},g=>{g.setAttribute("uploadStatus","uploading",u)})}return m}).then(m=>{i.enqueueChange({isUndoable:!1},u=>{for(const g of l.get(e.id))u.setAttribute("uploadStatus","complete",g),this.fire("uploadComplete",{data:m,imageElement:g});t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Image upload complete")),this._uploadedImages.set(e.id,m)}),c()}).catch(m=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Error during image upload")),e.status!=="error"&&e.status!=="aborted")throw m;e.status=="error"&&m&&s.showWarning(m,{title:n("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},u=>{for(const g of l.get(e.id))g.root.rootName!=="$graveyard"&&u.remove(g)}),c()});function c(){i.enqueueChange({isUndoable:!1},m=>{for(const u of l.get(e.id))m.removeAttribute("uploadId",u),m.removeAttribute("uploadStatus",u);l.delete(e.id)}),a.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const a=Object.keys(e).filter(s=>{const r=parseInt(s,10);if(!isNaN(r))return n=Math.max(n,r),!0}).map(s=>`${e[s]} ${s}w`).join(", ");if(a!=""){const s={srcset:a};!t.hasAttribute("width")&&!t.hasAttribute("height")&&(s.width=n),i.setAttributes(s,t)}}_registerConverters(e){const{conversion:t,plugins:i}=this.editor,n=i.get(y),a=i.get(I);t.for("dataDowncast").add(s=>{s.on(`attribute:uploadId:${e}`,(r,l,c)=>{if(!c.consumable.test(l.item,r.name))return;const m=n.loaders.get(l.attributeNewValue);if(!m||!m.data)return null;const u=c.mapper.toViewElement(l.item),g=a.findViewImgElement(u);g&&(c.consumable.consume(l.item,r.name),c.writer.setAttribute("data-ck-upload-id",m.id,g))})})}}function pi(o){return Array.from(o.types).includes("text/html")&&o.getData("text/html")!==""}function Ii(o,e){const t=o.plugins.get("ImageUtils");return Array.from(o.model.createRangeOn(e)).filter(i=>t.isImage(i.item)).map(i=>i.item)}class bi extends f{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[fi,oi,ai]}}class wi extends R{urlInputView;keystrokes;constructor(e){super(e),this.set("imageURLInputValue",""),this.set("isImageSelected",!1),this.set("isEnabled",!0),this.keystrokes=new z,this.urlInputView=this._createUrlInputView(),this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-url"],tabindex:"-1"},children:[this.urlInputView,{tag:"div",attributes:{class:["ck","ck-image-insert-url__action-row"]}}]})}render(){super.render(),O({view:this}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}_createUrlInputView(){const e=this.locale,t=e.t,i=new X(e,ve);return i.bind("label").to(this,"isImageSelected",n=>t(n?"Update image URL":"Insert image via URL")),i.bind("isEnabled").to(this),i.fieldView.inputMode="url",i.fieldView.placeholder="https://example.com/image.png",i.fieldView.bind("value").to(this,"imageURLInputValue",n=>n||""),i.fieldView.on("input",()=>{this.imageURLInputValue=i.fieldView.element.value.trim()}),i}focus(){this.urlInputView.focus()}}class _i extends f{_imageInsertUI;_formView;static get pluginName(){return"ImageInsertViaUrlUI"}static get isOfficialPlugin(){return!0}static get requires(){return[S,pt]}init(){this.editor.ui.componentFactory.add("insertImageViaUrl",()=>this._createToolbarButton()),this.editor.ui.componentFactory.add("menuBar:insertImageViaUrl",()=>this._createMenuBarButton("standalone"))}afterInit(){this._imageInsertUI=this.editor.plugins.get("ImageInsertUI"),this._imageInsertUI.registerIntegration({name:"url",observable:()=>this.editor.commands.get("insertImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createInsertUrlButton(e){const t=new e(this.editor.locale);return t.icon=Ut,t.on("execute",()=>{this._showModal()}),t}_createToolbarButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(b);return t.tooltip=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",i=>e(i?"Update image URL":"Insert image via URL")),t}_createDropdownButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(b);return t.withText=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",i=>e(i?"Update image URL":"Insert via URL")),t}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createInsertUrlButton(It);switch(i.withText=!0,e){case"standalone":i.label=t("Image via URL");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("Via URL");break}return i}_createInsertUrlView(){const e=this.editor,t=e.locale,i=e.commands.get("replaceImageSource"),n=e.commands.get("insertImage"),a=new wi(t);return a.bind("isImageSelected").to(this._imageInsertUI),a.bind("isEnabled").toMany([n,i],"isEnabled",(...s)=>s.some(r=>r)),a}_showModal(){const e=this.editor,i=e.locale.t,n=e.plugins.get("Dialog");this._formView||(this._formView=this._createInsertUrlView(),this._formView.on("submit",()=>this._handleSave()));const a=e.commands.get("replaceImageSource");this._formView.imageURLInputValue=a.value||"",n.show({id:"insertImageViaUrl",title:i("Image via URL"),isModal:!0,content:this._formView,actionButtons:[{label:i("Cancel"),withText:!0,onExecute:()=>n.hide()},{label:this._imageInsertUI.isImageSelected?i("Save"):i("Insert"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSave()}]})}_handleSave(){this.editor.commands.get("replaceImageSource").isEnabled?this.editor.execute("replaceImageSource",{source:this._formView.imageURLInputValue}):this.editor.execute("insertImage",{source:this._formView.imageURLInputValue}),this.editor.plugins.get("Dialog").hide()}}class vi extends f{static get pluginName(){return"ImageInsertViaUrl"}static get isOfficialPlugin(){return!0}static get requires(){return[_i,S]}}class ln extends f{static get pluginName(){return"ImageInsert"}static get isOfficialPlugin(){return!0}static get requires(){return[bi,vi,S]}}class yi extends v{refresh(){const e=this.editor,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!i,!i||!i.hasAttribute("resizedWidth")?this.value=null:this.value={width:i.getAttribute("resizedWidth"),height:null}}execute(e){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils"),a=n.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},a&&i.change(s=>{s.setAttribute("resizedWidth",e.width,a),s.removeAttribute("resizedHeight",a),n.setImageNaturalSizeAttributes(a)})}}class qe extends f{static get requires(){return[I]}static get pluginName(){return"ImageResizeEditing"}static get isOfficialPlugin(){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(){const e=this.editor,t=new yi(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){const 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){const t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add(n=>n.on(`attribute:resizedWidth:${e}`,(a,s,r)=>{if(!r.consumable.consume(s.item,a.name))return;const l=r.writer,c=r.mapper.toViewElement(s.item);s.attributeNewValue!==null?(l.setStyle("width",s.attributeNewValue,c),l.addClass("image_resized",c)):(l.removeStyle("width",c),l.removeClass("image_resized",c))})),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:n=>({key:"style",value:{height:n}})}),t.conversion.for("editingDowncast").add(n=>n.on(`attribute:resizedHeight:${e}`,(a,s,r)=>{if(!r.consumable.consume(s.item,a.name))return;const l=r.writer,c=r.mapper.toViewElement(s.item),m=e==="imageInline"?i.findViewImgElement(c):c;s.attributeNewValue!==null?l.setStyle("height",s.attributeNewValue,m):l.removeStyle("height",m)})),t.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:n=>A(n)?null:n.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:n=>A(n)?null:n.getStyle("height")}}),t.conversion.for("upcast").add(n=>{n.on(`element:${e==="imageBlock"?"figure":"img"}`,(a,s,r)=>{r.consumable.consume(s.viewItem,{classes:["image_resized"]})})})}}const F={small:xt,medium:Tt,large:At,custom:Bt,original:Vt};class Ei extends f{static get requires(){return[qe]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const n of t)this._registerImageResizeButton(n);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:i,value:n,icon:a}=e;t.ui.componentFactory.add(i,s=>{const r=new b(s),l=t.commands.get("resizeImage"),c=this._getOptionLabelValue(e,!0);if(!F[a])throw new ot("imageresizebuttons-missing-icon",t,e);if(r.set({label:c,icon:F[a],tooltip:c,isToggleable:!0}),r.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&k(e)){const m=t.plugins.get("ImageCustomResizeUI");this.listenTo(r,"execute",()=>{m._showForm(this._resizeUnit)})}else{const m=n?n+this._resizeUnit:null;r.bind("isOn").to(l,"value",l,"isEnabled",j(m)),this.listenTo(r,"execute",()=>{t.execute("resizeImage",{width:m})})}return r})}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,n=e.find(s=>!s.value),a=s=>{const r=t.commands.get("resizeImage"),l=K(s,yt),c=l.buttonView,m=i("Resize image");return c.set({tooltip:m,commandValue:n.value,icon:F.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button",ariaLabel:m,ariaLabelledBy:void 0}),c.bind("label").to(r,"value",u=>u&&u.width?u.width:this._getOptionLabelValue(n)),l.bind("isEnabled").to(this),Et(l,()=>this._getResizeDropdownListItemDefinitions(e,r),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(l,"execute",u=>{"onClick"in u.source?u.source.onClick():(t.execute(u.source.commandName,{width:u.source.commandValue}),t.editing.view.focus())}),l};t.ui.componentFactory.add("resizeImage",a),t.ui.componentFactory.add("imageResize",a)}_getOptionLabelValue(e,t=!1){const i=this.editor.t;return e.label?e.label:t?k(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):k(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const{editor:i}=this,n=new at,a=e.map(s=>k(s)?{...s,valueWithUnits:"custom"}:s.value?{...s,valueWithUnits:`${s.value}${this._resizeUnit}`}:{...s,valueWithUnits:null});for(const s of a){let r=null;if(i.plugins.has("ImageCustomResizeUI")&&k(s)){const l=i.plugins.get("ImageCustomResizeUI");r={type:"button",model:new ne({label:this._getOptionLabelValue(s),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{l._showForm(this._resizeUnit)}})};const c=Object.values(a).map(m=>m.valueWithUnits);r.model.bind("isOn").to(t,"value",t,"isEnabled",Ci(c))}else r={type:"button",model:new ne({commandName:"resizeImage",commandValue:s.valueWithUnits,label:this._getOptionLabelValue(s),role:"menuitemradio",withText:!0,icon:null})},r.model.bind("isOn").to(t,"value",t,"isEnabled",j(s.valueWithUnits));r.model.bind("isEnabled").to(t,"isEnabled"),n.add(r)}return n}}function k(o){return o.value==="custom"}function j(o){return(e,t)=>{const i=e;return i===void 0||!t?!1:o===null&&i===o?!0:i!==null&&i.width===o}}function Ci(o){return(e,t)=>!o.some(i=>j(i)(e,t))}const ki="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",L="image_resized";class Si extends f{static get requires(){return[N,I]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(ee),this.listenTo(t.document,"imageLoaded",(n,a)=>{if(!a.target.matches(ki))return;const s=e.editing.view.domConverter,r=s.domToView(a.target),l=i.getImageWidgetFromImageView(r);let c=this.editor.plugins.get(N).getResizerByViewElement(l);if(c){c.redraw();return}const m=e.editing.mapper,u=m.toModelElement(l);c=e.plugins.get(N).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:u,viewElement:l,editor:e,getHandleHost(g){return g.querySelector("img")},getResizeHost(){return s.mapViewToDom(m.toViewElement(u))},isCentered(){return u.getAttribute("imageStyle")=="alignCenter"},onCommit(g){t.change(d=>{d.removeClass(L,l)}),e.execute("resizeImage",{width:g})}}),c.on("updateSize",()=>{l.hasClass(L)||t.change(d=>{d.addClass(L,l)});const g=u.name==="imageInline"?r:l;g.getStyle("height")&&t.change(d=>{d.removeStyle("height",g)})}),c.bind("isEnabled").to(this)})}}function $e(o){if(!o)return null;const[,e,t]=o.trim().match(/([.,\d]+)(%|px)$/)||[],i=Number.parseFloat(e);return Number.isNaN(i)?null:{value:i,unit:t}}function He(o,e,t){return t==="px"?{value:e.value,unit:"px"}:{value:e.value/o*100,unit:"%"}}function Ge(o){const{editing:e}=o,i=o.plugins.get("ImageUtils").getClosestSelectedImageElement(o.model.document.selection);if(!i)return null;const n=e.mapper.toViewElement(i),a=e.view.domConverter.mapViewToDom(n);return{model:i,view:n,dom:a}}function Ui(o,e){const t=Ge(o);if(!t)return null;const i=$e(t.model.getAttribute("resizedWidth")||null);if(!i)return null;if(i.unit===e)return i;const n=pe(t.dom),a={value:new lt(t.dom).width};return He(n,a,e)}class Vi extends R{focusTracker;keystrokes;unit;backButtonView;saveButtonView;labeledInput;children;_focusables;_focusCycler;_validators;constructor(e,t,i){super(e),this.focusTracker=new G,this.keystrokes=new z,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 ye(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new J,this._validators=i,this.keystrokes.set("Esc",(n,a)=>{this.fire("cancel"),a()}),this._focusCycler=new Z({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(),O({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,t=new b(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:Ve,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new b(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new Ee(this.locale,{label:e("Image Resize")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){const e=this.locale.t,t=new X(this.locale,Ct);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(const e of this._validators){const t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(e===null)return null;const t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){const{parsedSize:e,unit:t}=this;return e===null?null:`${e}${t}`}}function Bi(o,e){const t=Ge(o);if(!t)return null;const i=pe(t.dom),n=$e(window.getComputedStyle(t.dom).minWidth)||{value:1},a=Math.max(.1,He(i,n,e).value);return{unit:e,lower:a,upper:e==="px"?i:100}}class Ai extends f{_balloon;_form;static get requires(){return[be]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(we(Vi))(t.locale,e,Ti(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)}),_e({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);const t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:Q(t)});const n=Ui(t,e),a=n?n.value.toFixed(1):"",s=Bi(t,e);i.fieldView.value=i.fieldView.element.value=a,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 Ti(o){const e=o.t;return[t=>{if(t.rawSize.trim()==="")return e("The value must not be empty.");if(t.parsedSize===null)return e("The value should be a plain number.")}]}class cn extends f{static get requires(){return[qe,Si,Ai,Ei]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}}class xi extends v{_defaultStyles;_styles;constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(i=>{if(i.isDefault)for(const n of i.modelElements)this._defaultStyles[n]=i.name;return[i.name,i]}))}refresh(){const i=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!i,this.isEnabled?i.hasAttribute("imageStyle")?this.value=i.getAttribute("imageStyle"):this.value=this._defaultStyles[i.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils");i.change(a=>{const s=e.value,{setImageSizes:r=!0}=e;let l=n.getClosestSelectedImageElement(i.document.selection);s&&this.shouldConvertImageType(s,l)&&(this.editor.execute(n.isBlockImage(l)?"imageTypeInline":"imageTypeBlock",{setImageSizes:r}),l=n.getClosestSelectedImageElement(i.document.selection)),!s||this._styles.get(s).isDefault?a.removeAttribute("imageStyle",l):a.setAttribute("imageStyle",s,l),r&&n.setImageNaturalSizeAttributes(l)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const D={get inline(){return{name:"inline",title:"In line",icon:Ce,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:ke,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Ue,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:W,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:M,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Se,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:W,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:M,modelElements:["imageBlock"],className:"image-style-side"}}},zi={full:Ot,left:Ue,right:Se,center:W,inlineLeft:ke,inlineRight:M,inline:Ce},Ri=[{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 Oi(o){return(o.configuredStyles.options||[]).map(i=>Fi(i)).filter(i=>Li(i,o))}function Pi(o,e){return o&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:o?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}}function Ni(o){return o.has("ImageBlockEditing")&&o.has("ImageInlineEditing")?[...Ri]:[]}function Fi(o){return typeof o=="string"?D[o]?o={...D[o]}:o={name:o}:o=Di(D[o.name],o),typeof o.icon=="string"&&(o.icon=zi[o.icon]||o.icon),o}function Li(o,{isBlockPluginLoaded:e,isInlinePluginLoaded:t}){const{modelElements:i,name:n}=o;if(!i||!i.length||!n)return Ke({style:o}),!1;{const a=[e?"imageBlock":null,t?"imageInline":null];if(!i.some(s=>a.includes(s)))return _("image-style-missing-dependency",{style:o,missingPlugins:i.map(s=>s==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}function Di(o,e){const t={...e};for(const i in o)Object.prototype.hasOwnProperty.call(e,i)||(t[i]=o[i]);return t}function Ke(o){_("image-style-configuration-definition-invalid",o)}const x={normalizeStyles:Oi,getDefaultStylesConfiguration:Pi,getDefaultDropdownDefinitions:Ni,warnInvalidStyle:Ke};function Mi(o){return(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=me(t.attributeNewValue,o),a=me(t.attributeOldValue,o),s=i.mapper.toViewElement(t.item),r=i.writer;a&&r.removeClass(a.className,s),n&&r.addClass(n.className,s)}}function Wi(o){const e={imageInline:o.filter(t=>!t.isDefault&&t.modelElements.includes("imageInline")),imageBlock:o.filter(t=>!t.isDefault&&t.modelElements.includes("imageBlock"))};return(t,i,n)=>{if(!i.modelRange)return;const a=i.viewItem,s=H(i.modelRange.getItems());if(s&&n.schema.checkAttribute(s,"imageStyle"))for(const r of e[s.name])n.consumable.consume(a,{classes:r.className})&&n.writer.setAttribute("imageStyle",r.name,s)}}function me(o,e){for(const t of e)if(t.name===o)return t}class Je extends f{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}normalizedStyles;init(){const e=this.editor,t=e.plugins.has("ImageBlockEditing"),i=e.plugins.has("ImageInlineEditing");e.config.define("image.styles",x.getDefaultStylesConfiguration(t,i)),this.normalizedStyles=x.normalizeStyles({configuredStyles:e.config.get("image.styles"),isBlockPluginLoaded:t,isInlinePluginLoaded:i}),this._setupConversion(t,i),this._setupPostFixer(),e.commands.add("imageStyle",new xi(e,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,n=i.model.schema,a=Mi(this.normalizedStyles),s=Wi(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",a),i.data.downcastDispatcher.on("attribute:imageStyle",a),e&&(n.extend("imageBlock",{allowAttributes:"imageStyle"}),n.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(n.extend("imageInline",{allowAttributes:"imageStyle"}),n.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(I),n=new Map(this.normalizedStyles.map(a=>[a.name,a]));t.registerPostFixer(a=>{let s=!1;for(const r of t.differ.getChanges())if(r.type=="insert"||r.type=="attribute"&&r.attributeKey=="imageStyle"){let l=r.type=="insert"?r.position.nodeAfter:r.range.start.nodeAfter;if(l&&l.is("element","paragraph")&&l.childCount>0&&(l=l.getChild(0)),!i.isImage(l))continue;const c=l.getAttribute("imageStyle");if(!c)continue;const m=n.get(c);(!m||!m.modelElements.includes(l.name))&&(a.removeAttribute("imageStyle",l),s=!0)}return s})}}class ji extends f{static get requires(){return[Je]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){const 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(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],i=e.get("ImageStyleEditing"),n=ue(i.normalizedStyles,this.localizedDefaultStylesTitles);for(const s of n)this._createButton(s);const a=ue([...t.filter(Be),...x.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const s of a)this._createDropdown(s,n)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,n=>{let a;const{defaultItem:s,items:r,title:l}=e,c=r.filter(d=>t.find(({name:h})=>ge(h)===d)).map(d=>{const h=i.create(d);return d===s&&(a=h),h});r.length!==c.length&&x.warnInvalidStyle({dropdown:e});const m=K(n,Ie),u=m.buttonView,g=u.arrowView;return bt(m,c,{enableActiveItemFocusOnDropdownOpen:!0}),u.set({label:de(l,a.label),class:null,tooltip:!0}),g.unbind("label"),g.set({label:l}),u.bind("icon").toMany(c,"isOn",(...d)=>{const h=d.findIndex(C);return h<0?a.icon:c[h].icon}),u.bind("label").toMany(c,"isOn",(...d)=>{const h=d.findIndex(C);return de(l,h<0?a.label:c[h].label)}),u.bind("isOn").toMany(c,"isOn",(...d)=>d.some(C)),u.bind("class").toMany(c,"isOn",(...d)=>d.some(C)?"ck-splitbutton_flatten":void 0),u.on("execute",()=>{c.some(({isOn:d})=>d)?m.isOpen=!m.isOpen:a.fire("execute")}),m.bind("isEnabled").toMany(c,"isEnabled",(...d)=>d.some(C)),this.listenTo(m,"execute",()=>{this.editor.editing.view.focus()}),m})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(ge(t),i=>{const n=this.editor.commands.get("imageStyle"),a=new b(i);return a.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),a.bind("isEnabled").to(n,"isEnabled"),a.bind("isOn").to(n,"value",s=>s===t),a.on("execute",this._executeCommand.bind(this,t)),a})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function ue(o,e){for(const t of o)e[t.title]&&(t.title=e[t.title]);return o}function ge(o){return`imageStyle:${o}`}function de(o,e){return(o?o+": ":"")+e}class mn extends f{static get requires(){return[Je,ji]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}}class un extends f{static get requires(){return[ie,I]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.t,i=e.plugins.get(ie),n=e.plugins.get("ImageUtils");i.register("image",{ariaLabel:t("Image toolbar"),items:qi(e.config.get("image.toolbar")||[]),getRelatedElement:a=>n.getClosestSelectedImageWidget(a)})}}function qi(o){return o.map(e=>Be(e)?e.name:e)}export{sn as AutoImage,on as ImageBlock,Fe as ImageBlockEditing,rn as ImageCaption,Qt as ImageCaptionEditing,ei as ImageCaptionUI,Le as ImageCaptionUtils,Ai as ImageCustomResizeUI,Re as ImageEditing,an as ImageInline,Xt as ImageInlineEditing,ln as ImageInsert,S as ImageInsertUI,vi as ImageInsertViaUrl,_i as ImageInsertViaUrlUI,ee as ImageLoadObserver,Ne as ImagePlaceholder,cn as ImageResize,Ei as ImageResizeButtons,qe as ImageResizeEditing,Si as ImageResizeHandles,Oe as ImageSizeAttributes,mn as ImageStyle,xi as ImageStyleCommand,Je as ImageStyleEditing,ji as ImageStyleUI,xe as ImageTextAlternative,Wt as ImageTextAlternativeCommand,jt as ImageTextAlternativeEditing,Ht as ImageTextAlternativeUI,un as ImageToolbar,Pe as ImageTypeCommand,bi as ImageUpload,fi as ImageUploadEditing,ai as ImageUploadProgress,oi as ImageUploadUI,I as ImageUtils,Kt as InsertImageCommand,Jt as ReplaceImageSourceCommand,yi as ResizeImageCommand,Yt as ToggleImageCaptionCommand,hi as UploadImageCommand,Ri as _IMAGE_DEFAULT_DROPDOWN_DEFINITIONS,zi as _IMAGE_DEFAULT_ICONS,D as _IMAGE_DEFAULT_OPTIONS,Vi as _ImageCustomResizeFormView,Zt as _ImageInsertFormView,wi as _ImageInsertUrlView,x as _ImageStyleUtils,qt as _ImageTextAlternativeFormView,A as _checkIfImageWidthAndHeightStylesAreBothSet,ae as _createBlockImageViewElement,Pt as _createInlineImageViewElement,Y as _determineImageTypeForInsertionAtSelection,T as _downcastImageAttribute,ze as _downcastImageSrcsetAttribute,ti as _fetchLocalImage,Q as _getImageBalloonPositionData,B as _getImageSizeValueIfInPx,Ae as _getImageViewElementMatcher,Ge as _getSelectedImageEditorNodes,Bi as _getSelectedImagePossibleResizeRange,Ui as _getSelectedImageWidthInUnits,ii as _isLocalImage,Mi as _modelToViewImageStyleAttribute,$t as _repositionImageContextualBalloon,He as _tryCastImageDimensionsToUnit,$e as _tryParseImageDimensionWithUnit,Gt as _upcastImageFigure,Wi as _viewToModelImageStyleAttribute,De as createImageTypeRegExp,pi as isHtmlInDataTransfer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Plugin as p,Command as ee}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Delete as ue,findAttributeRange as C,TextWatcher as he,getLastTextLine as me,TwoStepCaretMovement as K,Input as fe,inlineHighlight as ke}from"../../../../../@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{ClipboardPipeline as ge}from"../../../../../@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js";import{env as we,keyCodes as be,Collection as te,first as ie,toMap as A,ObservableMixin as pe,FocusTracker as x,KeystrokeHandler as S,diff as _e}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{ClickObserver as Ve,ModelLivePosition as $,Matcher as ve}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{IconUnlink as Le,IconPencil as Ie,IconSettings as ye,IconLink as se,IconPreviousArrow as B,IconNextArrow as Te}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ContextualBalloon as G,ToolbarView as Pe,CssTransitionDisablerMixin as W,ButtonView as w,SwitchButtonView as Ee,MenuBarMenuListItemButtonView as Ce,clickOutsideHandler as Ae,View as L,ViewCollection as F,FocusCycler as H,ListView as R,ListItemView as D,FormHeaderView as U,IconView as xe,submitHandler as Se,LabeledFieldView as X,createLabeledInputText as j,FormRowView as J}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{isWidget as Be}from"../../../../../@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js";import{upperFirst as Fe}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/string/upperFirst.js";class He{_definitions=new Set;get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(t,i,s)=>{if(!s.consumable.test(i.item,"attribute:linkHref")||!(i.item.is("selection")||s.schema.isInline(i.item)))return;const n=s.writer,o=n.document.selection;for(const a of this._definitions){const r=n.createAttributeElement("a",a.attributes,{priority:5});a.classes&&n.addClass(a.classes,r);for(const c in a.styles)n.setStyle(c,a.styles[c],r);n.setCustomProperty("link",!0,r),a.callback(i.attributeNewValue)?i.item.is("selection")?n.wrap(o.getFirstRange(),r):n.wrap(s.mapper.toViewRange(i.range),r):n.unwrap(s.mapper.toViewRange(i.range),r)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,i,{writer:s,mapper:n})=>{const o=n.toViewElement(i.item),a=Array.from(o.getChildren()).find(r=>r.is("element","a"));if(a)for(const r of this._definitions){const c=A(r.attributes);if(r.callback(i.attributeNewValue)){for(const[u,h]of c)u==="class"?s.addClass(h,a):s.setAttribute(u,h,a);r.classes&&s.addClass(r.classes,a);for(const u in r.styles)s.setStyle(u,r.styles[u],a)}else{for(const[u,h]of c)u==="class"?s.removeClass(h,a):s.removeAttribute(u,a);r.classes&&s.removeClass(r.classes,a);for(const u in r.styles)s.removeStyle(u,a)}}})}}}const Re=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,De="^(?:(?:<protocols>):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))",Ue=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,Oe=/^((\w+:(\/{2,})?)|(\W))/i,Me=["https?","ftps?","mailto"],v="Ctrl+K";function Ne(l){return l.is("attributeElement")&&!!l.getCustomProperty("link")}function Y(l,{writer:e}){const t=e.createAttributeElement("a",{href:l},{priority:5});return e.setCustomProperty("link",!0,t),t}function ne(l,e=Me){const t=String(l),i=e.join("|"),s=new RegExp(`${De.replace("<protocols>",i)}`,"i");return qe(t,s)?t:"#"}function qe(l,e){return!!l.replace(Re,"").match(e)}function ze(l,e){const t={"Open in a new tab":l("Open in a new tab"),Downloadable:l("Downloadable")};return e.forEach(i=>("label"in i&&t[i.label]&&(i.label=t[i.label]),i)),e}function Ke(l){const e=[];if(l)for(const[t,i]of Object.entries(l)){const s=Object.assign({},i,{id:`link${Fe(t)}`});e.push(s)}return e}function P(l,e){return l?e.checkAttribute(l.name,"linkHref"):!1}function $e(l){return Ue.test(l)}function O(l,e){const t=$e(l)?"mailto:":e,i=!!t&&!oe(l);return l&&i?t+l:l}function oe(l){return Oe.test(l)}function Ge(l){window.open(l,"_blank","noopener")}function E(l){let e="";for(const t of l.getItems()){if(!t.is("$text")&&!t.is("$textProxy"))return;e+=t.data}return e}class We extends ee{manualDecorators=new te;automaticDecorators=new He;restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||ie(t.getSelectedBlocks());P(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(const s of this.manualDecorators)s.value=this._getDecoratorStateFromModel(s.id)}execute(e,t={},i){const s=this.editor.model,n=s.document.selection,o=[],a=[];for(const r in t)t[r]?o.push(r):a.push(r);s.change(r=>{const c=d=>{r.setAttribute("linkHref",e,d),o.forEach(m=>r.setAttribute(m,!0,d)),a.forEach(m=>r.removeAttribute(m,d))},u=(d,m)=>{const k=E(d);if(!k)return d;let g=i;if(g||(g=m&&m==k?e:k),g!=k){const I=Xe(k,g);let f=0;for(const{offset:V,actual:y,expected:M}of I){const N=V+f,q=r.createRange(d.start.getShiftedBy(N),d.start.getShiftedBy(N+y.length)),ae=je(q,d).getAttributes(),ce=Array.from(ae).filter(([de])=>s.schema.getAttributeProperties(de).isFormatting),z=r.createText(M,ce);c(z),s.insertContent(z,q),f+=M.length}return r.createRange(d.start,d.start.getShiftedBy(g.length))}},h=d=>{const{plugins:m}=this.editor;if(r.setSelection(d.end),m.has("TwoStepCaretMovement"))m.get("TwoStepCaretMovement")._handleForwardMovement();else for(const k of["linkHref",...o,...a])r.removeSelectionAttribute(k)};if(n.isCollapsed){const d=n.getFirstPosition();if(n.hasAttribute("linkHref")){const m=n.getAttribute("linkHref"),k=C(d,"linkHref",m,s),g=u(k,m);c(g||k),g&&h(g)}else if(e!==""){const m=A(n.getAttributes());m.set("linkHref",e),o.forEach(g=>{m.set(g,!0)});const k=s.insertContent(r.createText(i||e,m),d);h(k)}}else{const d=Array.from(n.getRanges()),m=s.schema.getValidRanges(d,"linkHref"),k=[];for(const f of n.getSelectedBlocks())s.schema.checkAttribute(f,"linkHref")&&k.push(r.createRangeOn(f));const g=k.slice();for(const f of m)this._isRangeToUpdate(f,k)&&g.push(f);const I=d.map(f=>({start:$.fromPosition(f.start,"toPrevious"),end:$.fromPosition(f.end,"toNext")}));for(let f of g){const V=(f.start.textNode||f.start.nodeAfter).getAttribute("linkHref");f=u(f,V)||f,c(f)}r.setSelection(I.map(f=>{const V=f.start.toPosition(),y=f.end.toPosition();return f.start.detach(),f.end.detach(),s.createRange(V,y)}))}})}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,s=i.getSelectedElement();return P(s,t.schema)?s.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}}function Xe(l,e){const t=_e(l,e),i={equal:0,insert:0,delete:0},s=[];let n="",o="";for(const a of[...t,null])a=="insert"?o+=e[i.equal+i.insert]:a=="delete"?n+=l[i.equal+i.delete]:(n.length||o.length)&&(s.push({offset:i.equal,actual:n,expected:o}),n="",o=""),a&&i[a]++;return s}function je(l,e){if(!l.isCollapsed)return ie(l.getItems());const t=l.start;return t.textNode?t.textNode:!t.nodeBefore||t.isEqual(e.start)?t.nodeAfter:t.nodeBefore}class Je extends ee{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();P(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,s=e.commands.get("link");t.change(n=>{const o=i.isCollapsed?[C(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const a of o)if(n.removeAttribute("linkHref",a),s)for(const r of s.manualDecorators)n.removeAttribute(r.id,a)})}}class Ye extends pe(){id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:t,attributes:i,classes:s,styles:n,defaultValue:o}){super(),this.id=e,this.set("value",void 0),this.defaultValue=o,this.label=t,this.attributes=i,this.classes=s,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}const Qe="ck-link_selected",Q="automatic",Ze="manual",et=/^(https?:)?\/\//;class _ extends p{_linkOpeners=[];static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[K,fe,ge]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1,toolbar:["linkPreview","|","editLink","linkProperties","unlink"]})}init(){const 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:Y}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,o)=>Y(ne(n,t),o)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),e.commands.add("link",new We(e)),e.commands.add("unlink",new Je(e));const i=ze(e.t,Ke(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter(n=>n.mode===Q)),this._enableManualDecorators(i.filter(n=>n.mode===Ze)),e.plugins.get(K).registerAttribute("linkHref"),ke(e,"linkHref","a",Qe),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_registerLinkOpener(e){this._linkOpeners.push(e)}_enableAutomaticDecorators(e){const t=this.editor,s=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&s.add({id:"linkIsExternal",mode:Q,callback:n=>!!n&&et.test(n),attributes:{target:"_blank",rel:"noopener noreferrer"}}),s.add(e),s.length&&t.conversion.for("downcast").add(s.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,s=t.commands.get("link").manualDecorators;e.forEach(n=>{t.model.schema.extend("$text",{allowAttributes:n.id});const o=new Ye(n);s.add(o),t.conversion.for("downcast").attributeToElement({model:o.id,view:(a,{writer:r,schema:c},{item:u})=>{if((u.is("selection")||c.isInline(u))&&a){const h=r.createAttributeElement("a",o.attributes,{priority:5});o.classes&&r.addClass(o.classes,h);for(const d in o.styles)r.setStyle(d,o.styles[d],h);return r.setCustomProperty("link",!0,h),h}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...o._createPattern()},model:{key:o.id}})})}_enableLinkOpen(){const e=this.editor,i=e.editing.view.document,s=n=>{this._linkOpeners.some(o=>o(n))||Ge(n)};this.listenTo(i,"click",(n,o)=>{if(!(we.isMac?o.domEvent.metaKey:o.domEvent.ctrlKey))return;let r=o.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const c=r.getAttribute("href");c&&(n.stop(),o.preventDefault(),s(c))},{context:"$capture"}),this.listenTo(i,"keydown",(n,o)=>{const r=e.commands.get("link").value;r&&o.keyCode===be.enter&&o.altKey&&(n.stop(),s(r))})}_enableSelectionAttributesFixer(){const t=this.editor.model,i=t.document.selection;this.listenTo(i,"change:attribute",(s,{attributeKeys:n})=>{!n.includes("linkHref")||i.hasAttribute("linkHref")||t.change(o=>{tt(o,it(t.schema))})})}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(s,n)=>{t.change(o=>{const a=o.createRangeIn(n.content);for(const r of a.getItems())if(r.hasAttribute("linkHref")){const c=O(r.getAttribute("linkHref"),i);o.setAttribute("linkHref",c,r)}})})}}function tt(l,e){l.removeSelectionAttribute("linkHref");for(const t of e)l.removeSelectionAttribute(t)}function it(l){return l.getDefinition("$text").allowAttributes.filter(t=>t.startsWith("link"))}class st extends w{constructor(e){super(e);const 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){const s=()=>i.preventDefault();this.fire("navigate",this.href,s)}})}}),this.template.tag="a"}}class nt extends L{focusTracker=new x;keystrokes=new S;backButtonView;saveButtonView;displayedTextInputView;urlInputView;children;providersListChildren;_validators;_focusables=new F;_focusCycler;constructor(e,t){super(e),this._validators=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),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 H({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(),Se({view:this}),[this.urlInputView,this.saveButtonView,...this.providersListChildren,this.backButtonView,this.displayedTextInputView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createBackButton(){const e=this.locale.t,t=new w(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:B,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){const e=this.locale.t,t=new w(this.locale);return t.set({label:e("Insert"),tooltip:!1,withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),t}_createHeaderView(){const e=this.locale.t,t=new U(this.locale,{label:e("Link")});return t.children.add(this.backButtonView,0),t}_createProvidersListView(){const e=new R(this.locale);return e.extendTemplate({attributes:{class:["ck-link-form__providers-list"]}}),e.items.bindTo(this.providersListChildren).using(t=>{const i=new D(this.locale);return i.children.add(t),i}),e}_createDisplayedTextInput(){const e=this.locale.t,t=new X(this.locale,j);return t.label=e("Displayed text"),t.class="ck-labeled-field-view_full-width",t}_createUrlInput(){const e=this.locale.t,t=new X(this.locale,j);return t.fieldView.inputMode="url",t.label=e("Link URL"),t.class="ck-labeled-field-view_full-width",t}_createFormChildren(){this.children.add(new J(this.locale,{children:[this.displayedTextInputView],class:["ck-form__row_large-top-padding"]})),this.children.add(new J(this.locale,{children:[this.urlInputView,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]}))}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}class ot extends L{focusTracker=new x;keystrokes=new S;backButtonView;listView;listChildren;emptyListInformation;children;_focusables=new F;_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,s)=>{s?(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 H({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(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createListView(){const e=new R(this.locale);return e.extendTemplate({attributes:{class:["ck-link-providers__list"]}}),e.items.bindTo(this.listChildren).using(t=>{const i=new D(this.locale);return i.children.add(t),i}),e}_createBackButton(){const e=this.locale.t,t=new w(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:B,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createHeaderView(){const e=new U(this.locale);return e.bind("label").to(this,"title"),e.children.add(this.backButtonView,0),e}_createEmptyLinksListItemView(){const e=new L(this.locale);return e.setTemplate({tag:"p",attributes:{class:["ck","ck-link__empty-list-info"]},children:[{text:this.bindTemplate.to("emptyListPlaceholder")}]}),e}}class rt extends L{focusTracker=new x;keystrokes=new S;backButtonView;children;listChildren;_focusables=new F;_focusCycler;constructor(e){super(e),this.backButtonView=this._createBackButton(),this.listChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView(),this._createListView()]),this._focusCycler=new H({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(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBackButton(){const e=this.locale.t,t=new w(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:B,tooltip:!0}),t.delegate("execute").to(this,"back"),t}_createHeaderView(){const e=this.locale.t,t=new U(this.locale,{label:e("Link properties")});return t.children.add(this.backButtonView,0),t}_createListView(){const e=new R(this.locale);return e.extendTemplate({attributes:{class:["ck-link__list"]}}),e.items.bindTo(this.listChildren).using(t=>{const i=new D(this.locale);return i.children.add(t),i}),e}}class lt extends w{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(){const e=new xe;return e.content=Te,e}}const b="link-ui";class re extends p{toolbarView=null;formView=null;linkProviderItemsView=null;propertiesView=null;_balloon;_linksProviders=new te;static get requires(){return[G,_]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;this.set("selectedLinkableText",void 0),e.editing.view.addObserver(Ve),this._balloon=e.plugins.get(G),this._registerComponents(),this._registerEditingOpeners(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:b,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:b,view:(i,{writer:s})=>{if(!i.markerRange.isCollapsed)return null;const n=s.createUIElement("span");return s.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],n),n}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:v},{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){const t=this._linksProviders.filter(i=>(i.order||0)<=(e.order||0)).length;this._linksProviders.add(e,t)}_createViews(){const e=this.editor.commands.get("link");this.toolbarView=this._createToolbarView(),this.formView=this._createFormView(),e.manualDecorators.length&&(this.propertiesView=this._createPropertiesView()),this._enableUserBalloonInteractions()}_createToolbarView(){const e=this.editor,t=new Pe(e.locale),i=e.commands.get("link");t.class="ck-link-toolbar";let s=e.config.get("link.toolbar");return i.manualDecorators.length||(s=s.filter(n=>n!=="linkProperties")),t.fillFromConfig(s,e.ui.componentFactory),t.keystrokes.set("Esc",(n,o)=>{this._hideUI(),o()}),t.keystrokes.set(v,(n,o)=>{this._addFormView(),o()}),e.ui.addToolbar(t,{isContextual:!0,beforeFocus:()=>{this._getSelectedLinkElement()&&!this._isToolbarVisible&&this._showUI(!0)},afterBlur:()=>{this._hideUI(!1)}}),t}_createFormView(){const e=this.editor,t=e.locale.t,i=e.commands.get("link"),s=e.config.get("link.defaultProtocol"),n=new(W(nt))(e.locale,at(e));return n.displayedTextInputView.bind("isEnabled").to(this,"selectedLinkableText",o=>o!==void 0),n.urlInputView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("label").to(i,"value",o=>t(o?"Update":"Insert")),this.listenTo(n,"submit",()=>{if(n.isValid()){const o=n.urlInputView.fieldView.element.value,a=O(o,s),r=n.displayedTextInputView.fieldView.element.value;e.execute("link",a,this._getDecoratorSwitchesState(),r!==this.selectedLinkableText?r:void 0),this._closeFormView()}}),this.listenTo(n.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(n,"cancel",()=>{this._closeFormView()}),n.keystrokes.set("Esc",(o,a)=>{this._closeFormView(),a()}),n.providersListChildren.bindTo(this._linksProviders).using(o=>this._createLinksListProviderButton(o)),n}_createLinkProviderListView(e){return e.getListItems().map(({href:t,label:i,icon:s})=>{const n=new w;return n.set({label:i,icon:s,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){const t=this.editor,i=t.locale.t,s=new ot(t.locale),{emptyListPlaceholder:n,label:o}=e;return s.emptyListPlaceholder=n||i("No links available"),s.title=o,this.listenTo(s,"cancel",()=>{t.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),s}_createPropertiesView(){const e=this.editor,t=this.editor.commands.get("link"),i=new(W(rt))(e.locale);return this.listenTo(i,"back",()=>{e.editing.view.focus(),this._removePropertiesView()}),i.listChildren.bindTo(t.manualDecorators).using(s=>{const n=new Ee(e.locale);return n.set({label:s.label,withText:!0}),n.bind("isOn").toMany([s,t],"value",(o,a)=>a===void 0&&o===void 0?!!s.defaultValue:!!o),n.on("execute",()=>{s.set("value",!n.isOn),e.execute("link",t.value,this._getDecoratorSwitchesState())}),n}),i}_getDecoratorSwitchesState(){const e=this.editor.commands.get("link");return Array.from(e.manualDecorators).reduce((t,i)=>{const s=e.value===void 0&&i.value===void 0?i.defaultValue:i.value;return{...t,[i.id]:!!s}},{})}_registerEditingOpeners(){this.editor.plugins.get(_)._registerLinkOpener(t=>{const i=this._getLinkProviderLinkByHref(t);if(!i)return!1;const{item:s,provider:n}=i;return n.navigate?n.navigate(s):!1})}_registerComponents(){const e=this.editor;e.ui.componentFactory.add("link",()=>{const t=this._createButton(w);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:link",()=>{const t=this._createButton(Ce);return t.set({role:"menuitemcheckbox"}),t}),e.ui.componentFactory.add("linkPreview",t=>{const i=new st(t),s=e.config.get("link.allowedProtocols"),n=e.commands.get("link"),o=t.t;i.bind("isEnabled").to(n,"value",r=>!!r),i.bind("href").to(n,"value",r=>r&&ne(r,s));const a=r=>{if(!r){i.label=void 0,i.icon=void 0,i.tooltip=o("Open link in new tab");return}const c=this._getLinkProviderLinkByHref(r);if(c){const{label:u,tooltip:h,icon:d}=c.item;i.label=u,i.tooltip=h||!1,i.icon=d}else i.label=r,i.icon=void 0,i.tooltip=o("Open link in new tab")};return a(n.value),this.listenTo(n,"change:value",(r,c,u)=>{a(u)}),this.listenTo(i,"navigate",(r,c,u)=>{const h=this._getLinkProviderLinkByHref(c);if(!h)return;const{provider:d,item:m}=h,{navigate:k}=d;k&&k(m)&&(r.stop(),u())}),i}),e.ui.componentFactory.add("unlink",t=>{const i=e.commands.get("unlink"),s=new w(t),n=t.t;return s.set({label:n("Unlink"),icon:Le,tooltip:!0}),s.bind("isEnabled").to(i),this.listenTo(s,"execute",()=>{e.execute("unlink"),this._hideUI()}),s}),e.ui.componentFactory.add("editLink",t=>{const i=e.commands.get("link"),s=new w(t),n=t.t;return s.set({label:n("Edit link"),icon:Ie,tooltip:!0}),s.bind("isEnabled").to(i),this.listenTo(s,"execute",()=>{this._addFormView()}),s}),e.ui.componentFactory.add("linkProperties",t=>{const i=e.commands.get("link"),s=new w(t),n=t.t;return s.set({label:n("Link properties"),icon:ye,tooltip:!0}),s.bind("isEnabled").to(i,"isEnabled",i,"value",i,"manualDecorators",(o,a,r)=>o&&!!a&&r.length>0),this.listenTo(s,"execute",()=>{this._addPropertiesView()}),s})}_createLinksListProviderButton(e){const t=this.editor.locale,i=new lt(t);return i.set({label:e.label}),this.listenTo(i,"execute",()=>{this._showLinksProviderView(e)}),i}_createButton(e){const t=this.editor,i=t.locale,s=t.commands.get("link"),n=new e(t.locale),o=i.t;return n.set({label:o("Link"),icon:se,keystroke:v,isToggleable:!0}),n.bind("isEnabled").to(s,"isEnabled"),n.bind("isOn").to(s,"value",a=>!!a),this.listenTo(n,"execute",()=>{t.editing.view.scrollToTheSelection(),this._showUI(!0),this._getSelectedLinkElement()&&this._addFormView()}),n}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(v,(i,s)=>{s(),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())}),Ae({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;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this.formView.backButtonView.isVisible=e.isEnabled&&!!e.value,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(){const 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){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.displayedTextInputView.fieldView.reset(),this.formView.urlInputView.fieldView.reset(),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){const 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(){const e=this.editor,t=e.editing.view.document;let i=this._getSelectedLinkElement(),s=o();const n=()=>{const a=this._getSelectedLinkElement(),r=o();i&&!a||!i&&r!==s?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=a,s=r};function o(){return t.selection.focus.getAncestors().reverse().find(a=>a.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(){const e=this.editor.editing.view,t=e.document;if(this.editor.model.markers.has(b)){const s=this.editor.editing.mapper.markerNameToElements(b);if(s){const n=Array.from(s),o=e.createRange(e.createPositionBefore(n[0]),e.createPositionAfter(n[n.length-1]));return{target:e.domConverter.viewRangeToDom(o)}}}return{target:()=>{const s=this._getSelectedLinkElement();return s?e.domConverter.mapViewToDom(s):e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&Be(i))return T(t.getFirstPosition());{const s=t.getFirstRange().getTrimmed(),n=T(s.start),o=T(s.end);return!n||n!=o?null:e.createRangeIn(n).getTrimmed().isEqual(s)?n:null}}_getSelectedLinkableText(){const e=this.editor.model,t=this.editor.editing,i=this._getSelectedLinkElement();if(!i)return E(e.document.selection.getFirstRange());const s=t.view.createRangeOn(i),n=t.mapper.toModelRange(s);return E(n)}_getLinkProviderLinkByHref(e){if(!e)return null;for(const t of this._linksProviders){const i=t.getItem?t.getItem(e):t.getListItems().find(s=>s.href===e);if(i)return{provider:t,item:i}}return null}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(b))t.updateMarker(b,{range:i});else if(i.start.isAtEnd){const s=i.start.getLastMatchingPosition(({item:n})=>!e.schema.isContent(n),{boundaries:i});t.addMarker(b,{usingOperation:!1,affectsData:!1,range:t.createRange(s,i.end)})}else t.addMarker(b,{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(b)&&e.change(t=>{t.removeMarker(b)})}}function T(l){return l.getAncestors().find(e=>Ne(e))||null}function at(l){const e=l.t,t=l.config.get("link.allowCreatingEmptyLinks");return[i=>{if(!t&&!i.url.length)return e("Link URL must not be empty.")}]}const ct=4,le=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"),dt=2;class ut extends p{static get requires(){return[ue,_]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?C(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const s=this.editor.model,n=s.document.selection,o=n.getFirstPosition(),a=n.getLastPosition();let r=t.getJoined(this._expandLinkRange(s,o)||t);r&&(r=r.getJoined(this._expandLinkRange(s,a)||t)),r&&(r.start.isBefore(o)||r.end.isAfter(a))&&e.setSelection(r)}_enablePasteLinking(){const e=this.editor,t=e.model,i=t.document.selection,s=e.plugins.get("ClipboardPipeline"),n=e.commands.get("link");s.on("inputTransformation",(o,a)=>{if(!this.isEnabled||!n.isEnabled||i.isCollapsed||a.method!=="paste"||i.rangeCount>1)return;const r=i.getFirstRange(),c=a.dataTransfer.getData("text/plain");if(!c)return;const u=c.match(le);u&&u[2]===c&&(t.change(h=>{this._selectEntireLinks(h,r),n.execute(c)}),o.stop())},{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new he(e.model,i=>{let s=i;if(!ht(s))return;s=s.slice(0,-1),"!.:,;?".includes(s[s.length-1])&&(s=s.slice(0,-1));const n=Z(s);if(n)return{url:n,removedTrailingCharacters:i.length-s.length}});t.on("matched:data",(i,s)=>{const{batch:n,range:o,url:a,removedTrailingCharacters:r}=s;if(!n.isTyping)return;const c=o.end.getShiftedBy(-r),u=c.getShiftedBy(-a.length),h=e.model.createRange(u,c);this._applyAutoLink(a,h)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",()=>{const s=t.document.selection.getFirstPosition();let n;s.parent.previousSibling?.is("element")?n=t.createRangeIn(s.parent.previousSibling):n=t.createRange(t.createPositionAt(s.parent,0),s),this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",()=>{const s=t.document.selection.getFirstPosition(),n=t.createRange(t.createPositionAt(s.parent,0),s.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:s}=me(e,t),n=Z(i);if(n){const o=t.createRange(s.end.getShiftedBy(-n.length),s.end);this._applyAutoLink(n,o)}}_applyAutoLink(e,t){const i=this.editor.model,s=this.editor.config.get("link.defaultProtocol"),n=O(e,s);!this.isEnabled||!mt(t,i)||!oe(n)||ft(t)||this._persistAutoLink(n,t)}_persistAutoLink(e,t){const i=this.editor.model,s=this.editor.plugins.get("Delete");i.enqueueChange(n=>{n.setAttribute("linkHref",e,t),i.enqueueChange(()=>{s.requestUndoOnBackspace()})})}}function ht(l){return l.length>ct&&l[l.length-1]===" "&&l[l.length-2]!==" "}function Z(l){const e=le.exec(l);return e?e[dt]:null}function mt(l,e){return e.schema.checkAttributeInSelection(e.createSelection(l),"linkHref")}function ft(l){const e=l.start.nodeAfter;return!!e&&e.hasAttribute("linkHref")}class xt extends p{static get requires(){return[_,re,ut]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}}class kt extends p{static get requires(){return["ImageEditing","ImageUtils",_]}static get pluginName(){return"LinkImageEditing"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=e.model.schema;e.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["linkHref"]}),e.conversion.for("upcast").add(gt(e)),e.conversion.for("downcast").add(wt(e)),this._enableAutomaticDecorators(),this._enableManualDecorators()}_enableAutomaticDecorators(){const e=this.editor,i=e.commands.get("link").automaticDecorators;i.length&&e.conversion.for("downcast").add(i.getDispatcherForLinkedImage())}_enableManualDecorators(){const e=this.editor,t=e.commands.get("link");for(const i of t.manualDecorators)e.plugins.has("ImageBlockEditing")&&e.model.schema.extend("imageBlock",{allowAttributes:i.id}),e.plugins.has("ImageInlineEditing")&&e.model.schema.extend("imageInline",{allowAttributes:i.id}),e.conversion.for("downcast").add(bt(i)),e.conversion.for("upcast").add(pt(e,i))}}function gt(l){const e=l.plugins.has("ImageInlineEditing"),t=l.plugins.get("ImageUtils");return i=>{i.on("element:a",(s,n,o)=>{const a=n.viewItem,r=t.findViewImgElement(a);if(!r)return;const c=r.findAncestor(m=>t.isBlockImageView(m));if(e&&!c)return;const u={attributes:["href"]};if(!o.consumable.consume(a,u))return;const h=a.getAttribute("href");if(!h)return;let d=n.modelCursor.parent;if(!d.is("element","imageBlock")){const m=o.convertItem(r,n.modelCursor);n.modelRange=m.modelRange,n.modelCursor=m.modelCursor,d=n.modelCursor.nodeBefore}d&&d.is("element","imageBlock")&&o.writer.setAttribute("linkHref",h,d)},{priority:"high"})}}function wt(l){const e=l.plugins.get("ImageUtils");return t=>{t.on("attribute:linkHref:imageBlock",(i,s,n)=>{if(!n.consumable.consume(s.item,i.name))return;const o=n.mapper.toViewElement(s.item),a=n.writer,r=Array.from(o.getChildren()).find(h=>h.is("element","a")),c=e.findViewImgElement(o),u=c.parent.is("element","picture")?c.parent:c;if(r)s.attributeNewValue?a.setAttribute("href",s.attributeNewValue,r):(a.move(a.createRangeOn(u),a.createPositionAt(o,0)),a.remove(r));else{const h=a.createContainerElement("a",{href:s.attributeNewValue});a.insert(a.createPositionAt(o,0),h),a.move(a.createRangeOn(u),a.createPositionAt(h,0))}},{priority:"high"})}}function bt(l){return e=>{e.on(`attribute:${l.id}:imageBlock`,(t,i,s)=>{const n=s.mapper.toViewElement(i.item),o=Array.from(n.getChildren()).find(a=>a.is("element","a"));if(o){if(l.value===void 0){for(const a in l.attributes)s.writer.removeAttribute(a,o);l.classes&&s.writer.removeClass(l.classes,o);for(const a in l.styles)s.writer.removeStyle(a,o);return}for(const[a,r]of A(l.attributes))s.writer.setAttribute(a,r,o);l.classes&&s.writer.addClass(l.classes,o);for(const a in l.styles)s.writer.setStyle(a,l.styles[a],o)}})}}function pt(l,e){const t=l.plugins.has("ImageInlineEditing"),i=l.plugins.get("ImageUtils");return s=>{s.on("element:a",(n,o,a)=>{const r=o.viewItem,c=i.findViewImgElement(r);if(!c)return;const u=c.findAncestor(k=>i.isBlockImageView(k));if(t&&!u)return;const d=new ve(e._createPattern()).match(r);if(!d||!a.consumable.consume(r,d.match))return;const m=o.modelCursor.nodeBefore||o.modelCursor.parent;a.writer.setAttribute(e.id,!0,m)},{priority:"high"})}}class _t extends p{static get requires(){return[_,re,"ImageBlockEditing"]}static get pluginName(){return"LinkImageUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(i,s)=>{this._isSelectedLinkedImage(e.model.document.selection)&&(s.preventDefault(),i.stop())},{priority:"high"}),this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("linkImage",i=>{const s=new w(i),n=e.plugins.get("LinkUI"),o=e.commands.get("link");return s.set({isEnabled:!0,label:t("Link image"),icon:se,keystroke:v,tooltip:!0,isToggleable:!0}),s.bind("isEnabled").to(o,"isEnabled"),s.bind("isOn").to(o,"value",a=>!!a),this.listenTo(s,"execute",()=>{this._isSelectedLinkedImage(e.model.document.selection)?n._addToolbarView():n._showUI(!0)}),s})}_isSelectedLinkedImage(e){const t=e.getSelectedElement();return this.editor.plugins.get("ImageUtils").isImage(t)&&t.hasAttribute("linkHref")}}class St extends p{static get requires(){return[kt,_t]}static get pluginName(){return"LinkImage"}static get isOfficialPlugin(){return!0}}export{ut as AutoLink,He as AutomaticLinkDecorators,xt as Link,We as LinkCommand,_ as LinkEditing,nt as LinkFormView,St as LinkImage,kt as LinkImageEditing,_t as LinkImageUI,Ye as LinkManualDecorator,rt as LinkPropertiesView,ot as LinkProviderItemsView,re as LinkUI,Je as UnlinkCommand,v as _LINK_KEYSTROKE,lt as _LinkButtonView,st as _LinkPreviewButtonView,Y as _createLinkElement,ne as _ensureSafeLinkUrl,E as _extractTextFromLinkRange,ze as _getLocalizedLinkDecorators,oe as _hasLinkProtocol,$e as _isEmailLink,Ke as _normalizeLinkDecorators,Ge as _openLink,O as addLinkProtocolIfApplicable,ne as ensureSafeUrl,Ne as isLinkElement,P as isLinkableElement};
|