'use strict';
var __defProp=Object['defineProperty'],__name=(_0x24e038,_0x4ba168)=>__defProp(_0x24e038,'name',{'value':_0x4ba168,'configurable':!![]});const eventHandlersMap=new Map(),defaultPriority=-0x2*-0xa3c+0x1*0x13f3+-0x14e3;function subscribe(_0x506276){const _0x5618c2=_0x506276['priority']??defaultPriority,_0x1c7e50=_0x506276['eventName'];!eventHandlersMap['has'](_0x1c7e50)&&eventHandlersMap['set'](_0x1c7e50,[]);const _0xbfc7de=eventHandlersMap['get'](_0x1c7e50);let _0x37291b=_0xbfc7de['length'];for(let _0x12cc6b=0x29f+-0x2e5+0x46;_0x12cc6b<_0xbfc7de['length'];_0x12cc6b++){if(_0x5618c2<_0xbfc7de[_0x12cc6b]['priority']){_0x37291b=_0x12cc6b;break;}}_0xbfc7de['splice'](_0x37291b,-0x15ad+-0xee7*0x1+0x4*0x925,{'eventHandler':_0x506276['eventHandler'],'priority':_0x5618c2});}__name(subscribe,'subscribe');function onEvent(_0x2849d3,_0x5016c9){const _0xdc1166=eventHandlersMap['get'](_0x2849d3);if(!_0xdc1166)return;for(const _0x1e54c8 of _0xdc1166){_0x1e54c8['eventHandler']['func'](_0x5016c9);}}__name(onEvent,'onEvent');

export { onEvent, subscribe };
