import { __assign } from 'tslib';
import { useMemo } from 'react';
import { copyRawValuesOnly } from '../html/use-props.js';
import { buildSVGAttrs } from './utils/build-attrs.js';
import { createSvgRenderState } from './utils/create-render-state.js';

function useSVGProps(props, visualState) {
    var visualProps = useMemo(function () {
        var state = createSvgRenderState();
        buildSVGAttrs(state, visualState, undefined, undefined, { enableHardwareAcceleration: false }, props.transformTemplate);
        return __assign(__assign({}, state.attrs), { style: __assign({}, state.style) });
    }, [visualState]);
    if (props.style) {
        var rawStyles = {};
        copyRawValuesOnly(rawStyles, props.style, props);
        visualProps.style = __assign(__assign({}, rawStyles), visualProps.style);
    }
    return visualProps;
}

export { useSVGProps };
