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zBM,SAAS,GAuBd,MAtBqB,iBAAV,EACT,EAAM,OAAO,GAAS,EAAM,GAAS,WAGnC,cAFO,EAAM,UAAU,UAChB,EAAM,OAAO,GACb,GACT,IAEA,EAAM,OAAO,EAAM,KAAK,MAAQ,EAAM,GAAS,WAC7C,IAAI,EAAM,EAAG,EAAI,EAEjB,IADA,EAAO,CAAC,EACH,EAAK,EAAG,EAAO,EAAM,OAAQ,EAAK,EAAM,IAC3C,EAAI,EAAM,UACH,EAAM,UAAU,GACnB,KAAK,EAAM,QACb,EAAK,GAAK,EAAM,MAAM,UACf,EAAM,MAAM,IAIvB,cADO,EAAM,OAAO,EAAM,KAAK,MACxB,EAAS,EAClB,IAEK,CACT,GACO,EACX,EAEA,EAAM,UAAU,QAAU,SAAS,EAAO,GACxC,IAAc,EAAI,EAAM,EAKxB,GAJI,KAAS,KAAK,SAChB,aAAa,KAAK,OAAO,WAClB,KAAK,OAAO,IAEjB,KAAS,KAAK,UAAW,CAE3B,IAAK,EAAK,EAAG,GADb,EAAO,KAAK,UAAU,IACG,OAAQ,EAAK,EAAM,KAC1C,EAAW,EAAK,IACP,EAAM,UAEV,KAAK,UAAU,EACxB,CACA,OAAO,IACT,EAEO,CAER,CAxGO,GA0Gc,oBAAX,QAAqC,OAAX,OACnC,OAAO,QAAU,WACf,OAAO,IAAI,CACb,EAEA,KAAK,QAAU,WACb,OAAO,IAAI,CACb,CAGH,GAAE,KAAK","file":"/npm/too-late@0.1.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/too-late@0.1.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Generated by CoffeeScript 1.9.0\n(function() {\n  var Thing, delay;\n\n  delay = function(cb, time) {\n    return setTimeout(time, cb);\n  };\n\n  Thing = (function() {\n    function Thing() {\n      this.callbacks = {};\n      this.timers = {};\n      this.lastevent = null;\n      this.datas = {};\n    }\n\n    Thing.prototype.waitfor = function(event, callback) {\n      if (typeof event === 'string') {\n        if (!(event in this.callbacks)) {\n          this.callbacks[event] = [];\n        }\n        this.callbacks[this.lastevent = event].push(callback);\n        return this;\n      } else {\n        return this.waitforMany(event, callback);\n      }\n    };\n\n    Thing.prototype.waitforMany = function(events, callback) {\n      var done;\n      done = 0;\n      (function(_this) {\n        return (function(events, callback, done) {\n          var cb, event, _i, _len;\n          cb = function(data, event) {\n            var e, _i, _len;\n            _this.datas[event] = data;\n            if (++done >= events.length) {\n              callback.apply(null, events.map(function(e) {\n                return _this.datas[e];\n              }));\n              for (_i = 0, _len = events.length; _i < _len; _i++) {\n                e = events[_i];\n                delete _this.datas[e];\n              }\n              return clearTimeout(_this.timers[events.join(',')]);\n            }\n          };\n          for (_i = 0, _len = events.length; _i < _len; _i++) {\n            event = events[_i];\n            if (!(event in _this.callbacks)) {\n              _this.callbacks[event] = [];\n            }\n            _this.callbacks[event].push(cb);\n          }\n          return _this.lastevent = events;\n        });\n      })(this)(events, callback, done);\n      return this;\n    };\n\n    Thing.prototype.till = function(timeout, callback) {\n      var event;\n      event = this.lastevent;\n      return (function(_this) {\n        return function(event) {\n          if (typeof event === 'string') {\n            _this.timers[event] = delay(timeout, function() {\n              delete _this.callbacks[event];\n              delete _this.timers[event];\n              return callback();\n            });\n          } else {\n            _this.timers[event.join(',')] = delay(timeout, function() {\n              var done, e, _i, _len;\n              done = {};\n              for (_i = 0, _len = event.length; _i < _len; _i++) {\n                e = event[_i];\n                delete _this.callbacks[e];\n                if (e in _this.datas) {\n                  done[e] = _this.datas[e];\n                  delete _this.datas[e];\n                }\n              }\n              delete _this.timers[event.join(',')];\n              return callback(done);\n            });\n          }\n          return _this;\n        };\n      })(this)(event);\n    };\n\n    Thing.prototype.deliver = function(event, data) {\n      var callback, _i, _len, _ref;\n      if (event in this.timers) {\n        clearTimeout(this.timers[event]);\n        delete this.timers[event];\n      }\n      if (event in this.callbacks) {\n        _ref = this.callbacks[event];\n        for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n          callback = _ref[_i];\n          callback(data, event);\n        }\n        delete this.callbacks[event];\n      }\n      return this;\n    };\n\n    return Thing;\n\n  })();\n\n  if (typeof module !== \"undefined\" && module !== null) {\n    module.exports = function() {\n      return new Thing;\n    };\n  } else {\n    this.toolate = function() {\n      return new Thing;\n    };\n  }\n\n}).call(this);\n"]}