"use strict";var e,n=(e=["once"],{create:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t={_events:{}};function o(e){Object.keys(e).map((function(n){r(n,e[n])}))}function r(n,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t._events.hasOwnProperty(n)||(t._events[n]=[]);var c={};"[object Object]"===Object.prototype.toString.call(r)&&Object.keys(r).filter((function(n){return-1!==e.indexOf(n)})).map((function(e){c[e]=r[e]})),c.fn=o,t._events[n].push(c)}function c(e,n){r(e,n,{once:!0})}function s(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!t._events.hasOwnProperty(e))return[];for(var o=[],r=[],c=0;c<t._events[e].length;c++){var s=t._events[e][c];!0===s.once&&r.push(c);var v=s.fn.apply(this,n);o.push(v)}return r.length>0&&i(e,r),o}function v(){t._events={}}function i(e,n){for(var o=[],r=0;r<t._events[e].length;r++)-1===n.indexOf(r)&&o.push(t._events[e][r]);t._events[e]=o}return"[object Object]"===Object.prototype.toString.call(n)&&o(n),{on:r,once:c,emit:s,flush:v}}});module.exports=n;
