"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const schedule = require("./src-transition-schedule.cjs");
function transition_end() {
  var on0, on1, that = this, id = that._id, size = that.size();
  return new Promise(function(resolve, reject) {
    var cancel = { value: reject }, end = { value: function() {
      if (--size === 0) resolve();
    } };
    that.each(function() {
      var schedule$1 = schedule.set(this, id), on = schedule$1.on;
      if (on !== on0) {
        on1 = (on0 = on).copy();
        on1._.cancel.push(cancel);
        on1._.interrupt.push(cancel);
        on1._.end.push(end);
      }
      schedule$1.on = on1;
    });
    if (size === 0) resolve();
  });
}
exports.default = transition_end;
//# sourceMappingURL=src-transition-end.cjs.map
