1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0xf871=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3443d1,_0x1b6169){var _0xa19924=function(_0x57dcf0){while(--_0x57dcf0){_0x3443d1['push'](_0x3443d1['shift']());}};_0xa19924(++_0x1b6169);}(_0xf871,0x13a));var _0x1f87=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf871[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x1f87('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x1f87('0x1')](0x0);var events={'afterCreate':_0x1f87('0x2'),'afterUpdate':_0x1f87('0x3'),'afterDestroy':_0x1f87('0x4')};function emitEvent(_0x17194e){return function(_0x2db794,_0x2097a9,_0x3b5f69){TeamEvents[_0x1f87('0x5')](_0x17194e+':'+_0x2db794['id'],_0x2db794);TeamEvents[_0x1f87('0x5')](_0x17194e,_0x2db794);_0x3b5f69(null);};}for(var e in events){if(events[_0x1f87('0x6')](e)){var event=events[e];Team[_0x1f87('0x7')](e,emitEvent(event));}}module[_0x1f87('0x8')]=TeamEvents;