{"version":3,"file":"katoid-angular-grid-layout.mjs","sources":["../../../projects/angular-grid-layout/src/lib/utils/react-grid-layout.utils.ts","../../../projects/angular-grid-layout/src/lib/utils/passive-listeners.ts","../../../projects/angular-grid-layout/src/lib/utils/pointer.utils.ts","../../../projects/angular-grid-layout/src/lib/utils/react-grid-layout-multiple.utils.ts","../../../projects/angular-grid-layout/src/lib/utils/grid.utils.ts","../../../projects/angular-grid-layout/src/lib/directives/drag-handle.ts","../../../projects/angular-grid-layout/src/lib/directives/resize-handle.ts","../../../projects/angular-grid-layout/src/lib/directives/placeholder.ts","../../../projects/angular-grid-layout/src/lib/coercion/boolean-property.ts","../../../projects/angular-grid-layout/src/lib/coercion/number-property.ts","../../../projects/angular-grid-layout/src/lib/grid.definitions.ts","../../../projects/angular-grid-layout/src/lib/utils/operators.ts","../../../projects/angular-grid-layout/src/lib/grid.service.ts","../../../projects/angular-grid-layout/src/lib/grid-item/grid-item.component.ts","../../../projects/angular-grid-layout/src/lib/grid-item/grid-item.component.html","../../../projects/angular-grid-layout/src/lib/utils/client-rect.ts","../../../projects/angular-grid-layout/src/lib/utils/scroll.ts","../../../projects/angular-grid-layout/src/lib/utils/transition-duration.ts","../../../projects/angular-grid-layout/src/lib/grid.component.ts","../../../projects/angular-grid-layout/src/lib/grid.component.html","../../../projects/angular-grid-layout/src/lib/grid.module.ts","../../../projects/angular-grid-layout/src/public-api.ts","../../../projects/angular-grid-layout/src/katoid-angular-grid-layout.ts"],"sourcesContent":["/**\r\n * IMPORTANT:\r\n * This utils are taken from the project: https://github.com/STRML/react-grid-layout.\r\n * The code should be as less modified as possible for easy maintenance.\r\n */\r\n\r\n// Disable lint since we don't want to modify this code\r\n/* eslint-disable */\r\nexport type LayoutItem = {\r\n    w: number;\r\n    h: number;\r\n    x: number;\r\n    y: number;\r\n    id: string;\r\n    minW?: number;\r\n    minH?: number;\r\n    maxW?: number;\r\n    maxH?: number;\r\n    moved?: boolean;\r\n    static?: boolean;\r\n    isDraggable?: boolean | null | undefined;\r\n    isResizable?: boolean | null | undefined;\r\n};\r\nexport type Layout = Array<LayoutItem>;\r\nexport type Position = {\r\n    left: number;\r\n    top: number;\r\n    width: number;\r\n    height: number;\r\n};\r\nexport type ReactDraggableCallbackData = {\r\n    node: HTMLElement;\r\n    x?: number;\r\n    y?: number;\r\n    deltaX: number;\r\n    deltaY: number;\r\n    lastX?: number;\r\n    lastY?: number;\r\n};\r\n\r\nexport type PartialPosition = { left: number; top: number };\r\nexport type DroppingPosition = { x: number; y: number; e: Event };\r\nexport type Size = { width: number; height: number };\r\nexport type GridDragEvent = {\r\n    e: Event;\r\n    node: HTMLElement;\r\n    newPosition: PartialPosition;\r\n};\r\nexport type GridResizeEvent = { e: Event; node: HTMLElement; size: Size };\r\nexport type DragOverEvent = MouseEvent & {\r\n    nativeEvent: {\r\n        layerX: number;\r\n        layerY: number;\r\n        target: {\r\n            className: String;\r\n        };\r\n    };\r\n};\r\n\r\n//type REl = ReactElement<any>;\r\n//export type ReactChildren = ReactChildrenArray<REl>;\r\n\r\n// All callbacks are of the signature (layout, oldItem, newItem, placeholder, e).\r\nexport type EventCallback = (\r\n    arg0: Layout,\r\n    oldItem: LayoutItem | null | undefined,\r\n    newItem: LayoutItem | null | undefined,\r\n    placeholder: LayoutItem | null | undefined,\r\n    arg4: Event,\r\n    arg5: HTMLElement | null | undefined,\r\n) => void;\r\nexport type CompactType = ('horizontal' | 'vertical') | null | undefined;\r\n\r\nconst DEBUG = false;\r\n\r\n/**\r\n * Return the bottom coordinate of the layout.\r\n *\r\n * @param  {Array} layout Layout array.\r\n * @return {Number}       Bottom coordinate.\r\n */\r\nexport function bottom(layout: Layout): number {\r\n    let max = 0,\r\n        bottomY;\r\n    for (let i = 0, len = layout.length; i < len; i++) {\r\n        bottomY = layout[i].y + layout[i].h;\r\n        if (bottomY > max) {\r\n            max = bottomY;\r\n        }\r\n    }\r\n    return max;\r\n}\r\n\r\nexport function cloneLayout(layout: Layout): Layout {\r\n    const newLayout = Array(layout.length);\r\n    for (let i = 0, len = layout.length; i < len; i++) {\r\n        newLayout[i] = cloneLayoutItem(layout[i]);\r\n    }\r\n    return newLayout;\r\n}\r\n\r\n// Fast path to cloning, since this is monomorphic\r\n/** NOTE: This code has been modified from the original source */\r\nexport function cloneLayoutItem(layoutItem: LayoutItem): LayoutItem {\r\n    const clonedLayoutItem: LayoutItem = {\r\n        w: layoutItem.w,\r\n        h: layoutItem.h,\r\n        x: layoutItem.x,\r\n        y: layoutItem.y,\r\n        id: layoutItem.id,\r\n        moved: !!layoutItem.moved,\r\n        static: !!layoutItem.static,\r\n    };\r\n\r\n    if (layoutItem.minW !== undefined) { clonedLayoutItem.minW = layoutItem.minW;}\r\n    if (layoutItem.maxW !== undefined) { clonedLayoutItem.maxW = layoutItem.maxW;}\r\n    if (layoutItem.minH !== undefined) { clonedLayoutItem.minH = layoutItem.minH;}\r\n    if (layoutItem.maxH !== undefined) { clonedLayoutItem.maxH = layoutItem.maxH;}\r\n    // These can be null\r\n    if (layoutItem.isDraggable !== undefined) { clonedLayoutItem.isDraggable = layoutItem.isDraggable;}\r\n    if (layoutItem.isResizable !== undefined) { clonedLayoutItem.isResizable = layoutItem.isResizable;}\r\n\r\n    return clonedLayoutItem;\r\n}\r\n\r\n/**\r\n * Given two layoutitems, check if they collide.\r\n */\r\nexport function collides(l1: LayoutItem, l2: LayoutItem): boolean {\r\n    if (l1.id === l2.id) {\r\n        return false;\r\n    } // same element\r\n    if (l1.x + l1.w <= l2.x) {\r\n        return false;\r\n    } // l1 is left of l2\r\n    if (l1.x >= l2.x + l2.w) {\r\n        return false;\r\n    } // l1 is right of l2\r\n    if (l1.y + l1.h <= l2.y) {\r\n        return false;\r\n    } // l1 is above l2\r\n    if (l1.y >= l2.y + l2.h) {\r\n        return false;\r\n    } // l1 is below l2\r\n    return true; // boxes overlap\r\n}\r\n\r\n/**\r\n * Given a layout, compact it. This involves going down each y coordinate and removing gaps\r\n * between items.\r\n *\r\n * @param  {Array} layout Layout.\r\n * @param  {Boolean} verticalCompact Whether or not to compact the layout\r\n *   vertically.\r\n * @return {Array}       Compacted Layout.\r\n */\r\nexport function compact(\r\n    layout: Layout,\r\n    compactType: CompactType,\r\n    cols: number\r\n): Layout {\r\n    // Statics go in the compareWith array right away so items flow around them\r\n    const compareWith = getStatics(layout);\r\n    const multipleStaticItems = compareWith.length>1;\r\n    // We sort the elements to avoid collisions being skipped due to flow around static items\r\n    if(multipleStaticItems){\r\n        compareWith.sort((a, b) => (a.y + a.h) - (b.y + b.h));\r\n    }\r\n    // We go through the items by row and column.\r\n    const sorted = sortLayoutItems(layout, compactType);\r\n    // Holding for new items.\r\n    const out = Array(layout.length);\r\n    for (let i = 0, len = sorted.length; i < len; i++) {\r\n        let l = cloneLayoutItem(sorted[i]);\r\n\r\n        // Don't move static elements\r\n        if (!l.static) {\r\n            l = compactItem(compareWith, l, compactType, cols, sorted, multipleStaticItems);\r\n\r\n            // Add to comparison array. We only collide with items before this one.\r\n            // Statics are already in this array.\r\n            compareWith.push(l);\r\n        }\r\n\r\n        // Add to output array to make sure they still come out in the right order.\r\n        out[layout.indexOf(sorted[i])] = l;\r\n\r\n        // Clear moved flag, if it exists.\r\n        l.moved = false;\r\n    }\r\n\r\n    return out;\r\n}\r\n\r\nconst heightWidth = {x: 'w', y: 'h'};\r\n\r\n/**\r\n * Before moving item down, it will check if the movement will cause collisions and move those items down before.\r\n */\r\nfunction resolveCompactionCollision(\r\n    layout: Layout,\r\n    item: LayoutItem,\r\n    moveToCoord: number,\r\n    axis: 'x' | 'y',\r\n    maxMoveToCoord?: number\r\n): number | undefined {\r\n    const sizeProp = heightWidth[axis];\r\n    item[axis] += 1;\r\n    const itemIndex = layout\r\n        .map(layoutItem => {\r\n            return layoutItem.id;\r\n        })\r\n        .indexOf(item.id);\r\n\r\n    // Go through each item we collide with.\r\n    for (let i = itemIndex + 1; i < layout.length; i++) {\r\n        const otherItem = layout[i];\r\n        // Ignore static items\r\n        if (otherItem.static) {\r\n            continue;\r\n        }\r\n\r\n        // Optimization: we can break early if we know we're past this el\r\n        // We can do this b/c it's a sorted layout\r\n        // Since previous elements may have moved without reordering the layout, this movement must be taken into account\r\n        // (maxMoveToCoord for multiple static items, moveToCoord for 0 or 1 static item).\r\n        if (otherItem[axis] > (maxMoveToCoord ?? moveToCoord)+item[sizeProp]) {\r\n           break;\r\n        }\r\n        if (collides(item, otherItem)) {\r\n            // Update maxMoveToCoord when moving multiple items moving, to avoid overly aggressive pruning in the \"break\" line\r\n            maxMoveToCoord = resolveCompactionCollision(\r\n                layout,\r\n                otherItem,\r\n                moveToCoord + item[sizeProp],\r\n                axis,\r\n                maxMoveToCoord ? maxMoveToCoord + item[sizeProp] : undefined\r\n            );\r\n        }\r\n    }\r\n\r\n    item[axis] = moveToCoord;\r\n    return maxMoveToCoord;\r\n}\r\n\r\n/**\r\n * Compact an item in the layout.\r\n */\r\nexport function compactItem(\r\n    compareWith: Layout,\r\n    l: LayoutItem,\r\n    compactType: CompactType,\r\n    cols: number,\r\n    fullLayout: Layout,\r\n    multipleStaticItems?: boolean\r\n): LayoutItem {\r\n    const compactV = compactType === 'vertical';\r\n    const compactH = compactType === 'horizontal';\r\n    if (compactV) {\r\n        // Bottom 'y' possible is the bottom of the layout.\r\n        // This allows you to do nice stuff like specify {y: Infinity}\r\n        // This is here because the layout must be sorted in order to get the correct bottom `y`.\r\n        l.y = Math.min(bottom(compareWith), l.y);\r\n        // Move the element up as far as it can go without colliding.\r\n        while (l.y > 0 && !getFirstCollision(compareWith, l)) {\r\n            l.y--;\r\n        }\r\n    } else if (compactH) {\r\n        // Move the element left as far as it can go without colliding.\r\n        while (l.x > 0 && !getFirstCollision(compareWith, l)) {\r\n            l.x--;\r\n        }\r\n    }\r\n\r\n    // Move it down, and keep moving it down if it's colliding.\r\n    let collides;\r\n    // In the case of having multiple static items, when performing the break comparison we must take into account\r\n    // that the first item may have been moved his position + maxMoveToCoord\r\n    let maxMoveToCoord: number | undefined = undefined;\r\n    if(multipleStaticItems){\r\n        compareWith.forEach(item=>{\r\n            if(!maxMoveToCoord || item.y+item.h>maxMoveToCoord){\r\n                maxMoveToCoord = item.y+item.h;\r\n            }\r\n        })\r\n    }\r\n    while ((collides = getFirstCollision(compareWith, l))) {\r\n        if (compactH) {\r\n            resolveCompactionCollision(fullLayout, l, collides.x + collides.w, 'x', maxMoveToCoord);\r\n        } else {\r\n            resolveCompactionCollision(fullLayout, l, collides.y + collides.h, 'y', maxMoveToCoord);\r\n        }\r\n        // Since we can't grow without bounds horizontally, if we've overflown, let's move it down and try again.\r\n        if (compactH && l.x + l.w > cols) {\r\n            l.x = cols - l.w;\r\n            l.y++;\r\n\r\n            // ALso move element as left as much as we can (ktd-custom-change)\r\n            while (l.x > 0 && !getFirstCollision(compareWith, l)) {\r\n                l.x--;\r\n            }\r\n        }\r\n    }\r\n    // Ensure that there are no negative positions\r\n    l.y = Math.max(l.y, 0);\r\n    l.x = Math.max(l.x, 0);\r\n\r\n    return l;\r\n}\r\n\r\n/**\r\n * Given a layout, make sure all elements fit within its bounds.\r\n *\r\n * @param  {Array} layout Layout array.\r\n * @param  {Number} bounds Number of columns.\r\n */\r\nexport function correctBounds(layout: Layout, bounds: { cols: number }): Layout {\r\n    const collidesWith = getStatics(layout);\r\n    for (let i = 0, len = layout.length; i < len; i++) {\r\n        const l = layout[i];\r\n        // Overflows right\r\n        if (l.x + l.w > bounds.cols) {\r\n            l.x = bounds.cols - l.w;\r\n        }\r\n        // Overflows left\r\n        if (l.x < 0) {\r\n            l.x = 0;\r\n            l.w = bounds.cols;\r\n        }\r\n        if (!l.static) {\r\n            collidesWith.push(l);\r\n        } else {\r\n            // If this is static and collides with other statics, we must move it down.\r\n            // We have to do something nicer than just letting them overlap.\r\n            while (getFirstCollision(collidesWith, l)) {\r\n                l.y++;\r\n            }\r\n        }\r\n    }\r\n    return layout;\r\n}\r\n\r\n/**\r\n * Get a layout item by ID. Used so we can override later on if necessary.\r\n *\r\n * @param  {Array}  layout Layout array.\r\n * @param  {String} id     ID\r\n * @return {LayoutItem}    Item at ID.\r\n */\r\nexport function getLayoutItem(\r\n    layout: Layout,\r\n    id: string,\r\n): LayoutItem | null | undefined {\r\n    for (let i = 0, len = layout.length; i < len; i++) {\r\n        if (layout[i].id === id) {\r\n            return layout[i];\r\n        }\r\n    }\r\n    return null;\r\n}\r\n\r\n/**\r\n * Returns the first item this layout collides with.\r\n * It doesn't appear to matter which order we approach this from, although\r\n * perhaps that is the wrong thing to do.\r\n *\r\n * @param  {Object} layoutItem Layout item.\r\n * @return {Object|undefined}  A colliding layout item, or undefined.\r\n */\r\nexport function getFirstCollision(\r\n    layout: Layout,\r\n    layoutItem: LayoutItem,\r\n): LayoutItem | null | undefined {\r\n    for (let i = 0, len = layout.length; i < len; i++) {\r\n        if (collides(layout[i], layoutItem)) {\r\n            return layout[i];\r\n        }\r\n    }\r\n    return null;\r\n}\r\n\r\nexport function getAllCollisions(\r\n    layout: Layout,\r\n    layoutItem: LayoutItem,\r\n): Array<LayoutItem> {\r\n    return layout.filter(l => collides(l, layoutItem));\r\n}\r\n\r\n/**\r\n * Get all static elements.\r\n * @param  {Array} layout Array of layout objects.\r\n * @return {Array}        Array of static layout items..\r\n */\r\nexport function getStatics(layout: Layout): Array<LayoutItem> {\r\n    return layout.filter(l => l.static);\r\n}\r\n\r\n/**\r\n * Move an element. Responsible for doing cascading movements of other elements.\r\n *\r\n * @param  {Array}      layout            Full layout to modify.\r\n * @param  {LayoutItem} l                 element to move.\r\n * @param  {Number}     [x]               X position in grid units.\r\n * @param  {Number}     [y]               Y position in grid units.\r\n */\r\nexport function moveElement(\r\n    layout: Layout,\r\n    l: LayoutItem,\r\n    x: number | null | undefined,\r\n    y: number | null | undefined,\r\n    isUserAction: boolean | null | undefined,\r\n    preventCollision: boolean | null | undefined,\r\n    compactType: CompactType,\r\n    cols: number,\r\n): Layout {\r\n    // If this is static and not explicitly enabled as draggable,\r\n    // no move is possible, so we can short-circuit this immediately.\r\n    if (l.static && l.isDraggable !== true) {\r\n        return layout;\r\n    }\r\n\r\n    // Short-circuit if nothing to do.\r\n    if (l.y === y && l.x === x) {\r\n        return layout;\r\n    }\r\n\r\n    log(\r\n        `Moving element ${l.id} to [${String(x)},${String(y)}] from [${l.x},${\r\n            l.y\r\n        }]`,\r\n    );\r\n    const oldX = l.x;\r\n    const oldY = l.y;\r\n\r\n    // This is quite a bit faster than extending the object\r\n    if (typeof x === 'number') {\r\n        l.x = x;\r\n    }\r\n    if (typeof y === 'number') {\r\n        l.y = y;\r\n    }\r\n    l.moved = true;\r\n\r\n    // If this collides with anything, move it.\r\n    // When doing this comparison, we have to sort the items we compare with\r\n    // to ensure, in the case of multiple collisions, that we're getting the\r\n    // nearest collision.\r\n    let sorted = sortLayoutItems(layout, compactType);\r\n    const movingUp =\r\n        compactType === 'vertical' && typeof y === 'number'\r\n            ? oldY >= y\r\n            : compactType === 'horizontal' && typeof x === 'number'\r\n                ? oldX >= x\r\n                : false;\r\n    if (movingUp) {\r\n        sorted = sorted.reverse();\r\n    }\r\n    const collisions = getAllCollisions(sorted, l);\r\n\r\n    // There was a collision; abort\r\n    if (preventCollision && collisions.length) {\r\n        log(`Collision prevented on ${l.id}, reverting.`);\r\n        l.x = oldX;\r\n        l.y = oldY;\r\n        l.moved = false;\r\n        return layout;\r\n    }\r\n\r\n    // Move each item that collides away from this element.\r\n    for (let i = 0, len = collisions.length; i < len; i++) {\r\n        const collision = collisions[i];\r\n        log(\r\n            `Resolving collision between ${l.id} at [${l.x},${l.y}] and ${\r\n                collision.id\r\n            } at [${collision.x},${collision.y}]`,\r\n        );\r\n\r\n        // Short circuit so we can't infinite loop\r\n        if (collision.moved) {\r\n            continue;\r\n        }\r\n\r\n        // Don't move static items - we have to move *this* element away\r\n        if (collision.static) {\r\n            layout = moveElementAwayFromCollision(\r\n                layout,\r\n                collision,\r\n                l,\r\n                isUserAction,\r\n                compactType,\r\n                cols,\r\n            );\r\n        } else {\r\n            layout = moveElementAwayFromCollision(\r\n                layout,\r\n                l,\r\n                collision,\r\n                isUserAction,\r\n                compactType,\r\n                cols,\r\n            );\r\n        }\r\n    }\r\n\r\n    return layout;\r\n}\r\n\r\n/**\r\n * This is where the magic needs to happen - given a collision, move an element away from the collision.\r\n * We attempt to move it up if there's room, otherwise it goes below.\r\n *\r\n * @param  {Array} layout            Full layout to modify.\r\n * @param  {LayoutItem} collidesWith Layout item we're colliding with.\r\n * @param  {LayoutItem} itemToMove   Layout item we're moving.\r\n */\r\nexport function moveElementAwayFromCollision(\r\n    layout: Layout,\r\n    collidesWith: LayoutItem,\r\n    itemToMove: LayoutItem,\r\n    isUserAction: boolean | null | undefined,\r\n    compactType: CompactType,\r\n    cols: number,\r\n): Layout {\r\n    const compactH = compactType === 'horizontal';\r\n    // Compact vertically if not set to horizontal\r\n    const compactV = compactType !== 'horizontal';\r\n    const preventCollision = collidesWith.static; // we're already colliding (not for static items)\r\n\r\n    // If there is enough space above the collision to put this element, move it there.\r\n    // We only do this on the main collision as this can get funky in cascades and cause\r\n    // unwanted swapping behavior.\r\n    if (isUserAction) {\r\n        // Reset isUserAction flag because we're not in the main collision anymore.\r\n        isUserAction = false;\r\n\r\n        // Make a mock item so we don't modify the item here, only modify in moveElement.\r\n        const fakeItem: LayoutItem = {\r\n            x: compactH\r\n                ? Math.max(collidesWith.x - itemToMove.w, 0)\r\n                : itemToMove.x,\r\n            y: compactV\r\n                ? Math.max(collidesWith.y - itemToMove.h, 0)\r\n                : itemToMove.y,\r\n            w: itemToMove.w,\r\n            h: itemToMove.h,\r\n            id: '-1',\r\n        };\r\n\r\n        // No collision? If so, we can go up there; otherwise, we'll end up moving down as normal\r\n        if (!getFirstCollision(layout, fakeItem)) {\r\n            log(\r\n                `Doing reverse collision on ${itemToMove.id} up to [${\r\n                    fakeItem.x\r\n                },${fakeItem.y}].`,\r\n            );\r\n            return moveElement(\r\n                layout,\r\n                itemToMove,\r\n                compactH ? fakeItem.x : undefined,\r\n                compactV ? fakeItem.y : undefined,\r\n                isUserAction,\r\n                preventCollision,\r\n                compactType,\r\n                cols,\r\n            );\r\n        }\r\n    }\r\n\r\n    return moveElement(\r\n        layout,\r\n        itemToMove,\r\n        compactH ? itemToMove.x + 1 : undefined,\r\n        compactV ? itemToMove.y + 1 : undefined,\r\n        isUserAction,\r\n        preventCollision,\r\n        compactType,\r\n        cols,\r\n    );\r\n}\r\n\r\n/**\r\n * Helper to convert a number to a percentage string.\r\n *\r\n * @param  {Number} num Any number\r\n * @return {String}     That number as a percentage.\r\n */\r\nexport function perc(num: number): string {\r\n    return num * 100 + '%';\r\n}\r\n\r\nexport function setTransform({top, left, width, height}: Position): Object {\r\n    // Replace unitless items with px\r\n    const translate = `translate(${left}px,${top}px)`;\r\n    return {\r\n        transform: translate,\r\n        WebkitTransform: translate,\r\n        MozTransform: translate,\r\n        msTransform: translate,\r\n        OTransform: translate,\r\n        width: `${width}px`,\r\n        height: `${height}px`,\r\n        position: 'absolute',\r\n    };\r\n}\r\n\r\nexport function setTopLeft({top, left, width, height}: Position): Object {\r\n    return {\r\n        top: `${top}px`,\r\n        left: `${left}px`,\r\n        width: `${width}px`,\r\n        height: `${height}px`,\r\n        position: 'absolute',\r\n    };\r\n}\r\n\r\n/**\r\n * Get layout items sorted from top left to right and down.\r\n *\r\n * @return {Array} Array of layout objects.\r\n * @return {Array}        Layout, sorted static items first.\r\n */\r\nexport function sortLayoutItems(\r\n    layout: Layout,\r\n    compactType: CompactType,\r\n): Layout {\r\n    if (compactType === 'horizontal') {\r\n        return sortLayoutItemsByColRow(layout);\r\n    } else {\r\n        return sortLayoutItemsByRowCol(layout);\r\n    }\r\n}\r\n\r\nexport function sortLayoutItemsByRowCol(layout: Layout): Layout {\r\n    return ([] as any[]).concat(layout).sort(function(a, b) {\r\n        if (a.y > b.y || (a.y === b.y && a.x > b.x)) {\r\n            return 1;\r\n        } else if (a.y === b.y && a.x === b.x) {\r\n            // Without this, we can get different sort results in IE vs. Chrome/FF\r\n            return 0;\r\n        }\r\n        return -1;\r\n    });\r\n}\r\n\r\nexport function sortLayoutItemsByColRow(layout: Layout): Layout {\r\n    return ([] as any[]).concat(layout).sort(function(a, b) {\r\n        if (a.x > b.x || (a.x === b.x && a.y > b.y)) {\r\n            return 1;\r\n        }\r\n        return -1;\r\n    });\r\n}\r\n\r\n/**\r\n * Validate a layout. Throws errors.\r\n *\r\n * @param  {Array}  layout        Array of layout items.\r\n * @param  {String} [contextName] Context name for errors.\r\n * @throw  {Error}                Validation error.\r\n */\r\nexport function validateLayout(\r\n    layout: Layout,\r\n    contextName: string = 'Layout',\r\n): void {\r\n    const subProps = ['x', 'y', 'w', 'h'];\r\n    if (!Array.isArray(layout)) {\r\n        throw new Error(contextName + ' must be an array!');\r\n    }\r\n    for (let i = 0, len = layout.length; i < len; i++) {\r\n        const item = layout[i];\r\n        for (let j = 0; j < subProps.length; j++) {\r\n            if (typeof item[subProps[j]] !== 'number') {\r\n                throw new Error(\r\n                    'ReactGridLayout: ' +\r\n                    contextName +\r\n                    '[' +\r\n                    i +\r\n                    '].' +\r\n                    subProps[j] +\r\n                    ' must be a number!',\r\n                );\r\n            }\r\n        }\r\n        if (item.id && typeof item.id !== 'string') {\r\n            throw new Error(\r\n                'ReactGridLayout: ' +\r\n                contextName +\r\n                '[' +\r\n                i +\r\n                '].i must be a string!',\r\n            );\r\n        }\r\n        if (item.static !== undefined && typeof item.static !== 'boolean') {\r\n            throw new Error(\r\n                'ReactGridLayout: ' +\r\n                contextName +\r\n                '[' +\r\n                i +\r\n                '].static must be a boolean!',\r\n            );\r\n        }\r\n    }\r\n}\r\n\r\n// Flow can't really figure this out, so we just use Object\r\nexport function autoBindHandlers(el: Object, fns: Array<string>): void {\r\n    fns.forEach(key => (el[key] = el[key].bind(el)));\r\n}\r\n\r\nfunction log(...args) {\r\n    if (!DEBUG) {\r\n        return;\r\n    }\r\n    // eslint-disable-next-line no-console\r\n    console.log(...args);\r\n}\r\n\r\nexport const noop = () => {};\r\n","/** Cached result of whether the user's browser supports passive event listeners. */\r\nlet supportsPassiveEvents: boolean;\r\n\r\n/**\r\n * Checks whether the user's browser supports passive event listeners.\r\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\r\n */\r\nexport function ktdSupportsPassiveEventListeners(): boolean {\r\n    if (supportsPassiveEvents == null && typeof window !== 'undefined') {\r\n        try {\r\n            window.addEventListener('test', null!, Object.defineProperty({}, 'passive', {\r\n                get: () => supportsPassiveEvents = true\r\n            }));\r\n        } finally {\r\n            supportsPassiveEvents = supportsPassiveEvents || false;\r\n        }\r\n    }\r\n\r\n    return supportsPassiveEvents;\r\n}\r\n\r\n/**\r\n * Normalizes an `AddEventListener` object to something that can be passed\r\n * to `addEventListener` on any browser, no matter whether it supports the\r\n * `options` parameter.\r\n * @param options Object to be normalized.\r\n */\r\nexport function ktdNormalizePassiveListenerOptions(options: AddEventListenerOptions):\r\n    AddEventListenerOptions | boolean {\r\n    return ktdSupportsPassiveEventListeners() ? options : !!options.capture;\r\n}\r\n","import { fromEvent, iif, merge, Observable } from 'rxjs';\r\nimport { filter } from 'rxjs/operators';\r\nimport { ktdNormalizePassiveListenerOptions } from './passive-listeners';\r\n\r\n/** Options that can be used to bind a passive event listener. */\r\nconst passiveEventListenerOptions = ktdNormalizePassiveListenerOptions({passive: true});\r\n\r\n/** Options that can be used to bind an active event listener. */\r\nconst activeEventListenerOptions = ktdNormalizePassiveListenerOptions({passive: false});\r\n\r\nlet isMobile: boolean | null = null;\r\n\r\nexport function ktdIsMobileOrTablet(): boolean {\r\n\r\n    if (isMobile != null) {\r\n        return isMobile;\r\n    }\r\n\r\n    // Generic match pattern to identify mobile or tablet devices\r\n    const isMobileDevice = /Android|webOS|BlackBerry|Windows Phone|iPad|iPhone|iPod/i.test(navigator.userAgent);\r\n\r\n    // Since IOS 13 is not safe to just check for the generic solution. See: https://stackoverflow.com/questions/58019463/how-to-detect-device-name-in-safari-on-ios-13-while-it-doesnt-show-the-correct\r\n    const isIOSMobileDevice = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);\r\n\r\n    isMobile = isMobileDevice || isIOSMobileDevice;\r\n\r\n    return isMobile;\r\n}\r\n\r\nexport function ktdIsMouseEvent(event: any): event is MouseEvent {\r\n    return (event as MouseEvent).clientX != null;\r\n}\r\n\r\nexport function ktdIsTouchEvent(event: any): event is TouchEvent {\r\n    return (event as TouchEvent).touches != null && (event as TouchEvent).touches.length != null;\r\n}\r\n\r\nexport function ktdPointerClientX(event: MouseEvent | TouchEvent): number {\r\n    return ktdIsMouseEvent(event) ? event.clientX : event.touches[0].clientX;\r\n}\r\n\r\nexport function ktdPointerClientY(event: MouseEvent | TouchEvent): number {\r\n    return ktdIsMouseEvent(event) ? event.clientY : event.touches[0].clientY;\r\n}\r\n\r\nexport function ktdPointerClient(event: MouseEvent | TouchEvent): { clientX: number, clientY: number } {\r\n    return {\r\n        clientX: ktdIsMouseEvent(event) ? event.clientX : event.touches[0].clientX,\r\n        clientY: ktdIsMouseEvent(event) ? event.clientY : event.touches[0].clientY\r\n    };\r\n}\r\n\r\nexport function ktdIsMouseEventOrMousePointerEvent(event: MouseEvent | TouchEvent | PointerEvent): boolean {\r\n    return event.type === 'mousedown'\r\n        || (event.type === 'pointerdown' && (event as PointerEvent).pointerType === 'mouse');\r\n}\r\n\r\n/** Returns true if browser supports pointer events */\r\nexport function ktdSupportsPointerEvents(): boolean {\r\n    return !!window.PointerEvent;\r\n}\r\n\r\n/**\r\n * Emits when a mousedown or touchstart emits. Avoids conflicts between both events.\r\n * @param element, html element where to  listen the events.\r\n * @param touchNumber number of the touch to track the event, default to the first one.\r\n */\r\nfunction ktdMouseOrTouchDown(element, touchNumber = 1): Observable<MouseEvent | TouchEvent> {\r\n    return iif(\r\n        () => ktdIsMobileOrTablet(),\r\n        fromEvent<TouchEvent>(element, 'touchstart', passiveEventListenerOptions as AddEventListenerOptions).pipe(\r\n            filter((touchEvent) => touchEvent.touches.length === touchNumber)\r\n        ),\r\n        fromEvent<MouseEvent>(element, 'mousedown', activeEventListenerOptions as AddEventListenerOptions).pipe(\r\n            filter((mouseEvent: MouseEvent) => {\r\n                /**\r\n                 * 0 : Left mouse button\r\n                 * 1 : Wheel button or middle button (if present)\r\n                 * 2 : Right mouse button\r\n                 */\r\n                return mouseEvent.button === 0; // Mouse down to be only fired if is left click\r\n            })\r\n        )\r\n    );\r\n}\r\n\r\n/**\r\n * Emits when a 'mousemove' or a 'touchmove' event gets fired.\r\n * @param element, html element where to  listen the events.\r\n * @param touchNumber number of the touch to track the event, default to the first one.\r\n */\r\nfunction ktdMouseOrTouchMove(element: HTMLElement, touchNumber = 1): Observable<MouseEvent | TouchEvent> {\r\n    return iif(\r\n        () => ktdIsMobileOrTablet(),\r\n        fromEvent<TouchEvent>(element, 'touchmove', activeEventListenerOptions as AddEventListenerOptions).pipe(\r\n            filter((touchEvent) => touchEvent.touches.length === touchNumber),\r\n        ),\r\n        fromEvent<MouseEvent>(element, 'mousemove', activeEventListenerOptions as AddEventListenerOptions)\r\n    );\r\n}\r\n\r\nexport function ktdTouchEnd(element, touchNumber = 1): Observable<TouchEvent> {\r\n    return merge(\r\n        fromEvent<TouchEvent>(element, 'touchend').pipe(\r\n            filter((touchEvent) => touchEvent.touches.length === touchNumber - 1)\r\n        ),\r\n        fromEvent<TouchEvent>(element, 'touchcancel').pipe(\r\n            filter((touchEvent) => touchEvent.touches.length === touchNumber - 1)\r\n        )\r\n    );\r\n}\r\n\r\n/**\r\n * Emits when a there is a 'mouseup' or the touch ends.\r\n * @param element, html element where to  listen the events.\r\n * @param touchNumber number of the touch to track the event, default to the first one.\r\n */\r\nfunction ktdMouserOrTouchEnd(element: HTMLElement, touchNumber = 1): Observable<MouseEvent | TouchEvent> {\r\n    return iif(\r\n        () => ktdIsMobileOrTablet(),\r\n        ktdTouchEnd(element, touchNumber),\r\n        fromEvent<MouseEvent>(element, 'mouseup'),\r\n    );\r\n}\r\n\r\n\r\n/**\r\n * Emits when a 'pointerdown' event occurs (only for the primary pointer and mousePrimaryButton/touch). Fallbacks to 'mousemove' or a 'touchmove' if pointer events are not supported.\r\n * @param element, html element where to listen the events.\r\n */\r\nexport function ktdPointerDown(element): Observable<MouseEvent | TouchEvent | PointerEvent> {\r\n    if (!ktdSupportsPointerEvents()) {\r\n        return ktdMouseOrTouchDown(element);\r\n    }\r\n\r\n    return fromEvent<PointerEvent>(element, 'pointerdown', activeEventListenerOptions as AddEventListenerOptions).pipe(\r\n        filter((pointerEvent) => pointerEvent.isPrimary && pointerEvent.button === 0)\r\n    )\r\n}\r\n\r\n/**\r\n * Emits when a 'pointermove' event occurs (only for the primary pointer and mousePrimaryButton/touch). Fallbacks to 'mousemove' or a 'touchmove' if pointer events are not supported.\r\n * @param element, html element where to listen the events.\r\n */\r\nexport function ktdPointerMove(element): Observable<MouseEvent | TouchEvent | PointerEvent> {\r\n    if (!ktdSupportsPointerEvents()) {\r\n        return ktdMouseOrTouchMove(element);\r\n    }\r\n    return fromEvent<PointerEvent>(element, 'pointermove', activeEventListenerOptions as AddEventListenerOptions).pipe(\r\n        filter((pointerEvent) => pointerEvent.isPrimary && pointerEvent.button === 0),\r\n    );\r\n}\r\n\r\n/**\r\n * Emits when a 'pointerup' event occurs (only for the primary pointer and mousePrimaryButton/touch). Fallbacks to 'mousemove' or a 'touchmove' if pointer events are not supported.\r\n * @param element, html element where to listen the events.\r\n */\r\nexport function ktdPointerUp(element): Observable<MouseEvent | TouchEvent | PointerEvent> {\r\n    if (!ktdSupportsPointerEvents()) {\r\n        return ktdMouserOrTouchEnd(element);\r\n    }\r\n    return fromEvent<PointerEvent>(element, 'pointerup').pipe(filter(pointerEvent => pointerEvent.isPrimary && pointerEvent.button === 0));\r\n}\r\n","/**\r\n * IMPORTANT:\r\n * This utils are taken from the project: https://github.com/STRML/react-grid-layout.\r\n * The code should be as less modified as possible for easy maintenance.\r\n */\r\n\r\nimport { CompactType, getAllCollisions, getFirstCollision, Layout, LayoutItem, sortLayoutItems } from './react-grid-layout.utils';\r\n\r\nconst DEBUG = false;\r\n\r\n\r\n/**\r\n * Move a set of elements \"items\". Responsible for doing cascading movements of other elements.\r\n *\r\n * @export\r\n * @param {Layout} layout\r\n * @param {({\r\n *         l: LayoutItem,\r\n *         x: number | null | undefined,\r\n *         y: number | null | undefined\r\n *     }[])} items\r\n * @param {(boolean | null | undefined)} isUserAction\r\n * @param {(boolean | null | undefined)} preventCollision\r\n * @param {CompactType} compactType\r\n * @param {number} cols\r\n * @returns {Layout}\r\n */\r\nexport function KtdMoveMultipleElements(\r\n    layout: Layout,\r\n    items: {\r\n        l: LayoutItem,\r\n        x: number | null | undefined,\r\n        y: number | null | undefined\r\n    }[],\r\n    isUserAction: boolean | null | undefined,\r\n    compactType: CompactType,\r\n    cols: number\r\n): Layout {\r\n    let axes = compactType === 'vertical' ? 'y' : 'x';\r\n    // Short-circuit if nothing to do.\r\n    if (items.every((item) => item.l.y === item.y && item.l.x === item.x)) {\r\n        return layout;\r\n    }\r\n    // Old coordinates to detect the cursor movement direction (up, down, left, right)\r\n    const oldX = items[0].l.x;\r\n    const oldY = items[0].l.y;\r\n    // Old coordinates before mutation, to retrieve it if the element cant move\r\n    const oldCoord = {}\r\n\r\n    // Move the selected elements\r\n    items.forEach((item) => {\r\n        oldCoord[item.l.id] = {\r\n            x: item.l.x,\r\n            y: item.l.y\r\n        }\r\n        if (typeof item.x === 'number') {\r\n            item.l.x = item.x;\r\n        }\r\n        if (typeof item.y === 'number') {\r\n            item.l.y = item.y;\r\n        }\r\n        item.l.moved = true;\r\n    })\r\n\r\n    let sorted = sortLayoutItems(layout, compactType);\r\n    let itemsSorted = sortLayoutItems(items.map(item => item.l), compactType);\r\n\r\n    // If this collides with anything, move it.\r\n    // When doing this comparison, we have to sort the items we compare with\r\n    // to ensure, in the case of multiple collisions, that we're getting the\r\n    // nearest collision.\r\n    const movingUp =\r\n        compactType === 'vertical' && typeof items[0].y === 'number'\r\n            ? oldY >= items[0].y\r\n            : compactType === 'horizontal' && typeof items[0].x === 'number'\r\n                ? oldX >= items[0].x\r\n                : false;\r\n    if (movingUp) {\r\n        sorted = sorted.reverse();\r\n    }\r\n\r\n    // Get the position of the first row/col of the moved block, to avoid repositioning elements between the moved block, only\r\n    // can apply a repositioning if the collide item its on the first row/col\r\n    let minAxe: number | undefined;\r\n    if (itemsSorted && itemsSorted.length) {\r\n        minAxe = itemsSorted[0][axes];\r\n    }\r\n    // For each element, detect collisions and move the collided element by +1\r\n    itemsSorted.forEach((item) => {\r\n        const collisions: LayoutItem[] = getAllCollisions(sorted, item);\r\n        // Move each item that collides away from this element.\r\n        for (let i = 0, len = collisions.length; i < len; i++) {\r\n            const collision = collisions[i];\r\n            logMulti(\r\n                `Resolving collision between ${item.id}] and ${\r\n                    collision.id\r\n                } at [${collision.x},${collision.y}]`,\r\n            );\r\n            // Short circuit so we can't infinite loop\r\n            if (collision.moved) {\r\n                continue;\r\n            }\r\n            // Don't move static items - we have to move *this* element away\r\n            if (collision.static && !item.static) {\r\n                layout = KtdMoveElementsAwayFromCollision(\r\n                    layout,\r\n                    collision,\r\n                    item,\r\n                    minAxe === item[axes] ? isUserAction : false, // We only allow repositioning the \"item\" element if \"collision\" is in the first row of the moved block\r\n                    compactType,\r\n                    cols\r\n                );\r\n            } else {\r\n                layout = KtdMoveElementsAwayFromCollision(\r\n                    layout,\r\n                    item,\r\n                    collision,\r\n                    minAxe === item[axes] ? isUserAction : false, // We only allow repositioning the \"collision\" element if \"item\" is in the first row of the moved block\r\n                    compactType,\r\n                    cols\r\n                );\r\n            }\r\n        }\r\n    });\r\n\r\n    return layout;\r\n}\r\n\r\n/**\r\n * Move the element \"itemToMove\" away from the collision with \"collidesWith\"\r\n * @export\r\n * @param {Layout} layout\r\n * @param {LayoutItem} collidesWith\r\n * @param {LayoutItem} itemToMove\r\n * @param {(boolean | null | undefined)} isUserAction\r\n * @param {CompactType} compactType\r\n * @param {number} cols\r\n * @returns {Layout}\r\n */\r\nexport function KtdMoveElementsAwayFromCollision(\r\n    layout: Layout,\r\n    collidesWith: LayoutItem,\r\n    itemToMove: LayoutItem,\r\n    isUserAction: boolean | null | undefined,\r\n    compactType: CompactType,\r\n    cols: number,\r\n): Layout {\r\n    const compactH = compactType === 'horizontal';\r\n    // Compact vertically if not set to horizontal\r\n    const compactV = compactType !== 'horizontal';\r\n\r\n    // If there is enough space above the collision to put this element, move it there.\r\n    // We only do this on the main collision as this can get funky in cascades and cause\r\n    // unwanted swapping behavior.\r\n    if (isUserAction) {\r\n        // Reset isUserAction flag because we're not in the main collision anymore.\r\n        isUserAction = false;\r\n\r\n        // Make a mock item so we don't modify the item here, only modify in moveElement.\r\n        const fakeItem: LayoutItem = {\r\n            x: compactH\r\n                ? Math.max(collidesWith.x - itemToMove.w, 0)\r\n                : itemToMove.x,\r\n            y: compactV\r\n                ? Math.max(collidesWith.y - itemToMove.h, 0)\r\n                : itemToMove.y,\r\n            w: itemToMove.w,\r\n            h: itemToMove.h,\r\n            id: '-1',\r\n        };\r\n\r\n        // No collision? If so, we can go up there; otherwise, we'll end up moving down as normal\r\n        if (!getFirstCollision(layout, fakeItem)) {\r\n            logMulti(\r\n                `Doing reverse collision on ${itemToMove.id} up to [${\r\n                    fakeItem.x\r\n                },${fakeItem.y}].`,\r\n            );\r\n            return KtdMoveMultipleElements(\r\n                layout,\r\n                [{\r\n                    l: itemToMove,\r\n                    x: compactH ? fakeItem.x : undefined,\r\n                    y: compactV ? fakeItem.y : undefined,\r\n                }],\r\n                isUserAction,\r\n                compactType,\r\n                cols\r\n            );\r\n        }\r\n    }\r\n\r\n    return KtdMoveMultipleElements(\r\n        layout,\r\n        [{\r\n            l: itemToMove,\r\n            x: compactH ? itemToMove.x + 1 : undefined,\r\n            y: compactV ? itemToMove.y + 1 : undefined,\r\n        }],\r\n        isUserAction,\r\n        compactType,\r\n        cols\r\n    );\r\n}\r\n\r\nfunction logMulti(...args) {\r\n    if (!DEBUG) {\r\n        return;\r\n    }\r\n    // eslint-disable-next-line no-console\r\n    console.log(...args);\r\n}\r\n\r\n","import { compact, CompactType, getFirstCollision, Layout, LayoutItem, moveElement, sortLayoutItems } from './react-grid-layout.utils';\r\nimport {\r\n    KtdDraggingData, KtdDraggingMultipleData, KtdGridCfg, KtdGridCompactType, KtdGridItemRect, KtdGridItemRenderData, KtdGridLayout, KtdGridLayoutItem\r\n} from '../grid.definitions';\r\nimport { ktdPointerClientX, ktdPointerClientY } from './pointer.utils';\r\nimport { KtdDictionary } from '../../types';\r\nimport { KtdGridItemComponent } from '../grid-item/grid-item.component';\r\nimport { KtdMoveMultipleElements } from './react-grid-layout-multiple.utils';\r\n\r\n/** Tracks items by id. This function is mean to be used in conjunction with the ngFor that renders the 'ktd-grid-items' */\r\nexport function ktdTrackById(index: number, item: {id: string}) {\r\n    return item.id;\r\n}\r\n\r\n/** Given a layout, the gridHeight and the gap return the resulting rowHeight */\r\nexport function ktdGetGridItemRowHeight(layout: KtdGridLayout, gridHeight: number, gap: number): number {\r\n    const numberOfRows = layout.reduce((acc, cur) => Math.max(acc, Math.max(cur.y + cur.h, 0)), 0);\r\n    const gapTotalHeight = (numberOfRows - 1) * gap;\r\n    const gridHeightMinusGap = gridHeight - gapTotalHeight;\r\n    return gridHeightMinusGap / numberOfRows;\r\n}\r\n\r\n/**\r\n * Call react-grid-layout utils 'compact()' function and return the compacted layout.\r\n * @param layout to be compacted.\r\n * @param compactType, type of compaction.\r\n * @param cols, number of columns of the grid.\r\n */\r\nexport function ktdGridCompact(layout: KtdGridLayout, compactType: KtdGridCompactType, cols: number): KtdGridLayout {\r\n    return compact(layout, compactType, cols)\r\n        // Prune react-grid-layout compact extra properties.\r\n        .map(item => ({ id: item.id, x: item.x, y: item.y, w: item.w, h: item.h, minW: item.minW, minH: item.minH, maxW: item.maxW, maxH: item.maxH }));\r\n}\r\n\r\n/**\r\n * Call react-grid-layout utils 'sortLayoutItems()' function to return the 'layout' sorted by 'compactType'\r\n * @param {Layout} layout\r\n * @param {CompactType} compactType\r\n * @returns {Layout}\r\n */\r\nexport function ktdGridSortLayoutItems(\r\n    layout: Layout,\r\n    compactType: CompactType,\r\n): Layout {\r\n    return sortLayoutItems(layout,compactType)\r\n}\r\n\r\nfunction screenXToGridX(screenXPos: number, cols: number, width: number, gap: number): number {\r\n    if (cols <= 1) {\r\n        return 0;\r\n    }\r\n\r\n    const totalGapsWidth = gap * (cols - 1);\r\n    const totalItemsWidth = width - totalGapsWidth;\r\n    const itemPlusGapWidth = totalItemsWidth / cols + gap;\r\n    return Math.round(screenXPos / itemPlusGapWidth);\r\n}\r\n\r\nfunction screenYToGridY(screenYPos: number, rowHeight: number, height: number, gap: number): number {\r\n    return Math.round(screenYPos / (rowHeight + gap));\r\n}\r\n\r\nfunction screenWidthToGridWidth(gridScreenWidth: number, cols: number, width: number, gap: number): number {\r\n    const widthMinusGaps = width - (gap * (cols - 1));\r\n    const itemWidth = widthMinusGaps / cols;\r\n    const gridScreenWidthMinusFirst = gridScreenWidth - itemWidth;\r\n    return Math.round(gridScreenWidthMinusFirst / (itemWidth + gap)) + 1;\r\n}\r\n\r\nfunction screenHeightToGridHeight(gridScreenHeight: number, rowHeight: number, height: number, gap: number): number {\r\n    const gridScreenHeightMinusFirst = gridScreenHeight - rowHeight;\r\n    return Math.round(gridScreenHeightMinusFirst / (rowHeight + gap)) + 1;\r\n}\r\n\r\n/** Returns a Dictionary where the key is the id and the value is the change applied to that item. If no changes Dictionary is empty. */\r\nexport function ktdGetGridLayoutDiff(gridLayoutA: KtdGridLayoutItem[], gridLayoutB: KtdGridLayoutItem[]): KtdDictionary<{ change: 'move' | 'resize' | 'moveresize' }> {\r\n    const diff: KtdDictionary<{ change: 'move' | 'resize' | 'moveresize' }> = {};\r\n\r\n    gridLayoutA.forEach(itemA => {\r\n        const itemB = gridLayoutB.find(_itemB => _itemB.id === itemA.id);\r\n        if (itemB != null) {\r\n            const posChanged = itemA.x !== itemB.x || itemA.y !== itemB.y;\r\n            const sizeChanged = itemA.w !== itemB.w || itemA.h !== itemB.h;\r\n            const change: 'move' | 'resize' | 'moveresize' | null = posChanged && sizeChanged ? 'moveresize' : posChanged ? 'move' : sizeChanged ? 'resize' : null;\r\n            if (change) {\r\n                diff[itemB.id] = {change};\r\n            }\r\n        }\r\n    });\r\n    return diff;\r\n}\r\n\r\n/**\r\n * Given the grid config & layout data and the current drag position & information, returns the corresponding layout and drag item position\r\n * @param gridItem grid item that is been dragged\r\n * @param config current grid configuration\r\n * @param compactionType type of compaction that will be performed\r\n * @param draggingData contains all the information about the drag\r\n */\r\nexport function ktdGridItemDragging(gridItem: KtdGridItemComponent, config: KtdGridCfg, compactionType: CompactType, draggingData: KtdDraggingData): { layout: KtdGridLayoutItem[]; draggedItemPos: KtdGridItemRect } {\r\n    const {pointerDownEvent, pointerDragEvent, gridElemClientRect, dragElemClientRect, scrollDifference} = draggingData;\r\n\r\n    const gridItemId = gridItem.id;\r\n\r\n    const draggingElemPrevItem = config.layout.find(item => item.id === gridItemId)!;\r\n\r\n    const clientStartX = ktdPointerClientX(pointerDownEvent);\r\n    const clientStartY = ktdPointerClientY(pointerDownEvent);\r\n    const clientX = ktdPointerClientX(pointerDragEvent);\r\n    const clientY = ktdPointerClientY(pointerDragEvent);\r\n\r\n    const offsetX = clientStartX - dragElemClientRect.left;\r\n    const offsetY = clientStartY - dragElemClientRect.top;\r\n\r\n    // Grid element positions taking into account the possible scroll total difference from the beginning.\r\n    const gridElementLeftPosition = gridElemClientRect.left + scrollDifference.left;\r\n    const gridElementTopPosition = gridElemClientRect.top + scrollDifference.top;\r\n\r\n    // Calculate position relative to the grid element.\r\n    const gridRelXPos = clientX - gridElementLeftPosition - offsetX;\r\n    const gridRelYPos = clientY - gridElementTopPosition - offsetY;\r\n\r\n    const rowHeightInPixels = config.rowHeight === 'fit'\r\n        ? ktdGetGridItemRowHeight(config.layout, config.height ?? gridElemClientRect.height, config.gap)\r\n        : config.rowHeight;\r\n\r\n    // Get layout item position\r\n    const layoutItem: KtdGridLayoutItem = {\r\n        ...draggingElemPrevItem,\r\n        x: screenXToGridX(gridRelXPos , config.cols, gridElemClientRect.width, config.gap),\r\n        y: screenYToGridY(gridRelYPos, rowHeightInPixels, gridElemClientRect.height, config.gap)\r\n    };\r\n\r\n    // Correct the values if they overflow, since 'moveElement' function doesn't do it\r\n    layoutItem.x = Math.max(0, layoutItem.x);\r\n    layoutItem.y = Math.max(0, layoutItem.y);\r\n    if (layoutItem.x + layoutItem.w > config.cols) {\r\n        layoutItem.x = Math.max(0, config.cols - layoutItem.w);\r\n    }\r\n\r\n    // Parse to LayoutItem array data in order to use 'react.grid-layout' utils\r\n    const layoutItems: LayoutItem[] = config.layout;\r\n    const draggedLayoutItem: LayoutItem = layoutItems.find(item => item.id === gridItemId)!;\r\n\r\n    let newLayoutItems: LayoutItem[] = moveElement(\r\n        layoutItems,\r\n        draggedLayoutItem,\r\n        layoutItem.x,\r\n        layoutItem.y,\r\n        true,\r\n        config.preventCollision,\r\n        compactionType,\r\n        config.cols\r\n    );\r\n\r\n    newLayoutItems = compact(newLayoutItems, compactionType, config.cols);\r\n\r\n    return {\r\n        layout: newLayoutItems,\r\n        draggedItemPos: {\r\n            top: gridRelYPos,\r\n            left: gridRelXPos,\r\n            width: dragElemClientRect.width,\r\n            height: dragElemClientRect.height,\r\n        }\r\n    };\r\n}\r\n\r\n\r\n\r\n/**\r\n * Given the grid config & layout data and the current drag position & information, returns the corresponding layout and drag item position\r\n * @param gridItem grid item that is been dragged\r\n * @param config current grid configuration\r\n * @param compactionType type of compaction that will be performed\r\n * @param draggingData contains all the information about the drag\r\n */\r\nexport function ktdGridItemsDragging(gridItems: KtdGridItemComponent[], config: KtdGridCfg, compactionType: CompactType, draggingData: KtdDraggingMultipleData): { layout: KtdGridLayoutItem[]; draggedItemPos:  KtdDictionary<KtdGridItemRect> } {\r\n    const {pointerDownEvent, pointerDragEvent, gridElemClientRect, dragElementsClientRect, scrollDifference} = draggingData;\r\n\r\n    const draggingElemPrevItem: KtdDictionary<KtdGridLayoutItem> = {}\r\n    gridItems.forEach(gridItem=> {\r\n        draggingElemPrevItem[gridItem.id] = config.layout.find(item => item.id === gridItem.id)!\r\n    });\r\n\r\n    const clientStartX = ktdPointerClientX(pointerDownEvent);\r\n    const clientStartY = ktdPointerClientY(pointerDownEvent);\r\n    const clientX = ktdPointerClientX(pointerDragEvent);\r\n    const clientY = ktdPointerClientY(pointerDragEvent);\r\n\r\n    // Grid element positions taking into account the possible scroll total difference from the beginning.\r\n    const gridElementLeftPosition = gridElemClientRect.left + scrollDifference.left;\r\n    const gridElementTopPosition = gridElemClientRect.top + scrollDifference.top;\r\n\r\n    const rowHeightInPixels = config.rowHeight === 'fit'\r\n        ? ktdGetGridItemRowHeight(config.layout, config.height ?? gridElemClientRect.height, config.gap)\r\n        : config.rowHeight;\r\n\r\n    const layoutItemsToMove:  KtdDictionary<KtdGridLayoutItem>={};\r\n    const gridRelPos: KtdDictionary<{x:number,y:number}>={}\r\n    let maxXMove: number = 0;\r\n    let maxYMove: number = 0;\r\n    gridItems.forEach((gridItem: KtdGridItemComponent)=>{\r\n        const offsetX = clientStartX - dragElementsClientRect[gridItem.id].left;\r\n        const offsetY = clientStartY - dragElementsClientRect[gridItem.id].top;\r\n        // Calculate position relative to the grid element.\r\n        gridRelPos[gridItem.id]={\r\n            x: clientX - gridElementLeftPosition - offsetX,\r\n            y: clientY - gridElementTopPosition - offsetY\r\n        };\r\n        // Get layout item position\r\n        layoutItemsToMove[gridItem.id] = {\r\n            ...draggingElemPrevItem[gridItem.id],\r\n            x: screenXToGridX(gridRelPos[gridItem.id].x , config.cols, gridElemClientRect.width, config.gap),\r\n            y: screenYToGridY(gridRelPos[gridItem.id].y, rowHeightInPixels, gridElemClientRect.height, config.gap)\r\n        };\r\n        // Determine the maximum X and Y displacement where an item has gone outside the grid\r\n        if(0>layoutItemsToMove[gridItem.id].x && maxXMove>layoutItemsToMove[gridItem.id].x){\r\n            maxXMove = layoutItemsToMove[gridItem.id].x;\r\n        }\r\n        if(0>layoutItemsToMove[gridItem.id].y && maxYMove>layoutItemsToMove[gridItem.id].y){\r\n            maxYMove = layoutItemsToMove[gridItem.id].y;\r\n        }\r\n        if(layoutItemsToMove[gridItem.id].x + layoutItemsToMove[gridItem.id].w > config.cols && maxXMove<layoutItemsToMove[gridItem.id].w + layoutItemsToMove[gridItem.id].x - config.cols){\r\n            maxXMove = layoutItemsToMove[gridItem.id].w + layoutItemsToMove[gridItem.id].x - config.cols\r\n        }\r\n    })\r\n    // Correct all the x and y position of the group decreasing/increasing the maximum overflow of an item, to maintain the structure\r\n    Object.entries(layoutItemsToMove).forEach(([key, item]) => {\r\n        layoutItemsToMove[key] = {\r\n            ...item,\r\n            x: item.x - maxXMove,\r\n            y: item.y - maxYMove\r\n        };\r\n    })\r\n\r\n    // Parse to LayoutItem array data in order to use 'react.grid-layout' utils\r\n    const layoutItems: LayoutItem[] = config.layout;\r\n    const draggedLayoutItems: {\r\n        l: LayoutItem,\r\n        x: number | null | undefined,\r\n        y: number | null | undefined\r\n    }[] = gridItems.map((gridItem:KtdGridItemComponent)=>{\r\n        const draggedLayoutItem: LayoutItem = layoutItems.find(item => item.id === gridItem.id)!;\r\n        draggedLayoutItem.static = true;\r\n        return {\r\n            l: draggedLayoutItem,\r\n            x: layoutItemsToMove[gridItem.id].x,\r\n            y: layoutItemsToMove[gridItem.id].y\r\n        }\r\n    });\r\n\r\n    // Move all elements in group\r\n    let newLayoutItems: LayoutItem[] = KtdMoveMultipleElements(\r\n        layoutItems,\r\n        draggedLayoutItems,\r\n        true,\r\n        compactionType,\r\n        config.cols,\r\n    );\r\n\r\n    // Compact with selected items as static to preserve the structure of the selected items group\r\n    newLayoutItems = compact(newLayoutItems, compactionType, config.cols);\r\n    gridItems.forEach(gridItem=>newLayoutItems.find(layoutItem=>layoutItem.id === gridItem.id)!.static = false);\r\n    // Compact normal to display the layout correctly\r\n    newLayoutItems = compact(newLayoutItems, compactionType, config.cols);\r\n\r\n    const draggedItemPos: KtdDictionary<KtdGridItemRect>={};\r\n    gridItems.forEach(gridItem=>\r\n        draggedItemPos[gridItem.id]={\r\n            left: gridRelPos[gridItem.id].x,\r\n            top: gridRelPos[gridItem.id].y,\r\n            width: dragElementsClientRect[gridItem.id].width,\r\n            height: dragElementsClientRect[gridItem.id].height,\r\n        }\r\n    );\r\n\r\n    return {\r\n        layout: newLayoutItems,\r\n        draggedItemPos\r\n    };\r\n}\r\n\r\n/**\r\n * Given the grid config & layout data and the current drag position & information, returns the corresponding layout and drag item position\r\n * @param gridItem grid item that is been dragged\r\n * @param config current grid configuration\r\n * @param compactionType type of compaction that will be performed\r\n * @param draggingData contains all the information about the drag\r\n */\r\nexport function ktdGridItemResizing(gridItem: KtdGridItemComponent, config: KtdGridCfg, compactionType: CompactType, draggingData: KtdDraggingData): { layout: KtdGridLayoutItem[]; draggedItemPos: KtdGridItemRect } {\r\n    const {pointerDownEvent, pointerDragEvent, gridElemClientRect, dragElemClientRect, scrollDifference} = draggingData;\r\n    const gridItemId = gridItem.id;\r\n\r\n    const clientStartX = ktdPointerClientX(pointerDownEvent);\r\n    const clientStartY = ktdPointerClientY(pointerDownEvent);\r\n    const clientX = ktdPointerClientX(pointerDragEvent);\r\n    const clientY = ktdPointerClientY(pointerDragEvent);\r\n\r\n    // Get the difference between the mouseDown and the position 'right' of the resize element.\r\n    const resizeElemOffsetX = dragElemClientRect.width - (clientStartX - dragElemClientRect.left);\r\n    const resizeElemOffsetY = dragElemClientRect.height - (clientStartY - dragElemClientRect.top);\r\n\r\n    const draggingElemPrevItem = config.layout.find(item => item.id === gridItemId)!;\r\n    const width = clientX + resizeElemOffsetX - (dragElemClientRect.left + scrollDifference.left);\r\n    const height = clientY + resizeElemOffsetY - (dragElemClientRect.top + scrollDifference.top);\r\n\r\n    const rowHeightInPixels = config.rowHeight === 'fit'\r\n        ? ktdGetGridItemRowHeight(config.layout, config.height ?? gridElemClientRect.height, config.gap)\r\n        : config.rowHeight;\r\n\r\n    // Get layout item grid position\r\n    const layoutItem: KtdGridLayoutItem = {\r\n        ...draggingElemPrevItem,\r\n        w: screenWidthToGridWidth(width, config.cols, gridElemClientRect.width, config.gap),\r\n        h: screenHeightToGridHeight(height, rowHeightInPixels, gridElemClientRect.height, config.gap)\r\n    };\r\n\r\n    layoutItem.w = limitNumberWithinRange(layoutItem.w, gridItem.minW ?? layoutItem.minW, gridItem.maxW ?? layoutItem.maxW);\r\n    layoutItem.h = limitNumberWithinRange(layoutItem.h, gridItem.minH ?? layoutItem.minH, gridItem.maxH ?? layoutItem.maxH);\r\n\r\n    if (layoutItem.x + layoutItem.w > config.cols) {\r\n        layoutItem.w = Math.max(1, config.cols - layoutItem.x);\r\n    }\r\n\r\n    if (config.preventCollision) {\r\n        const maxW = layoutItem.w;\r\n        const maxH = layoutItem.h;\r\n\r\n        let colliding = hasCollision(config.layout, layoutItem);\r\n        let shrunkDimension: 'w' | 'h' | undefined;\r\n\r\n        while (colliding) {\r\n            shrunkDimension = getDimensionToShrink(layoutItem, shrunkDimension);\r\n            layoutItem[shrunkDimension]--;\r\n            colliding = hasCollision(config.layout, layoutItem);\r\n        }\r\n\r\n        if (shrunkDimension === 'w') {\r\n            layoutItem.h = maxH;\r\n\r\n            colliding = hasCollision(config.layout, layoutItem);\r\n            while (colliding) {\r\n                layoutItem.h--;\r\n                colliding = hasCollision(config.layout, layoutItem);\r\n            }\r\n        }\r\n        if (shrunkDimension === 'h') {\r\n            layoutItem.w = maxW;\r\n\r\n            colliding = hasCollision(config.layout, layoutItem);\r\n            while (colliding) {\r\n                layoutItem.w--;\r\n                colliding = hasCollision(config.layout, layoutItem);\r\n            }\r\n        }\r\n\r\n    }\r\n\r\n    const newLayoutItems: LayoutItem[] = config.layout.map((item) => {\r\n        return item.id === gridItemId ? layoutItem : item;\r\n    });\r\n\r\n    return {\r\n        layout: compact(newLayoutItems, compactionType, config.cols),\r\n        draggedItemPos: {\r\n            top: dragElemClientRect.top - gridElemClientRect.top,\r\n            left: dragElemClientRect.left - gridElemClientRect.left,\r\n            width,\r\n            height,\r\n        }\r\n    };\r\n}\r\n\r\nfunction hasCollision(layout: Layout, layoutItem: LayoutItem): boolean {\r\n    return !!getFirstCollision(layout, layoutItem);\r\n}\r\n\r\nfunction getDimensionToShrink(layoutItem, lastShrunk): 'w' | 'h' {\r\n    if (layoutItem.h <= 1) {\r\n        return 'w';\r\n    }\r\n    if (layoutItem.w <= 1) {\r\n        return 'h';\r\n    }\r\n\r\n    return lastShrunk === 'w' ? 'h' : 'w';\r\n}\r\n\r\n/**\r\n * Given the current number and min/max values, returns the number within the range\r\n * @param number can be any numeric value\r\n * @param min minimum value of range\r\n * @param max maximum value of range\r\n */\r\nfunction limitNumberWithinRange(num: number, min: number = 1, max: number = Infinity) {\r\n    return Math.min(Math.max(num, min < 1 ? 1 : min), max);\r\n}\r\n\r\n/** Returns true if both item1 and item2 KtdGridLayoutItems are equivalent. */\r\nexport function ktdGridItemLayoutItemAreEqual(item1: KtdGridLayoutItem, item2: KtdGridLayoutItem): boolean {\r\n    return item1.id === item2.id\r\n        && item1.x === item2.x\r\n        && item1.y === item2.y\r\n        && item1.w === item2.w\r\n        && item1.h === item2.h\r\n}\r\n","import { Directive, ElementRef, InjectionToken } from '@angular/core';\r\n\r\n/**\r\n * Injection token that can be used to reference instances of `KtdGridDragHandle`. It serves as\r\n * alternative token to the actual `KtdGridDragHandle` class which could cause unnecessary\r\n * retention of the class and its directive metadata.\r\n */\r\nexport const KTD_GRID_DRAG_HANDLE = new InjectionToken<KtdGridDragHandle>('KtdGridDragHandle');\r\n\r\n/** Handle that can be used to drag a KtdGridItem instance. */\r\n@Directive({\r\n    standalone: true,\r\n    selector: '[ktdGridDragHandle]',\r\n    // eslint-disable-next-line @angular-eslint/no-host-metadata-property\r\n    host: {\r\n        class: 'ktd-grid-drag-handle'\r\n    },\r\n    providers: [{provide: KTD_GRID_DRAG_HANDLE, useExisting: KtdGridDragHandle}],\r\n})\r\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\r\nexport class KtdGridDragHandle {\r\n    constructor(\r\n        public element: ElementRef<HTMLElement>) {\r\n    }\r\n}\r\n","import { Directive, ElementRef, InjectionToken, } from '@angular/core';\r\n\r\n\r\n/**\r\n * Injection token that can be used to reference instances of `KtdGridResizeHandle`. It serves as\r\n * alternative token to the actual `KtdGridResizeHandle` class which could cause unnecessary\r\n * retention of the class and its directive metadata.\r\n */\r\nexport const KTD_GRID_RESIZE_HANDLE = new InjectionToken<KtdGridResizeHandle>('KtdGridResizeHandle');\r\n\r\n/** Handle that can be used to drag a KtdGridItem instance. */\r\n@Directive({\r\n    standalone: true,\r\n    selector: '[ktdGridResizeHandle]',\r\n    // eslint-disable-next-line @angular-eslint/no-host-metadata-property\r\n    host: {\r\n        class: 'ktd-grid-resize-handle'\r\n    },\r\n    providers: [{provide: KTD_GRID_RESIZE_HANDLE, useExisting: KtdGridResizeHandle}],\r\n})\r\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\r\nexport class KtdGridResizeHandle {\r\n\r\n    constructor(\r\n        public element: ElementRef<HTMLElement>) {\r\n    }\r\n}\r\n","import { Directive, InjectionToken, Input, TemplateRef } from '@angular/core';\r\n\r\n/**\r\n * Injection token that can be used to reference instances of `KtdGridItemPlaceholder`. It serves as\r\n * alternative token to the actual `KtdGridItemPlaceholder` class which could cause unnecessary\r\n * retention of the class and its directive metadata.\r\n */\r\nexport const KTD_GRID_ITEM_PLACEHOLDER = new InjectionToken<KtdGridItemPlaceholder>('KtdGridItemPlaceholder');\r\n\r\n/** Directive that can be used to create a custom placeholder for a KtdGridItem instance. */\r\n@Directive({\r\n    standalone: true,\r\n    selector: 'ng-template[ktdGridItemPlaceholder]',\r\n    // eslint-disable-next-line @angular-eslint/no-host-metadata-property\r\n    host: {\r\n        class: 'ktd-grid-item-placeholder-content'\r\n    },\r\n    providers: [{provide: KTD_GRID_ITEM_PLACEHOLDER, useExisting: KtdGridItemPlaceholder}],\r\n})\r\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\r\nexport class KtdGridItemPlaceholder<T = any> {\r\n    /** Context data to be added to the placeholder template instance. */\r\n    @Input() data: T;\r\n    constructor(public templateRef: TemplateRef<T>) {}\r\n}\r\n","/* eslint-disable */\r\n/**\r\n * Type describing the allowed values for a boolean input.\r\n * @docs-private\r\n */\r\nexport type BooleanInput = string | boolean | null | undefined;\r\n\r\n/** Coerces a data-bound value (typically a string) to a boolean. */\r\nexport function coerceBooleanProperty(value: any): boolean {\r\n  return value != null && `${value}` !== 'false';\r\n}\r\n","/* eslint-disable */\r\nexport type NumberInput = string | number | null | undefined;\r\n\r\n/** Coerces a data-bound value (typically a string) to a number. */\r\nexport function coerceNumberProperty(value: any): number;\r\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\r\nexport function coerceNumberProperty(value: any, fallbackValue = 0) {\r\n    return _isNumberValue(value) ? Number(value) : fallbackValue;\r\n}\r\n\r\n/**\r\n * Whether the provided value is considered a number.\r\n * @docs-private\r\n */\r\nexport function _isNumberValue(value: any): boolean {\r\n    // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\r\n    // and other non-number values as NaN, where Number just uses 0) but it considers the string\r\n    // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\r\n    return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\r\n}\r\n","import { InjectionToken } from '@angular/core';\r\nimport { CompactType } from './utils/react-grid-layout.utils';\r\nimport { KtdClientRect } from './utils/client-rect';\r\nimport { KtdDictionary } from '../types';\r\n\r\nexport interface KtdGridLayoutItem {\r\n    id: string;\r\n    x: number;\r\n    y: number;\r\n    w: number;\r\n    h: number;\r\n    minW?: number;\r\n    minH?: number;\r\n    maxW?: number;\r\n    maxH?: number;\r\n}\r\n\r\nexport type KtdGridCompactType = CompactType;\r\n\r\n\r\nexport interface KtdGridBackgroundCfg {\r\n    show: 'never' | 'always' | 'whenDragging';\r\n    borderColor?: string;\r\n    gapColor?: string;\r\n    rowColor?: string;\r\n    columnColor?: string;\r\n    borderWidth?: number;\r\n}\r\n\r\nexport interface KtdGridCfg {\r\n    cols: number;\r\n    rowHeight: number | 'fit'; // row height in pixels\r\n    height?: number | null;\r\n    layout: KtdGridLayoutItem[];\r\n    preventCollision: boolean;\r\n    gap: number;\r\n}\r\n\r\nexport type KtdGridLayout = KtdGridLayoutItem[];\r\n\r\n// TODO: Remove this interface. If can't remove, move and rename this interface in the core module or similar.\r\nexport interface KtdGridItemRect {\r\n    top: number;\r\n    left: number;\r\n    width: number;\r\n    height: number;\r\n}\r\n\r\nexport interface KtdGridItemRenderData<T = number | string> {\r\n    id: string;\r\n    top: T;\r\n    left: T;\r\n    width: T;\r\n    height: T;\r\n}\r\n\r\n/**\r\n * We inject a token because of the 'circular dependency issue warning'. In case we don't had this issue with the circular dependency, we could just\r\n * import KtdGridComponent on KtdGridItem and execute the needed function to get the rendering data.\r\n */\r\nexport type KtdGridItemRenderDataTokenType = (id: string) => KtdGridItemRenderData<string>;\r\nexport const GRID_ITEM_GET_RENDER_DATA_TOKEN: InjectionToken<KtdGridItemRenderDataTokenType> = new InjectionToken('GRID_ITEM_GET_RENDER_DATA_TOKEN');\r\n\r\nexport interface KtdDraggingData {\r\n    pointerDownEvent: MouseEvent | TouchEvent;\r\n    pointerDragEvent: MouseEvent | TouchEvent;\r\n    gridElemClientRect: KtdClientRect;\r\n    dragElemClientRect: KtdClientRect;\r\n    scrollDifference: { top: number, left: number };\r\n}\r\n\r\nexport interface KtdDraggingMultipleData {\r\n    pointerDownEvent: MouseEvent | TouchEvent;\r\n    pointerDragEvent: MouseEvent | TouchEvent;\r\n    gridElemClientRect: KtdClientRect;\r\n    dragElementsClientRect: KtdDictionary<KtdClientRect>;\r\n    scrollDifference: { top: number, left: number };\r\n}\r\n","import { NgZone } from '@angular/core';\r\nimport { Observable, Subscription } from 'rxjs';\r\nimport { filter } from 'rxjs/operators';\r\n\r\n/** Runs source observable outside the zone */\r\nexport function ktdOutsideZone<T>(zone: NgZone) {\r\n    return (source: Observable<T>) => {\r\n        return new Observable<T>(observer => {\r\n            return zone.runOutsideAngular<Subscription>(() => source.subscribe(observer));\r\n        });\r\n    };\r\n}\r\n\r\n\r\n/** Rxjs operator that makes source observable to no emit any data */\r\nexport function ktdNoEmit() {\r\n    return (source$: Observable<any>): Observable<any> => {\r\n        return source$.pipe(filter(() => false));\r\n    };\r\n}\r\n","import { Inject, Injectable, NgZone, OnDestroy } from '@angular/core';\r\nimport { ktdNormalizePassiveListenerOptions } from './utils/passive-listeners';\r\nimport { fromEvent, iif, Observable, Subject, Subscription } from 'rxjs';\r\nimport { filter } from 'rxjs/operators';\r\nimport { ktdIsMobileOrTablet, ktdSupportsPointerEvents } from './utils/pointer.utils';\r\nimport { DOCUMENT } from '@angular/common';\r\n\r\n/** Event options that can be used to bind an active, capturing event. */\r\nconst activeCapturingEventOptions = ktdNormalizePassiveListenerOptions({\r\n    passive: false,\r\n    capture: true\r\n});\r\n\r\n@Injectable({providedIn: 'root'})\r\nexport class KtdGridService implements OnDestroy {\r\n\r\n    touchMove$: Observable<TouchEvent>;\r\n    private touchMoveSubject: Subject<TouchEvent> = new Subject<TouchEvent>();\r\n    private touchMoveSubscription: Subscription;\r\n\r\n    constructor(private ngZone: NgZone, @Inject(DOCUMENT) private document: Document) {\r\n        this.touchMove$ = this.touchMoveSubject.asObservable();\r\n        this.registerTouchMoveSubscription();\r\n    }\r\n\r\n    ngOnDestroy() {\r\n        this.touchMoveSubscription.unsubscribe();\r\n    }\r\n\r\n    mouseOrTouchMove$(element): Observable<MouseEvent | TouchEvent> {\r\n        if (!ktdSupportsPointerEvents()) {\r\n            return iif(\r\n                () => ktdIsMobileOrTablet(),\r\n                this.touchMove$,\r\n                fromEvent<MouseEvent>(element, 'mousemove', activeCapturingEventOptions as AddEventListenerOptions) // TODO: Fix rxjs typings, boolean should be a good param too.\r\n            );\r\n        }\r\n\r\n        return fromEvent<MouseEvent>(element, 'pointermove', activeCapturingEventOptions as AddEventListenerOptions);\r\n    }\r\n\r\n    private registerTouchMoveSubscription() {\r\n        // The `touchmove` event gets bound once, ahead of time, because WebKit\r\n        // won't preventDefault on a dynamically-added `touchmove` listener.\r\n        // See https://bugs.webkit.org/show_bug.cgi?id=184250.\r\n        this.touchMoveSubscription = this.ngZone.runOutsideAngular(() =>\r\n            // The event handler has to be explicitly active,\r\n            // because newer browsers make it passive by default.\r\n            fromEvent(this.document, 'touchmove', activeCapturingEventOptions as AddEventListenerOptions) // TODO: Fix rxjs typings, boolean should be a good param too.\r\n                .pipe(filter((touchEvent: TouchEvent) => touchEvent.touches.length === 1))\r\n                .subscribe((touchEvent: TouchEvent) => this.touchMoveSubject.next(touchEvent))\r\n        );\r\n    }\r\n}\r\n","import {\r\n    AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, ContentChildren, ElementRef, HostBinding, Inject, Input, NgZone, OnDestroy, OnInit,\r\n    QueryList, Renderer2, ViewChild\r\n} from '@angular/core';\r\nimport { BehaviorSubject, NEVER, Observable, Subject, Subscription, iif, merge } from 'rxjs';\r\nimport { exhaustMap, filter, map, startWith, switchMap, take, takeUntil, tap } from 'rxjs/operators';\r\nimport { BooleanInput, coerceBooleanProperty } from '../coercion/boolean-property';\r\nimport { NumberInput, coerceNumberProperty } from '../coercion/number-property';\r\nimport { KTD_GRID_DRAG_HANDLE, KtdGridDragHandle } from '../directives/drag-handle';\r\nimport { KTD_GRID_ITEM_PLACEHOLDER, KtdGridItemPlaceholder } from '../directives/placeholder';\r\nimport { KTD_GRID_RESIZE_HANDLE, KtdGridResizeHandle } from '../directives/resize-handle';\r\nimport { GRID_ITEM_GET_RENDER_DATA_TOKEN, KtdGridItemRenderDataTokenType } from '../grid.definitions';\r\nimport { KtdGridService } from '../grid.service';\r\nimport { ktdOutsideZone } from '../utils/operators';\r\nimport { ktdIsMouseEventOrMousePointerEvent, ktdPointerClient, ktdPointerDown, ktdPointerUp } from '../utils/pointer.utils';\r\nimport { DOCUMENT } from '@angular/common';\r\n\r\n@Component({\r\n    standalone: true,\r\n    selector: 'ktd-grid-item',\r\n    templateUrl: './grid-item.component.html',\r\n    styleUrls: ['./grid-item.component.scss'],\r\n    changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class KtdGridItemComponent implements OnInit, OnDestroy, AfterContentInit {\r\n    /** Elements that can be used to drag the grid item. */\r\n    @ContentChildren(KTD_GRID_DRAG_HANDLE, {descendants: true}) _dragHandles: QueryList<KtdGridDragHandle>;\r\n    @ContentChildren(KTD_GRID_RESIZE_HANDLE, {descendants: true}) _resizeHandles: QueryList<KtdGridResizeHandle>;\r\n    @ViewChild('resizeElem', {static: true, read: ElementRef}) resizeElem: ElementRef;\r\n\r\n    /** Template ref for placeholder */\r\n    @ContentChild(KTD_GRID_ITEM_PLACEHOLDER) placeholder: KtdGridItemPlaceholder;\r\n\r\n    /** Min and max size input properties. Any of these would 'override' the min/max values specified in the layout. */\r\n    @Input() minW?: number;\r\n    @Input() minH?: number;\r\n    @Input() maxW?: number;\r\n    @Input() maxH?: number;\r\n\r\n    /** CSS transition style. Note that for more performance is preferable only make transition on transform property. */\r\n    @Input() transition: string = 'transform 500ms ease, width 500ms ease, height 500ms ease';\r\n\r\n    /** Dynamically apply `touch-action` to the host element based on draggable */\r\n    @HostBinding('style.touch-action') get touchAction(): string {\r\n        return this._draggable ? 'none' : 'auto';\r\n    }\r\n\r\n    dragStart$: Observable<MouseEvent | TouchEvent>;\r\n    resizeStart$: Observable<MouseEvent | TouchEvent>;\r\n\r\n    /** Id of the grid item. This property is strictly compulsory. */\r\n    @Input()\r\n    get id(): string {\r\n        return this._id;\r\n    }\r\n\r\n    set id(val: string) {\r\n        this._id = val;\r\n    }\r\n\r\n    private _id: string;\r\n\r\n    /** Minimum amount of pixels that the user should move before it starts the drag sequence. */\r\n    @Input()\r\n    get dragStartThreshold(): number { return this._dragStartThreshold; }\r\n\r\n    set dragStartThreshold(val: number) {\r\n        this._dragStartThreshold = coerceNumberProperty(val);\r\n    }\r\n\r\n    private _dragStartThreshold: number = 0;\r\n\r\n\r\n    /** Whether the item is draggable or not. Defaults to true. Does not affect manual dragging using the startDragManually method. */\r\n    @Input()\r\n    get draggable(): boolean {\r\n        return this._draggable;\r\n    }\r\n\r\n    set draggable(val: boolean) {\r\n        this._draggable = coerceBooleanProperty(val);\r\n        this._draggable$.next(this._draggable);\r\n    }\r\n\r\n    private _draggable: boolean = true;\r\n    private _draggable$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(this._draggable);\r\n\r\n    private _manualDragEvents$: Subject<MouseEvent | TouchEvent> = new Subject<MouseEvent | TouchEvent>();\r\n\r\n    /** Whether the item is resizable or not. Defaults to true. */\r\n    @Input()\r\n    get resizable(): boolean {\r\n        return this._resizable;\r\n    }\r\n\r\n    set resizable(val: boolean) {\r\n        this._resizable = coerceBooleanProperty(val);\r\n        this._resizable$.next(this._resizable);\r\n    }\r\n\r\n    private _resizable: boolean = true;\r\n    private _resizable$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(this._resizable);\r\n\r\n    private dragStartSubject: Subject<MouseEvent | TouchEvent> = new Subject<MouseEvent | TouchEvent>();\r\n    private resizeStartSubject: Subject<MouseEvent | TouchEvent> = new Subject<MouseEvent | TouchEvent>();\r\n\r\n    private subscriptions: Subscription[] = [];\r\n\r\n    constructor(public elementRef: ElementRef,\r\n                private gridService: KtdGridService,\r\n                private renderer: Renderer2,\r\n                private ngZone: NgZone,\r\n                @Inject(DOCUMENT) private document: Document,\r\n                @Inject(GRID_ITEM_GET_RENDER_DATA_TOKEN) private getItemRenderData: KtdGridItemRenderDataTokenType) {\r\n        this.dragStart$ = this.dragStartSubject.asObservable();\r\n        this.resizeStart$ = this.resizeStartSubject.asObservable();\r\n    }\r\n\r\n    ngOnInit() {\r\n        const gridItemRenderData = this.getItemRenderData(this.id)!;\r\n        this.setStyles(gridItemRenderData);\r\n    }\r\n\r\n    ngAfterContentInit() {\r\n        this.subscriptions.push(\r\n            this._dragStart$().subscribe(this.dragStartSubject),\r\n            this._resizeStart$().subscribe(this.resizeStartSubject),\r\n        );\r\n    }\r\n\r\n    ngOnDestroy() {\r\n        this.subscriptions.forEach(sub => sub.unsubscribe());\r\n    }\r\n\r\n    /**\r\n     * To manually start dragging, route the desired pointer events to this method.\r\n     * Dragging initiated by this method will work regardless of the value of the draggable Input.\r\n     * It is the caller's responsibility to call this method with only the events that are desired to cause a drag.\r\n     * For example, if you only want left clicks to cause a drag, it is your responsibility to filter out other mouse button events.\r\n     * @param startEvent The pointer event that should initiate the drag.\r\n     */\r\n    startDragManually(startEvent: MouseEvent | TouchEvent) {\r\n        this._manualDragEvents$.next(startEvent);\r\n    }\r\n\r\n    setStyles({top, left, width, height}: { top: string, left: string, width?: string, height?: string }) {\r\n        // transform is 6x times faster than top/left\r\n        this.renderer.setStyle(this.elementRef.nativeElement, 'transform', `translateX(${left}) translateY(${top})`);\r\n        this.renderer.setStyle(this.elementRef.nativeElement, 'display', `block`);\r\n        this.renderer.setStyle(this.elementRef.nativeElement, 'transition', this.transition);\r\n        if (width != null) { this.renderer.setStyle(this.elementRef.nativeElement, 'width', width); }\r\n        if (height != null) {this.renderer.setStyle(this.elementRef.nativeElement, 'height', height); }\r\n    }\r\n\r\n    private _dragStart$(): Observable<MouseEvent | TouchEvent> {\r\n        return merge(\r\n            this._manualDragEvents$,\r\n            this._draggable$.pipe(\r\n                switchMap((draggable) => {\r\n                    if (!draggable) {\r\n                        return NEVER;\r\n                    }\r\n                    return this._dragHandles.changes.pipe(\r\n                        startWith(this._dragHandles),\r\n                        switchMap((dragHandles: QueryList<KtdGridDragHandle>) => {\r\n                            return iif(\r\n                                () => dragHandles.length > 0,\r\n                                merge(...dragHandles.toArray().map(dragHandle => ktdPointerDown(dragHandle.element.nativeElement))),\r\n                                ktdPointerDown(this.elementRef.nativeElement)\r\n                            )\r\n                        })\r\n                    );\r\n                })\r\n            )\r\n        ).pipe(\r\n            exhaustMap(startEvent => {\r\n                // If the event started from an element with the native HTML drag&drop, it'll interfere\r\n                // with our own dragging (e.g. `img` tags do it by default). Prevent the default action\r\n                // to stop it from happening. Note that preventing on `dragstart` also seems to work, but\r\n                // it's flaky and it fails if the user drags it away quickly. Also note that we only want\r\n                // to do this for `mousedown` and `pointerdown` since doing the same for `touchstart` will\r\n                // stop any `click` events from firing on touch devices.\r\n                if (ktdIsMouseEventOrMousePointerEvent(startEvent)) {\r\n                    startEvent.preventDefault();\r\n                }\r\n\r\n                const startPointer = ktdPointerClient(startEvent);\r\n                return this.gridService.mouseOrTouchMove$(this.document).pipe(\r\n                    takeUntil(ktdPointerUp(this.document)),\r\n                    ktdOutsideZone(this.ngZone),\r\n                    filter((moveEvent) => {\r\n                        moveEvent.preventDefault();\r\n                        const movePointer = ktdPointerClient(moveEvent);\r\n                        const distanceX = Math.abs(startPointer.clientX - movePointer.clientX);\r\n                        const distanceY = Math.abs(startPointer.clientY - movePointer.clientY);\r\n                        // When this conditions returns true mean that we are over threshold.\r\n                        return distanceX + distanceY >= this.dragStartThreshold;\r\n                    }),\r\n                    take(1),\r\n                    // Return the original start event\r\n                    map(() => startEvent)\r\n                );\r\n            })\r\n        );\r\n    }\r\n\r\n    private _resizeStart$(): Observable<MouseEvent | TouchEvent> {\r\n        return this._resizable$.pipe(\r\n            switchMap((resizable) => {\r\n                if (!resizable) {\r\n                    // Side effect to hide the resizeElem if resize is disabled.\r\n                    this.renderer.setStyle(this.resizeElem.nativeElement, 'display', 'none');\r\n                    return NEVER;\r\n                } else {\r\n                    return this._resizeHandles.changes.pipe(\r\n                        startWith(this._resizeHandles),\r\n                        switchMap((resizeHandles: QueryList<KtdGridResizeHandle>) => {\r\n                            if (resizeHandles.length > 0) {\r\n                                // Side effect to hide the resizeElem if there are resize handles.\r\n                                this.renderer.setStyle(this.resizeElem.nativeElement, 'display', 'none');\r\n                                return merge(...resizeHandles.toArray().map(resizeHandle => ktdPointerDown(resizeHandle.element.nativeElement)));\r\n                            } else {\r\n                                this.renderer.setStyle(this.resizeElem.nativeElement, 'display', 'block');\r\n                                return ktdPointerDown(this.resizeElem.nativeElement);\r\n                            }\r\n                        }),\r\n                        tap((startEvent) => {\r\n                            if (ktdIsMouseEventOrMousePointerEvent(startEvent)) {\r\n                                startEvent.preventDefault();\r\n                            }\r\n                        })\r\n                    );\r\n                }\r\n            })\r\n        );\r\n    }\r\n\r\n\r\n    static ngAcceptInputType_minW: NumberInput;\r\n    static ngAcceptInputType_minH: NumberInput;\r\n    static ngAcceptInputType_maxW: NumberInput;\r\n    static ngAcceptInputType_maxH: NumberInput;\r\n    static ngAcceptInputType_draggable: BooleanInput;\r\n    static ngAcceptInputType_resizable: BooleanInput;\r\n    static ngAcceptInputType_dragStartThreshold: NumberInput;\r\n\r\n}\r\n","<ng-content></ng-content>\r\n<div #resizeElem class=\"grid-item-resize-icon\"></div>","/**\r\n * Client rect utilities.\r\n * This file is taken from Angular Material repository.\r\n */\r\n\r\n/* eslint-disable */\r\n\r\nexport interface KtdClientRect {\r\n    top: number;\r\n    bottom: number;\r\n    left: number;\r\n    right: number;\r\n    width: number;\r\n    height: number;\r\n}\r\n\r\n/** Gets a mutable version of an element's bounding `ClientRect`. */\r\nexport function getMutableClientRect(element: Element): KtdClientRect {\r\n    const clientRect = element.getBoundingClientRect();\r\n\r\n    // We need to clone the `clientRect` here, because all the values on it are readonly\r\n    // and we need to be able to update them. Also we can't use a spread here, because\r\n    // the values on a `ClientRect` aren't own properties. See:\r\n    // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#Notes\r\n    return {\r\n        top: clientRect.top,\r\n        right: clientRect.right,\r\n        bottom: clientRect.bottom,\r\n        left: clientRect.left,\r\n        width: clientRect.width,\r\n        height: clientRect.height\r\n    };\r\n}\r\n\r\n/**\r\n * Checks whether some coordinates are within a `ClientRect`.\r\n * @param clientRect ClientRect that is being checked.\r\n * @param x Coordinates along the X axis.\r\n * @param y Coordinates along the Y axis.\r\n */\r\nexport function isInsideClientRect(clientRect: ClientRect, x: number, y: number) {\r\n    const {top, bottom, left, right} = clientRect;\r\n    return y >= top && y <= bottom && x >= left && x <= right;\r\n}\r\n\r\n/**\r\n * Updates the top/left positions of a `ClientRect`, as well as their bottom/right counterparts.\r\n * @param clientRect `ClientRect` that should be updated.\r\n * @param top Amount to add to the `top` position.\r\n * @param left Amount to add to the `left` position.\r\n */\r\nexport function adjustClientRect(clientRect: KtdClientRect, top: number, left: number) {\r\n    clientRect.top += top;\r\n    clientRect.bottom = clientRect.top + clientRect.height;\r\n\r\n    clientRect.left += left;\r\n    clientRect.right = clientRect.left + clientRect.width;\r\n}\r\n\r\n/**\r\n * Checks whether the pointer coordinates are close to a ClientRect.\r\n * @param rect ClientRect to check against.\r\n * @param threshold Threshold around the ClientRect.\r\n * @param pointerX Coordinates along the X axis.\r\n * @param pointerY Coordinates along the Y axis.\r\n */\r\nexport function isPointerNearClientRect(rect: KtdClientRect,\r\n                                        threshold: number,\r\n                                        pointerX: number,\r\n                                        pointerY: number): boolean {\r\n    const {top, right, bottom, left, width, height} = rect;\r\n    const xThreshold = width * threshold;\r\n    const yThreshold = height * threshold;\r\n\r\n    return pointerY > top - yThreshold && pointerY < bottom + yThreshold &&\r\n        pointerX > left - xThreshold && pointerX < right + xThreshold;\r\n}\r\n","import { animationFrameScheduler, fromEvent, interval, NEVER, Observable } from 'rxjs';\r\nimport { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\r\nimport { ktdNormalizePassiveListenerOptions } from './passive-listeners';\r\nimport { getMutableClientRect, KtdClientRect } from './client-rect';\r\nimport { ktdNoEmit } from './operators';\r\n\r\n/**\r\n * Proximity, as a ratio to width/height at which to start auto-scrolling.\r\n * The value comes from trying it out manually until it feels right.\r\n */\r\nconst SCROLL_PROXIMITY_THRESHOLD = 0.05;\r\n\r\n/** Vertical direction in which we can auto-scroll. */\r\nconst enum AutoScrollVerticalDirection {NONE, UP, DOWN}\r\n\r\n/** Horizontal direction in which we can auto-scroll. */\r\nconst enum AutoScrollHorizontalDirection {NONE, LEFT, RIGHT}\r\n\r\nexport interface KtdScrollPosition {\r\n    top: number;\r\n    left: number;\r\n}\r\n\r\n\r\n/**\r\n * Increments the vertical scroll position of a node.\r\n * @param node Node whose scroll position should change.\r\n * @param amount Amount of pixels that the `node` should be scrolled.\r\n */\r\nfunction incrementVerticalScroll(node: HTMLElement | Window, amount: number) {\r\n    if (node === window) {\r\n        (node as Window).scrollBy(0, amount);\r\n    } else {\r\n        // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\r\n        (node as HTMLElement).scrollTop += amount;\r\n    }\r\n}\r\n\r\n/**\r\n * Increments the horizontal scroll position of a node.\r\n * @param node Node whose scroll position should change.\r\n * @param amount Amount of pixels that the `node` should be scrolled.\r\n */\r\nfunction incrementHorizontalScroll(node: HTMLElement | Window, amount: number) {\r\n    if (node === window) {\r\n        (node as Window).scrollBy(amount, 0);\r\n    } else {\r\n        // Ideally we could use `Element.scrollBy` here as well, but IE and Edge don't support it.\r\n        (node as HTMLElement).scrollLeft += amount;\r\n    }\r\n}\r\n\r\n\r\n/**\r\n * Gets whether the vertical auto-scroll direction of a node.\r\n * @param clientRect Dimensions of the node.\r\n * @param pointerY Position of the user's pointer along the y axis.\r\n */\r\nfunction getVerticalScrollDirection(clientRect: KtdClientRect, pointerY: number) {\r\n    const {top, bottom, height} = clientRect;\r\n    const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;\r\n\r\n    if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {\r\n        return AutoScrollVerticalDirection.UP;\r\n    } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {\r\n        return AutoScrollVerticalDirection.DOWN;\r\n    }\r\n\r\n    return AutoScrollVerticalDirection.NONE;\r\n}\r\n\r\n/**\r\n * Gets whether the horizontal auto-scroll direction of a node.\r\n * @param clientRect Dimensions of the node.\r\n * @param pointerX Position of the user's pointer along the x axis.\r\n */\r\nfunction getHorizontalScrollDirection(clientRect: KtdClientRect, pointerX: number) {\r\n    const {left, right, width} = clientRect;\r\n    const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;\r\n\r\n    if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {\r\n        return AutoScrollHorizontalDirection.LEFT;\r\n    } else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {\r\n        return AutoScrollHorizontalDirection.RIGHT;\r\n    }\r\n\r\n    return AutoScrollHorizontalDirection.NONE;\r\n}\r\n\r\n/**\r\n * Returns an observable that schedules a loop and apply scroll on the scrollNode into the specified direction/s.\r\n * This observable doesn't emit, it just performs the 'scroll' side effect.\r\n * @param scrollNode, node where the scroll would be applied.\r\n * @param verticalScrollDirection, vertical direction of the scroll.\r\n * @param horizontalScrollDirection, horizontal direction of the scroll.\r\n * @param scrollStep, scroll step in CSS pixels that would be applied in every loop.\r\n */\r\nfunction scrollToDirectionInterval$(scrollNode: HTMLElement | Window, verticalScrollDirection: AutoScrollVerticalDirection, horizontalScrollDirection: AutoScrollHorizontalDirection, scrollStep: number = 2) {\r\n    return interval(0, animationFrameScheduler)\r\n        .pipe(\r\n            tap(() => {\r\n                if (verticalScrollDirection === AutoScrollVerticalDirection.UP) {\r\n                    incrementVerticalScroll(scrollNode, -scrollStep);\r\n                } else if (verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {\r\n                    incrementVerticalScroll(scrollNode, scrollStep);\r\n                }\r\n\r\n                if (horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {\r\n                    incrementHorizontalScroll(scrollNode, -scrollStep);\r\n                } else if (horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {\r\n                    incrementHorizontalScroll(scrollNode, scrollStep);\r\n                }\r\n            }),\r\n            ktdNoEmit()\r\n        );\r\n}\r\n\r\nexport interface KtdScrollIfNearElementOptions {\r\n    scrollStep?: number;\r\n    disableVertical?: boolean;\r\n    disableHorizontal?: boolean;\r\n}\r\n\r\n/**\r\n * Given a source$ observable with pointer location, scroll the scrollNode if the pointer is near to it.\r\n * This observable doesn't emit, it just performs a 'scroll' side effect.\r\n * @param scrollableParent, parent node in which the scroll would be performed.\r\n * @param options, configuration options.\r\n */\r\nexport function ktdScrollIfNearElementClientRect$(scrollableParent: HTMLElement | Document, options?: KtdScrollIfNearElementOptions): (source$: Observable<{ pointerX: number, pointerY: number }>) => Observable<any> {\r\n\r\n    let scrollNode: Window | HTMLElement;\r\n    let scrollableParentClientRect: KtdClientRect;\r\n    let scrollableParentScrollWidth: number;\r\n\r\n    if (scrollableParent === document) {\r\n        scrollNode = document.defaultView as Window;\r\n        const {width, height} = getViewportSize();\r\n        scrollableParentClientRect = {width, height, top: 0, right: width, bottom: height, left: 0};\r\n        scrollableParentScrollWidth = getDocumentScrollWidth();\r\n    } else {\r\n        scrollNode = scrollableParent as HTMLElement;\r\n        scrollableParentClientRect = getMutableClientRect(scrollableParent as HTMLElement);\r\n        scrollableParentScrollWidth = (scrollableParent as HTMLElement).scrollWidth;\r\n    }\r\n\r\n    /**\r\n     * IMPORTANT: By design, only let scroll horizontal if the scrollable parent has explicitly an scroll horizontal.\r\n     * This layout solution is not designed in mind to have any scroll horizontal, but exceptionally we allow it in this\r\n     * specific use case.\r\n     */\r\n    options = options || {};\r\n    if (options.disableHorizontal == null && scrollableParentScrollWidth <= scrollableParentClientRect.width) {\r\n        options.disableHorizontal = true;\r\n    }\r\n\r\n    return (source$) => source$.pipe(\r\n        map(({pointerX, pointerY}) => {\r\n            let verticalScrollDirection = getVerticalScrollDirection(scrollableParentClientRect, pointerY);\r\n            let horizontalScrollDirection = getHorizontalScrollDirection(scrollableParentClientRect, pointerX);\r\n\r\n            // Check if scroll directions are disabled.\r\n            if (options?.disableVertical) {\r\n                verticalScrollDirection = AutoScrollVerticalDirection.NONE;\r\n            }\r\n            if (options?.disableHorizontal) {\r\n                horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;\r\n            }\r\n\r\n            return {verticalScrollDirection, horizontalScrollDirection};\r\n        }),\r\n        distinctUntilChanged((prev, actual) => {\r\n            return prev.verticalScrollDirection === actual.verticalScrollDirection\r\n                && prev.horizontalScrollDirection === actual.horizontalScrollDirection;\r\n        }),\r\n        switchMap(({verticalScrollDirection, horizontalScrollDirection}) => {\r\n            if (verticalScrollDirection || horizontalScrollDirection) {\r\n                return scrollToDirectionInterval$(scrollNode, verticalScrollDirection, horizontalScrollDirection, options?.scrollStep);\r\n            } else {\r\n                return NEVER;\r\n            }\r\n        })\r\n    );\r\n}\r\n\r\n/**\r\n * Emits on EVERY scroll event and returns the accumulated scroll offset relative to the initial scroll position.\r\n * @param scrollableParent, node in which scroll events would be listened.\r\n */\r\nexport function ktdGetScrollTotalRelativeDifference$(scrollableParent: HTMLElement | Document): Observable<{ top: number, left: number }> {\r\n    let scrollInitialPosition;\r\n\r\n    // Calculate initial scroll position\r\n    if (scrollableParent === document) {\r\n        scrollInitialPosition = getViewportScrollPosition();\r\n    } else {\r\n        scrollInitialPosition = {\r\n            top: (scrollableParent as HTMLElement).scrollTop,\r\n            left: (scrollableParent as HTMLElement).scrollLeft\r\n        };\r\n    }\r\n\r\n    return fromEvent(scrollableParent, 'scroll', ktdNormalizePassiveListenerOptions({capture: true}) as AddEventListenerOptions).pipe(\r\n        map(() => {\r\n            let newTop: number;\r\n            let newLeft: number;\r\n\r\n            if (scrollableParent === document) {\r\n                const viewportScrollPosition = getViewportScrollPosition();\r\n                newTop = viewportScrollPosition.top;\r\n                newLeft = viewportScrollPosition.left;\r\n            } else {\r\n                newTop = (scrollableParent as HTMLElement).scrollTop;\r\n                newLeft = (scrollableParent as HTMLElement).scrollLeft;\r\n            }\r\n\r\n            const topDifference = scrollInitialPosition.top - newTop;\r\n            const leftDifference = scrollInitialPosition.left - newLeft;\r\n\r\n            return {top: topDifference, left: leftDifference};\r\n        })\r\n    );\r\n\r\n}\r\n\r\n/** Returns the viewport's width and height. */\r\nfunction getViewportSize(): { width: number, height: number } {\r\n    const _window = document.defaultView || window;\r\n    return {\r\n        width: _window.innerWidth,\r\n        height: _window.innerHeight\r\n    };\r\n\r\n}\r\n\r\n/** Gets a ClientRect for the viewport's bounds. */\r\nfunction getViewportRect(): KtdClientRect {\r\n    // Use the document element's bounding rect rather than the window scroll properties\r\n    // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\r\n    // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\r\n    // conceptual viewports. Under most circumstances these viewports are equivalent, but they\r\n    // can disagree when the page is pinch-zoomed (on devices that support touch).\r\n    // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\r\n    // We use the documentElement instead of the body because, by default (without a css reset)\r\n    // browsers typically give the document body an 8px margin, which is not included in\r\n    // getBoundingClientRect().\r\n    const scrollPosition = getViewportScrollPosition();\r\n    const {width, height} = getViewportSize();\r\n\r\n    return {\r\n        top: scrollPosition.top,\r\n        left: scrollPosition.left,\r\n        bottom: scrollPosition.top + height,\r\n        right: scrollPosition.left + width,\r\n        height,\r\n        width,\r\n    };\r\n}\r\n\r\n/** Gets the (top, left) scroll position of the viewport. */\r\nfunction getViewportScrollPosition(): { top: number, left: number } {\r\n\r\n    // The top-left-corner of the viewport is determined by the scroll position of the document\r\n    // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\r\n    // whether `document.body` or `document.documentElement` is the scrolled element, so reading\r\n    // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\r\n    // `document.documentElement` works consistently, where the `top` and `left` values will\r\n    // equal negative the scroll position.\r\n    const windowRef = document.defaultView || window;\r\n    const documentElement = document.documentElement!;\r\n    const documentRect = documentElement.getBoundingClientRect();\r\n\r\n    const top = -documentRect.top || document.body.scrollTop || windowRef.scrollY ||\r\n        documentElement.scrollTop || 0;\r\n\r\n    const left = -documentRect.left || document.body.scrollLeft || windowRef.scrollX ||\r\n        documentElement.scrollLeft || 0;\r\n\r\n    return {top, left};\r\n}\r\n\r\n/** Returns the document scroll width */\r\nfunction getDocumentScrollWidth() {\r\n    return Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);\r\n}\r\n\r\n","/**\r\n * Transition duration utilities.\r\n * This file is taken from Angular Material repository.\r\n */\r\n\r\n/* eslint-disable @katoid/prefix-exported-code */\r\n\r\n/** Parses a CSS time value to milliseconds. */\r\nfunction parseCssTimeUnitsToMs(value: string): number {\r\n  // Some browsers will return it in seconds, whereas others will return milliseconds.\r\n  const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\r\n  return parseFloat(value) * multiplier;\r\n}\r\n\r\n/** Gets the transform transition duration, including the delay, of an element in milliseconds. */\r\nexport function getTransformTransitionDurationInMs(element: HTMLElement): number {\r\n  const computedStyle = getComputedStyle(element);\r\n  const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\r\n  const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all');\r\n\r\n  // If there's no transition for `all` or `transform`, we shouldn't do anything.\r\n  if (!property) {\r\n    return 0;\r\n  }\r\n\r\n  // Get the index of the property that we're interested in and match\r\n  // it up to the same index in `transition-delay` and `transition-duration`.\r\n  const propertyIndex = transitionedProperties.indexOf(property);\r\n  const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\r\n  const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\r\n\r\n  return parseCssTimeUnitsToMs(rawDurations[propertyIndex]) +\r\n         parseCssTimeUnitsToMs(rawDelays[propertyIndex]);\r\n}\r\n\r\n/** Parses out multiple values from a computed style into an array. */\r\nfunction parseCssPropertyValue(computedStyle: CSSStyleDeclaration, name: string): string[] {\r\n  const value = computedStyle.getPropertyValue(name);\r\n  return value.split(',').map(part => part.trim());\r\n}\r\n","import {\r\n    AfterContentChecked, AfterContentInit, ChangeDetectionStrategy, Component, ContentChildren, ElementRef, EmbeddedViewRef, EventEmitter, Inject, Input,\r\n    NgZone, OnChanges, OnDestroy, Output, QueryList, Renderer2, SimpleChanges, ViewContainerRef, ViewEncapsulation\r\n} from '@angular/core';\r\nimport { coerceNumberProperty, NumberInput } from './coercion/number-property';\r\nimport { KtdGridItemComponent } from './grid-item/grid-item.component';\r\nimport { combineLatest, merge, NEVER, Observable, Observer, of, Subscription } from 'rxjs';\r\nimport { exhaustMap, map, startWith, switchMap, takeUntil } from 'rxjs/operators';\r\nimport { ktdGetGridItemRowHeight, ktdGridItemDragging, ktdGridItemLayoutItemAreEqual, ktdGridItemResizing, ktdGridItemsDragging } from './utils/grid.utils';\r\nimport { compact } from './utils/react-grid-layout.utils';\r\nimport {\r\n    GRID_ITEM_GET_RENDER_DATA_TOKEN, KtdGridBackgroundCfg, KtdGridCfg, KtdGridCompactType, KtdGridItemRect, KtdGridItemRenderData, KtdGridLayout, KtdGridLayoutItem\r\n} from './grid.definitions';\r\nimport { ktdPointerUp, ktdPointerClientX, ktdPointerClientY } from './utils/pointer.utils';\r\nimport { KtdDictionary } from '../types';\r\nimport { KtdGridService } from './grid.service';\r\nimport { getMutableClientRect, KtdClientRect } from './utils/client-rect';\r\nimport { ktdGetScrollTotalRelativeDifference$, ktdScrollIfNearElementClientRect$ } from './utils/scroll';\r\nimport { BooleanInput, coerceBooleanProperty } from './coercion/boolean-property';\r\nimport { KtdGridItemPlaceholder } from './directives/placeholder';\r\nimport { getTransformTransitionDurationInMs } from './utils/transition-duration';\r\nimport { DOCUMENT } from '@angular/common';\r\n\r\ninterface KtdDragResizeEvent {\r\n    layout: KtdGridLayout;\r\n    layoutItem: KtdGridLayoutItem;\r\n    gridItemRef: KtdGridItemComponent;\r\n    selectedItems?: {\r\n        layoutItem: KtdGridLayoutItem;\r\n        gridItemRef: KtdGridItemComponent;\r\n    }[];\r\n}\r\n\r\nexport type KtdDragStart = KtdDragResizeEvent;\r\nexport type KtdResizeStart = KtdDragResizeEvent;\r\nexport type KtdDragEnd = KtdDragResizeEvent;\r\nexport type KtdResizeEnd = KtdDragResizeEvent;\r\n\r\nexport interface KtdGridItemResizeEvent {\r\n    width: number;\r\n    height: number;\r\n    gridItemRef: KtdGridItemComponent;\r\n}\r\n\r\ntype DragActionType = 'drag' | 'resize';\r\n\r\nfunction getDragResizeEventData(gridItem: KtdGridItemComponent, layout: KtdGridLayout, multipleSelection?: KtdGridItemComponent[]): KtdDragResizeEvent {\r\n    return {\r\n        layout,\r\n        layoutItem: layout.find((item) => item.id === gridItem.id)!,\r\n        gridItemRef: gridItem,\r\n        selectedItems: multipleSelection && multipleSelection.map(selectedItem=>(\r\n            {\r\n                layoutItem: layout.find((layoutItem: KtdGridLayoutItem) => layoutItem.id === selectedItem.id)!,\r\n                gridItemRef: selectedItem\r\n            })\r\n        )\r\n    };\r\n}\r\n\r\nfunction getColumnWidth(config: KtdGridCfg, width: number): number {\r\n    const {cols, gap} = config;\r\n    const widthExcludingGap = width - Math.max((gap * (cols - 1)), 0);\r\n    return (widthExcludingGap / cols);\r\n}\r\n\r\nfunction getRowHeightInPixels(config: KtdGridCfg, height: number): number {\r\n    const {rowHeight, layout, gap} = config;\r\n    return rowHeight === 'fit' ? ktdGetGridItemRowHeight(layout, height, gap) : rowHeight;\r\n}\r\n\r\nfunction layoutToRenderItems(config: KtdGridCfg, width: number, height: number): KtdDictionary<KtdGridItemRenderData<number>> {\r\n    const {layout, gap} = config;\r\n    const rowHeightInPixels = getRowHeightInPixels(config, height);\r\n    const itemWidthPerColumn = getColumnWidth(config, width);\r\n    const renderItems: KtdDictionary<KtdGridItemRenderData<number>> = {};\r\n    for (const item of layout) {\r\n        renderItems[item.id] = {\r\n            id: item.id,\r\n            top: item.y * rowHeightInPixels + gap * item.y,\r\n            left: item.x * itemWidthPerColumn + gap * item.x,\r\n            width: item.w * itemWidthPerColumn + gap * Math.max(item.w - 1, 0),\r\n            height: item.h * rowHeightInPixels + gap * Math.max(item.h - 1, 0),\r\n        };\r\n    }\r\n    return renderItems;\r\n}\r\n\r\nfunction getGridHeight(layout: KtdGridLayout, rowHeight: number, gap: number): number {\r\n    return layout.reduce((acc, cur) => Math.max(acc, (cur.y + cur.h) * rowHeight + Math.max(cur.y + cur.h - 1, 0) * gap), 0);\r\n}\r\n\r\n// eslint-disable-next-line @katoid/prefix-exported-code\r\nexport function parseRenderItemToPixels(renderItem: KtdGridItemRenderData<number>): KtdGridItemRenderData<string> {\r\n    return {\r\n        id: renderItem.id,\r\n        top: `${renderItem.top}px`,\r\n        left: `${renderItem.left}px`,\r\n        width: `${renderItem.width}px`,\r\n        height: `${renderItem.height}px`\r\n    };\r\n}\r\n\r\n// eslint-disable-next-line @katoid/prefix-exported-code\r\nexport function __gridItemGetRenderDataFactoryFunc(gridCmp: KtdGridComponent) {\r\n    return function(id: string) {\r\n        return parseRenderItemToPixels(gridCmp.getItemRenderData(id));\r\n    };\r\n}\r\n\r\nexport function ktdGridItemGetRenderDataFactoryFunc(gridCmp: KtdGridComponent) {\r\n    // Workaround explained: https://github.com/ng-packagr/ng-packagr/issues/696#issuecomment-387114613\r\n    const resultFunc = __gridItemGetRenderDataFactoryFunc(gridCmp);\r\n    return resultFunc;\r\n}\r\n\r\nconst defaultBackgroundConfig: Required<Omit<KtdGridBackgroundCfg, 'show'>> = {\r\n    borderColor: '#ffa72678',\r\n    gapColor: 'transparent',\r\n    rowColor: 'transparent',\r\n    columnColor: 'transparent',\r\n    borderWidth: 1,\r\n};\r\n\r\n@Component({\r\n    standalone: true,\r\n    selector: 'ktd-grid',\r\n    templateUrl: './grid.component.html',\r\n    styleUrls: ['./grid.component.scss'],\r\n    encapsulation: ViewEncapsulation.None,\r\n    changeDetection: ChangeDetectionStrategy.OnPush,\r\n    providers: [\r\n        {\r\n            provide: GRID_ITEM_GET_RENDER_DATA_TOKEN,\r\n            useFactory: ktdGridItemGetRenderDataFactoryFunc,\r\n            deps: [KtdGridComponent]\r\n        }\r\n    ]\r\n})\r\nexport class KtdGridComponent implements OnChanges, AfterContentInit, AfterContentChecked, OnDestroy {\r\n    /** Query list of grid items that are being rendered. */\r\n    @ContentChildren(KtdGridItemComponent, {descendants: true}) _gridItems: QueryList<KtdGridItemComponent>;\r\n\r\n    /** Emits when layout change */\r\n    @Output() layoutUpdated: EventEmitter<KtdGridLayout> = new EventEmitter<KtdGridLayout>();\r\n\r\n    /** Emits when drag starts */\r\n    @Output() dragStarted: EventEmitter<KtdDragStart> = new EventEmitter<KtdDragStart>();\r\n\r\n    /** Emits when resize starts */\r\n    @Output() resizeStarted: EventEmitter<KtdResizeStart> = new EventEmitter<KtdResizeStart>();\r\n\r\n    /** Emits when drag ends */\r\n    @Output() dragEnded: EventEmitter<KtdDragEnd> = new EventEmitter<KtdDragEnd>();\r\n\r\n    /** Emits when resize ends */\r\n    @Output() resizeEnded: EventEmitter<KtdResizeEnd> = new EventEmitter<KtdResizeEnd>();\r\n\r\n    /** Emits when a grid item is being resized and its bounds have changed */\r\n    @Output() gridItemResize: EventEmitter<KtdGridItemResizeEvent> = new EventEmitter<KtdGridItemResizeEvent>();\r\n\r\n    /**\r\n     * Parent element that contains the scroll. If an string is provided it would search that element by id on the dom.\r\n     * If no data provided or null autoscroll is not performed.\r\n     */\r\n    @Input() scrollableParent: HTMLElement | Document | string | null = null;\r\n\r\n    /** Whether or not to update the internal layout when some dependent property change. */\r\n    @Input()\r\n    get compactOnPropsChange(): boolean { return this._compactOnPropsChange; }\r\n\r\n    set compactOnPropsChange(value: boolean) {\r\n        this._compactOnPropsChange = coerceBooleanProperty(value);\r\n    }\r\n\r\n    private _compactOnPropsChange: boolean = true;\r\n\r\n    /** If true, grid items won't change position when being dragged over. Handy when using no compaction */\r\n    @Input()\r\n    get preventCollision(): boolean { return this._preventCollision; }\r\n\r\n    set preventCollision(value: boolean) {\r\n        this._preventCollision = coerceBooleanProperty(value);\r\n    }\r\n\r\n    private _preventCollision: boolean = false;\r\n\r\n    /** Number of CSS pixels that would be scrolled on each 'tick' when auto scroll is performed. */\r\n    @Input()\r\n    get scrollSpeed(): number { return this._scrollSpeed; }\r\n\r\n    set scrollSpeed(value: number) {\r\n        this._scrollSpeed = coerceNumberProperty(value, 2);\r\n    }\r\n\r\n    private _scrollSpeed: number = 2;\r\n\r\n    /** Type of compaction that will be applied to the layout (vertical, horizontal or free). Defaults to 'vertical' */\r\n    @Input()\r\n    get compactType(): KtdGridCompactType {\r\n        return this._compactType;\r\n    }\r\n\r\n    set compactType(val: KtdGridCompactType) {\r\n        this._compactType = val;\r\n    }\r\n\r\n    private _compactType: KtdGridCompactType = 'vertical';\r\n\r\n    /**\r\n     * Row height as number or as 'fit'.\r\n     * If rowHeight is a number value, it means that each row would have those css pixels in height.\r\n     * if rowHeight is 'fit', it means that rows will fit in the height available. If 'fit' value is set, a 'height' should be also provided.\r\n     */\r\n    @Input()\r\n    get rowHeight(): number | 'fit' { return this._rowHeight; }\r\n\r\n    set rowHeight(val: number | 'fit') {\r\n        this._rowHeight = val === 'fit' ? val : Math.max(1, Math.round(coerceNumberProperty(val)));\r\n    }\r\n\r\n    private _rowHeight: number | 'fit' = 100;\r\n\r\n    /** Number of columns  */\r\n    @Input()\r\n    get cols(): number { return this._cols; }\r\n\r\n    set cols(val: number) {\r\n        this._cols = Math.max(1, Math.round(coerceNumberProperty(val)));\r\n    }\r\n\r\n    private _cols: number = 6;\r\n\r\n    /** Layout of the grid. Array of all the grid items with its 'id' and position on the grid. */\r\n    @Input()\r\n    get layout(): KtdGridLayout { return this._layout; }\r\n\r\n    set layout(layout: KtdGridLayout) {\r\n        /**\r\n         * Enhancement:\r\n         * Only set layout if it's reference has changed and use a boolean to track whenever recalculate the layout on ngOnChanges.\r\n         *\r\n         * Why:\r\n         * The normal use of this lib is having the variable layout in the outer component or in a store, assigning it whenever it changes and\r\n         * binded in the component with it's input [layout]. In this scenario, we would always calculate one unnecessary change on the layout when\r\n         * it is re-binded on the input.\r\n         */\r\n        this._layout = layout;\r\n    }\r\n\r\n    private _layout: KtdGridLayout;\r\n\r\n    /** Grid gap in css pixels */\r\n    @Input()\r\n    get gap(): number {\r\n        return this._gap;\r\n    }\r\n\r\n    set gap(val: number) {\r\n        this._gap = Math.max(coerceNumberProperty(val), 0);\r\n    }\r\n\r\n    private _gap: number = 0;\r\n\r\n\r\n    /**\r\n     * If height is a number, fixes the height of the grid to it, recommended when rowHeight = 'fit' is used.\r\n     * If height is null, height will be automatically set according to its inner grid items.\r\n     * Defaults to null.\r\n     * */\r\n    @Input()\r\n    get height(): number | null {\r\n        return this._height;\r\n    }\r\n\r\n    set height(val: number | null) {\r\n        this._height = typeof val === 'number' ? Math.max(val, 0) : null;\r\n    }\r\n\r\n    private _height: number | null = null;\r\n\r\n    /**\r\n     * Multiple items drag/resize\r\n     * A list of selected items to move (drag or resize) together as a group.\r\n     * The multi-selection of items is managed externally. By default, the library manages a single item, but if a set of item IDs is provided, the specified group will be handled as a unit.\"\r\n     */\r\n    @Input()\r\n    get selectedItemsIds(): string[] | null {\r\n        return this._selectedItemsIds;\r\n    }\r\n\r\n    set selectedItemsIds(val: string[] | null) {\r\n        this._selectedItemsIds = val;\r\n        if(val){\r\n            this.selectedItems = val.map(\r\n                (layoutItemId: string) =>\r\n                    this._gridItems.find(\r\n                        (gridItem: KtdGridItemComponent) =>\r\n                            gridItem.id === layoutItemId\r\n                    )!\r\n            );\r\n        } else {\r\n            this.selectedItems = undefined;\r\n        }\r\n    }\r\n\r\n    private _selectedItemsIds: string[] | null;\r\n    selectedItems: KtdGridItemComponent[] | undefined;\r\n\r\n\r\n    @Input()\r\n    get backgroundConfig(): KtdGridBackgroundCfg | null {\r\n        return this._backgroundConfig;\r\n    }\r\n\r\n    set backgroundConfig(val: KtdGridBackgroundCfg | null) {\r\n        this._backgroundConfig = val;\r\n\r\n        // If there is background configuration, add main grid background class. Grid background class comes with opacity 0.\r\n        // It is done this way for adding opacity animation and to don't add any styles when grid background is null.\r\n        const classList = (this.elementRef.nativeElement as HTMLDivElement).classList;\r\n        this._backgroundConfig !== null ? classList.add('ktd-grid-background') : classList.remove('ktd-grid-background');\r\n\r\n        // Set background visibility\r\n        this.setGridBackgroundVisible(this._backgroundConfig?.show === 'always');\r\n    }\r\n\r\n    private _backgroundConfig: KtdGridBackgroundCfg | null = null;\r\n\r\n    private gridCurrentHeight: number;\r\n\r\n    get config(): KtdGridCfg {\r\n        return {\r\n            cols: this.cols,\r\n            rowHeight: this.rowHeight,\r\n            height: this.height,\r\n            layout: this.layout,\r\n            preventCollision: this.preventCollision,\r\n            gap: this.gap,\r\n        };\r\n    }\r\n\r\n    /** References to the views of the placeholder elements. */\r\n    private placeholderRef: KtdDictionary<EmbeddedViewRef<any> | null>={};\r\n\r\n    /** Elements that are rendered as placeholder when a list of grid items are being dragged */\r\n    private placeholder: KtdDictionary<HTMLElement | null>={};\r\n\r\n    private _gridItemsRenderData: KtdDictionary<KtdGridItemRenderData<number>>;\r\n    private subscriptions: Subscription[] = [];\r\n\r\n    constructor(private gridService: KtdGridService,\r\n                private elementRef: ElementRef,\r\n                private viewContainerRef: ViewContainerRef,\r\n                private renderer: Renderer2,\r\n                private ngZone: NgZone,\r\n                @Inject(DOCUMENT) private document: Document) {\r\n\r\n    }\r\n\r\n    ngOnChanges(changes: SimpleChanges) {\r\n\r\n        if (this.rowHeight === 'fit' && this.height == null) {\r\n            console.warn(`KtdGridComponent: The @Input() height should not be null when using rowHeight 'fit'`);\r\n        }\r\n\r\n        let needsCompactLayout = false;\r\n        let needsRecalculateRenderData = false;\r\n\r\n        // TODO: Does fist change need to be compacted by default?\r\n        // Compact layout whenever some dependent prop changes.\r\n        if (changes.compactType || changes.cols || changes.layout) {\r\n            needsCompactLayout = true;\r\n        }\r\n\r\n        // Check if wee need to recalculate rendering data.\r\n        if (needsCompactLayout || changes.rowHeight || changes.height || changes.gap || changes.backgroundConfig) {\r\n            needsRecalculateRenderData = true;\r\n        }\r\n\r\n        // Only compact layout if lib user has provided it. Lib users that want to save/store always the same layout  as it is represented (compacted)\r\n        // can use KtdCompactGrid utility and pre-compact the layout. This is the recommended behaviour for always having a the same layout on this component\r\n        // and the ones that uses it.\r\n        if (needsCompactLayout && this.compactOnPropsChange) {\r\n            this.compactLayout();\r\n        }\r\n\r\n        if (needsRecalculateRenderData) {\r\n            this.calculateRenderData();\r\n        }\r\n    }\r\n\r\n    ngAfterContentInit() {\r\n        this.initSubscriptions();\r\n    }\r\n\r\n    ngAfterContentChecked() {\r\n        this.render();\r\n    }\r\n\r\n    resize() {\r\n        this.calculateRenderData();\r\n        this.render();\r\n    }\r\n\r\n    ngOnDestroy() {\r\n        this.subscriptions.forEach(sub => sub.unsubscribe());\r\n    }\r\n\r\n    compactLayout() {\r\n        this.layout = compact(this.layout, this.compactType, this.cols);\r\n    }\r\n\r\n    getItemsRenderData(): KtdDictionary<KtdGridItemRenderData<number>> {\r\n        return {...this._gridItemsRenderData};\r\n    }\r\n\r\n    getItemRenderData(itemId: string): KtdGridItemRenderData<number> {\r\n        return this._gridItemsRenderData[itemId];\r\n    }\r\n\r\n    calculateRenderData() {\r\n        const clientRect = (this.elementRef.nativeElement as HTMLElement).getBoundingClientRect();\r\n        this.gridCurrentHeight = this.height ?? (this.rowHeight === 'fit' ? clientRect.height : getGridHeight(this.layout, this.rowHeight, this.gap));\r\n        this._gridItemsRenderData = layoutToRenderItems(this.config, clientRect.width, this.gridCurrentHeight);\r\n\r\n        // Set Background CSS variables\r\n        this.setBackgroundCssVariables(getRowHeightInPixels(this.config, this.gridCurrentHeight));\r\n    }\r\n\r\n    render() {\r\n        this.renderer.setStyle(this.elementRef.nativeElement, 'height', `${this.gridCurrentHeight}px`);\r\n        this.updateGridItemsStyles();\r\n    }\r\n\r\n    private setBackgroundCssVariables(rowHeight: number) {\r\n        const style = (this.elementRef.nativeElement as HTMLDivElement).style;\r\n\r\n        if (this._backgroundConfig) {\r\n            // structure\r\n            style.setProperty('--gap', this.gap + 'px');\r\n            style.setProperty('--row-height', rowHeight + 'px');\r\n            style.setProperty('--columns', `${this.cols}`);\r\n            style.setProperty('--border-width', (this._backgroundConfig.borderWidth ?? defaultBackgroundConfig.borderWidth) + 'px');\r\n\r\n            // colors\r\n            style.setProperty('--border-color', this._backgroundConfig.borderColor ?? defaultBackgroundConfig.borderColor);\r\n            style.setProperty('--gap-color', this._backgroundConfig.gapColor ?? defaultBackgroundConfig.gapColor);\r\n            style.setProperty('--row-color', this._backgroundConfig.rowColor ?? defaultBackgroundConfig.rowColor);\r\n            style.setProperty('--column-color', this._backgroundConfig.columnColor ?? defaultBackgroundConfig.columnColor);\r\n        } else {\r\n            style.removeProperty('--gap');\r\n            style.removeProperty('--row-height');\r\n            style.removeProperty('--columns');\r\n            style.removeProperty('--border-width');\r\n            style.removeProperty('--border-color');\r\n            style.removeProperty('--gap-color');\r\n            style.removeProperty('--row-color');\r\n            style.removeProperty('--column-color');\r\n        }\r\n    }\r\n\r\n    private updateGridItemsStyles() {\r\n                this._gridItems.forEach(item => {\r\n            const gridItemRenderData: KtdGridItemRenderData<number> | undefined = this._gridItemsRenderData[item.id];\r\n            if (gridItemRenderData == null) {\r\n                console.error(`Couldn\\'t find the specified grid item for the id: ${item.id}`);\r\n            } else {\r\n                item.setStyles(parseRenderItemToPixels(gridItemRenderData));\r\n            }\r\n        });\r\n    }\r\n\r\n\r\n    private setGridBackgroundVisible(visible: boolean) {\r\n        const classList = (this.elementRef.nativeElement as HTMLDivElement).classList;\r\n        visible ? classList.add('ktd-grid-background-visible') : classList.remove('ktd-grid-background-visible');\r\n    }\r\n\r\n    private initSubscriptions() {\r\n        this.subscriptions = [\r\n            this._gridItems.changes.pipe(\r\n                startWith(this._gridItems),\r\n                switchMap((gridItems: QueryList<KtdGridItemComponent>) => {\r\n                    return merge(\r\n                        ...gridItems.map((gridItem) => gridItem.dragStart$.pipe(map((event) => ({event, gridItem, type: 'drag' as DragActionType})))),\r\n                        ...gridItems.map((gridItem) => gridItem.resizeStart$.pipe(map((event) => ({\r\n                            event,\r\n                            gridItem,\r\n                            type: 'resize' as DragActionType\r\n                        })))),\r\n                    ).pipe(exhaustMap(({event, gridItem, type}) => {\r\n                        const multipleSelection: KtdGridItemComponent[] | undefined = this.selectedItems && [...this.selectedItems];\r\n                        // Emit drag or resize start events. Ensure that is start event is inside the zone.\r\n                        this.ngZone.run(() => (type === 'drag' ? this.dragStarted : this.resizeStarted).emit(getDragResizeEventData(gridItem, this.layout, multipleSelection)));\r\n                        this.setGridBackgroundVisible(this._backgroundConfig?.show === 'whenDragging' || this._backgroundConfig?.show === 'always');\r\n                        // Perform drag sequence\r\n                        let gridItemsSelected: KtdGridItemComponent[] = [gridItem];\r\n                        if (multipleSelection && multipleSelection.some((currItem) => currItem.id === gridItem.id)) {\r\n                            gridItemsSelected = multipleSelection\r\n                        }\r\n                        return this.performDragSequence$(gridItemsSelected, event, type).pipe(\r\n                            map((layout) => ({layout, gridItem, type, multipleSelection})));\r\n\r\n                    }));\r\n                })\r\n            ).subscribe(({layout, gridItem, type, multipleSelection} : {layout: KtdGridLayout, gridItem: KtdGridItemComponent, type: DragActionType, multipleSelection?: KtdGridItemComponent[]}) => {\r\n                this.layout = layout;\r\n                // Calculate new rendering data given the new layout.\r\n                this.calculateRenderData();\r\n                // Emit drag or resize end events.\r\n                (type === 'drag' ? this.dragEnded : this.resizeEnded).emit(getDragResizeEventData(gridItem, layout, multipleSelection));\r\n                // Notify that the layout has been updated.\r\n                this.layoutUpdated.emit(layout);\r\n\r\n                this.setGridBackgroundVisible(this._backgroundConfig?.show === 'always');\r\n            })\r\n\r\n        ];\r\n    }\r\n\r\n    /**\r\n     * Perform a general grid drag action, from start to end. A general grid drag action basically includes creating the placeholder element and adding\r\n     * some class animations. calcNewStateFunc needs to be provided in order to calculate the new state of the layout.\r\n     * @param gridItem that is been dragged\r\n     * @param pointerDownEvent event (mousedown or touchdown) where the user initiated the drag\r\n     * @param calcNewStateFunc function that return the new layout state and the drag element position\r\n     */\r\n    private performDragSequence$(gridItems: KtdGridItemComponent[], pointerDownEvent: MouseEvent | TouchEvent, type: DragActionType): Observable<KtdGridLayout> {\r\n\r\n        return new Observable<KtdGridLayout>((observer: Observer<KtdGridLayout>) => {\r\n            const scrollableParent = typeof this.scrollableParent === 'string' ? this.document.getElementById(this.scrollableParent) : this.scrollableParent;\r\n            // Retrieve grid (parent) client rect.\r\n            const gridElemClientRect: KtdClientRect = getMutableClientRect(this.elementRef.nativeElement as HTMLElement);\r\n\r\n            const dragElemClientRect: KtdDictionary<KtdClientRect> = {};\r\n            const newGridItemRenderData: KtdDictionary<KtdGridItemRenderData<number>> = {};\r\n            let draggedItemsPos: KtdDictionary<KtdGridItemRect> = {};\r\n\r\n            gridItems.forEach((gridItem)=>{\r\n                // Retrieve gridItem (draggedElem) client rect.\r\n                dragElemClientRect[gridItem.id] = getMutableClientRect(gridItem.elementRef.nativeElement as HTMLElement);\r\n                this.renderer.addClass(gridItem.elementRef.nativeElement, 'no-transitions');\r\n                this.renderer.addClass(gridItem.elementRef.nativeElement, 'ktd-grid-item-dragging');\r\n                const placeholderClientRect: KtdClientRect = {\r\n                    ...dragElemClientRect[gridItem.id],\r\n                    left: dragElemClientRect[gridItem.id].left - gridElemClientRect.left,\r\n                    top: dragElemClientRect[gridItem.id].top - gridElemClientRect.top\r\n                }\r\n                this.createPlaceholderElement(gridItem.id, placeholderClientRect, gridItem.placeholder);\r\n            });\r\n\r\n            let newLayout: KtdGridLayoutItem[];\r\n\r\n            // TODO (enhancement): consider move this 'side effect' observable inside the main drag loop.\r\n            //  - Pros are that we would not repeat subscriptions and takeUntil would shut down observables at the same time.\r\n            //  - Cons are that moving this functionality as a side effect inside the main drag loop would be confusing.\r\n            const scrollSubscription = this.ngZone.runOutsideAngular(() =>\r\n                (!scrollableParent ? NEVER : this.gridService.mouseOrTouchMove$(this.document).pipe(\r\n                    map((event) => ({\r\n                        pointerX: ktdPointerClientX(event),\r\n                        pointerY: ktdPointerClientY(event)\r\n                    })),\r\n                    ktdScrollIfNearElementClientRect$(scrollableParent, {scrollStep: this.scrollSpeed})\r\n                )).pipe(\r\n                    takeUntil(ktdPointerUp(this.document))\r\n                ).subscribe());\r\n\r\n            /**\r\n             * Main subscription, it listens for 'pointer move' and 'scroll' events and recalculates the layout on each emission\r\n             */\r\n            const subscription = this.ngZone.runOutsideAngular(() =>\r\n                merge(\r\n                    combineLatest([\r\n                        this.gridService.mouseOrTouchMove$(this.document),\r\n                        ...(!scrollableParent ? [of({top: 0, left: 0})] : [\r\n                            ktdGetScrollTotalRelativeDifference$(scrollableParent).pipe(\r\n                                startWith({top: 0, left: 0}) // Force first emission to allow CombineLatest to emit even no scroll event has occurred\r\n                            )\r\n                        ])\r\n                    ])\r\n                ).pipe(\r\n                    takeUntil(ktdPointerUp(this.document)),\r\n                ).subscribe(([pointerDragEvent, scrollDifference]: [MouseEvent | TouchEvent | PointerEvent, { top: number, left: number }]) => {\r\n                        pointerDragEvent.preventDefault();\r\n                        /**\r\n                         * Set the new layout to be the layout in which the calcNewStateFunc would be executed.\r\n                         * NOTE: using the mutated layout is the way to go by 'react-grid-layout' utils. If we don't use the previous layout,\r\n                         * some utilities from 'react-grid-layout' would not work as expected.\r\n                         */\r\n                        const currentLayout: KtdGridLayout = newLayout || this.layout;\r\n                        // Get the correct newStateFunc depending on if we are dragging or resizing\r\n                        if (type === 'drag' && gridItems.length > 1) {\r\n                            const {layout, draggedItemPos} = ktdGridItemsDragging(gridItems, {\r\n                                layout: currentLayout,\r\n                                rowHeight: this.rowHeight,\r\n                                height: this.height,\r\n                                cols: this.cols,\r\n                                preventCollision: this.preventCollision,\r\n                                gap: this.gap,\r\n                            }, this.compactType, {\r\n                                pointerDownEvent,\r\n                                pointerDragEvent,\r\n                                gridElemClientRect,\r\n                                dragElementsClientRect: dragElemClientRect,\r\n                                scrollDifference\r\n                            });\r\n                            newLayout = layout;\r\n                            draggedItemsPos = draggedItemPos;\r\n                        }  else {\r\n                            const calcNewStateFunc = type === 'drag' ? ktdGridItemDragging : ktdGridItemResizing;\r\n                            newLayout = currentLayout;\r\n                            gridItems.forEach((gridItem)=>{\r\n                                const {layout, draggedItemPos} = calcNewStateFunc(gridItem, {\r\n                                    layout: newLayout,\r\n                                    rowHeight: this.rowHeight,\r\n                                    height: this.height,\r\n                                    cols: this.cols,\r\n                                    preventCollision: this.preventCollision,\r\n                                    gap: this.gap,\r\n                                }, this.compactType, {\r\n                                    pointerDownEvent,\r\n                                    pointerDragEvent,\r\n                                    gridElemClientRect,\r\n                                    dragElemClientRect: dragElemClientRect[gridItem.id],\r\n                                    scrollDifference\r\n                                });\r\n                                newLayout = layout;\r\n                                draggedItemsPos[gridItem.id]=draggedItemPos;\r\n                            });\r\n                        }\r\n\r\n                        this.gridCurrentHeight = this.height ?? (this.rowHeight === 'fit' ? gridElemClientRect.height : getGridHeight(newLayout, this.rowHeight, this.gap))\r\n                        this._gridItemsRenderData = layoutToRenderItems({\r\n                            cols: this.cols,\r\n                            rowHeight: this.rowHeight,\r\n                            height: this.height,\r\n                            layout: newLayout,\r\n                            preventCollision: this.preventCollision,\r\n                            gap: this.gap,\r\n                        }, gridElemClientRect.width, gridElemClientRect.height);\r\n\r\n                        // Modify the position of the dragged item to be the once we want (for example the mouse position or whatever)\r\n                        gridItems.forEach((gridItem)=>{\r\n                            newGridItemRenderData[gridItem.id] = {...this._gridItemsRenderData[gridItem.id]}\r\n                            const placeholderStyles = parseRenderItemToPixels(newGridItemRenderData[gridItem.id]);\r\n\r\n                            // Put the real final position to the placeholder element\r\n                            this.placeholder[gridItem.id]!.style.width = placeholderStyles.width;\r\n                            this.placeholder[gridItem.id]!.style.height = placeholderStyles.height;\r\n                            this.placeholder[gridItem.id]!.style.transform = `translateX(${placeholderStyles.left}) translateY(${placeholderStyles.top})`;\r\n\r\n                            this._gridItemsRenderData[gridItem.id] = {\r\n                                ...draggedItemsPos[gridItem.id],\r\n                                id: this._gridItemsRenderData[gridItem.id].id\r\n                            };\r\n                        });\r\n\r\n                        this.setBackgroundCssVariables(this.rowHeight === 'fit' ? ktdGetGridItemRowHeight(newLayout, gridElemClientRect.height, this.gap) : this.rowHeight);\r\n                        this.render();\r\n\r\n                        gridItems.forEach((gridItem)=>{\r\n                            // If we are performing a resize, and bounds have changed, emit event.\r\n                            // NOTE: Only emit on resize for now. Use case for normal drag is not justified for now. Emitting on resize is, since we may want to re-render the grid item or the placeholder in order to fit the new bounds.\r\n                            if (type === 'resize') {\r\n                                const prevGridItem = currentLayout.find(item => item.id === gridItem.id)!;\r\n                                const newGridItem = newLayout.find(item => item.id === gridItem.id)!;\r\n                                // Check if item resized has changed, if so, emit resize change event\r\n                                if (!ktdGridItemLayoutItemAreEqual(prevGridItem, newGridItem)) {\r\n                                    this.gridItemResize.emit({\r\n                                        width: newGridItemRenderData[gridItem.id].width,\r\n                                        height: newGridItemRenderData[gridItem.id].height,\r\n                                        gridItemRef: getDragResizeEventData(gridItem, newLayout).gridItemRef as KtdGridItemComponent\r\n                                    });\r\n                                }\r\n                            }\r\n                        });\r\n                    },\r\n                    (error) => observer.error(error),\r\n                    () => {\r\n                        this.ngZone.run(() => {\r\n                            gridItems.forEach((gridItem)=>{\r\n                                // Remove drag classes\r\n                                this.renderer.removeClass(gridItem.elementRef.nativeElement, 'no-transitions');\r\n                                this.renderer.removeClass(gridItem.elementRef.nativeElement, 'ktd-grid-item-dragging');\r\n\r\n                                this.addGridItemAnimatingClass(gridItem).subscribe();\r\n                                // Consider destroying the placeholder after the animation has finished.\r\n                                this.destroyPlaceholder(gridItem.id);\r\n                            });\r\n\r\n                            if (newLayout) {\r\n                                // TODO: newLayout should already be pruned. If not, it should have type Layout, not KtdGridLayout as it is now.\r\n                                // Prune react-grid-layout compact extra properties.\r\n                                observer.next(newLayout.map(item => ({\r\n                                    id: item.id,\r\n                                    x: item.x,\r\n                                    y: item.y,\r\n                                    w: item.w,\r\n                                    h: item.h,\r\n                                    minW: item.minW,\r\n                                    minH: item.minH,\r\n                                    maxW: item.maxW,\r\n                                    maxH: item.maxH,\r\n                                })) as KtdGridLayout);\r\n                            } else {\r\n                                // TODO: Need we really to emit if there is no layout change but drag started and ended?\r\n                                observer.next(this.layout);\r\n                            }\r\n\r\n                            observer.complete();\r\n                        });\r\n\r\n                    }));\r\n\r\n\r\n            return () => {\r\n                scrollSubscription.unsubscribe();\r\n                subscription.unsubscribe();\r\n            };\r\n        });\r\n    }\r\n\r\n\r\n    /**\r\n     * It adds the `ktd-grid-item-animating` class and removes it when the animated transition is complete.\r\n     * This function is meant to be executed when the drag has ended.\r\n     * @param gridItem that has been dragged\r\n     */\r\n    private addGridItemAnimatingClass(gridItem: KtdGridItemComponent): Observable<undefined> {\r\n\r\n        return new Observable(observer => {\r\n\r\n            const duration = getTransformTransitionDurationInMs(gridItem.elementRef.nativeElement);\r\n\r\n            if (duration === 0) {\r\n                observer.next();\r\n                observer.complete();\r\n                return;\r\n            }\r\n\r\n            this.renderer.addClass(gridItem.elementRef.nativeElement, 'ktd-grid-item-animating');\r\n            const handler = ((event: TransitionEvent) => {\r\n                if (!event || (event.target === gridItem.elementRef.nativeElement && event.propertyName === 'transform')) {\r\n                    this.renderer.removeClass(gridItem.elementRef.nativeElement, 'ktd-grid-item-animating');\r\n                    removeEventListener();\r\n                    clearTimeout(timeout);\r\n                    observer.next();\r\n                    observer.complete();\r\n                }\r\n            }) as EventListener;\r\n\r\n            // If a transition is short enough, the browser might not fire the `transitionend` event.\r\n            // Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll\r\n            // fire if the transition hasn't completed when it was supposed to.\r\n            const timeout = setTimeout(handler, duration * 1.5);\r\n            const removeEventListener = this.renderer.listen(gridItem.elementRef.nativeElement, 'transitionend', handler);\r\n        })\r\n    }\r\n\r\n    /** Creates placeholder element */\r\n    private createPlaceholderElement(gridItemId: string, clientRect: KtdClientRect, gridItemPlaceholder?: KtdGridItemPlaceholder) {\r\n        this.placeholder[gridItemId] = this.renderer.createElement('div');\r\n        this.placeholder[gridItemId]!.style.width = `${clientRect.width}px`;\r\n        this.placeholder[gridItemId]!.style.height = `${clientRect.height}px`;\r\n        this.placeholder[gridItemId]!.style.transform = `translateX(${clientRect.left}px) translateY(${clientRect.top}px)`;\r\n        this.placeholder[gridItemId]!.classList.add('ktd-grid-item-placeholder');\r\n        this.renderer.appendChild(this.elementRef.nativeElement, this.placeholder[gridItemId]);\r\n\r\n        // Create and append custom placeholder if provided.\r\n        // Important: Append it after creating & appending the container placeholder. This way we ensure parent bounds are set when creating the embeddedView.\r\n        if (gridItemPlaceholder) {\r\n            this.placeholderRef[gridItemId] = this.viewContainerRef.createEmbeddedView(\r\n                gridItemPlaceholder.templateRef,\r\n                gridItemPlaceholder.data\r\n            );\r\n            this.placeholderRef[gridItemId]!.rootNodes.forEach(node => this.placeholder[gridItemId]!.appendChild(node));\r\n            this.placeholderRef[gridItemId]!.detectChanges();\r\n        } else {\r\n            this.placeholder[gridItemId]!.classList.add('ktd-grid-item-placeholder-default');\r\n        }\r\n    }\r\n\r\n    /** Destroys the placeholder element and its ViewRef. */\r\n    private destroyPlaceholder(gridItemId: string) {\r\n        this.placeholder[gridItemId]?.remove();\r\n        this.placeholderRef[gridItemId]?.destroy();\r\n        this.placeholder[gridItemId] = this.placeholderRef[gridItemId] = null!;\r\n    }\r\n\r\n    static ngAcceptInputType_cols: NumberInput;\r\n    static ngAcceptInputType_rowHeight: NumberInput;\r\n    static ngAcceptInputType_scrollSpeed: NumberInput;\r\n    static ngAcceptInputType_compactOnPropsChange: BooleanInput;\r\n    static ngAcceptInputType_preventCollision: BooleanInput;\r\n}\r\n\r\n","<ng-content></ng-content>","import { NgModule } from '@angular/core';\r\nimport { KtdGridComponent } from './grid.component';\r\nimport { KtdGridItemComponent } from './grid-item/grid-item.component';\r\nimport { KtdGridDragHandle } from './directives/drag-handle';\r\nimport { KtdGridResizeHandle } from './directives/resize-handle';\r\nimport { KtdGridService } from './grid.service';\r\nimport { KtdGridItemPlaceholder } from '../public-api';\r\n\r\n@NgModule({\r\n    imports: [\r\n        KtdGridComponent,\r\n        KtdGridItemComponent,\r\n        KtdGridDragHandle,\r\n        KtdGridResizeHandle,\r\n        KtdGridItemPlaceholder\r\n    ],\r\n    exports: [\r\n        KtdGridComponent,\r\n        KtdGridItemComponent,\r\n        KtdGridDragHandle,\r\n        KtdGridResizeHandle,\r\n        KtdGridItemPlaceholder\r\n    ],\r\n    providers: [\r\n        KtdGridService\r\n    ]\r\n})\r\n/**\r\n * @deprecated Use `KtdGridComponent` instead.\r\n */\r\nexport class KtdGridModule {}\r\n","/*\r\n * Public API Surface of grid\r\n */\r\nexport { ktdGridCompact, ktdGridSortLayoutItems, ktdTrackById } from './lib/utils/grid.utils';\r\nexport { KtdClientRect } from './lib/utils/client-rect';\r\nexport * from './lib/directives/drag-handle';\r\nexport * from './lib/directives/resize-handle';\r\nexport * from './lib/directives/placeholder';\r\nexport * from './lib/grid-item/grid-item.component';\r\nexport * from './lib/grid.definitions';\r\nexport * from './lib/grid.component';\r\nexport * from './lib/grid.module';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEBUG","i1.KtdGridService"],"mappings":";;;;;;AAAA;;;;AAIG;AAqEH,MAAMA,OAAK,GAAG,KAAK,CAAC;AAEpB;;;;;AAKG;AACG,SAAU,MAAM,CAAC,MAAc,EAAA;AACjC,IAAA,IAAI,GAAG,GAAG,CAAC,EACP,OAAO,CAAC;AACZ,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC/C,QAAA,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,OAAO,GAAG,GAAG,EAAE;YACf,GAAG,GAAG,OAAO,CAAC;AACjB,SAAA;AACJ,KAAA;AACD,IAAA,OAAO,GAAG,CAAC;AACf,CAAC;AAEK,SAAU,WAAW,CAAC,MAAc,EAAA;IACtC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QAC/C,SAAS,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,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