{"version":3,"file":"angular-grid-layout-dont-use.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/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/utils/client-rect.ts","../../../projects/angular-grid-layout/src/lib/utils/scroll.ts","../../../projects/angular-grid-layout/src/lib/utils/drag-ref.ts","../../../projects/angular-grid-layout/src/lib/ktd-registry.service.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/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/directives/ktd-drag.ts","../../../projects/angular-grid-layout/src/lib/grid.module.ts","../../../projects/angular-grid-layout/src/public-api.ts","../../../projects/angular-grid-layout/src/angular-grid-layout-dont-use.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    data?: any;\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.data !== undefined) { clonedLayoutItem.data = layoutItem.data;}\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    return compactLayout(layout, null, compactType, cols);\r\n}\r\n\r\n\r\nexport function compactLayout(\r\n    layout: Layout,\r\n    layoutItem: LayoutItem | null,\r\n    compactType: CompactType,\r\n    cols: number,\r\n): Layout {\r\n    if (layoutItem != null) {\r\n        layout = [...layout, layoutItem];\r\n    }\r\n    // Statics go in the compareWith array right away so items flow around them.\r\n    const compareWith = getStatics(layout);\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\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);\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) {\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        if (otherItem.y > item.y + item.h) {\r\n            break;\r\n        }\r\n\r\n        if (collides(item, otherItem)) {\r\n            resolveCompactionCollision(\r\n                layout,\r\n                otherItem,\r\n                moveToCoord + item[sizeProp],\r\n                axis,\r\n            );\r\n        }\r\n    }\r\n\r\n    item[axis] = moveToCoord;\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): 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    while ((collides = getFirstCollision(compareWith, l))) {\r\n        if (compactH) {\r\n            resolveCompactionCollision(fullLayout, l, collides.x + collides.w, 'x');\r\n        } else {\r\n            resolveCompactionCollision(fullLayout, l, collides.y + collides.h, 'y',);\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\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\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 ktdMouserOrTouchMove(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). 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)\r\n    )\r\n}\r\n\r\n/**\r\n * Emits when a 'pointermove' event occurs (only for the primary pointer). 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 ktdMouserOrTouchMove(element);\r\n    }\r\n    return fromEvent<PointerEvent>(element, 'pointermove', activeEventListenerOptions as AddEventListenerOptions).pipe(\r\n        filter((pointerEvent) => pointerEvent.isPrimary),\r\n    );\r\n}\r\n\r\n/**\r\n * Emits when a 'pointerup' event occurs (only for the primary pointer). 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));\r\n}\r\n","import {\r\n    compact,\r\n    compactLayout,\r\n    CompactType,\r\n    getFirstCollision,\r\n    Layout,\r\n    LayoutItem,\r\n    moveElement\r\n} from './react-grid-layout.utils';\r\nimport { KtdDraggingData, KtdGridCfg, KtdGridCompactType, KtdGridItemRect, KtdGridLayout, KtdGridLayoutItem } from '../grid.definitions';\r\nimport { ktdPointerClientX, ktdPointerClientY } from './pointer.utils';\r\nimport { KtdDictionary } from '../../types';\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, data: item.data }));\r\n}\r\n\r\nfunction screenXToGridX(screenXPos: 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 widthMinusOneItem = width - itemWidth;\r\n    const colWidthWithGap = widthMinusOneItem / (cols - 1);\r\n    return Math.round(screenXPos / colWidthWithGap);\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 item 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(\r\n    item: KtdGridLayoutItem,\r\n    config: KtdGridCfg,\r\n    compactionType: CompactType,\r\n    draggingData: KtdDraggingData\r\n): { layout: KtdGridLayoutItem[]; draggedItemPos: KtdGridItemRect, draggedLayoutItem: KtdGridLayoutItem } {\r\n    const {\r\n        pointerDownEvent,\r\n        pointerDragEvent,\r\n        gridElemClientRect,\r\n        dragElemClientRect,\r\n        scrollDifference,\r\n        draggingFromOutside\r\n    } = draggingData;\r\n\r\n    const tmpGridItemId = 'tmp-dragging-item';\r\n    const gridItemId = draggingFromOutside ? tmpGridItemId + item.id : item.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    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        ...item,\r\n        id: gridItemId,\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    // Parse to LayoutItem array data in order to use 'react.grid-layout' utils\r\n    const layoutItems: LayoutItem[] = config.layout;\r\n    const draggedLayoutItem = draggingFromOutside ? {\r\n        ...item,\r\n        id: gridItemId\r\n    } : 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    if (draggingFromOutside) {\r\n        newLayoutItems = compactLayout(newLayoutItems, layoutItem, compactionType, config.cols);\r\n        const newLayoutItem = newLayoutItems.find(item => item.id === gridItemId)!;\r\n        newLayoutItems = newLayoutItems.filter((item) => item.id !== gridItemId);\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            draggedLayoutItem: {\r\n                ...newLayoutItem,\r\n                id: newLayoutItem.id.replace(tmpGridItemId, '')\r\n            },\r\n        };\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        draggedLayoutItem: draggedLayoutItem,\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 item 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(item: KtdGridLayoutItem, config: KtdGridCfg, compactionType: CompactType, draggingData: KtdDraggingData): { layout: KtdGridLayoutItem[]; draggedItemPos: KtdGridItemRect, draggedLayoutItem: KtdGridLayoutItem } {\r\n    const {pointerDownEvent, pointerDragEvent, gridElemClientRect, dragElemClientRect, scrollDifference} = draggingData;\r\n    const gridItemId = item.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, item.minW ?? layoutItem.minW, item.maxW ?? layoutItem.maxW);\r\n    layoutItem.h = limitNumberWithinRange(layoutItem.h, item.minH ?? layoutItem.minH, item.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        draggedLayoutItem: layoutItem,\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 num 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    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    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    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\n\r\n\r\nexport interface KtdGridLayoutItem<T = any> {\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    data?: T;\r\n}\r\n\r\nexport type KtdGridCompactType = CompactType;\r\nexport type DragActionType = 'drag' | 'resize';\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    gridId: string;\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<number>;\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    draggingFromOutside: boolean;\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","/**\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","import {ElementRef, NgZone} from \"@angular/core\";\r\nimport {coerceBooleanProperty} from \"../coercion/boolean-property\";\r\nimport {BehaviorSubject, combineLatest, iif, merge, NEVER, Observable, of, Subject, Subscription} from \"rxjs\";\r\nimport {exhaustMap, filter, map, startWith, switchMap, take, takeUntil} from \"rxjs/operators\";\r\nimport {ktdPointerClient, ktdPointerClientX, ktdPointerClientY, ktdPointerDown} from './pointer.utils';\r\nimport {ktdOutsideZone} from \"./operators\";\r\nimport {KtdGridService} from \"../grid.service\";\r\nimport {KtdGridDragHandle} from \"../directives/drag-handle\";\r\nimport {KtdGridItemPlaceholder} from \"../directives/placeholder\";\r\nimport {KtdGridItemComponent} from \"../grid-item/grid-item.component\";\r\nimport {KtdDrag} from \"../directives/ktd-drag\";\r\nimport {ktdGetScrollTotalRelativeDifference$, ktdScrollIfNearElementClientRect$} from \"./scroll\";\r\nimport {PointingDeviceEvent} from \"../grid.component\";\r\nimport {KtdGridResizeHandle} from \"../directives/resize-handle\";\r\n\r\nexport class DragRef<T = any> {\r\n    private static _nextUniqueId: number = 0;\r\n\r\n    id: string = `ktd-drag-${DragRef._nextUniqueId++}`;\r\n    width: number = 1;\r\n    height: number = 1;\r\n    dragStartThreshold: number = 0;\r\n    data: T;\r\n\r\n    get scrollableParent(): HTMLElement | Document | string | null {\r\n        return this._scrollableParent;\r\n    }\r\n    set scrollableParent(val: HTMLElement | Document | string | null) {\r\n        this._scrollableParent = val;\r\n        this.scrollableParent$.next(this._scrollableParent);\r\n    }\r\n    private _scrollableParent: HTMLElement | Document | string | null = null;\r\n    private scrollableParent$: BehaviorSubject<HTMLElement | Document | string | null> = new BehaviorSubject<HTMLElement | Document | string | null>(this._scrollableParent);\r\n    placeholder: KtdGridItemPlaceholder;\r\n    scrollSpeed: number = 2;\r\n\r\n    transformX: number = 0;\r\n    transformY: number = 0;\r\n\r\n    get dragHandles(): KtdGridDragHandle[] {\r\n        return this._dragHandles;\r\n    }\r\n    set dragHandles(val: KtdGridDragHandle[]) {\r\n        this._dragHandles = val;\r\n        this._dragHandles$.next(this._dragHandles);\r\n    }\r\n    private _dragHandles: KtdGridDragHandle[] = [];\r\n    private _dragHandles$: BehaviorSubject<KtdGridDragHandle[]> = new BehaviorSubject<KtdGridDragHandle[]>(this._dragHandles);\r\n\r\n    get resizeHandles(): KtdGridDragHandle[] {\r\n        return this._resizeHandles;\r\n    }\r\n    set resizeHandles(val: KtdGridResizeHandle[]) {\r\n        this._resizeHandles = val;\r\n        this._resizeHandles$.next(this._resizeHandles);\r\n    }\r\n    private _resizeHandles: KtdGridResizeHandle[] = [];\r\n    private _resizeHandles$: BehaviorSubject<KtdGridResizeHandle[]> = new BehaviorSubject<KtdGridResizeHandle[]>(this._resizeHandles);\r\n\r\n    get draggable(): boolean {\r\n        return this._draggable;\r\n    }\r\n    set draggable(val: boolean) {\r\n        this._draggable = coerceBooleanProperty(val);\r\n        this._draggable$.next(this._draggable);\r\n        // Re-subscribe to the drag start observable to update the draggable state.\r\n        // this.dragStartSubscription?.unsubscribe();\r\n        // this.dragStartSubscription = this._dragStart$().subscribe(this.dragStartSubject);\r\n    }\r\n    private _draggable: boolean = true;\r\n    private _draggable$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(this._draggable);\r\n\r\n    get itemRef(): KtdGridItemComponent | KtdDrag<any> {\r\n        return this._itemRef;\r\n    }\r\n\r\n    get isDragging(): boolean {\r\n        return this._isDragging;\r\n    }\r\n    private _isDragging: boolean = false;\r\n\r\n    private _manualDragEvents$: Subject<MouseEvent | TouchEvent> = new Subject<MouseEvent | TouchEvent>();\r\n\r\n    private dragStartSubject: Subject<{source: DragRef; event: MouseEvent | TouchEvent}> = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\r\n    private dragMoveSubject: Subject<{source: DragRef; event: MouseEvent | TouchEvent}> = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\r\n    private dragEndSubject: Subject<{source: DragRef; event: MouseEvent | TouchEvent}> = new Subject<{source: DragRef; event: MouseEvent | TouchEvent}>();\r\n\r\n    readonly dragStart$ = new Observable<{source: DragRef; event: MouseEvent | TouchEvent}>();\r\n    readonly dragMove$ = new Observable<{source: DragRef; event: MouseEvent | TouchEvent}>();\r\n    readonly dragEnd$ = new Observable<{source: DragRef; event: MouseEvent | TouchEvent}>();\r\n\r\n    private subscriptions: Subscription[] = [];\r\n    private dragStartSubscription: Subscription;\r\n\r\n    private readonly element: HTMLElement;\r\n\r\n    constructor(\r\n        public elementRef: ElementRef<HTMLElement>,\r\n        private _gridService: KtdGridService,\r\n        private _ngZone: NgZone,\r\n        private _itemRef: KtdGridItemComponent | KtdDrag<any>,\r\n    ) {\r\n        this.dragStart$ = this.dragStartSubject.asObservable();\r\n        this.dragMove$ = this.dragMoveSubject.asObservable();\r\n        this.dragEnd$ = this.dragEndSubject.asObservable();\r\n\r\n        this.dragStartSubscription = this._dragStart$().subscribe(this.dragStartSubject);\r\n\r\n        this.element = this.elementRef.nativeElement as HTMLElement;\r\n        this.initDrag();\r\n    }\r\n\r\n    public dispose() {\r\n        this._manualDragEvents$.complete();\r\n        this.dragStartSubject.complete();\r\n        this.dragMoveSubject.complete();\r\n        this.dragEndSubject.complete();\r\n\r\n        this._manualDragEvents$.unsubscribe();\r\n        this.dragStartSubject.unsubscribe();\r\n        this.dragMoveSubject.unsubscribe();\r\n        this.dragEndSubject.unsubscribe();\r\n        this.dragStartSubscription.unsubscribe();\r\n\r\n        this.subscriptions.forEach(subscription => subscription.unsubscribe());\r\n    }\r\n\r\n    /**\r\n     * Initialize the drag of ktd-drag element, placeholder dragging is handled by ktd-grid.\r\n     * The element will be freely draggable, when drag ends it will snap back to its initial place.\r\n     */\r\n    private initDrag(): Subscription {\r\n        return this.scrollableParent$.pipe(\r\n            switchMap((newScrollableParent) => {\r\n                this.subscriptions.forEach(subscription => subscription.unsubscribe());\r\n\r\n                const scrollableParent = typeof newScrollableParent === 'string' ? document.getElementById(newScrollableParent) : newScrollableParent;\r\n\r\n                let scrollSubscription: Subscription | null = null;\r\n                let dragSubscription: Subscription | null = null;\r\n\r\n                const dragStart$ = this.dragStart$.subscribe(({event}) => {\r\n                    const initialX = ktdPointerClientX(event) - this.transformX;\r\n                    const initialY = ktdPointerClientY(event) - this.transformY;\r\n\r\n                    scrollSubscription = this._ngZone.runOutsideAngular(() =>\r\n                        (!scrollableParent ? NEVER : this.dragMove$.pipe(\r\n                            map(({event}) => ({\r\n                                pointerX: ktdPointerClientX(event),\r\n                                pointerY: ktdPointerClientY(event)\r\n                            })),\r\n                            ktdScrollIfNearElementClientRect$(scrollableParent, {scrollStep: 2}),\r\n                            takeUntil(this.dragEnd$)\r\n                        )).subscribe());\r\n\r\n                    dragSubscription = this._ngZone.runOutsideAngular(() =>\r\n                        merge(\r\n                            combineLatest([\r\n                                this.dragMove$,\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(this.dragEnd$),\r\n                        ).subscribe(([{event}, scrollDifference]: [{source: DragRef<T>, event: PointingDeviceEvent}, { top: number, left: number }]) => {\r\n                            event.preventDefault();\r\n\r\n                            const currentX = ktdPointerClientX(event) - initialX - scrollDifference.left;\r\n                            const currentY = ktdPointerClientY(event) - initialY - scrollDifference.top;\r\n\r\n                            this.element.style.transform = `translate3d(${currentX}px, ${currentY}px, 0)`;\r\n                        }));\r\n                });\r\n\r\n                const dragEnd$ = this.dragEnd$.subscribe(() => {\r\n                    scrollSubscription?.unsubscribe();\r\n                    dragSubscription?.unsubscribe();\r\n                    this.element.style.transform = `translate3d(${this.transformX}px, ${this.transformY}px, 0)`;\r\n                });\r\n\r\n                this.subscriptions = [dragStart$, dragEnd$];\r\n                // Return an observable that completes when the dragEnd$ observable completes\r\n                return this.dragEnd$.pipe(takeUntil(this.dragEnd$));\r\n            })\r\n        ).subscribe();\r\n    }\r\n\r\n    public startDragManual(event: MouseEvent | TouchEvent) {\r\n        this._manualDragEvents$.next(event);\r\n    }\r\n\r\n    private _dragStart$(): Observable<{source: DragRef, event: MouseEvent | TouchEvent}> {\r\n        return this._draggable$.pipe(\r\n            switchMap(draggable =>\r\n            draggable ?\r\n            merge(\r\n                this._manualDragEvents$,\r\n                this._dragHandles$.pipe(\r\n                    switchMap(dragHandles =>\r\n                        iif(() => dragHandles.length > 0,\r\n                            merge(...dragHandles.map(dragHandle => ktdPointerDown(dragHandle.element.nativeElement))),\r\n                            ktdPointerDown(this.elementRef.nativeElement)\r\n                        )\r\n                    )\r\n                )\r\n            ) : NEVER)\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 positioning logic since it'll start dragging the native element.\r\n                if (startEvent.target && (startEvent.target as HTMLElement).draggable && startEvent.type === 'pointerdown') {\r\n                    startEvent.preventDefault();\r\n                }\r\n\r\n                const startPointer = ktdPointerClient(startEvent);\r\n                return this._gridService.pointerMove$.pipe(\r\n                    takeUntil(this._gridService.pointerEnd$),\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                    map((moveEvent) => {\r\n                        // Emit the move event, so the user can perform any action while dragging.\r\n                        this._gridService.pointerMove$.pipe(\r\n                            takeUntil(this._gridService.pointerEnd$),\r\n                        ).subscribe((moveEvent) => {\r\n                            this._isDragging = true;\r\n                            this.dragMoveSubject.next({source: this, event: moveEvent});\r\n                        });\r\n\r\n                        // Emit the end event, so the user can perform any action when the drag stops;\r\n                        this._gridService.pointerEnd$.pipe(\r\n                            filter(() => this._isDragging),\r\n                            take(1),\r\n                        ).subscribe((event) => {\r\n                            this._isDragging = false;\r\n                            this.dragEndSubject.next({source: this, event});\r\n                        });\r\n\r\n                        // Emit the start event, so the user can perform any action when the drag starts.\r\n                        return {source: this, event: moveEvent};\r\n                    }),\r\n                );\r\n            })\r\n        );\r\n    }\r\n}\r\n","import {ElementRef, Injectable, NgZone} from '@angular/core';\r\nimport {KtdDrag} from \"./directives/ktd-drag\";\r\nimport {BehaviorSubject} from \"rxjs\";\r\nimport {KtdGridService} from \"./grid.service\";\r\nimport {DragRef} from \"./utils/drag-ref\";\r\nimport {KtdGridItemComponent} from \"./grid-item/grid-item.component\";\r\nimport {KtdGridComponent} from \"./grid.component\";\r\n\r\n@Injectable({\r\n    providedIn: 'root'\r\n})\r\nexport class KtdRegistryService<T = any> {\r\n    private _ktdDragItems: KtdDrag<T>[] = [];\r\n    public ktdDragItems$: BehaviorSubject<KtdDrag<T>[]> = new BehaviorSubject<KtdDrag<T>[]>(this._ktdDragItems);\r\n\r\n    // Two way binding between grids and drag items\r\n    private gridConnectedToKtdDragItems: {[gridId: string]: BehaviorSubject<KtdDrag<T>[]>} = {};\r\n    private gridConnectedToGridItems: {[gridId: string]: BehaviorSubject<KtdGridItemComponent<T>[]>} = {};\r\n    private ktdDragItemConnectedToGrid: {[ktdDragItemId: string]: KtdGridComponent[]} = {};\r\n    private gridItemConnectedToGrid: {[gridItemId: string]: KtdGridComponent[]} = {};\r\n\r\n    private _dragRefItems: DragRef<T>[] = [];\r\n    public dragRefItems$: BehaviorSubject<DragRef<T>[]> = new BehaviorSubject<DragRef<T>[]>(this._dragRefItems);\r\n\r\n    public _ktgGrids: KtdGridComponent[] = [];\r\n    public ktgGrids$: BehaviorSubject<KtdGridComponent[]> = new BehaviorSubject<KtdGridComponent[]>(this._ktgGrids);\r\n\r\n    constructor(\r\n        private _ngZone: NgZone,\r\n    ) { }\r\n\r\n    public createKtgDrag(element: ElementRef<HTMLElement>, gridService: KtdGridService, itemRef: KtdGridItemComponent | KtdDrag<any>): DragRef<T> {\r\n        const dragRef = new DragRef<T>(element, gridService, this._ngZone, itemRef);\r\n        this._dragRefItems.push(dragRef);\r\n        this.dragRefItems$.next(this._dragRefItems);\r\n        return dragRef;\r\n    }\r\n\r\n    public destroyKtgDrag(dragRef: DragRef<T>) {\r\n        this._dragRefItems.splice(this._dragRefItems.indexOf(dragRef), 1);\r\n        this.dragRefItems$.next(this._dragRefItems);\r\n        dragRef.dispose();\r\n    }\r\n\r\n    public registerKtgDragItem(item: KtdDrag<T>) {\r\n        this._ktdDragItems.push(item);\r\n\r\n        // Check if each item has unique id\r\n        const ids = this._dragRefItems.map(item => item.id);\r\n        if (new Set(ids).size !== ids.length) {\r\n            throw new Error(`KtdDrag: dragRef id must be unique`);\r\n        }\r\n\r\n        this.ktdDragItems$.next(this._ktdDragItems);\r\n    }\r\n\r\n    public unregisterKtgDragItem(item: KtdDrag<T>) {\r\n        this._ktdDragItems.splice(this._ktdDragItems.indexOf(item), 1);\r\n        this.ktdDragItems$.next(this._ktdDragItems);\r\n    }\r\n\r\n    public registerKtdGrid(grid: KtdGridComponent) {\r\n        this._ktgGrids.push(grid);\r\n\r\n        // Check if each grid has unique id\r\n        const ids = this._dragRefItems.map(item => item.id);\r\n        if (new Set(ids).size !== ids.length) {\r\n            throw new Error(`ktd-grid id must be unique`);\r\n        }\r\n\r\n        this.ktgGrids$.next(this._ktgGrids);\r\n    }\r\n\r\n    public unregisterKtdGrid(grid: KtdGridComponent) {\r\n        this._ktgGrids.splice(this._ktgGrids.indexOf(grid), 1);\r\n        this.ktgGrids$.next(this._ktgGrids);\r\n    }\r\n\r\n    public updateConnectedTo(dragRef: DragRef, connectedTo: KtdGridComponent[]) {\r\n        if (dragRef.itemRef instanceof KtdGridItemComponent) {\r\n            connectedTo.forEach(grid => {\r\n                if (!this.gridConnectedToGridItems[grid.id]) {\r\n                    this.gridConnectedToGridItems[grid.id] = new BehaviorSubject<KtdGridItemComponent<T>[]>([]);\r\n                }\r\n                const connectedToSubject = this.gridConnectedToGridItems[grid.id];\r\n                const connectedTo = connectedToSubject.getValue();\r\n                connectedTo.push(dragRef.itemRef as KtdGridItemComponent);\r\n                connectedToSubject.next(connectedTo);\r\n\r\n                if (!this.gridItemConnectedToGrid[dragRef.id]) {\r\n                    this.gridItemConnectedToGrid[dragRef.id] = [];\r\n                }\r\n                this.gridItemConnectedToGrid[dragRef.id].push(grid);\r\n            });\r\n            return;\r\n        }\r\n\r\n        connectedTo.forEach(grid => {\r\n            if (!this.gridConnectedToKtdDragItems[grid.id]) {\r\n                this.gridConnectedToKtdDragItems[grid.id] = new BehaviorSubject<KtdDrag<T>[]>([]);\r\n            }\r\n            const connectedToSubject = this.gridConnectedToKtdDragItems[grid.id];\r\n            const connectedTo = connectedToSubject.getValue();\r\n            connectedTo.push(dragRef.itemRef as KtdDrag<any>);\r\n            connectedToSubject.next(connectedTo);\r\n\r\n            if (!this.ktdDragItemConnectedToGrid[dragRef.id]) {\r\n                this.ktdDragItemConnectedToGrid[dragRef.id] = [];\r\n            }\r\n            this.ktdDragItemConnectedToGrid[dragRef.id].push(grid);\r\n        });\r\n    }\r\n}\r\n","import {Injectable, NgZone} from '@angular/core';\r\nimport {Observable, Subject, Subscription} from 'rxjs';\r\nimport {DragActionType, KtdGridItemRenderData} from \"./grid.definitions\";\r\nimport {DragRef} from \"./utils/drag-ref\";\r\nimport {getDragResizeEventData, KtdGridComponent, PointingDeviceEvent} from \"./grid.component\";\r\nimport {KtdDrag} from \"./directives/ktd-drag\";\r\nimport {ktdOutsideZone} from \"./utils/operators\";\r\nimport {takeUntil} from \"rxjs/operators\";\r\nimport {ktdPointerMove, ktdPointerUp} from './utils/pointer.utils';\r\nimport {KtdRegistryService} from \"./ktd-registry.service\";\r\nimport {LayoutItem} from \"./utils/react-grid-layout.utils\";\r\n\r\n\r\nexport interface PointerEventInfo {\r\n    dragRef: DragRef;\r\n    startEvent: PointingDeviceEvent;\r\n    moveEvent: PointingDeviceEvent;\r\n    type: DragActionType;\r\n    newLayoutItem: LayoutItem;\r\n    renderData: KtdGridItemRenderData<number> | null;\r\n    fromGrid: KtdGridComponent | null; // The grid where the drag started, it can be null if the drag started outside a grid. For example, when dragging from a connected drag item\r\n    currentGrid: KtdGridComponent | null;\r\n    lastGrid: KtdGridComponent | null; // The last grid that we were in, is used so when we stop resizing outside a grid, we can notify the last grid of new layout\r\n}\r\n\r\n@Injectable({providedIn: 'root'})\r\nexport class KtdGridService {\r\n    pointerMove$: Observable<MouseEvent | TouchEvent>;\r\n    private pointerMoveSubject: Subject<MouseEvent | TouchEvent> = new Subject<MouseEvent | TouchEvent>();\r\n    private pointerMoveSubscription: Subscription;\r\n\r\n    pointerEnd$: Observable<MouseEvent | TouchEvent>;\r\n    private pointerEndSubject: Subject<MouseEvent | TouchEvent> = new Subject<MouseEvent | TouchEvent>();\r\n    private pointerEndSubscription: Subscription;\r\n\r\n    private drag: PointerEventInfo | null = null;\r\n\r\n    constructor(\r\n        private ngZone: NgZone,\r\n        private registryService: KtdRegistryService,\r\n    ) {\r\n        this.pointerMove$ = this.pointerMoveSubject.asObservable();\r\n        this.pointerEnd$ = this.pointerEndSubject.asObservable();\r\n        this.initSubscriptions();\r\n    }\r\n\r\n    private initSubscriptions() {\r\n        this.pointerMoveSubscription = this.ngZone.runOutsideAngular(() =>\r\n            ktdPointerMove(document)\r\n                .subscribe((mouseEvent: MouseEvent | TouchEvent) => this.pointerMoveSubject.next(mouseEvent))\r\n        );\r\n\r\n        this.pointerEndSubscription = this.ngZone.runOutsideAngular(() =>\r\n            ktdPointerUp(document)\r\n                .subscribe((mouseEvent: MouseEvent | TouchEvent) => {\r\n                    this.pointerEndSubject.next(mouseEvent);\r\n                    if (this.drag !== null) {\r\n                        this.updateGrids(this.drag);\r\n                    }\r\n                    this.drag = null;\r\n                })\r\n        );\r\n    }\r\n\r\n    /**\r\n     * Start a drag sequence.\r\n     * @param event The event that triggered the drag sequence.\r\n     * @param dragRef The dragRef that started the drag sequence.\r\n     * @param type The type of drag sequence.\r\n     * @param grid The grid where the drag sequence started. It can be null if the drag sequence started outside a grid.\r\n     * @param gridItem The grid item that is being dragged. It can be null if the drag sequence started from outside a grid.\r\n     */\r\n    public startDrag(event: MouseEvent | TouchEvent | PointerEvent, dragRef: DragRef, type: DragActionType, grid: KtdGridComponent | null = null, gridItem: {layoutItem: LayoutItem, renderData: KtdGridItemRenderData<number>} | null = null): void {\r\n        // Make sure, this function is only being called once\r\n        if (this.drag !== null) {\r\n            return;\r\n        }\r\n\r\n        const isKtdDrag = dragRef.itemRef instanceof KtdDrag;\r\n\r\n        if (!isKtdDrag && gridItem === null) {\r\n            throw new Error('layoutItem must be provided when dragging from a connected drag item');\r\n        }\r\n\r\n        this.drag = {\r\n            dragRef,\r\n            startEvent: event,\r\n            moveEvent: event,\r\n            type,\r\n            fromGrid: isKtdDrag ? null : grid,\r\n            currentGrid: null,\r\n            lastGrid: isKtdDrag ? null : grid,\r\n            newLayoutItem: isKtdDrag ? {\r\n                id: dragRef.id,\r\n                w: dragRef.width,\r\n                h: dragRef.height,\r\n                x: -1,\r\n                y: -1,\r\n                data: dragRef.data,\r\n            } : gridItem!.layoutItem!,\r\n            renderData: isKtdDrag ? null : gridItem!.renderData!,\r\n        };\r\n\r\n        if (grid !== null) {\r\n            grid.setGridBackgroundVisible(grid.backgroundConfig?.show === 'whenDragging' || grid.backgroundConfig?.show === 'always');\r\n            this.ngZone.run(() => (type === 'drag' ? grid.dragStarted : grid.resizeStarted).emit(getDragResizeEventData(dragRef, grid.layout)));\r\n        }\r\n\r\n        const connectedToGrids = isKtdDrag ? (dragRef.itemRef as KtdDrag<any>).connectedTo : this.registryService._ktgGrids;\r\n        this.pointerMove$.pipe(\r\n            takeUntil(this.pointerEnd$),\r\n            ktdOutsideZone(this.ngZone),\r\n        ).subscribe((moveEvent: MouseEvent | TouchEvent) => {\r\n            this.drag!.moveEvent = moveEvent;\r\n            this.handleGridInteraction(moveEvent, connectedToGrids);\r\n        });\r\n    }\r\n\r\n    private handleGridInteraction(moveEvent: MouseEvent | TouchEvent, connectedToGrids: KtdGridComponent[]): void {\r\n        for (const grid of connectedToGrids) {\r\n            if (!grid.isPointerInsideGridElement(moveEvent)) {\r\n                continue;\r\n            }\r\n\r\n            // When we are still in the same grid, we don't need to do anything\r\n            if (grid.id === this.drag!.currentGrid?.id) {\r\n                return;\r\n            }\r\n\r\n            // We are in new grid, so we need to notify the previous grid that the item has left it\r\n            this.notifyGrids(grid, moveEvent);\r\n            return;\r\n        }\r\n\r\n        // We are not in any grid, so we need to notify the previous grid that the item has left it\r\n        this.notifyGrids(null, moveEvent);\r\n    }\r\n\r\n    /**\r\n     * Notify the previous grid that the item has left it and notify the new grid that the item has entered it.\r\n     */\r\n    private notifyGrids(grid: KtdGridComponent | null, moveEvent: MouseEvent | TouchEvent): void {\r\n        if (this.drag!.currentGrid !== null) {\r\n            this.drag!.currentGrid.dragExited.next({\r\n                source: this.drag!.dragRef,\r\n                event: moveEvent,\r\n                grid: this.drag!.currentGrid,\r\n                dragInfo: this.drag!,\r\n            });\r\n        }\r\n\r\n        if (grid !== null) {\r\n            grid.dragEntered.next({\r\n                source: this.drag!.dragRef,\r\n                event: moveEvent,\r\n                grid: grid,\r\n                dragInfo: this.drag!,\r\n            });\r\n        }\r\n\r\n        this.drag!.currentGrid = grid;\r\n        this.drag!.lastGrid = grid === null ? this.drag!.lastGrid : grid;\r\n    }\r\n\r\n    private updateGrids(drag: PointerEventInfo): void {\r\n        // If the drag ended outside a grid, we don't need to do anything\r\n        if (drag.currentGrid === null && drag.type === 'drag') {\r\n            /*\r\n            * This emit is not required, but when it is not here, it cases a bug where the grid-element,\r\n            * does not return to its original position when the drag ends outside the grid.\r\n            * The same thing happens when the resize ends outside the grid.\r\n            * */\r\n            drag.fromGrid?.layoutUpdated.emit(drag.fromGrid!.layout);\r\n            drag.fromGrid?.stopDragSequence(drag);\r\n            return;\r\n        }\r\n\r\n        if (drag.type === 'resize') {\r\n            if (drag.lastGrid === null) {\r\n                console.error('lastGrid is null');\r\n                return;\r\n            }\r\n\r\n            // Do not update the layout if the resize did not change the layout,\r\n            // this can happen when the user only clicks on the resize handle, but does not resize\r\n            if (drag.fromGrid !== null && drag.fromGrid.drag !== null && drag.fromGrid.drag.newLayout !== null) {\r\n                drag.fromGrid.layoutUpdated.emit(drag.fromGrid.drag.newLayout);\r\n            } else if (drag.lastGrid.drag !== null && drag.lastGrid.drag.newLayout !== null) {\r\n                drag.lastGrid.layoutUpdated.emit(drag.lastGrid.drag!.newLayout!);\r\n            }\r\n\r\n            //\r\n            // if (drag.fromGrid === drag.currentGrid) {\r\n            //     drag.currentGrid!.layoutUpdated.emit(drag.currentGrid!.drag!.newLayout!);\r\n            // } else {\r\n            //     /*\r\n            //      * This emit is not required, but when it is not here, it cases a bug where the grid-element,\r\n            //      * does not return to its original position when the resize ends on another grid than the one it started.\r\n            //      */\r\n            //     if (drag.fromGrid !== null && drag.fromGrid.drag !== null) {\r\n            //         drag.fromGrid.layoutUpdated.emit(drag.fromGrid.drag.newLayout!);\r\n            //     }\r\n            // }\r\n\r\n        } else {\r\n            const currentLayoutItem = drag.fromGrid === null ? {\r\n                ...drag.newLayoutItem,\r\n                id: drag.currentGrid!.getNextId()\r\n            } : drag.newLayoutItem;\r\n\r\n            // Dragging between two distinct grids\r\n            if (drag.fromGrid !== drag.currentGrid) {\r\n                // Notify the previous grid that the item has left it\r\n                drag.fromGrid?.layoutUpdated.emit(drag.fromGrid!.layout.filter(item => item.id !== drag.dragRef.id));\r\n\r\n                // Notify the new grid that we dropped new item that was not in any grid\r\n                drag.currentGrid?.dropped.emit({\r\n                    event: drag.moveEvent,\r\n                    currentLayout: drag.currentGrid.drag!.newLayout!.map(item => ({...item})),\r\n                    currentLayoutItem: currentLayoutItem,\r\n                });\r\n            } else {\r\n                // Skip the update if the layout did not change,\r\n                // this may happen when the user only clicks on the drag handle, but does not drag\r\n                if (drag.currentGrid!.drag === null) {\r\n                    return;\r\n                }\r\n\r\n                // Update the new grid layout\r\n                drag.currentGrid!.layoutUpdated.emit(drag.currentGrid!.drag!.newLayout!);\r\n            }\r\n        }\r\n\r\n        // Clean up\r\n        drag.fromGrid?.stopDragSequence(drag);\r\n        drag.currentGrid?.stopDragSequence(drag);\r\n        this.registryService._ktgGrids.forEach(grid => grid.clearDragSequence());\r\n    }\r\n\r\n    dispose() {\r\n        this.pointerMoveSubscription.unsubscribe();\r\n        this.pointerEndSubscription.unsubscribe();\r\n    }\r\n}\r\n","import {\r\n    AfterContentInit,\r\n    ChangeDetectionStrategy,\r\n    Component,\r\n    ContentChild,\r\n    ContentChildren,\r\n    ElementRef,\r\n    Inject,\r\n    Input,\r\n    OnDestroy,\r\n    OnInit,\r\n    Output,\r\n    QueryList,\r\n    Renderer2,\r\n    ViewChild\r\n} from '@angular/core';\r\nimport { BehaviorSubject, merge, NEVER, Observable, Observer, Subject, Subscription} from 'rxjs';\r\nimport { startWith, switchMap} from 'rxjs/operators';\r\nimport { ktdPointerDown} from '../utils/pointer.utils';\r\nimport { GRID_ITEM_GET_RENDER_DATA_TOKEN, KtdGridItemRenderDataTokenType } from '../grid.definitions';\r\nimport { KTD_GRID_DRAG_HANDLE, KtdGridDragHandle } from '../directives/drag-handle';\r\nimport { KTD_GRID_RESIZE_HANDLE, KtdGridResizeHandle } from '../directives/resize-handle';\r\nimport { BooleanInput, coerceBooleanProperty } from '../coercion/boolean-property';\r\nimport { coerceNumberProperty, NumberInput } from '../coercion/number-property';\r\nimport { KTD_GRID_ITEM_PLACEHOLDER, KtdGridItemPlaceholder } from '../directives/placeholder';\r\nimport {DragRef} from \"../utils/drag-ref\";\r\nimport {KtdRegistryService} from \"../ktd-registry.service\";\r\nimport {KtdGridService} from \"../grid.service\";\r\n\r\n@Component({\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<T = any> 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    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._dragRef.id;\r\n    }\r\n    set id(val: string) {\r\n        this._dragRef.id = val;\r\n    }\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._dragRef.dragStartThreshold; }\r\n    set dragStartThreshold(val: number) {\r\n        this._dragRef.dragStartThreshold = coerceNumberProperty(val);\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._dragRef.draggable;\r\n    }\r\n    set draggable(val: boolean) {\r\n        this._dragRef.draggable = coerceBooleanProperty(val);\r\n    }\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    set resizable(val: boolean) {\r\n        this._resizable = coerceBooleanProperty(val);\r\n        this._resizable$.next(this._resizable);\r\n    }\r\n    private _resizable: boolean = true;\r\n    private _resizable$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(this._resizable);\r\n\r\n    private resizeStartSubject: Subject<MouseEvent | TouchEvent> = new Subject<MouseEvent | TouchEvent>();\r\n\r\n    private subscriptions: Subscription[] = [];\r\n\r\n    get dragRef(): DragRef<T> {\r\n        return this._dragRef;\r\n    }\r\n    private readonly _dragRef: DragRef<T>;\r\n\r\n    @Output('dragStart')\r\n    readonly dragStart: Observable<{source: DragRef<T>, event: MouseEvent | TouchEvent}> = new Observable(\r\n        (observer: Observer<{source: DragRef<T>, event: MouseEvent | TouchEvent}>) => {\r\n            const subscription = this._dragRef.dragStart$\r\n                .subscribe(observer);\r\n\r\n            return () => {\r\n                subscription.unsubscribe();\r\n            };\r\n        },\r\n    );\r\n\r\n    @Output('dragMove')\r\n    readonly dragMove: Observable<{source: DragRef<T>, event: MouseEvent | TouchEvent}> = new Observable(\r\n        (observer: Observer<{source: DragRef<T>, event: MouseEvent | TouchEvent}>) => {\r\n            const subscription = this._dragRef.dragMove$\r\n                .subscribe(observer);\r\n\r\n            return () => {\r\n                subscription.unsubscribe();\r\n            };\r\n        },\r\n    );\r\n\r\n    @Output('dragEnd')\r\n    readonly dragEnd: Observable<{source: DragRef<T>, event: MouseEvent | TouchEvent}> = new Observable(\r\n        (observer: Observer<{source: DragRef<T>, event: MouseEvent | TouchEvent}>) => {\r\n            const subscription = this._dragRef.dragEnd$\r\n                .subscribe(observer);\r\n\r\n            return () => {\r\n                subscription.unsubscribe();\r\n            };\r\n        },\r\n    );\r\n\r\n    constructor(public elementRef: ElementRef,\r\n                private gridService: KtdGridService,\r\n                private registryService: KtdRegistryService,\r\n                private renderer: Renderer2,\r\n                @Inject(GRID_ITEM_GET_RENDER_DATA_TOKEN) private getItemRenderData: KtdGridItemRenderDataTokenType) {\r\n        this.resizeStart$ = this.resizeStartSubject.asObservable();\r\n\r\n        this._dragRef = this.registryService.createKtgDrag(this.elementRef, this.gridService, this);\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._resizeStart$().subscribe(this.resizeStartSubject),\r\n            this._dragHandles.changes.subscribe(() => {\r\n                this._dragRef.dragHandles = this._dragHandles.toArray();\r\n            }),\r\n            this._resizeHandles.changes.subscribe(() => {\r\n                this._dragRef.resizeHandles = this._resizeHandles.toArray();\r\n            }),\r\n        );\r\n    }\r\n\r\n    ngOnDestroy() {\r\n        this.registryService.destroyKtgDrag(this._dragRef);\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._dragRef.startDragManual(startEvent);\r\n    }\r\n\r\n    setStyles({top, left, width, height}: { top: number, left: number, width?: number, height?: number }) {\r\n        this._dragRef.transformX = left;\r\n        this._dragRef.transformY = top;\r\n\r\n        // transform is 6x times faster than top/left\r\n        this.renderer.setStyle(this.elementRef.nativeElement, 'transform', `translateX(${left}px) translateY(${top}px)`);\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}px`); }\r\n        if (height != null) {this.renderer.setStyle(this.elementRef.nativeElement, 'height', `${height}px`); }\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                    );\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","/**\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,\r\n    AfterContentInit,\r\n    ChangeDetectionStrategy,\r\n    Component,\r\n    ContentChildren,\r\n    ElementRef,\r\n    EmbeddedViewRef,\r\n    EventEmitter,\r\n    Input,\r\n    NgZone,\r\n    OnChanges,\r\n    OnDestroy,\r\n    Output,\r\n    QueryList,\r\n    Renderer2,\r\n    SimpleChanges,\r\n    ViewContainerRef,\r\n    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, of, Subscription} from 'rxjs';\r\nimport {exhaustMap, map, startWith, switchMap, takeUntil} from 'rxjs/operators';\r\nimport {\r\n    ktdGetGridItemRowHeight,\r\n    ktdGridItemDragging, ktdGridItemLayoutItemAreEqual,\r\n    ktdGridItemResizing\r\n} from './utils/grid.utils';\r\nimport {compact, Layout} from './utils/react-grid-layout.utils';\r\nimport {\r\n    DragActionType,\r\n    GRID_ITEM_GET_RENDER_DATA_TOKEN,\r\n    KtdGridBackgroundCfg,\r\n    KtdGridCfg,\r\n    KtdGridCompactType,\r\n    KtdGridItemRenderData,\r\n    KtdGridLayout,\r\n    KtdGridLayoutItem,\r\n} from './grid.definitions';\r\nimport { ktdPointerClientX, ktdPointerClientY } from './utils/pointer.utils';\r\nimport { KtdDictionary } from '../types';\r\nimport {KtdGridService, PointerEventInfo} 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 {KtdRegistryService} from \"./ktd-registry.service\";\r\nimport {DragRef} from \"./utils/drag-ref\";\r\nimport {KtdDrag} from \"./directives/ktd-drag\";\r\n\r\n// region Types\r\n\r\ninterface KtdGridDrag {\r\n    dragSubscription: Subscription | null;\r\n    scrollSubscription: Subscription | null;\r\n    startEvent: MouseEvent | TouchEvent;\r\n    newLayout: Layout | null;\r\n}\r\n\r\ninterface KtdDragResizeEvent {\r\n    layout: KtdGridLayout;\r\n    layoutItem: KtdGridLayoutItem;\r\n    gridItemRef: KtdGridItemComponent | KtdDrag<any>; //\r\n}\r\n\r\nexport type KtdDragStart = KtdDragResizeEvent;\r\nexport type KtdDragEnter = KtdGridEnterLeaveEvent;\r\nexport type KtdDragLeave = KtdGridEnterLeaveEvent;\r\nexport type KtdDragEnd = KtdDragResizeEvent;\r\nexport type KtdDropped<T = any> = KtdDroppedEvent<T>;\r\n\r\nexport type KtdResizeStart = KtdDragResizeEvent;\r\nexport type KtdResizeEnd = KtdDragResizeEvent;\r\n\r\ninterface KtdDroppedEvent<T> {\r\n    event: PointingDeviceEvent;\r\n    currentLayout: KtdGridLayout;\r\n    currentLayoutItem: KtdGridLayoutItem<T>;\r\n}\r\n\r\nexport interface KtdGridItemResizeEvent {\r\n    width: number;\r\n    height: number;\r\n    gridItemRef: KtdGridItemComponent;\r\n}\r\n\r\nexport type PointingDeviceEvent = MouseEvent | TouchEvent | PointerEvent;\r\n\r\nexport interface KtdGridEnterLeaveEvent {\r\n    grid: KtdGridComponent;\r\n    event: PointingDeviceEvent;\r\n    source: DragRef;\r\n    dragInfo: PointerEventInfo;\r\n}\r\n\r\nexport function getDragResizeEventData(dragRef: DragRef, layout: KtdGridLayout): KtdDragResizeEvent {\r\n    return {\r\n        layout,\r\n        layoutItem: dragRef.itemRef instanceof KtdGridItemComponent ? layout.find((item) => item.id === dragRef.id)! : {\r\n            id: dragRef.id,\r\n            x: 0,\r\n            y: 0,\r\n            w: 1,\r\n            h: 1,\r\n        },\r\n        gridItemRef: dragRef.itemRef,\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(\r\n    config: KtdGridCfg,\r\n    width: number,\r\n    height: number,\r\n    draggingLayoutItem: KtdGridLayoutItem | null = null\r\n): { dict: KtdDictionary<KtdGridItemRenderData<number>>, draggingItem: KtdGridItemRenderData<number> | null } {\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 {\r\n        dict: renderItems,\r\n        draggingItem: draggingLayoutItem !== null ? {\r\n            id: draggingLayoutItem.id,\r\n            top: draggingLayoutItem.y * rowHeightInPixels + gap * draggingLayoutItem.y,\r\n            left: draggingLayoutItem.x * itemWidthPerColumn + gap * draggingLayoutItem.x,\r\n            width: draggingLayoutItem.w * itemWidthPerColumn + gap * Math.max(draggingLayoutItem.w - 1, 0),\r\n            height: draggingLayoutItem.h * rowHeightInPixels + gap * Math.max(draggingLayoutItem.h - 1, 0),\r\n        } : null,\r\n    };\r\n}\r\n\r\nfunction getGridHeight(layout: KtdGridLayout, rowHeight: number, gap: number, draggedItem: KtdGridLayoutItem<number> | null): number {\r\n    const newLayout = draggedItem !== null ? [...layout, draggedItem] : layout;\r\n    return newLayout.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 __gridItemGetRenderDataFactoryFunc(gridCmp: KtdGridComponent) {\r\n    return function(id: string) {\r\n        return 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// endregion\r\n\r\n@Component({\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    // region Parameters\r\n    private static _nextUniqueId: number = 0;\r\n\r\n    /** Query list of grid items that are being rendered. */\r\n    @ContentChildren(KtdGridItemComponent, {descendants: true}) private _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 user moves the item into the grid. Being emitted from grid.service. */\r\n    @Output() dragEntered: EventEmitter<KtdDragEnter> = new EventEmitter<KtdDragEnter>();\r\n\r\n    /** Emits when user moves the item out of the grid. Being emitted from grid.service. */\r\n    @Output() dragExited: EventEmitter<KtdDragLeave> = new EventEmitter<KtdDragLeave>();\r\n\r\n    /** Emits when drag ends */\r\n    @Output() dragEnded: EventEmitter<KtdDragEnd> = new EventEmitter<KtdDragEnd>();\r\n\r\n    /** Emits when user drops an item to this grid */\r\n    @Output() dropped: EventEmitter<KtdDropped> = new EventEmitter<KtdDropped>();\r\n\r\n    /** Emits when resize starts */\r\n    @Output() resizeStarted: EventEmitter<KtdResizeStart> = new EventEmitter<KtdResizeStart>();\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    @Input()\r\n    get id(): string { return this._id; }\r\n    set id(val: string) {\r\n        this._id = val;\r\n    }\r\n    private _id: string = `ktd-grid-${KtdGridComponent._nextUniqueId++}`;\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    set compactOnPropsChange(value: boolean) {\r\n        this._compactOnPropsChange = coerceBooleanProperty(value);\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    set preventCollision(value: boolean) {\r\n        this._preventCollision = coerceBooleanProperty(value);\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    set scrollSpeed(value: number) {\r\n        this._scrollSpeed = coerceNumberProperty(value, 2);\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 { return this._compactType; }\r\n    set compactType(val: KtdGridCompactType) {\r\n        this._compactType = val;\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    set rowHeight(val: number | 'fit') {\r\n        this._rowHeight = val === 'fit' ? val : Math.max(1, Math.round(coerceNumberProperty(val)));\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    set cols(val: number) {\r\n        this._cols = Math.max(1, Math.round(coerceNumberProperty(val)));\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    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    private _layout: KtdGridLayout;\r\n\r\n    /** Grid gap in css pixels */\r\n    @Input()\r\n    get gap(): number { return this._gap; }\r\n    set gap(val: number) {\r\n        this._gap = Math.max(coerceNumberProperty(val), 0);\r\n    }\r\n    private _gap: number = 0;\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 { return this._height; }\r\n    set height(val: number | null) {\r\n        this._height = typeof val === 'number' ? Math.max(val, 0) : null;\r\n    }\r\n    private _height: number | null = null;\r\n\r\n    @Input()\r\n    get backgroundConfig(): KtdGridBackgroundCfg | null { return this._backgroundConfig; }\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.gridElement.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    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            gridId: this.id,\r\n        };\r\n    }\r\n\r\n    /** Reference to the view of the placeholder element. */\r\n    private placeholderRef: EmbeddedViewRef<any> | null;\r\n\r\n    /** Element that is rendered as placeholder when a grid item is being dragged */\r\n    private placeholder: HTMLElement | null;\r\n\r\n    private _gridItemsRenderData: KtdDictionary<KtdGridItemRenderData<number>>;\r\n    private subscriptions: Subscription[];\r\n\r\n    public get drag(): KtdGridDrag | null {\r\n        return this._drag;\r\n    }\r\n    private _drag: KtdGridDrag | null = null;\r\n\r\n    private readonly gridElement: HTMLElement;\r\n\r\n    // endregion\r\n\r\n    constructor(private gridService: KtdGridService,\r\n                private ktdRegistryService: KtdRegistryService,\r\n                private elementRef: ElementRef,\r\n                private viewContainerRef: ViewContainerRef,\r\n                private renderer: Renderer2,\r\n                private ngZone: NgZone\r\n    ) {\r\n        this.gridElement = this.elementRef.nativeElement as HTMLElement;\r\n        this.ktdRegistryService.registerKtdGrid(this);\r\n    }\r\n\r\n    ngOnChanges(changes: SimpleChanges) {\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        this.ktdRegistryService.unregisterKtdGrid(this);\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.gridElement.getBoundingClientRect();\r\n        this.gridCurrentHeight = this.height ?? (this.rowHeight === 'fit' ? clientRect.height : getGridHeight(this.layout, this.rowHeight, this.gap, null));\r\n        const {dict} = layoutToRenderItems(this.config, clientRect.width, this.gridCurrentHeight);\r\n        this._gridItemsRenderData = dict;\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.gridElement, 'height', `${this.gridCurrentHeight}px`);\r\n        this.updateGridItemsStyles();\r\n    }\r\n\r\n    private setBackgroundCssVariables(rowHeight: number) {\r\n        const style = (this.gridElement 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(gridItemRenderData);\r\n            }\r\n        });\r\n    }\r\n\r\n    public setGridBackgroundVisible(visible: boolean) {\r\n        const classList = this.gridElement.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        // const itemsConnectedToGrid$ = this.ktdRegistryService.getKtdDragItemsConnectedToGrid(this);\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}) => ({\r\n                            event,\r\n                            gridItem,\r\n                            type: 'drag' as DragActionType\r\n                        })))),\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((data) => of(data)));\r\n                })\r\n            ).subscribe(({event, gridItem, type}) => {\r\n                // Prevents the event from bubbling up the DOM tree, preventing any parent event handlers from being notified of the event.\r\n                // Specifically, it prevents the event from being sent to any parent event handlers that may be listening for it.\r\n                if (type === 'resize') {\r\n                    event.stopPropagation();\r\n                }\r\n\r\n                // If the event started from an element with the native HTML drag&drop, it'll interfere\r\n                // with our positioning logic since it'll start dragging the native element.\r\n                if (event.target && ((event.target as HTMLElement).draggable || true) && event.type === 'pointerdown') {\r\n                    event.preventDefault();\r\n                }\r\n\r\n                const layoutItem = this.layout.find((item) => item.id === gridItem.id);\r\n                const renderData = this._gridItemsRenderData[gridItem.id];\r\n\r\n                if (layoutItem === undefined || renderData === undefined) {\r\n                    console.error(`Couldn\\'t find the specified grid item for the id: ${gridItem.id}`);\r\n                    return;\r\n                }\r\n\r\n                return this.gridService.startDrag(event, gridItem.dragRef, type, this, {layoutItem, renderData});\r\n            }),\r\n            this.dragEntered.subscribe(({event, dragInfo }) => {\r\n                this.startRestoreDragSequence(event, dragInfo);\r\n            }),\r\n            this.dragExited.subscribe(({dragInfo}) => {\r\n                this.pauseDragSequence(dragInfo);\r\n            }),\r\n        ];\r\n    }\r\n\r\n    /**\r\n     * Starts the drag sequence when a drag event is triggered. It will restore paused drag sequence if it's already started.\r\n     * @param event The event that triggered the drag sequence.\r\n     * @param dragInfo The drag info.\r\n     */\r\n    private startRestoreDragSequence(event: PointingDeviceEvent, dragInfo: PointerEventInfo): void {\r\n        // Drag sequence can be paused, but the resize sequence can't be paused.\r\n        if (this.drag !== null && dragInfo.type === 'resize') {\r\n            return;\r\n        }\r\n\r\n        // Prevents the resize from starting if the resize already started on another grid.\r\n        if (dragInfo.type === 'resize' && this.drag === null && dragInfo.fromGrid !== this) {\r\n            return;\r\n        }\r\n\r\n        const scrollableParent = typeof this.scrollableParent === 'string' ? document.getElementById(this.scrollableParent) : this.scrollableParent;\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.pointerMove$.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(this.gridService.pointerEnd$),\r\n            ).subscribe());\r\n\r\n        this._drag = {\r\n            dragSubscription: this.createDragResizeLoop(scrollableParent, dragInfo),\r\n            scrollSubscription,\r\n            startEvent: event,\r\n            newLayout: null,\r\n        };\r\n    }\r\n\r\n    private pauseDragSequence(dragInfo: PointerEventInfo): void {\r\n        // If the drag is a resize, we don't need to pause the drag sequence.\r\n        if (dragInfo.type === 'resize') {\r\n            return;\r\n        }\r\n\r\n        // Partially reset the drag sequence.\r\n        this.clearDragSequence();\r\n    }\r\n\r\n    /**\r\n     * Creates the drag loop. It listens for 'pointer move' and 'scroll' events and recalculates the layout on each emission.\r\n     * @param scrollableParent The parent element that contains the scroll.\r\n     * @param dragInfo The drag info.\r\n     */\r\n    private createDragResizeLoop(scrollableParent: HTMLElement | Document | null, dragInfo: PointerEventInfo): Subscription {\r\n        let renderData: KtdGridItemRenderData<number> | null = null;\r\n\r\n        // Retrieve grid (parent) and gridItem (draggedElem) client rects.\r\n        const gridElemClientRect: KtdClientRect = getMutableClientRect(this.gridElement);\r\n        const dragElemClientRect: KtdClientRect = getMutableClientRect(dragInfo.dragRef.elementRef.nativeElement as HTMLElement);\r\n\r\n        this.renderer.addClass(dragInfo.dragRef.elementRef.nativeElement, 'no-transitions');\r\n        this.renderer.addClass(dragInfo.dragRef.elementRef.nativeElement, 'ktd-grid-item-dragging');\r\n\r\n        const placeholderClientRect: KtdClientRect = {\r\n            ...dragElemClientRect,\r\n            left: dragElemClientRect.left - gridElemClientRect.left,\r\n            top: dragElemClientRect.top - gridElemClientRect.top\r\n        }\r\n\r\n        this.createPlaceholderElement(placeholderClientRect, dragInfo.dragRef.placeholder);\r\n\r\n        // Main subscription, it listens for 'pointer move' and 'scroll' events and recalculates the layout on each emission\r\n        return this.ngZone.runOutsideAngular(() =>\r\n            merge(\r\n                combineLatest([\r\n                    this.gridService.pointerMove$,\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(this.gridService.pointerEnd$),\r\n            ).subscribe(([pointerDragEvent, scrollDifference]: [MouseEvent | TouchEvent, { top: number, left: number }]) => {\r\n                pointerDragEvent.preventDefault();\r\n\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 = this.drag!.newLayout || this.layout;\r\n                // const ktdLayoutItem = dragInfo.fromGrid !== this ? dragInfo.newLayoutItem : currentLayout.find(item => item.id === dragInfo.dragRef.id)!;\r\n                const ktdLayoutItem = dragInfo.newLayoutItem;\r\n\r\n                // Get the correct newStateFunc depending on if we are dragging or resizing\r\n                const calcNewStateFunc = dragInfo.type === 'drag' ? ktdGridItemDragging : ktdGridItemResizing;\r\n\r\n                const {layout, draggedItemPos, draggedLayoutItem} = calcNewStateFunc(ktdLayoutItem, {\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                    gridId: this.id,\r\n                }, this.compactType, {\r\n                    pointerDownEvent: this.drag!.startEvent!,\r\n                    pointerDragEvent,\r\n                    gridElemClientRect,\r\n                    dragElemClientRect,\r\n                    scrollDifference,\r\n                    draggingFromOutside: dragInfo.fromGrid !== this,\r\n                });\r\n                this.drag!.newLayout = layout;\r\n\r\n                this.gridCurrentHeight = this.height ?? (this.rowHeight === 'fit' ? gridElemClientRect.height : getGridHeight(this.drag!.newLayout, this.rowHeight, this.gap, draggedLayoutItem));\r\n\r\n                const {dict, draggingItem} = layoutToRenderItems({\r\n                    cols: this.cols,\r\n                    rowHeight: this.rowHeight,\r\n                    height: this.height,\r\n                    layout: this.drag!.newLayout,\r\n                    preventCollision: this.preventCollision,\r\n                    gap: this.gap,\r\n                    gridId: this.id,\r\n                }, gridElemClientRect.width, gridElemClientRect.height, draggedLayoutItem);\r\n                this._gridItemsRenderData = dict;\r\n\r\n                if (dragInfo.fromGrid !== this || dragInfo.type === 'resize') {\r\n                    dragInfo.newLayoutItem = draggedLayoutItem;\r\n                    renderData = draggingItem!;\r\n                }\r\n\r\n                const newGridItemRenderData = renderData !== null && dragInfo.fromGrid !== this ? renderData : this._gridItemsRenderData[dragInfo.dragRef.id];\r\n\r\n                // Put the real final position to the placeholder element\r\n                this.placeholder!.style.width = `${newGridItemRenderData.width}px`;\r\n                this.placeholder!.style.height = `${newGridItemRenderData.height}px`;\r\n                this.placeholder!.style.transform = `translateX(${newGridItemRenderData.left}px) translateY(${newGridItemRenderData.top}px)`;\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                if (renderData !== null && dragInfo.fromGrid !== this ) {\r\n                    renderData = {\r\n                        ...renderData,\r\n                        ...draggedItemPos,\r\n                    }\r\n                } else {\r\n                    this._gridItemsRenderData[dragInfo.dragRef.id] = {\r\n                        ...draggedItemPos,\r\n                        id: this._gridItemsRenderData[dragInfo.dragRef.id].id\r\n                    };\r\n                }\r\n\r\n                this.setBackgroundCssVariables(this.rowHeight === 'fit' ? ktdGetGridItemRowHeight(this.drag!.newLayout, gridElemClientRect.height, this.gap) : this.rowHeight);\r\n\r\n                this.render();\r\n\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 (dragInfo.type === 'resize') {\r\n                    const prevGridItem = currentLayout.find(item => item.id === dragInfo.dragRef.id)!;\r\n                    const newGridItem = this.drag!.newLayout.find(item => item.id === dragInfo.dragRef.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.width,\r\n                            height: newGridItemRenderData.height,\r\n                            gridItemRef: dragInfo.dragRef.itemRef as KtdGridItemComponent, // We always have a grid item ref when resizing\r\n                        });\r\n                    }\r\n                }\r\n            })\r\n        );\r\n    }\r\n\r\n    public stopDragSequence(dragInfo: PointerEventInfo): void {\r\n        if (this.drag === null) {\r\n            return;\r\n        }\r\n\r\n        // Remove drag classes\r\n        this.renderer.removeClass(dragInfo.dragRef.elementRef.nativeElement, 'no-transitions');\r\n        this.renderer.removeClass(dragInfo.dragRef.elementRef.nativeElement, 'ktd-grid-item-dragging');\r\n\r\n        this.ngZone.run(() => {\r\n            (dragInfo.type === 'drag' ? this.dragEnded : this.resizeEnded).emit(getDragResizeEventData(dragInfo.dragRef, this.drag!.newLayout!));\r\n        });\r\n\r\n        this.clearDragSequence();\r\n        this._drag = null;\r\n        this.addGridItemAnimatingClass(dragInfo.dragRef).subscribe();\r\n    }\r\n\r\n    /**\r\n     * Clears the drag sequence.\r\n     * This is called from grid-service when drag/resize finishes.\r\n     */\r\n    public clearDragSequence(): void {\r\n        if (this.drag !== null) {\r\n            this.destroyPlaceholder();\r\n            this.drag?.dragSubscription?.unsubscribe();\r\n            this.drag?.scrollSubscription?.unsubscribe();\r\n            this.drag.dragSubscription = null;\r\n            this.drag.scrollSubscription = null;\r\n        }\r\n    }\r\n\r\n    public isPointerInsideGridElement(event: MouseEvent | TouchEvent): boolean {\r\n        const gridElemClientRect: KtdClientRect = getMutableClientRect(this.gridElement);\r\n        const pointerX = ktdPointerClientX(event);\r\n        const pointerY = ktdPointerClientY(event);\r\n        return gridElemClientRect.left < pointerX && pointerX < gridElemClientRect.right && gridElemClientRect.top < pointerY && pointerY < gridElemClientRect.bottom;\r\n    }\r\n\r\n    public getNextId(): string {\r\n        return this._gridItems.toArray().reduce((acc, cur) => acc > parseInt(cur.id) ? acc : parseInt(cur.id), 0) + 1 + '';\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 dragRef that has been dragged\r\n     */\r\n    private addGridItemAnimatingClass(dragRef: DragRef): Observable<undefined> {\r\n        return new Observable(observer => {\r\n            const duration = getTransformTransitionDurationInMs(dragRef.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(dragRef.elementRef.nativeElement, 'ktd-grid-item-animating');\r\n            const handler = ((event: TransitionEvent) => {\r\n                if (!event || (event.target === dragRef.elementRef.nativeElement && event.propertyName === 'transform')) {\r\n                    this.renderer.removeClass(dragRef.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(dragRef.elementRef.nativeElement, 'transitionend', handler);\r\n        })\r\n    }\r\n\r\n    /** Creates placeholder element */\r\n    private createPlaceholderElement(clientRect: KtdClientRect, gridItemPlaceholder?: KtdGridItemPlaceholder) {\r\n        this.placeholder = this.renderer.createElement('div');\r\n        this.placeholder!.style.width = `${clientRect.width}px`;\r\n        this.placeholder!.style.height = `${clientRect.height}px`;\r\n        this.placeholder!.style.transform = `translateX(${clientRect.left}px) translateY(${clientRect.top}px)`;\r\n        this.placeholder!.classList.add('ktd-grid-item-placeholder');\r\n        this.renderer.appendChild(this.gridElement, this.placeholder);\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 = this.viewContainerRef.createEmbeddedView(\r\n                gridItemPlaceholder.templateRef,\r\n                gridItemPlaceholder.data\r\n            );\r\n            this.placeholderRef.rootNodes.forEach(node => this.placeholder!.appendChild(node));\r\n            this.placeholderRef.detectChanges();\r\n        } else {\r\n            this.placeholder!.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() {\r\n        this.placeholder?.remove();\r\n        this.placeholderRef?.destroy();\r\n        this.placeholder = this.placeholderRef = 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>\r\n","import {\r\n    AfterContentInit, ContentChild, ContentChildren,\r\n    Directive, ElementRef,\r\n    InjectionToken, Input, OnDestroy, Output, QueryList\r\n} from '@angular/core';\r\nimport {coerceBooleanProperty} from \"../coercion/boolean-property\";\r\nimport {Observable, Observer, Subscription} from \"rxjs\";\r\nimport {coerceNumberProperty} from \"../coercion/number-property\";\r\nimport {KtdRegistryService} from \"../ktd-registry.service\";\r\nimport {KTD_GRID_DRAG_HANDLE, KtdGridDragHandle} from \"./drag-handle\";\r\nimport {DragRef} from \"../utils/drag-ref\";\r\nimport {KTD_GRID_ITEM_PLACEHOLDER, KtdGridItemPlaceholder} from \"./placeholder\";\r\nimport {KtdGridComponent, PointingDeviceEvent} from \"../grid.component\";\r\nimport {KtdGridService} from \"../grid.service\";\r\n\r\n\r\nexport const KTD_DRAG = new InjectionToken<KtdDrag<any>>('KtdDrag');\r\n\r\n@Directive({\r\n    selector: '[ktdDrag]',\r\n    host: {\r\n        '[class.ktd-draggable]': '_dragHandles.length === 0 && draggable',\r\n        '[class.ktd-dragging]': '_dragRef.isDragging',\r\n        '[class.ktd-drag-disabled]': 'disabled',\r\n    },\r\n    providers: [{provide: KTD_DRAG, useExisting: KtdDrag}]\r\n})\r\nexport class KtdDrag<T> implements AfterContentInit, OnDestroy {\r\n    /** Elements that can be used to drag the draggable item. */\r\n    @ContentChildren(KTD_GRID_DRAG_HANDLE, {descendants: true}) _dragHandles: QueryList<KtdGridDragHandle>;\r\n\r\n    /** Template ref for placeholder */\r\n    @ContentChild(KTD_GRID_ITEM_PLACEHOLDER) placeholder: KtdGridItemPlaceholder;\r\n\r\n    @Input()\r\n    get disabled(): boolean {\r\n        return this._disabled;\r\n    }\r\n    set disabled(value: boolean) {\r\n        this._disabled = coerceBooleanProperty(value);\r\n        this._dragRef.draggable = !this._disabled;\r\n    }\r\n    private _disabled: boolean = false;\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 {\r\n        return this._dragRef.dragStartThreshold;\r\n    }\r\n    set dragStartThreshold(val: number) {\r\n        this._dragRef.dragStartThreshold = coerceNumberProperty(val);\r\n    }\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._dragRef.scrollSpeed; }\r\n    set scrollSpeed(value: number) {\r\n        this._dragRef.scrollSpeed = coerceNumberProperty(value, 2);\r\n    }\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()\r\n    get scrollableParent(): HTMLElement | Document | string | null { return this._dragRef.scrollableParent; }\r\n    set scrollableParent(value: HTMLElement | Document | string | null) {\r\n        this._dragRef.scrollableParent = value;\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._dragRef.draggable;\r\n    }\r\n    set draggable(val: boolean) {\r\n        this._dragRef.draggable = coerceBooleanProperty(val);\r\n    }\r\n\r\n    /**\r\n     * List of ids of grids or grid components that the item is connected to.\r\n     */\r\n    @Input()\r\n    get connectedTo(): KtdGridComponent[] {\r\n        return this._connectedTo;\r\n    }\r\n    set connectedTo(val: (string|KtdGridComponent|any)[]) {\r\n        this._connectedTo = val.map((item: string|KtdGridComponent|any) => {\r\n            if (typeof item === 'string') {\r\n                const grid = this.registryService._ktgGrids.find(grid => grid.id === item);\r\n                if (grid === undefined) {\r\n                    throw new Error(`KtdDrag connectedTo: could not find grid with id ${item}`);\r\n                }\r\n                return grid;\r\n            }\r\n            if (item instanceof KtdGridComponent) {\r\n                return item;\r\n            }\r\n            throw new Error(`KtdDrag connectedTo: connectedTo must be an array of KtdGridComponent or string`);\r\n        });\r\n        this.registryService.updateConnectedTo(this._dragRef, this._connectedTo);\r\n    }\r\n    private _connectedTo: KtdGridComponent[] = [];\r\n\r\n    @Input()\r\n    get id(): string {\r\n        return this._dragRef.id;\r\n    }\r\n    set id(val: string) {\r\n        this._dragRef.id = val;\r\n    }\r\n\r\n    /**\r\n     * Width of the draggable item, in cols. Minimum value is 1. Maximum value is how many cols the grid has.\r\n     */\r\n    @Input()\r\n    get width(): number {\r\n        return this._dragRef.width;\r\n    }\r\n    set width(val: number) {\r\n        const width = coerceNumberProperty(val);\r\n        this._dragRef.width = width <= 0 ? 1 : width;\r\n    }\r\n\r\n    /**\r\n     * Height of the draggable item, in cols. Minimum value is 1. Maximum value is how many rows the grid has.\r\n     */\r\n    @Input()\r\n    get height(): number {\r\n        return this._dragRef.height;\r\n    }\r\n    set height(val: number) {\r\n        const height = coerceNumberProperty(val);\r\n        this._dragRef.height = height <= 0 ? 1 : height;\r\n    }\r\n\r\n    @Input('ktdDragData')\r\n    set data(val: T) {\r\n        this._dragRef.data = val;\r\n    }\r\n\r\n    @Output('dragStart')\r\n    readonly dragStart: Observable<{source: DragRef<T>, event: PointingDeviceEvent}> = new Observable(\r\n        (observer: Observer<{source: DragRef<T>, event: PointingDeviceEvent}>) => {\r\n            const subscription = this._dragRef.dragStart$\r\n                .subscribe(observer);\r\n\r\n            return () => {\r\n                subscription.unsubscribe();\r\n            };\r\n        },\r\n    );\r\n\r\n    @Output('dragMove')\r\n    readonly dragMove: Observable<{source: DragRef<T>, event: PointingDeviceEvent}> = new Observable(\r\n        (observer: Observer<{source: DragRef<T>, event: PointingDeviceEvent}>) => {\r\n            const subscription = this._dragRef.dragMove$\r\n                .subscribe(observer);\r\n\r\n            return () => {\r\n                subscription.unsubscribe();\r\n            };\r\n        },\r\n    );\r\n\r\n    @Output('dragEnd')\r\n    readonly dragEnd: Observable<{source: DragRef<T>, event: PointingDeviceEvent}> = new Observable(\r\n        (observer: Observer<{source: DragRef<T>, event: PointingDeviceEvent}>) => {\r\n            const subscription = this._dragRef.dragEnd$\r\n                .subscribe(observer);\r\n\r\n            return () => {\r\n                subscription.unsubscribe();\r\n            };\r\n        },\r\n    );\r\n\r\n    public _dragRef: DragRef<T>;\r\n\r\n    private subscriptions: Subscription[] = [];\r\n\r\n    constructor(\r\n        /** Element that the draggable is attached to. */\r\n        public elementRef: ElementRef,\r\n        private gridService: KtdGridService,\r\n        private registryService: KtdRegistryService,\r\n    ) {\r\n        this._dragRef = this.registryService.createKtgDrag(this.elementRef, this.gridService, this);\r\n    }\r\n\r\n    ngAfterContentInit(): void {\r\n        this.registryService.registerKtgDragItem(this);\r\n        this.subscriptions.push(\r\n            this._dragHandles.changes.subscribe(() => {\r\n                this._dragRef.dragHandles = this._dragHandles.toArray();\r\n            }),\r\n            this.dragStart.subscribe(({event}) => {\r\n                this.gridService.startDrag(event, this._dragRef, 'drag');\r\n            }),\r\n        );\r\n    }\r\n\r\n    ngOnDestroy(): void {\r\n        this.registryService.unregisterKtgDragItem(this);\r\n        this.registryService.destroyKtgDrag(this._dragRef);\r\n        this.subscriptions.forEach(subscription => subscription.unsubscribe());\r\n    }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\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\nimport { KtdDrag } from './directives/ktd-drag';\r\n\r\n@NgModule({\r\n    declarations: [\r\n        KtdGridComponent,\r\n        KtdGridItemComponent,\r\n        KtdGridDragHandle,\r\n        KtdGridResizeHandle,\r\n        KtdGridItemPlaceholder,\r\n        KtdDrag\r\n    ],\r\n    exports: [\r\n        KtdGridComponent,\r\n        KtdGridItemComponent,\r\n        KtdGridDragHandle,\r\n        KtdGridResizeHandle,\r\n        KtdGridItemPlaceholder,\r\n        KtdDrag\r\n    ],\r\n    providers: [\r\n        KtdGridService\r\n    ],\r\n    imports: [\r\n        CommonModule\r\n    ]\r\n})\r\nexport class KtdGridModule {}\r\n","/*\r\n * Public API Surface of grid\r\n */\r\nexport { ktdGridCompact, 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/directives/ktd-drag';\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":["i1.KtdRegistryService","i1.KtdGridService","i2.KtdRegistryService"],"mappings":";;;;;;AAAA;;;;AAIG;AAsEH,MAAM,KAAK,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,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,KAAA;AACD,IAAA,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;AACA;AACM,SAAU,eAAe,CAAC,UAAsB,EAAA;AAClD,IAAA,MAAM,gBAAgB,GAAe;QACjC,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,CAAC,EAAE,UAAU,CAAC,CAAC;QAC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