e6b7b41d9b039cfccbc2616d2e1c6c1db5659d70
[motion.git] / server / config / integrations / zendesk.js
1 var _0x7f8a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x75\x72\x6C","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x5A\x65\x6E\x64\x65\x73\x6B\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x55\x73\x65\x72","\x5A\x65\x6E\x64\x65\x73\x6B\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x69\x6E\x66\x6F","\x68\x61\x6E\x64\x6C\x65\x45\x76\x65\x6E\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x50\x61\x73\x73\x65\x64\x20\x70\x61\x72\x61\x6D\x65\x74\x65\x72\x73\x20\x61\x72\x65\x20\x6E\x6F\x74\x20\x65\x6E\x6F\x75\x67\x68\x20\x74\x6F\x20\x63\x72\x65\x61\x74\x65\x20\x61\x20\x6E\x65\x77\x20\x74\x69\x63\x6B\x65\x74\x3A\x20\x6D\x69\x73\x73\x20\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64\x20\x6F\x72\x20\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x49\x64","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x66\x69\x6E\x64","\x63\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x75\x72\x69","\x68\x65\x61\x64\x65\x72\x73","\x73\x65\x72\x76\x65\x72\x55\x52\x4C","\x73\x65\x72\x76\x65\x72\x55\x72\x6C","\x5A\x65\x6E\x64\x65\x73\x6B\x41\x63\x63\x6F\x75\x6E\x74","\x72\x65\x6D\x6F\x74\x65\x55\x72\x69","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x61\x67\x65\x6E\x74","\x73\x63\x6F\x70\x65","\x61\x67\x65\x6E\x74\x4E\x61\x6D\x65","\x71\x75\x65\x75\x65","\x6E\x61\x6D\x65","\x6D\x6F\x6E\x69\x74\x6F\x72\x5F\x66\x6F\x72\x6D\x61\x74","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x65\x6E\x61\x62\x6C\x65\x64\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x51\x75\x65\x75\x65","\x72\x65\x63\x6F\x72\x64\x45\x6E\x61\x62\x6C\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x51\x75\x65\x75\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x20\x6F\x72\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x6E\x6F\x74\x20\x65\x6E\x61\x62\x6C\x65\x64","\x72\x6F\x75\x74\x65\x49\x64","\x69\x64","\x72\x65\x63\x6F\x72\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x65\x6E\x61\x62\x6C\x65\x64\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x52\x6F\x75\x74\x65\x20\x4F\x75\x74\x62\x6F\x75\x6E\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x52\x6F\x75\x74\x65\x20\x4F\x75\x74\x62\x6F\x75\x6E\x64\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x20\x6F\x72\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x6E\x6F\x74\x20\x65\x6E\x61\x62\x6C\x65\x64","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x61\x75\x74\x68\x54\x79\x70\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x3A","\x74\x6F\x6B\x65\x6E","\x2F\x74\x6F\x6B\x65\x6E\x3A","\x41\x75\x74\x68\x6F\x72\x69\x7A\x61\x74\x69\x6F\x6E","\x42\x61\x73\x69\x63\x20","\x62\x61\x73\x65\x36\x34","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x41\x67\x65\x6E\x74\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x2F\x73\x65\x61\x72\x63\x68\x2E\x6A\x73\x6F\x6E","\x74\x79\x70\x65\x3A\x75\x73\x65\x72\x20\x72\x6F\x6C\x65\x3A\x61\x67\x65\x6E\x74\x20\x6E\x61\x6D\x65\x3A\x25\x73","\x66\x6F\x72\x6D\x61\x74","","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x76\x6F\x69\x63\x65","\x43\x68\x61\x6E\x6E\x65\x6C\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64\x3A","\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x55\x52\x4C","\x25\x73\x2F\x61\x70\x69\x2F\x76\x6F\x69\x63\x65\x2F\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x73\x2F\x25\x73\x2F\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x3F\x74\x79\x70\x65\x3D\x75\x6E\x69\x71\x75\x65\x69\x64","\x75\x6E\x69\x71\x75\x65\x69\x64","\x72\x65\x73\x75\x6C\x74","\x6C\x65\x6E\x67\x74\x68","\x72\x65\x73\x75\x6C\x74\x73","\x63\x6F\x75\x6E\x74","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x41\x67\x65\x6E\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x66\x69\x72\x73\x74","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x41\x67\x65\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2E\x20\x55\x73\x65\x20\x74\x68\x65\x20\x61\x64\x6D\x69\x6E\x20\x61\x63\x63\x6F\x75\x6E\x74","\x2F\x75\x73\x65\x72\x73\x2F\x6D\x65\x2E\x6A\x73\x6F\x6E","\x75\x73\x65\x72","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x41\x64\x6D\x69\x6E\x20\x73\x65\x6C\x65\x63\x74\x65\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x6E\x64\x20\x55\x73\x65\x72\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x74\x79\x70\x65\x3A\x75\x73\x65\x72\x20\x72\x6F\x6C\x65\x3A\x65\x6E\x64\x2D\x75\x73\x65\x72\x20\x25\x73\x3A\x25\x73","\x70\x68\x6F\x6E\x65","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x6E\x64\x20\x55\x73\x65\x72\x20\x66\x6F\x75\x6E\x64\x3A","\x65\x6E\x64\x75\x73\x65\x72","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x6E\x64\x20\x55\x73\x65\x72\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x64\x65\x62\x75\x67","\x2F\x75\x73\x65\x72\x73\x2E\x6A\x73\x6F\x6E","\x50\x4F\x53\x54","\x65\x6E\x64\x2D\x75\x73\x65\x72","\x43\x61\x6C\x6C\x65\x72\x20\x2D\x20\x25\x73","\x3C\x75\x6E\x6B\x6E\x6F\x77\x6E\x3E","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x6E\x64\x20\x55\x73\x65\x72\x20\x63\x72\x65\x61\x74\x65\x64\x3A","\x76\x61\x6C\x75\x65","\x66\x6F\x72\x45\x61\x63\x68","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x54\x69\x63\x6B\x65\x74\x20\x62\x6F\x64\x79\x3A","\x2F\x74\x69\x63\x6B\x65\x74\x73\x2E\x6A\x73\x6F\x6E","\x54\x61\x67\x73","\x6D\x61\x70","\x53\x75\x62\x6A\x65\x63\x74","\x73\x6F\x72\x74\x42\x79","\x74\x79\x70\x65","\x73\x74\x72\x69\x6E\x67","\x63\x6F\x6E\x74\x65\x6E\x74","\x70\x75\x73\x68","\x76\x61\x72\x69\x61\x62\x6C\x65","\x76\x61\x72\x69\x61\x62\x6C\x65\x4E\x61\x6D\x65","\x63\x75\x73\x74\x6F\x6D\x56\x61\x72\x69\x61\x62\x6C\x65","\x56\x61\x72\x69\x61\x62\x6C\x65","\x20","\x6A\x6F\x69\x6E","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x6B\x65\x79\x56\x61\x6C\x75\x65","\x6B\x65\x79\x54\x79\x70\x65","\x6B\x65\x79","\x25\x73\x3A\x20\x25\x73","\x6B\x65\x79\x43\x6F\x6E\x74\x65\x6E\x74","\x0A","\x46\x69\x65\x6C\x64","\x66\x69\x6C\x74\x65\x72","\x69\x64\x46\x69\x65\x6C\x64","\x6E\x61\x6D\x65\x46\x69\x65\x6C\x64","\x74\x69\x63\x6B\x65\x74","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x54\x69\x63\x6B\x65\x74\x20\x63\x72\x65\x61\x74\x65\x64","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x54\x61\x62","\x2F\x63\x68\x61\x6E\x6E\x65\x6C\x73\x2F\x76\x6F\x69\x63\x65\x2F\x61\x67\x65\x6E\x74\x73\x2F\x25\x64\x2F\x74\x69\x63\x6B\x65\x74\x73\x2F\x25\x64\x2F\x64\x69\x73\x70\x6C\x61\x79\x2E\x6A\x73\x6F\x6E","\x70\x61\x72\x73\x65","\x70\x61\x74\x68","\x73\x65\x61\x72\x63\x68","\x68\x72\x65\x66","\x71\x75\x65\x72\x79","\x70\x61\x74\x68\x6E\x61\x6D\x65","\x74\x61\x62\x55\x72\x6C","\x25\x73\x2F\x61\x67\x65\x6E\x74\x2F\x74\x69\x63\x6B\x65\x74\x73\x2F\x25\x73","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x7A\x65\x6E\x64\x65\x73\x6B","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x65\x78\x69\x74\x53\x74\x61\x74\x75\x73","\x73\x75\x63\x63\x65\x73\x73","\x74\x69\x63\x6B\x65\x74\x49\x64","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64","\x73\x75\x62\x74\x79\x70\x65\x43\x68\x61\x6E\x6E\x65\x6C","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x72\x65\x70\x6F\x72\x74\x5F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x3A\x7A\x65\x6E\x64\x65\x73\x6B","\x65\x6D\x69\x74","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x74\x6F","\x63\x72\x65\x61\x74\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x54\x69\x63\x6B\x65\x74\x20\x25\x64\x20\x25\x73\x20\x74\x6F\x20\x61\x67\x65\x6E\x74\x20\x25\x64","\x6F\x70\x65\x6E\x65\x64","\x64\x69\x73\x70\x6C\x61\x79\x65\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x74\x69\x63\x6B\x65\x74\x20\x63\x72\x65\x61\x74\x69\x6F\x6E","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x3A","\x6D\x65\x73\x73\x61\x67\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x53\x74\x61\x63\x6B\x3A","\x73\x74\x61\x63\x6B","\x66\x61\x69\x6C\x65\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x52\x65\x70\x6F\x72\x74\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x63\x72\x65\x61\x74\x65","\x73\x75\x62\x73\x74\x72","\x2F","\x65\x78\x70\x6F\x72\x74\x73"];_0x7f8a[0];var _=require(_0x7f8a[1]);var util=require(_0x7f8a[2]);var url=require(_0x7f8a[3]);var rp=require(_0x7f8a[4]);var logger=require(_0x7f8a[6])(_0x7f8a[5]);var ZendeskConfiguration=require(_0x7f8a[8])[_0x7f8a[7]];var ReportIntegration=require(_0x7f8a[8])[_0x7f8a[9]];var VoiceQueue=require(_0x7f8a[8])[_0x7f8a[10]];var VoiceExtension=require(_0x7f8a[8])[_0x7f8a[11]];var Agent=require(_0x7f8a[8])[_0x7f8a[12]];function Zendesk(){logger[_0x7f8a[14]](_0x7f8a[13])}Zendesk[_0x7f8a[16]][_0x7f8a[15]]= function(_0xa72dxc,_0xa72dxd,_0xa72dxe,_0xa72dxf,_0xa72dx10,_0xa72dx11,_0xa72dx12){var _0xa72dx13={uri:undefined,headers:undefined,agent:undefined,enduser:undefined,ticket:undefined,configuration:undefined,recordEnable:false,serverURL:undefined,agentName:undefined,tabUrl:undefined};if(!_0xa72dxc||  !_0xa72dxd){logger[_0x7f8a[18]](_0x7f8a[17]);return};ZendeskConfiguration[_0x7f8a[21]]({where:{id:_0xa72dxd,AccountId:_0xa72dxc},include:[{all:true,include:[{all:true}]}]})[_0x7f8a[20]](handleEntityNotFound())[_0x7f8a[20]](handleConnection(_0xa72dx13))[_0x7f8a[20]](searchMotionAgent(_0xa72dxe,_0xa72dx10))[_0x7f8a[20]](handleMotionAgent(_0xa72dx13))[_0x7f8a[20]](searchQueue(_0xa72dx10))[_0x7f8a[20]](handleQueueRecordings(_0xa72dx13,_0xa72dx10))[_0x7f8a[20]](searchRoute(_0xa72dx10))[_0x7f8a[20]](handleOutboundRecordings(_0xa72dx13,_0xa72dx10))[_0x7f8a[20]](searchAgent(_0xa72dx13))[_0x7f8a[20]](handleAgent(_0xa72dx13))[_0x7f8a[20]](searchAdmin(_0xa72dx13))[_0x7f8a[20]](handleAdmin(_0xa72dx13))[_0x7f8a[20]](searchEndUser(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxf))[_0x7f8a[20]](handleEndUser(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxf))[_0x7f8a[20]](endUserCreation(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxf))[_0x7f8a[20]](handleEndUserCreation(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxf))[_0x7f8a[20]](ticketCreation(_0xa72dx13,_0xa72dx10,_0xa72dx11))[_0x7f8a[20]](handleTicketDisplay(_0xa72dx13))[_0x7f8a[20]](handleReportIntegration(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxc,_0xa72dxf,_0xa72dx12))[_0x7f8a[20]](handleEnd(_0xa72dx13))[_0x7f8a[19]](handleError(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxc))};function handleEntityNotFound(){return function(_0xa72dx15){if(!_0xa72dx15){return null};return _0xa72dx15}}function handleConnection(_0xa72dx13){return function(_0xa72dx17){var _0xa72dx18=getAccountConfiguration(_0xa72dx17.ZendeskAccount);_0xa72dx13[_0x7f8a[22]]= _0xa72dx17;_0xa72dx13[_0x7f8a[23]]= _0xa72dx18[_0x7f8a[23]];_0xa72dx13[_0x7f8a[24]]= _0xa72dx18[_0x7f8a[24]];_0xa72dx13[_0x7f8a[25]]= _0xa72dx17[_0x7f8a[27]][_0x7f8a[26]];_0xa72dx13[_0x7f8a[28]]= _0xa72dx17[_0x7f8a[27]][_0x7f8a[28]]}}function searchMotionAgent(_0xa72dxe,_0xa72dx10){return function(){var _0xa72dx1a=getAgentSearchPropertyFromChannel(_0xa72dxe);if(_0xa72dx10[_0x7f8a[29]](_0xa72dx1a)){return Agent[_0x7f8a[33]](_0x7f8a[32])[_0x7f8a[31]]({where:{name:getValueFromPropertyName(_0xa72dx10,_0xa72dx1a)},attributes:[_0x7f8a[30]]})};return}}function handleMotionAgent(_0xa72dx13){return function(_0xa72dx1c){if(_0xa72dx1c&& _0xa72dx1c[_0x7f8a[30]]){_0xa72dx13[_0x7f8a[34]]= _0xa72dx1c[_0x7f8a[30]]};return}}function searchQueue(_0xa72dx10){return function(){if(_0xa72dx10[_0x7f8a[35]]){return VoiceQueue[_0x7f8a[31]]({where:{name:_0xa72dx10[_0x7f8a[35]]},attributes:[_0x7f8a[36],_0x7f8a[37]]})}else {return}}}function handleQueueRecordings(_0xa72dx13,_0xa72dx10){return function(_0xa72dx1f){if(_0xa72dx10[_0x7f8a[35]]){if(_0xa72dx1f&& _0xa72dx1f[_0x7f8a[37]]){logger[_0x7f8a[14]](_0x7f8a[38],_0xa72dx1f[_0x7f8a[36]]);_0xa72dx13[_0x7f8a[39]]= true}else {_0xa72dx13[_0x7f8a[39]]= false;logger[_0x7f8a[14]](_0x7f8a[40])}};return}}function searchRoute(_0xa72dx10){return function(){if(_0xa72dx10[_0x7f8a[41]]){return VoiceExtension[_0x7f8a[31]]({where:{id:_0xa72dx10[_0x7f8a[41]]},attributes:[_0x7f8a[42],_0x7f8a[43]]})}else {return}}}function handleOutboundRecordings(_0xa72dx13,_0xa72dx10){return function(_0xa72dx22){if(_0xa72dx10[_0x7f8a[41]]){if(_0xa72dx22&& _0xa72dx22[_0x7f8a[43]]){logger[_0x7f8a[14]](_0x7f8a[44],_0xa72dx22[_0x7f8a[42]]);_0xa72dx13[_0x7f8a[39]]= true}else {_0xa72dx13[_0x7f8a[39]]= false;logger[_0x7f8a[14]](_0x7f8a[45])}};return}}function getAccountConfiguration(_0xa72dx24){var _0xa72dx25={uri:stripTrailingSlash(_0xa72dx24[_0x7f8a[28]]),headers:{"\x41\x75\x74\x68\x6F\x72\x69\x7A\x61\x74\x69\x6F\x6E":undefined,"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x7f8a[46],"\x41\x63\x63\x65\x70\x74":_0x7f8a[46]}};var _0xa72dx26=_0xa72dx24[_0x7f8a[47]];if(_0xa72dx24[_0x7f8a[48]]=== _0x7f8a[49]){_0xa72dx26= _0xa72dx26+ _0x7f8a[50]+ _0xa72dx24[_0x7f8a[49]]}else {if(_0xa72dx24[_0x7f8a[48]]=== _0x7f8a[51]){_0xa72dx26= _0xa72dx26+ _0x7f8a[52]+ _0xa72dx24[_0x7f8a[51]]}};_0xa72dx25[_0x7f8a[24]][_0x7f8a[53]]= _0x7f8a[54]+  new Buffer(_0xa72dx26).toString(_0x7f8a[55]);return _0xa72dx25}function searchAgent(_0xa72dx13){return function(){if(_0xa72dx13[_0x7f8a[34]]){logger[_0x7f8a[14]](_0x7f8a[56],_0xa72dx13[_0x7f8a[34]]);return rp({uri:_0xa72dx13[_0x7f8a[23]]+ _0x7f8a[57],qs:{"\x71\x75\x65\x72\x79":util[_0x7f8a[59]](_0x7f8a[58],_0xa72dx13[_0x7f8a[34]])},headers:_0xa72dx13[_0x7f8a[24]],json:true})};return}}function getAgentSearchPropertyFromChannel(_0xa72dxe){var _0xa72dx29=_0x7f8a[60];if(_0xa72dxe){switch(_0xa72dxe){case _0x7f8a[62]:_0xa72dx29= _0x7f8a[61];break;default:_0xa72dx29= _0x7f8a[61];logger[_0x7f8a[18]](_0x7f8a[63],_0xa72dxe)}};return _0xa72dx29}function getValueFromPropertyName(_0xa72dx10,_0xa72dx29,_0xa72dx13){if(_0xa72dx29=== _0x7f8a[64]){if(_0xa72dx13&& _0xa72dx13[_0x7f8a[39]]&& _0xa72dx13[_0x7f8a[25]]){return util[_0x7f8a[59]](_0x7f8a[65],stripTrailingSlash(_0xa72dx13[_0x7f8a[25]]),_0xa72dx10[_0x7f8a[66]])}else {return null}}else {return _[_0x7f8a[67]](_0xa72dx10,_0xa72dx29)}}function handleAgent(_0xa72dx13){return function(_0xa72dx10){if(_0xa72dx10&& _0xa72dx10[_0x7f8a[69]][_0x7f8a[68]]> 0&& _0xa72dx10[_0x7f8a[70]]> 0){logger[_0x7f8a[14]](_0x7f8a[71],_0xa72dx13[_0x7f8a[34]]);_0xa72dx13[_0x7f8a[32]]= getMatchObject(_0xa72dx10[_0x7f8a[69]],_0x7f8a[36],_0xa72dx13[_0x7f8a[34]]);return _0xa72dx13[_0x7f8a[32]]};return}}function getMatchObject(_0xa72dx2d,_0xa72dx29,_0xa72dx2e){var _0xa72dx2f=_[_0x7f8a[21]](_0xa72dx2d,{property:_0xa72dx2e});if(_0xa72dx2f){return _0xa72dx2f};return _[_0x7f8a[72]](_0xa72dx2d)}function searchAdmin(_0xa72dx13){return function(_0xa72dx10){if(_0xa72dx10){return};logger[_0x7f8a[14]](_0x7f8a[73]);return rp({uri:_0xa72dx13[_0x7f8a[23]]+ _0x7f8a[74],headers:_0xa72dx13[_0x7f8a[24]],json:true})}}function handleAdmin(_0xa72dx13){return function(_0xa72dx10){if(!_0xa72dx10){return};if(_0xa72dx10[_0x7f8a[75]]){logger[_0x7f8a[14]](_0x7f8a[76]);_0xa72dx13[_0x7f8a[32]]= _0xa72dx10[_0x7f8a[75]]};return}}function searchEndUser(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxf){return function(){logger[_0x7f8a[14]](_0x7f8a[77],getValueFromPropertyName(_0xa72dx10,getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf)));return rp({uri:_0xa72dx13[_0x7f8a[23]]+ _0x7f8a[57],qs:{"\x71\x75\x65\x72\x79":util[_0x7f8a[59]](_0x7f8a[78],getEndUserSearchQueryFromChannel(_0xa72dxe),getValueFromPropertyName(_0xa72dx10,getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf)))},headers:_0xa72dx13[_0x7f8a[24]],json:true})}}function getEndUserSearchQueryFromChannel(_0xa72dxe){var _0xa72dx29=_0x7f8a[60];if(_0xa72dxe){switch(_0xa72dxe){case _0x7f8a[62]:_0xa72dx29= _0x7f8a[79];break;default:_0xa72dx29= _0x7f8a[79];logger[_0x7f8a[18]](_0x7f8a[63],_0xa72dxe)}};return _0xa72dx29}function getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf){var _0xa72dx29=_0x7f8a[60];if(_0xa72dxe){switch(_0xa72dxe){case _0x7f8a[62]:if(_0xa72dxf=== _0x7f8a[80]){_0xa72dx29= _0x7f8a[81]}else {if(_0xa72dxf=== _0x7f8a[35]){_0xa72dx29= _0x7f8a[82]}};break;default:_0xa72dx29= _0x7f8a[82];logger[_0x7f8a[18]](_0x7f8a[63],_0xa72dxe)}};return _0xa72dx29}function getEndUserNamePropertyFromChannel(_0xa72dxe,_0xa72dxf){var _0xa72dx29=_0x7f8a[60];if(_0xa72dxe){switch(_0xa72dxe){case _0x7f8a[62]:if(_0xa72dxf=== _0x7f8a[80]){_0xa72dx29= _0x7f8a[83]}else {if(_0xa72dxf=== _0x7f8a[35]){_0xa72dx29= _0x7f8a[84]}};break;default:_0xa72dx29= _0x7f8a[84];logger[_0x7f8a[18]](_0x7f8a[63],_0xa72dxe)}};return _0xa72dx29}function handleEndUser(_0xa72dx13,_0xa72dxe,_0xa72dx37,_0xa72dxf){return function(_0xa72dx10){if(_0xa72dx10[_0x7f8a[69]][_0x7f8a[68]]> 0&& _0xa72dx10[_0x7f8a[70]]> 0){logger[_0x7f8a[14]](_0x7f8a[85],getValueFromPropertyName(_0xa72dx37,getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf)));_0xa72dx13[_0x7f8a[86]]= _0xa72dx10[_0x7f8a[69]][0];return _0xa72dx13[_0x7f8a[86]]};return}}function endUserCreation(_0xa72dx13,_0xa72dxe,_0xa72dx37,_0xa72dxf){return function(_0xa72dx10){if(_0xa72dx10){return};logger[_0x7f8a[14]](_0x7f8a[87],getValueFromPropertyName(_0xa72dx37,getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf)));logger[_0x7f8a[88]](getJsonForEndUserCreation(_0xa72dxe,_0xa72dx37,_0xa72dxf));return rp({uri:_0xa72dx13[_0x7f8a[23]]+ _0x7f8a[89],method:_0x7f8a[90],body:{user:getJsonForEndUserCreation(_0xa72dxe,_0xa72dx37,_0xa72dxf)},headers:_0xa72dx13[_0x7f8a[24]],json:true})}}function getJsonForEndUserCreation(_0xa72dxe,_0xa72dx10,_0xa72dxf){var _0xa72dx3a={role:_0x7f8a[91]};switch(_0xa72dxe){case _0x7f8a[62]:if(_0xa72dxf=== _0x7f8a[35]){if(isValidName(_0xa72dx10[_0x7f8a[84]])){_0xa72dx3a[_0x7f8a[36]]= getValueFromPropertyName(_0xa72dx10,getEndUserNamePropertyFromChannel(_0xa72dxe,_0xa72dxf))}else {_0xa72dx3a[_0x7f8a[36]]= util[_0x7f8a[59]](_0x7f8a[92],getValueFromPropertyName(_0xa72dx10,getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf)))}}else {if(_0xa72dxf=== _0x7f8a[80]){if(isValidName(_0xa72dx10[_0x7f8a[83]])){_0xa72dx3a[_0x7f8a[36]]= getValueFromPropertyName(_0xa72dx10,getEndUserNamePropertyFromChannel(_0xa72dxe,_0xa72dxf))}else {_0xa72dx3a[_0x7f8a[36]]= util[_0x7f8a[59]](_0x7f8a[92],getValueFromPropertyName(_0xa72dx10,getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf)))}}};_0xa72dx3a[_0x7f8a[79]]= getValueFromPropertyName(_0xa72dx10,getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf));break;default:logger[_0x7f8a[18]](_0x7f8a[63],_0xa72dxe)};return _0xa72dx3a}function isValidName(_0xa72dx3c){return _0xa72dx3c&& _0xa72dx3c!== _0x7f8a[93]}function handleEndUserCreation(_0xa72dx13,_0xa72dxe,_0xa72dx37,_0xa72dxf){return function(_0xa72dx10){if(!_0xa72dx10){return};if(_0xa72dx10[_0x7f8a[75]]){logger[_0x7f8a[14]](_0x7f8a[94],getValueFromPropertyName(_0xa72dx37,getEndUserSearchPropertyFromChannel(_0xa72dxe,_0xa72dxf)));_0xa72dx13[_0x7f8a[86]]= _0xa72dx10[_0x7f8a[75]]};return}}function ticketCreation(_0xa72dx13,_0xa72dx37,_0xa72dx11){return function(){var _0xa72dx3f={requester_id:_0xa72dx13[_0x7f8a[86]][_0x7f8a[42]],submitter_id:_0xa72dx13[_0x7f8a[32]][_0x7f8a[42]],assignee_id:_0xa72dx13[_0x7f8a[32]][_0x7f8a[42]],tags:createTagsFromConfiguration(_0xa72dx13),subject:createSubjectFromConfiguration(_0xa72dx13,_0xa72dx37,_0xa72dx11),comment:{public:false,body:createDescriptionFromConfiguration(_0xa72dx13,_0xa72dx37,_0xa72dx11)},custom_fields:createCustomFieldsFromConfiguration(_0xa72dx13,_0xa72dx37,_0xa72dx11)};var _0xa72dx40=createFieldsFromConfiguration(_0xa72dx13);if(_0xa72dx40[_0x7f8a[68]]> 0){_[_0x7f8a[96]](_0xa72dx40,function(_0xa72dx41){_0xa72dx3f[_0xa72dx41[_0x7f8a[42]]]= _0xa72dx41[_0x7f8a[95]]})};logger[_0x7f8a[88]](_0x7f8a[97],_0xa72dx3f);return rp({uri:_0xa72dx13[_0x7f8a[23]]+ _0x7f8a[98],method:_0x7f8a[90],body:{ticket:_0xa72dx3f},headers:_0xa72dx13[_0x7f8a[24]],json:true})}}function createTagsFromConfiguration(_0xa72dx13){var _0xa72dx43=[];if(_0xa72dx13[_0x7f8a[22]][_0x7f8a[99]][_0x7f8a[68]]> 0){_0xa72dx43= _[_0x7f8a[100]](_0xa72dx13[_0x7f8a[22]].Tags,_0x7f8a[36])};return _0xa72dx43}function createSubjectFromConfiguration(_0xa72dx13,_0xa72dx37,_0xa72dx11){var _0xa72dx45=_0x7f8a[60];var _0xa72dx46=[];if(_0xa72dx13[_0x7f8a[22]][_0x7f8a[101]][_0x7f8a[68]]> 0){var _0xa72dx47=_[_0x7f8a[102]](_0xa72dx13[_0x7f8a[22]].Subject,[_0x7f8a[42]]);_[_0x7f8a[96]](_0xa72dx47,function(_0xa72dx48){if(_0xa72dx48[_0x7f8a[103]]=== _0x7f8a[104]){_0xa72dx46[_0x7f8a[106]](_0xa72dx48[_0x7f8a[105]])}else {if(_0xa72dx48[_0x7f8a[103]]=== _0x7f8a[107]&& _0xa72dx48[_0x7f8a[108]]){var _0xa72dx49=getValueFromPropertyName(_0xa72dx37,_0xa72dx48[_0x7f8a[108]],_0xa72dx13);if(_0xa72dx49){_0xa72dx46[_0x7f8a[106]](_0xa72dx49.toString())}}else {if(_0xa72dx48[_0x7f8a[103]]=== _0x7f8a[109]&& _0xa72dx48[_0x7f8a[110]]&& _0xa72dx48[_0x7f8a[110]][_0x7f8a[36]]){_0xa72dx11[_0xa72dx48[_0x7f8a[110]][_0x7f8a[36]]]&& _0xa72dx46[_0x7f8a[106]](_0xa72dx11[_0xa72dx48[_0x7f8a[110]][_0x7f8a[36]]].toString())}}}});_0xa72dx45= _0xa72dx46[_0x7f8a[112]](_0x7f8a[111])};return _0xa72dx45}function createDescriptionFromConfiguration(_0xa72dx13,_0xa72dx37,_0xa72dx11){var _0xa72dx4b=_0x7f8a[60];var _0xa72dx46=[];if(_0xa72dx13[_0x7f8a[22]][_0x7f8a[113]][_0x7f8a[68]]> 0){var _0xa72dx4c=_[_0x7f8a[102]](_0xa72dx13[_0x7f8a[22]].Description,[_0x7f8a[42]]);_[_0x7f8a[96]](_0xa72dx4c,function(_0xa72dx48){if(_0xa72dx48[_0x7f8a[103]]=== _0x7f8a[104]){_0xa72dx46[_0x7f8a[106]](_0xa72dx48[_0x7f8a[105]])}else {if(_0xa72dx48[_0x7f8a[103]]=== _0x7f8a[114]){if(_0xa72dx48[_0x7f8a[115]]=== _0x7f8a[104]&& _0xa72dx48[_0x7f8a[116]]){_0xa72dx46[_0x7f8a[106]](util[_0x7f8a[59]](_0x7f8a[117],_0xa72dx48[_0x7f8a[116]],_0xa72dx48[_0x7f8a[118]]))}else {if(_0xa72dx48[_0x7f8a[115]]=== _0x7f8a[107]&& _0xa72dx48[_0x7f8a[108]]&& _0xa72dx48[_0x7f8a[116]]){var _0xa72dx49=getValueFromPropertyName(_0xa72dx37,_0xa72dx48[_0x7f8a[108]],_0xa72dx13);if(_0xa72dx49){_0xa72dx46[_0x7f8a[106]](util[_0x7f8a[59]](_0x7f8a[117],_0xa72dx48[_0x7f8a[116]],_0xa72dx49.toString()))}}else {if(_0xa72dx48[_0x7f8a[115]]=== _0x7f8a[109]&& _0xa72dx48[_0x7f8a[110]]&& _0xa72dx48[_0x7f8a[110]][_0x7f8a[36]]&& _0xa72dx48[_0x7f8a[116]]){_0xa72dx11[_0xa72dx48[_0x7f8a[110]][_0x7f8a[36]]]&& _0xa72dx46[_0x7f8a[106]](util[_0x7f8a[59]](_0x7f8a[117],_0xa72dx48[_0x7f8a[116]],_0xa72dx11[_0xa72dx48[_0x7f8a[110]][_0x7f8a[36]]]))}}}}}});_0xa72dx4b= _0xa72dx46[_0x7f8a[112]](_0x7f8a[119])};return _0xa72dx4b}function createCustomFieldsFromConfiguration(_0xa72dx13,_0xa72dx37,_0xa72dx11){var _0xa72dx4e=[];var _0xa72dx4f=[];if(_0xa72dx13[_0x7f8a[22]][_0x7f8a[120]][_0x7f8a[68]]> 0){_0xa72dx4e= _[_0x7f8a[121]](_0xa72dx13[_0x7f8a[22]].Field,{"\x63\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64":true});_[_0x7f8a[96]](_0xa72dx4e,function(_0xa72dx41){if(_0xa72dx41[_0x7f8a[103]]=== _0x7f8a[104]&& _0xa72dx41[_0x7f8a[122]]){_0xa72dx4f[_0x7f8a[106]]({id:_0xa72dx41[_0x7f8a[122]],value:_0xa72dx41[_0x7f8a[105]]})}else {if(_0xa72dx41[_0x7f8a[103]]=== _0x7f8a[107]&& _0xa72dx41[_0x7f8a[108]]&& _0xa72dx41[_0x7f8a[122]]){var _0xa72dx49=getValueFromPropertyName(_0xa72dx37,_0xa72dx41[_0x7f8a[108]],_0xa72dx13);if(_0xa72dx49){_0xa72dx4f[_0x7f8a[106]]({id:_0xa72dx41[_0x7f8a[122]],value:_0xa72dx49.toString()})}}else {if(_0xa72dx41[_0x7f8a[103]]=== _0x7f8a[109]&& _0xa72dx41[_0x7f8a[110]]&& _0xa72dx41[_0x7f8a[110]][_0x7f8a[36]]&& _0xa72dx41[_0x7f8a[122]]){_0xa72dx11[_0xa72dx41[_0x7f8a[110]][_0x7f8a[36]]]&& _0xa72dx4f[_0x7f8a[106]]({id:_0xa72dx41[_0x7f8a[122]],value:_0xa72dx11[_0xa72dx41[_0x7f8a[110]][_0x7f8a[36]]].toString()})}}}})};return _0xa72dx4f}function createFieldsFromConfiguration(_0xa72dx13){var _0xa72dx40=[];var _0xa72dx4f=[];if(_0xa72dx13[_0x7f8a[22]][_0x7f8a[120]][_0x7f8a[68]]> 0){_0xa72dx40= _[_0x7f8a[121]](_0xa72dx13[_0x7f8a[22]].Field,{"\x63\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64":false});_[_0x7f8a[96]](_0xa72dx40,function(_0xa72dx41){if(_0xa72dx41[_0x7f8a[103]]=== _0x7f8a[104]&& _0xa72dx41[_0x7f8a[123]]){_0xa72dx4f[_0x7f8a[106]]({id:_0xa72dx41[_0x7f8a[123]],value:_0xa72dx41[_0x7f8a[105]]})}})};return _0xa72dx4f}function handleTicketDisplay(_0xa72dx13){return function(_0xa72dx10){if(_0xa72dx10[_0x7f8a[124]]){logger[_0x7f8a[14]](_0x7f8a[125]);_0xa72dx13[_0x7f8a[124]]= _0xa72dx10[_0x7f8a[124]];if(_0xa72dx13[_0x7f8a[22]][_0x7f8a[27]][_0x7f8a[103]]=== _0x7f8a[126]){var _0xa72dx52=util[_0x7f8a[59]](_0x7f8a[127],_0xa72dx13[_0x7f8a[32]][_0x7f8a[42]],_0xa72dx13[_0x7f8a[124]][_0x7f8a[42]]);return rp({uri:_0xa72dx13[_0x7f8a[23]]+ _0xa72dx52,method:_0x7f8a[90],headers:_0xa72dx13[_0x7f8a[24]],json:true})}else {var _0xa72dx53=url[_0x7f8a[128]](stripTrailingSlash(_0xa72dx13[_0x7f8a[28]]));delete _0xa72dx53[_0x7f8a[129]];delete _0xa72dx53[_0x7f8a[130]];delete _0xa72dx53[_0x7f8a[131]];delete _0xa72dx53[_0x7f8a[132]];delete _0xa72dx53[_0x7f8a[133]];if(_0xa72dx53){_0xa72dx13[_0x7f8a[134]]= util[_0x7f8a[59]](_0x7f8a[135],url[_0x7f8a[59]](_0xa72dx53),_0xa72dx10[_0x7f8a[124]][_0x7f8a[42]])}}};return}}function handleReportIntegration(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxc,_0xa72dxf,_0xa72dx12){return function(){delete _0xa72dx10[_0x7f8a[42]];delete _0xa72dx10[_0x7f8a[136]];delete _0xa72dx10[_0x7f8a[137]];_0xa72dx10[_0x7f8a[138]]= _0x7f8a[139];_0xa72dx10[_0x7f8a[140]]= _0xa72dxe;_0xa72dx10[_0x7f8a[141]]= _0x7f8a[142];_0xa72dx10[_0x7f8a[143]]= _0xa72dx13[_0x7f8a[124]][_0x7f8a[42]];_0xa72dx10[_0x7f8a[3]]= _0xa72dx13[_0x7f8a[124]][_0x7f8a[3]];_0xa72dx10[_0x7f8a[144]]= _0xa72dxc;_0xa72dx10[_0x7f8a[145]]= _0xa72dxf;_0xa72dx10[_0x7f8a[146]]= _0xa72dx13[_0x7f8a[22]][_0x7f8a[27]][_0x7f8a[103]];if(_0xa72dx13[_0x7f8a[134]]){_0xa72dx10[_0x7f8a[3]]= _0xa72dx13[_0x7f8a[134]];_0xa72dx12[_0x7f8a[150]](util[_0x7f8a[59]](_0x7f8a[149],_0xa72dx10[_0x7f8a[61]]))[_0x7f8a[148]](_0x7f8a[147],_0xa72dx10)};return ReportIntegration[_0x7f8a[151]](_0xa72dx10)}}function handleEnd(_0xa72dx13,_0xa72dx10,_0xa72dxe){return function(){logger[_0x7f8a[14]](util[_0x7f8a[59]](_0x7f8a[152],_0xa72dx13[_0x7f8a[124]][_0x7f8a[42]],_0xa72dx13[_0x7f8a[134]]?_0x7f8a[153]:_0x7f8a[154],_0xa72dx13[_0x7f8a[32]][_0x7f8a[42]]));_0xa72dx13= undefined;return}}function handleError(_0xa72dx13,_0xa72dxe,_0xa72dx10,_0xa72dxc){return function(_0xa72dx57){logger[_0x7f8a[18]](_0x7f8a[155]);logger[_0x7f8a[18]](_0x7f8a[156],_0xa72dx57[_0x7f8a[157]]);logger[_0x7f8a[18]](_0x7f8a[158],_0xa72dx57[_0x7f8a[159]]);_0xa72dx13= undefined;delete _0xa72dx10[_0x7f8a[42]];delete _0xa72dx10[_0x7f8a[136]];delete _0xa72dx10[_0x7f8a[137]];_0xa72dx10[_0x7f8a[138]]= _0x7f8a[139];_0xa72dx10[_0x7f8a[140]]= _0xa72dxe;_0xa72dx10[_0x7f8a[141]]= _0x7f8a[160];_0xa72dx10[_0x7f8a[144]]= _0xa72dxc;ReportIntegration[_0x7f8a[151]](_0xa72dx10)[_0x7f8a[20]](function(){return})[_0x7f8a[19]](function(_0xa72dx57){logger[_0x7f8a[18]](_0x7f8a[161]);return})}}function stripTrailingSlash(_0xa72dx59){if(_0xa72dx59[_0x7f8a[162]](-1) === _0x7f8a[163]){return _0xa72dx59[_0x7f8a[162]](0,_0xa72dx59[_0x7f8a[68]]- 1)};return _0xa72dx59}module[_0x7f8a[164]]= Zendesk