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 _0xf874=['update','remove','emit','hasOwnProperty','hook','ChatWebsite','setMaxListeners','save'];(function(_0x320276,_0x13d69a){var _0x553c9b=function(_0x3536e9){while(--_0x3536e9){_0x320276['push'](_0x320276['shift']());}};_0x553c9b(++_0x13d69a);}(_0xf874,0xed));var _0x4f87=function(_0x50a8d2,_0x30f638){_0x50a8d2=_0x50a8d2-0x0;var _0x43e1af=_0xf874[_0x50a8d2];return _0x43e1af;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x4f87('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4f87('0x1')](0x0);var events={'afterCreate':_0x4f87('0x2'),'afterUpdate':_0x4f87('0x3'),'afterDestroy':_0x4f87('0x4')};function emitEvent(_0x2f2b69){return function(_0x5b10c6,_0x402bfc,_0x31e744){ChatWebsiteEvents[_0x4f87('0x5')](_0x2f2b69+':'+_0x5b10c6['id'],_0x5b10c6);ChatWebsiteEvents[_0x4f87('0x5')](_0x2f2b69,_0x5b10c6);_0x31e744(null);};}for(var e in events){if(events[_0x4f87('0x6')](e)){var event=events[e];ChatWebsite[_0x4f87('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;