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