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 _0x073d=['hook','exports','../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x107daa,_0x30e0f6){var _0x253fca=function(_0x47f7de){while(--_0x47f7de){_0x107daa['push'](_0x107daa['shift']());}};_0x253fca(++_0x30e0f6);}(_0x073d,0xd2));var _0xd073=function(_0x505b1,_0x3f2a5d){_0x505b1=_0x505b1-0x0;var _0x6f5380=_0x073d[_0x505b1];return _0x6f5380;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd073('0x0'))['db'][_0xd073('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd073('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd073('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ad2eb){return function(_0x423dc8,_0x494f81,_0x11bd94){UserProfileEvents[_0xd073('0x4')](_0x3ad2eb+':'+_0x423dc8['id'],_0x423dc8);UserProfileEvents[_0xd073('0x4')](_0x3ad2eb,_0x423dc8);_0x11bd94(null);};}for(var e in events){if(events[_0xd073('0x5')](e)){var event=events[e];UserProfile[_0xd073('0x6')](e,emitEvent(event));}}module[_0xd073('0x7')]=UserProfileEvents;