Built motion from commit (unavailable).|2.4.21
[motion2.git] / server / components / parsers / qs.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x57c3=['length','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','push','join','lodash','sequelize','fields','filters','isEmpty','isArray','parse','split','limit','offset','sort','map','indexOf','priority','cast','col','substr','DESC','unsigned','ASC','omit','isObject','isString'];(function(_0x1b9c0c,_0x4266ea){var _0x1f7b63=function(_0x4ae1cf){while(--_0x4ae1cf){_0x1b9c0c['push'](_0x1b9c0c['shift']());}};_0x1f7b63(++_0x4266ea);}(_0x57c3,0xc2));var _0x357c=function(_0x222f0c,_0x5557e8){_0x222f0c=_0x222f0c-0x0;var _0x4c6e5e=_0x57c3[_0x222f0c];return _0x4c6e5e;};'use strict';var _=require(_0x357c('0x0'));var sequelize=require(_0x357c('0x1'));var LIMIT_VALUE=0xfa;exports[_0x357c('0x2')]=function(_0x48957b){var _0x580dd6=null;if(_0x48957b){_0x580dd6=_0x48957b['split'](',');}return _0x580dd6;};exports[_0x357c('0x3')]=function(_0x1b6624){var _0x2aef77={};if(!_[_0x357c('0x4')](_0x1b6624)){_0x2aef77={};_['forOwn'](_0x1b6624,function(_0x2ea232,_0x4ef0ce){try{_0x2aef77[_0x4ef0ce]=_[_0x357c('0x5')](_0x2ea232)?_0x2ea232:JSON[_0x357c('0x6')](_0x2ea232);}catch(_0x2320eb){_0x2aef77[_0x4ef0ce]=_0x2ea232[_0x357c('0x7')](',');}});}return _0x2aef77;};exports[_0x357c('0x8')]=function(_0x1e4977){_0x1e4977=parseInt(_0x1e4977,0xa);if(!_0x1e4977||_0x1e4977<0x0){_0x1e4977=LIMIT_VALUE;}return _0x1e4977;};exports[_0x357c('0x9')]=function(_0x4e7812){_0x4e7812=parseInt(_0x4e7812,0xa);if(!_0x4e7812||_0x4e7812<0x0){_0x4e7812=0x0;}return _0x4e7812;};exports[_0x357c('0xa')]=function(_0x1c30bd){var _0x214216,_0x14f062=null;if(_0x1c30bd){_0x214216=_0x1c30bd[_0x357c('0x7')](',');_0x14f062=_[_0x357c('0xb')](_0x214216,function(_0x271d88){if(_0x271d88[_0x357c('0xc')]('-')===0x0){return[_0x271d88===_0x357c('0xd')?sequelize[_0x357c('0xe')](sequelize[_0x357c('0xf')](_0x357c('0xd')),'unsigned'):_0x271d88[_0x357c('0x10')](0x1),_0x357c('0x11')];}else{return[_0x271d88===_0x357c('0xd')?sequelize['cast'](sequelize['col'](_0x357c('0xd')),_0x357c('0x12')):_0x271d88,_0x357c('0x13')];}});}return _0x14f062;};exports[_0x357c('0x14')]=function(_0xe9ad54,_0xf2ccec){if(_['isEmpty'](_0xe9ad54)){return _0xe9ad54;}if(_[_0x357c('0x5')](_0xe9ad54)){for(var _0x288ed7=0x0;_0x288ed7<_0xe9ad54['length'];_0x288ed7+=0x1){_0xe9ad54[_0x288ed7]=this['omit'](_0xe9ad54[_0x288ed7],_0xf2ccec);}return _0xe9ad54;}if(!_[_0x357c('0x15')](_0xe9ad54)){return _0xe9ad54;}if(_[_0x357c('0x16')](_0xf2ccec)){_0xf2ccec=[_0xf2ccec];}if(!_[_0x357c('0x5')](_0xf2ccec)){return _0xe9ad54;}for(var _0x5bf715=0x0;_0x5bf715<_0xf2ccec[_0x357c('0x17')];_0x5bf715+=0x1){_[_0x357c('0x18')](_0xe9ad54,_0xf2ccec[_0x5bf715]);}for(var _0x1ddb95 in _0xe9ad54){if(_0xe9ad54[_0x357c('0x19')](_0x1ddb95)){_0xe9ad54[_0x1ddb95]=this[_0x357c('0x14')](_0xe9ad54[_0x1ddb95],_0xf2ccec);}}return _0xe9ad54;};exports[_0x357c('0x1a')]=function(_0xb60cf9){return _0xb60cf9[_0x357c('0x1b')](RegExp(_0x357c('0x1c')))?!![]:![];};exports['isEmail']=function(_0x147b66){return _0x147b66[_0x357c('0x1b')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x51f71f){var _0x12879b=[];_0x51f71f[_0x357c('0x7')]('\x20')['forEach'](function(_0x437762){_0x12879b[_0x357c('0x1d')]('+'+_0x437762['toString']()+'*');});return _0x12879b[_0x357c('0x1e')]('\x20');};