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 _0xd846=['../../mysqldb','ChatWebsite','update','emit','hook','exports','events'];(function(_0x31ae77,_0x1c0eab){var _0x4f5294=function(_0x27295a){while(--_0x27295a){_0x31ae77['push'](_0x31ae77['shift']());}};_0x4f5294(++_0x1c0eab);}(_0xd846,0x195));var _0x6d84=function(_0x325087,_0x464da6){_0x325087=_0x325087-0x0;var _0x11b08e=_0xd846[_0x325087];return _0x11b08e;};'use strict';var EventEmitter=require(_0x6d84('0x0'));var ChatWebsite=require(_0x6d84('0x1'))['db'][_0x6d84('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d84('0x3'),'afterDestroy':'remove'};function emitEvent(_0x47e90f){return function(_0x15fb0c,_0xa19796,_0x5c2176){ChatWebsiteEvents[_0x6d84('0x4')](_0x47e90f+':'+_0x15fb0c['id'],_0x15fb0c);ChatWebsiteEvents['emit'](_0x47e90f,_0x15fb0c);_0x5c2176(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x6d84('0x5')](e,emitEvent(event));}}module[_0x6d84('0x6')]=ChatWebsiteEvents;