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 _0xc43c=['hook','exports','events','../../mysqldb','UserProfile','remove','emit'];(function(_0x137b26,_0x176e50){var _0x353d0b=function(_0xd96029){while(--_0xd96029){_0x137b26['push'](_0x137b26['shift']());}};_0x353d0b(++_0x176e50);}(_0xc43c,0xd4));var _0xcc43=function(_0x301467,_0x124c6b){_0x301467=_0x301467-0x0;var _0x3aeef7=_0xc43c[_0x301467];return _0x3aeef7;};'use strict';var EventEmitter=require(_0xcc43('0x0'));var UserProfile=require(_0xcc43('0x1'))['db'][_0xcc43('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcc43('0x3')};function emitEvent(_0x482ebc){return function(_0x484b53,_0x4c59cc,_0x37e84f){UserProfileEvents[_0xcc43('0x4')](_0x482ebc+':'+_0x484b53['id'],_0x484b53);UserProfileEvents[_0xcc43('0x4')](_0x482ebc,_0x484b53);_0x37e84f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xcc43('0x5')](e,emitEvent(event));}}module[_0xcc43('0x6')]=UserProfileEvents;