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 _0x4a80=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','ChatWebsite'];(function(_0x3cec8c,_0x3f6c1d){var _0x38032e=function(_0x4ef75b){while(--_0x4ef75b){_0x3cec8c['push'](_0x3cec8c['shift']());}};_0x38032e(++_0x3f6c1d);}(_0x4a80,0xbe));var _0x04a8=function(_0x5b4b3e,_0x2dd356){_0x5b4b3e=_0x5b4b3e-0x0;var _0x589d5a=_0x4a80[_0x5b4b3e];return _0x589d5a;};'use strict';var EventEmitter=require(_0x04a8('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x04a8('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x04a8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x04a8('0x3'),'afterDestroy':_0x04a8('0x4')};function emitEvent(_0x256369){return function(_0x1e36fc,_0x85c22,_0xde2f6a){ChatWebsiteEvents[_0x04a8('0x5')](_0x256369+':'+_0x1e36fc['id'],_0x1e36fc);ChatWebsiteEvents[_0x04a8('0x5')](_0x256369,_0x1e36fc);_0xde2f6a(null);};}for(var e in events){if(events[_0x04a8('0x6')](e)){var event=events[e];ChatWebsite[_0x04a8('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;