"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const VisualElement = require("./dist-es-render-VisualElement.cjs");
const DOMKeyframesResolver = require("./dist-es-render-dom-DOMKeyframesResolver.cjs");
const isMotionValue = require("./dist-es-value-utils-is-motion-value.cjs");
class DOMVisualElement extends VisualElement.VisualElement {
  constructor() {
    super(...arguments);
    this.KeyframeResolver = DOMKeyframesResolver.DOMKeyframesResolver;
  }
  sortInstanceNodePosition(a, b) {
    return a.compareDocumentPosition(b) & 2 ? 1 : -1;
  }
  getBaseTargetFromProps(props, key) {
    return props.style ? props.style[key] : void 0;
  }
  removeValueFromRenderState(key, { vars, style }) {
    delete vars[key];
    delete style[key];
  }
  handleChildMotionValue() {
    if (this.childSubscription) {
      this.childSubscription();
      delete this.childSubscription;
    }
    const { children } = this.props;
    if (isMotionValue.isMotionValue(children)) {
      this.childSubscription = children.on("change", (latest) => {
        if (this.current) {
          this.current.textContent = `${latest}`;
        }
      });
    }
  }
}
exports.DOMVisualElement = DOMVisualElement;
//# sourceMappingURL=dist-es-render-dom-DOMVisualElement.cjs.map
