{"version":3,"file":"childrenHelperMixin.mjs","sources":["../../../../src/scene/container/container-mixins/childrenHelperMixin.ts"],"sourcesContent":["import { removeItems } from '../../../utils/data/removeItems';\nimport { deprecation, v8_0_0 } from '../../../utils/logging/deprecation';\n\nimport type { Container, ContainerChild } from '../Container';\n\n/**\n * Mixin interface for containers that allows them to manage children.\n * It provides methods for adding, removing, and manipulating child containers.\n * @category scene\n * @advanced\n */\nexport interface ChildrenHelperMixin<C = ContainerChild>\n{\n    /** @internal */\n    allowChildren: boolean;\n    addChild<U extends C[]>(...children: U): U[0];\n    removeChild<U extends C[]>(...children: U): U[0];\n    /**\n     * Removes all children from this container that are within the begin and end indexes.\n     * @example\n     * ```ts\n     * // Remove all children\n     * container.removeChildren();\n     *\n     * // Remove first 3 children\n     * const removed = container.removeChildren(0, 3);\n     * console.log('Removed:', removed.length); // 3\n     *\n     * // Remove children from index 2 onwards\n     * container.removeChildren(2);\n     *\n     * // Remove specific range\n     * const middle = container.removeChildren(1, 4);\n     * ```\n     * @param {number} beginIndex - The beginning position\n     * @param {number} endIndex - The ending position. Default is container size\n     * @returns List of removed children\n     * @throws {RangeError} If begin/end indexes are invalid\n     * @see {@link Container#addChild} For adding children\n     * @see {@link Container#removeChild} For removing specific children\n     */\n    removeChildren(beginIndex?: number, endIndex?: number): C[];\n    /**\n     * Removes a child from the specified index position.\n     * @example\n     * ```ts\n     * // Remove first child\n     * const removed = container.removeChildAt(0);\n     *\n     * // type safe access\n     * const sprite = container.removeChildAt<Sprite>(1);\n     *\n     * // With error handling\n     * try {\n     *     const child = container.removeChildAt(10);\n     * } catch (e) {\n     *     console.warn('Index out of bounds');\n     * }\n     * ```\n     * @param {number} index - The index to remove the child from\n     * @returns The child that was removed\n     * @throws {Error} If index is out of bounds\n     * @see {@link Container#removeChild} For removing specific children\n     * @see {@link Container#removeChildren} For removing multiple children\n     */\n    removeChildAt<U extends C>(index: number): U;\n    /**\n     * Returns the child at the specified index.\n     * @example\n     * ```ts\n     * // Get first child\n     * const first = container.getChildAt(0);\n     *\n     * // Type-safe access\n     * const sprite = container.getChildAt<Sprite>(1);\n     *\n     * // With error handling\n     * try {\n     *     const child = container.getChildAt(10);\n     * } catch (e) {\n     *     console.warn('Index out of bounds');\n     * }\n     * ```\n     * @param {number} index - The index to get the child from\n     * @returns The child at the given index\n     * @throws {Error} If index is out of bounds\n     * @see {@link Container#children} For direct array access\n     * @see {@link Container#getChildByLabel} For name-based lookup\n     */\n    getChildAt<U extends C>(index: number): U;\n    /**\n     * Changes the position of an existing child in the container.\n     * @example\n     * ```ts\n     * // Basic index change\n     * container.setChildIndex(sprite, 0); // Move to front\n     * container.setChildIndex(sprite, container.children.length - 1); // Move to back\n     *\n     * // With error handling\n     * try {\n     *     container.setChildIndex(sprite, 5);\n     * } catch (e) {\n     *     console.warn('Invalid index or child not found');\n     * }\n     * ```\n     * @param {Container}child - The child Container instance to reposition\n     * @param {number}index - The resulting index number for the child\n     * @throws {Error} If index is out of bounds\n     * @throws {Error} If child is not in container\n     * @see {@link Container#getChildIndex} For getting current index\n     * @see {@link Container#swapChildren} For swapping positions\n     */\n    setChildIndex(child: C, index: number): void;\n    /**\n     * Returns the index position of a child Container instance.\n     * @example\n     * ```ts\n     * // Basic index lookup\n     * const index = container.getChildIndex(sprite);\n     * console.log(`Sprite is at index ${index}`);\n     *\n     * // With error handling\n     * try {\n     *     const index = container.getChildIndex(sprite);\n     * } catch (e) {\n     *     console.warn('Child not found in container');\n     * }\n     * ```\n     * @param {Container} child - The Container instance to identify\n     * @returns The index position of the child container\n     * @throws {Error} If child is not in this container\n     * @see {@link Container#setChildIndex} For changing index\n     * @see {@link Container#children} For direct array access\n     */\n    getChildIndex(child: C): number;\n    /**\n     * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown.\n     * If the child is already in this container, it will be moved to the specified index.\n     * @example\n     * ```ts\n     * // Add at specific index\n     * container.addChildAt(sprite, 0); // Add to front\n     *\n     * // Move existing child\n     * const index = container.children.length - 1;\n     * container.addChildAt(existingChild, index); // Move to back\n     *\n     * // With error handling\n     * try {\n     *     container.addChildAt(sprite, 1000);\n     * } catch (e) {\n     *     console.warn('Index out of bounds');\n     * }\n     * ```\n     * @param {Container} child - The child to add\n     * @param {number} index - The index where the child will be placed\n     * @returns The child that was added\n     * @throws {Error} If index is out of bounds\n     * @see {@link Container#addChild} For adding to the end\n     * @see {@link Container#setChildIndex} For moving existing children\n     */\n    addChildAt<U extends C>(child: U, index: number): U;\n    /**\n     * Swaps the position of 2 Containers within this container.\n     * @example\n     * ```ts\n     * // Basic swap\n     * container.swapChildren(sprite1, sprite2);\n     *\n     * // With error handling\n     * try {\n     *     container.swapChildren(sprite1, sprite2);\n     * } catch (e) {\n     *     console.warn('One or both children not found in container');\n     * }\n     * ```\n     * @remarks\n     * - Updates render groups\n     * - No effect if same child\n     * - Triggers container changes\n     * - Common in z-ordering\n     * @param {Container} child - First container to swap\n     * @param {Container} child2 - Second container to swap\n     * @throws {Error} If either child is not in container\n     * @see {@link Container#setChildIndex} For direct index placement\n     * @see {@link Container#getChildIndex} For getting current positions\n     */\n    swapChildren<U extends C>(child: U, child2: U): void;\n    /**\n     * Remove the Container from its parent Container. If the Container has no parent, do nothing.\n     * @example\n     * ```ts\n     * // Basic removal\n     * sprite.removeFromParent();\n     *\n     * // With validation\n     * if (sprite.parent) {\n     *     sprite.removeFromParent();\n     * }\n     * ```\n     * @see {@link Container#addChild} For adding to a new parent\n     * @see {@link Container#removeChild} For parent removing children\n     */\n    removeFromParent(): void;\n    /**\n     * Reparent a child or multiple children to this container while preserving their world transform.\n     * This ensures that the visual position and rotation of the children remain the same even when changing parents.\n     * @example\n     * ```ts\n     * // Basic reparenting\n     * const sprite = new Sprite(texture);\n     * oldContainer.addChild(sprite);\n     * // Move to new parent, keeping visual position\n     * newContainer.reparentChild(sprite);\n     *\n     * // Reparent multiple children\n     * const batch = [sprite1, sprite2, sprite3];\n     * newContainer.reparentChild(...batch);\n     * ```\n     * @param {Container} child - The child or children to reparent\n     * @returns The first child that was reparented\n     * @see {@link Container#reparentChildAt} For index-specific reparenting\n     * @see {@link Container#addChild} For simple parenting\n     */\n    reparentChild<U extends C[]>(...child: U): U[0];\n    /**\n     * Reparent the child to this container at the specified index while preserving its world transform.\n     * This ensures that the visual position and rotation of the child remain the same even when changing parents.\n     * @example\n     * ```ts\n     * // Basic index-specific reparenting\n     * const sprite = new Sprite(texture);\n     * oldContainer.addChild(sprite);\n     * // Move to new parent at index 0 (front)\n     * newContainer.reparentChildAt(sprite, 0);\n     * ```\n     * @param {Container} child - The child to reparent\n     * @param {number} index - The index to reparent the child to\n     * @returns The reparented child\n     * @throws {Error} If index is out of bounds\n     * @see {@link Container#reparentChild} For appending reparented children\n     * @see {@link Container#addChildAt} For simple indexed parenting\n     */\n    reparentChildAt<U extends C>(child: U, index: number): U;\n    /**\n     * Replace a child in the container with a new child. Copying the local transform from the old child to the new one.\n     * @param {Container} oldChild - The child to replace.\n     * @param {Container} newChild - The new child to add.\n     */\n    replaceChild<U extends C, T extends C>(oldChild: U, newChild: T): void;\n}\n\n/** @internal */\nexport const childrenHelperMixin: ChildrenHelperMixin<ContainerChild> = {\n\n    allowChildren: true,\n\n    removeChildren(beginIndex = 0, endIndex?: number): ContainerChild[]\n    {\n        const end = endIndex ?? this.children.length;\n        const range = end - beginIndex;\n        const removed: ContainerChild[] = [];\n\n        if (range > 0 && range <= end)\n        {\n            for (let i = end - 1; i >= beginIndex; i--)\n            {\n                const child = this.children[i];\n\n                if (!child) continue;\n                removed.push(child);\n                child.parent = null;\n            }\n\n            removeItems(this.children, beginIndex, end);\n\n            const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n            if (renderGroup)\n            {\n                renderGroup.removeChildren(removed);\n            }\n\n            for (let i = 0; i < removed.length; ++i)\n            {\n                const child = removed[i];\n\n                child.parentRenderLayer?.detach(child);\n\n                this.emit('childRemoved', child, this, i);\n                removed[i].emit('removed', this);\n            }\n\n            if (removed.length > 0)\n            {\n                this._didViewChangeTick++;\n            }\n\n            return removed;\n        }\n        else if (range === 0 && this.children.length === 0)\n        {\n            return removed;\n        }\n\n        throw new RangeError('removeChildren: numeric values are outside the acceptable range.');\n    },\n\n    removeChildAt<U extends ContainerChild>(index: number): U\n    {\n        const child = this.getChildAt<U>(index);\n\n        return this.removeChild(child);\n    },\n\n    getChildAt<U extends ContainerChild>(index: number): U\n    {\n        if (index < 0 || index >= this.children.length)\n        {\n            throw new Error(`getChildAt: Index (${index}) does not exist.`);\n        }\n\n        return this.children[index] as U;\n    },\n\n    setChildIndex(child: ContainerChild, index: number): void\n    {\n        if (index < 0 || index >= this.children.length)\n        {\n            throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`);\n        }\n\n        this.getChildIndex(child); // check if child exists\n        this.addChildAt(child, index);\n    },\n\n    getChildIndex(child: ContainerChild): number\n    {\n        const index = this.children.indexOf(child);\n\n        if (index === -1)\n        {\n            throw new Error('The supplied Container must be a child of the caller');\n        }\n\n        return index;\n    },\n\n    addChildAt<U extends ContainerChild>(child: U, index: number): U\n    {\n        // #if _DEBUG\n        if (!this.allowChildren)\n        {\n            deprecation(v8_0_0, 'addChildAt: Only Containers will be allowed to add children in v8.0.0');\n        }\n        // #endif\n\n        const { children } = this;\n\n        if (index < 0 || index > children.length)\n        {\n            throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${children.length}`);\n        }\n\n        // TODO - check if child is already in the list?\n        // we should be able to optimise this!\n\n        if (child.parent)\n        {\n            const currentIndex = child.parent.children.indexOf(child);\n\n            // If this child is in the container and in the same position, do nothing\n            if (child.parent === this && currentIndex === index)\n            {\n                return child;\n            }\n\n            if (currentIndex !== -1)\n            {\n                child.parent.children.splice(currentIndex, 1);\n            }\n        }\n\n        if (index === children.length)\n        {\n            children.push(child);\n        }\n        else\n        {\n            children.splice(index, 0, child);\n        }\n\n        child.parent = this;\n        child.didChange = true;\n        child._updateFlags = 0b1111;\n\n        const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n        if (renderGroup)\n        {\n            renderGroup.addChild(child);\n        }\n\n        if (this.sortableChildren) this.sortDirty = true;\n\n        this.emit('childAdded', child, this, index);\n        child.emit('added', this);\n\n        return child;\n    },\n\n    swapChildren<U extends ContainerChild>(child: U, child2: U): void\n    {\n        if (child === child2)\n        {\n            return;\n        }\n\n        const index1 = this.getChildIndex(child);\n        const index2 = this.getChildIndex(child2);\n\n        this.children[index1] = child2;\n        this.children[index2] = child;\n\n        const renderGroup = this.renderGroup || this.parentRenderGroup;\n\n        if (renderGroup)\n        {\n            renderGroup.structureDidChange = true;\n        }\n\n        this._didContainerChangeTick++;\n    },\n\n    removeFromParent()\n    {\n        this.parent?.removeChild(this);\n    },\n\n    reparentChild<U extends ContainerChild[]>(...child: U): U[0]\n    {\n        if (child.length === 1)\n        {\n            return this.reparentChildAt(child[0], this.children.length);\n        }\n\n        child.forEach((c) => this.reparentChildAt(c, this.children.length));\n\n        return child[0];\n    },\n\n    reparentChildAt<U extends ContainerChild>(child: U, index: number): U\n    {\n        if (child.parent === this)\n        {\n            this.setChildIndex(child, index);\n\n            return child;\n        }\n\n        const childMat = child.worldTransform.clone();\n\n        child.removeFromParent();\n        this.addChildAt(child, index);\n\n        const newMatrix = this.worldTransform.clone();\n\n        newMatrix.invert();\n        childMat.prepend(newMatrix);\n\n        child.setFromMatrix(childMat);\n\n        return child;\n    },\n\n    replaceChild<U extends ContainerChild, T extends ContainerChild>(oldChild: U, newChild: T)\n    {\n        oldChild.updateLocalTransform();\n        this.addChildAt(newChild, this.getChildIndex(oldChild));\n\n        newChild.setFromMatrix(oldChild.localTransform);\n        newChild.updateLocalTransform();\n        this.removeChild(oldChild);\n    },\n} as Container;\n"],"names":[],"mappings":";;;;AA6PO,MAAM,mBAA2D,GAAA;AAAA,EAEpE,aAAe,EAAA,IAAA;AAAA,EAEf,cAAA,CAAe,UAAa,GAAA,CAAA,EAAG,QAC/B,EAAA;AACI,IAAM,MAAA,GAAA,GAAM,QAAY,IAAA,IAAA,CAAK,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