import { isCSSVariableName } from "./index127.js";
import { defaultTransformValue, readTransformValue } from "./index165.js";
import { transformProps } from "./index166.js";
import { DOMVisualElement } from "./index258.js";
import { measureViewportBox } from "./index263.js";
import { buildHTMLStyles } from "./index265.js";
import { renderHTML } from "./index266.js";
import { scrapeMotionValuesFromProps } from "./index271.js";
//#region node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs
function getComputedStyle(element) {
	return window.getComputedStyle(element);
}
var HTMLVisualElement = class extends DOMVisualElement {
	constructor() {
		super(...arguments);
		this.type = "html";
		this.renderInstance = renderHTML;
	}
	readValueFromInstance(instance, key) {
		if (transformProps.has(key)) return this.projection?.isProjecting ? defaultTransformValue(key) : readTransformValue(instance, key);
		else {
			const computedStyle = getComputedStyle(instance);
			const value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0;
			return typeof value === "string" ? value.trim() : value;
		}
	}
	measureInstanceViewportBox(instance, { transformPagePoint }) {
		return measureViewportBox(instance, transformPagePoint);
	}
	build(renderState, latestValues, props) {
		buildHTMLStyles(renderState, latestValues, props.transformTemplate);
	}
	scrapeMotionValuesFromProps(props, prevProps, visualElement) {
		return scrapeMotionValuesFromProps(props, prevProps, visualElement);
	}
};
//#endregion
export { HTMLVisualElement };

//# sourceMappingURL=index272.js.map