1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="81c67492-bd55-4988-9459-5e1632a340d4",e._sentryDebugIdIdentifier="sentry-dbid-81c67492-bd55-4988-9459-5e1632a340d4")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7427],{32123:(e,t,o)=>{var l=o(38412),i=o(91145),s=o(46664);o(20986),o(43778),o(59214),o(19542);var n=o(43625),r=o(51927);o(68364);var a=o(16763);let u="table-style-block-align-left",c="table-style-block-align-right";class d{_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();let e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0,value:void 0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null,o=this._getSpanned();if(o)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(o.cell,o.row,o.column));else{let o=e.getChild(this._cellIndex);if(!o)return this._advanceToNextRow();let l=parseInt(o.getAttribute("colspan")||"1"),i=parseInt(o.getAttribute("rowspan")||"1");(l>1||i>1)&&this._recordSpans(o,i,l),this._shouldSkipSlot()||(t=this._formatOutValue(o)),this._nextCellAtColumn=this._column+l}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 h(this,e,t,o)}}_shouldSkipSlot(){let e=this._skipRows.has(this._row),t=this._row<this._startRow,o=this._column<this._startColumn,l=void 0!==this._endColumn&&this._column>this._endColumn;return e||t||o||l}_getSpanned(){let e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,o){let l={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,l)}_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(){let e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce((e,t)=>e+parseInt(t.getAttribute("colspan")||"1"),0)}}class h{cell;row;column;cellAnchorRow;cellAnchorColumn;_cellIndex;_rowIndex;_table;constructor(e,t,o,l){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=o,this.cellAnchorColumn=l,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 g(e){return"header"===e||"header-row"===e||"header-column"===e}function f(e,t,o,l,i=1){null!=t&&null!=i&&t>i?l.setAttribute(e,t,o):l.removeAttribute(e,o)}function p(e,t,o={}){let l=e.createElement("tableCell",o);return e.insertElement("paragraph",l),e.insert(l,t),l}function w(e,t){let o=parseInt(t.parent.parent.getAttribute("headingColumns")||"0"),{column:l}=e.getCellLocation(t);return!!o&&l<o}function m({table:e,row:t,column:o}){for(let{cell:l}of new d(e,{row:t,column:o}))if(!g(l.getAttribute("tableCellType")))return!1;return!0}function b(e){return e.model.schema.checkAttribute("tableCell","tableCellType")}function C(e,t,o=0){let l=[];for(let i of new d(e,{startRow:o,endRow:t-1})){let{row:e,cellHeight:o}=i,s=e+o-1;e<t&&t<=s&&l.push(i)}return l}function _(e,t,o){let l,i=e.parent,s=i.parent,n=i.index,r=parseInt(e.getAttribute("rowspan")),a=t-n,u={},c=r-a;c>
11&&(u.rowspan=c);let h=parseInt(e.getAttribute("colspan")||"1");h>1&&(u.colspan=h);let g=n+a,w=[...new d(s,{startRow:n,endRow:g,includeAllSlots:!0})],m=null;for(let t of w){let{row:i,column:s,cell:n}=t;n===e&&void 0===l&&(l=s),void 0!==l&&l===s&&i===g&&(m=p(o,t.getPositionBefore(),u))}return f("rowspan",a,e,o),m}function A(e,t){let o=Array(t.getColumns(e)).fill(0);for(let{column:t}of new d(e))o[t]++;let l=o.reduce((e,t,o)=>t?e:[...e,o],[]);if(l.length>0){let o=l[l.length-1];return t.removeColumns(e,{at:o}),!0}return!1}function R(e,t){let o=[],l=t.getRows(e);for(let t=0;t<l;t++)e.getChild(t).isEmpty&&o.push(t);if(o.length>0){let l=o[o.length-1];return t.removeRows(e,{at:l}),!0}return!1}function S(e,t){A(e,t)||R(e,t)}class v extends l.k_{static get pluginName(){return"TableUtils"}static get isOfficialPlugin(){return!0}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){let t=e.parent,o=t.parent,l=o.getChildIndex(t);for(let{cell:t,row:i,column:s}of new d(o,{row:l}))if(t===e)return{row:i,column:s}}createTable(e,t){let o=e.createElement("table");return x(e,o,0,t.rows||2,t.columns||2),t.footerRows&&this.setFooterRowsCount(e,o,t.footerRows),t.headingRows&&this.setHeadingRowsCount(e,o,t.headingRows),t.headingColumns&&this.setHeadingColumnsCount(e,o,t.headingColumns),o}insertRows(e,t={}){let o=this.editor.model,l=t.at||0,i=t.rows||1,n=void 0!==t.copyStructureFromAbove,r=t.copyStructureFromAbove?l-1:l,a=b(this.editor),u=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=this.getRows(e),h=this.getColumns(e);if(l>c)throw new s.Yb("tableutils-insertrows-insert-out-of-range",this,{options:t});o.change(t=>{let o=e.getAttribute("headingRows")||0,s=e.getAttribute("footerRows")||0;if(o>l&&(o+=i),s&&l>c-s&&(s+=i),n||0!==l&&l!==c){let o=new d(e,{endRow:n?Math.max(l,r):l}),s=Array(h).fill(1);for(let{row:e,column:a,cellHeight:u,cellWidth:c,cell:d}of o){let o=e+u-1,h=e<l&&l<=o,g=e<=r&&r<=o;h?(t.setAttribute("rowspan",u+i,d),s[a]=-c):n&&g&&(s[a]=c)}for(let o=0;o<i;o++){let i=t.createElement("tableRow");t.insert(i,e,l);for(let n=0;n<s.length;n++){let r=s[n],c=t.createPositionAt(i,"end");if(r>0){let i=p(t,c,r>1?{colspan:r}:void 0);a&&k({table:e,writer:t,cell:i,row:l+o,column:n,scopedHeaders:u})}n+=Math.abs(r)-1}}}else{let o=x(t,e,l,i,h);if(a)for(let i=0;i<o.length;i++){let s=o[i];for(let o=0;o<h;o++)k({table:e,writer:t,cell:s[o],row:l+i,column:o,scopedHeaders:u})}}this.setFooterRowsCount(t,e,s),this.setHeadingRowsCount(t,e,o,{updateCellType:!1})})}insertColumns(e,t={}){let o=this.editor.model,l=t.at||0,i=t.columns||1,s=b(this.editor),n=!!this.editor.config.get("table.tableCellProperties.scopedHeaders");o.change(t=>{let o=e.getAttribute("headingColumns");l<o&&(o+=i);let r=this.getColumns(e);if(0===l||r===l){let o=0;for(let r of e.getChildren()){if(!r.is("element","tableRow"))continue;let a=T(i,t,t.createPositionAt(r,l?"end":0));if(s)for(let i=0;i<a.length;i++)k({table:e,writer:t,cell:a[i],row:o,column:l+i,scopedHeaders:n});o++}}else{let o=new d(e,{column:l,includeAllSlots:!0});for(let r of o){let{row:a,cell:u,cellAnchorColumn:c,cellAnchorRow:d,cellWidth:h,cellHeight:g}=r;if(c<l){t.setAttribute("colspan",h+i,u);let e=d+g-1;for(let t=a;t<=e;t++)o.skipRow(t)}else{let o=T(i,t,r.getPositionBefore());if(s)for(let i=0;i<o.length;i++)k({table:e,writer:t,cell:o[i],row:a,column:l+i,scopedHeaders:n})}}}this.setHeadingColumnsCount(t,e,o,{updateCellType:!1})})}removeRows(e,t){let o=this.editor.model,l=t.rows||1,i=this.getRows(e),n=t.at,r=n+l-1;if(r>i-1)throw new s.Yb("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});o.change(t=>{let o={first:n,last:r},{cellsToMove:l,cellsToTrim:s}=function(e,{first:t,last:o}){let l=new Map,i=[];for(let{row:s,column:n,cellHeight:r,cell:a}of new d(e,{endRow:o})){let e=s+r-1;if(s>=t&&s<=o&&e>o){let e=r-(o-s+1);l.set(n,{cell:a,rowspan:e})}if(s<t&&e>=t){let l;l=e>=o?o-t+1:e-t+1,i.push({cell:a,rowspan:r-l})}}return{cellsToMove:l,cellsToTrim:i}}(e,o);l.size&&function(e,t,o,l){let i,s=[...new d(e,{includeAllSlots:!0,row:t})],n=e.getChild(t);for(let{column:e,cell:t,isAnchor:r}of s)if(o.has(e)){let{cell:t,rowspan:s}=o.get(e),r=i?l.createPositionAfter(i):l.createPositionAt(n,0);
1l.move(l.createRangeOn(t),r),f("rowspan",s,t,l),i=t}else r&&(i=t)}(e,r+1,l,t);for(let o=r;o>=n;o--)t.remove(e.getChild(o));for(let{rowspan:e,cell:o}of s)f("rowspan",e,o,t);if(function(e,{first:t,last:o},l){let i=e.getAttribute("headingRows")||0;t<i&&f("headingRows",o<i?i-(o-t+1):t,e,l,0)}(e,o,t),function(e,t,{first:o,last:l},i){if(!e.hasAttribute("footerRows"))return;let s=e.getAttribute("footerRows"),n=t-s;l>=n&&f("footerRows",o>=n?s-(l-o+1):t-1-l,e,i,0)}(e,i,o,t),A(e,this)||R(e,this),b(this.editor)){let o=e.getAttribute("headingRows")||0,l=this.getRows(e);for(;o<l&&m({table:e,row:o});)o++;this.setHeadingRowsCount(t,e,o,{updateCellType:!1})}})}removeColumns(e,t){let o=this.editor.model,l=t.at,i=t.columns||1,s=t.at+i-1;o.change(t=>{let o;var i,n=e,r={first:l,last:s},a=t;let u=n.getAttribute("headingColumns")||0;if(u&&r.first<u){let e=Math.min(u-1,r.last)-r.first+1;a.setAttribute("headingColumns",u-e,n)}let c=(o=(i=e).is("element","tableColumnGroup")?i:Array.from(i.getChildren()).find(e=>e.is("element","tableColumnGroup")))?Array.from(o.getChildren()):[];for(let o=s;o>=l;o--){for(let{cell:l,column:i,cellWidth:s}of[...new d(e)])i<=o&&s>1&&i+s>o?f("colspan",s-1,l,t):i===o&&t.remove(l);if(c[o]){let e=0===o?c[1]:c[o-1],l=parseFloat(c[o].getAttribute("columnWidth")),i=parseFloat(e.getAttribute("columnWidth"));t.remove(c[o]),t.setAttribute("columnWidth",l+i+"%",e)}}if(R(e,this)||A(e,this),b(this.editor)){let o=e.getAttribute("headingColumns")||0,l=this.getColumns(e);for(;o<l&&m({table:e,column:o});)o++;this.setHeadingColumnsCount(t,e,o,{updateCellType:!1})}})}splitCellVertically(e,t=2){let o=this.editor.model,l=e.parent.parent,i=parseInt(e.getAttribute("rowspan")||"1"),s=parseInt(e.getAttribute("colspan")||"1");o.change(o=>{if(s>1){let{newCellsSpan:l,updatedSpan:n}=I(s,t);f("colspan",n,e,o);let r={};l>1&&(r.colspan=l),i>1&&(r.rowspan=i),T(s>t?t-1:s-1,o,o.createPositionAfter(e),r)}if(s<t){let n=t-s,r=[...new d(l)],{column:a}=r.find(({cell:t})=>t===e);for(let{cell:t,cellWidth:l}of r.filter(({cell:t,cellWidth:o,column:l})=>t!==e&&l===a||l<a&&l+o>a))o.setAttribute("colspan",l+n,t);let u={};i>1&&(u.rowspan=i),T(n,o,o.createPositionAfter(e),u);let c=l.getAttribute("headingColumns")||0;c>a&&f("headingColumns",c+n,l,o)}})}splitCellHorizontally(e,t=2){let o=this.editor.model,l=e.parent,i=l.parent,s=i.getChildIndex(l),n=parseInt(e.getAttribute("rowspan")||"1"),r=parseInt(e.getAttribute("colspan")||"1");o.change(o=>{if(n>1){let l=[...new d(i,{startRow:s,endRow:s+n-1,includeAllSlots:!0})],{newCellsSpan:a,updatedSpan:u}=I(n,t);f("rowspan",u,e,o);let{column:c}=l.find(({cell:t})=>t===e),h={};a>1&&(h.rowspan=a),r>1&&(h.colspan=r);let g=0;for(let e of l){let{column:t,row:l}=e,i=t===c;g>=a&&i&&(g=0),l>=s+u&&i&&(g||T(1,o,e.getPositionBefore(),h),g++)}}if(n<t){let l=t-n,a=this.getRows(i);for(let{cell:t,cellHeight:n,row:r}of[...new d(i,{startRow:0,endRow:s})])if(t!==e&&r+n>s){let e=n+l;o.setAttribute("rowspan",e,t)}let u={};r>1&&(u.colspan=r),x(o,i,s+1,l,1,u);let c=i.getAttribute("headingRows")||0;c>s&&f("headingRows",c+l,i,o);let h=i.getAttribute("footerRows")||0;a-h<=s&&f("footerRows",h+l,i,o)}})}getColumns(e){return[...e.getChild(0).getChildren()].filter(e=>e.is("element","tableCell")).reduce((e,t)=>e+parseInt(t.getAttribute("colspan")||"1"),0)}getRows(e){return Array.from(e.getChildren()).reduce((e,t)=>t.is("element","tableRow")?e+1:e,0)}createTableWalker(e,t={}){return new d(e,t)}getSelectedTableCells(e){let t=[];for(let o of this.sortRanges(e.getRanges())){let e=o.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}setFooterRowsCount(e,t,o){if(!this.editor.config.get("table.enableFooters"))return;let l=t.getAttribute("headingRows")||0,i=this.getRows(t),s=Math.min(o,i);f("footerRows",s,t,e,0),l+s>i&&this.setHeadingRowsCount(e,t,i-s)}setHeadingRowsCount(e,t,o,l={}){let{updateCellType:i=!0,resetFormerHeadingCells:s=!0,autoExpand:n=!0}=l,r=this.getRows(t),a=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),u=t.getAttribute("headingRows")||0,c=Math.min(o,r);if(c!==u){if(f("headingRows",c,t,e,0),c+(t.getAttribute("footerRows")||0)>r){let o=r-c;this.setFooterRowsCount(e,t,o)}if(b(this.editor)){if(i){for(let{cell:o,row:l,column:i}of new d(t,{endRow:c-1}))k({table:t,writer:e,cell:o,row:l,column:i,scopedHeaders:a});if(s&&c<u)for(let o=c;o<u&&m({table:t,row:o});o++)for(let{cell:l,row:i,column:s}of new d(t,{row:o}))k({table:t,writer:e,cell:l,row:i,column:s,scopedHeaders:a})}if(n&&c>u){for(;c<r&&m({table:t,row:c});)c++;f("headingRows",c,t,e,0)}}}}setHeadingColumnsCount(e,t,o,l={}){let{updateCellType:i=!0,resetFormerHeadingCells:s=!0,autoExpand:n=!0}=l,r=this.getColumns(t),a=t.getAttribute("headingColumns")||0,u=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=Math.min(o,r);
1if(c!==a&&(f("headingColumns",c,t,e,0),b(this.editor))){if(i){for(let{cell:o,row:l,column:i}of new d(t,{endColumn:c-1}))k({table:t,writer:e,cell:o,row:l,column:i,scopedHeaders:u});if(s&&c<a)for(let o=c;o<a&&m({table:t,column:o});o++)for(let{cell:l,row:i,column:s}of new d(t,{column:o}))k({table:t,writer:e,cell:l,row:i,column:s,scopedHeaders:u})}if(n&&c>a){for(;c<r&&m({table:t,column:c});)c++;f("headingColumns",c,t,e,0)}}}getTableCellsContainingSelection(e){let t=[];for(let o of e.getRanges()){let e=o.start.findAncestor("tableCell");e&&t.push(e)}return t}getSelectionAffectedTableCells(e){let t=this.getSelectedTableCells(e);return t.length?t:this.getTableCellsContainingSelection(e)}getRowIndexes(e){let t=e.map(e=>e.parent.index);return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){let t=[...new d(e[0].findAncestor("table"))].filter(t=>e.includes(t.cell)).map(e=>e.column);return this._getFirstLastIndexesObject(t)}isSelectionRectangular(e){var t,o;let l,i;if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;let s=new Set,n=new Set,r=0;for(let t of e){let{row:e,column:o}=this.getCellLocation(t),l=parseInt(t.getAttribute("rowspan"))||1,i=parseInt(t.getAttribute("colspan"))||1;s.add(e),n.add(o),l>1&&s.add(e+l-1),i>1&&n.add(o+i-1),r+=l*i}return t=s,o=n,l=Array.from(t.values()),(Math.max(...l)-Math.min(...l)+1)*(Math.max(...i=Array.from(o.values()))-Math.min(...i)+1)==r}sortRanges(e){return Array.from(e).sort(y)}_getFirstLastIndexesObject(e){let t=e.sort((e,t)=>e-t);return{first:t[0],last:t[t.length-1]}}
1_areCellInTheSameTableSection(e){let t=e[0].findAncestor("table"),o=this.getRows(t),l=this.getRowIndexes(e),i=parseInt(t.getAttribute("headingRows"))||0,s=parseInt(t.getAttribute("footerRows"))||0;if(!this._areIndexesInSameHeadingSection(l,i)||!this._areIndexesInSameFooterSection(l,o,s))return!1;let n=this.getColumnIndexes(e),r=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameHeadingSection(n,r)}_areIndexesInSameHeadingSection({first:e,last:t},o){return e<o==t<o}_areIndexesInSameFooterSection({first:e,last:t},o,l){let i=o-l;return e>=i==t>=i}}function x(e,t,o,l,i,s={}){let n=[];for(let r=0;r<l;r++){let l=e.createElement("tableRow");e.insert(l,t,o),n.push(T(i,e,e.createPositionAt(l,"end"),s))}return n}function T(e,t,o,l={}){let i=[],s=o;for(let o=0;o<e;o++){let e=p(t,s,l);i.push(e),s=t.createPositionAfter(e)}return i}function I(e,t){if(e<t)return{newCellsSpan:1,updatedSpan:1};let o=Math.floor(e/t);return{newCellsSpan:o,updatedSpan:e-o*t+o}}function y(e,t){let o=e.start,l=t.start;return o.isBefore(l)?-1:1}function k({writer:e,table:t,row:o,column:l,cell:i,scopedHeaders:s}){let n=t.getAttribute("headingRows")||0,r=t.getAttribute("headingColumns")||0;if(o>=n&&l>=r)return void e.removeAttribute("tableCellType",i);let a="header";s&&(a=o<n?"header-column":"header-row"),e.setAttribute("tableCellType",a,i)}class P extends l.uB{refresh(){var e,t;let o,l,i=this.editor.model,s=i.document.selection,n=i.schema;this.isEnabled=(e=s,t=n,l=(o=e.getFirstPosition().parent)===o.root?o:o.parent,t.checkChild(l,"table"))}execute(e={}){let t=this.editor,o=t.model,l=t.plugins.get("TableUtils"),i=!!t.config.get("table.enableFooters"),s=t.config.get("table.defaultHeadings.rows"),n=t.config.get("table.defaultHeadings.columns"),r=t.config.get("table.defaultFooters");void 0===e.headingRows&&s&&(e.headingRows=s),void 0===e.headingColumns&&n&&(e.headingColumns=n),i&&void 0===e.footerRows&&r&&(e.footerRows=r),!i&&"footerRows"in e&&delete e.footerRows,o.change(t=>{let i=l.createTable(t,e);o.insertObject(i,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(i.getNodeByPath([0,0,0]),0))})}}class E extends l.uB{order;constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){let e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){let e=this.editor,t=e.model.document.selection,o=e.plugins.get("TableUtils"),l="above"===this.order,i=o.getSelectionAffectedTableCells(t),s=o.getRowIndexes(i),n=l?s.first:s.last,r=i[0].findAncestor("table");o.insertRows(r,{at:l?n:n+1,copyStructureFromAbove:!l})}}class V extends l.uB{order;constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){let e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){let e=this.editor,t=e.model.document.selection,o=e.plugins.get("TableUtils"),l="left"===this.order,i=o.getSelectionAffectedTableCells(t),s=o.getColumnIndexes(i),n=l?s.first:s.last,r=i[0].findAncestor("table");o.insertColumns(r,{columns:1,at:l?n:n+1})}}class H extends l.uB{direction;constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){let 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)}}class B extends l.uB{direction;isHorizontal;constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){let e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){let e=this.editor.model,t=e.document,o=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],l=this.value,i=this.direction;e.change(e=>{var t,s,n;let r="right"==i||"down"==i,a=r?o:l,u=r?l:o,c=u.parent;t=u,s=a,n=e,U(t)||(U(s)&&n.remove(n.createRangeIn(s)),n.move(n.createRangeIn(t),n.createPositionAt(s,"end"))),n.remove(t);let d=this.isHorizontal?"colspan":"rowspan",h=parseInt(o.getAttribute(d)||"1"),g=parseInt(l.getAttribute(d)||"1");e.setAttribute(d,h+g,a),e.setSelection(e.createRangeIn(a));let f=this.editor.plugins.get("TableUtils");
1S(c.findAncestor("table"),f)})}_getMergeableCell(){let e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),o=t.getTableCellsContainingSelection(e.selection)[0];if(!o)return;let l=this.isHorizontal?function(e,t,o){let l=e.parent.parent,i="right"==t?e.nextSibling:e.previousSibling,s=(l.getAttribute("headingColumns")||0)>0;if(!i)return;let n="right"==t?e:i,r="right"==t?i:e,{column:a}=o.getCellLocation(n),{column:u}=o.getCellLocation(r),c=parseInt(n.getAttribute("colspan")||"1"),d=w(o,n),h=w(o,r);if(!s||d==h)return a+c===u?i:void 0}(o,this.direction,t):function(e,t,o){let l=e.parent,i=l.parent,s=i.getChildIndex(l),n=o.getRows(i);if("down"==t&&s===n-1||"up"==t&&0===s)return null;let r=parseInt(e.getAttribute("rowspan")||"1"),a=i.getAttribute("headingRows")||0,u=i.getAttribute("footerRows")||0,c=n-u;if(a&&("down"==t&&s+r===a||"up"==t&&s===a)||u&&("up"==t&&s===c||"down"==t&&s+r===c))return null;let h=parseInt(e.getAttribute("rowspan")||"1"),g="down"==t?s+h:s,f=[...new d(i,{endRow:g})],p=f.find(t=>t.cell===e).column,w=f.find(({row:e,cellHeight:o,column:l})=>l===p&&("down"==t?e===g:g===e+o));return w&&w.cell?w.cell:null}(o,this.direction,t);if(!l)return;let i=this.isHorizontal?"rowspan":"colspan",s=parseInt(o.getAttribute(i)||"1");if(parseInt(l.getAttribute(i)||"1")===s)return l}}function U(e){let t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class F extends l.uB{refresh(){let e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),o=t[0];if(o){let l=o.findAncestor("table"),i=e.getRows(l),s=e.getRowIndexes(t),n=0===s.first&&s.last===i-1;this.isEnabled=!n}else this.isEnabled=!1}execute(){let e=this.editor.model,t=this.editor.plugins.get("TableUtils"),o=t.getSelectionAffectedTableCells(e.document.selection),l=t.getRowIndexes(o),i=o[0],s=i.findAncestor("table"),n=t.getCellLocation(i).column;e.change(e=>{let o=l.last-l.first+1;t.removeRows(s,{at:l.first,rows:o});let i=function(e,t,o,l){let i=e.getChild(Math.min(t,l-1)),s=i.getChild(0),n=0;for(let e of i.getChildren()){if(n>o)break;s=e,n+=parseInt(e.getAttribute("colspan")||"1")}return s}(s,l.first,n,t.getRows(s));e.setSelection(e.createPositionAt(i,0))})}}class O extends l.uB{refresh(){let e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),o=t[0];if(o){let l=o.findAncestor("table"),i=e.getColumns(l),{first:s,last:n}=e.getColumnIndexes(t);this.isEnabled=n-s<i-1}else this.isEnabled=!1}execute(){var e,t,o,l,i;let s,n,r,a,u=this.editor.plugins.get("TableUtils"),[c,h]=(e=this.editor.model.document.selection,n=(s=u.getSelectionAffectedTableCells(e))[0],a=[n,r=s.pop()],n.isBefore(r)?a:a.reverse()),g=c.parent.parent,f=[...new d(g)],p={first:f.find(e=>e.cell===c).column,last:f.find(e=>e.cell===h).column},w=(t=f,o=c,l=h,i=p,parseInt(l.getAttribute("colspan")||"1")>1?l:o.previousSibling||l.nextSibling?l.nextSibling||o.previousSibling:i.first?t.reverse().find(({column:e})=>e<i.first).cell:t.reverse().find(({column:e})=>e>i.last).cell);this.editor.model.change(e=>{let t=p.last-p.first+1;u.removeColumns(g,{at:p.first,columns:t}),e.setSelection(e.createPositionAt(w,0))})}}class L extends l.uB{refresh(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,o=e.getSelectionAffectedTableCells(t.document.selection);if(0===o.length){this.isEnabled=!1,this.value=!1;return}let l=o[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(l,"headingRows"),this.value=o.every(e=>this._isInHeading(e,e.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),o=this.editor.model,l=t.getSelectionAffectedTableCells(o.document.selection),i=l[0].findAnce
1stor("table"),{first:s,last:n}=t.getRowIndexes(l),r=this.value?s:n+1,a=i.getAttribute("headingRows")||0;o.change(e=>{if(r){let t=r>a?a:0;for(let{cell:o}of C(i,r,t))_(o,r,e)}t.setHeadingRowsCount(e,i,r)})}_isInHeading(e,t){let o=parseInt(t.getAttribute("headingRows")||"0");return!!o&&e.parent.index<o}}class M extends l.uB{refresh(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,o=e.getSelectionAffectedTableCells(t.document.selection);if(0===o.length){this.isEnabled=!1,this.value=!1;return}let l=o[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(l,"footerRows"),this.value=o.every(e=>this._isInFooter(e,l))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),o=this.editor.model,l=t.getSelectionAffectedTableCells(o.document.selection),i=l[0].findAncestor("table"),{first:s,last:n}=t.getRowIndexes(l),r=t.getRows(i),a=this.value?r-(n+1):r-s,u=i.getAttribute("footerRows")||0;o.change(e=>{if(a){let t=r-a,o=r-u;for(let{cell:l}of C(i,t,t>o?o:0))_(l,t,e)}t.setFooterRowsCount(e,i,a)})}_isInFooter(e,t){let o=parseInt(t.getAttribute("footerRows")||"0"),l=this.editor.plugins.get("TableUtils").getRows(t),i=e.parent.index;return!!o&&i>=l-o}}class N extends l.uB{refresh(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,o=e.getSelectionAffectedTableCells(t.document.selection);if(0===o.length){this.isEnabled=!1,this.value=!1;return}let l=o[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(l,"headingColumns"),this.value=o.every(t=>w(e,t))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),o=this.editor.model,l=t.getSelectionAffectedTableCells(o.document.selection),i=l[0].findAnce
1stor("table"),{first:s,last:n}=t.getColumnIndexes(l),r=this.value?s:n+1;o.change(e=>{if(r)for(let{cell:t,column:o}of function(e,t){let o=[];for(let l of new d(e)){let{column:e,cellWidth:i}=l,s=e+i-1;e<t&&t<=s&&o.push(l)}return o}(i,r))!function(e,t,o,l){let i=parseInt(e.getAttribute("colspan")),s=o-t,n={},r=i-s;r>1&&(n.colspan=r);let a=parseInt(e.getAttribute("rowspan")||"1");a>1&&(n.rowspan=a),p(l,l.createPositionAfter(e),n),f("colspan",s,e,l)}(t,o,r,e);t.setHeadingColumnsCount(e,i,r)})}}class D extends l.uB{refresh(){let e=this.editor.plugins.get(v),t=e.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=e.isSelectionRectangular(t)}execute(){let e=this.editor.model,t=this.editor.plugins.get(v);e.change(o=>{let l=t.getSelectedTableCells(e.document.selection),i=l.shift(),{mergeWidth:s,mergeHeight:n}=function(e,t,o){let l=0,i=0;for(let e of t){let{row:t,column:s}=o.getCellLocation(e);l=z(e,s,l,"colspan"),i=z(e,t,i,"rowspan")}let{row:s,column:n}=o.getCellLocation(e);return{mergeWidth:l-n,mergeHeight:i-s}}(i,l,t);for(let e of(f("colspan",s,i,o),f("rowspan",n,i,o),l)){var r,a,u;r=e,a=i,u=o,j(r)||(j(a)&&u.remove(u.createRangeIn(a)),u.move(u.createRangeIn(r),u.createPositionAt(a,"end"))),u.remove(r)}S(i.findAncestor("table"),t),o.setSelection(i,"in")})}}function j(e){let t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}function z(e,t,o,l){return Math.max(o,t+parseInt(e.getAttribute(l)||"1"))}class J extends l.uB{constructor(e){super(e),this.affectsData=!1}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){let e=this.editor.model,t=this.editor.plugins.get("TableUtils"),o=t.getSelectionAffectedTableCells(e.document.selection),l=t.getRowIndexes(o),i=o[0].findAncestor("table"),s=[];for(let t=l.first;t<=l.last;t++)for(let o of i.getChild(t).getChildren())s.push(e.createRangeOn(o));e.change(e=>{e.setSelection(s)})}}class W extends l.uB{constructor(e){super(e),this.affectsData=!1}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,o=e.getSelectionAffectedTableCells(t.document.selection),l=o[0],i=o.pop(),s=l.findAncestor("table"),n=e.getCellLocation(l),r=e.getCellLocation(i),a=Math.min(n.column,r.column),u=Math.max(n.column,r.column),c=[];for(let e of new d(s,{startColumn:a,endColumn:u}))c.push(t.createRangeOn(e.cell));t.change(e=>{e.setSelection(c)})}}l.k_,r.Ss,a.$AX;class G extends r.Ss{options;focusTracker;focusCycler;_focusables;dropdownView;inputView;keystrokes;_stillTyping;constructor(e,t){super(e),this.set("value",""),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isEmpty",!0),this.options=t,this.focusTracker=new s.$x,this._focusables=new r.s3,this.dropdownView=this._createDropdownView(),this.inputView=this._createInputTextView(),this.keystrokes=new s.EP,this._stillTyping=!1,this.focusCycler=new r.H({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-input-color"]},children:[this.dropdownView,this.inputView]}),this.on("change:value",(e,t,o)=>this._setInputValue(o))}render(){super.render(),[this.inputView,this.dropdownView.buttonView].forEach(e=>{this.focusTracker.add(e.element),this._focusables.add(e)}),this.keystrokes.listenTo(this.element)}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createDropdownView(){let e=this.locale,t=e.t,o=this.bindTemplate,l=this._createColorSelector(e),i=(0,r.yu)(e),s=new r.Ss;return s.setTemplate({tag:"span",attributes:{class:["ck","ck-input-color__button__preview"],style:{backgroundColor:o.to("value")}},children:[{tag:"span",attributes:{class:["ck","ck-input-color__button__preview__no-color-indicator",o.if("value","ck-hidden",e=>""!=e)]}}]}),i.buttonView.extendTemplate({attributes:{class:"ck-input-color__button"}}),i.buttonView.children.add(s),i.buttonView.label=t("Color picker"),i.buttonView.tooltip=!0,i.panelPosition="rtl"===e.uiLanguageDirection?"se":"sw",i.panelView.children.add(l),i.bind("isEnabled").to(this,"isReadOnly",e=>!e),i.on("change:isOpen",(e,t,o)=>{o&&(l.updateSelectedColors(),l.showColorGridsFragment())}),i}_createInputTextView(){let e=this.locale,t=new r.hK(e);return t.extendTemplate({on:{blur:t.bindTemplate.to("blur")}}),t.value=this.value,t.bind("isReadOnly","hasError").to(this),this.bind("isFocused","isEmpty").to(t),t.on("input",()=>{let e=t.element.value,o=this.options.colorDefinitions.find(t=>e===t.label);this._stillTyping=!0,this.value=o&&o.color||e}),t.on("blur",()=>{this._stillTyping=!1,this._setInputValue(t.element.value)}),t.delegate("input").to(this),t}_createColorSelector(e){let t=e.t,o=this.options.defaultColorValue||"",l=t(o?"Restore default":"Remove c
1olor"),i=new r.oB(e,{colors:this.options.colorDefinitions,columns:this.options.columns,removeButtonLabel:l,colorPickerLabel:t("Color picker"),colorPickerViewConfig:!1!==this.options.colorPickerConfig&&{...this.options.colorPickerConfig,hideInput:!0}});i.appendUI(),i.on("execute",(e,t)=>{if("colorPickerSaveButton"===t.source){this.dropdownView.isOpen=!1;return}this.value=t.value||o,this.fire("input"),"colorPicker"!==t.source&&(this.dropdownView.isOpen=!1)});let s=this.value;return i.on("colorPicker:cancel",()=>{this.value=s,this.fire("input"),this.dropdownView.isOpen=!1}),i.colorGridsFragmentView.colorPickerButtonView.on("execute",()=>{s=this.value}),i.bind("selectedColor").to(this,"value"),i}_setInputValue(e){if(!this._stillTyping){let t=$(e),o=this.options.colorDefinitions.find(e=>t===$(e.color));o?this.inputView.value=o.label:this.inputView.value=e||""}}}function $(e){return e.replace(/([(,])\s+/g,"$1").replace(/^\s+|\s+(?=[),\s]|$)/g,"").replace(/,|\s/g," ")}r.Ss;r.Jr.defaultPositions.northArrowSouth,r.Jr.defaultPositions.northArrowSouthWest,r.Jr.defaultPositions.northArrowSouthEast,r.Jr.defaultPositions.southArrowNorth,r.Jr.defaultPositions.southArrowNorthWest,r.Jr.defaultPositions.southArrowNorthEast,r.Jr.defaultPositions.viewportStickyNorth;l.k_,l.uB,l.uB,l.k_,l.uB,r.Ss;l.k_}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.