@ckeditor/ckeditor5-table
Version:
Table feature for CKEditor 5.
5 lines • 171 kB
JavaScript
!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Align cell text to the bottom":"Align cell text to the bottom","Align cell text to the center":"Align cell text to the center","Align cell text to the left":"Align cell text to the left","Align cell text to the middle":"Align cell text to the middle","Align cell text to the right":"Align cell text to the right","Align cell text to the top":"Align cell text to the top","Align table to the left":"Align table to the left","Align table to the right":"Align table to the right",Alignment:"Alignment",Background:"Background",Border:"Border","Cell properties":"Cell properties","Center table":"Center table","Choose table type":"Choose table type",Color:"Color",Column:"Column","Content table":"Content table",Dashed:"Dashed","Delete column":"Delete column","Delete row":"Delete row",Dimensions:"Dimensions",Dotted:"Dotted",Double:"Double","Enter table caption":"Enter table caption",Groove:"Groove","Header column":"Header column","Header row":"Header row",Height:"Height","Horizontal text alignment toolbar":"Horizontal text alignment toolbar","Insert a new table row (when in the last cell of a table)":"Insert a new table row (when in the last cell of a table)","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Insert table layout":"Insert table layout",Inset:"Inset","Justify cell text":"Justify cell text","Keystrokes that can be used in a table cell":"Keystrokes that can be used in a table cell","Layout table":"Layout table","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells","Move the selection to the next cell":"Move the selection to the next cell","Move the selection to the previous cell":"Move the selection to the previous cell","Navigate through the table":"Navigate through the table",None:"None",Outset:"Outset",Padding:"Padding",Ridge:"Ridge",Row:"Row","Select column":"Select column","Select row":"Select row",Solid:"Solid","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Style:"Style",Table:"Table","Table alignment toolbar":"Table alignment toolbar","Table cell text alignment":"Table cell text alignment","Table layout":"Table layout","Table properties":"Table properties","Table toolbar":"Table toolbar","Table type":"Table type","Table type options":"Table type options",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".','The value is invalid. Try "10px" or "2em" or simply "2".':'The value is invalid. Try "10px" or "2em" or simply "2".',"Vertical text alignment toolbar":"Vertical text alignment toolbar",Width:"Width"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
/*!
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(()=>{var e={21:e=>{"use strict";e.exports=function(e,t){Object.keys(t).forEach((function(o){e.setAttribute(o,t[o])}))}},25:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,".ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-content figure.table:not(.layout-table){display:table}.ck-content figure.table:not(.layout-table)>table{height:100%;width:100%}.ck-content figure.table:not(.layout-table),.ck-content table.table:not(.layout-table){margin:.9em auto}.ck-content figure.table:not(.layout-table)>table,.ck-content table.table:not(.layout-table){border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0}.ck-content figure.table:not(.layout-table)>table>tbody>tr>th,.ck-content figure.table:not(.layout-table)>table>thead>tr>th,.ck-content table.table:not(.layout-table)>tbody>tr>th,.ck-content table.table:not(.layout-table)>thead>tr>th{background:rgba(0,0,0,.05);font-weight:700}.ck-content figure.table:not(.layout-table)>table>tbody>tr>td,.ck-content figure.table:not(.layout-table)>table>tbody>tr>th,.ck-content figure.table:not(.layout-table)>table>thead>tr>td,.ck-content figure.table:not(.layout-table)>table>thead>tr>th,.ck-content table.table:not(.layout-table)>tbody>tr>td,.ck-content table.table:not(.layout-table)>tbody>tr>th,.ck-content table.table:not(.layout-table)>thead>tr>td,.ck-content table.table:not(.layout-table)>thead>tr>th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}@media print{.ck-content figure.table>table{height:auto}}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}",""]);const a=r},51:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},103:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,'.ck-editor__editable.ck-editor__editable_inline>.ck-widget.ck-widget_with-selection-handle.layout-table:first-child{margin-top:var(--ck-spacing-large)}.ck-editor__editable.ck-editor__editable_inline>.ck-widget.ck-widget_with-selection-handle.layout-table:last-child,.ck-editor__editable.ck-editor__editable_inline>.ck-widget.ck-widget_with-selection-handle.layout-table:nth-last-child(2):has(+.ck-fake-selection-container){margin-bottom:var(--ck-spacing-large)}.ck-editor__editable .table.layout-table{display:table;margin:0}.ck-editor__editable .table.layout-table.ck-widget:hover{z-index:var(--ck-z-default)}.ck-editor__editable .table.layout-table.ck-widget:hover>.ck-widget__selection-handle{opacity:.75;visibility:visible}.ck-editor__editable .table.layout-table.ck-widget:hover>.ck-widget__selection-handle:hover{opacity:1}.ck-editor__editable .table.layout-table.ck-widget:has(.ck-widget.table:hover)>.ck-widget__selection-handle{opacity:0;visibility:hidden}.ck-editor__editable .table.layout-table.ck-widget.ck-widget_selected{z-index:var(--ck-z-default)}.ck-content figure.table.layout-table,.ck-content table.table.layout-table{margin-bottom:0;margin-top:0}.ck-content figure.table.layout-table>table,.ck-content table.table.layout-table{border-spacing:0}:root{--ck-table-layout-widget-type-around-button-size:16px;--ck-table-layout-widget-type-around-icon-width:10px;--ck-table-layout-widget-type-around-icon-height:8px;--ck-table-layout-widget-handler-icon-size:10px;--ck-table-layout-default-border-color:#d4d4d4}.ck-editor__editable .table.layout-table>table{border-collapse:revert;height:100%;width:100%}.ck-editor__editable .table.layout-table>table:not([style*="border:"],[style*=border-top],[style*=border-bottom],[style*=border-left],[style*=border-right],[style*=border-width],[style*=border-style],[style*=border-color]){border-color:transparent;border-width:0;outline:none}.ck-editor__editable .table.layout-table>table>tbody>tr>td{box-shadow:revert;min-width:2em;padding:revert;text-indent:1px}.ck-editor__editable .table.layout-table>table>tbody>tr>td[style*=" width:"],.ck-editor__editable .table.layout-table>table>tbody>tr>td[style*="\'width:"],.ck-editor__editable .table.layout-table>table>tbody>tr>td[style*=";width:"],.ck-editor__editable .table.layout-table>table>tbody>tr>td[style^="width:"]{min-width:auto}.ck-editor__editable .table.layout-table>table>tbody>tr>td:focus{background-color:transparent}.ck-editor__editable .table.layout-table>table>tbody>tr>td:not([style*="border:"],[style*=border-top],[style*=border-bottom],[style*=border-left],[style*=border-right],[style*=border-width],[style*=border-style],[style*=border-color]){border-color:transparent;border-width:0;outline:var(--ck-table-layout-default-border-color) 1px dashed;outline-offset:-1px}.ck-editor__editable .table.layout-table>table>tbody>tr>td:not([style*="border:"],[style*=border-top],[style*=border-bottom],[style*=border-left],[style*=border-right],[style*=border-width],[style*=border-style],[style*=border-color]):focus{outline:var(--ck-color-focus-border) 1px solid}.ck-editor__editable .table.layout-table>table>tbody>tr>td>.ck-table-bogus-paragraph{text-indent:0;width:calc(100% - 1px)}.ck-editor__editable .table.layout-table.ck-widget>.ck-widget__type-around{--ck-widget-type-around-button-size:var(--ck-table-layout-widget-type-around-button-size)}.ck-editor__editable .table.layout-table.ck-widget>.ck-widget__type-around>.ck-widget__type-around__button.ck-widget__type-around__button_after,.ck-editor__editable .table.layout-table.ck-widget>.ck-widget__type-around>.ck-widget__type-around__button.ck-widget__type-around__button_before{transform:translateY(0);z-index:2}.ck-editor__editable .table.layout-table.ck-widget>.ck-widget__type-around>.ck-widget__type-around__button.ck-widget__type-around__button_before{border-radius:0 0 100px 100px;left:min(10%,30px);margin-left:var(--ck-table-layout-widget-type-around-button-size)}.ck-editor__editable .table.layout-table.ck-widget>.ck-widget__type-around>.ck-widget__type-around__button.ck-widget__type-around__button_before:after{border-radius:0 0 100px 100px}.ck-editor__editable .table.layout-table.ck-widget>.ck-widget__type-around>.ck-widget__type-around__button.ck-widget__type-around__button_after,.ck-editor__editable .table.layout-table.ck-widget>.ck-widget__type-around>.ck-widget__type-around__button.ck-widget__type-around__button_after:after{border-radius:100px 100px 0 0}.ck-editor__editable .table.layout-table.ck-widget>.ck-widget__type-around>.ck-widget__type-around__button svg{height:var(--ck-table-layout-widget-type-around-icon-height);width:var(--ck-table-layout-widget-type-around-icon-width)}.ck-editor__editable .table.layout-table.ck-widget.ck-widget_with-selection-handle>.ck-widget__selection-handle{--ck-widget-handler-icon-size:var(--ck-table-layout-widget-handler-icon-size);transform:translateY(calc(0px - var(--ck-widget-outline-thickness)));z-index:3}.ck-editor__editable .table.layout-table.ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:0}.ck-editor__editable .table.layout-table.ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:0}',""]);const a=r},128:e=>{"use strict";var t={};e.exports=function(e,o){var n=function(e){if(void 0===t[e]){var o=document.querySelector(e);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},175:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,":root{--ck-color-selector-caption-background:#f7f7f7;--ck-color-selector-caption-text:#333;--ck-color-selector-caption-highlighted-background:#fd0}.ck-content .table>figcaption{background-color:var(--ck-color-selector-caption-background);caption-side:top;color:var(--ck-color-selector-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;text-align:center;word-break:break-word}@media (forced-colors:active){.ck-content .table>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .table>figcaption.table__caption_highlighted{animation:ck-table-caption-highlight .6s ease-out}}.ck.ck-editor__editable .table>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}@keyframes ck-table-caption-highlight{0%{background-color:var(--ck-color-selector-caption-highlighted-background)}to{background-color:var(--ck-color-selector-caption-background)}}",""]);const a=r},218:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,".ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}",""]);const a=r},237:e=>{"use strict";e.exports=CKEditor5.dll},266:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,".ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}",""]);const a=r},311:(e,t,o)=>{e.exports=o(237)("./src/ui.js")},331:(e,t,o)=>{e.exports=o(237)("./src/clipboard.js")},355:(e,t,o)=>{e.exports=o(237)("./src/icons.js")},363:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,":root{--ck-color-selector-column-resizer-hover:var(--ck-color-base-active);--ck-table-column-resizer-width:7px;--ck-table-column-resizer-position-offset:calc(var(--ck-table-column-resizer-width)*-0.5 - 0.5px)}.ck-content .table .ck-table-resized{table-layout:fixed}.ck-content .table td,.ck-content .table th{overflow-wrap:break-word}.ck.ck-editor__editable .table td,.ck.ck-editor__editable .table th{position:relative}.ck.ck-editor__editable .table .ck-table-column-resizer{bottom:0;cursor:col-resize;position:absolute;right:var(--ck-table-column-resizer-position-offset);top:0;user-select:none;width:var(--ck-table-column-resizer-width);z-index:var(--ck-z-default)}.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer,.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer{display:none}.ck.ck-editor__editable .table .ck-table-column-resizer:hover,.ck.ck-editor__editable .table .ck-table-column-resizer__active{background-color:var(--ck-color-selector-column-resizer-hover);opacity:.25}.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer{left:var(--ck-table-column-resizer-position-offset);right:unset}",""]);const a=r},584:(e,t,o)=>{e.exports=o(237)("./src/utils.js")},591:e=>{"use strict";var t=[];function o(e){for(var o=-1,n=0;n<t.length;n++)if(t[n].identifier===e){o=n;break}return o}function n(e,n){for(var l={},r=[],a=0;a<e.length;a++){var s=e[a],c=n.base?s[0]+n.base:s[0],d=l[c]||0,u="".concat(c," ").concat(d);l[c]=d+1;var b=o(u),h={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==b)t[b].references++,t[b].updater(h);else{var m=i(h,n);n.byIndex=a,t.splice(a,0,{identifier:u,updater:m,references:1})}r.push(u)}return r}function i(e,t){var o=t.domAPI(t);o.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;o.update(e=t)}else o.remove()}}e.exports=function(e,i){var l=n(e=e||[],i=i||{});return function(e){e=e||[];for(var r=0;r<l.length;r++){var a=o(l[r]);t[a].references--}for(var s=n(e,i),c=0;c<l.length;c++){var d=o(l[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}l=s}}},639:e=>{"use strict";var t,o=(t=[],function(e,o){return t[e]=o,t.filter(Boolean).join("\n")});function n(e,t,n,i){var l;if(n)l="";else{l="",i.supports&&(l+="@supports (".concat(i.supports,") {")),i.media&&(l+="@media ".concat(i.media," {"));var r=void 0!==i.layer;r&&(l+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),l+=i.css,r&&(l+="}"),i.media&&(l+="}"),i.supports&&(l+="}")}if(e.styleSheet)e.styleSheet.cssText=o(t,l);else{var a=document.createTextNode(l),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(a,s[t]):e.appendChild(a)}}var i={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=i.singletonCounter++,o=i.singleton||(i.singleton=e.insertStyleElement(e));return{update:function(e){n(o,t,!1,e)},remove:function(e){n(o,t,!0,e)}}}},712:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}@media (prefers-reduced-motion:reduce){.ck .ck-insert-table-dropdown-grid-box{transition:none}}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}",""]);const a=r},719:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,':root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;outline:unset;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}',""]);const a=r},758:e=>{"use strict";e.exports=function(e){return e[1]}},770:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,".ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%}.ck.ck-input-color>input.ck.ck-input-text{flex-grow:1;min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button{display:flex}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{overflow:hidden;position:relative}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-input-color>.ck.ck-input-text:focus{z-index:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-left-radius:0;border-top-left-radius:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-left:1px solid transparent}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-right:1px solid transparent}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border:1px solid var(--ck-color-input-border);border-radius:0;height:20px;width:20px}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{background:red;border-radius:2px;height:150%;left:50%;top:-30%;transform:rotate(45deg);transform-origin:50%;width:8%}.ck.ck-input-color .ck.ck-input-color__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);width:100%}.ck.ck-input-color .ck.ck-input-color__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-input-border)}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard);margin-right:0}",""]);const a=r},782:(e,t,o)=>{e.exports=o(237)("./src/core.js")},783:(e,t,o)=>{e.exports=o(237)("./src/engine.js")},817:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,":root{--ck-color-selector-focused-cell-background:rgba(158,201,250,.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-selector-focused-cell-background);outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}",""]);const a=r},839:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,".ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row>:not(.ck-label)+*{margin-inline-start:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{min-width:100%;width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}",""]);const a=r},901:(e,t,o)=>{e.exports=o(237)("./src/widget.js")},911:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,'.ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck-form__row>:not(.ck-label,.ck-table-form__dimension-operator){flex-grow:1}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:"";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{max-width:80px;min-width:80px;width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both;background:var(--ck-color-base-error);border-radius:0;color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}@media (prefers-reduced-motion:reduce){.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:none}}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}',""]);const a=r},922:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var n=o(758),i=o.n(n),l=o(935),r=o.n(l)()(i());r.push([e.id,":root{--ck-form-default-width:340px}.ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form.ck-form_default-width{width:var(--ck-form-default-width)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-number,.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}@media screen and (max-width:600px){.ck.ck-form.ck-responsive-form .ck.ck-form__row.ck-form__row_with-submit{align-items:stretch;flex-direction:column;padding:0}.ck.ck-form.ck-responsive-form .ck.ck-form__row.ck-form__row_with-submit>.ck{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-form.ck-responsive-form .ck.ck-form__row.ck-form__row_with-submit .ck-button_with-text{justify-content:center}.ck.ck-form.ck-responsive-form .ck.ck-form__row.ck-form__row_large-bottom-padding{padding-bottom:var(--ck-spacing-large)}}[dir=ltr] .ck.ck-form.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-form.ck-responsive-form>:not(:last-child){margin-left:0}",""]);const a=r},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o="",n=void 0!==t[5];return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),n&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),n&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o})).join("")},t.i=function(e,o,n,i,l){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(n)for(var a=0;a<this.length;a++){var s=this[a][0];null!=s&&(r[s]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);n&&r[d[0]]||(void 0!==l&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=l),o&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=o):d[2]=o),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var l=t[n]={id:n,exports:{}};return e[n](l,l.exports,o),l.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";o.r(n),o.d(n,{PlainTableOutput:()=>at,Table:()=>rt,TableCaption:()=>_n,TableCaptionEditing:()=>gn,TableCaptionUI:()=>pn,TableCellProperties:()=>go,TableCellPropertiesEditing:()=>mo,TableCellPropertiesUI:()=>Zt,TableCellWidthEditing:()=>oo,TableClipboard:()=>Je,TableColumnResize:()=>Wo,TableColumnResizeEditing:()=>Eo,TableEditing:()=>De,TableKeyboard:()=>Ze,TableLayout:()=>jo,TableLayoutEditing:()=>No,TableMouse:()=>ot,TableProperties:()=>cn,TablePropertiesEditing:()=>en,TablePropertiesUI:()=>sn,TableSelection:()=>qe,TableToolbar:()=>ht,TableUI:()=>je,TableUtils:()=>ne});var e=o(782),t=o(901),i=o(584);function l(e,t){const{modelAttribute:o,styleName:n,viewElement:i,defaultValue:l,reduceBoxSides:r=!1,shouldUpcast:a=()=>!0}=t;e.for("upcast").attributeToAttribute({view:{name:i,styles:{[n]:/[\s\S]+/}},model:{key:o,value:(e,t,o)=>{if(!a(e))return;const i=c(l,"",o),s=e.getNormalizedStyle(n),u=r?d(s):s;return i!==u?u:void 0}}})}function r(e,t,o,n){e.for("upcast").add((e=>e.on("element:"+t,((e,t,i)=>{if(!t.modelRange)return;const l=["border-top-width","border-top-color","border-top-style","border-bottom-width","border-bottom-color","border-bottom-style","border-right-width","border-right-color","border-right-style","border-left-width","border-left-color","border-left-style"].filter((e=>t.viewItem.hasStyle(e)));if(!l.length)return;const r={styles:l};if(!i.consumable.test(t.viewItem,r))return;const a=[...t.modelRange.getItems({shallow:!0})].pop(),s=a.findAncestor("table",{includeSelf:!0});let c=n;s&&"layout"==s.getAttribute("tableType")&&(c={style:"none",color:"",width:""}),i.consumable.consume(t.viewItem,r);const u={style:t.viewItem.getNormalizedStyle("border-style"),color:t.viewItem.getNormalizedStyle("border-color"),width:t.viewItem.getNormalizedStyle("border-width")},b={style:d(u.style),color:d(u.color),width:d(u.width)};b.style!==c.style&&i.writer.setAttribute(o.style,b.style,a),b.color!==c.color&&i.writer.setAttribute(o.color,b.color,a),b.width!==c.width&&i.writer.setAttribute(o.width,b.width,a)}))))}function a(e,t){const{modelElement:o,modelAttribute:n,styleName:i}=t;e.for("downcast").attributeToAttribute({model:{name:o,key:n},view:e=>({key:"style",value:{[i]:e}})})}function s(e,t){const{modelAttribute:o,styleName:n}=t;e.for("downcast").add((e=>e.on(`attribute:${o}:table`,((e,t,o)=>{const{item:i,attributeNewValue:l}=t,{mapper:r,writer:a}=o;if(!o.consumable.consume(t.item,e.name))return;const s=[...r.toViewElement(i).getChildren()].find((e=>e.is("element","table")));l?a.setStyle(n,l,s):a.removeStyle(n,s)}))))}function c(e,t,o){const n=o.modelRange&&(0,i.first)(o.modelRange.getItems({shallow:!0})),l=n&&n.is("element")&&n.findAncestor("table",{includeSelf:!0});return l&&"layout"===l.getAttribute("tableType")?t:e}function d(e){if(!e)return;const t=["top","right","bottom","left"];if(!t.every((t=>e[t])))return e;const o=e.top;return t.every((t=>e[t]===o))?o:e}function u(e,t,o,n,i=1){null!=t&&null!=i&&t>i?n.setAttribute(e,t,o):n.removeAttribute(e,o)}function b(e,t,o={}){const n=e.createElement("tableCell",o);return e.insertElement("paragraph",n),e.insert(n,t),n}function h(e,t){const o=t.parent.parent,n=parseInt(o.getAttribute("headingColumns")||"0"),{column:i}=e.getCellLocation(t);return!!n&&i<n}function m(e,t,o){const{modelAttribute:n}=o;e.extend("tableCell",{allowAttributes:[n]}),l(t,{viewElement:/^(td|th)$/,...o}),a(t,{modelElement:"tableCell",...o})}function g(e){const t=e.getSelectedElement();return t&&t.is("element","table")?t:e.getFirstPosition().findAncestor("table")}function p(){return e=>{e.on("element:table",((e,t,o)=>{const n=t.viewItem;if(!o.consumable.test(n,{name:!0}))return;const{rows:i,headingRows:l,headingColumns:r}=function(e){let t,o=0;const n=[],i=[];let l;for(const r of Array.from(e.getChildren())){if("tbody"!==r.name&&"thead"!==r.name&&"tfoot"!==r.name)continue;"thead"!==r.name||l||(l=r);const e=Array.from(r.getChildren()).filter((e=>e.is("element","tr")));let a=null;for(const s of e){const e=Array.from(s.getChildren()).filter((e=>e.is("element","td")||e.is("element","th")));if(l&&r===l||"tbody"===r.name&&e.length>0&&(null===a||e.length===a)&&e.every((e=>e.is("element","th"))))o++,n.push(s);else{i.push(s);const e=w(s);(!t||e<t)&&(t=e)}a=Math.max(a||0,e.length)}}return{headingRows:o,headingColumns:t||0,rows:[...n,...i]}}(n),a={};r&&(a.headingColumns=r),l&&(a.headingRows=l);const s=o.writer.createElement("table",a);if(o.safeInsert(s,t.modelCursor)){if(o.consumable.consume(n,{name:!0}),i.forEach((e=>o.convertItem(e,o.writer.createPositionAt(s,"end")))),o.convertChildren(n,o.writer.createPositionAt(s,"end")),s.isEmpty){const e=o.writer.createElement("tableRow");o.writer.insert(e,o.writer.createPositionAt(s,"end")),b(o.writer,o.writer.createPositionAt(e,"end"))}o.updateConversionResult(s,t)}}))}}function f(e){return t=>{t.on(`element:${e}`,((e,t,{writer:o})=>{if(!t.modelRange)return;const n=t.modelRange.start.nodeAfter,i=o.createPositionAt(n,0);if(t.viewItem.isEmpty)return void o.insertElement("paragraph",i);const l=Array.from(n.getChildren());if(l.every((e=>e.is("element","$marker")))){const e=o.createElement("paragraph");o.insert(e,o.createPositionAt(n,0));for(const t of l)o.move(o.createRangeOn(t),o.createPositionAt(e,"end"))}}),{priority:"low"})}}function w(e){let t=0,o=0;const n=Array.from(e.getChildren()).filter((e=>"th"===e.name||"td"===e.name));for(;o<n.length&&"th"===n[o].name;){const e=n[o];t+=parseInt(e.getAttribute("colspan")||"1"),o++}return t}class _{_table;_startRow;_endRow;_startColumn;_endColumn;_includeAllSlots;_skipRows;_row;_rowIndex;_column;_cellIndex;_spannedCells;_nextCellAtColumn;_jumpedToStartRow=!1;constructor(e,t={}){this._table=e,this._startRow=void 0!==t.row?t.row:t.startRow||0,this._endRow=void 0!==t.row?t.row:t.endRow,this._startColumn=void 0!==t.column?t.column:t.startColumn||0,this._endColumn=void 0!==t.column?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){this._canJumpToStartRow()&&this._jumpToNonSpannedRowClosestToStartRow();const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0,value:void 0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const o=this._getSpanned();if(o)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(o.cell,o.row,o.column));else{const o=e.getChild(this._cellIndex);if(!o)return this._advanceToNextRow();const n=parseInt(o.getAttribute("colspan")||"1"),i=parseInt(o.getAttribute("rowspan")||"1");(n>1||i>1)&&this._recordSpans(o,i,n),this._shouldSkipSlot()||(t=this._formatOutValue(o)),this._nextCellAtColumn=this._column+n}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,o=this._column){return{done:!1,value:new k(this,e,t,o)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._row<this._startRow,o=this._column<this._startColumn,n=void 0!==this._endColumn&&this._column>this._endColumn;return e||t||o||n}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,o){const n={cell:e,row:this._row,column:this._column};for(let e=this._row;e<this._row+t;e++)for(let t=this._column;t<this._column+o;t++)e==this._row&&t==this._column||this._markSpannedCell(e,t,n)}_markSpannedCell(e,t,o){this._spannedCells.has(e)||this._spannedCells.set(e,new Map);this._spannedCells.get(e).set(t,o)}_canJumpToStartRow(){return!!this._startRow&&this._startRow>0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}}class k{cell;row;column;cellAnchorRow;cellAnchorColumn;_cellIndex;_rowIndex;_table;constructor(e,t,o,n){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=o,this.cellAnchorColumn=n,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function C(e,o){return(n,{writer:i})=>{const l=n.getAttribute("headingRows")||0,r=i.createContainerElement("table",null,[]),a=i.createContainerElement("figure",{class:"table"},r);l>0&&i.insert(i.createPositionAt(r,"end"),i.createContainerElement("thead",null,i.createSlot((e=>e.is("element","tableRow")&&e.index<l)))),l<e.getRows(n)&&i.insert(i.createPositionAt(r,"end"),i.createContainerElement("tbody",null,i.createSlot((e=>e.is("element","tableRow")&&e.index>=l))));for(const{positionOffset:e,filter:t}of o.additionalSlots)i.insert(i.createPositionAt(r,e),i.createSlot(t));return i.insert(i.createPositionAt(r,"after"),i.createSlot((e=>!e.is("element","tableRow")&&!o.additionalSlots.some((({filter:t})=>t(e)))))),o.asWidget?function(e,o){return o.setCustomProperty("table",!0,e),(0,t.toWidget)(e,o,{hasSelectionHandle:!0})}(a,i):a}}function y(e={}){return(o,{writer:n})=>{const i=o.parent,l=i.parent,r=l.getChildIndex(i),a=new _(l,{row:r}),s=l.getAttribute("headingRows")||0,c=l.getAttribute("headingColumns")||0;let d=null;for(const i of a)if(i.cell==o){const o=i.row<s||i.column<c?"th":"td";d=e.asWidget?(0,t.toWidgetEditable)(n.createEditableElement(o),n,{withAriaRole:!1}):n.createContainerElement(o);break}return d}}function v(e={}){return(t,{writer:o})=>{if(!t.parent.is("element","tableCell"))return null;if(!A(t))return null;if(e.asWidget)return o.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const e=o.createContainerElement("p");return o.setCustomProperty("dataPipeline:transparentRendering",!0,e),e}}}function A(e){return 1==e.parent.childCount&&!function(e){for(const t of e.getAttributeKeys())if(!t.startsWith("selection:")&&"htmlEmptyBlock"!=t)return!0;return!1}(e)}class T extends e.Command{refresh(){const e=this.editor.model,t=e.document.selection,o=e.schema;this.isEnabled=function(e,t){const o=e.getFirstPosition().parent,n=o===o.root?o:o.parent;return t.checkChild(n,"table")}(t,o)}execute(e={}){const t=this.editor,o=t.model,n=t.plugins.get("TableUtils"),i=t.config.get("table.defaultHeadings.rows"),l=t.config.get("table.defaultHeadings.columns");void 0===e.headingRows&&i&&(e.headingRows=i),void 0===e.headingColumns&&l&&(e.headingColumns=l),o.change((t=>{const i=n.createTable(t,e);o.insertObject(i,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(i.getNodeByPath([0,0,0]),0))}))}}class x extends e.Command{order;constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,o=e.plugins.get("TableUtils"),n="above"===this.order,i=o.getSelectionAffectedTableCells(t),l=o.getRowIndexes(i),r=n?l.first:l.last,a=i[0].findAncestor("table");o.insertRows(a,{at:n?r:r+1,copyStructureFromAbove:!n})}}class S extends e.Command{order;constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,o=e.plugins.get("TableUtils"),n="left"===this.order,i=o.getSelectionAffectedTableCells(t),l=o.getColumnIndexes(i),r=n?l.first:l.last,a=i[0].findAncestor("table");o.insertColumns(a,{columns:1,at:n?r:r+1})}}class V extends e.Command{direction;constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}function R(e,t,o){const{startRow:n,startColumn:i,endRow:l,endColumn:r}=t,a=o.createElement("table"),s=e.getAttribute("tableType");s&&o.setAttribute("tableType",s,a);const c=l-n+1;for(let e=0;e<c;e++)o.insertElement("tableRow",a,"end");const d=[...new _(e,{startRow:n,endRow:l,startColumn:i,endColumn:r,includeAllSlots:!0})];for(const{row:e,column:t,cell:s,isAnchor:c,cellAnchorRow:u,cellAnchorColumn:h}of d){const d=e-n,m=a.getChild(d);if(c){const n=o.cloneElement(s);o.append(n,m),B(n,e,t,l,r,o)}else(u<n||h<i)&&b(o,o.createPositionAt(m,"end"))}return function(e,t,o,n,i){const l=parseInt(t.getAttribute("headingRows")||"0");if(l>0){u("headingRows",l-o,e,i,0)}const r=parseInt(t.getAttribute("headingColumns")||"0");if(r>0){u("headingColumns",r-n,e,i,0)}}(a,e,n,i,o),a}function I(e,t,o=0){const n=[],i=new _(e,{startRow:o,endRow:t-1});for(const e of i){const{row:o,cellHeight:i}=e;o<t&&t<=o+i-1&&n.push(e)}return n}function P(e,t,o){const n=e.parent,i=n.parent,l=n.index,r=t-l,a={},s=parseInt(e.getAttribute("rowspan"))-r;s>1&&(a.rowspan=s);const c=parseInt(e.getAttribute("colspan")||"1");c>1&&(a.colspan=c);const d=l+r,h=[...new _(i,{startRow:l,endRow:d,includeAllSlots:!0})];let m,g=null;for(const t of h){const{row:n,column:i,cell:l}=t;l===e&&void 0===m&&(m=i),void 0!==m&&m===i&&n===d&&(g=b(o,t.getPositionBefore(),a))}return u("rowspan",r,e,o),g}function E(e,t){const o=[],n=new _(e);for(const e of n){const{column:n,cellWidth:i}=e;n<t&&t<=n+i-1&&o.push(e)}return o}function L(e,t,o,n){const i=o-t,l={},r=parseInt(e.getAttribute("colspan"))-i;r>1&&(l.colspan=r);const a=parseInt(e.getAttribute("rowspan")||"1");a>1&&(l.rowspan=a);const s=b(n,n.createPositionAfter(e),l);return u("colspan",i,e,n),s}function B(e,t,o,n,i,l){const r=parseInt(e.getAttribute("colspan")||"1"),a=parseInt(e.getAttribute("rowspan")||"1");if(o+r-1>i){u("colspan",i-o+1,e,l,1)}if(t+a-1>n){u("rowspan",n-t+1,e,l,1)}}function W(e,t){const o=t.getColumns(e),n=new Array(o).fill(0);for(const{column:t}of new _(e))n[t]++;const i=n.reduce(((e,t,o)=>t?e:[...e,o]),[]);if(i.length>0){const o=i[i.length-1];return t.removeColumns(e,{at:o}),!0}return!1}function D(e,t){const o=[],n=t.getRows(e);for(let t=0;t<n;t++){e.getChild(t).isEmpty&&o.push(t)}if(o.length>0){const n=o[o.length-1];return t.removeRows(e,{at:n}),!0}return!1}function z(e,t){W(e,t)||D(e,t)}function F(e,t){const o=Array.from(new _(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(o.every((({cellHeight:e})=>1===e)))return t.lastRow;const n=o[0].cellHeight-1;return t.lastRow+n}function O(e,t){const o=Array.from(new _(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(o.every((({cellWidth:e})=>1===e)))return t.lastColumn;const n=o[0].cellWidth-1;return t.lastColumn+n}class N extends e.Command{direction;isHorizontal;constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,o=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],n=this.value,i=this.direction;e.change((e=>{const t="right"==i||"down"==i,l=t?o:n,r=t?n:o,a=r.parent;!function(e,t,o){M(e)||(M(t)&&o.remove(o.createRangeIn(t)),o.move(o.createRangeIn(e),o.createPositionAt(t,"end")));o.remove(e)}(r,l,e);const s=this.isHorizontal?"colspan":"rowspan",c=parseInt(o.getAttribute(s)||"1"),d=parseInt(n.getAttribute(s)||"1");e.setAttribute(s,c+d,l),e.setSelection(e.createRangeIn(l));const u=this.editor.plugins.get("TableUtils");z(a.findAncestor("table"),u)}))}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),o=t.getTableCellsContainingSelection(e.selection)[0];if(!o)return;const n=this.isHorizontal?function(e,t,o){const n=e.parent,i=n.parent,l="right"==t?e.nextSibling:e.previousSibling,r=(i.getAttribute("headingColumns")||0)>0;if(!l)return;const a="right"==t?e:l,s="right"==t?l:e,{column:c}=o.getCellLocation(a),{column:d}=o.getCellLocation(s),u=parseInt(a.getAttribute("colspan")||"1"),b=h(o,a),m=h(o,s);if(r&&b!=m)return;return c+u===d?l:void 0}(o,this.direction,t):function(e,t,o){const n=e.parent,i=n.parent,l=i.getChildIndex(n);if("down"==t&&l===o.getRows(i)-1||"up"==t&&0===l)return null;const r=parseInt(e.getAttribute("rowspan")||"1"),a=i.getAttribute("headingRows")||0,s="down"==t&&l+r===a,c="up"==t&&l===a;if(a&&(s||c))return null;const d=parseInt(e.getAttribute("rowspan")||"1"),u="down"==t?l+d:l,b=[...new _(i,{endRow:u})],h=b.find((t=>t.cell===e)),m=h.column,g=b.find((({row:e,cellHeight:o,column:n})=>n===m&&("down"==t?e===u:u===e+o)));return g&&g.cell?g.cell:null}(o,this.direction,t);if(!n)return;const i=this.isHorizontal?"rowspan":"colspan",l=parseInt(o.getAttribute(i)||"1");return parseInt(n.getAttribute(i)||"1")===l?n:void 0}}function M(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class H extends e.Command{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),o=t[0];if(o){const n=o.findAncestor("table"),i=e.getRows(n)-1,l=e.getRowIndexes(t),r=0===l.first&&l.last===i;this.isEnabled=!r}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),o=t.getSelectionAffectedTableCells(e.document.selection),n=t.getRowIndexes(o),i=o[0],l=i.findAncestor("table"),r=t.getCellLocation(i).column;e.change((e=>{const o=n.last-n.first+1;t.removeRows(l,{at:n.first,rows:o});const i=function(e,t,o,n){const i=e.getChild(Math.min(t,n-1));let l=i.getChild(0),r=0;for(const e of i.getChildren()){if(r>o)return l;l=e,r+=parseInt(e.getAttribute("colspan")||"1")}return l}(l,n.first,r,t.getRows(l));e.setSelection(e.createPositionAt(i,0))}))}}class j extends e.Command{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),o=t[0];if(o){const n=o.findAncestor("table"),i=e.getColumns(n),{first:l,last:r}=e.getColumnIndexes(t);this.isEnabled=r-l<i-1}else this.isEnabled=!1}execute(){const e=this.editor.plugins.get("TableUtils"),[t,o]=function(e,t){const o=t.getSelectionAffectedTableCells(e),n=o[0],i=o.pop(),l=[n,i];return n.isBefore(i)?l:l.reverse()}(this.editor.model.document.selection,e),n=t.parent.parent,i=[...new _(n)],l={first:i.find((e=>e.cell===t)).column,la