import { Feature as s } from "../Feature.es.js";
let o = 0;
class d extends s {
  constructor() {
    super(...arguments), this.id = o++;
  }
  update() {
    if (!this.node.presenceContext)
      return;
    const { isPresent: t, onExitComplete: e } = this.node.presenceContext, { isPresent: n } = this.node.prevPresenceContext || {};
    if (!this.node.animationState || t === n)
      return;
    const i = this.node.animationState.setActive("exit", !t);
    e && !t && i.then(() => {
      e(this.id);
    });
  }
  mount() {
    const { register: t, onExitComplete: e } = this.node.presenceContext || {};
    e && e(this.id), t && (this.unmount = t(this.id));
  }
  unmount() {
  }
}
export {
  d as ExitAnimationFeature
};
//# sourceMappingURL=exit.es.js.map
