@ncino/web-components 8.0.1 → 8.1.0-preview.8
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/_slds/icons/symbols-rtl.svg +1 -1
- package/dist/_slds/icons/symbols.svg +1 -1
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index_html.js +1 -1
- package/dist/_virtual/index_react.js +1 -1
- package/dist/assets/node_modules/.pnpm/ckeditor5@46.1.1/node_modules/ckeditor5/dist/ckeditor5.css +1 -4
- package/dist/components/accordion/gator/base/accordion.gator.js +1 -1
- package/dist/components/accordion/gator/group/accordion-group.gator.js +1 -1
- package/dist/components/alert/gator/base/alert.gator.js +1 -1
- package/dist/components/alert/gator/subtitle/alert-subtitle.gator.js +1 -1
- package/dist/components/alert/gator/title/alert-title.gator.js +1 -1
- package/dist/components/avatar/gator/avatar.gator.js +1 -1
- package/dist/components/badge/gator/badge.gator.js +1 -1
- package/dist/components/banner/gator/banner.gator.js +1 -1
- package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.js +10 -4
- package/dist/components/button/gator/button.gator.js +1 -1
- package/dist/components/button-card/gator/button-card.gator.js +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/gator/base/card.gator.js +1 -1
- package/dist/components/card/gator/content/card-content.gator.js +1 -1
- package/dist/components/card/gator/footer/card-footer.gator.js +1 -1
- package/dist/components/card/gator/header/card-header.gator.js +1 -1
- package/dist/components/checkbox/checkbox.gator.js +1 -1
- package/dist/components/chip/gator/chip.gator.js +1 -1
- package/dist/components/date-picker/base/gator/datepicker.gator.js +1 -1
- package/dist/components/date-picker/year-month-selector/year-month-selector.gator.js +1 -1
- package/dist/components/display-card/gator/display-card.gator.js +1 -1
- package/dist/components/divider/gator/divider.gator.js +1 -1
- package/dist/components/fab/gator/fab.gator.js +1 -1
- package/dist/components/icon-button/gator/icon-button.gator.js +1 -1
- package/dist/components/illustration/gator/illustration.gator.js +1 -1
- package/dist/components/image-card/gator/image-card.gator.js +24 -20
- package/dist/components/input/base/input-base.gator.js +1 -1
- package/dist/components/input/gator/help-text/help-text.gator.js +1 -1
- package/dist/components/input/gator/input-phone/input-phone.gator.js +1 -1
- package/dist/components/loading-spinner/gator/loading-spinner.gator.js +1 -1
- package/dist/components/menu/base/gator/menu.gator.js +1 -1
- package/dist/components/modal/gator/modal.gator.js +54 -50
- package/dist/components/page-header/gator/page-header.gator.js +3 -3
- package/dist/components/panel/gator/panel.storybook-test.js +1 -1
- package/dist/components/popover/gator/popover.gator.js +1 -1
- package/dist/components/progress-bar/gator/progress-bar.gator.js +18 -12
- package/dist/components/progress-ring/gator/progress-ring.gator.js +1 -1
- package/dist/components/selection-box/selection-box.gator.js +1 -1
- package/dist/components/selector/gator/selector.gator.js +1 -1
- package/dist/components/skeleton-loader/gator/skeleton-loader.gator.js +1 -1
- package/dist/components/switch/gator/switch.gator.js +1 -1
- package/dist/components/table/gator/table.gator.js +1 -1
- package/dist/components/tabs/gator/tabset/tabset.gator.js +1 -1
- package/dist/components/text-detail/gator/text-detail.gator.js +1 -1
- package/dist/components/text-link/gator/text-link.gator.js +1 -1
- package/dist/components/toast/gator/base/toast.gator.js +1 -1
- package/dist/components/toast/gator/subtitle/toast-subtitle.gator.js +1 -1
- package/dist/components/toast/gator/title/toast-title.gator.js +1 -1
- package/dist/components/toast-container/gator/toast-container.gator.js +1 -1
- package/dist/components/toaster/gator/toaster.gator.js +1 -1
- package/dist/components/tooltip/gator/tooltip.gator.js +1 -1
- package/dist/design-tokens.source.json +1 -1
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-alignment@46.1.1/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autoformat@46.1.1/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autosave@46.1.1/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-basic-styles@46.1.1/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-block-quote@46.1.1/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +2 -14
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-cloud-services@46.1.1/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-code-block@46.1.1/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-editor-classic@46.1.1/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +2 -29
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-enter@46.1.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-essentials@46.1.1/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-find-and-replace@46.1.1/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +2 -5
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-font@46.1.1/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-heading@46.1.1/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-highlight@46.1.1/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-horizontal-line@46.1.1/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@46.1.1/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@46.1.1/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +1 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@46.1.1/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@46.1.1/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-language@46.1.1/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@46.1.1/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@46.1.1/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -13
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-markdown-gfm@46.1.1/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +2 -5
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@46.1.1/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-mention@46.1.1/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@46.1.1/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paragraph@46.1.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@46.1.1/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -31
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-remove-format@46.1.1/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-select-all@46.1.1/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-show-blocks@46.1.1/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@46.1.1/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@46.1.1/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-style@46.1.1/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@46.1.1/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -16
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -13
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -25
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-undo@46.1.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-upload@46.1.1/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +3 -108
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-watchdog@46.1.1/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +1 -10
- package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -4
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/package.json.js +1 -0
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/default-msg.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/deferred.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/fnv1a64.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/locale-status-event.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-controller.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js +1 -5
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/custom-element.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js +1 -5
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js +1 -5
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +1 -17
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +1 -7
- package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +1 -1
- package/dist/node_modules/.pnpm/axe-core@4.11.0/node_modules/axe-core/axe.js +1 -11
- package/dist/node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js +1 -6
- package/dist/node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.js +1 -217
- package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/conversions.js +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/index.js +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/route.js +1 -0
- package/dist/node_modules/.pnpm/color-string@2.1.4/node_modules/color-string/index.js +1 -0
- package/dist/node_modules/.pnpm/{color@5.0.2 → color@5.0.3}/node_modules/color/index.js +1 -1
- package/dist/node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js +1 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.26/node_modules/libphonenumber-js/metadata.min.json.js +1 -0
- package/dist/node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/async-directive.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/ref.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/repeat.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js +1 -5
- package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js +1 -5
- package/dist/node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.production.js +1 -9
- package/dist/node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-JVSKG4YS.js +48 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-MM7DTO55.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-OPCDBBL3.js +6 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-SN4J4IQ3.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-VUAFL5XK.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/client-logger/index.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/core-events/index.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/instrumenter/index.js +1 -0
- package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/test/index.js +152 -0
- package/dist/node_modules/.pnpm/{string_decoder@1.3.0 → string_decoder@1.1.1}/node_modules/string_decoder/lib/string_decoder.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/index.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/body.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fileapi/util.js +1 -1
- package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/frame.js +1 -1
- package/dist/packages/web-components/src/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/image-card/gator/image-card.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/modal/gator/modal.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/progress-bar/gator/progress-bar.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/text-link/gator/text-link.gator.scss.js +1 -1
- package/dist/packages/web-components/src/index.slds.scss.js +1 -1
- package/dist/types/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.d.ts +3 -5
- package/dist/types/components/image-card/gator/image-card.gator.d.ts +5 -0
- package/dist/types/components/modal/gator/modal.gator.d.ts +16 -3
- package/dist/types/components/page-header/gator/page-header.gator.d.ts +0 -1
- package/dist/types/components/progress-bar/gator/progress-bar.gator.d.ts +8 -0
- package/dist/types/generated/locale-codes.d.ts +10 -0
- package/dist/types/generated/locales/es-419.d.ts +6 -1
- package/dist/types/generated/locales/fr-CA.d.ts +6 -1
- package/dist/types/generated/locales/zh-Hans.d.ts +6 -1
- package/dist/utils/brand-color-utils.js +1 -1
- package/dist/utils/components/ngc-component.js +1 -1
- package/dist/utils/vitest-a11y-utils.js +1 -1
- package/package.json +21 -21
- package/web-types.json +15 -5
- package/dist/generated/locale-codes.d.js +0 -1
- package/dist/generated/locales/es-419.d.js +0 -1
- package/dist/generated/locales/fr-CA.d.js +0 -1
- package/dist/generated/locales/zh-Hans.d.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.7/node_modules/@figma/code-connect/package.json.js +0 -1
- package/dist/node_modules/.pnpm/color-string@2.0.1/node_modules/color-string/index.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/metadata.min.json.js +0 -1
- package/dist/node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js +0 -1
- package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5.9.3___lkgkjokudzf76cn2onqpg4zpmy/node_modules/storybook/dist/client-logger/index.js +0 -1
- package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5.9.3___lkgkjokudzf76cn2onqpg4zpmy/node_modules/storybook/dist/core-events/index.js +0 -1
- package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5.9.3___lkgkjokudzf76cn2onqpg4zpmy/node_modules/storybook/dist/instrumenter/index.js +0 -48
- package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5.9.3___lkgkjokudzf76cn2onqpg4zpmy/node_modules/storybook/dist/test/index.js +0 -217
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/client/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/fetch.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/logging.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/updates.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/helpers.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/index_html.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/react/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/react/index_react.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.10.0_typescript@5.9.3__playwright@1.56.1_vite@_goyfjr2bjpgz2pt2645hrgmcse → @vitest_browser@3.2.4_msw@2.7.3_@types_node@24.10.0_typescript@5.9.3__playwright@1.56.1_fa5be4b0345b48b65ec4b7072214c2b3}/node_modules/@vitest/browser/context.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/ParseError.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/PhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/format.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/isObject.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/isPossible.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/isValid.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/metadata.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parse.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/tools/semver-compare.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3.2.4_j_d4zn5pd34wsgn4wvyuyhrqqcse → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3.2.4_j_d4zn5pd34wsgn4wvyuyhrqqcse → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3.2.4_j_d4zn5pd34wsgn4wvyuyhrqqcse → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3.2.4_j_d4zn5pd34wsgn4wvyuyhrqqcse → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -0
- /package/dist/packages/{web-components/src/tokens/primitive.tokens.scss.js → styles/src/gator/tokens/primitive.tokens.css.js} +0 -0
- /package/dist/packages/{web-components/src/tokens/semantic.tokens.scss.js → styles/src/gator/tokens/semantic.tokens.css.js} +0 -0
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as u,Command as _}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{transformOperationSets as B,NoOperation as b}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ButtonView as y,MenuBarMenuListItemButtonView as R}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconUndo as p,IconRedo as f}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class g extends _{_stack=[];_createdBatches=new WeakSet;constructor(t){super(t),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(t.data,"set",(e,o)=>{o[1]={...o[1]};const s=o[1];s.batchType||(s.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(t.data,"set",(e,o)=>{o[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const e=this.editor.model.document.selection,o={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:o}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,o){const s=this.editor.model,i=s.document,n=[],d=t.map(r=>r.getTransformedByOperations(o)),h=d.flat();for(const r of d){const l=r.filter(c=>c.root!=i.graveyard).filter(c=>!C(c,h));l.length&&(k(l),n.push(l[0]))}n.length&&s.change(r=>{r.setSelection(n,{backward:e})})}_undo(t,e){const o=this.editor.model,s=o.document;this._createdBatches.add(e);const i=t.operations.slice().filter(n=>n.isDocumentOperation);i.reverse();for(const n of i){const d=n.baseVersion+1,h=Array.from(s.history.getOperations(d)),l=B([n.getReversed()],h,{useRelations:!0,document:this.editor.model.document,forceWeakRemove:!0}).operationsA;for(let c of l){const m=c.affectedSelectable;m&&!o.canEditAt(m)&&(c=new b(c.baseVersion)),e.addOperation(c),o.applyOperation(c),s.history.setOperationAsUndone(n,c)}}}}function k(a){a.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;t<a.length;t++){const o=a[t-1].getJoined(a[t],!0);o&&(t--,a.splice(t,2,o))}}function C(a,t){return t.some(e=>e!==a&&e.containsRange(a,!0))}class T extends g{execute(t=null){const e=t?this._stack.findIndex(i=>i.batch==t):this._stack.length-1,o=this._stack.splice(e,1)[0],s=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(s,()=>{this._undo(o.batch,s);const i=this.editor.model.document.history.getOperations(o.batch.baseVersion);this._restoreSelection(o.selection.ranges,o.selection.isBackward,i)}),this.fire("revert",o.batch,s),this.refresh()}}class U extends g{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,()=>{const s=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(s);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)}),this.refresh()}}class O extends u{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.t;this._undoCommand=new T(t),this._redoCommand=new U(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(o,s)=>{const i=s[0];if(!i.isDocumentOperation)return;const n=i.batch,d=this._redoCommand.createdBatches.has(n),h=this._undoCommand.createdBatches.has(n);this._batchRegistry.has(n)||(this._batchRegistry.add(n),n.isUndoable&&(d?this._undoCommand.addBatch(n):h||(this._undoCommand.addBatch(n),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(o,s,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Undo"),keystroke:"CTRL+Z"},{label:e("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class w extends u{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale,o=t.t,s=e.uiLanguageDirection=="ltr"?p:f,i=e.uiLanguageDirection=="ltr"?f:p;this._addButtonsToFactory("undo",o("Undo"),"CTRL+Z",s),this._addButtonsToFactory("redo",o("Redo"),"CTRL+Y",i)}_addButtonsToFactory(t,e,o,s){const i=this.editor;i.ui.componentFactory.add(t,()=>{const n=this._createButton(y,t,e,o,s);return n.set({tooltip:!0}),n}),i.ui.componentFactory.add("menuBar:"+t,()=>this._createButton(R,t,e,o,s))}_createButton(t,e,o,s,i){const n=this.editor,d=n.locale,h=n.commands.get(e),r=new t(d);return r.set({label:o,icon:i,keystroke:s}),r.bind("isEnabled").to(h,"isEnabled"),this.listenTo(r,"execute",()=>{n.execute(e),n.editing.view.focus()}),r}}class L extends u{static get requires(){return[O,w]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}export{U as RedoCommand,L as Undo,T as UndoCommand,O as UndoEditing,g as UndoRedoBaseCommand,w as UndoUI};
|
|
1
|
+
import{Plugin as u,Command as _}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{transformOperationSets as B,NoOperation as b}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ButtonView as y,MenuBarMenuListItemButtonView as R}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconUndo as p,IconRedo as f}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";class g extends _{_stack=[];_createdBatches=new WeakSet;constructor(t){super(t),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(t.data,"set",(e,o)=>{o[1]={...o[1]};const s=o[1];s.batchType||(s.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(t.data,"set",(e,o)=>{o[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const e=this.editor.model.document.selection,o={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:o}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,o){const s=this.editor.model,i=s.document,n=[],d=t.map(r=>r.getTransformedByOperations(o)),h=d.flat();for(const r of d){const l=r.filter(c=>c.root!=i.graveyard).filter(c=>!C(c,h));l.length&&(k(l),n.push(l[0]))}n.length&&s.change(r=>{r.setSelection(n,{backward:e})})}_undo(t,e){const o=this.editor.model,s=o.document;this._createdBatches.add(e);const i=t.operations.slice().filter(n=>n.isDocumentOperation);i.reverse();for(const n of i){const d=n.baseVersion+1,h=Array.from(s.history.getOperations(d)),l=B([n.getReversed()],h,{useRelations:!0,document:this.editor.model.document,forceWeakRemove:!0}).operationsA;for(let c of l){const m=c.affectedSelectable;m&&!o.canEditAt(m)&&(c=new b(c.baseVersion)),e.addOperation(c),o.applyOperation(c),s.history.setOperationAsUndone(n,c)}}}}function k(a){a.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;t<a.length;t++){const o=a[t-1].getJoined(a[t],!0);o&&(t--,a.splice(t,2,o))}}function C(a,t){return t.some(e=>e!==a&&e.containsRange(a,!0))}class T extends g{execute(t=null){const e=t?this._stack.findIndex(i=>i.batch==t):this._stack.length-1,o=this._stack.splice(e,1)[0],s=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(s,()=>{this._undo(o.batch,s);const i=this.editor.model.document.history.getOperations(o.batch.baseVersion);this._restoreSelection(o.selection.ranges,o.selection.isBackward,i)}),this.fire("revert",o.batch,s),this.refresh()}}class U extends g{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,()=>{const s=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(s);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)}),this.refresh()}}class O extends u{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.t;this._undoCommand=new T(t),this._redoCommand=new U(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(o,s)=>{const i=s[0];if(!i.isDocumentOperation)return;const n=i.batch,d=this._redoCommand.createdBatches.has(n),h=this._undoCommand.createdBatches.has(n);this._batchRegistry.has(n)||(this._batchRegistry.add(n),n.isUndoable&&(d?this._undoCommand.addBatch(n):h||(this._undoCommand.addBatch(n),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(o,s,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Undo"),keystroke:"CTRL+Z"},{label:e("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class w extends u{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale,o=t.t,s=e.uiLanguageDirection=="ltr"?p:f,i=e.uiLanguageDirection=="ltr"?f:p;this._addButtonsToFactory("undo",o("Undo"),"CTRL+Z",s),this._addButtonsToFactory("redo",o("Redo"),"CTRL+Y",i)}_addButtonsToFactory(t,e,o,s){const i=this.editor;i.ui.componentFactory.add(t,()=>{const n=this._createButton(y,t,e,o,s);return n.set({tooltip:!0}),n}),i.ui.componentFactory.add("menuBar:"+t,()=>this._createButton(R,t,e,o,s))}_createButton(t,e,o,s,i){const n=this.editor,d=n.locale,h=n.commands.get(e),r=new t(d);return r.set({label:o,icon:i,keystroke:s}),r.bind("isEnabled").to(h,"isEnabled"),this.listenTo(r,"execute",()=>{n.execute(e),n.editing.view.focus()}),r}}class L extends u{static get requires(){return[O,w]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}export{U as RedoCommand,L as Undo,T as UndoCommand,O as UndoEditing,g as UndoRedoBaseCommand,w as UndoUI};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{Plugin as h,PendingActions as o}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Collection as u,logWarning as c,ObservableMixin as p,uid as g,CKEditorError as d}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/class _ extends p(){total;_reader;_data;constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((r,s)=>{t.onload=()=>{const a=t.result;this._data=a,r(a)},t.onerror=()=>{s("error")},t.onabort=()=>{s("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class n extends h{loaders=new u;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[o]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return c("filerepository-no-upload-adapter"),null;const t=new l(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(r=>{this._loadersMap.set(r,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let r=0;for(const s of this.loaders)r+=s.uploaded;this.uploaded=r}),t.on("change:uploadTotal",()=>{let r=0;for(const s of this.loaders)s.uploadTotal&&(r+=s.uploadTotal);this.uploadTotal=r}),t}destroyLoader(e){const t=e instanceof l?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((r,s)=>{r===t&&this._loadersMap.delete(s)})}_updatePendingAction(){const e=this.editor.plugins.get(o);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,r=s=>`${t("Upload in progress")} ${parseInt(s)}%.`;this._pendingAction=e.add(r(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",r)}}else e.remove(this._pendingAction),this._pendingAction=null}}class l extends p(){id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=g(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new _,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(r,s)=>s?r/s*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new d("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new d("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((r,s)=>{t.rejecter=s,t.isFulfilled=!1,e.then(a=>{t.isFulfilled=!0,r(a)}).catch(a=>{t.isFulfilled=!0,s(a)})}),t}}class b extends h{static get requires(){return[n]}static get pluginName(){return"Base64UploadAdapter"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(n).createUploadAdapter=e=>new f(e)}}let f=class{loader;reader;constructor(e){this.loader=e}upload(){return new Promise((e,t)=>{const r=this.reader=new window.FileReader;r.addEventListener("load",()=>{e({default:r.result})}),r.addEventListener("error",s=>{t(s)}),r.addEventListener("abort",()=>{t()}),this.loader.file.then(s=>{r.readAsDataURL(s)})})}abort(){this.reader.abort()}};export{b as Base64UploadAdapter,_ as FileReader,n as FileRepository};
|
|
1
|
+
import{Plugin as h,PendingActions as o}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Collection as u,logWarning as c,ObservableMixin as p,uid as g,CKEditorError as d}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";class _ extends p(){total;_reader;_data;constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((r,s)=>{t.onload=()=>{const a=t.result;this._data=a,r(a)},t.onerror=()=>{s("error")},t.onabort=()=>{s("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class n extends h{loaders=new u;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[o]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return c("filerepository-no-upload-adapter"),null;const t=new l(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(r=>{this._loadersMap.set(r,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let r=0;for(const s of this.loaders)r+=s.uploaded;this.uploaded=r}),t.on("change:uploadTotal",()=>{let r=0;for(const s of this.loaders)s.uploadTotal&&(r+=s.uploadTotal);this.uploadTotal=r}),t}destroyLoader(e){const t=e instanceof l?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((r,s)=>{r===t&&this._loadersMap.delete(s)})}_updatePendingAction(){const e=this.editor.plugins.get(o);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,r=s=>`${t("Upload in progress")} ${parseInt(s)}%.`;this._pendingAction=e.add(r(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",r)}}else e.remove(this._pendingAction),this._pendingAction=null}}class l extends p(){id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=g(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new _,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(r,s)=>s?r/s*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new d("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new d("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((r,s)=>{t.rejecter=s,t.isFulfilled=!1,e.then(a=>{t.isFulfilled=!0,r(a)}).catch(a=>{t.isFulfilled=!0,s(a)})}),t}}class b extends h{static get requires(){return[n]}static get pluginName(){return"Base64UploadAdapter"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(n).createUploadAdapter=e=>new f(e)}}let f=class{loader;reader;constructor(e){this.loader=e}upload(){return new Promise((e,t)=>{const r=this.reader=new window.FileReader;r.addEventListener("load",()=>{e({default:r.result})}),r.addEventListener("error",s=>{t(s)}),r.addEventListener("abort",()=>{t()}),this.loader.file.then(s=>{r.readAsDataURL(s)})})}abort(){this.reader.abort()}};export{b as Base64UploadAdapter,_ as FileReader,n as FileRepository};
|
|
@@ -1,113 +1,8 @@
|
|
|
1
|
-
import{isObject as Ot}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isObject.js";import{isString as nt}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isString.js";import{isFunction as it}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isFunction.js";import{isElement as Et}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{isPlainObject as F}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js";import{cloneDeepWith as Wt}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";import{merge as Kt}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/merge.js"
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*//**
|
|
5
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
6
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
7
|
-
*/let _;try{_={window,document}}catch{/* istanbul ignore next -- @preserve */_={window:{},document:{}}}function $t(){try{return navigator.userAgent.toLowerCase()}catch{return""}}const T=$t(),C={isMac:Tt(T),isWindows:Ht(T),isGecko:Ut(T),isSafari:Gt(T),isiOS:qt(T),isAndroid:Yt(T),isBlink:Xt(T),get isMediaForcedColors(){return Jt()}};function Tt(e){return e.indexOf("macintosh")>-1}function Ht(e){return e.indexOf("windows")>-1}function Ut(e){return!!e.match(/gecko\/\d+/)}function Gt(e){return e.indexOf(" applewebkit/")>-1&&e.indexOf("chrome")===-1}function qt(e){return!!e.match(/iphone|ipad/i)||Tt(e)&&navigator.maxTouchPoints>0}function Yt(e){return e.indexOf("android")>-1}function Xt(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function Jt(){return _.window.matchMedia?_.window.matchMedia("(forced-colors: active)").matches:!1}/**
|
|
8
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
9
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
10
|
-
*/function Qt(e,t,n,i){n=n||function(a,c){return a===c};const s=Array.isArray(e)?e:Array.prototype.slice.call(e),o=Array.isArray(t)?t:Array.prototype.slice.call(t),r=Zt(s,o,n);return i?te(r,o.length):zt(o,r)}function Zt(e,t,n){const i=st(e,t,n);if(i===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=ot(e,i),o=ot(t,i),r=st(s,o,n),l=e.length-r,a=t.length-r;return{firstIndex:i,lastIndexOld:l,lastIndexNew:a}}function st(e,t,n){for(let i=0;i<Math.max(e.length,t.length);i++)if(e[i]===void 0||t[i]===void 0||!n(e[i],t[i]))return i;return-1}function ot(e,t){return e.slice(t).reverse()}function zt(e,t){const n=[],{firstIndex:i,lastIndexOld:s,lastIndexNew:o}=t;return o-i>0&&n.push({index:i,type:"insert",values:e.slice(i,o)}),s-i>0&&n.push({index:i+(o-i),type:"delete",howMany:s-i}),n}function te(e,t){const{firstIndex:n,lastIndexOld:i,lastIndexNew:s}=e;if(n===-1)return Array(t).fill("equal");let o=[];return n>0&&(o=o.concat(Array(n).fill("equal"))),s-n>0&&(o=o.concat(Array(s-n).fill("insert"))),i-n>0&&(o=o.concat(Array(i-n).fill("delete"))),s<t&&(o=o.concat(Array(t-s).fill("equal"))),o}function xt(e,t,n){n=n||function(p,k){return p===k};const i=e.length,s=t.length;if(i>200||s>200||i+s>300)return xt.fastDiff(e,t,n,!0);let o,r;if(s<i){const p=e;e=t,t=p,o="delete",r="insert"}else o="insert",r="delete";const l=e.length,a=t.length,c=a-l,f={},u={};function w(p){const k=(u[p-1]!==void 0?u[p-1]:-1)+1,D=u[p+1]!==void 0?u[p+1]:-1,et=k>D?-1:1;f[p+et]&&(f[p]=f[p+et].slice(0)),f[p]||(f[p]=[]),f[p].push(k>D?o:r);let M=Math.max(k,D),j=M-p;for(;j<l&&M<a&&n(e[j],t[M]);)j++,M++,f[p].push("equal");return M}let L=0,y;do{for(y=-L;y<c;y++)u[y]=w(y);for(y=c+L;y>c;y--)u[y]=w(y);u[c]=w(c),L++}while(u[c]!==a);return f[c].slice(1)}xt.fastDiff=Qt;/**
|
|
11
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
12
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
13
|
-
*/function rt(){return function e(){e.called=!0}}class H{source;name;path;stop;off;return;constructor(t,n){this.source=t,this.name=n,this.path=[],this.stop=rt(),this.off=rt()}}/**
|
|
14
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
15
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
16
|
-
*/const b=new Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function X(){const[e,t,n,i]=crypto.getRandomValues(new Uint32Array(4));return"e"+b[e>>0&255]+b[e>>8&255]+b[e>>16&255]+b[e>>24&255]+b[t>>0&255]+b[t>>8&255]+b[t>>16&255]+b[t>>24&255]+b[n>>0&255]+b[n>>8&255]+b[n>>16&255]+b[n>>24&255]+b[i>>0&255]+b[i>>8&255]+b[i>>16&255]+b[i>>24&255]}/**
|
|
17
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
18
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
19
|
-
*/const U={get(e="normal"){return typeof e!="number"?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function ee(e,t){const n=U.get(t.priority);let i=0,s=e.length;for(;i<s;){const o=i+s>>1;U.get(e[o].priority)<n?s=o:i=o+1}e.splice(i,0,t)}/**
|
|
20
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
21
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
22
|
-
*/const ne="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";class d extends Error{context;data;constructor(t,n,i,s){super(ie(t,i,s)),this.name="CKEditorError",this.context=n,this.data=i,s&&(this.stack=s.stack)}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,n){throw t.is&&t.is("CKEditorError")?t:new d("unexpected-error",n,void 0,t)}}function un(e,t){console.warn(...At(e,t))}function dn(e,t){console.error(...At(e,t))}function It(e){return`
|
|
1
|
+
import{isObject as Ot}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isObject.js";import{isString as nt}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isString.js";import{isFunction as it}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isFunction.js";import{isElement as Et}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{isPlainObject as F}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js";import{cloneDeepWith as Wt}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";import{merge as Kt}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/merge.js";let _;try{_={window,document}}catch{_={window:{},document:{}}}function $t(){try{return navigator.userAgent.toLowerCase()}catch{return""}}const T=$t(),C={isMac:Tt(T),isWindows:Ht(T),isGecko:Ut(T),isSafari:Gt(T),isiOS:qt(T),isAndroid:Yt(T),isBlink:Xt(T),get isMediaForcedColors(){return Jt()}};function Tt(e){return e.indexOf("macintosh")>-1}function Ht(e){return e.indexOf("windows")>-1}function Ut(e){return!!e.match(/gecko\/\d+/)}function Gt(e){return e.indexOf(" applewebkit/")>-1&&e.indexOf("chrome")===-1}function qt(e){return!!e.match(/iphone|ipad/i)||Tt(e)&&navigator.maxTouchPoints>0}function Yt(e){return e.indexOf("android")>-1}function Xt(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function Jt(){return _.window.matchMedia?_.window.matchMedia("(forced-colors: active)").matches:!1}function Qt(e,t,n,i){n=n||function(a,c){return a===c};const s=Array.isArray(e)?e:Array.prototype.slice.call(e),o=Array.isArray(t)?t:Array.prototype.slice.call(t),r=Zt(s,o,n);return i?te(r,o.length):zt(o,r)}function Zt(e,t,n){const i=st(e,t,n);if(i===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=ot(e,i),o=ot(t,i),r=st(s,o,n),l=e.length-r,a=t.length-r;return{firstIndex:i,lastIndexOld:l,lastIndexNew:a}}function st(e,t,n){for(let i=0;i<Math.max(e.length,t.length);i++)if(e[i]===void 0||t[i]===void 0||!n(e[i],t[i]))return i;return-1}function ot(e,t){return e.slice(t).reverse()}function zt(e,t){const n=[],{firstIndex:i,lastIndexOld:s,lastIndexNew:o}=t;return o-i>0&&n.push({index:i,type:"insert",values:e.slice(i,o)}),s-i>0&&n.push({index:i+(o-i),type:"delete",howMany:s-i}),n}function te(e,t){const{firstIndex:n,lastIndexOld:i,lastIndexNew:s}=e;if(n===-1)return Array(t).fill("equal");let o=[];return n>0&&(o=o.concat(Array(n).fill("equal"))),s-n>0&&(o=o.concat(Array(s-n).fill("insert"))),i-n>0&&(o=o.concat(Array(i-n).fill("delete"))),s<t&&(o=o.concat(Array(t-s).fill("equal"))),o}function xt(e,t,n){n=n||function(p,k){return p===k};const i=e.length,s=t.length;if(i>200||s>200||i+s>300)return xt.fastDiff(e,t,n,!0);let o,r;if(s<i){const p=e;e=t,t=p,o="delete",r="insert"}else o="insert",r="delete";const l=e.length,a=t.length,c=a-l,f={},u={};function w(p){const k=(u[p-1]!==void 0?u[p-1]:-1)+1,D=u[p+1]!==void 0?u[p+1]:-1,et=k>D?-1:1;f[p+et]&&(f[p]=f[p+et].slice(0)),f[p]||(f[p]=[]),f[p].push(k>D?o:r);let M=Math.max(k,D),j=M-p;for(;j<l&&M<a&&n(e[j],t[M]);)j++,M++,f[p].push("equal");return M}let L=0,y;do{for(y=-L;y<c;y++)u[y]=w(y);for(y=c+L;y>c;y--)u[y]=w(y);u[c]=w(c),L++}while(u[c]!==a);return f[c].slice(1)}xt.fastDiff=Qt;function rt(){return function e(){e.called=!0}}class H{source;name;path;stop;off;return;constructor(t,n){this.source=t,this.name=n,this.path=[],this.stop=rt(),this.off=rt()}}const b=new Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function X(){const[e,t,n,i]=crypto.getRandomValues(new Uint32Array(4));return"e"+b[e>>0&255]+b[e>>8&255]+b[e>>16&255]+b[e>>24&255]+b[t>>0&255]+b[t>>8&255]+b[t>>16&255]+b[t>>24&255]+b[n>>0&255]+b[n>>8&255]+b[n>>16&255]+b[n>>24&255]+b[i>>0&255]+b[i>>8&255]+b[i>>16&255]+b[i>>24&255]}const U={get(e="normal"){return typeof e!="number"?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function ee(e,t){const n=U.get(t.priority);let i=0,s=e.length;for(;i<s;){const o=i+s>>1;U.get(e[o].priority)<n?s=o:i=o+1}e.splice(i,0,t)}const ne="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";class d extends Error{context;data;constructor(t,n,i,s){super(ie(t,i,s)),this.name="CKEditorError",this.context=n,this.data=i,s&&(this.stack=s.stack)}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,n){throw t.is&&t.is("CKEditorError")?t:new d("unexpected-error",n,void 0,t)}}function un(e,t){console.warn(...At(e,t))}function dn(e,t){console.error(...At(e,t))}function It(e){return`
|
|
23
2
|
Read more: ${ne}#error-${e}`}function ie(e,t,n){const i=new WeakSet,o=t?` ${JSON.stringify(t,(a,c)=>{if(typeof c=="object"&&c!==null){if(i.has(c))return`[object ${c.constructor.name}]`;i.add(c)}return c})}`:"",r=It(e),l=n?`
|
|
24
|
-
Original error: ${n.name}: ${n.message}`:"";return e+o+r+l}function At(e,t){const n=It(e);return t?[e,t,n]:[e,n]}const se="46.1.1",hn=new Date(2025,8,15);/* istanbul ignore next -- @preserve */if(globalThis.CKEDITOR_VERSION)throw new d("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=se;const A=Symbol("listeningTo"),G=Symbol("emitterId"),E=Symbol("delegations"),oe=I(Object);function I(e){if(!e)return oe;class t extends e{on(i,s,o){this.listenTo(this,i,s,o)}once(i,s,o){let r=!1;const l=(a,...c)=>{r||(r=!0,a.off(),s.call(this,a,...c))};this.listenTo(this,i,l,o)}off(i,s){this.stopListening(this,i,s)}listenTo(i,s,o,r={}){let l,a;this[A]||(this[A]={});const c=this[A];O(i)||Ct(i);const f=O(i);(l=c[f])||(l=c[f]={emitter:i,callbacks:{}}),(a=l.callbacks[s])||(a=l.callbacks[s]=[]),a.push(o),fe(this,i,s,o,r)}stopListening(i,s,o){const r=this[A];let l=i&&O(i);const a=r&&l?r[l]:void 0,c=a&&s?a.callbacks[s]:void 0;if(!(!r||i&&!a||s&&!c))if(o)W(this,i,s,o),c.indexOf(o)!==-1&&(c.length===1?delete a.callbacks[s]:W(this,i,s,o));else if(c){for(;o=c.pop();)W(this,i,s,o);delete a.callbacks[s]}else if(a){for(s in a.callbacks)this.stopListening(i,s);delete r[l]}else{for(l in r)this.stopListening(r[l].emitter);delete this[A]}}fire(i,...s){try{const o=i instanceof H?i:new H(this,i),r=o.name;let l=ae(this,r);if(o.path.push(this),l){l=l.slice();for(let c=0;c<l.length;c++){const f=l[c].callback;if(f.call(this,o,...s),o.off.called&&(delete o.off.called,this._removeEventListener(r,f)),o.stop.called)break}}const a=this[E];if(a){const c=a.get(r),f=a.get("*");c&<(c,o,s),f&<(f,o,s)}return o.return}catch(o){/* istanbul ignore next -- @preserve */d.rethrowUnexpectedError(o,this)}}delegate(...i){return{to:(s,o)=>{this[E]||(this[E]=new Map),i.forEach(r=>{const l=this[E].get(r);l?l.set(s,o):this[E].set(r,new Map([[s,o]]))})}}}stopDelegating(i,s){if(this[E])if(!i)this[E].clear();else if(!s)this[E].delete(i);else{const o=this[E].get(i);o&&o.delete(s)}}_addEventListener(i,s,o){ce(this,i);const r=q(this,i),l=U.get(o.priority),a={callback:s,priority:l};for(const c of r)ee(c,a)}_removeEventListener(i,s){const o=q(this,i);for(const r of o)for(let l=0;l<r.length;l++)r[l].callback==s&&(r.splice(l,1),l--)}}return t}function re(e,t){const n=e[A];return n&&n[t]?n[t].emitter:null}function Ct(e,t){e[G]||(e[G]=t||X())}function O(e){return e[G]}function Lt(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function le(){return{callbacks:[],childEvents:[]}}function ce(e,t){const n=Lt(e);if(n[t])return;let i=t,s=null;const o=[];for(;i!==""&&!n[i];)n[i]=le(),o.push(n[i]),s&&n[i].childEvents.push(s),s=i,i=i.substr(0,i.lastIndexOf(":"));if(i!==""){for(const r of o)r.callbacks=n[i].callbacks.slice();n[i].childEvents.push(s)}}function q(e,t){const n=Lt(e)[t];if(!n)return[];let i=[n.callbacks];for(let s=0;s<n.childEvents.length;s++){const o=q(e,n.childEvents[s]);i=i.concat(o)}return i}function ae(e,t){if(!e._events)return null;let n=t;do{const i=e._events[n];if(i&&i.callbacks&&i.callbacks.length)return i.callbacks;const s=n.lastIndexOf(":");n=s>-1?n.substring(0,s):""}while(n);return null}function lt(e,t,n){for(let[i,s]of e){s?typeof s=="function"&&(s=s(t.name)):s=t.name;const o=new H(t.source,s);o.path=[...t.path],i.fire(o,...n)}}function fe(e,t,n,i,s){t._addEventListener?t._addEventListener(n,i,s):e._addEventListener.call(t,n,i,s)}function W(e,t,n,i){t._removeEventListener?t._removeEventListener(n,i):e._removeEventListener.call(t,n,i)}const S=Symbol("observableProperties"),R=Symbol("boundObservables"),V=Symbol("boundProperties"),x=Symbol("decoratedMethods"),ct=Symbol("decoratedOriginal"),ue=kt(I());function kt(e){if(!e)return ue;class t extends e{set(i,s){if(Ot(i)){Object.keys(i).forEach(r=>{this.set(r,i[r])},this);return}K(this);const o=this[S];if(i in this&&!o.has(i))throw new d("observable-set-cannot-override",this);Object.defineProperty(this,i,{enumerable:!0,configurable:!0,get(){return o.get(i)},set(r){const l=o.get(i);let a=this.fire(`set:${i}`,i,r,l);a===void 0&&(a=r),(l!==a||!o.has(i))&&(o.set(i,a),this.fire(`change:${i}`,i,a,l))}}),this[i]=s}bind(...i){if(!i.length||!at(i))throw new d("observable-bind-wrong-properties",this);if(new Set(i).size!==i.length)throw new d("observable-bind-duplicate-properties",this);K(this);const s=this[V];i.forEach(r=>{if(s.has(r))throw new d("observable-bind-rebind",this)});const o=new Map;return i.forEach(r=>{const l={property:r,to:[]};s.set(r,l),o.set(r,l)}),{to:de,toMany:he,_observable:this,_bindProperties:i,_to:[],_bindings:o}}unbind(...i){if(!this[S])return;const s=this[V],o=this[R];if(i.length){if(!at(i))throw new d("observable-unbind-wrong-properties",this);i.forEach(r=>{const l=s.get(r);l&&(l.to.forEach(([a,c])=>{const f=o.get(a),u=f[c];u.delete(l),u.size||delete f[c],Object.keys(f).length||(o.delete(a),this.stopListening(a,"change"))}),s.delete(r))})}else o.forEach((r,l)=>{this.stopListening(l,"change")}),o.clear(),s.clear()}decorate(i){K(this);const s=this[i];if(!s)throw new d("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:i});this.on(i,(o,r)=>{o.return=s.apply(this,r)}),this[i]=function(...o){return this.fire(i,o)},this[i][ct]=s,this[x]||(this[x]=[]),this[x].push(i)}stopListening(i,s,o){if(!i&&this[x]){for(const r of this[x])this[r]=this[r][ct];delete this[x]}super.stopListening(i,s,o)}[S];[x];[V];[R]}return t}function K(e){e[S]||(Object.defineProperty(e,S,{value:new Map}),Object.defineProperty(e,R,{value:new Map}),Object.defineProperty(e,V,{value:new Map}))}function de(...e){const t=ge(...e),n=Array.from(this._bindings.keys()),i=n.length;if(!t.callback&&t.to.length>1)throw new d("observable-bind-to-no-callback",this);if(i>1&&t.callback)throw new d("observable-bind-to-extra-callback",this);t.to.forEach(s=>{if(s.properties.length&&s.properties.length!==i)throw new d("observable-bind-to-properties-length",this);s.properties.length||(s.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),_e(this._observable,this._to),be(this),this._bindProperties.forEach(s=>{Mt(this._observable,s)})}function he(e,t,n){if(this._bindings.size>1)throw new d("observable-bind-to-many-not-one-binding",this);this.to(...pe(e,t),n)}function pe(e,t){const n=e.map(i=>[i,t]);return Array.prototype.concat.apply([],n)}function at(e){return e.every(t=>typeof t=="string")}function ge(...e){if(!e.length)throw new d("observable-bind-to-parse-error",null);const t={to:[]};let n;return typeof e[e.length-1]=="function"&&(t.callback=e.pop()),e.forEach(i=>{if(typeof i=="string")n.properties.push(i);else if(typeof i=="object")n={observable:i,properties:[]},t.to.push(n);else throw new d("observable-bind-to-parse-error",null)}),t}function me(e,t,n,i){const s=e[R],o=s.get(n),r=o||{};r[i]||(r[i]=new Set),r[i].add(t),o||s.set(n,r)}function be(e){let t;e._bindings.forEach((n,i)=>{e._to.forEach(s=>{t=s.properties[n.callback?0:e._bindProperties.indexOf(i)],n.to.push([s.observable,t]),me(e._observable,n,s.observable,t)})})}function Mt(e,t){const i=e[V].get(t);let s;i.callback?s=i.callback.apply(e,i.to.map(o=>o[0][o[1]])):(s=i.to[0],s=s[0][s[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=s:e.set(t,s)}function _e(e,t){t.forEach(n=>{const i=e[R];let s;i.get(n.observable)||e.listenTo(n.observable,"change",(o,r)=>{s=i.get(n.observable)[r],s&&s.forEach(l=>{Mt(e,l.property)})})})}/**
|
|
25
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
26
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
27
|
-
*/class pn{_replacedElements;constructor(){this._replacedElements=[]}replace(t,n){this._replacedElements.push({element:t,newElement:n}),t.style.display="none",n&&t.parentNode.insertBefore(n,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:n})=>{t.style.display="",n&&n.remove()}),this._replacedElements=[]}}/**
|
|
28
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
29
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
30
|
-
*/function gn(e){let t=0;for(const n of e)t++;return t}/**
|
|
31
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
32
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
33
|
-
*/function mn(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)if(e[i]!=t[i])return i;return e.length==t.length?"same":e.length<t.length?"prefix":"extension"}/**
|
|
34
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
35
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
36
|
-
*/function J(e){return!!(e&&e[Symbol.iterator])}function bn(e,t,n={},i=[]){const s=n&&n.xmlns,o=s?e.createElementNS(s,t):e.createElement(t);for(const r in n)o.setAttribute(r,n[r]);(nt(i)||!J(i))&&(i=[i]);for(let r of i)nt(r)&&(r=e.createTextNode(r)),o.appendChild(r);return o}class _n{_config;constructor(t,n){this._config=Object.create(null),n&&this.define(ft(n)),t&&this._setObjectToTarget(this._config,t)}set(t,n){this._setToTarget(this._config,t,n)}define(t,n){this._setToTarget(this._config,t,n,!0)}get(t){return this._getFromSource(this._config,t)}*names(){for(const t of Object.keys(this._config))yield t}_setToTarget(t,n,i,s=!1){if(F(n)){this._setObjectToTarget(t,n,s);return}const o=n.split(".");n=o.pop();for(const r of o)F(t[r])||(t[r]=Object.create(null)),t=t[r];if(F(i)){F(t[n])||(t[n]=Object.create(null)),t=t[n],this._setObjectToTarget(t,i,s);return}s&&typeof t[n]<"u"||(t[n]=i)}_getFromSource(t,n){const i=n.split(".");n=i.pop();for(const s of i){if(!F(t[s])){t=null;break}t=t[s]}return t?ft(t[n]):void 0}_setObjectToTarget(t,n,i){Object.keys(n).forEach(s=>{this._setToTarget(t,s,n[s],i)})}}function ft(e){return Wt(e,we)}function we(e){return Et(e)||typeof e=="function"?e:void 0}/**
|
|
37
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
38
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
39
|
-
*/function ut(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}/**
|
|
40
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
41
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
42
|
-
*/function N(e){const t=Object.prototype.toString.apply(e);return t=="[object Window]"||t=="[object global]"}const ye=Q(I());function Q(e){if(!e)return ye;class t extends e{listenTo(i,s,o,r={}){if(ut(i)||N(i)||i instanceof _.window.EventTarget){const l={capture:!!r.useCapture,passive:!!r.usePassive},a=this._getProxyEmitter(i,l)||new Ee(i,l);this.listenTo(a,s,o,r)}else super.listenTo(i,s,o,r)}stopListening(i,s,o){if(ut(i)||N(i)||i instanceof _.window.EventTarget){const r=this._getAllProxyEmitters(i);for(const l of r)this.stopListening(l,s,o)}else super.stopListening(i,s,o)}_getProxyEmitter(i,s){return re(this,Ft(i,s))}_getAllProxyEmitters(i){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(s=>this._getProxyEmitter(i,s)).filter(s=>!!s)}}return t}class Ee extends I(){_domNode;_options;constructor(t,n){super(),Ct(this,Ft(t,n)),this._domNode=t,this._options=n}_domListeners;attach(t){if(this._domListeners&&this._domListeners[t])return;const n=this._createDomListener(t);this._domNode.addEventListener(t,n,this._options),this._domListeners||(this._domListeners={}),this._domListeners[t]=n}detach(t){let n;this._domListeners[t]&&(!(n=this._events[t])||!n.callbacks.length)&&this._domListeners[t].removeListener()}_addEventListener(t,n,i){this.attach(t),I().prototype._addEventListener.call(this,t,n,i)}_removeEventListener(t,n){I().prototype._removeEventListener.call(this,t,n),this.detach(t)}_createDomListener(t){const n=i=>{this.fire(t,i)};return n.removeListener=()=>{this._domNode.removeEventListener(t,n,this._options),delete this._domListeners[t]},n}}function Te(e){return e["data-ck-expando"]||(e["data-ck-expando"]=X())}function Ft(e,t){let n=Te(e);for(const i of Object.keys(t).sort())t[i]&&(n+="-"+i);return n}/**
|
|
43
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
44
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
45
|
-
*/function wn(e){const t=[];let n=e;for(;n&&n.nodeType!=Node.DOCUMENT_NODE;)t.unshift(n),n=n.parentNode;return t}/**
|
|
46
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
47
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
48
|
-
*/function yn(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}/**
|
|
49
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
50
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
51
|
-
*/function St(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}/**
|
|
52
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
53
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
54
|
-
*/function En(e){if(!e.target)return null;const t=e.target.ownerDocument,n=e.clientX,i=e.clientY;let s=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(n,i)?s=t.caretRangeFromPoint(n,i):e.rangeParent&&(s=t.createRange(),s.setStart(e.rangeParent,e.rangeOffset),s.collapse(!0)),s}function Vt(e){return!e||!e.parentNode||e.offsetParent===_.document.body?null:e.offsetParent}/**
|
|
55
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
56
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
57
|
-
*/function Z(e){return Object.prototype.toString.call(e)=="[object Text]"}/**
|
|
58
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
59
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
60
|
-
*/function z(e){return Object.prototype.toString.apply(e)=="[object Range]"}const Rt=["top","right","bottom","left","width","height"];class m{top;right;bottom;left;width;height;_source;constructor(t){const n=z(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),Y(t)||n)if(n){const i=m.getDomRangeRects(t);v(this,m.getBoundingRect(i))}else v(this,t.getBoundingClientRect());else if(N(t)){const{innerWidth:i,innerHeight:s}=t;v(this,{top:0,right:i,bottom:s,left:0,width:i,height:s})}else v(this,t)}clone(){return new m(this)}moveTo(t,n){return this.top=n,this.right=t+this.width,this.bottom=n+this.height,this.left=t,this}moveBy(t,n){return this.top+=n,this.right+=t,this.left+=t,this.bottom+=n,this}getIntersection(t){const n={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left),width:0,height:0};if(n.width=n.right-n.left,n.height=n.bottom-n.top,n.width<0||n.height<0)return null;{const i=new m(n);return i._source=this._source,i}}getIntersectionArea(t){const n=this.getIntersection(t);return n?n.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let n=this.clone();if(dt(t))return n;let i=t,s=t.parentNode||t.commonAncestorContainer,o;for(;s&&!dt(s);){const r=xe(s)==="visible";i instanceof HTMLElement&&ht(i)==="absolute"&&(o=i);const l=ht(s);if(r||o&&(l==="relative"&&r||l!=="relative")){i=s,s=s.parentNode;continue}const a=new m(s),c=n.getIntersection(a);if(c)c.getArea()<n.getArea()&&(n=c);else return null;i=s,s=s.parentNode}return n}isEqual(t){for(const n of Rt)if(this[n]!==t[n])return!1;return!0}contains(t){const n=this.getIntersection(t);return!!(n&&n.isEqual(t))}toAbsoluteRect(){const{scrollX:t,scrollY:n}=_.window,i=this.clone().moveBy(t,n);if(Y(i._source)){const s=Vt(i._source);s&&Ie(i,s)}return i}excludeScrollbarsAndBorders(){const t=this._source;let n,i,s;if(N(t))n=t.innerWidth-t.document.documentElement.clientWidth,i=t.innerHeight-t.document.documentElement.clientHeight,s=t.getComputedStyle(t.document.documentElement).direction;else{const o=St(t);n=t.offsetWidth-t.clientWidth-o.left-o.right,i=t.offsetHeight-t.clientHeight-o.top-o.bottom,s=t.ownerDocument.defaultView.getComputedStyle(t).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=n,s==="ltr"?this.right-=n:this.left+=n,this.height-=i,this.bottom-=i,this}static getDomRangeRects(t){const n=[],i=Array.from(t.getClientRects());if(i.length)for(const s of i)n.push(new m(s));else{let s=t.startContainer;Z(s)&&(s=s.parentNode);const o=new m(s.getBoundingClientRect());o.right=o.left,o.width=0,n.push(o)}return n}static getBoundingRect(t){const n={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const s of t)i++,n.left=Math.min(n.left,s.left),n.top=Math.min(n.top,s.top),n.right=Math.max(n.right,s.right),n.bottom=Math.max(n.bottom,s.bottom);return i==0?null:(n.width=n.right-n.left,n.height=n.bottom-n.top,new m(n))}}function v(e,t){for(const n of Rt)e[n]=t[n]}function dt(e){return Y(e)?e===e.ownerDocument.body:!1}function Y(e){return e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.getBoundingClientRect=="function"}function ht(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).position:"static"}function xe(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).overflow:"visible"}function Ie(e,t){const n=new m(t),i=St(t);let s=0,o=0;s-=n.left,o-=n.top,s+=t.scrollLeft,o+=t.scrollTop,s-=i.left,o-=i.top,e.moveBy(s,o)}class h{_element;_callback;static _observerInstance=null;static _elementCallbacks=null;constructor(t,n){h._observerInstance||h._createObserver(),this._element=t,this._callback=n,h._addElementCallback(t,n),h._observerInstance.observe(t)}get element(){return this._element}destroy(){h._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,n){h._elementCallbacks||(h._elementCallbacks=new Map);let i=h._elementCallbacks.get(t);i||(i=new Set,h._elementCallbacks.set(t,i)),i.add(n)}static _deleteElementCallback(t,n){const i=h._getElementCallbacks(t);i&&(i.delete(n),i.size||(h._elementCallbacks.delete(t),h._observerInstance.unobserve(t))),h._elementCallbacks&&!h._elementCallbacks.size&&(h._observerInstance=null,h._elementCallbacks=null)}static _getElementCallbacks(t){return h._elementCallbacks?h._elementCallbacks.get(t):null}static _createObserver(){h._observerInstance=new _.window.ResizeObserver(t=>{for(const n of t){const i=h._getElementCallbacks(n.target);if(i)for(const s of i)s(n)}})}}/**
|
|
61
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
62
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
63
|
-
*/function Tn(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}/**
|
|
64
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
65
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
66
|
-
*/function xn(e){return t=>t+e}/**
|
|
67
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
68
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
69
|
-
*/function In(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}/**
|
|
70
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
71
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
72
|
-
*/function An(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}/**
|
|
73
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
74
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
75
|
-
*/function Cn(e){return e&&e.nodeType===Node.COMMENT_NODE}function Ln(e){try{_.document.createAttribute(e)}catch{return!1}return!0}function Ae(e){return e?Z(e)?Ae(e.parentElement):e.getClientRects?!!e.getClientRects().length:!1:!1}function kn({element:e,target:t,positions:n,limiter:i,fitInViewport:s,viewportOffsetConfig:o}){it(t)&&(t=t()),it(i)&&(i=i());const r=Vt(e),l=Ce(o),a=new m(e),c=pt(t,l);let f;if(!c||!l.getIntersection(c))return null;const u={targetRect:c,elementRect:a,positionedElementAncestor:r,viewportRect:l};if(!i&&!s)f=new vt(n[0],u);else{if(i){const w=pt(i,l);w&&(u.limiterRect=w)}f=Le(n,u)}return f}function pt(e,t){const n=new m(e).getVisible();return n?n.getIntersection(t):null}function Ce(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new m(_.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t}function Le(e,t){const{elementRect:n}=t,i=n.getArea(),s=e.map(l=>new vt(l,t)).filter(l=>!!l.name);let o=0,r=null;for(const l of s){const{limiterIntersectionArea:a,viewportIntersectionArea:c}=l;if(a===i)return l;const f=c**2+a**2;f>o&&(o=f,r=l)}return r}class vt{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(t,n){const i=t(n.targetRect,n.elementRect,n.viewportRect,n.limiterRect);if(!i)return;const{left:s,top:o,name:r,config:l}=i;this.name=r,this.config=l,this._positioningFunctionCoordinates={left:s,top:o},this._options=n}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const t=this._options.limiterRect;return t?t.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect?this._cachedRect:(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top),this._cachedRect)}get _absoluteRect(){return this._cachedAbsoluteRect?this._cachedAbsoluteRect:(this._cachedAbsoluteRect=this._rect.toAbsoluteRect(),this._cachedAbsoluteRect)}}/**
|
|
76
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
77
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
78
|
-
*/function Mn(e){const t=e.parentNode;t&&t.removeChild(e)}function Fn(){const e=_.window.visualViewport;if(!e||!(C.isiOS||C.isSafari))return{left:0,top:0};const t=Math.max(Math.round(e.offsetLeft),0),n=Math.max(Math.round(e.offsetTop),0);return{left:t,top:n}}function Sn({target:e,viewportOffset:t=0,ancestorOffset:n=0,alignToTop:i,forceScroll:s}){const o=tt(e);let r=o,l=null;for(t=Fe(t);r;){let a;r==o?a=gt(e):a=gt(l),Me({parent:a,getRect:()=>$(e,r),alignToTop:i,ancestorOffset:n,forceScroll:s});let c=$(e,r);const f=$(a,r);if(c.height>f.height){const u=c.getIntersection(f);u&&(c=u)}if(ke({window:r,rect:c,viewportOffset:t,alignToTop:i,forceScroll:s}),r.parent!=r){if(l=r.frameElement,r=r.parent,!l)return}else r=null}}function ke({window:e,rect:t,alignToTop:n,forceScroll:i,viewportOffset:s}){const o=t.clone().moveBy(0,s.bottom),r=t.clone().moveBy(0,-s.top),l=new m(e).excludeScrollbarsAndBorders(),a=[r,o],c=n&&i,f=a.every(p=>l.contains(p));let{scrollX:u,scrollY:w}=e;const L=u,y=w;c?w-=l.top-t.top+s.top:f||(Nt(r,l)?w-=l.top-t.top+s.top:Pt(o,l)&&(n?w+=t.top-l.top-s.top:w+=t.bottom-l.bottom+s.bottom)),f||(Bt(t,l)?u-=l.left-t.left+s.left:Dt(t,l)&&(u+=t.right-l.right+s.right)),(u!=L||w!==y)&&e.scrollTo(u,w)}function Me({parent:e,getRect:t,alignToTop:n,forceScroll:i,ancestorOffset:s=0,limiterElement:o}){const r=tt(e),l=n&&i;let a,c,f;const u=o||r.document.body;for(;e!=u;)c=t(),a=new m(e).excludeScrollbarsAndBorders(),f=a.contains(c),l?e.scrollTop-=a.top-c.top+s:f||(Nt(c,a)?e.scrollTop-=a.top-c.top+s:Pt(c,a)&&(n?e.scrollTop+=c.top-a.top-s:e.scrollTop+=c.bottom-a.bottom+s)),f||(Bt(c,a)?e.scrollLeft-=a.left-c.left+s:Dt(c,a)&&(e.scrollLeft+=c.right-a.right+s)),e=e.parentNode}function Pt(e,t){return e.bottom>t.bottom}function Nt(e,t){return e.top<t.top}function Bt(e,t){return e.left<t.left}function Dt(e,t){return e.right>t.right}function tt(e){return z(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function gt(e){if(z(e)){let t=e.commonAncestorContainer;return Z(t)&&(t=t.parentNode),t}else return e.parentNode}function $(e,t){const n=tt(e),i=new m(e);if(n===t)return i;{let s=n;for(;s!=t;){const o=s.frameElement,r=new m(o).excludeScrollbarsAndBorders();i.moveBy(r.left,r.top),s=s.parent}}return i}function Fe(e){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:e}const Se={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},Ve={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},mt={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},g=Ne(),Re=Object.fromEntries(Object.entries(g).map(([e,t])=>{let n;return t in mt?n=mt[t]:n=e.charAt(0).toUpperCase()+e.slice(1),[t,n]}));function B(e){let t;if(typeof e=="string"){if(t=g[e.toLowerCase()],!t)throw new d("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?g.alt:0)+(e.ctrlKey?g.ctrl:0)+(e.shiftKey?g.shift:0)+(e.metaKey?g.cmd:0);return t}function jt(e){return typeof e=="string"&&(e=Be(e)),e.map(t=>typeof t=="string"?Pe(t):t).reduce((t,n)=>n+t,0)}function Vn(e,t){let n=jt(e);const i=C.isMac||C.isiOS;return Object.entries(i?Se:Ve).reduce((r,[l,a])=>((n&g[l])!=0&&(n&=~g[l],r+=a),r),"")+(n?Re[n]:"")}function Rn(e){return e==g.arrowright||e==g.arrowleft||e==g.arrowup||e==g.arrowdown}function ve(e,t){const n=t==="ltr";switch(e){case g.arrowleft:return n?"left":"right";case g.arrowright:return n?"right":"left";case g.arrowup:return"up";case g.arrowdown:return"down"}}function Pe(e){if(e.endsWith("!"))return B(e.slice(0,-1));const t=B(e);return(C.isMac||C.isiOS)&&t==g.ctrl?g.cmd:t}function vn(e,t){const n=ve(e,t);return n==="down"||n==="right"}function Ne(){const e={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){const n=String.fromCharCode(t);e[n.toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}function Be(e){return e.split("+").map(t=>t.trim())}/**
|
|
79
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
80
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
81
|
-
*/const De=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function bt(e){return De.includes(e)?"rtl":"ltr"}/**
|
|
82
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
83
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
84
|
-
*/function je(e){return Array.isArray(e)?e:[e]}/* istanbul ignore else -- @preserve */_.window.CKEDITOR_TRANSLATIONS||(_.window.CKEDITOR_TRANSLATIONS={});function Oe(e,t,n=1,i){if(typeof n!="number")throw new d("translation-service-quantity-not-a-number",null,{quantity:n});const s=i||_.window.CKEDITOR_TRANSLATIONS,o=$e(s);o===1&&(e=Object.keys(s)[0]);const r=t.id||t.string;if(o===0||!Ke(e,r,s))return n!==1?t.plural:t.string;const l=s[e].dictionary,a=s[e].getPluralForm||(u=>u===1?0:1),c=l[r];if(typeof c=="string")return c;const f=Number(a(n));return c[f]}function We(e){return Array.isArray(e)?e.reduce((t,n)=>Kt(t,n)):e}function Ke(e,t,n){return!!n[e]&&!!n[e].dictionary[t]}function $e(e){return Object.keys(e).length}class Pn{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:t="en",contentLanguage:n,translations:i}={}){this.uiLanguage=t,this.contentLanguage=n||this.uiLanguage,this.uiLanguageDirection=bt(this.uiLanguage),this.contentLanguageDirection=bt(this.contentLanguage),this.translations=We(i),this.t=(s,o)=>this._t(s,o)}_t(t,n=[]){n=je(n),typeof t=="string"&&(t={string:t});const s=!!t.plural?n[0]:1,o=Oe(this.uiLanguage,t,s,this.translations);return He(o,n)}}function He(e,t){return e.replace(/%(\d+)/g,(n,i)=>i<t.length?t[i]:n)}class Nn extends I(){_items;_itemMap;_idProperty;_bindToCollection;_bindToExternalToInternalMap;_bindToInternalToExternalMap;_skippedIndexesFromExternal;constructor(t={},n={}){super();const i=J(t);if(i||(n=t),this._items=[],this._itemMap=new Map,this._idProperty=n.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const s of t)this._items.push(s),this._itemMap.set(this._getItemIdBeforeAdding(s),s)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,n){return this.addMany([t],n)}addMany(t,n){if(n===void 0)n=this._items.length;else if(n>this._items.length||n<0)throw new d("collection-add-item-invalid-index",this);let i=0;for(const s of t){const o=this._getItemIdBeforeAdding(s),r=n+i;this._items.splice(r,0,s),this._itemMap.set(o,s),this.fire("add",s,r),i++}return this.fire("change",{added:t,removed:[],index:n}),this}get(t){let n;if(typeof t=="string")n=this._itemMap.get(t);else if(typeof t=="number")n=this._items[t];else throw new d("collection-get-invalid-arg",this);return n||null}has(t){if(typeof t=="string")return this._itemMap.has(t);{const n=this._idProperty,i=t[n];return i&&this._itemMap.has(i)}}getIndex(t){let n;return typeof t=="string"?n=this._itemMap.get(t):n=t,n?this._items.indexOf(n):-1}remove(t){const[n,i]=this._remove(t);return this.fire("change",{added:[],removed:[n],index:i}),n}map(t,n){return this._items.map(t,n)}forEach(t,n){this._items.forEach(t,n)}find(t,n){return this._items.find(t,n)}filter(t,n){return this._items.filter(t,n)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const t=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:t,index:0})}bindTo(t){if(this._bindToCollection)throw new d("collection-bind-to-rebind",this);return this._bindToCollection=t,{as:n=>{this._setUpBindToBinding(i=>new n(i))},using:n=>{typeof n=="function"?this._setUpBindToBinding(n):this._setUpBindToBinding(i=>i[n])}}}_setUpBindToBinding(t){const n=this._bindToCollection,i=(s,o,r)=>{const l=n._bindToCollection==this,a=n._bindToInternalToExternalMap.get(o);if(l&&a)this._bindToExternalToInternalMap.set(o,a),this._bindToInternalToExternalMap.set(a,o);else{const c=t(o);if(!c){this._skippedIndexesFromExternal.push(r);return}let f=r;for(const u of this._skippedIndexesFromExternal)r>u&&f--;for(const u of n._skippedIndexesFromExternal)f>=u&&f++;this._bindToExternalToInternalMap.set(o,c),this._bindToInternalToExternalMap.set(c,o),this.add(c,f);for(let u=0;u<n._skippedIndexesFromExternal.length;u++)f<=n._skippedIndexesFromExternal[u]&&n._skippedIndexesFromExternal[u]++}};for(const s of n)i(null,s,n.getIndex(s));this.listenTo(n,"add",i),this.listenTo(n,"remove",(s,o,r)=>{const l=this._bindToExternalToInternalMap.get(o);l&&this.remove(l),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((a,c)=>(r<c&&a.push(c-1),r>c&&a.push(c),a),[])})}_getItemIdBeforeAdding(t){const n=this._idProperty;let i;if(n in t){if(i=t[n],typeof i!="string")throw new d("collection-add-invalid-id",this);if(this.get(i))throw new d("collection-add-item-already-exists",this)}else t[n]=i=X();return i}_remove(t){let n,i,s,o=!1;const r=this._idProperty;if(typeof t=="string"?(i=t,s=this._itemMap.get(i),o=!s,s&&(n=this._items.indexOf(s))):typeof t=="number"?(n=t,s=this._items[n],o=!s,s&&(i=s[r])):(s=t,i=s[r],n=this._items.indexOf(s),o=n==-1||!this._itemMap.get(i)),o)throw new d("collection-remove-404",this);this._items.splice(n,1),this._itemMap.delete(i);const l=this._bindToInternalToExternalMap.get(s);return this._bindToInternalToExternalMap.delete(s),this._bindToExternalToInternalMap.delete(l),this.fire("remove",s,n),[s,n]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}/**
|
|
85
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
86
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
87
|
-
*/function Bn(e){const t=e.next();return t.done?null:t.value}class Ue extends Q(kt()){_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(t){if(wt(t))this._addElement(t);else if(_t(t))this._addView(t);else{if(!t.element)throw new d("focustracker-add-view-missing-element",{focusTracker:this,view:t});this._addElement(t.element)}}remove(t){wt(t)?this._removeElement(t):_t(t)?this._removeView(t):this._removeElement(t.element)}_addElement(t){if(this._elements.has(t))throw new d("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>{const n=this.externalViews.find(i=>Ge(t,i));n?this._focus(n.element):this._focus(t)},{useCapture:!0}),this.listenTo(t,"blur",()=>{this._blur()},{useCapture:!0}),this._elements.add(t)}_removeElement(t){this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t)),t===this.focusedElement&&this._blur()}_addView(t){t.element&&this._addElement(t.element),this.listenTo(t.focusTracker,"change:focusedElement",()=>{t.focusTracker.focusedElement?t.element&&this._focus(t.element):this._blur()}),this._externalViews.add(t)}_removeView(t){t.element&&this._removeElement(t.element),this.stopListening(t.focusTracker),this._externalViews.delete(t)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(t){this._clearBlurTimeout(),this.focusedElement=t,this.isFocused=!0}_blur(){this.elements.find(i=>i.contains(document.activeElement))||this.externalViews.find(i=>i.focusTracker.isFocused&&!i.focusTracker._blurTimeout)||(this._clearBlurTimeout(),this._blurTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function _t(e){return"focusTracker"in e&&e.focusTracker instanceof Ue}function wt(e){return Et(e)}function Ge(e,t){return yt(e,t)?!0:!!t.focusTracker.externalViews.find(n=>yt(e,n))}function yt(e,t){return!!t.element&&t.element.contains(document.activeElement)&&e.contains(t.element)}class Dn{_listener;constructor(){this._listener=new(Q())}listenTo(t){this._listener.listenTo(t,"keydown",(n,i)=>{this._listener.fire("_keydown:"+B(i),i)})}set(t,n,i={}){const s=jt(t),o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+s,(r,l)=>{i.filter&&!i.filter(l)||(n(l,()=>{l.preventDefault(),l.stopPropagation(),r.stop()}),r.return=!0)},{priority:o})}press(t){return!!this._listener.fire("_keydown:"+B(t),t)}stopListening(t){this._listener.stopListening(t)}destroy(){this.stopListening()}}/**
|
|
88
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
89
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
90
|
-
*/function qe(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}function jn(e){return J(e)?new Map(e):qe(e)}/**
|
|
91
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
92
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
93
|
-
*/function On(e,t,n){const i=e.length,s=t.length;for(let o=i-1;o>=n;o--)e[o+s]=e[o];for(let o=0;o<s;o++)e[n+o]=t[o]}/**
|
|
94
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
95
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
96
|
-
*/function Wn(e,t){let n;function i(...s){i.cancel(),n=setTimeout(()=>e(...s),t)}return i.cancel=()=>{clearTimeout(n)},i}/**
|
|
97
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
98
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
99
|
-
*/function Kn(e){try{if(!e.startsWith("ey"))return null;const t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch{return null}}/**
|
|
100
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
101
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
102
|
-
*/function Ye(){const e=[];for(let t=0;t<256;t++){let n=t;for(let i=0;i<8;i++)n&1?n=3988292384^n>>>1:n=n>>>1;e[t]=n}return e}function $n(e){const t=Array.isArray(e)?e:[e],n=Ye();let i=-1;const s=t.map(o=>Array.isArray(o)?o.join(""):String(o)).join("");for(let o=0;o<s.length;o++){const r=s.charCodeAt(o);i=i>>>8^n[(i^r)&255]}return i=(i^-1)>>>0,i.toString(16).padStart(8,"0")}/**
|
|
103
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
104
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
105
|
-
*/function Hn(e){const t=[{name:"address",isVoid:!1},{name:"article",isVoid:!1},{name:"aside",isVoid:!1},{name:"blockquote",isVoid:!1},{name:"details",isVoid:!1},{name:"dialog",isVoid:!1},{name:"dd",isVoid:!1},{name:"div",isVoid:!1},{name:"dl",isVoid:!1},{name:"dt",isVoid:!1},{name:"fieldset",isVoid:!1},{name:"figcaption",isVoid:!1},{name:"figure",isVoid:!1},{name:"footer",isVoid:!1},{name:"form",isVoid:!1},{name:"h1",isVoid:!1},{name:"h2",isVoid:!1},{name:"h3",isVoid:!1},{name:"h4",isVoid:!1},{name:"h5",isVoid:!1},{name:"h6",isVoid:!1},{name:"header",isVoid:!1},{name:"hgroup",isVoid:!1},{name:"hr",isVoid:!0},{name:"li",isVoid:!1},{name:"main",isVoid:!1},{name:"nav",isVoid:!1},{name:"ol",isVoid:!1},{name:"p",isVoid:!1},{name:"section",isVoid:!1},{name:"table",isVoid:!1},{name:"tbody",isVoid:!1},{name:"td",isVoid:!1},{name:"th",isVoid:!1},{name:"thead",isVoid:!1},{name:"tr",isVoid:!1},{name:"ul",isVoid:!1}],n=t.map(r=>r.name).join("|"),i=e.replace(new RegExp(`</?(${n})( .*?)?>`,"g"),`
|
|
3
|
+
Original error: ${n.name}: ${n.message}`:"";return e+o+r+l}function At(e,t){const n=It(e);return t?[e,t,n]:[e,n]}const se="46.1.1",hn=new Date(2025,8,15);if(globalThis.CKEDITOR_VERSION)throw new d("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=se;const A=Symbol("listeningTo"),G=Symbol("emitterId"),E=Symbol("delegations"),oe=I(Object);function I(e){if(!e)return oe;class t extends e{on(i,s,o){this.listenTo(this,i,s,o)}once(i,s,o){let r=!1;const l=(a,...c)=>{r||(r=!0,a.off(),s.call(this,a,...c))};this.listenTo(this,i,l,o)}off(i,s){this.stopListening(this,i,s)}listenTo(i,s,o,r={}){let l,a;this[A]||(this[A]={});const c=this[A];O(i)||Ct(i);const f=O(i);(l=c[f])||(l=c[f]={emitter:i,callbacks:{}}),(a=l.callbacks[s])||(a=l.callbacks[s]=[]),a.push(o),fe(this,i,s,o,r)}stopListening(i,s,o){const r=this[A];let l=i&&O(i);const a=r&&l?r[l]:void 0,c=a&&s?a.callbacks[s]:void 0;if(!(!r||i&&!a||s&&!c))if(o)W(this,i,s,o),c.indexOf(o)!==-1&&(c.length===1?delete a.callbacks[s]:W(this,i,s,o));else if(c){for(;o=c.pop();)W(this,i,s,o);delete a.callbacks[s]}else if(a){for(s in a.callbacks)this.stopListening(i,s);delete r[l]}else{for(l in r)this.stopListening(r[l].emitter);delete this[A]}}fire(i,...s){try{const o=i instanceof H?i:new H(this,i),r=o.name;let l=ae(this,r);if(o.path.push(this),l){l=l.slice();for(let c=0;c<l.length;c++){const f=l[c].callback;if(f.call(this,o,...s),o.off.called&&(delete o.off.called,this._removeEventListener(r,f)),o.stop.called)break}}const a=this[E];if(a){const c=a.get(r),f=a.get("*");c&<(c,o,s),f&<(f,o,s)}return o.return}catch(o){d.rethrowUnexpectedError(o,this)}}delegate(...i){return{to:(s,o)=>{this[E]||(this[E]=new Map),i.forEach(r=>{const l=this[E].get(r);l?l.set(s,o):this[E].set(r,new Map([[s,o]]))})}}}stopDelegating(i,s){if(this[E])if(!i)this[E].clear();else if(!s)this[E].delete(i);else{const o=this[E].get(i);o&&o.delete(s)}}_addEventListener(i,s,o){ce(this,i);const r=q(this,i),l=U.get(o.priority),a={callback:s,priority:l};for(const c of r)ee(c,a)}_removeEventListener(i,s){const o=q(this,i);for(const r of o)for(let l=0;l<r.length;l++)r[l].callback==s&&(r.splice(l,1),l--)}}return t}function re(e,t){const n=e[A];return n&&n[t]?n[t].emitter:null}function Ct(e,t){e[G]||(e[G]=t||X())}function O(e){return e[G]}function Lt(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function le(){return{callbacks:[],childEvents:[]}}function ce(e,t){const n=Lt(e);if(n[t])return;let i=t,s=null;const o=[];for(;i!==""&&!n[i];)n[i]=le(),o.push(n[i]),s&&n[i].childEvents.push(s),s=i,i=i.substr(0,i.lastIndexOf(":"));if(i!==""){for(const r of o)r.callbacks=n[i].callbacks.slice();n[i].childEvents.push(s)}}function q(e,t){const n=Lt(e)[t];if(!n)return[];let i=[n.callbacks];for(let s=0;s<n.childEvents.length;s++){const o=q(e,n.childEvents[s]);i=i.concat(o)}return i}function ae(e,t){if(!e._events)return null;let n=t;do{const i=e._events[n];if(i&&i.callbacks&&i.callbacks.length)return i.callbacks;const s=n.lastIndexOf(":");n=s>-1?n.substring(0,s):""}while(n);return null}function lt(e,t,n){for(let[i,s]of e){s?typeof s=="function"&&(s=s(t.name)):s=t.name;const o=new H(t.source,s);o.path=[...t.path],i.fire(o,...n)}}function fe(e,t,n,i,s){t._addEventListener?t._addEventListener(n,i,s):e._addEventListener.call(t,n,i,s)}function W(e,t,n,i){t._removeEventListener?t._removeEventListener(n,i):e._removeEventListener.call(t,n,i)}const S=Symbol("observableProperties"),R=Symbol("boundObservables"),V=Symbol("boundProperties"),x=Symbol("decoratedMethods"),ct=Symbol("decoratedOriginal"),ue=kt(I());function kt(e){if(!e)return ue;class t extends e{set(i,s){if(Ot(i)){Object.keys(i).forEach(r=>{this.set(r,i[r])},this);return}K(this);const o=this[S];if(i in this&&!o.has(i))throw new d("observable-set-cannot-override",this);Object.defineProperty(this,i,{enumerable:!0,configurable:!0,get(){return o.get(i)},set(r){const l=o.get(i);let a=this.fire(`set:${i}`,i,r,l);a===void 0&&(a=r),(l!==a||!o.has(i))&&(o.set(i,a),this.fire(`change:${i}`,i,a,l))}}),this[i]=s}bind(...i){if(!i.length||!at(i))throw new d("observable-bind-wrong-properties",this);if(new Set(i).size!==i.length)throw new d("observable-bind-duplicate-properties",this);K(this);const s=this[V];i.forEach(r=>{if(s.has(r))throw new d("observable-bind-rebind",this)});const o=new Map;return i.forEach(r=>{const l={property:r,to:[]};s.set(r,l),o.set(r,l)}),{to:de,toMany:he,_observable:this,_bindProperties:i,_to:[],_bindings:o}}unbind(...i){if(!this[S])return;const s=this[V],o=this[R];if(i.length){if(!at(i))throw new d("observable-unbind-wrong-properties",this);i.forEach(r=>{const l=s.get(r);l&&(l.to.forEach(([a,c])=>{const f=o.get(a),u=f[c];u.delete(l),u.size||delete f[c],Object.keys(f).length||(o.delete(a),this.stopListening(a,"change"))}),s.delete(r))})}else o.forEach((r,l)=>{this.stopListening(l,"change")}),o.clear(),s.clear()}decorate(i){K(this);const s=this[i];if(!s)throw new d("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:i});this.on(i,(o,r)=>{o.return=s.apply(this,r)}),this[i]=function(...o){return this.fire(i,o)},this[i][ct]=s,this[x]||(this[x]=[]),this[x].push(i)}stopListening(i,s,o){if(!i&&this[x]){for(const r of this[x])this[r]=this[r][ct];delete this[x]}super.stopListening(i,s,o)}[S];[x];[V];[R]}return t}function K(e){e[S]||(Object.defineProperty(e,S,{value:new Map}),Object.defineProperty(e,R,{value:new Map}),Object.defineProperty(e,V,{value:new Map}))}function de(...e){const t=ge(...e),n=Array.from(this._bindings.keys()),i=n.length;if(!t.callback&&t.to.length>1)throw new d("observable-bind-to-no-callback",this);if(i>1&&t.callback)throw new d("observable-bind-to-extra-callback",this);t.to.forEach(s=>{if(s.properties.length&&s.properties.length!==i)throw new d("observable-bind-to-properties-length",this);s.properties.length||(s.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),_e(this._observable,this._to),be(this),this._bindProperties.forEach(s=>{Mt(this._observable,s)})}function he(e,t,n){if(this._bindings.size>1)throw new d("observable-bind-to-many-not-one-binding",this);this.to(...pe(e,t),n)}function pe(e,t){const n=e.map(i=>[i,t]);return Array.prototype.concat.apply([],n)}function at(e){return e.every(t=>typeof t=="string")}function ge(...e){if(!e.length)throw new d("observable-bind-to-parse-error",null);const t={to:[]};let n;return typeof e[e.length-1]=="function"&&(t.callback=e.pop()),e.forEach(i=>{if(typeof i=="string")n.properties.push(i);else if(typeof i=="object")n={observable:i,properties:[]},t.to.push(n);else throw new d("observable-bind-to-parse-error",null)}),t}function me(e,t,n,i){const s=e[R],o=s.get(n),r=o||{};r[i]||(r[i]=new Set),r[i].add(t),o||s.set(n,r)}function be(e){let t;e._bindings.forEach((n,i)=>{e._to.forEach(s=>{t=s.properties[n.callback?0:e._bindProperties.indexOf(i)],n.to.push([s.observable,t]),me(e._observable,n,s.observable,t)})})}function Mt(e,t){const i=e[V].get(t);let s;i.callback?s=i.callback.apply(e,i.to.map(o=>o[0][o[1]])):(s=i.to[0],s=s[0][s[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=s:e.set(t,s)}function _e(e,t){t.forEach(n=>{const i=e[R];let s;i.get(n.observable)||e.listenTo(n.observable,"change",(o,r)=>{s=i.get(n.observable)[r],s&&s.forEach(l=>{Mt(e,l.property)})})})}class pn{_replacedElements;constructor(){this._replacedElements=[]}replace(t,n){this._replacedElements.push({element:t,newElement:n}),t.style.display="none",n&&t.parentNode.insertBefore(n,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:n})=>{t.style.display="",n&&n.remove()}),this._replacedElements=[]}}function gn(e){let t=0;for(const n of e)t++;return t}function mn(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)if(e[i]!=t[i])return i;return e.length==t.length?"same":e.length<t.length?"prefix":"extension"}function J(e){return!!(e&&e[Symbol.iterator])}function bn(e,t,n={},i=[]){const s=n&&n.xmlns,o=s?e.createElementNS(s,t):e.createElement(t);for(const r in n)o.setAttribute(r,n[r]);(nt(i)||!J(i))&&(i=[i]);for(let r of i)nt(r)&&(r=e.createTextNode(r)),o.appendChild(r);return o}class _n{_config;constructor(t,n){this._config=Object.create(null),n&&this.define(ft(n)),t&&this._setObjectToTarget(this._config,t)}set(t,n){this._setToTarget(this._config,t,n)}define(t,n){this._setToTarget(this._config,t,n,!0)}get(t){return this._getFromSource(this._config,t)}*names(){for(const t of Object.keys(this._config))yield t}_setToTarget(t,n,i,s=!1){if(F(n)){this._setObjectToTarget(t,n,s);return}const o=n.split(".");n=o.pop();for(const r of o)F(t[r])||(t[r]=Object.create(null)),t=t[r];if(F(i)){F(t[n])||(t[n]=Object.create(null)),t=t[n],this._setObjectToTarget(t,i,s);return}s&&typeof t[n]<"u"||(t[n]=i)}_getFromSource(t,n){const i=n.split(".");n=i.pop();for(const s of i){if(!F(t[s])){t=null;break}t=t[s]}return t?ft(t[n]):void 0}_setObjectToTarget(t,n,i){Object.keys(n).forEach(s=>{this._setToTarget(t,s,n[s],i)})}}function ft(e){return Wt(e,we)}function we(e){return Et(e)||typeof e=="function"?e:void 0}function ut(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}function N(e){const t=Object.prototype.toString.apply(e);return t=="[object Window]"||t=="[object global]"}const ye=Q(I());function Q(e){if(!e)return ye;class t extends e{listenTo(i,s,o,r={}){if(ut(i)||N(i)||i instanceof _.window.EventTarget){const l={capture:!!r.useCapture,passive:!!r.usePassive},a=this._getProxyEmitter(i,l)||new Ee(i,l);this.listenTo(a,s,o,r)}else super.listenTo(i,s,o,r)}stopListening(i,s,o){if(ut(i)||N(i)||i instanceof _.window.EventTarget){const r=this._getAllProxyEmitters(i);for(const l of r)this.stopListening(l,s,o)}else super.stopListening(i,s,o)}_getProxyEmitter(i,s){return re(this,Ft(i,s))}_getAllProxyEmitters(i){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(s=>this._getProxyEmitter(i,s)).filter(s=>!!s)}}return t}class Ee extends I(){_domNode;_options;constructor(t,n){super(),Ct(this,Ft(t,n)),this._domNode=t,this._options=n}_domListeners;attach(t){if(this._domListeners&&this._domListeners[t])return;const n=this._createDomListener(t);this._domNode.addEventListener(t,n,this._options),this._domListeners||(this._domListeners={}),this._domListeners[t]=n}detach(t){let n;this._domListeners[t]&&(!(n=this._events[t])||!n.callbacks.length)&&this._domListeners[t].removeListener()}_addEventListener(t,n,i){this.attach(t),I().prototype._addEventListener.call(this,t,n,i)}_removeEventListener(t,n){I().prototype._removeEventListener.call(this,t,n),this.detach(t)}_createDomListener(t){const n=i=>{this.fire(t,i)};return n.removeListener=()=>{this._domNode.removeEventListener(t,n,this._options),delete this._domListeners[t]},n}}function Te(e){return e["data-ck-expando"]||(e["data-ck-expando"]=X())}function Ft(e,t){let n=Te(e);for(const i of Object.keys(t).sort())t[i]&&(n+="-"+i);return n}function wn(e){const t=[];let n=e;for(;n&&n.nodeType!=Node.DOCUMENT_NODE;)t.unshift(n),n=n.parentNode;return t}function yn(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}function St(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function En(e){if(!e.target)return null;const t=e.target.ownerDocument,n=e.clientX,i=e.clientY;let s=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(n,i)?s=t.caretRangeFromPoint(n,i):e.rangeParent&&(s=t.createRange(),s.setStart(e.rangeParent,e.rangeOffset),s.collapse(!0)),s}function Vt(e){return!e||!e.parentNode||e.offsetParent===_.document.body?null:e.offsetParent}function Z(e){return Object.prototype.toString.call(e)=="[object Text]"}function z(e){return Object.prototype.toString.apply(e)=="[object Range]"}const Rt=["top","right","bottom","left","width","height"];class m{top;right;bottom;left;width;height;_source;constructor(t){const n=z(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),Y(t)||n)if(n){const i=m.getDomRangeRects(t);v(this,m.getBoundingRect(i))}else v(this,t.getBoundingClientRect());else if(N(t)){const{innerWidth:i,innerHeight:s}=t;v(this,{top:0,right:i,bottom:s,left:0,width:i,height:s})}else v(this,t)}clone(){return new m(this)}moveTo(t,n){return this.top=n,this.right=t+this.width,this.bottom=n+this.height,this.left=t,this}moveBy(t,n){return this.top+=n,this.right+=t,this.left+=t,this.bottom+=n,this}getIntersection(t){const n={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left),width:0,height:0};if(n.width=n.right-n.left,n.height=n.bottom-n.top,n.width<0||n.height<0)return null;{const i=new m(n);return i._source=this._source,i}}getIntersectionArea(t){const n=this.getIntersection(t);return n?n.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let n=this.clone();if(dt(t))return n;let i=t,s=t.parentNode||t.commonAncestorContainer,o;for(;s&&!dt(s);){const r=xe(s)==="visible";i instanceof HTMLElement&&ht(i)==="absolute"&&(o=i);const l=ht(s);if(r||o&&(l==="relative"&&r||l!=="relative")){i=s,s=s.parentNode;continue}const a=new m(s),c=n.getIntersection(a);if(c)c.getArea()<n.getArea()&&(n=c);else return null;i=s,s=s.parentNode}return n}isEqual(t){for(const n of Rt)if(this[n]!==t[n])return!1;return!0}contains(t){const n=this.getIntersection(t);return!!(n&&n.isEqual(t))}toAbsoluteRect(){const{scrollX:t,scrollY:n}=_.window,i=this.clone().moveBy(t,n);if(Y(i._source)){const s=Vt(i._source);s&&Ie(i,s)}return i}excludeScrollbarsAndBorders(){const t=this._source;let n,i,s;if(N(t))n=t.innerWidth-t.document.documentElement.clientWidth,i=t.innerHeight-t.document.documentElement.clientHeight,s=t.getComputedStyle(t.document.documentElement).direction;else{const o=St(t);n=t.offsetWidth-t.clientWidth-o.left-o.right,i=t.offsetHeight-t.clientHeight-o.top-o.bottom,s=t.ownerDocument.defaultView.getComputedStyle(t).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=n,s==="ltr"?this.right-=n:this.left+=n,this.height-=i,this.bottom-=i,this}static getDomRangeRects(t){const n=[],i=Array.from(t.getClientRects());if(i.length)for(const s of i)n.push(new m(s));else{let s=t.startContainer;Z(s)&&(s=s.parentNode);const o=new m(s.getBoundingClientRect());o.right=o.left,o.width=0,n.push(o)}return n}static getBoundingRect(t){const n={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const s of t)i++,n.left=Math.min(n.left,s.left),n.top=Math.min(n.top,s.top),n.right=Math.max(n.right,s.right),n.bottom=Math.max(n.bottom,s.bottom);return i==0?null:(n.width=n.right-n.left,n.height=n.bottom-n.top,new m(n))}}function v(e,t){for(const n of Rt)e[n]=t[n]}function dt(e){return Y(e)?e===e.ownerDocument.body:!1}function Y(e){return e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.getBoundingClientRect=="function"}function ht(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).position:"static"}function xe(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).overflow:"visible"}function Ie(e,t){const n=new m(t),i=St(t);let s=0,o=0;s-=n.left,o-=n.top,s+=t.scrollLeft,o+=t.scrollTop,s-=i.left,o-=i.top,e.moveBy(s,o)}class h{_element;_callback;static _observerInstance=null;static _elementCallbacks=null;constructor(t,n){h._observerInstance||h._createObserver(),this._element=t,this._callback=n,h._addElementCallback(t,n),h._observerInstance.observe(t)}get element(){return this._element}destroy(){h._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,n){h._elementCallbacks||(h._elementCallbacks=new Map);let i=h._elementCallbacks.get(t);i||(i=new Set,h._elementCallbacks.set(t,i)),i.add(n)}static _deleteElementCallback(t,n){const i=h._getElementCallbacks(t);i&&(i.delete(n),i.size||(h._elementCallbacks.delete(t),h._observerInstance.unobserve(t))),h._elementCallbacks&&!h._elementCallbacks.size&&(h._observerInstance=null,h._elementCallbacks=null)}static _getElementCallbacks(t){return h._elementCallbacks?h._elementCallbacks.get(t):null}static _createObserver(){h._observerInstance=new _.window.ResizeObserver(t=>{for(const n of t){const i=h._getElementCallbacks(n.target);if(i)for(const s of i)s(n)}})}}function Tn(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function xn(e){return t=>t+e}function In(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function An(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Cn(e){return e&&e.nodeType===Node.COMMENT_NODE}function Ln(e){try{_.document.createAttribute(e)}catch{return!1}return!0}function Ae(e){return e?Z(e)?Ae(e.parentElement):e.getClientRects?!!e.getClientRects().length:!1:!1}function kn({element:e,target:t,positions:n,limiter:i,fitInViewport:s,viewportOffsetConfig:o}){it(t)&&(t=t()),it(i)&&(i=i());const r=Vt(e),l=Ce(o),a=new m(e),c=pt(t,l);let f;if(!c||!l.getIntersection(c))return null;const u={targetRect:c,elementRect:a,positionedElementAncestor:r,viewportRect:l};if(!i&&!s)f=new vt(n[0],u);else{if(i){const w=pt(i,l);w&&(u.limiterRect=w)}f=Le(n,u)}return f}function pt(e,t){const n=new m(e).getVisible();return n?n.getIntersection(t):null}function Ce(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new m(_.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t}function Le(e,t){const{elementRect:n}=t,i=n.getArea(),s=e.map(l=>new vt(l,t)).filter(l=>!!l.name);let o=0,r=null;for(const l of s){const{limiterIntersectionArea:a,viewportIntersectionArea:c}=l;if(a===i)return l;const f=c**2+a**2;f>o&&(o=f,r=l)}return r}class vt{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(t,n){const i=t(n.targetRect,n.elementRect,n.viewportRect,n.limiterRect);if(!i)return;const{left:s,top:o,name:r,config:l}=i;this.name=r,this.config=l,this._positioningFunctionCoordinates={left:s,top:o},this._options=n}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const t=this._options.limiterRect;return t?t.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect?this._cachedRect:(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top),this._cachedRect)}get _absoluteRect(){return this._cachedAbsoluteRect?this._cachedAbsoluteRect:(this._cachedAbsoluteRect=this._rect.toAbsoluteRect(),this._cachedAbsoluteRect)}}function Mn(e){const t=e.parentNode;t&&t.removeChild(e)}function Fn(){const e=_.window.visualViewport;if(!e||!(C.isiOS||C.isSafari))return{left:0,top:0};const t=Math.max(Math.round(e.offsetLeft),0),n=Math.max(Math.round(e.offsetTop),0);return{left:t,top:n}}function Sn({target:e,viewportOffset:t=0,ancestorOffset:n=0,alignToTop:i,forceScroll:s}){const o=tt(e);let r=o,l=null;for(t=Fe(t);r;){let a;r==o?a=gt(e):a=gt(l),Me({parent:a,getRect:()=>$(e,r),alignToTop:i,ancestorOffset:n,forceScroll:s});let c=$(e,r);const f=$(a,r);if(c.height>f.height){const u=c.getIntersection(f);u&&(c=u)}if(ke({window:r,rect:c,viewportOffset:t,alignToTop:i,forceScroll:s}),r.parent!=r){if(l=r.frameElement,r=r.parent,!l)return}else r=null}}function ke({window:e,rect:t,alignToTop:n,forceScroll:i,viewportOffset:s}){const o=t.clone().moveBy(0,s.bottom),r=t.clone().moveBy(0,-s.top),l=new m(e).excludeScrollbarsAndBorders(),a=[r,o],c=n&&i,f=a.every(p=>l.contains(p));let{scrollX:u,scrollY:w}=e;const L=u,y=w;c?w-=l.top-t.top+s.top:f||(Nt(r,l)?w-=l.top-t.top+s.top:Pt(o,l)&&(n?w+=t.top-l.top-s.top:w+=t.bottom-l.bottom+s.bottom)),f||(Bt(t,l)?u-=l.left-t.left+s.left:Dt(t,l)&&(u+=t.right-l.right+s.right)),(u!=L||w!==y)&&e.scrollTo(u,w)}function Me({parent:e,getRect:t,alignToTop:n,forceScroll:i,ancestorOffset:s=0,limiterElement:o}){const r=tt(e),l=n&&i;let a,c,f;const u=o||r.document.body;for(;e!=u;)c=t(),a=new m(e).excludeScrollbarsAndBorders(),f=a.contains(c),l?e.scrollTop-=a.top-c.top+s:f||(Nt(c,a)?e.scrollTop-=a.top-c.top+s:Pt(c,a)&&(n?e.scrollTop+=c.top-a.top-s:e.scrollTop+=c.bottom-a.bottom+s)),f||(Bt(c,a)?e.scrollLeft-=a.left-c.left+s:Dt(c,a)&&(e.scrollLeft+=c.right-a.right+s)),e=e.parentNode}function Pt(e,t){return e.bottom>t.bottom}function Nt(e,t){return e.top<t.top}function Bt(e,t){return e.left<t.left}function Dt(e,t){return e.right>t.right}function tt(e){return z(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function gt(e){if(z(e)){let t=e.commonAncestorContainer;return Z(t)&&(t=t.parentNode),t}else return e.parentNode}function $(e,t){const n=tt(e),i=new m(e);if(n===t)return i;{let s=n;for(;s!=t;){const o=s.frameElement,r=new m(o).excludeScrollbarsAndBorders();i.moveBy(r.left,r.top),s=s.parent}}return i}function Fe(e){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:e}const Se={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},Ve={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},mt={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},g=Ne(),Re=Object.fromEntries(Object.entries(g).map(([e,t])=>{let n;return t in mt?n=mt[t]:n=e.charAt(0).toUpperCase()+e.slice(1),[t,n]}));function B(e){let t;if(typeof e=="string"){if(t=g[e.toLowerCase()],!t)throw new d("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?g.alt:0)+(e.ctrlKey?g.ctrl:0)+(e.shiftKey?g.shift:0)+(e.metaKey?g.cmd:0);return t}function jt(e){return typeof e=="string"&&(e=Be(e)),e.map(t=>typeof t=="string"?Pe(t):t).reduce((t,n)=>n+t,0)}function Vn(e,t){let n=jt(e);const i=C.isMac||C.isiOS;return Object.entries(i?Se:Ve).reduce((r,[l,a])=>((n&g[l])!=0&&(n&=~g[l],r+=a),r),"")+(n?Re[n]:"")}function Rn(e){return e==g.arrowright||e==g.arrowleft||e==g.arrowup||e==g.arrowdown}function ve(e,t){const n=t==="ltr";switch(e){case g.arrowleft:return n?"left":"right";case g.arrowright:return n?"right":"left";case g.arrowup:return"up";case g.arrowdown:return"down"}}function Pe(e){if(e.endsWith("!"))return B(e.slice(0,-1));const t=B(e);return(C.isMac||C.isiOS)&&t==g.ctrl?g.cmd:t}function vn(e,t){const n=ve(e,t);return n==="down"||n==="right"}function Ne(){const e={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){const n=String.fromCharCode(t);e[n.toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}function Be(e){return e.split("+").map(t=>t.trim())}const De=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function bt(e){return De.includes(e)?"rtl":"ltr"}function je(e){return Array.isArray(e)?e:[e]}_.window.CKEDITOR_TRANSLATIONS||(_.window.CKEDITOR_TRANSLATIONS={});function Oe(e,t,n=1,i){if(typeof n!="number")throw new d("translation-service-quantity-not-a-number",null,{quantity:n});const s=i||_.window.CKEDITOR_TRANSLATIONS,o=$e(s);o===1&&(e=Object.keys(s)[0]);const r=t.id||t.string;if(o===0||!Ke(e,r,s))return n!==1?t.plural:t.string;const l=s[e].dictionary,a=s[e].getPluralForm||(u=>u===1?0:1),c=l[r];if(typeof c=="string")return c;const f=Number(a(n));return c[f]}function We(e){return Array.isArray(e)?e.reduce((t,n)=>Kt(t,n)):e}function Ke(e,t,n){return!!n[e]&&!!n[e].dictionary[t]}function $e(e){return Object.keys(e).length}class Pn{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:t="en",contentLanguage:n,translations:i}={}){this.uiLanguage=t,this.contentLanguage=n||this.uiLanguage,this.uiLanguageDirection=bt(this.uiLanguage),this.contentLanguageDirection=bt(this.contentLanguage),this.translations=We(i),this.t=(s,o)=>this._t(s,o)}_t(t,n=[]){n=je(n),typeof t=="string"&&(t={string:t});const s=!!t.plural?n[0]:1,o=Oe(this.uiLanguage,t,s,this.translations);return He(o,n)}}function He(e,t){return e.replace(/%(\d+)/g,(n,i)=>i<t.length?t[i]:n)}class Nn extends I(){_items;_itemMap;_idProperty;_bindToCollection;_bindToExternalToInternalMap;_bindToInternalToExternalMap;_skippedIndexesFromExternal;constructor(t={},n={}){super();const i=J(t);if(i||(n=t),this._items=[],this._itemMap=new Map,this._idProperty=n.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const s of t)this._items.push(s),this._itemMap.set(this._getItemIdBeforeAdding(s),s)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,n){return this.addMany([t],n)}addMany(t,n){if(n===void 0)n=this._items.length;else if(n>this._items.length||n<0)throw new d("collection-add-item-invalid-index",this);let i=0;for(const s of t){const o=this._getItemIdBeforeAdding(s),r=n+i;this._items.splice(r,0,s),this._itemMap.set(o,s),this.fire("add",s,r),i++}return this.fire("change",{added:t,removed:[],index:n}),this}get(t){let n;if(typeof t=="string")n=this._itemMap.get(t);else if(typeof t=="number")n=this._items[t];else throw new d("collection-get-invalid-arg",this);return n||null}has(t){if(typeof t=="string")return this._itemMap.has(t);{const n=this._idProperty,i=t[n];return i&&this._itemMap.has(i)}}getIndex(t){let n;return typeof t=="string"?n=this._itemMap.get(t):n=t,n?this._items.indexOf(n):-1}remove(t){const[n,i]=this._remove(t);return this.fire("change",{added:[],removed:[n],index:i}),n}map(t,n){return this._items.map(t,n)}forEach(t,n){this._items.forEach(t,n)}find(t,n){return this._items.find(t,n)}filter(t,n){return this._items.filter(t,n)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const t=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:t,index:0})}bindTo(t){if(this._bindToCollection)throw new d("collection-bind-to-rebind",this);return this._bindToCollection=t,{as:n=>{this._setUpBindToBinding(i=>new n(i))},using:n=>{typeof n=="function"?this._setUpBindToBinding(n):this._setUpBindToBinding(i=>i[n])}}}_setUpBindToBinding(t){const n=this._bindToCollection,i=(s,o,r)=>{const l=n._bindToCollection==this,a=n._bindToInternalToExternalMap.get(o);if(l&&a)this._bindToExternalToInternalMap.set(o,a),this._bindToInternalToExternalMap.set(a,o);else{const c=t(o);if(!c){this._skippedIndexesFromExternal.push(r);return}let f=r;for(const u of this._skippedIndexesFromExternal)r>u&&f--;for(const u of n._skippedIndexesFromExternal)f>=u&&f++;this._bindToExternalToInternalMap.set(o,c),this._bindToInternalToExternalMap.set(c,o),this.add(c,f);for(let u=0;u<n._skippedIndexesFromExternal.length;u++)f<=n._skippedIndexesFromExternal[u]&&n._skippedIndexesFromExternal[u]++}};for(const s of n)i(null,s,n.getIndex(s));this.listenTo(n,"add",i),this.listenTo(n,"remove",(s,o,r)=>{const l=this._bindToExternalToInternalMap.get(o);l&&this.remove(l),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((a,c)=>(r<c&&a.push(c-1),r>c&&a.push(c),a),[])})}_getItemIdBeforeAdding(t){const n=this._idProperty;let i;if(n in t){if(i=t[n],typeof i!="string")throw new d("collection-add-invalid-id",this);if(this.get(i))throw new d("collection-add-item-already-exists",this)}else t[n]=i=X();return i}_remove(t){let n,i,s,o=!1;const r=this._idProperty;if(typeof t=="string"?(i=t,s=this._itemMap.get(i),o=!s,s&&(n=this._items.indexOf(s))):typeof t=="number"?(n=t,s=this._items[n],o=!s,s&&(i=s[r])):(s=t,i=s[r],n=this._items.indexOf(s),o=n==-1||!this._itemMap.get(i)),o)throw new d("collection-remove-404",this);this._items.splice(n,1),this._itemMap.delete(i);const l=this._bindToInternalToExternalMap.get(s);return this._bindToInternalToExternalMap.delete(s),this._bindToExternalToInternalMap.delete(l),this.fire("remove",s,n),[s,n]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Bn(e){const t=e.next();return t.done?null:t.value}class Ue extends Q(kt()){_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(t){if(wt(t))this._addElement(t);else if(_t(t))this._addView(t);else{if(!t.element)throw new d("focustracker-add-view-missing-element",{focusTracker:this,view:t});this._addElement(t.element)}}remove(t){wt(t)?this._removeElement(t):_t(t)?this._removeView(t):this._removeElement(t.element)}_addElement(t){if(this._elements.has(t))throw new d("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>{const n=this.externalViews.find(i=>Ge(t,i));n?this._focus(n.element):this._focus(t)},{useCapture:!0}),this.listenTo(t,"blur",()=>{this._blur()},{useCapture:!0}),this._elements.add(t)}_removeElement(t){this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t)),t===this.focusedElement&&this._blur()}_addView(t){t.element&&this._addElement(t.element),this.listenTo(t.focusTracker,"change:focusedElement",()=>{t.focusTracker.focusedElement?t.element&&this._focus(t.element):this._blur()}),this._externalViews.add(t)}_removeView(t){t.element&&this._removeElement(t.element),this.stopListening(t.focusTracker),this._externalViews.delete(t)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(t){this._clearBlurTimeout(),this.focusedElement=t,this.isFocused=!0}_blur(){this.elements.find(i=>i.contains(document.activeElement))||this.externalViews.find(i=>i.focusTracker.isFocused&&!i.focusTracker._blurTimeout)||(this._clearBlurTimeout(),this._blurTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function _t(e){return"focusTracker"in e&&e.focusTracker instanceof Ue}function wt(e){return Et(e)}function Ge(e,t){return yt(e,t)?!0:!!t.focusTracker.externalViews.find(n=>yt(e,n))}function yt(e,t){return!!t.element&&t.element.contains(document.activeElement)&&e.contains(t.element)}class Dn{_listener;constructor(){this._listener=new(Q())}listenTo(t){this._listener.listenTo(t,"keydown",(n,i)=>{this._listener.fire("_keydown:"+B(i),i)})}set(t,n,i={}){const s=jt(t),o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+s,(r,l)=>{i.filter&&!i.filter(l)||(n(l,()=>{l.preventDefault(),l.stopPropagation(),r.stop()}),r.return=!0)},{priority:o})}press(t){return!!this._listener.fire("_keydown:"+B(t),t)}stopListening(t){this._listener.stopListening(t)}destroy(){this.stopListening()}}function qe(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}function jn(e){return J(e)?new Map(e):qe(e)}function On(e,t,n){const i=e.length,s=t.length;for(let o=i-1;o>=n;o--)e[o+s]=e[o];for(let o=0;o<s;o++)e[n+o]=t[o]}function Wn(e,t){let n;function i(...s){i.cancel(),n=setTimeout(()=>e(...s),t)}return i.cancel=()=>{clearTimeout(n)},i}function Kn(e){try{if(!e.startsWith("ey"))return null;const t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch{return null}}function Ye(){const e=[];for(let t=0;t<256;t++){let n=t;for(let i=0;i<8;i++)n&1?n=3988292384^n>>>1:n=n>>>1;e[t]=n}return e}function $n(e){const t=Array.isArray(e)?e:[e],n=Ye();let i=-1;const s=t.map(o=>Array.isArray(o)?o.join(""):String(o)).join("");for(let o=0;o<s.length;o++){const r=s.charCodeAt(o);i=i>>>8^n[(i^r)&255]}return i=(i^-1)>>>0,i.toString(16).padStart(8,"0")}function Hn(e){const t=[{name:"address",isVoid:!1},{name:"article",isVoid:!1},{name:"aside",isVoid:!1},{name:"blockquote",isVoid:!1},{name:"details",isVoid:!1},{name:"dialog",isVoid:!1},{name:"dd",isVoid:!1},{name:"div",isVoid:!1},{name:"dl",isVoid:!1},{name:"dt",isVoid:!1},{name:"fieldset",isVoid:!1},{name:"figcaption",isVoid:!1},{name:"figure",isVoid:!1},{name:"footer",isVoid:!1},{name:"form",isVoid:!1},{name:"h1",isVoid:!1},{name:"h2",isVoid:!1},{name:"h3",isVoid:!1},{name:"h4",isVoid:!1},{name:"h5",isVoid:!1},{name:"h6",isVoid:!1},{name:"header",isVoid:!1},{name:"hgroup",isVoid:!1},{name:"hr",isVoid:!0},{name:"li",isVoid:!1},{name:"main",isVoid:!1},{name:"nav",isVoid:!1},{name:"ol",isVoid:!1},{name:"p",isVoid:!1},{name:"section",isVoid:!1},{name:"table",isVoid:!1},{name:"tbody",isVoid:!1},{name:"td",isVoid:!1},{name:"th",isVoid:!1},{name:"thead",isVoid:!1},{name:"tr",isVoid:!1},{name:"ul",isVoid:!1}],n=t.map(r=>r.name).join("|"),i=e.replace(new RegExp(`</?(${n})( .*?)?>`,"g"),`
|
|
106
4
|
$&
|
|
107
5
|
`).replace(/<br[^>]*>/g,`$&
|
|
108
6
|
`).split(`
|
|
109
7
|
`);let s=0,o=!1;return i.map(r=>(o=Qe(r,o),!r.length&&!o?"":Xe(r,t)?P(r,s++):Je(r,t)?P(r,--s):o==="middle"||o==="last"?P(r,0):P(r,s))).join("").trimEnd()}function Xe(e,t){return t.some(n=>!(n.isVoid||!new RegExp(`<${n.name}( .*?)?>`).test(e)))}function Je(e,t){return t.some(n=>new RegExp(`</${n.name}>`).test(e))}function P(e,t,n=" "){return`${n.repeat(Math.max(0,t))}${e}
|
|
110
|
-
`}function Qe(e,t){const n=/<pre( .*?)?>/.test(e),i=/<\/pre>/.test(e);return n&&i?!1:n?"first":i?"last":t==="first"||t==="middle"?"middle":!1}
|
|
111
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
112
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
113
|
-
*/function Ze(e){return!!e&&e.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e)}function ze(e){return!!e&&e.length==1&&/[\ud800-\udbff]/.test(e)}function tn(e){return!!e&&e.length==1&&/[\udc00-\udfff]/.test(e)}function Un(e,t){return ze(e.charAt(t-1))&&tn(e.charAt(t))}function Gn(e,t){return Ze(e.charAt(t))}const en=nn();function qn(e,t){const n=String(e).matchAll(en);return Array.from(n).some(i=>i.index<t&&t<i.index+i[0].length)}function nn(){const e=[new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}","u"),new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}","u"),new RegExp("\\p{Emoji}\\u{FE0F}","u"),new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*","u")],t=new RegExp("\\p{Regional_Indicator}{2}","u").source,n="(?:"+e.map(s=>s.source).join("|")+")",i=`${t}|${n}(?:${n})*`;return new RegExp(i,"ug")}export{d as CKEditorError,Nn as Collection,_n as Config,ne as DOCUMENTATION_URL,Q as DomEmitterMixin,pn as ElementReplacer,I as EmitterMixin,H as EventInfo,Ue as FocusTracker,Dn as KeystrokeHandler,Pn as Locale,kt as ObservableMixin,m as Rect,h as ResizeObserver,O as _getEmitterId,re as _getEmitterListenedTo,$t as _getUserAgent,Yt as _isAndroid,Xt as _isBlink,Ut as _isGecko,Tt as _isMac,Jt as _isMediaForcedColors,Gt as _isSafari,Ht as _isWindows,qt as _isiOS,Ct as _setEmitterId,Oe as _translate,We as _unifyTranslations,mn as compareArrays,gn as count,$n as crc32,bn as createElement,Wn as delay,xt as diff,C as env,Qt as fastDiff,Bn as first,Hn as formatHtml,wn as getAncestors,St as getBorderWidths,B as getCode,yn as getDataFromElement,Vn as getEnvKeystrokeText,bt as getLanguageDirection,ve as getLocalizedArrowKeyCodeDirection,kn as getOptimalPosition,Vt as getPositionedAncestor,En as getRangeFromMouseEvent,Fn as getVisualViewportOffset,_ as global,In as indexOf,An as insertAt,ee as insertToPriorityArray,Rn as isArrowKeyCode,Ze as isCombiningMark,Cn as isComment,vn as isForwardArrowKeyCode,ze as isHighSurrogateHalf,Gn as isInsideCombinedSymbol,qn as isInsideEmojiSequence,Un as isInsideSurrogatePair,J as isIterable,tn as isLowSurrogateHalf,ut as isNode,z as isRange,Z as isText,Ln as isValidAttributeName,_t as isViewWithFocusTracker,Ae as isVisible,N as isWindow,g as keyCodes,dn as logError,un as logWarning,qe as objectToMap,Kn as parseBase64EncodedObject,jt as parseKeystroke,U as priorities,hn as releaseDate,Mn as remove,Sn as scrollViewportToShowTarget,Tn as setDataInElement,On as spliceArray,rt as spy,je as toArray,jn as toMap,xn as toUnit,X as uid,se as version};
|
|
8
|
+
`}function Qe(e,t){const n=/<pre( .*?)?>/.test(e),i=/<\/pre>/.test(e);return n&&i?!1:n?"first":i?"last":t==="first"||t==="middle"?"middle":!1}function Ze(e){return!!e&&e.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e)}function ze(e){return!!e&&e.length==1&&/[\ud800-\udbff]/.test(e)}function tn(e){return!!e&&e.length==1&&/[\udc00-\udfff]/.test(e)}function Un(e,t){return ze(e.charAt(t-1))&&tn(e.charAt(t))}function Gn(e,t){return Ze(e.charAt(t))}const en=nn();function qn(e,t){const n=String(e).matchAll(en);return Array.from(n).some(i=>i.index<t&&t<i.index+i[0].length)}function nn(){const e=[new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}","u"),new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}","u"),new RegExp("\\p{Emoji}\\u{FE0F}","u"),new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*","u")],t=new RegExp("\\p{Regional_Indicator}{2}","u").source,n="(?:"+e.map(s=>s.source).join("|")+")",i=`${t}|${n}(?:${n})*`;return new RegExp(i,"ug")}export{d as CKEditorError,Nn as Collection,_n as Config,ne as DOCUMENTATION_URL,Q as DomEmitterMixin,pn as ElementReplacer,I as EmitterMixin,H as EventInfo,Ue as FocusTracker,Dn as KeystrokeHandler,Pn as Locale,kt as ObservableMixin,m as Rect,h as ResizeObserver,O as _getEmitterId,re as _getEmitterListenedTo,$t as _getUserAgent,Yt as _isAndroid,Xt as _isBlink,Ut as _isGecko,Tt as _isMac,Jt as _isMediaForcedColors,Gt as _isSafari,Ht as _isWindows,qt as _isiOS,Ct as _setEmitterId,Oe as _translate,We as _unifyTranslations,mn as compareArrays,gn as count,$n as crc32,bn as createElement,Wn as delay,xt as diff,C as env,Qt as fastDiff,Bn as first,Hn as formatHtml,wn as getAncestors,St as getBorderWidths,B as getCode,yn as getDataFromElement,Vn as getEnvKeystrokeText,bt as getLanguageDirection,ve as getLocalizedArrowKeyCodeDirection,kn as getOptimalPosition,Vt as getPositionedAncestor,En as getRangeFromMouseEvent,Fn as getVisualViewportOffset,_ as global,In as indexOf,An as insertAt,ee as insertToPriorityArray,Rn as isArrowKeyCode,Ze as isCombiningMark,Cn as isComment,vn as isForwardArrowKeyCode,ze as isHighSurrogateHalf,Gn as isInsideCombinedSymbol,qn as isInsideEmojiSequence,Un as isInsideSurrogatePair,J as isIterable,tn as isLowSurrogateHalf,ut as isNode,z as isRange,Z as isText,Ln as isValidAttributeName,_t as isViewWithFocusTracker,Ae as isVisible,N as isWindow,g as keyCodes,dn as logError,un as logWarning,qe as objectToMap,Kn as parseBase64EncodedObject,jt as parseKeystroke,U as priorities,hn as releaseDate,Mn as remove,Sn as scrollViewportToShowTarget,Tn as setDataInElement,On as spliceArray,rt as spy,je as toArray,jn as toMap,xn as toUnit,X as uid,se as version};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import{throttle as E}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/throttle.js";import{isElement as _}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{cloneDeepWith as b}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";/**
|
|
2
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*//**
|
|
5
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
6
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
7
|
-
*/class m{crashes=[];state="initializing";_crashNumberLimit;_now=Date.now;_minimumNonErrorTimePeriod;_boundErrorHandler;_listeners;constructor(t){if(this.crashes=[],this._crashNumberLimit=typeof t.crashNumberLimit=="number"?t.crashNumberLimit:3,this._minimumNonErrorTimePeriod=typeof t.minimumNonErrorTimePeriod=="number"?t.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=e=>{const s="error"in e?e.error:e.reason;s instanceof Error&&this._handleError(s,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e)}off(t,e){this._listeners[t]=this._listeners[t].filter(s=>s!==e)}_fire(t,...e){const s=this._listeners[t]||[];for(const r of s)r.apply(this,[null,...e])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(t,e){if(this._shouldReactToError(t)){this.crashes.push({message:t.message,stack:t.stack,filename:e instanceof ErrorEvent?e.filename:void 0,lineno:e instanceof ErrorEvent?e.lineno:void 0,colno:e instanceof ErrorEvent?e.colno:void 0,date:this._now()});const s=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:t,causesRestart:s}),s?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(t){return t.is&&t.is("CKEditorError")&&t.context!==void 0&&t.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(t)}_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;const t=this.crashes[this.crashes.length-1].date,e=this.crashes[this.crashes.length-1-this._crashNumberLimit].date;return(t-e)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}/**
|
|
8
|
-
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
9
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
10
|
-
*/function l(n,t=new Set){const e=[n],s=new Set;let r=0;for(;e.length>r;){const o=e[r++];if(!(s.has(o)||!w(o)||t.has(o)))if(s.add(o),Symbol.iterator in o)try{for(const i of o)e.push(i)}catch{}else for(const i in o)i!=="defaultValue"&&e.push(o[i])}return s}function w(n){const t=Object.prototype.toString.call(n),e=typeof n;return!(e==="number"||e==="boolean"||e==="string"||e==="symbol"||e==="function"||t==="[object Date]"||t==="[object RegExp]"||t==="[object Module]"||n===void 0||n===null||n._watchdogExcluded||n instanceof EventTarget||n instanceof Event)}function f(n,t,e=new Set){if(n===t&&P(n))return!0;const s=l(n,e),r=l(t,e);for(const o of s)if(r.has(o))return!0;return!1}function P(n){return typeof n=="object"&&n!==null}class C extends m{_editor=null;_lifecyclePromise=null;_throttledSave;_data;_lastDocumentVersion;_elementOrData;_initUsingData=!0;_editables={};_config;_excludedProps;constructor(t,e={}){super(e),this._throttledSave=E(this._save.bind(this),typeof e.saveInterval=="number"?e.saveInterval:5e3),t&&(this._creator=(s,r)=>t.create(s,r)),this._destructor=s=>s.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(t){this._creator=t}setDestructor(t){this._destructor=t}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(t=>{console.error("An error happened during the editor destroying.",t)}).then(()=>{const t={},e=[],s=this._config.rootsAttributes||{},r={};for(const[i,a]of Object.entries(this._data.roots))a.isLoaded?(t[i]="",r[i]=s[i]||{}):e.push(i);const o={...this._config,extraPlugins:this._config.extraPlugins||[],lazyRoots:e,rootsAttributes:r,_watchdogInitialData:this._data};return delete o.initialData,o.extraPlugins.push(x),this._initUsingData?this.create(t,o,o.context):_(this._elementOrData)?this.create(this._elementOrData,o,o.context):this.create(this._editables,o,o.context)}).then(()=>{this._fire("restart")})}create(t=this._elementOrData,e=this._config,s){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(super._startErrorHandling(),this._elementOrData=t,this._initUsingData=typeof t=="string"||Object.keys(t).length>0&&typeof Object.values(t)[0]=="string",this._config=this._cloneEditorConfiguration(e)||{},this._config.context=s,this._creator(t,this._config))).then(r=>{this._editor=r,r.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=r.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")}).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.cancel();const t=this._editor;return this._editor=null,t.model.document.off("change:data",this._throttledSave),this._destructor(t)})}_save(){const t=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=t}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(t){this._excludedProps=t}_getData(){const t=this._editor,e=t.model.document.roots.filter(a=>a.isAttached()&&a.rootName!="$graveyard"),{plugins:s}=t,r=s.has("CommentsRepository")&&s.get("CommentsRepository"),o=s.has("TrackChanges")&&s.get("TrackChanges"),i={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};e.forEach(a=>{i.roots[a.rootName]={content:JSON.stringify(Array.from(a.getChildren())),attributes:JSON.stringify(Array.from(a.getAttributes())),isLoaded:a._isLoaded}});for(const a of t.model.markers)a._affectsData&&(i.markers[a.name]={rangeJSON:a.getRange().toJSON(),usingOperation:a._managedUsingOperations,affectsData:a._affectsData});return r&&(i.commentThreads=JSON.stringify(r.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),o&&(i.suggestions=JSON.stringify(o.getSuggestions({toJSON:!0,skipNotAttached:!0}))),i}_getEditables(){const t={};for(const e of this.editor.model.document.getRootNames()){const s=this.editor.ui.getEditableElement(e);s&&(t[e]=s)}return t}_isErrorComingFromThisItem(t){return f(this._editor,t.context,this._excludedProps)}_cloneEditorConfiguration(t){return b(t,(e,s)=>{if(_(e)||s==="context")return e})}}class x{editor;_data;constructor(t){this.editor=t,this._data=t.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",t=>{t.stop(),this.editor.model.enqueueChange({isUndoable:!1},e=>{this._restoreCollaborationData(),this._restoreEditorData(e)}),this.editor.data.fire("ready")},{priority:999})}_createNode(t,e){if("name"in e){const s=t.createElement(e.name,e.attributes);if(e.children)for(const r of e.children)s._appendChild(this._createNode(t,r));return s}else return t.createText(e.data,e.attributes)}_restoreEditorData(t){const e=this.editor;Object.entries(this._data.roots).forEach(([s,{content:r,attributes:o}])=>{const i=JSON.parse(r),a=JSON.parse(o),c=e.model.document.getRoot(s);for(const[h,d]of a)t.setAttribute(h,d,c);for(const h of i){const d=this._createNode(t,h);t.insert(d,c,"end")}}),Object.entries(this._data.markers).forEach(([s,r])=>{const{document:o}=e.model,{rangeJSON:{start:i,end:a},...c}=r,h=o.getRoot(i.root),d=t.createPositionFromPath(h,i.path,i.stickiness),p=t.createPositionFromPath(h,a.path,a.stickiness),y=t.createRange(d,p);t.addMarker(s,{range:y,...c})})}_restoreCollaborationData(){const t=JSON.parse(this._data.commentThreads),e=JSON.parse(this._data.suggestions);if(this.editor.plugins.has("CommentsRepository")){const s=this.editor.plugins.get("CommentsRepository");for(const r of s.getCommentThreads())s._removeCommentThread({threadId:r.id});t.forEach(r=>{const o=this.editor.config.get("collaboration.channelId");this.editor.plugins.get("CommentsRepository").addCommentThread({channelId:o,...r})})}if(this.editor.plugins.has("TrackChangesEditing")){const s=this.editor.plugins.get("TrackChangesEditing");for(const r of s.getSuggestions())s._removeSuggestion(r);e.forEach(r=>{s.addSuggestionData(r)})}}}const u=Symbol("MainQueueId");class D extends m{_watchdogs=new Map;_watchdogConfig;_context=null;_contextProps=new Set;_actionQueues=new v;_contextConfig;_item;constructor(t,e={}){super(e),this._watchdogConfig=e,this._creator=s=>t.create(s),this._destructor=s=>s.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}setCreator(t){this._creator=t}setDestructor(t){this._destructor=t}get context(){return this._context}create(t={}){return this._actionQueues.enqueue(u,()=>(this._contextConfig=t,this._create()))}getItem(t){return this._getWatchdog(t)._item}getItemState(t){return this._getWatchdog(t).state}add(t){const e=g(t);return Promise.all(e.map(s=>this._actionQueues.enqueue(s.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let r;if(this._watchdogs.has(s.id))throw new Error(`Item with the given id is already added: '${s.id}'.`);if(s.type==="editor")return r=new C(null,this._watchdogConfig),r.setCreator(s.creator),r._setExcludedProperties(this._contextProps),s.destructor&&r.setDestructor(s.destructor),this._watchdogs.set(s.id,r),r.on("error",(o,{error:i,causesRestart:a})=>{this._fire("itemError",{itemId:s.id,error:i}),a&&this._actionQueues.enqueue(s.id,()=>new Promise(c=>{const h=()=>{r.off("restart",h),this._fire("itemRestart",{itemId:s.id}),c()};r.on("restart",h)}))}),r.create(s.sourceElementOrData,s.config,this._context);throw new Error(`Not supported item type: '${s.type}'.`)})))}remove(t){const e=g(t);return Promise.all(e.map(s=>this._actionQueues.enqueue(s,()=>{const r=this._getWatchdog(s);return this._watchdogs.delete(s),r.destroy()})))}destroy(){return this._actionQueues.enqueue(u,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(u,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(t=>{console.error("An error happened during destroying the context or items.",t)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(t=>(this._context=t,this._contextProps=l(this._context),Promise.all(Array.from(this._watchdogs.values()).map(e=>(e._setExcludedProperties(this._contextProps),e.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const t=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(e=>e.destroy())).then(()=>this._destructor(t))})}_getWatchdog(t){const e=this._watchdogs.get(t);if(!e)throw new Error(`Item with the given id was not registered: ${t}.`);return e}_isErrorComingFromThisItem(t){for(const e of this._watchdogs.values())if(e._isErrorComingFromThisItem(t))return!1;return f(this._context,t.context)}}class v{_onEmptyCallbacks=[];_queues=new Map;_activeActions=0;onEmpty(t){this._onEmptyCallbacks.push(t)}enqueue(t,e){const s=t===u;this._activeActions++,this._queues.get(t)||this._queues.set(t,Promise.resolve());const o=(s?Promise.all(this._queues.values()):Promise.all([this._queues.get(u),this._queues.get(t)])).then(e),i=o.catch(()=>{});return this._queues.set(t,i),o.finally(()=>{this._activeActions--,this._queues.get(t)===i&&this._activeActions===0&&this._onEmptyCallbacks.forEach(a=>a())})}}function g(n){return Array.isArray(n)?n:[n]}export{D as ContextWatchdog,C as EditorWatchdog,m as Watchdog};
|
|
1
|
+
import{throttle as E}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/throttle.js";import{isElement as _}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{cloneDeepWith as b}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";class m{crashes=[];state="initializing";_crashNumberLimit;_now=Date.now;_minimumNonErrorTimePeriod;_boundErrorHandler;_listeners;constructor(t){if(this.crashes=[],this._crashNumberLimit=typeof t.crashNumberLimit=="number"?t.crashNumberLimit:3,this._minimumNonErrorTimePeriod=typeof t.minimumNonErrorTimePeriod=="number"?t.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=e=>{const s="error"in e?e.error:e.reason;s instanceof Error&&this._handleError(s,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e)}off(t,e){this._listeners[t]=this._listeners[t].filter(s=>s!==e)}_fire(t,...e){const s=this._listeners[t]||[];for(const r of s)r.apply(this,[null,...e])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(t,e){if(this._shouldReactToError(t)){this.crashes.push({message:t.message,stack:t.stack,filename:e instanceof ErrorEvent?e.filename:void 0,lineno:e instanceof ErrorEvent?e.lineno:void 0,colno:e instanceof ErrorEvent?e.colno:void 0,date:this._now()});const s=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:t,causesRestart:s}),s?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(t){return t.is&&t.is("CKEditorError")&&t.context!==void 0&&t.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(t)}_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;const t=this.crashes[this.crashes.length-1].date,e=this.crashes[this.crashes.length-1-this._crashNumberLimit].date;return(t-e)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function l(n,t=new Set){const e=[n],s=new Set;let r=0;for(;e.length>r;){const o=e[r++];if(!(s.has(o)||!w(o)||t.has(o)))if(s.add(o),Symbol.iterator in o)try{for(const i of o)e.push(i)}catch{}else for(const i in o)i!=="defaultValue"&&e.push(o[i])}return s}function w(n){const t=Object.prototype.toString.call(n),e=typeof n;return!(e==="number"||e==="boolean"||e==="string"||e==="symbol"||e==="function"||t==="[object Date]"||t==="[object RegExp]"||t==="[object Module]"||n===void 0||n===null||n._watchdogExcluded||n instanceof EventTarget||n instanceof Event)}function f(n,t,e=new Set){if(n===t&&P(n))return!0;const s=l(n,e),r=l(t,e);for(const o of s)if(r.has(o))return!0;return!1}function P(n){return typeof n=="object"&&n!==null}class C extends m{_editor=null;_lifecyclePromise=null;_throttledSave;_data;_lastDocumentVersion;_elementOrData;_initUsingData=!0;_editables={};_config;_excludedProps;constructor(t,e={}){super(e),this._throttledSave=E(this._save.bind(this),typeof e.saveInterval=="number"?e.saveInterval:5e3),t&&(this._creator=(s,r)=>t.create(s,r)),this._destructor=s=>s.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(t){this._creator=t}setDestructor(t){this._destructor=t}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(t=>{console.error("An error happened during the editor destroying.",t)}).then(()=>{const t={},e=[],s=this._config.rootsAttributes||{},r={};for(const[i,a]of Object.entries(this._data.roots))a.isLoaded?(t[i]="",r[i]=s[i]||{}):e.push(i);const o={...this._config,extraPlugins:this._config.extraPlugins||[],lazyRoots:e,rootsAttributes:r,_watchdogInitialData:this._data};return delete o.initialData,o.extraPlugins.push(x),this._initUsingData?this.create(t,o,o.context):_(this._elementOrData)?this.create(this._elementOrData,o,o.context):this.create(this._editables,o,o.context)}).then(()=>{this._fire("restart")})}create(t=this._elementOrData,e=this._config,s){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(super._startErrorHandling(),this._elementOrData=t,this._initUsingData=typeof t=="string"||Object.keys(t).length>0&&typeof Object.values(t)[0]=="string",this._config=this._cloneEditorConfiguration(e)||{},this._config.context=s,this._creator(t,this._config))).then(r=>{this._editor=r,r.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=r.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")}).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.cancel();const t=this._editor;return this._editor=null,t.model.document.off("change:data",this._throttledSave),this._destructor(t)})}_save(){const t=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=t}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(t){this._excludedProps=t}_getData(){const t=this._editor,e=t.model.document.roots.filter(a=>a.isAttached()&&a.rootName!="$graveyard"),{plugins:s}=t,r=s.has("CommentsRepository")&&s.get("CommentsRepository"),o=s.has("TrackChanges")&&s.get("TrackChanges"),i={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};e.forEach(a=>{i.roots[a.rootName]={content:JSON.stringify(Array.from(a.getChildren())),attributes:JSON.stringify(Array.from(a.getAttributes())),isLoaded:a._isLoaded}});for(const a of t.model.markers)a._affectsData&&(i.markers[a.name]={rangeJSON:a.getRange().toJSON(),usingOperation:a._managedUsingOperations,affectsData:a._affectsData});return r&&(i.commentThreads=JSON.stringify(r.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),o&&(i.suggestions=JSON.stringify(o.getSuggestions({toJSON:!0,skipNotAttached:!0}))),i}_getEditables(){const t={};for(const e of this.editor.model.document.getRootNames()){const s=this.editor.ui.getEditableElement(e);s&&(t[e]=s)}return t}_isErrorComingFromThisItem(t){return f(this._editor,t.context,this._excludedProps)}_cloneEditorConfiguration(t){return b(t,(e,s)=>{if(_(e)||s==="context")return e})}}class x{editor;_data;constructor(t){this.editor=t,this._data=t.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",t=>{t.stop(),this.editor.model.enqueueChange({isUndoable:!1},e=>{this._restoreCollaborationData(),this._restoreEditorData(e)}),this.editor.data.fire("ready")},{priority:999})}_createNode(t,e){if("name"in e){const s=t.createElement(e.name,e.attributes);if(e.children)for(const r of e.children)s._appendChild(this._createNode(t,r));return s}else return t.createText(e.data,e.attributes)}_restoreEditorData(t){const e=this.editor;Object.entries(this._data.roots).forEach(([s,{content:r,attributes:o}])=>{const i=JSON.parse(r),a=JSON.parse(o),c=e.model.document.getRoot(s);for(const[h,d]of a)t.setAttribute(h,d,c);for(const h of i){const d=this._createNode(t,h);t.insert(d,c,"end")}}),Object.entries(this._data.markers).forEach(([s,r])=>{const{document:o}=e.model,{rangeJSON:{start:i,end:a},...c}=r,h=o.getRoot(i.root),d=t.createPositionFromPath(h,i.path,i.stickiness),p=t.createPositionFromPath(h,a.path,a.stickiness),y=t.createRange(d,p);t.addMarker(s,{range:y,...c})})}_restoreCollaborationData(){const t=JSON.parse(this._data.commentThreads),e=JSON.parse(this._data.suggestions);if(this.editor.plugins.has("CommentsRepository")){const s=this.editor.plugins.get("CommentsRepository");for(const r of s.getCommentThreads())s._removeCommentThread({threadId:r.id});t.forEach(r=>{const o=this.editor.config.get("collaboration.channelId");this.editor.plugins.get("CommentsRepository").addCommentThread({channelId:o,...r})})}if(this.editor.plugins.has("TrackChangesEditing")){const s=this.editor.plugins.get("TrackChangesEditing");for(const r of s.getSuggestions())s._removeSuggestion(r);e.forEach(r=>{s.addSuggestionData(r)})}}}const u=Symbol("MainQueueId");class D extends m{_watchdogs=new Map;_watchdogConfig;_context=null;_contextProps=new Set;_actionQueues=new v;_contextConfig;_item;constructor(t,e={}){super(e),this._watchdogConfig=e,this._creator=s=>t.create(s),this._destructor=s=>s.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}setCreator(t){this._creator=t}setDestructor(t){this._destructor=t}get context(){return this._context}create(t={}){return this._actionQueues.enqueue(u,()=>(this._contextConfig=t,this._create()))}getItem(t){return this._getWatchdog(t)._item}getItemState(t){return this._getWatchdog(t).state}add(t){const e=g(t);return Promise.all(e.map(s=>this._actionQueues.enqueue(s.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let r;if(this._watchdogs.has(s.id))throw new Error(`Item with the given id is already added: '${s.id}'.`);if(s.type==="editor")return r=new C(null,this._watchdogConfig),r.setCreator(s.creator),r._setExcludedProperties(this._contextProps),s.destructor&&r.setDestructor(s.destructor),this._watchdogs.set(s.id,r),r.on("error",(o,{error:i,causesRestart:a})=>{this._fire("itemError",{itemId:s.id,error:i}),a&&this._actionQueues.enqueue(s.id,()=>new Promise(c=>{const h=()=>{r.off("restart",h),this._fire("itemRestart",{itemId:s.id}),c()};r.on("restart",h)}))}),r.create(s.sourceElementOrData,s.config,this._context);throw new Error(`Not supported item type: '${s.type}'.`)})))}remove(t){const e=g(t);return Promise.all(e.map(s=>this._actionQueues.enqueue(s,()=>{const r=this._getWatchdog(s);return this._watchdogs.delete(s),r.destroy()})))}destroy(){return this._actionQueues.enqueue(u,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(u,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(t=>{console.error("An error happened during destroying the context or items.",t)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(t=>(this._context=t,this._contextProps=l(this._context),Promise.all(Array.from(this._watchdogs.values()).map(e=>(e._setExcludedProperties(this._contextProps),e.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const t=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(e=>e.destroy())).then(()=>this._destructor(t))})}_getWatchdog(t){const e=this._watchdogs.get(t);if(!e)throw new Error(`Item with the given id was not registered: ${t}.`);return e}_isErrorComingFromThisItem(t){for(const e of this._watchdogs.values())if(e._isErrorComingFromThisItem(t))return!1;return f(this._context,t.context)}}class v{_onEmptyCallbacks=[];_queues=new Map;_activeActions=0;onEmpty(t){this._onEmptyCallbacks.push(t)}enqueue(t,e){const s=t===u;this._activeActions++,this._queues.get(t)||this._queues.set(t,Promise.resolve());const o=(s?Promise.all(this._queues.values()):Promise.all([this._queues.get(u),this._queues.get(t)])).then(e),i=o.catch(()=>{});return this._queues.set(t,i),o.finally(()=>{this._activeActions--,this._queues.get(t)===i&&this._activeActions===0&&this._onEmptyCallbacks.forEach(a=>a())})}}function g(n){return Array.isArray(n)?n:[n]}export{D as ContextWatchdog,C as EditorWatchdog,m as Watchdog};
|