1 var _0x7cf7=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x63\x6F\x6D\x70\x6F\x73\x61\x62\x6C\x65\x2D\x6D\x69\x64\x64\x6C\x65\x77\x61\x72\x65","\x6D\x6F\x6D\x65\x6E\x74","\x63\x72\x79\x70\x74\x6F","\x75\x74\x69\x6C","\x6F\x73","\x65\x78\x65\x63\x53\x79\x6E\x63","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x54\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x53\x65\x74\x74\x69\x6E\x67","\x4C\x69\x63\x65\x6E\x73\x65","\x44\x45\x4D\x4F\x20\x4C\x49\x43\x45\x4E\x53\x45","\x0D\x0A","","\x72\x65\x70\x6C\x61\x63\x65","\x64\x6D\x69\x64\x65\x63\x6F\x64\x65\x20\x2D\x2D\x73\x74\x72\x69\x6E\x67\x20\x73\x79\x73\x74\x65\x6D\x2D\x75\x75\x69\x64","\x75\x74\x66\x38","\x77\x69\x6E\x33\x32","\x2E\x2F\x68\x61\x72\x64\x77\x61\x72\x65","\x70\x6C\x61\x74\x66\x6F\x72\x6D","\x63\x61\x74\x63\x68","\x6C\x69\x63\x65\x6E\x73\x65","\x64\x61\x74\x61\x31","\x70\x61\x72\x73\x65","\x64\x65\x6D\x6F","\x4C\x69\x63\x65\x6E\x73\x65\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x73\x70\x72\x65\x61\x64","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x75\x73\x65","\x63\x68\x61\x74","\x6D\x65\x73\x73\x61\x67\x69\x6E\x67","\x63\x6D","\x75\x70\x64\x61\x74\x65","\x6D\x61\x69\x6C","\x66\x61\x78","\x6A\x73\x63\x72\x69\x70\x74\x79","\x63\x75\x73\x74\x6F\x6D","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x65\x78\x70\x69\x72\x61\x74\x69\x6F\x6E","\x69\x73\x53\x61\x6D\x65\x4F\x72\x42\x65\x66\x6F\x72\x65","\x4C\x69\x63\x65\x6E\x73\x65\x20\x64\x61\x74\x65\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x69\x6E\x66\x6F","\x4C\x69\x63\x65\x6E\x73\x65\x20\x75\x73\x65\x72\x73\x20\x6C\x69\x6D\x69\x74\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x75\x73\x65\x72\x73","\x4D\x61\x78\x69\x6D\x75\x6D\x20\x75\x73\x65\x72\x73\x20\x6C\x69\x6D\x69\x74\x20\x68\x61\x76\x65\x20\x62\x65\x65\x6E\x20\x72\x65\x61\x63\x68\x65\x64","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x61\x64\x6D\x69\x6E","\x75\x73\x65\x72","\x63\x6F\x75\x6E\x74","\x4C\x69\x63\x65\x6E\x73\x65\x20\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73\x20\x6C\x69\x6D\x69\x74\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73","\x4D\x61\x78\x69\x6D\x75\x6D\x20\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73\x20\x6C\x69\x6D\x69\x74\x20\x68\x61\x76\x65\x20\x62\x65\x65\x6E\x20\x72\x65\x61\x63\x68\x65\x64","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74","\x6F\x6E\x6C\x69\x6E\x65","\x4C\x69\x63\x65\x6E\x73\x65\x20\x61\x67\x65\x6E\x74\x20\x76\x61\x6C\x69\x64\x69\x74\x79\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x61\x67\x65\x6E\x74\x73","\x2D","\x73\x70\x6C\x69\x74","\x61\x65\x73\x2D\x32\x35\x36\x2D\x63\x74\x72","\x25\x73\x3A\x25\x73\x3A\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x63\x72\x65\x61\x74\x65\x44\x65\x63\x69\x70\x68\x65\x72","\x62\x61\x73\x65\x36\x34","\x66\x69\x6E\x61\x6C","\x67\x65\x74\x55\x75\x69\x64","\x69\x73\x56\x61\x6C\x69\x64\x44\x61\x74\x65","\x69\x73\x55\x73\x65\x72\x73\x4C\x69\x6D\x69\x74","\x69\x73\x54\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73\x4C\x69\x6D\x69\x74","\x68\x61\x73\x43\x68\x61\x74","\x68\x61\x73\x4D\x61\x69\x6C","\x68\x61\x73\x46\x61\x78","\x68\x61\x73\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x68\x61\x73\x53\x6D\x73","\x68\x61\x73\x4A\x73\x63\x72\x69\x70\x74\x79","\x68\x61\x73\x43\x6D","\x68\x61\x73\x55\x70\x64\x61\x74\x65","\x69\x73\x56\x61\x6C\x69\x64\x41\x67\x65\x6E\x74","\x64\x65\x6D\x6F\x4C\x69\x63\x65\x6E\x73\x65","\x64\x65\x63\x72\x79\x70\x74"];_0x7cf7[0];var compose=require(_0x7cf7[1]);var moment=require(_0x7cf7[2]);var crypto=require(_0x7cf7[3]);var util=require(_0x7cf7[4]);var os=require(_0x7cf7[5]);var exec=require(_0x7cf7[7])[_0x7cf7[6]];var config=require(_0x7cf7[8]);var logger=require(_0x7cf7[10])(_0x7cf7[9]);var User=require(_0x7cf7[12])[_0x7cf7[11]];var Telephone=require(_0x7cf7[12])[_0x7cf7[13]];var Setting=require(_0x7cf7[12])[_0x7cf7[14]];var License=require(_0x7cf7[12])[_0x7cf7[15]];var demoLicense={demo:true,users:1,agents:1,telephones:0,chat:false,mail:false,fax:false,jscripty:false,messaging:false,openchannel:false,custom:false,cm:false,dialer:false,update:false,description:_0x7cf7[16]};function getUuid(){switch(os[_0x7cf7[24]]()){case _0x7cf7[22]:return exec(_0x7cf7[20],{encoding:_0x7cf7[21]})[_0x7cf7[19]](_0x7cf7[17],_0x7cf7[18]);default:return require(_0x7cf7[23])(true)}}function checkLicense(_0xbeb6x10){return compose()[_0x7cf7[36]](function(_0xbeb6x11,_0xbeb6x12,_0xbeb6x13){return License[_0x7cf7[35]]({where:{id:1}})[_0x7cf7[34]](function(_0xbeb6x15){var _0xbeb6x16=null;var _0xbeb6x17=false;try{if(_0xbeb6x15[_0x7cf7[26]]){_0xbeb6x16= decrypt(_0xbeb6x15[_0x7cf7[26]],_0xbeb6x15[_0x7cf7[27]]);_0xbeb6x16= JSON[_0x7cf7[28]](_0xbeb6x16);_0xbeb6x16[_0x7cf7[29]]= false}else {_0xbeb6x16= demoLicense;_0xbeb6x16[_0x7cf7[29]]= true}}catch(err){logger[_0x7cf7[32]](_0x7cf7[30],err[_0x7cf7[31]]);_0xbeb6x16= demoLicense;_0xbeb6x16[_0x7cf7[29]]= true};_0xbeb6x17= _0xbeb6x16[_0xbeb6x10];if(!_0xbeb6x17){return _0xbeb6x12[_0x7cf7[33]](403)};return _0xbeb6x13()})[_0x7cf7[25]](function(_0xbeb6x14){return _0xbeb6x13(_0xbeb6x14)})})}function hasChat(){return checkLicense(_0x7cf7[37])}function hasSms(){return checkLicense(_0x7cf7[38])}function hasCm(){return checkLicense(_0x7cf7[39])}function hasUpdate(){return checkLicense(_0x7cf7[40])}function hasMail(){return checkLicense(_0x7cf7[41])}function hasFax(){return checkLicense(_0x7cf7[42])}function hasJscripty(){return checkLicense(_0x7cf7[43])}function hasCustom(){return checkLicense(_0x7cf7[44])}function hasOpenchannel(){return checkLicense(_0x7cf7[45])}function isValidDate(){return compose()[_0x7cf7[36]](function(_0xbeb6x11,_0xbeb6x12,_0xbeb6x13){return License[_0x7cf7[35]]({where:{id:1}})[_0x7cf7[34]](function(_0xbeb6x15){var _0xbeb6x16=null,_0xbeb6x22=false;try{if(_0xbeb6x15[_0x7cf7[26]]){_0xbeb6x16= decrypt(_0xbeb6x15[_0x7cf7[26]],_0xbeb6x15[_0x7cf7[27]]);_0xbeb6x16= JSON[_0x7cf7[28]](_0xbeb6x16);if(moment()[_0x7cf7[47]](_0xbeb6x16[_0x7cf7[46]])){_0xbeb6x22= true}}}catch(err){logger[_0x7cf7[49]](_0x7cf7[48],err[_0x7cf7[31]])};if(!_0xbeb6x22){return _0xbeb6x12[_0x7cf7[33]](403)};return _0xbeb6x13()})[_0x7cf7[25]](function(_0xbeb6x14){return _0xbeb6x13(_0xbeb6x14)})})}function isUsersLimit(){return compose()[_0x7cf7[36]](function(_0xbeb6x11,_0xbeb6x12,_0xbeb6x13){var _0xbeb6x15;return License[_0x7cf7[35]]({where:{id:1}})[_0x7cf7[34]](function(_0xbeb6x26){_0xbeb6x15= _0xbeb6x26;return User[_0x7cf7[58]]({where:{$or:[{role:_0x7cf7[56]},{role:_0x7cf7[57]}]}})})[_0x7cf7[55]](function(_0xbeb6x24){var _0xbeb6x16=null,_0xbeb6x25=false;try{if(_0xbeb6x15[_0x7cf7[26]]){_0xbeb6x16= decrypt(_0xbeb6x15[_0x7cf7[26]],_0xbeb6x15[_0x7cf7[27]]);_0xbeb6x16= JSON[_0x7cf7[28]](_0xbeb6x16)}else {_0xbeb6x16= demoLicense}}catch(err){logger[_0x7cf7[49]](_0x7cf7[50],err[_0x7cf7[31]]);_0xbeb6x16= demoLicense};if(_0xbeb6x16[_0x7cf7[51]]> _0xbeb6x24){_0xbeb6x25= true};if(!_0xbeb6x25){return _0xbeb6x12[_0x7cf7[54]](403)[_0x7cf7[53]]({message:_0x7cf7[52]})};return _0xbeb6x13()})[_0x7cf7[25]](function(_0xbeb6x14){return _0xbeb6x13(_0xbeb6x14)})})}function isTelephonesLimit(){return compose()[_0x7cf7[36]](function(_0xbeb6x11,_0xbeb6x12,_0xbeb6x13){var _0xbeb6x15;return License[_0x7cf7[35]]({where:{id:1}})[_0x7cf7[34]](function(_0xbeb6x26){_0xbeb6x15= _0xbeb6x26;return User[_0x7cf7[58]]({where:{role:_0x7cf7[62]}})})[_0x7cf7[55]](function(_0xbeb6x28){var _0xbeb6x16=null,_0xbeb6x25=false;try{if(_0xbeb6x15[_0x7cf7[26]]){_0xbeb6x16= decrypt(_0xbeb6x15[_0x7cf7[26]],_0xbeb6x15[_0x7cf7[27]]);_0xbeb6x16= JSON[_0x7cf7[28]](_0xbeb6x16)}else {_0xbeb6x16= demoLicense}}catch(err){logger[_0x7cf7[49]](_0x7cf7[59],err[_0x7cf7[31]]);_0xbeb6x16= demoLicense};if(_0xbeb6x16[_0x7cf7[60]]> _0xbeb6x28){_0xbeb6x25= true};if(!_0xbeb6x25){return _0xbeb6x12[_0x7cf7[54]](403)[_0x7cf7[53]]({message:_0x7cf7[61]})};return _0xbeb6x13()})[_0x7cf7[25]](function(_0xbeb6x14){return _0xbeb6x13(_0xbeb6x14)})})}function isValidAgent(){return function(_0xbeb6x2a){var _0xbeb6x15;var _0xbeb6x2b=false;if(_0xbeb6x2a[_0x7cf7[63]]=== _0x7cf7[56]|| _0xbeb6x2a[_0x7cf7[63]]=== _0x7cf7[57]|| (_0xbeb6x2a[_0x7cf7[63]]=== _0x7cf7[64]&& _0xbeb6x2a[_0x7cf7[65]])){_0xbeb6x2b= true};return License[_0x7cf7[35]]({where:{id:1}})[_0x7cf7[34]](function(_0xbeb6x26){_0xbeb6x15= _0xbeb6x26;return User[_0x7cf7[58]]({where:{role:_0x7cf7[64],online:true}})})[_0x7cf7[55]](function(_0xbeb6x2c){var _0xbeb6x16=null;try{if(_0xbeb6x15[_0x7cf7[26]]){_0xbeb6x16= decrypt(_0xbeb6x15[_0x7cf7[26]],_0xbeb6x15[_0x7cf7[27]]);_0xbeb6x16= JSON[_0x7cf7[28]](_0xbeb6x16)}else {_0xbeb6x16= demoLicense}}catch(err){logger[_0x7cf7[49]](_0x7cf7[66],err);_0xbeb6x16= demoLicense};if(_0xbeb6x16[_0x7cf7[67]]> _0xbeb6x2c){_0xbeb6x2b= true};return _0xbeb6x2b})}}function decrypt(_0xbeb6x2e,_0xbeb6x2f){var _0xbeb6x30=_0xbeb6x2f[_0x7cf7[69]](_0x7cf7[68])[4];var _0xbeb6x31=_0xbeb6x2f[_0x7cf7[69]](_0x7cf7[68])[0];var _0xbeb6x32=crypto[_0x7cf7[73]](_0x7cf7[70],util[_0x7cf7[72]](_0x7cf7[71],_0xbeb6x30,_0xbeb6x2f,_0xbeb6x31));var _0xbeb6x15=_0xbeb6x32[_0x7cf7[40]](_0xbeb6x2e,_0x7cf7[74],_0x7cf7[21]);_0xbeb6x15+= _0xbeb6x32[_0x7cf7[75]](_0x7cf7[21]);return _0xbeb6x15}exports[_0x7cf7[76]]= getUuid;exports[_0x7cf7[77]]= isValidDate;exports[_0x7cf7[78]]= isUsersLimit;exports[_0x7cf7[79]]= isTelephonesLimit;exports[_0x7cf7[80]]= hasChat;exports[_0x7cf7[81]]= hasMail;exports[_0x7cf7[82]]= hasFax;exports[_0x7cf7[83]]= hasOpenchannel;exports[_0x7cf7[84]]= hasSms;exports[_0x7cf7[85]]= hasJscripty;exports[_0x7cf7[86]]= hasCm;exports[_0x7cf7[87]]= hasUpdate;exports[_0x7cf7[88]]= isValidAgent;exports[_0x7cf7[89]]= demoLicense;exports[_0x7cf7[90]]= decrypt