"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useItemScale = void 0;
const sdk_1 = require("@cntrl-site/sdk");
const useKeyframeValue_1 = require("../common/useKeyframeValue");
const useLayoutContext_1 = require("./useLayoutContext");
const useItemScale = (item, sectionId) => {
    const layoutId = (0, useLayoutContext_1.useLayoutContext)();
    const scale = (0, useKeyframeValue_1.useKeyframeValue)(item, sdk_1.KeyframeType.Scale, (item, layoutId) => (layoutId ? item.area[layoutId].scale : undefined), (animator, scroll, value) => value !== undefined ? animator.getScale({ scale: value }, scroll).scale : undefined, sectionId, [layoutId]);
    return scale;
};
exports.useItemScale = useItemScale;
