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 _0x7bf2=['exports','events','Team','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xf6647a,_0x4a05a0){var _0xdd3a42=function(_0x58fc02){while(--_0x58fc02){_0xf6647a['push'](_0xf6647a['shift']());}};_0xdd3a42(++_0x4a05a0);}(_0x7bf2,0x133));var _0x27bf=function(_0x5a6d98,_0x316745){_0x5a6d98=_0x5a6d98-0x0;var _0x126ed0=_0x7bf2[_0x5a6d98];return _0x126ed0;};'use strict';var EventEmitter=require(_0x27bf('0x0'));var Team=require('../../mysqldb')['db'][_0x27bf('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x27bf('0x2'),'afterUpdate':_0x27bf('0x3'),'afterDestroy':_0x27bf('0x4')};function emitEvent(_0x5472a1){return function(_0x3547bd,_0x328985,_0x3c5ca3){TeamEvents[_0x27bf('0x5')](_0x5472a1+':'+_0x3547bd['id'],_0x3547bd);TeamEvents[_0x27bf('0x5')](_0x5472a1,_0x3547bd);_0x3c5ca3(null);};}for(var e in events){if(events[_0x27bf('0x6')](e)){var event=events[e];Team[_0x27bf('0x7')](e,emitEvent(event));}}module[_0x27bf('0x8')]=TeamEvents;