import { VisualElementDragControls as t } from "./VisualElementDragControls.es.js";
import { Feature as e } from "../../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/Feature.es.js";
import { noop as s } from "../../../../../../../motion-utils@12.36.0/node_modules/motion-utils/dist/es/noop.es.js";
class m extends e {
  constructor(o) {
    super(o), this.removeGroupControls = s, this.removeListeners = s, this.controls = new t(o);
  }
  mount() {
    const { dragControls: o } = this.node.getProps();
    o && (this.removeGroupControls = o.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || s;
  }
  update() {
    const { dragControls: o } = this.node.getProps(), { dragControls: r } = this.node.prevProps || {};
    o !== r && (this.removeGroupControls(), o && (this.removeGroupControls = o.subscribe(this.controls)));
  }
  unmount() {
    this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
  }
}
export {
  m as DragGesture
};
//# sourceMappingURL=index.es.js.map
