{"version":3,"sources":["webpack:///./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/utils/table-properties.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/contextualballoon.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/ui/colorinputview.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/table-properties.js","webpack:///./node_modules/@ckeditor/ckeditor5-table/src/ui/formrowview.js"],"names":["getSelectedTableWidget","selection","viewElement","getSelectedElement","isTableWidget","getTableWidgetAncestor","parentTable","findAncestor","getFirstPosition","parent","getCustomProperty","isWidget","parentName","positionOrElement","name","getSingleValue","objectOrString","isObject","top","right","bottom","left","addDefaultUnitToNumericValue","value","defaultUnit","numericValue","parseFloat","Number","isNaN","String","getSelectedTableCells","cells","sortRanges","getRanges","range","element","getContainedElement","is","push","getTableCellsContainingSelection","cellWithSelection","start","getSelectionAffectedTableCells","selectedCells","length","getRowIndexes","tableCells","indexes","map","cell","index","getFirstLastIndexesObject","getColumnIndexes","table","tableMap","TableWalker","filter","entry","includes","column","isSelectionRectangular","selectedTableCells","tableUtils","areCellInTheSameTableSection","rows","Set","columns","areaOfSelectedCells","tableCell","getCellLocation","row","rowspan","parseInt","getAttribute","colspan","add","areaOfValidSelection","getBiggestRectangleArea","ranges","Array","from","sort","compareRangeOrder","allIndexesSorted","indexA","indexB","first","last","rangeA","rangeB","posA","posB","isBefore","rowsIndexes","values","columnIndexes","lastRow","Math","max","firstRow","min","lastColumn","firstColumn","rowIndexes","headingRows","areIndexesInSameSection","headingColumns","headingSectionSize","firstCellIsInHeading","lastCellIsInHeading","DEFAULT_BALLOON_POSITIONS","BalloonPanelView","defaultPositions","BALLOON_POSITIONS","northArrowSouth","northArrowSouthWest","northArrowSouthEast","southArrowNorth","southArrowNorthWest","southArrowNorthEast","TABLE_PROPERTIES_BALLOON_POSITIONS","centeredBalloonPositionForLongWidgets","repositionContextualBalloon","editor","target","position","balloon","plugins","get","editing","view","document","getBalloonCellPositionData","getBalloonTablePositionData","updatePosition","firstPosition","model","modelTable","viewTable","mapper","toViewElement","domConverter","viewToDom","positions","rangeCount","createBoundingRect","modelTableCell","getTableCellAtPosition","viewTableCell","isTableCellSelected","nodeAfter","rects","Rect","getBoundingRect","cropTableToDimensions","sourceTable","cropDimensions","writer","startRow","startColumn","endRow","endColumn","croppedTable","createElement","cropHeight","i","insertElement","includeAllSlots","sourceRow","sourceColumn","isAnchor","cellAnchorRow","cellAnchorColumn","rowInCroppedTable","getChild","tableCellCopy","cloneElement","append","trimTableCellIfNeeded","createEmptyTableCell","createPositionAt","addHeadingsToCroppedTable","getVerticallyOverlappingCells","overlapRow","tableWalker","slotInfo","cellHeight","cellEndRow","splitHorizontally","splitRow","tableRow","rowIndex","newRowspan","newCellAttributes","newCellRowSpan","columnIndex","newCell","tableSlot","undefined","getPositionBefore","updateNumericAttribute","getHorizontallyOverlappingCells","overlapColumn","cellsToSplit","cellWidth","cellEndColumn","splitVertically","splitColumn","newColspan","newCellColSpan","createPositionAfter","cellRow","cellColumn","limitRow","limitColumn","trimmedSpan","headingRowsInCrop","headingColumnsInCrop","removeEmptyColumns","width","getColumns","columnsMap","fill","emptyColumns","reduce","result","cellsCount","emptyColumn","removeColumns","at","removeEmptyRows","emptyRows","childCount","isEmpty","emptyRow","removeRows","removeEmptyRowsColumns","removedColumns","adjustLastRowIndex","dimensions","lastRowMap","everyCellHasSingleRowspan","every","rowspanAdjustment","adjustLastColumnIndex","lastColumnMap","everyCellHasSingleColspan","colspanAdjustment","key","item","defaultValue","setAttribute","removeAttribute","insertPosition","attributes","insert","isHeadingColumnCell","InsertTableView","locale","bind","bindTemplate","items","_createGridCollection","set","to","setTemplate","tag","class","children","on","text","mousedown","evt","preventDefault","click","fire","domEvt","dataset","_highlightGridBoxes","this","boxView","itemRow","floor","itemColumn","isOn","boxes","TableSizeGridBoxView","createCollection","View","if","ColorInputView","options","_dropdownView","_createDropdownView","_inputView","_createInputTextView","_stillTyping","id","inputValue","_setInputValue","focus","t","colorGrid","_createColorGrid","dropdown","createDropdown","colorPreview","removeColorButton","_createRemoveColorButton","style","backgroundColor","buttonView","extendTemplate","tooltip","panelPosition","uiLanguageDirection","panelView","inputView","InputTextView","blur","mappedColor","colorDefinitions","find","def","label","color","delegate","ButtonView","withText","icon","icons","eraser","isOpen","ColorGridView","evtData","data","normalizedInputValue","normalizeColor","colorString","replace","val","getBorderStyleLabels","none","solid","dotted","dashed","double","groove","ridge","inset","outset","getLocalizedColorErrorText","getLocalizedLengthErrorText","colorFieldValidator","trim","isColor","lengthFieldValidator","isNumberString","isLength","isPercentage","lineWidthFieldValidator","getBorderStyleDefinitions","itemDefinitions","Collection","styleLabels","definition","type","Model","_borderStyleValue","fillToolbar","toolbar","labels","propertyName","nameToValue","button","defaultColors","hasBorder","getLabeledColorInputCreator","labeledFieldView","viewUid","statusUid","colorConfigToColorGridDefinitions","colorConfig","ariaDescribedById","errorText","parsedValue","FormRowView","forEach","child","labelView","_role","_ariaLabelledBy","role"],"mappings":";;;;;AAiBO,SAASA,EAAwBC,GACvC,IAAMC,EAAcD,EAAUE,qBAE9B,OAAKD,GAAeE,EAAeF,GAC3BA,EAGD,KASD,SAASG,EAAwBJ,GACvC,IAAMK,EAAcC,EAAc,QAASN,EAAUO,oBAErD,OAAKF,GAAeF,EAAeE,EAAYG,QACvCH,EAAYG,OAGb,KAOR,SAASL,EAAeF,GACvB,QAASA,EAAYQ,kBAAmB,UAAaC,eAAUT,GAGhE,SAASK,EAAcK,EAAYC,GAClC,IAAIJ,EAASI,EAAkBJ,OAE/B,MAAQA,EAAS,CAChB,GAAKA,EAAOK,OAASF,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iB,OAWnC,EAAKG,IAAK,QAAS4B,EAAQxB,OAAS,MAQpC,EAAKC,SAAW,EAAKmB,mBAEhBI,EAAQvB,UACZuB,EAAQvB,SAASuH,SAAS,SAAAC,GAAK,OAAI,EAAKxH,SAASjM,IAAKyT,MAYvD,EAAK7H,IAAK,QAAS,MAWnB,EAAKA,IAAK,kBAAmB,MAExB4B,EAAQkG,WACZ,EAAK9H,IAAK,CACT+H,MAAO,QACPC,gBAAiBpG,EAAQkG,UAAU5F,KAIrC,EAAKhC,YAAa,CACjBC,IAAK,MACLZ,WAAY,CACXa,MAAO,CACN,KACA,eACAR,EAAKK,GAAI,UAEVgI,KAAMrI,EAAKK,GAAI,SACf,kBAAmBL,EAAKK,GAAI,oBAE7BI,SAAU,EAAKA,WAjEmB,E,8BAXIoB","file":"js/chunk-vendors~a2e691db.0d930825.js","sourcesContent":["/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module table/utils/ui/widget\n */\n\nimport { isWidget } from 'ckeditor5/src/widget';\n\n/**\n * Returns a table widget editing view element if one is selected.\n *\n * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection\n * @returns {module:engine/view/element~Element|null}\n */\nexport function getSelectedTableWidget( selection ) {\n\tconst viewElement = selection.getSelectedElement();\n\n\tif ( viewElement && isTableWidget( viewElement ) ) {\n\t\treturn viewElement;\n\t}\n\n\treturn null;\n}\n\n/**\n * Returns a table widget editing view element if one is among the selection's ancestors.\n *\n * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection\n * @returns {module:engine/view/element~Element|null}\n */\nexport function getTableWidgetAncestor( selection ) {\n\tconst parentTable = findAncestor( 'table', selection.getFirstPosition() );\n\n\tif ( parentTable && isTableWidget( parentTable.parent ) ) {\n\t\treturn parentTable.parent;\n\t}\n\n\treturn null;\n}\n\n// Checks if a given view element is a table widget.\n//\n// @param {module:engine/view/element~Element} viewElement\n// @returns {Boolean}\nfunction isTableWidget( viewElement ) {\n\treturn !!viewElement.getCustomProperty( 'table' ) && isWidget( viewElement );\n}\n\nfunction findAncestor( parentName, positionOrElement ) {\n\tlet parent = positionOrElement.parent;\n\n\twhile ( parent ) {\n\t\tif ( parent.name === parentName ) {\n\t\t\treturn parent;\n\t\t}\n\n\t\tparent = parent.parent;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module table/utils/table-properties\n */\n\nimport { isObject } from 'lodash-es';\n\n/**\n * Returns a string if all four values of box sides are equal.\n *\n * If a string is passed, it is treated as a single value (pass-through).\n *\n *\t\t// Returns 'foo':\n *\t\tgetSingleValue( { top: 'foo', right: 'foo', bottom: 'foo', left: 'foo' } );\n *\t\tgetSingleValue( 'foo' );\n *\n *\t\t// Returns undefined:\n *\t\tgetSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );\n *\t\tgetSingleValue( { top: 'foo', right: 'foo' } );\n *\n * @param objectOrString\n * @returns {module:engine/view/stylesmap~BoxSides|String}\n */\nexport function getSingleValue( objectOrString ) {\n\tif ( !objectOrString || !isObject( objectOrString ) ) {\n\t\treturn objectOrString;\n\t}\n\n\tconst { top, right, bottom, left } = objectOrString;\n\n\tif ( top == right && right == bottom && bottom == left ) {\n\t\treturn top;\n\t}\n}\n\n/**\n * Adds a unit to a value if the value is a number or a string representing a number.\n *\n * **Note**: It does nothing to non-numeric values.\n *\n *\t\tgetSingleValue( 25, 'px' );\t\t// '25px'\n *\t\tgetSingleValue( 25, 'em' );\t\t// '25em'\n *\t\tgetSingleValue( '25em', 'px' );\t// '25em'\n *\t\tgetSingleValue( 'foo', 'px' );\t// 'foo'\n *\n * @param {*} value\n * @param {String} defaultUnit A default unit added to a numeric value.\n * @returns {String|*}\n */\nexport function addDefaultUnitToNumericValue( value, defaultUnit ) {\n\tconst numericValue = parseFloat( value );\n\n\tif ( Number.isNaN( numericValue ) ) {\n\t\treturn value;\n\t}\n\n\tif ( String( numericValue ) !== String( value ) ) {\n\t\treturn value;\n\t}\n\n\treturn `${ numericValue }${ defaultUnit }`;\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module table/utils/selection\n */\n\nimport TableWalker from '../tablewalker';\n\n/**\n * Returns all model table cells that are fully selected (from the outside)\n * within the provided model selection's ranges.\n *\n * To obtain the cells selected from the inside, use\n * {@link module:table/utils/selection~getTableCellsContainingSelection}.\n *\n * @param {module:engine/model/selection~Selection} selection\n * @returns {Array.}\n */\nexport function getSelectedTableCells( selection ) {\n\tconst cells = [];\n\n\tfor ( const range of sortRanges( selection.getRanges() ) ) {\n\t\tconst element = range.getContainedElement();\n\n\t\tif ( element && element.is( 'element', 'tableCell' ) ) {\n\t\t\tcells.push( element );\n\t\t}\n\t}\n\n\treturn cells;\n}\n\n/**\n * Returns all model table cells that the provided model selection's ranges\n * {@link module:engine/model/range~Range#start} inside.\n *\n * To obtain the cells selected from the outside, use\n * {@link module:table/utils/selection~getSelectedTableCells}.\n *\n * @param {module:engine/model/selection~Selection} selection\n * @returns {Array.}\n */\nexport function getTableCellsContainingSelection( selection ) {\n\tconst cells = [];\n\n\tfor ( const range of selection.getRanges() ) {\n\t\tconst cellWithSelection = range.start.findAncestor( 'tableCell' );\n\n\t\tif ( cellWithSelection ) {\n\t\t\tcells.push( cellWithSelection );\n\t\t}\n\t}\n\n\treturn cells;\n}\n\n/**\n * Returns all model table cells that are either completely selected\n * by selection ranges or host selection range\n * {@link module:engine/model/range~Range#start start positions} inside them.\n *\n * Combines {@link module:table/utils/selection~getTableCellsContainingSelection} and\n * {@link module:table/utils/selection~getSelectedTableCells}.\n *\n * @param {module:engine/model/selection~Selection} selection\n * @returns {Array.}\n */\nexport function getSelectionAffectedTableCells( selection ) {\n\tconst selectedCells = getSelectedTableCells( selection );\n\n\tif ( selectedCells.length ) {\n\t\treturn selectedCells;\n\t}\n\n\treturn getTableCellsContainingSelection( selection );\n}\n\n/**\n * Returns an object with the `first` and `last` row index contained in the given `tableCells`.\n *\n *\t\tconst selectedTableCells = getSelectedTableCells( editor.model.document.selection );\n *\n *\t\tconst { first, last } = getRowIndexes( selectedTableCells );\n *\n *\t\tconsole.log( `Selected rows: ${ first } to ${ last }` );\n *\n * @param {Array.} tableCells\n * @returns {Object} Returns an object with the `first` and `last` table row indexes.\n */\nexport function getRowIndexes( tableCells ) {\n\tconst indexes = tableCells.map( cell => cell.parent.index );\n\n\treturn getFirstLastIndexesObject( indexes );\n}\n\n/**\n * Returns an object with the `first` and `last` column index contained in the given `tableCells`.\n *\n *\t\tconst selectedTableCells = getSelectedTableCells( editor.model.document.selection );\n *\n *\t\tconst { first, last } = getColumnIndexes( selectedTableCells );\n *\n *\t\tconsole.log( `Selected columns: ${ first } to ${ last }` );\n *\n * @param {Array.} tableCells\n * @returns {Object} Returns an object with the `first` and `last` table column indexes.\n */\nexport function getColumnIndexes( tableCells ) {\n\tconst table = tableCells[ 0 ].findAncestor( 'table' );\n\tconst tableMap = [ ...new TableWalker( table ) ];\n\n\tconst indexes = tableMap\n\t\t.filter( entry => tableCells.includes( entry.cell ) )\n\t\t.map( entry => entry.column );\n\n\treturn getFirstLastIndexesObject( indexes );\n}\n\n/**\n * Checks if the selection contains cells that do not exceed rectangular selection.\n *\n * In a table below:\n *\n *\t\t┌───┬───┬───┬───┐\n *\t\t│ a │ b │ c │ d │\n *\t\t├───┴───┼───┤ │\n *\t\t│ e │ f │ │\n *\t\t│ ├───┼───┤\n *\t\t│ │ g │ h │\n *\t\t└───────┴───┴───┘\n *\n * Valid selections are these which create a solid rectangle (without gaps), such as:\n * - a, b (two horizontal cells)\n * - c, f (two vertical cells)\n * - a, b, e (cell \"e\" spans over four cells)\n * - c, d, f (cell d spans over a cell in the row below)\n *\n * While an invalid selection would be:\n * - a, c (the unselected cell \"b\" creates a gap)\n * - f, g, h (cell \"d\" spans over a cell from the row of \"f\" cell - thus creates a gap)\n *\n * @param {Array.} selectedTableCells\n * @param {module:table/tableutils~TableUtils} tableUtils\n * @returns {Boolean}\n */\nexport function isSelectionRectangular( selectedTableCells, tableUtils ) {\n\tif ( selectedTableCells.length < 2 || !areCellInTheSameTableSection( selectedTableCells ) ) {\n\t\treturn false;\n\t}\n\n\t// A valid selection is a fully occupied rectangle composed of table cells.\n\t// Below we will calculate the area of a selected table cells and the area of valid selection.\n\t// The area of a valid selection is defined by top-left and bottom-right cells.\n\tconst rows = new Set();\n\tconst columns = new Set();\n\n\tlet areaOfSelectedCells = 0;\n\n\tfor ( const tableCell of selectedTableCells ) {\n\t\tconst { row, column } = tableUtils.getCellLocation( tableCell );\n\t\tconst rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );\n\t\tconst colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );\n\n\t\t// Record row & column indexes of current cell.\n\t\trows.add( row );\n\t\tcolumns.add( column );\n\n\t\t// For cells that spans over multiple rows add also the last row that this cell spans over.\n\t\tif ( rowspan > 1 ) {\n\t\t\trows.add( row + rowspan - 1 );\n\t\t}\n\n\t\t// For cells that spans over multiple columns add also the last column that this cell spans over.\n\t\tif ( colspan > 1 ) {\n\t\t\tcolumns.add( column + colspan - 1 );\n\t\t}\n\n\t\tareaOfSelectedCells += ( rowspan * colspan );\n\t}\n\n\t// We can only merge table cells that are in adjacent rows...\n\tconst areaOfValidSelection = getBiggestRectangleArea( rows, columns );\n\n\treturn areaOfValidSelection == areaOfSelectedCells;\n}\n\n/**\n * Returns array of sorted ranges.\n *\n * @param {Iterable.} ranges\n * @return {Array.}\n */\nexport function sortRanges( ranges ) {\n\treturn Array.from( ranges ).sort( compareRangeOrder );\n}\n\n// Helper method to get an object with `first` and `last` indexes from an unsorted array of indexes.\nfunction getFirstLastIndexesObject( indexes ) {\n\tconst allIndexesSorted = indexes.sort( ( indexA, indexB ) => indexA - indexB );\n\n\tconst first = allIndexesSorted[ 0 ];\n\tconst last = allIndexesSorted[ allIndexesSorted.length - 1 ];\n\n\treturn { first, last };\n}\n\nfunction compareRangeOrder( rangeA, rangeB ) {\n\t// Since table cell ranges are disjoint, it's enough to check their start positions.\n\tconst posA = rangeA.start;\n\tconst posB = rangeB.start;\n\n\t// Checking for equal position (returning 0) is not needed because this would be either:\n\t// a. Intersecting range (not allowed by model)\n\t// b. Collapsed range on the same position (allowed by model but should not happen).\n\treturn posA.isBefore( posB ) ? -1 : 1;\n}\n\n// Calculates the area of a maximum rectangle that can span over the provided row & column indexes.\n//\n// @param {Array.} rows\n// @param {Array.} columns\n// @returns {Number}\nfunction getBiggestRectangleArea( rows, columns ) {\n\tconst rowsIndexes = Array.from( rows.values() );\n\tconst columnIndexes = Array.from( columns.values() );\n\n\tconst lastRow = Math.max( ...rowsIndexes );\n\tconst firstRow = Math.min( ...rowsIndexes );\n\tconst lastColumn = Math.max( ...columnIndexes );\n\tconst firstColumn = Math.min( ...columnIndexes );\n\n\treturn ( lastRow - firstRow + 1 ) * ( lastColumn - firstColumn + 1 );\n}\n\n// Checks if the selection does not mix a header (column or row) with other cells.\n//\n// For instance, in the table below valid selections consist of cells with the same letter only.\n// So, a-a (same heading row and column) or d-d (body cells) are valid while c-d or a-b are not.\n//\n//\t\t header columns\n//\t\t ↓ ↓\n//\t\t┌───┬───┬───┬───┐\n//\t\t│ a │ a │ b │ b │ ← header row\n//\t\t├───┼───┼───┼───┤\n//\t\t│ c │ c │ d │ d │\n//\t\t├───┼───┼───┼───┤\n//\t\t│ c │ c │ d │ d │\n//\t\t└───┴───┴───┴───┘\nfunction areCellInTheSameTableSection( tableCells ) {\n\tconst table = tableCells[ 0 ].findAncestor( 'table' );\n\n\tconst rowIndexes = getRowIndexes( tableCells );\n\tconst headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );\n\n\t// Calculating row indexes is a bit cheaper so if this check fails we can't merge.\n\tif ( !areIndexesInSameSection( rowIndexes, headingRows ) ) {\n\t\treturn false;\n\t}\n\n\tconst headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );\n\tconst columnIndexes = getColumnIndexes( tableCells );\n\n\t// Similarly cells must be in same column section.\n\treturn areIndexesInSameSection( columnIndexes, headingColumns );\n}\n\n// Unified check if table rows/columns indexes are in the same heading/body section.\nfunction areIndexesInSameSection( { first, last }, headingSectionSize ) {\n\tconst firstCellIsInHeading = first < headingSectionSize;\n\tconst lastCellIsInHeading = last < headingSectionSize;\n\n\treturn firstCellIsInHeading === lastCellIsInHeading;\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module table/utils/ui/contextualballoon\n */\n\nimport { centeredBalloonPositionForLongWidgets } from 'ckeditor5/src/widget';\nimport { Rect } from 'ckeditor5/src/utils';\nimport { BalloonPanelView } from 'ckeditor5/src/ui';\n\nimport { getTableWidgetAncestor } from './widget';\n\nconst DEFAULT_BALLOON_POSITIONS = BalloonPanelView.defaultPositions;\n\nconst BALLOON_POSITIONS = [\n\tDEFAULT_BALLOON_POSITIONS.northArrowSouth,\n\tDEFAULT_BALLOON_POSITIONS.northArrowSouthWest,\n\tDEFAULT_BALLOON_POSITIONS.northArrowSouthEast,\n\tDEFAULT_BALLOON_POSITIONS.southArrowNorth,\n\tDEFAULT_BALLOON_POSITIONS.southArrowNorthWest,\n\tDEFAULT_BALLOON_POSITIONS.southArrowNorthEast\n];\n\nconst TABLE_PROPERTIES_BALLOON_POSITIONS = [\n\t...BALLOON_POSITIONS,\n\tcenteredBalloonPositionForLongWidgets\n];\n\n/**\n * A helper utility that positions the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance\n * with respect to the table in the editor content, if one is selected.\n *\n * @param {module:core/editor/editor~Editor} editor The editor instance.\n * @param {String} target Either \"cell\" or \"table\". Determines the target the balloon will\n * be attached to.\n */\nexport function repositionContextualBalloon( editor, target ) {\n\tconst balloon = editor.plugins.get( 'ContextualBalloon' );\n\n\tif ( getTableWidgetAncestor( editor.editing.view.document.selection ) ) {\n\t\tlet position;\n\n\t\tif ( target === 'cell' ) {\n\t\t\tposition = getBalloonCellPositionData( editor );\n\t\t} else {\n\t\t\tposition = getBalloonTablePositionData( editor );\n\t\t}\n\n\t\tballoon.updatePosition( position );\n\t}\n}\n\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected table in the editor content.\n *\n * @param {module:core/editor/editor~Editor} editor The editor instance.\n * @returns {module:utils/dom/position~Options}\n */\nexport function getBalloonTablePositionData( editor ) {\n\tconst firstPosition = editor.model.document.selection.getFirstPosition();\n\tconst modelTable = firstPosition.findAncestor( 'table' );\n\tconst viewTable = editor.editing.mapper.toViewElement( modelTable );\n\n\treturn {\n\t\ttarget: editor.editing.view.domConverter.viewToDom( viewTable ),\n\t\tpositions: TABLE_PROPERTIES_BALLOON_POSITIONS\n\t};\n}\n\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected table cell in the editor content.\n *\n * @param {module:core/editor/editor~Editor} editor The editor instance.\n * @returns {module:utils/dom/position~Options}\n */\nexport function getBalloonCellPositionData( editor ) {\n\tconst mapper = editor.editing.mapper;\n\tconst domConverter = editor.editing.view.domConverter;\n\tconst selection = editor.model.document.selection;\n\n\tif ( selection.rangeCount > 1 ) {\n\t\treturn {\n\t\t\ttarget: () => createBoundingRect( selection.getRanges(), editor ),\n\t\t\tpositions: BALLOON_POSITIONS\n\t\t};\n\t}\n\n\tconst modelTableCell = getTableCellAtPosition( selection.getFirstPosition() );\n\tconst viewTableCell = mapper.toViewElement( modelTableCell );\n\n\treturn {\n\t\ttarget: domConverter.viewToDom( viewTableCell ),\n\t\tpositions: BALLOON_POSITIONS\n\t};\n}\n\n// Returns the first selected table cell from a multi-cell or in-cell selection.\n//\n// @param {module:engine/model/position~Position} position Document position.\n// @returns {module:engine/model/element~Element}\nfunction getTableCellAtPosition( position ) {\n\tconst isTableCellSelected = position.nodeAfter && position.nodeAfter.is( 'element', 'tableCell' );\n\n\treturn isTableCellSelected ? position.nodeAfter : position.findAncestor( 'tableCell' );\n}\n\n// Returns bounding rectangle for given model ranges.\n//\n// @param {Iterable.} ranges Model ranges that the bounding rect should be returned for.\n// @param {module:core/editor/editor~Editor} editor The editor instance.\n// @returns {module:utils/dom/rect~Rect}\nfunction createBoundingRect( ranges, editor ) {\n\tconst mapper = editor.editing.mapper;\n\tconst domConverter = editor.editing.view.domConverter;\n\tconst rects = Array.from( ranges ).map( range => {\n\t\tconst modelTableCell = getTableCellAtPosition( range.start );\n\t\tconst viewTableCell = mapper.toViewElement( modelTableCell );\n\t\treturn new Rect( domConverter.viewToDom( viewTableCell ) );\n\t} );\n\n\treturn Rect.getBoundingRect( rects );\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module table/utils/structure\n */\n\nimport TableWalker from '../tablewalker';\nimport { createEmptyTableCell, updateNumericAttribute } from './common';\n\n/**\n * Returns a cropped table according to given dimensions.\n\n * To return a cropped table that starts at first row and first column and end in third row and column:\n *\n *\t\tconst croppedTable = cropTableToDimensions( table, {\n *\t\t\tstartRow: 1,\n *\t\t\tendRow: 1,\n *\t\t\tstartColumn: 3,\n *\t\t\tendColumn: 3\n *\t\t}, writer );\n *\n * Calling the code above for the table below:\n *\n *\t\t 0 1 2 3 4 0 1 2\n *\t\t ┌───┬───┬───┬───┬───┐\n *\t\t 0 │ a │ b │ c │ d │ e │\n *\t\t ├───┴───┤ ├───┴───┤ ┌───┬───┬───┐\n *\t\t 1 │ f │ │ g │ │ │ │ g │ 0\n *\t\t ├───┬───┴───┼───┬───┤ will return: ├───┴───┼───┤\n *\t\t 2 │ h │ i │ j │ k │ │ i │ j │ 1\n *\t\t ├───┤ ├───┤ │ │ ├───┤\n *\t\t 3 │ l │ │ m │ │ │ │ m │ 2\n *\t\t ├───┼───┬───┤ ├───┤ └───────┴───┘\n *\t\t 4 │ n │ o │ p │ │ q │\n *\t\t └───┴───┴───┴───┴───┘\n *\n * @param {module:engine/model/element~Element} sourceTable\n * @param {Object} cropDimensions\n * @param {Number} cropDimensions.startRow\n * @param {Number} cropDimensions.startColumn\n * @param {Number} cropDimensions.endRow\n * @param {Number} cropDimensions.endColumn\n * @param {module:engine/model/writer~Writer} writer\n * @returns {module:engine/model/element~Element}\n */\nexport function cropTableToDimensions( sourceTable, cropDimensions, writer ) {\n\tconst { startRow, startColumn, endRow, endColumn } = cropDimensions;\n\n\t// Create empty table with empty rows equal to crop height.\n\tconst croppedTable = writer.createElement( 'table' );\n\tconst cropHeight = endRow - startRow + 1;\n\n\tfor ( let i = 0; i < cropHeight; i++ ) {\n\t\twriter.insertElement( 'tableRow', croppedTable, 'end' );\n\t}\n\n\tconst tableMap = [ ...new TableWalker( sourceTable, { startRow, endRow, startColumn, endColumn, includeAllSlots: true } ) ];\n\n\t// Iterate over source table slots (including empty - spanned - ones).\n\tfor ( const { row: sourceRow, column: sourceColumn, cell: tableCell, isAnchor, cellAnchorRow, cellAnchorColumn } of tableMap ) {\n\t\t// Row index in cropped table.\n\t\tconst rowInCroppedTable = sourceRow - startRow;\n\t\tconst row = croppedTable.getChild( rowInCroppedTable );\n\n\t\t// For empty slots: fill the gap with empty table cell.\n\t\tif ( !isAnchor ) {\n\t\t\t// But fill the gap only if the spanning cell is anchored outside cropped area.\n\t\t\t// In the table from method jsdoc those cells are: \"c\" & \"f\".\n\t\t\tif ( cellAnchorRow < startRow || cellAnchorColumn < startColumn ) {\n\t\t\t\tcreateEmptyTableCell( writer, writer.createPositionAt( row, 'end' ) );\n\t\t\t}\n\t\t}\n\t\t// Otherwise clone the cell with all children and trim if it exceeds cropped area.\n\t\telse {\n\t\t\tconst tableCellCopy = writer.cloneElement( tableCell );\n\n\t\t\twriter.append( tableCellCopy, row );\n\n\t\t\t// Trim table if it exceeds cropped area.\n\t\t\t// In the table from method jsdoc those cells are: \"g\" & \"m\".\n\t\t\ttrimTableCellIfNeeded( tableCellCopy, sourceRow, sourceColumn, endRow, endColumn, writer );\n\t\t}\n\t}\n\n\t// Adjust heading rows & columns in cropped table if crop selection includes headings parts.\n\taddHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer );\n\n\treturn croppedTable;\n}\n\n/**\n * Returns slot info of cells that starts above and overlaps a given row.\n *\n * In a table below, passing `overlapRow = 3`\n *\n *\t\t ┌───┬───┬───┬───┬───┐\n *\t\t0 │ a │ b │ c │ d │ e │\n *\t\t │ ├───┼───┼───┼───┤\n *\t\t1 │ │ f │ g │ h │ i │\n *\t\t ├───┤ ├───┼───┤ │\n *\t\t2 │ j │ │ k │ l │ │\n *\t\t │ │ │ ├───┼───┤\n *\t\t3 │ │ │ │ m │ n │ <- overlap row to check\n *\t\t ├───┼───┤ │ ├───│\n *\t\t4 │ o │ p │ │ │ q │\n *\t\t └───┴───┴───┴───┴───┘\n *\n * will return slot info for cells: \"j\", \"f\", \"k\".\n *\n * @param {module:engine/model/element~Element} table The table to check.\n * @param {Number} overlapRow The index of the row to check.\n * @param {Number} [startRow=0] A row to start analysis. Use it when it is known that the cells above that row will not overlap.\n * @returns {Array.}\n */\nexport function getVerticallyOverlappingCells( table, overlapRow, startRow = 0 ) {\n\tconst cells = [];\n\n\tconst tableWalker = new TableWalker( table, { startRow, endRow: overlapRow - 1 } );\n\n\tfor ( const slotInfo of tableWalker ) {\n\t\tconst { row, cellHeight } = slotInfo;\n\t\tconst cellEndRow = row + cellHeight - 1;\n\n\t\tif ( row < overlapRow && overlapRow <= cellEndRow ) {\n\t\t\tcells.push( slotInfo );\n\t\t}\n\t}\n\n\treturn cells;\n}\n\n/**\n * Splits the table cell horizontally.\n *\n * @param {module:engine/model/element~Element} tableCell\n * @param {Number} splitRow\n * @param {module:engine/model/writer~Writer} writer\n * @returns {module:engine/model/element~Element} Created table cell.\n */\nexport function splitHorizontally( tableCell, splitRow, writer ) {\n\tconst tableRow = tableCell.parent;\n\tconst table = tableRow.parent;\n\tconst rowIndex = tableRow.index;\n\n\tconst rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) );\n\tconst newRowspan = splitRow - rowIndex;\n\n\tconst newCellAttributes = {};\n\tconst newCellRowSpan = rowspan - newRowspan;\n\n\tif ( newCellRowSpan > 1 ) {\n\t\tnewCellAttributes.rowspan = newCellRowSpan;\n\t}\n\n\tconst colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );\n\n\tif ( colspan > 1 ) {\n\t\tnewCellAttributes.colspan = colspan;\n\t}\n\n\tconst startRow = rowIndex;\n\tconst endRow = startRow + newRowspan;\n\tconst tableMap = [ ...new TableWalker( table, { startRow, endRow, includeAllSlots: true } ) ];\n\n\tlet newCell = null;\n\tlet columnIndex;\n\n\tfor ( const tableSlot of tableMap ) {\n\t\tconst { row, column, cell } = tableSlot;\n\n\t\tif ( cell === tableCell && columnIndex === undefined ) {\n\t\t\tcolumnIndex = column;\n\t\t}\n\n\t\tif ( columnIndex !== undefined && columnIndex === column && row === endRow ) {\n\t\t\tnewCell = createEmptyTableCell( writer, tableSlot.getPositionBefore(), newCellAttributes );\n\t\t}\n\t}\n\n\t// Update the rowspan attribute after updating table.\n\tupdateNumericAttribute( 'rowspan', newRowspan, tableCell, writer );\n\n\treturn newCell;\n}\n\n/**\n * Returns slot info of cells that starts before and overlaps a given column.\n *\n * In a table below, passing `overlapColumn = 3`\n *\n *\t\t 0 1 2 3 4\n *\t\t┌───────┬───────┬───┐\n *\t\t│ a │ b │ c │\n *\t\t│───┬───┴───────┼───┤\n *\t\t│ d │ e │ f │\n *\t\t├───┼───┬───────┴───┤\n *\t\t│ g │ h │ i │\n *\t\t├───┼───┼───┬───────┤\n *\t\t│ j │ k │ l │ m │\n *\t\t├───┼───┴───┼───┬───┤\n *\t\t│ n │ o │ p │ q │\n *\t\t└───┴───────┴───┴───┘\n *\t\t ^\n *\t\t Overlap column to check\n *\n * will return slot info for cells: \"b\", \"e\", \"i\".\n *\n * @param {module:engine/model/element~Element} table The table to check.\n * @param {Number} overlapColumn The index of the column to check.\n * @returns {Array.}\n */\nexport function getHorizontallyOverlappingCells( table, overlapColumn ) {\n\tconst cellsToSplit = [];\n\n\tconst tableWalker = new TableWalker( table );\n\n\tfor ( const slotInfo of tableWalker ) {\n\t\tconst { column, cellWidth } = slotInfo;\n\t\tconst cellEndColumn = column + cellWidth - 1;\n\n\t\tif ( column < overlapColumn && overlapColumn <= cellEndColumn ) {\n\t\t\tcellsToSplit.push( slotInfo );\n\t\t}\n\t}\n\n\treturn cellsToSplit;\n}\n\n/**\n * Splits the table cell vertically.\n *\n * @param {module:engine/model/element~Element} tableCell\n * @param {Number} columnIndex The table cell column index.\n * @param {Number} splitColumn The index of column to split cell on.\n * @param {module:engine/model/writer~Writer} writer\n * @returns {module:engine/model/element~Element} Created table cell.\n */\nexport function splitVertically( tableCell, columnIndex, splitColumn, writer ) {\n\tconst colspan = parseInt( tableCell.getAttribute( 'colspan' ) );\n\tconst newColspan = splitColumn - columnIndex;\n\n\tconst newCellAttributes = {};\n\tconst newCellColSpan = colspan - newColspan;\n\n\tif ( newCellColSpan > 1 ) {\n\t\tnewCellAttributes.colspan = newCellColSpan;\n\t}\n\n\tconst rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );\n\n\tif ( rowspan > 1 ) {\n\t\tnewCellAttributes.rowspan = rowspan;\n\t}\n\n\tconst newCell = createEmptyTableCell( writer, writer.createPositionAfter( tableCell ), newCellAttributes );\n\n\t// Update the colspan attribute after updating table.\n\tupdateNumericAttribute( 'colspan', newColspan, tableCell, writer );\n\n\treturn newCell;\n}\n\n/**\n * Adjusts table cell dimensions to not exceed limit row and column.\n *\n * If table cell width (or height) covers a column (or row) that is after a limit column (or row)\n * this method will trim \"colspan\" (or \"rowspan\") attribute so the table cell will fit in a defined limits.\n *\n * @param {module:engine/model/element~Element} tableCell\n * @param {Number} cellRow\n * @param {Number} cellColumn\n * @param {Number} limitRow\n * @param {Number} limitColumn\n * @param {module:engine/model/writer~Writer} writer\n */\nexport function trimTableCellIfNeeded( tableCell, cellRow, cellColumn, limitRow, limitColumn, writer ) {\n\tconst colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );\n\tconst rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );\n\n\tconst endColumn = cellColumn + colspan - 1;\n\n\tif ( endColumn > limitColumn ) {\n\t\tconst trimmedSpan = limitColumn - cellColumn + 1;\n\n\t\tupdateNumericAttribute( 'colspan', trimmedSpan, tableCell, writer, 1 );\n\t}\n\n\tconst endRow = cellRow + rowspan - 1;\n\n\tif ( endRow > limitRow ) {\n\t\tconst trimmedSpan = limitRow - cellRow + 1;\n\n\t\tupdateNumericAttribute( 'rowspan', trimmedSpan, tableCell, writer, 1 );\n\t}\n}\n\n// Sets proper heading attributes to a cropped table.\nfunction addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer ) {\n\tconst headingRows = parseInt( sourceTable.getAttribute( 'headingRows' ) || 0 );\n\n\tif ( headingRows > 0 ) {\n\t\tconst headingRowsInCrop = headingRows - startRow;\n\t\tupdateNumericAttribute( 'headingRows', headingRowsInCrop, croppedTable, writer, 0 );\n\t}\n\n\tconst headingColumns = parseInt( sourceTable.getAttribute( 'headingColumns' ) || 0 );\n\n\tif ( headingColumns > 0 ) {\n\t\tconst headingColumnsInCrop = headingColumns - startColumn;\n\t\tupdateNumericAttribute( 'headingColumns', headingColumnsInCrop, croppedTable, writer, 0 );\n\t}\n}\n\n/**\n * Removes columns that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+----+----+----+----+\n * | 00 | 01 | 03 | 04 | 06 |\n * +----+----+----+----+ +----+\n * | 10 | 11 | 13 | | 16 |\n * +----+----+----+----+----+----+----+\n * | 20 | 21 | 23 | 24 | 26 |\n * +----+----+----+----+----+----+----+\n * ^--- empty ---^\n *\n * Will remove columns 2 and 5.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a column from a table use {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`}.\n *\n * @protected\n * @param {module:engine/model/element~Element} table\n * @param {module:table/tableutils~TableUtils} tableUtils\n * @returns {Boolean} True if removed some columns.\n */\nexport function removeEmptyColumns( table, tableUtils ) {\n\tconst width = tableUtils.getColumns( table );\n\tconst columnsMap = new Array( width ).fill( 0 );\n\n\tfor ( const { column } of new TableWalker( table ) ) {\n\t\tcolumnsMap[ column ]++;\n\t}\n\n\tconst emptyColumns = columnsMap.reduce( ( result, cellsCount, column ) => {\n\t\treturn cellsCount ? result : [ ...result, column ];\n\t}, [] );\n\n\tif ( emptyColumns.length > 0 ) {\n\t\t// Remove only last empty column because it will recurrently trigger removing empty rows.\n\t\tconst emptyColumn = emptyColumns[ emptyColumns.length - 1 ];\n\n\t\t// @if CK_DEBUG_TABLE // console.log( `Removing empty column: ${ emptyColumn }.` );\n\t\ttableUtils.removeColumns( table, { at: emptyColumn } );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Removes rows that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+\n * | 00 | 01 | 02 |\n * +----+----+----+\n * | 10 | 11 | 12 |\n * + + + +\n * | | | | <-- empty\n * +----+----+----+\n * | 30 | 31 | 32 |\n * +----+----+----+\n * | 40 | 42 |\n * + + +\n * | | | <-- empty\n * +----+----+----+\n * | 60 | 61 | 62 |\n * +----+----+----+\n *\n * Will remove rows 2 and 5.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a row from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`}.\n *\n * @protected\n * @param {module:engine/model/element~Element} table\n * @param {module:table/tableutils~TableUtils} tableUtils\n * @returns {Boolean} True if removed some rows.\n */\nexport function removeEmptyRows( table, tableUtils ) {\n\tconst emptyRows = [];\n\n\tfor ( let rowIndex = 0; rowIndex < table.childCount; rowIndex++ ) {\n\t\tconst tableRow = table.getChild( rowIndex );\n\n\t\tif ( tableRow.isEmpty ) {\n\t\t\temptyRows.push( rowIndex );\n\t\t}\n\t}\n\n\tif ( emptyRows.length > 0 ) {\n\t\t// Remove only last empty row because it will recurrently trigger removing empty columns.\n\t\tconst emptyRow = emptyRows[ emptyRows.length - 1 ];\n\n\t\t// @if CK_DEBUG_TABLE // console.log( `Removing empty row: ${ emptyRow }.` );\n\t\ttableUtils.removeRows( table, { at: emptyRow } );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Removes rows and columns that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+----+\n * | 00 | 02 |\n * +----+----+ +\n * | 10 | |\n * +----+----+----+----+\n * | 20 | 22 | 23 |\n * + + + +\n * | | | | <-- empty row\n * +----+----+----+----+\n * ^--- empty column\n *\n * Will remove row 3 and column 1.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a rows from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`} and\n * {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`} to remove a column.\n *\n * @protected\n * @param {module:engine/model/element~Element} table\n * @param {module:table/tableutils~TableUtils} tableUtils\n */\nexport function removeEmptyRowsColumns( table, tableUtils ) {\n\tconst removedColumns = removeEmptyColumns( table, tableUtils );\n\n\t// If there was some columns removed then cleaning empty rows was already triggered.\n\tif ( !removedColumns ) {\n\t\tremoveEmptyRows( table, tableUtils );\n\t}\n}\n\n/**\n * Returns adjusted last row index if selection covers part of a row with empty slots (spanned by other cells).\n * The `dimensions.lastRow` is equal to last row index but selection might be bigger.\n *\n * This happens *only* on rectangular selection so we analyze a case like this:\n *\n * +---+---+---+---+\n * 0 | a | b | c | d |\n * + + +---+---+\n * 1 | | e | f | g |\n * + +---+ +---+\n * 2 | | h | | i | <- last row, each cell has rowspan = 2,\n * + + + + + so we need to return 3, not 2\n * 3 | | | | |\n * +---+---+---+---+\n *\n * @param {module:engine/model/element~Element} table\n * @param {Object} dimensions\n * @param {Number} dimensions.firstRow\n * @param {Number} dimensions.firstColumn\n * @param {Number} dimensions.lastRow\n * @param {Number} dimensions.lastColumn\n * @returns {Number} Adjusted last row index.\n */\nexport function adjustLastRowIndex( table, dimensions ) {\n\tconst lastRowMap = Array.from( new TableWalker( table, {\n\t\tstartColumn: dimensions.firstColumn,\n\t\tendColumn: dimensions.lastColumn,\n\t\trow: dimensions.lastRow\n\t} ) );\n\n\tconst everyCellHasSingleRowspan = lastRowMap.every( ( { cellHeight } ) => cellHeight === 1 );\n\n\t// It is a \"flat\" row, so the last row index is OK.\n\tif ( everyCellHasSingleRowspan ) {\n\t\treturn dimensions.lastRow;\n\t}\n\n\t// Otherwise get any cell's rowspan and adjust the last row index.\n\tconst rowspanAdjustment = lastRowMap[ 0 ].cellHeight - 1;\n\treturn dimensions.lastRow + rowspanAdjustment;\n}\n\n/**\n * Returns adjusted last column index if selection covers part of a column with empty slots (spanned by other cells).\n * The `dimensions.lastColumn` is equal to last column index but selection might be bigger.\n *\n * This happens *only* on rectangular selection so we analyze a case like this:\n *\n * 0 1 2 3\n * +---+---+---+---+\n * | a |\n * +---+---+---+---+\n * | b | c | d |\n * +---+---+---+---+\n * | e | f |\n * +---+---+---+---+\n * | g | h |\n * +---+---+---+---+\n * ^\n * last column, each cell has colspan = 2, so we need to return 3, not 2\n *\n * @param {module:engine/model/element~Element} table\n * @param {Object} dimensions\n * @param {Number} dimensions.firstRow\n * @param {Number} dimensions.firstColumn\n * @param {Number} dimensions.lastRow\n * @param {Number} dimensions.lastColumn\n * @returns {Number} Adjusted last column index.\n */\nexport function adjustLastColumnIndex( table, dimensions ) {\n\tconst lastColumnMap = Array.from( new TableWalker( table, {\n\t\tstartRow: dimensions.firstRow,\n\t\tendRow: dimensions.lastRow,\n\t\tcolumn: dimensions.lastColumn\n\t} ) );\n\n\tconst everyCellHasSingleColspan = lastColumnMap.every( ( { cellWidth } ) => cellWidth === 1 );\n\n\t// It is a \"flat\" column, so the last column index is OK.\n\tif ( everyCellHasSingleColspan ) {\n\t\treturn dimensions.lastColumn;\n\t}\n\n\t// Otherwise get any cell's colspan and adjust the last column index.\n\tconst colspanAdjustment = lastColumnMap[ 0 ].cellWidth - 1;\n\treturn dimensions.lastColumn + colspanAdjustment;\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module table/utils/common\n */\n\n/**\n * A common method to update the numeric value. If a value is the default one, it will be unset.\n *\n * @param {String} key An attribute key.\n * @param {*} value The new attribute value.\n * @param {module:engine/model/item~Item} item A model item on which the attribute will be set.\n * @param {module:engine/model/writer~Writer} writer\n * @param {*} defaultValue The default attribute value. If a value is lower or equal, it will be unset.\n */\nexport function updateNumericAttribute( key, value, item, writer, defaultValue = 1 ) {\n\tif ( value > defaultValue ) {\n\t\twriter.setAttribute( key, value, item );\n\t} else {\n\t\twriter.removeAttribute( key, item );\n\t}\n}\n\n/**\n * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.\n *\n * @param {module:engine/model/writer~Writer} writer The model writer.\n * @param {module:engine/model/position~Position} insertPosition The position at which the table cell should be inserted.\n * @param {Object} attributes The element attributes.\n * @returns {module:engine/model/element~Element} Created table cell.\n */\nexport function createEmptyTableCell( writer, insertPosition, attributes = {} ) {\n\tconst tableCell = writer.createElement( 'tableCell', attributes );\n\n\twriter.insertElement( 'paragraph', tableCell );\n\twriter.insert( tableCell, insertPosition );\n\n\treturn tableCell;\n}\n\n/**\n * Checks if a table cell belongs to the heading column section.\n *\n * @param {module:table/tableutils~TableUtils} tableUtils\n * @param {module:engine/model/element~Element} tableCell\n * @returns {Boolean}\n */\nexport function isHeadingColumnCell( tableUtils, tableCell ) {\n\tconst table = tableCell.parent.parent;\n\tconst headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );\n\tconst { column } = tableUtils.getCellLocation( tableCell );\n\n\treturn !!headingColumns && column < headingColumns;\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module table/ui/inserttableview\n */\n\nimport { View } from 'ckeditor5/src/ui';\n\nimport './../../theme/inserttable.css';\n\n/**\n * The table size view.\n *\n * It renders a 10x10 grid to choose the inserted table size.\n *\n * @extends module:ui/view~View\n * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable\n */\nexport default class InsertTableView extends View {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( locale ) {\n\t\tsuper( locale );\n\n\t\tconst bind = this.bindTemplate;\n\n\t\t/**\n\t\t * A collection of table size box items.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:ui/viewcollection~ViewCollection}\n\t\t */\n\t\tthis.items = this._createGridCollection();\n\n\t\t/**\n\t\t * The currently selected number of rows of the new table.\n\t\t *\n\t\t * @observable\n\t\t * @member {Number} #rows\n\t\t */\n\t\tthis.set( 'rows', 0 );\n\n\t\t/**\n\t\t * The currently selected number of columns of the new table.\n\t\t *\n\t\t * @observable\n\t\t * @member {Number} #columns\n\t\t */\n\t\tthis.set( 'columns', 0 );\n\n\t\t/**\n\t\t * The label text displayed under the boxes.\n\t\t *\n\t\t * @observable\n\t\t * @member {String} #label\n\t\t */\n\t\tthis.bind( 'label' )\n\t\t\t.to( this, 'columns', this, 'rows', ( columns, rows ) => `${ rows } × ${ columns }` );\n\n\t\tthis.setTemplate( {\n\t\t\ttag: 'div',\n\t\t\tattributes: {\n\t\t\t\tclass: [ 'ck' ]\n\t\t\t},\n\n\t\t\tchildren: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'div',\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tclass: [ 'ck-insert-table-dropdown__grid' ]\n\t\t\t\t\t},\n\t\t\t\t\ton: {\n\t\t\t\t\t\t'mouseover@.ck-insert-table-dropdown-grid-box': bind.to( 'boxover' )\n\t\t\t\t\t},\n\t\t\t\t\tchildren: this.items\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttag: 'div',\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tclass: [ 'ck-insert-table-dropdown__label' ]\n\t\t\t\t\t},\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: bind.to( 'label' )\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t],\n\n\t\t\ton: {\n\t\t\t\tmousedown: bind.to( evt => {\n\t\t\t\t\tevt.preventDefault();\n\t\t\t\t} ),\n\n\t\t\t\tclick: bind.to( () => {\n\t\t\t\t\tthis.fire( 'execute' );\n\t\t\t\t} )\n\t\t\t}\n\t\t} );\n\n\t\tthis.on( 'boxover', ( evt, domEvt ) => {\n\t\t\tconst { row, column } = domEvt.target.dataset;\n\n\t\t\t// As row & column indexes are zero-based transform it to number of selected rows & columns.\n\t\t\tthis.set( {\n\t\t\t\trows: parseInt( row ),\n\t\t\t\tcolumns: parseInt( column )\n\t\t\t} );\n\t\t} );\n\n\t\tthis.on( 'change:columns', () => {\n\t\t\tthis._highlightGridBoxes();\n\t\t} );\n\n\t\tthis.on( 'change:rows', () => {\n\t\t\tthis._highlightGridBoxes();\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tfocus() {\n\t\t// The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.\n\t\t// The method should be implemented while working on keyboard support for this view. See #22.\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tfocusLast() {\n\t\t// The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.\n\t\t// The method should be implemented while working on keyboard support for this view. See #22.\n\t}\n\n\t/**\n\t * Highlights grid boxes depending on rows and columns selected.\n\t *\n\t * @private\n\t */\n\t_highlightGridBoxes() {\n\t\tconst rows = this.rows;\n\t\tconst columns = this.columns;\n\n\t\tthis.items.map( ( boxView, index ) => {\n\t\t\t// Translate box index to the row & column index.\n\t\t\tconst itemRow = Math.floor( index / 10 );\n\t\t\tconst itemColumn = index % 10;\n\n\t\t\t// Grid box is highlighted when its row & column index belongs to selected number of rows & columns.\n\t\t\tconst isOn = itemRow < rows && itemColumn < columns;\n\n\t\t\tboxView.set( 'isOn', isOn );\n\t\t} );\n\t}\n\n\t/**\n\t * @private\n\t * @returns {module:ui/viewcollection~ViewCollection} A view collection containing boxes to be placed in a table grid.\n\t */\n\t_createGridCollection() {\n\t\tconst boxes = [];\n\n\t\t// Add grid boxes to table selection view.\n\t\tfor ( let index = 0; index < 100; index++ ) {\n\t\t\tconst row = Math.floor( index / 10 );\n\t\t\tconst column = index % 10;\n\n\t\t\tboxes.push( new TableSizeGridBoxView( this.locale, row + 1, column + 1 ) );\n\t\t}\n\n\t\treturn this.createCollection( boxes );\n\t}\n\n\t/**\n\t * Fired when the mouse hover over one of the {@link #items child grid boxes}.\n\t *\n\t * @event boxover\n\t */\n}\n\n/**\n * A single grid box view element.\n *\n * This class is used to render the table size selection grid in {@link module:table/ui/inserttableview~InsertTableView}.\n *\n * @private\n */\nclass TableSizeGridBoxView extends View {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( locale, row, column ) {\n\t\tsuper( locale );\n\n\t\tconst bind = this.bindTemplate;\n\n\t\t/**\n\t\t * Controls whether the grid box view is \"on\".\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #isOn\n\t\t */\n\t\tthis.set( 'isOn', false );\n\n\t\tthis.setTemplate( {\n\t\t\ttag: 'div',\n\t\t\tattributes: {\n\t\t\t\tclass: [\n\t\t\t\t\t'ck-insert-table-dropdown-grid-box',\n\t\t\t\t\tbind.if( 'isOn', 'ck-on' )\n\t\t\t\t],\n\t\t\t\t'data-row': row,\n\t\t\t\t'data-column': column\n\t\t\t}\n\t\t} );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module table/ui/colorinputview\n */\n\nimport { View, InputTextView, ButtonView, createDropdown, ColorGridView } from 'ckeditor5/src/ui';\nimport { icons } from 'ckeditor5/src/core';\n\nimport '../../theme/colorinput.css';\n\n/**\n * The color input view class. It allows the user to type in a color (hex, rgb, etc.)\n * or choose it from the configurable color palette with a preview.\n *\n * @private\n * @extends module:ui/view~View\n */\nexport default class ColorInputView extends View {\n\t/**\n\t * Creates an instance of the color input view.\n\t *\n\t * @param {module:utils/locale~Locale} locale The locale instance.\n\t * @param {Object} options The input options.\n\t * @param {module:ui/colorgrid/colorgrid~ColorDefinition} options.colorDefinitions The colors to be displayed\n\t * in the palette inside the input's dropdown.\n\t * @param {Number} options.columns The number of columns in which the colors will be displayed.\n\t */\n\tconstructor( locale, options ) {\n\t\tsuper( locale );\n\n\t\tconst bind = this.bindTemplate;\n\n\t\t/**\n\t\t * The value of the input.\n\t\t *\n\t\t * @observable\n\t\t * @member {String} #value\n\t\t * @default ''\n\t\t */\n\t\tthis.set( 'value', '' );\n\n\t\t/**\n\t\t * The `id` attribute of the input (i.e. to pair with the `