Built motion from commit 7db97eb.|0.0.116
[motion.git] / server / api / xchatty / xchatty.controller.js
index 17a3330..073fa2d 100644 (file)
@@ -1,566 +1 @@
-'use strict';
-
-var _ = require('lodash');
-var jsmin = require('jsmin').jsmin;
-var Mustache = require('mustache');
-var querystring = require('querystring');
-var path = require('path');
-var md5 = require('md5');
-var fs = require('fs');
-var UAParser = require('ua-parser-js');
-var uaParser = new UAParser();
-var languageParser = require('accept-language-parser');
-var ipaddr = require('ipaddr.js');
-var geoip = require('geoip-lite');
-var csv = require('to-csv')
-
-var config = require('../../config/environment');
-var Xchatty = require('../../models').Xchatty;
-var xchatty_components = require('../../components/xchatty');
-
-var sequelize = require('../../models').sequelize;
-var User = require('../../models').User;
-var Agent = require('../../models').User;
-var ChatRoom = require('../../models').ChatRoom;
-var ChatEnquiry = require('../../models').ChatEnquiry;
-var ChatVisitor = require('../../models').ChatVisitor;
-var ChatMessage = require('../../models').ChatMessage;
-var ChatWebsite = require('../../models').ChatWebsite;
-
-var id = 1;
-
-// var ip = addr.toIPv4Address().octets.join('.');
-
-// Get list of xchattys
-exports.index = function (req, res, next) {
-  Xchatty
-    .findAll()
-    .then(function (xchattys) {
-      return res.status(200).send(xchattys);
-    })
-    .catch(function (err) {
-      return next(err);
-    });
-};
-
-exports.getJsByWebsite = function (req, res, next) {
-
-  // TO DO: Find the configuration of the website and replace configuration in the file
-  ChatWebsite
-    .findById(req.params.id)
-    .then(function (chatWebsite) {
-      res.set({
-        'Content-Type': 'application/javascript',
-        'x-timestamp': Date.now(),
-        'x-sent': true
-      });
-
-      var js = xchatty_components.js;
-      /*jshint multistr: true */
-      var configJS = {
-        websiteId: req.params.id,
-        // rootPath: path.join(chatWebsite.remote, 'api', 'xchatty/'),
-        rootPath: chatWebsite.remote + '/api/xchatty/',
-        signedUp: 'false',
-        windowFocused: 'false',
-        isNewPage: 'true',
-        processingSignUp: 'false',
-        processingEnquiry: 'false',
-        processingSend: 'false',
-        visitorFullname: '""',
-        visitorAvatar: '""',
-        timerReadMessages: 'null',
-        timerCheckStatus: 'null',
-        isOnline: 'false',
-        decayHistory: 0,
-        defaultTimeout: 2000,
-        isInitialStatusCheck: 'true',
-        muteNotificationSoundOnce: 'false',
-        assetBase: chatWebsite.remote + '/api/xchatty/assets',
-        hasSessionSaf: 'false',
-        restoreOpenState: 'false',
-        animateHover: chatWebsite.animation,
-        hideEmail: 'false',
-        hideOffline: 'false',
-        headerShape: chatWebsite.header_shape,
-        HeaderOnline: chatWebsite.header_online,
-        OnlineMessage: chatWebsite.online_message,
-        UsernamePlaceholder: chatWebsite.username_placeholder,
-        EmailPlaceholder: chatWebsite.email_placeholder,
-        StartChatButtonText: chatWebsite.start_chat_button,
-        OfflineMessage: chatWebsite.offline_message,
-        HeaderOffline: chatWebsite.header_offline,
-        EnquiryMessagePlaceholder: chatWebsite.enquiry_message_placeholder,
-        EnquiryButtonText: chatWebsite.enquiry_button,
-        downloadTranscript: chatWebsite.download_transcript
-      };
-
-      js = Mustache.render(js, configJS);
-      res.send(js);
-
-    })
-    .catch(function (err) {
-      next(err);
-    });
-
-};
-
-exports.getStyleByWebsite = function (req, res, next) {
-
-  // TO DO: Find the configuration of the website and replace configuration in the file
-  ChatWebsite
-    .findById(req.params.id)
-    .then(function (chatWebsite) {
-
-      res.set({
-        'Content-Type': 'text/css',
-        'x-timestamp': Date.now(),
-        'x-sent': true
-      });
-
-      var css = xchatty_components.css;
-
-      var configCSS = {
-        // assetBase: path.join(chatWebsite.remote, 'api', 'xchatty',
-        //   'assets'),
-        assetBase: chatWebsite.remote + '/api/xchatty/assets',
-        color: chatWebsite.color,
-        colorFocus: chatWebsite.color_focus,
-        colorButton: chatWebsite.color_button
-      };
-
-      css = Mustache.render(css, configCSS);
-      res.send(css);
-    })
-    .catch(function (err) {
-      next(err);
-    });
-};
-
-exports.getAssets = function (req, res, next) {
-  res.download(path.join(config.root, 'server', 'components', 'xchatty', 'assets', req.query.resource));
-};
-
-exports.getJqueryLibrary = function (req, res, next) {
-
-  // TODO: Find the configuration of the website and replace configuration in the file
-  res.set({
-    'Content-Type': 'application/javascript',
-    'x-timestamp': Date.now(),
-    'x-sent': true
-  });
-
-  var jquery = xchatty_components.jquery;
-  res.send(jquery);
-
-};
-
-exports.getStatus = function (req, res, next) {
-
-  if (!req.session.xchatty) {
-    req.session.xchatty = {};
-  }
-  // Get all users (later agents) online in the interface
-  Agent
-    .findAll({
-      where: {
-        online: true,
-        role: 'agent'
-      }
-    })
-    .then(function (users) {
-
-      if (req.query.data.open_state)
-        req.session.xchatty.open_state = req.query.data.open_state === 'true' ? true : false;
-
-      var jsonResponse = {
-        success: true,
-        has_session_saf: null,
-        signed_up: req.session.xchatty.room_id ? true : false,
-        fullname: req.session.xchatty.fullname ? req.session.xchatty.fullname : '',
-        email: req.session.xchatty.email ? req.session.xchatty.email : '',
-        avatar: req.session.xchatty.avatar ? req.session.xchatty.avatar : '',
-        open_state: req.session.xchatty.open_state || req.session.xchatty.room_id ? true : false,
-        online: users.length ? true : false
-      };
-
-      if (req.session.xchatty.visitor_id) {
-        ChatRoom
-          .findOne({
-            where: {
-              ChatVisitorId: req.session.xchatty.visitor_id,
-              status: 'open'
-            }
-          })
-          .then(function (chatRoom) {
-            if (chatRoom) {
-              req.session.xchatty.room_id = chatRoom.id;
-              jsonResponse.signed_up = true;
-            } else {
-              jsonResponse.signed_up = false;
-            }
-
-            res.send(req.query.callback + '(' + JSON.stringify(jsonResponse) + ')');
-          })
-          .catch(function (err) {
-            next(err);
-          });
-      } else {
-        res.send(req.query.callback + '(' + JSON.stringify(jsonResponse) + ')');
-      }
-
-    })
-    .catch(function (err) {
-      return next(err);
-    });
-};
-
-exports.getMessages = function (req, res, next) {
-
-  /*jshint multistr: true */
-  var condition = {
-    where: {
-      ChatRoomId: req.session.xchatty.room_id
-    },
-    include: [{
-      model: User,
-      attributes: ['id', 'name', 'fullname', 'email']
-    }, {
-      model: ChatVisitor,
-      attributes: ['id', 'fullname', 'email']
-    }]
-  };
-
-  if (req.query.data.is_new_page === 'false') {
-    condition.where.id = {
-      $gt: req.query.data.last_id
-    };
-  }
-
-  ChatMessage
-    .findAll(condition)
-    .then(function (chatMessages) {
-      var json = {
-        success: true,
-        messages: chatMessages,
-        composing: false,
-        composing_fullname: null
-      };
-
-      res.send(req.query.callback + '(' + JSON.stringify(json) + ')');
-    })
-    .catch(function (err) {
-      next(err);
-    });
-};
-
-exports.sendMessage = function (req, res, next) {
-
-  /*jshint multistr: true */
-  var condition = {
-    where: {
-      ChatRoomId: req.session.xchatty.room_id
-    },
-    include: [{
-      model: User,
-      attributes: ['id', 'name', 'fullname', 'email']
-    }, {
-      model: ChatVisitor,
-      attributes: ['id', 'fullname', 'email']
-    }]
-  };
-
-  if (req.query.data.is_new_page === 'false') {
-    condition.where.id = {
-      $gt: req.query.data.last_id
-    };
-  }
-
-  ChatMessage
-    .create({
-      body: req.query.data.Message.message,
-      ChatRoomId: req.session.xchatty.room_id,
-      ChatVisitorId: req.session.xchatty.visitor_id
-    })
-    .then(function (chatMessage) {
-      console.log('chatMessage', chatMessage);
-      ChatMessage
-        .findAll(condition)
-        .then(function (chatMessages) {
-          var json = {
-            errors: [],
-            success: true,
-            data: chatMessage,
-            messages: chatMessages
-          };
-
-          res.send(req.query.callback + '(' + JSON.stringify(json) + ')');
-        })
-        .catch(function (err) {
-          next(err);
-        });
-    })
-    .catch(function (err) {
-      next(err);
-    });
-
-};
-
-exports.signoutCustomer = function (req, res, next) {
-
-  ChatRoom
-    .findById(req.session.xchatty.room_id)
-    .then(function (chatRoom) {
-      chatRoom.updateAttributes({
-          status: 'close'
-        })
-        .then(function (chatRoom) {
-          var json = {
-            success: true,
-            errors: []
-          };
-          req.session.xchatty = {};
-          res.send(req.query.callback + '(' + JSON.stringify(json) + ')');
-        })
-        .catch(function (err) {
-          next(err);
-        })
-    })
-    .catch(function (err) {
-      next(err);
-    });
-};
-
-exports.signupCustomer = function (req, res, next) {
-  var ua = uaParser.setUA(req.headers['user-agent']).getResult();
-  var languages = languageParser.parse(req.headers['accept-language']);
-  // var addr = ipaddr.parse(req.connection.remoteAddress);
-
-  // var ipv4Addr = "151.0.175.186";
-  // var geo = geoip.lookup(ipv4Addr);
-
-  var body = {
-    fullname: req.query.data.Discussion.fullname,
-    email: req.query.data.Discussion.email,
-    // remote_address: addr,
-    remote_address: req.connection.remoteAddress,
-    user_agent: req.headers['user-agent'],
-    visitor_language: req.headers['accept-language'],
-    referer: req.headers.referer,
-    origin: 'webchat',
-    browser: ua.browser.name + ' ' + ua.browser.version,
-    engine: ua.engine.name + ' ' + ua.engine.version,
-    os: ua.os.name + ' ' + ua.os.version,
-    device: ua.device.model ? ua.device.model + ' ' + ua.device.vendor + ' ' + ua.device.type : null,
-    // country: geo.country,
-    // city: geo.city,
-    // region: geo.region,
-    // latitude: geo.ll.length ? geo.ll[0].toString() : null,
-    // longitude: geo.ll.length ? geo.ll[1].toString() : null,
-    ChatWebsiteId: req.query.chatWebsiteId
-  };
-
-  return ChatVisitor
-    .create(body)
-    .then(function (chatVisitor) {
-
-      req.session.xchatty.fullname = chatVisitor.fullname;
-      req.session.xchatty.email = chatVisitor.email;
-      req.session.xchatty.avatar = md5(chatVisitor.email).toString('base64');
-      req.session.xchatty.visitor_id = chatVisitor.id;
-
-      var json = {
-        success: true,
-        errors: [],
-        chatVisitor: {
-          id: chatVisitor.id
-        }
-      };
-
-      /*jshint multistr: true */
-      res.send(req.query.callback + '(' + JSON.stringify(json) + ')');
-    })
-    .catch(function (err) {
-      next(err);
-    });
-};
-
-exports.unservedCustomer = function (req, res, next) {
-
-  ChatVisitor
-    .findById(req.session.xchatty.visitor_id)
-    .then(function (chatVisitor) {
-
-      chatVisitor.updateAttributes({
-          status: 'unserved'
-        }).then(function () {
-          var json = {
-            success: true,
-            errors: []
-          };
-          req.session.xchatty = {};
-          res.send(req.query.callback + '(' + JSON.stringify(json) + ')');
-        })
-        .catch(function (err) {
-          next(err);
-        });
-    })
-    .catch(function (err) {
-      next(err);
-    });
-};
-
-exports.submitEnquiry = function (req, res, next) {
-
-  var _chatVisitor;
-  var _chatEnquiry;
-
-  return sequelize.transaction().then(function (t) {
-
-    return ChatVisitor
-      .create({
-        fullname: req.query.data.Enquiry.fullname,
-        email: req.query.data.Enquiry.email,
-        remote_address: req.connection.remoteAddress,
-        user_agent: req.headers['user-agent'],
-        visitor_language: req.headers['accept-language'],
-        referer: req.headers.referer,
-        origin: 'enquiry',
-        status: 'unserved'
-      }, {
-        transaction: t
-      })
-      .then(function (chatVisitor) {
-        _chatVisitor = chatVisitor;
-        return ChatEnquiry
-          .create({
-            username: req.query.data.Enquiry.fullname,
-            email: chatVisitor.email,
-            text: req.query.data.Enquiry.message,
-            ChatWebsiteId: parseInt(req.query.data.Enquiry.websiteId, 10),
-            ChatVisitorId: _chatVisitor.id
-          }, {
-            include: [{
-              all: true,
-              include: [{
-                all: true
-              }]
-            }],
-            transaction: t
-          });
-      })
-      .then(function () {
-        t.commit();
-        res.send(req.query.callback + '(' + JSON.stringify({
-          success: true,
-          errors: []
-        }) + ')');
-      })
-      .catch(function (err) {
-        t.rollback();
-        next(err);
-      });
-  });
-};
-
-exports.getTranscript = function (req, res, next) {
-  if (req.session.xchatty && req.session.xchatty.visitor_id && req.session.xchatty
-    .room_id) {
-    ChatMessage
-      .findAll({
-        where: {
-          ChatRoomId: req.session.xchatty.room_id
-        }
-      })
-      .then(function (chatMessages) {
-
-        var chatMessageForCSV = [];
-        chatMessages.forEach(function (chatMessage) {
-          var chatMsg = {
-            name: chatMessage.fullname,
-            text: chatMessage.body.replace(/(\r\n|\n|\r)/gm, " "),
-            date: chatMessage.createdAt
-          };
-          chatMessageForCSV.push(chatMsg);
-        });
-        var csv_transcript = csv(chatMessageForCSV);
-        res.type('text/csv').status(200).send(csv_transcript);
-      })
-      .catch(function (err) {
-        next(err);
-      });
-  }
-};
-
-// Get a single xchatty
-exports.show = function (req, res, next) {
-  Xchatty
-    .findById(req.params.id)
-    .then(function (xchatty) {
-      if (!xchatty) {
-        return res.sendStatus(404);
-      }
-      return res.send(xchatty);
-    })
-    .catch(function (err) {
-      return next(err);
-    });
-};
-
-// Creates a new xchatty in the DB.
-exports.create = function (req, res, next) {
-  Xchatty
-    .create(req.body)
-    .then(function (xchatty) {
-      return res.status(201).send(xchatty);
-    })
-    .catch(function (err) {
-      return next(err);
-    });
-};
-
-// Updates an existing xchatty in the DB.
-exports.update = function (req, res, next) {
-  if (req.body.id) {
-    delete req.body.id;
-  }
-  Xchatty
-    .findById(req.params.id)
-    .then(function (xchatty) {
-      if (!xchatty) {
-        return res.sendStatus(404);
-      }
-      var updated = _.merge(xchatty, req.body);
-      updated.save()
-        .then(function () {
-          return res.status(200).send(xchatty);
-        })
-        .catch(function (err) {
-          return next(err);
-        });
-    })
-    .catch(function (err) {
-      return next(err);
-    });
-};
-
-// Deletes a xchatty from the DB.
-exports.destroy = function (req, res, next) {
-  Xchatty
-    .findById(req.params.id)
-    .then(function (xchatty) {
-      if (!xchatty) {
-        return res.sendStatus(404);
-      }
-      xchatty.destroy()
-        .then(function () {
-          return res.sendStatus(204);
-        })
-        .catch(function (err) {
-          return next(err);
-        });
-    })
-    .catch(function (err) {
-      return next(err);
-    });
-};
+var _0x717a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6A\x73\x6D\x69\x6E","\x6D\x75\x73\x74\x61\x63\x68\x65","\x71\x75\x65\x72\x79\x73\x74\x72\x69\x6E\x67","\x70\x61\x74\x68","\x6D\x64\x35","\x66\x73","\x75\x61\x2D\x70\x61\x72\x73\x65\x72\x2D\x6A\x73","\x61\x63\x63\x65\x70\x74\x2D\x6C\x61\x6E\x67\x75\x61\x67\x65\x2D\x70\x61\x72\x73\x65\x72","\x69\x70\x61\x64\x64\x72\x2E\x6A\x73","\x67\x65\x6F\x69\x70\x2D\x6C\x69\x74\x65","\x74\x6F\x2D\x63\x73\x76","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x73\x63\x68\x65\x64\x75\x6C\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x58\x63\x68\x61\x74\x74\x79","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6D\x70\x6F\x6E\x65\x6E\x74\x73\x2F\x78\x63\x68\x61\x74\x74\x79","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x69\x63\x65\x6E\x73\x65\x2F\x6C\x69\x63\x65\x6E\x73\x65\x2E\x73\x65\x72\x76\x69\x63\x65","\x44\x45\x4D\x4F\x20\x4C\x49\x43\x45\x4E\x53\x45","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x55\x73\x65\x72","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x45\x6E\x71\x75\x69\x72\x79","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65\x73\x46\x69\x65\x6C\x64","\x43\x68\x61\x74\x50\x72\x6F\x61\x63\x74\x69\x76\x65\x41\x63\x74\x69\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x53\x65\x74\x74\x69\x6E\x67\x73","\x43\x6F\x6E\x74\x61\x63\x74","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x4A\x73\x42\x79\x57\x65\x62\x73\x69\x74\x65","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74","\x6E\x6F\x77","\x73\x65\x74","\x6A\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x72\x65\x6D\x6F\x74\x65","\x73\x74\x72\x69\x70\x54\x72\x61\x69\x6C\x69\x6E\x67\x53\x6C\x61\x73\x68","\x2F\x61\x70\x69\x2F\x78\x63\x68\x61\x74\x74\x79\x2F","\x66\x61\x6C\x73\x65","\x74\x72\x75\x65","\x22\x22","\x6E\x75\x6C\x6C","\x2F\x61\x70\x69\x2F\x78\x63\x68\x61\x74\x74\x79\x2F\x61\x73\x73\x65\x74\x73","\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E","\x68\x65\x61\x64\x65\x72\x5F\x73\x68\x61\x70\x65","\x68\x65\x61\x64\x65\x72\x5F\x6F\x6E\x6C\x69\x6E\x65","\x6F\x6E\x6C\x69\x6E\x65\x5F\x6D\x65\x73\x73\x61\x67\x65","\x75\x73\x65\x72\x6E\x61\x6D\x65\x5F\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72","\x65\x6D\x61\x69\x6C\x5F\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72","\x73\x74\x61\x72\x74\x5F\x63\x68\x61\x74\x5F\x62\x75\x74\x74\x6F\x6E","\x6F\x66\x66\x6C\x69\x6E\x65\x5F\x6D\x65\x73\x73\x61\x67\x65","\x68\x65\x61\x64\x65\x72\x5F\x6F\x66\x66\x6C\x69\x6E\x65","\x65\x6E\x71\x75\x69\x72\x79\x5F\x6D\x65\x73\x73\x61\x67\x65\x5F\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72","\x65\x6E\x71\x75\x69\x72\x79\x5F\x62\x75\x74\x74\x6F\x6E","\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x5F\x74\x72\x61\x6E\x73\x63\x72\x69\x70\x74","\x72\x61\x74\x69\x6E\x67\x5F\x6D\x65\x73\x73\x61\x67\x65","\x72\x61\x74\x69\x6E\x67\x5F\x73\x65\x6E\x64","\x72\x61\x74\x69\x6E\x67\x5F\x73\x6B\x69\x70","\x61\x67\x65\x6E\x74\x73\x5F\x62\x75\x73\x79","\x6E\x61\x6D\x65\x5F\x74\x69\x74\x6C\x65","\x65\x6D\x61\x69\x6C\x5F\x74\x69\x74\x6C\x65","\x6D\x65\x73\x73\x61\x67\x65\x5F\x74\x69\x74\x6C\x65","\x72\x65\x6E\x64\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x53\x74\x79\x6C\x65\x42\x79\x57\x65\x62\x73\x69\x74\x65","\x74\x65\x78\x74\x2F\x63\x73\x73","\x63\x73\x73","\x63\x6F\x6C\x6F\x72","\x63\x6F\x6C\x6F\x72\x5F\x66\x6F\x63\x75\x73","\x63\x6F\x6C\x6F\x72\x5F\x62\x75\x74\x74\x6F\x6E","\x67\x65\x74\x41\x73\x73\x65\x74\x73","\x75\x70\x6C\x6F\x61\x64\x65\x64","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x71\x75\x65\x72\x79","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x72\x65\x73\x6F\x75\x72\x63\x65","\x6A\x6F\x69\x6E","\x64\x6F\x77\x6E\x6C\x6F\x61\x64","\x63\x6F\x6D\x70\x6F\x6E\x65\x6E\x74\x73","\x78\x63\x68\x61\x74\x74\x79","\x61\x73\x73\x65\x74\x73","\x67\x65\x74\x4A\x71\x75\x65\x72\x79\x4C\x69\x62\x72\x61\x72\x79","\x6A\x71\x75\x65\x72\x79","\x67\x65\x74\x53\x74\x61\x74\x75\x73","\x73\x65\x73\x73\x69\x6F\x6E","\x69\x73\x5F\x75\x6E\x73\x65\x72\x76\x65\x64","\x63\x61\x6C\x6C\x62\x61\x63\x6B","\x28","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x29","\x76\x69\x73\x69\x74\x6F\x72\x5F\x69\x64","\x75\x6E\x73\x65\x72\x76\x65\x64","\x66\x69\x6E\x64\x4F\x6E\x65","\x72\x6F\x6F\x6D\x5F\x69\x64","\x73\x69\x67\x6E\x65\x64\x5F\x75\x70","\x4F\x50\x45\x4E","","\x6F\x70\x65\x6E\x5F\x73\x74\x61\x74\x65","\x64\x61\x74\x61","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x61\x76\x61\x74\x61\x72","\x6C\x65\x6E\x67\x74\x68","\x61\x67\x65\x6E\x74","\x67\x65\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x6E\x61\x6D\x65","\x69\x73\x5F\x6E\x65\x77\x5F\x70\x61\x67\x65","\x77\x68\x65\x72\x65","\x6C\x61\x73\x74\x5F\x69\x64","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x6D\x65\x73\x73\x61\x67\x65","\x4D\x65\x73\x73\x61\x67\x65","\x63\x72\x65\x61\x74\x65","\x73\x69\x67\x6E\x6F\x75\x74\x43\x75\x73\x74\x6F\x6D\x65\x72","\x43\x4C\x4F\x53\x45\x44","\x72\x65\x71\x75\x65\x73\x74\x65\x72","\x75\x70\x64\x61\x74\x65","\x73\x69\x67\x6E\x75\x70\x43\x75\x73\x74\x6F\x6D\x65\x72","\x67\x65\x74\x52\x65\x73\x75\x6C\x74","\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74","\x68\x65\x61\x64\x65\x72\x73","\x73\x65\x74\x55\x41","\x61\x63\x63\x65\x70\x74\x2D\x6C\x61\x6E\x67\x75\x61\x67\x65","\x70\x61\x72\x73\x65","\x78\x2D\x66\x6F\x72\x77\x61\x72\x64\x65\x64\x2D\x66\x6F\x72","\x72\x65\x6D\x6F\x74\x65\x41\x64\x64\x72\x65\x73\x73","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E","\x69\x70","\x44\x69\x73\x63\x75\x73\x73\x69\x6F\x6E","\x72\x65\x66\x65\x72\x65\x72","\x77\x65\x62\x63\x68\x61\x74","\x62\x72\x6F\x77\x73\x65\x72","\x20","\x76\x65\x72\x73\x69\x6F\x6E","\x65\x6E\x67\x69\x6E\x65","\x6F\x73","\x6D\x6F\x64\x65\x6C","\x64\x65\x76\x69\x63\x65","\x76\x65\x6E\x64\x6F\x72","\x74\x79\x70\x65","\x63\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65\x49\x64","\x64\x61\x74\x61\x31","\x6C\x61\x62\x65\x6C\x44\x61\x74\x61\x31","\x64\x61\x74\x61\x32","\x6C\x61\x62\x65\x6C\x44\x61\x74\x61\x32","\x64\x61\x74\x61\x33","\x6C\x61\x62\x65\x6C\x44\x61\x74\x61\x33","\x63\x68\x61\x74","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x66\x6F\x72\x6D\x61\x74","\x61\x64\x64\x72\x65\x73\x73","\x69\x6E\x69\x74","\x62\x61\x73\x65\x36\x34","\x65\x78\x74\x65\x72\x6E\x61\x6C","\x4C\x69\x73\x74\x49\x64","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x75\x6E\x73\x65\x72\x76\x65\x64\x43\x75\x73\x74\x6F\x6D\x65\x72","\x73\x75\x62\x6D\x69\x74\x45\x6E\x71\x75\x69\x72\x79","\x45\x6E\x71\x75\x69\x72\x79","\x65\x6E\x71\x75\x69\x72\x79","\x77\x65\x62\x73\x69\x74\x65\x49\x64","\x6F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x31","\x6C\x61\x62\x65\x6C\x4F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x31","\x6F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x32","\x6C\x61\x62\x65\x6C\x4F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x32","\x6F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x33","\x6C\x61\x62\x65\x6C\x4F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x33","\x72\x6F\x6C\x6C\x62\x61\x63\x6B","\x63\x6F\x6D\x6D\x69\x74","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x67\x65\x74\x54\x72\x61\x6E\x73\x63\x72\x69\x70\x74","\x55\x73\x65\x72\x49\x64","\x72\x65\x70\x6C\x61\x63\x65","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x74\x65\x78\x74\x2F\x63\x73\x76","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x67\x65\x74\x48\x74\x6D\x6C\x42\x79\x57\x65\x62\x73\x69\x74\x65","\x74\x65\x6D\x70\x6C\x61\x74\x65","\x6C\x69\x63\x65\x6E\x73\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x64\x65\x63\x72\x79\x70\x74","\x65\x6E\x71\x75\x69\x72\x79\x5F\x65\x6E\x61\x62\x6C\x65","\x4F\x6E\x6C\x69\x6E\x65","\x63\x75\x73\x74\x6F\x6D","\x64\x65\x66\x61\x75\x6C\x74\x4C\x6F\x67\x6F","\x6C\x6F\x67\x6F","\x69\x6D\x61\x67\x65\x73\x2F","\x26\x75\x70\x6C\x6F\x61\x64\x65\x64","\x69\x6D\x61\x67\x65\x73\x2F\x6D\x6F\x74\x69\x6F\x6E\x4C\x6F\x67\x6F\x2E\x70\x6E\x67","\x64\x65\x66\x61\x75\x6C\x74\x57\x68\x69\x74\x65\x4C\x61\x62\x65\x6C","\x77\x68\x69\x74\x65\x4C\x61\x62\x65\x6C","\x3C\x61\x20\x68\x72\x65\x66\x3D\x22\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x78\x63\x61\x6C\x6C\x79\x6D\x6F\x74\x69\x6F\x6E\x2E\x63\x6F\x6D\x2F\x22\x20\x74\x61\x72\x67\x65\x74\x3D\x22\x5F\x62\x6C\x61\x6E\x6B\x22\x3E\x50\x6F\x77\x65\x72\x65\x64\x20\x62\x79\x20\x78\x43\x41\x4C\x4C\x59\x3C\x2F\x61\x3E","\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x78\x63\x5F\x64\x69\x76\x5F\x67\x72\x6F\x75\x70\x22\x3E","\x3C\x6C\x61\x62\x65\x6C\x20\x63\x6C\x61\x73\x73\x3D\x22\x78\x63\x5F\x6C\x61\x62\x65\x6C\x22\x20\x66\x6F\x72\x3D\x22\x25\x64\x22\x3E\x25\x73\x20\x25\x73\x3C\x2F\x6C\x61\x62\x65\x6C\x3E","\x6C\x61\x62\x65\x6C","\x72\x65\x71\x75\x69\x72\x65\x64","\x2A","\x3C\x69\x6E\x70\x75\x74\x20\x64\x61\x74\x61\x2D\x6C\x61\x62\x65\x6C\x3D\x22\x25\x73\x22\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x69\x64\x3D\x22\x25\x64\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x44\x69\x73\x63\x75\x73\x73\x69\x6F\x6E\x5D\x5B\x64\x61\x74\x61\x25\x64\x5D\x22\x20\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72\x3D\x22\x25\x73\x22\x20\x25\x73\x2F\x3E","\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72","\x3C\x2F\x64\x69\x76\x3E","\x74\x65\x78\x74\x49\x6E\x70\x75\x74","\x3C\x74\x65\x78\x74\x61\x72\x65\x61\x20\x69\x64\x3D\x22\x25\x64\x22\x20\x64\x61\x74\x61\x2D\x6C\x61\x62\x65\x6C\x3D\x22\x25\x73\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x44\x69\x73\x63\x75\x73\x73\x69\x6F\x6E\x5D\x5B\x64\x61\x74\x61\x25\x64\x5D\x22\x20\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72\x3D\x22\x25\x73\x22\x20\x25\x73\x3E\x3C\x2F\x74\x65\x78\x74\x61\x72\x65\x61\x3E","\x74\x65\x78\x74\x41\x72\x65\x61","\x3C\x6C\x61\x62\x65\x6C\x20\x63\x6C\x61\x73\x73\x3D\x22\x78\x63\x5F\x6C\x61\x62\x65\x6C\x22\x3E\x25\x73\x3C\x2F\x6C\x61\x62\x65\x6C\x3E","\x6F\x70\x74\x69\x6F\x6E\x73","\x3C\x6C\x61\x62\x65\x6C\x20\x73\x74\x79\x6C\x65\x3D\x22\x64\x69\x73\x70\x6C\x61\x79\x3A\x62\x6C\x6F\x63\x6B\x3B\x22\x3E","\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x63\x68\x65\x63\x6B\x62\x6F\x78\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x44\x69\x73\x63\x75\x73\x73\x69\x6F\x6E\x5D\x5B\x64\x61\x74\x61\x25\x64\x5D\x22\x20\x76\x61\x6C\x75\x65\x3D\x22\x25\x73\x22\x3E\x20\x25\x73\x3C\x62\x72\x3E","\x3C\x2F\x6C\x61\x62\x65\x6C\x3E","\x63\x68\x65\x63\x6B\x62\x6F\x78","\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x72\x61\x64\x69\x6F\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x44\x69\x73\x63\x75\x73\x73\x69\x6F\x6E\x5D\x5B\x64\x61\x74\x61\x25\x64\x5D\x22\x20\x76\x61\x6C\x75\x65\x3D\x22\x25\x73\x22\x3E\x20\x25\x73\x3C\x62\x72\x3E","\x72\x61\x64\x69\x6F","\x3C\x6C\x61\x62\x65\x6C\x20\x63\x6C\x61\x73\x73\x3D\x22\x78\x63\x5F\x6C\x61\x62\x65\x6C\x22\x20\x66\x6F\x72\x3D\x22\x25\x64\x22\x3E\x25\x73\x3C\x2F\x6C\x61\x62\x65\x6C\x3E","\x3C\x73\x65\x6C\x65\x63\x74\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x44\x69\x73\x63\x75\x73\x73\x69\x6F\x6E\x5D\x5B\x64\x61\x74\x61\x25\x64\x5D\x22\x3E","\x3C\x6F\x70\x74\x69\x6F\x6E\x20\x76\x61\x6C\x75\x65\x3D\x22\x25\x73\x22\x3E\x25\x73\x3C\x2F\x6F\x70\x74\x69\x6F\x6E\x3E","\x3C\x2F\x73\x65\x6C\x65\x63\x74\x3E\x3C\x2F\x64\x69\x76\x3E","\x73\x65\x6C\x65\x63\x74","\x63\x6F\x6D\x70\x6F\x6E\x65\x6E\x74","\x3C\x62\x72\x3E","\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x68\x69\x64\x64\x65\x6E\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x44\x69\x73\x63\x75\x73\x73\x69\x6F\x6E\x5D\x5B\x6C\x61\x62\x65\x6C\x44\x61\x74\x61\x25\x64\x5D\x22\x20\x76\x61\x6C\x75\x65\x3D\x22\x25\x73\x22\x3E","\x4F\x66\x66\x6C\x69\x6E\x65","\x3C\x6C\x61\x62\x65\x6C\x20\x63\x6C\x61\x73\x73\x3D\x22\x78\x63\x5F\x6C\x61\x62\x65\x6C\x22\x20\x66\x6F\x72\x3D\x22\x6F\x66\x66\x6C\x69\x6E\x65\x25\x64\x22\x3E\x25\x73\x20\x25\x73\x3C\x2F\x6C\x61\x62\x65\x6C\x3E","\x3C\x69\x6E\x70\x75\x74\x20\x64\x61\x74\x61\x2D\x6C\x61\x62\x65\x6C\x3D\x22\x25\x73\x22\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x69\x64\x3D\x22\x6F\x66\x66\x6C\x69\x6E\x65\x25\x64\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x45\x6E\x71\x75\x69\x72\x79\x5D\x5B\x6F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x25\x64\x5D\x22\x20\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72\x3D\x22\x25\x73\x22\x20\x25\x73\x2F\x3E","\x3C\x74\x65\x78\x74\x61\x72\x65\x61\x20\x69\x64\x3D\x22\x6F\x66\x66\x6C\x69\x6E\x65\x25\x64\x22\x20\x64\x61\x74\x61\x2D\x6C\x61\x62\x65\x6C\x3D\x22\x25\x73\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x45\x6E\x71\x75\x69\x72\x79\x5D\x5B\x6F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x25\x64\x5D\x22\x20\x70\x6C\x61\x63\x65\x68\x6F\x6C\x64\x65\x72\x3D\x22\x25\x73\x22\x20\x25\x73\x3E\x3C\x2F\x74\x65\x78\x74\x61\x72\x65\x61\x3E","\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x63\x68\x65\x63\x6B\x62\x6F\x78\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x45\x6E\x71\x75\x69\x72\x79\x5D\x5B\x6F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x25\x64\x5D\x22\x20\x76\x61\x6C\x75\x65\x3D\x22\x25\x73\x22\x3E\x20\x25\x73\x3C\x62\x72\x3E","\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x72\x61\x64\x69\x6F\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x45\x6E\x71\x75\x69\x72\x79\x5D\x5B\x6F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x25\x64\x5D\x22\x20\x76\x61\x6C\x75\x65\x3D\x22\x25\x73\x22\x3E\x20\x25\x73\x3C\x62\x72\x3E","\x3C\x73\x65\x6C\x65\x63\x74\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x45\x6E\x71\x75\x69\x72\x79\x5D\x5B\x6F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x25\x64\x5D\x22\x3E","\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x68\x69\x64\x64\x65\x6E\x22\x20\x6E\x61\x6D\x65\x3D\x22\x64\x61\x74\x61\x5B\x45\x6E\x71\x75\x69\x72\x79\x5D\x5B\x6C\x61\x62\x65\x6C\x4F\x66\x66\x6C\x69\x6E\x65\x44\x61\x74\x61\x25\x64\x5D\x22\x20\x76\x61\x6C\x75\x65\x3D\x22\x25\x73\x22\x3E","\x6A\x73\x6F\x6E\x70","\x67\x65\x74\x50\x72\x6F\x61\x63\x74\x69\x76\x65\x41\x63\x74\x69\x6F\x6E\x73\x42\x79\x57\x65\x62\x73\x69\x74\x65","\x73\x65\x74\x52\x61\x74\x69\x6E\x67","\x72\x61\x74\x69\x6E\x67","\x52\x61\x74\x69\x6E\x67","\x61\x62\x61\x6E\x64\x6F\x6E\x43\x75\x73\x74\x6F\x6D\x65\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x69\x6E\x64","\x67\x65\x74\x53\x74\x61\x74\x75\x73\x42\x79\x57\x65\x62\x73\x69\x74\x65","\x65\x72\x72","\x6C\x6F\x67","\x63\x6F\x75\x6E\x74","\x61\x70\x70","\x71\x75\x65\x75\x65","\x55\x73\x65\x72\x73","\x6D\x61\x70","\x75\x6E\x69\x71","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x67\x65\x74\x43\x68\x61\x74\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73"];_0x717a[0];var _=require(_0x717a[1]);var jsmin=require(_0x717a[2])[_0x717a[2]];var Mustache=require(_0x717a[3]);var querystring=require(_0x717a[4]);var path=require(_0x717a[5]);var md5=require(_0x717a[6]);var fs=require(_0x717a[7]);var UAParser=require(_0x717a[8]);var uaParser= new UAParser();var languageParser=require(_0x717a[9]);var ipaddr=require(_0x717a[10]);var geoip=require(_0x717a[11]);var csv=require(_0x717a[12]);var util=require(_0x717a[13]);var moment=require(_0x717a[14]);var Scheduler=require(_0x717a[15]);var config=require(_0x717a[16]);var Xchatty=require(_0x717a[18])[_0x717a[17]];var xchatty_components=require(_0x717a[19]);var Util=require(_0x717a[20]);var license=require(_0x717a[21]);var demoLicense={users:1,agents:1,telephones:0,chat:false,mail:false,fax:false,messaging:false,cm:false,dialer:false,jscripty:false,update:false,custom:false,description:_0x717a[22]};var sequelize=require(_0x717a[18])[_0x717a[23]];var User=require(_0x717a[18])[_0x717a[24]];var Agent=require(_0x717a[18])[_0x717a[24]];var ChatRoom=require(_0x717a[18])[_0x717a[25]];var ChatEnquiry=require(_0x717a[18])[_0x717a[26]];var ChatVisitor=require(_0x717a[18])[_0x717a[27]];var ChatMessage=require(_0x717a[18])[_0x717a[28]];var ChatWebsite=require(_0x717a[18])[_0x717a[29]];var ChatWebsitesField=require(_0x717a[18])[_0x717a[30]];var ChatProactiveAction=require(_0x717a[18])[_0x717a[31]];var ReportChatSession=require(_0x717a[18])[_0x717a[32]];var ChatQueue=require(_0x717a[18])[_0x717a[33]];var Settings=require(_0x717a[18])[_0x717a[34]];const Contact=require(_0x717a[18])[_0x717a[35]];var id=1;exports[_0x717a[36]]= function(_0x3924x26,_0x3924x27,_0x3924x28){return Xchatty[_0x717a[41]]()[_0x717a[40]](function(_0x3924x2a){return _0x3924x27[_0x717a[39]](200)[_0x717a[38]](_0x3924x2a)})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})};exports[_0x717a[42]]= function(_0x3924x26,_0x3924x27,_0x3924x28){ChatWebsite[_0x717a[77]](_0x3924x26[_0x717a[48]][_0x717a[47]])[_0x717a[40]](function(_0x3924x2b){_0x3924x27[_0x717a[45]]({"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x717a[43],"\x78\x2D\x74\x69\x6D\x65\x73\x74\x61\x6D\x70":Date[_0x717a[44]](),"\x78\x2D\x73\x65\x6E\x74":true});var _0x3924x2c=xchatty_components[_0x717a[46]];var _0x3924x2d={websiteId:_0x3924x26[_0x717a[48]][_0x717a[47]],rootPath:Util[_0x717a[50]](_0x3924x2b[_0x717a[49]])+ _0x717a[51],signedUp:_0x717a[52],windowFocused:_0x717a[52],isNewPage:_0x717a[53],processingSignUp:_0x717a[52],processingEnquiry:_0x717a[52],processingSend:_0x717a[52],processingRating:_0x717a[52],visitorFullname:_0x717a[54],visitorAvatar:_0x717a[54],timerReadMessages:_0x717a[55],timerCheckStatus:_0x717a[55],isOnline:_0x717a[52],decayHistory:0,defaultTimeout:5000,isInitialStatusCheck:_0x717a[53],muteNotificationSoundOnce:_0x717a[52],assetBase:Util[_0x717a[50]](_0x3924x2b[_0x717a[49]])+ _0x717a[56],hasSessionSaf:_0x717a[52],restoreOpenState:_0x717a[52],animateHover:_0x3924x2b[_0x717a[57]],hideEmail:_0x717a[52],hideOffline:_0x717a[52],headerShape:_0x3924x2b[_0x717a[58]],HeaderOnline:_0x3924x2b[_0x717a[59]],OnlineMessage:_0x3924x2b[_0x717a[60]],UsernamePlaceholder:_0x3924x2b[_0x717a[61]],EmailPlaceholder:_0x3924x2b[_0x717a[62]],StartChatButtonText:_0x3924x2b[_0x717a[63]],OfflineMessage:_0x3924x2b[_0x717a[64]],HeaderOffline:_0x3924x2b[_0x717a[65]],EnquiryMessagePlaceholder:_0x3924x2b[_0x717a[66]],EnquiryButtonText:_0x3924x2b[_0x717a[67]],downloadTranscript:_0x3924x2b[_0x717a[68]],RatingMessage:_0x3924x2b[_0x717a[69]],RatingSend:_0x3924x2b[_0x717a[70]],RatingSkip:_0x3924x2b[_0x717a[71]],MessageAgentsBusy:_0x3924x2b[_0x717a[72]],NameTitle:_0x3924x2b[_0x717a[73]],EmailTitle:_0x3924x2b[_0x717a[74]],MessageTitle:_0x3924x2b[_0x717a[75]]};_0x3924x2c= Mustache[_0x717a[76]](_0x3924x2c,_0x3924x2d);_0x3924x27[_0x717a[38]](_0x3924x2c)})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})};exports[_0x717a[78]]= function(_0x3924x26,_0x3924x27,_0x3924x28){ChatWebsite[_0x717a[77]](_0x3924x26[_0x717a[48]][_0x717a[47]])[_0x717a[40]](function(_0x3924x2b){_0x3924x27[_0x717a[45]]({"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x717a[79],"\x78\x2D\x74\x69\x6D\x65\x73\x74\x61\x6D\x70":Date[_0x717a[44]](),"\x78\x2D\x73\x65\x6E\x74":true});var _0x3924x2e=xchatty_components[_0x717a[80]];var _0x3924x2f={assetBase:Util[_0x717a[50]](_0x3924x2b[_0x717a[49]])+ _0x717a[56],color:_0x3924x2b[_0x717a[81]],colorFocus:_0x3924x2b[_0x717a[82]],colorButton:_0x3924x2b[_0x717a[83]]};_0x3924x2e= Mustache[_0x717a[76]](_0x3924x2e,_0x3924x2f);_0x3924x27[_0x717a[38]](_0x3924x2e)})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})};exports[_0x717a[84]]= function(_0x3924x26,_0x3924x27,_0x3924x28){if(_0x3924x26[_0x717a[87]][_0x717a[86]](_0x717a[85])){_0x3924x27[_0x717a[93]](path[_0x717a[92]](config[_0x717a[88]],_0x717a[89],_0x717a[90],_0x3924x26[_0x717a[87]][_0x717a[91]]))}else {_0x3924x27[_0x717a[93]](path[_0x717a[92]](config[_0x717a[88]],_0x717a[89],_0x717a[94],_0x717a[95],_0x717a[96],_0x3924x26[_0x717a[87]][_0x717a[91]]))}};exports[_0x717a[97]]= function(_0x3924x26,_0x3924x27,_0x3924x28){_0x3924x27[_0x717a[45]]({"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0x717a[43],"\x78\x2D\x74\x69\x6D\x65\x73\x74\x61\x6D\x70":Date[_0x717a[44]](),"\x78\x2D\x73\x65\x6E\x74":true});var _0x3924x30=xchatty_components[_0x717a[98]];_0x3924x27[_0x717a[38]](_0x3924x30)};exports[_0x717a[99]]= function(_0x3924x26,_0x3924x27,_0x3924x28){if(!_0x3924x26[_0x717a[100]][_0x717a[95]]){_0x3924x26[_0x717a[100]][_0x717a[95]]= {}};var _0x3924x31={};return Agent[_0x717a[41]]({where:{online:true,role:_0x717a[119]}})[_0x717a[40]](function(_0x3924x34){if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[113]]){_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[113]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[113]]=== _0x717a[53]?true:false};_0x3924x31= {success:true,has_session_saf:null,signed_up:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[109]]?true:false,fullname:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[115]]?_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[115]]:_0x717a[112],email:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[116]]?_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[116]]:_0x717a[112],avatar:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[117]]?_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[117]]:_0x717a[112],open_state:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[113]]|| _0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[109]]?true:false,online:_0x3924x34[_0x717a[118]]?true:false,is_unserved:false,room_id:0};return})[_0x717a[40]](function(){if(_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[106]]){return ChatRoom[_0x717a[108]]({where:{ChatVisitorId:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[106]],status:_0x717a[111],token:{$ne:_0x717a[112]}}})};return})[_0x717a[40]](function(_0x3924x33){if(_0x3924x33){_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[109]]= _0x3924x33[_0x717a[47]];_0x3924x31[_0x717a[109]]= _0x3924x33[_0x717a[47]];_0x3924x31[_0x717a[110]]= true}else {_0x3924x31[_0x717a[110]]= false};return})[_0x717a[40]](function(){if(_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[106]]){return ChatVisitor[_0x717a[108]]({where:{id:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[106]],status:_0x717a[107]}})};return})[_0x717a[40]](function(_0x3924x32){if(_0x3924x32){_0x3924x31[_0x717a[101]]= true};return _0x3924x27[_0x717a[38]](_0x3924x26[_0x717a[87]][_0x717a[102]]+ _0x717a[103]+ JSON[_0x717a[104]](_0x3924x31)+ _0x717a[105])})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})};exports[_0x717a[120]]= function(_0x3924x26,_0x3924x27,_0x3924x28){var _0x3924x35=_0x3924x26[_0x717a[48]][_0x717a[47]];var _0x3924x36={where:{ChatRoomId:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]]},include:[{model:User,attributes:[_0x717a[47],_0x717a[121],_0x717a[115],_0x717a[116]]},{model:ChatVisitor,attributes:[_0x717a[47],_0x717a[115],_0x717a[116]]}]};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[122]]=== _0x717a[52]){_0x3924x36[_0x717a[123]][_0x717a[47]]= {$gt:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[124]]}};ChatMessage[_0x717a[41]](_0x3924x36)[_0x717a[40]](function(_0x3924x37){var _0x3924x38={success:true,messages:_0x3924x37,composing:false,composing_fullname:null};_0x3924x27[_0x717a[38]](_0x3924x26[_0x717a[87]][_0x717a[102]]+ _0x717a[103]+ JSON[_0x717a[104]](_0x3924x38)+ _0x717a[105])})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})};exports[_0x717a[125]]= function(_0x3924x26,_0x3924x27,_0x3924x28){var _0x3924x35=_0x3924x26[_0x717a[48]][_0x717a[47]];var _0x3924x36={where:{ChatRoomId:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]]},include:[{model:User,attributes:[_0x717a[47],_0x717a[121],_0x717a[115],_0x717a[116]]},{model:ChatVisitor,attributes:[_0x717a[47],_0x717a[115],_0x717a[116]]}]};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[122]]=== _0x717a[52]){_0x3924x36[_0x717a[123]][_0x717a[47]]= {$gt:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[124]]}};ChatMessage[_0x717a[128]]({body:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[127]][_0x717a[126]],ChatRoomId:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]],ChatVisitorId:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]]})[_0x717a[40]](function(_0x3924x39){ChatMessage[_0x717a[41]](_0x3924x36)[_0x717a[40]](function(_0x3924x37){var _0x3924x38={errors:[],success:true,data:_0x3924x39,messages:_0x3924x37};_0x3924x27[_0x717a[38]](_0x3924x26[_0x717a[87]][_0x717a[102]]+ _0x717a[103]+ JSON[_0x717a[104]](_0x3924x38)+ _0x717a[105])})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})};exports[_0x717a[129]]= function(_0x3924x26,_0x3924x27,_0x3924x28){var _0x3924x35=_0x3924x26[_0x717a[48]][_0x717a[47]];return ChatRoom[_0x717a[77]](_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]])[_0x717a[40]](function(_0x3924x33){return _0x3924x33[_0x717a[132]]({status:_0x717a[130],completeReason:_0x717a[131]})})[_0x717a[40]](function(){var _0x3924x38={success:true,errors:[]};_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35]= {};_0x3924x27[_0x717a[38]](_0x3924x26[_0x717a[87]][_0x717a[102]]+ _0x717a[103]+ JSON[_0x717a[104]](_0x3924x38)+ _0x717a[105])})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})};exports[_0x717a[133]]= function(_0x3924x26,_0x3924x27,_0x3924x28){var _0x3924x35=_0x3924x26[_0x717a[48]][_0x717a[47]];var _0x3924x3a=uaParser[_0x717a[137]](_0x3924x26[_0x717a[136]][_0x717a[135]])[_0x717a[134]]();var _0x3924x3b=languageParser[_0x717a[139]](_0x3924x26[_0x717a[136]][_0x717a[138]]);var _0x3924x3c=_0x3924x26[_0x717a[136]][_0x717a[140]]?_0x3924x26[_0x717a[136]][_0x717a[140]]:_0x3924x26[_0x717a[142]][_0x717a[141]]|| _0x3924x26[_0x717a[143]];var _0x3924x3d={fullname:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[115]],email:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[116]],remote_address:_0x3924x3c,user_agent:_0x3924x26[_0x717a[136]][_0x717a[135]],visitor_language:_0x3924x26[_0x717a[136]][_0x717a[138]],referer:_0x3924x26[_0x717a[136]][_0x717a[145]],origin:_0x717a[146],browser:_0x3924x3a[_0x717a[147]][_0x717a[121]]+ _0x717a[148]+ _0x3924x3a[_0x717a[147]][_0x717a[149]],engine:_0x3924x3a[_0x717a[150]][_0x717a[121]]+ _0x717a[148]+ _0x3924x3a[_0x717a[150]][_0x717a[149]],os:_0x3924x3a[_0x717a[151]][_0x717a[121]]+ _0x717a[148]+ _0x3924x3a[_0x717a[151]][_0x717a[149]],device:_0x3924x3a[_0x717a[153]][_0x717a[152]]?_0x3924x3a[_0x717a[153]][_0x717a[152]]+ _0x717a[148]+ _0x3924x3a[_0x717a[153]][_0x717a[154]]+ _0x717a[148]+ _0x3924x3a[_0x717a[153]][_0x717a[155]]:null,ChatWebsiteId:_0x3924x26[_0x717a[87]][_0x717a[156]]};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[157]]&& _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[158]]){_0x3924x3d[_0x717a[157]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[157]];_0x3924x3d[_0x717a[158]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[158]]};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[159]]&& _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[160]]){_0x3924x3d[_0x717a[159]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[159]];_0x3924x3d[_0x717a[160]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[160]]};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[161]]&& _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[162]]){_0x3924x3d[_0x717a[161]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[161]];_0x3924x3d[_0x717a[162]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[144]][_0x717a[162]]};var _0x3924x3e,_0x3924x3f,_0x3924x40;return ChatVisitor[_0x717a[128]](_0x3924x3d)[_0x717a[40]](function(_0x3924x43){_0x3924x3e= _0x3924x43;return ChatWebsite[_0x717a[77]](_0x3924x3e.ChatWebsiteId)})[_0x717a[40]](function(_0x3924x42){_0x3924x3f= _0x3924x42;if(_0x3924x3f[_0x717a[171]]){return Contact[_0x717a[172]]({where:{email:_0x3924x3e[_0x717a[116]]},defaults:{email:_0x3924x3e[_0x717a[116]],firstName:_0x3924x3e[_0x717a[115]],ListId:_0x3924x3f[_0x717a[171]]}})}})[_0x717a[40]](function(){return ChatRoom[_0x717a[128]]({type:_0x717a[170],ChatVisitorId:_0x3924x3e[_0x717a[47]],ChatWebsiteId:_0x3924x3f[_0x717a[47]]})})[_0x717a[40]](function(_0x3924x33){_0x3924x40= _0x3924x33;var _0x3924x41= new Scheduler({channel:_0x717a[163],uniqueid:util[_0x717a[166]](_0x717a[164],moment()[_0x717a[165]](),_0x3924x40[_0x717a[47]]),roomid:_0x3924x40[_0x717a[47]],websiteid:_0x3924x3f[_0x717a[47]],websitename:_0x3924x3f[_0x717a[121]],websiteaddress:_0x3924x3f[_0x717a[167]],accountid:_0x3924x3f[_0x717a[47]],accountname:_0x3924x3f[_0x717a[121]],accountaddress:_0x3924x3f[_0x717a[167]],visitorid:_0x3924x3e[_0x717a[47]],visitorname:_0x3924x3e[_0x717a[115]],visitoremail:_0x3924x3e[_0x717a[116]]});_0x3924x41[_0x717a[168]]();_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[115]]= _0x3924x3e[_0x717a[115]];_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[116]]= _0x3924x3e[_0x717a[116]];_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[117]]= md5(_0x3924x3e[_0x717a[116]]).toString(_0x717a[169]);_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]]= _0x3924x3e[_0x717a[47]];var _0x3924x38={success:true,errors:[],chatVisitor:{id:_0x3924x3e[_0x717a[47]]}};_0x3924x27[_0x717a[38]](_0x3924x26[_0x717a[87]][_0x717a[102]]+ _0x717a[103]+ JSON[_0x717a[104]](_0x3924x38)+ _0x717a[105])})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})};exports[_0x717a[173]]= function(_0x3924x26,_0x3924x27,_0x3924x28){var _0x3924x35=_0x3924x26[_0x717a[48]][_0x717a[47]];return ChatVisitor[_0x717a[77]](_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]])[_0x717a[40]](function(_0x3924x43){return _0x3924x43[_0x717a[132]]({status:_0x717a[107]})})[_0x717a[40]](function(){var _0x3924x38={success:true,errors:[]};_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35]= {};_0x3924x27[_0x717a[38]](_0x3924x26[_0x717a[87]][_0x717a[102]]+ _0x717a[103]+ JSON[_0x717a[104]](_0x3924x38)+ _0x717a[105])})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})};exports[_0x717a[174]]= function(_0x3924x26,_0x3924x27,_0x3924x28){return sequelize[_0x717a[186]]()[_0x717a[40]](function(_0x3924x44){var _0x3924x3c=_0x3924x26[_0x717a[136]][_0x717a[140]]?_0x3924x26[_0x717a[136]][_0x717a[140]]:_0x3924x26[_0x717a[142]][_0x717a[141]]|| _0x3924x26[_0x717a[143]];var _0x3924x3a=uaParser[_0x717a[137]](_0x3924x26[_0x717a[136]][_0x717a[135]])[_0x717a[134]]();var _0x3924x3b=languageParser[_0x717a[139]](_0x3924x26[_0x717a[136]][_0x717a[138]]);var _0x3924x3d={fullname:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[115]],email:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[116]],remote_address:_0x3924x3c,user_agent:_0x3924x26[_0x717a[136]][_0x717a[135]],visitor_language:_0x3924x26[_0x717a[136]][_0x717a[138]],browser:_0x3924x3a[_0x717a[147]][_0x717a[121]]+ _0x717a[148]+ _0x3924x3a[_0x717a[147]][_0x717a[149]],engine:_0x3924x3a[_0x717a[150]][_0x717a[121]]+ _0x717a[148]+ _0x3924x3a[_0x717a[150]][_0x717a[149]],os:_0x3924x3a[_0x717a[151]][_0x717a[121]]+ _0x717a[148]+ _0x3924x3a[_0x717a[151]][_0x717a[149]],device:_0x3924x3a[_0x717a[153]][_0x717a[152]]?_0x3924x3a[_0x717a[153]][_0x717a[152]]+ _0x717a[148]+ _0x3924x3a[_0x717a[153]][_0x717a[154]]+ _0x717a[148]+ _0x3924x3a[_0x717a[153]][_0x717a[155]]:null,referer:_0x3924x26[_0x717a[136]][_0x717a[145]],origin:_0x717a[176],status:_0x717a[107],ChatWebsiteId:parseInt(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[177]],10),ChatEnquiry:{username:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[115]],email:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[116]],text:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[126]],ChatWebsiteId:parseInt(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[177]],10)}};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[178]]&& _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[179]]){_0x3924x3d[_0x717a[178]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[178]];_0x3924x3d[_0x717a[179]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[179]]};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[180]]&& _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[181]]){_0x3924x3d[_0x717a[180]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[180]];_0x3924x3d[_0x717a[181]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[181]]};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[182]]&& _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[183]]){_0x3924x3d[_0x717a[182]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[182]];_0x3924x3d[_0x717a[183]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[175]][_0x717a[183]]};var _0x3924x3e;return ChatVisitor[_0x717a[128]](_0x3924x3d,{transaction:_0x3924x44,include:[{model:ChatEnquiry}]})[_0x717a[40]](function(_0x3924x43){_0x3924x3e= _0x3924x43;return ChatWebsite[_0x717a[77]](_0x3924x3e.ChatWebsiteId)})[_0x717a[40]](function(_0x3924x42){if(_0x3924x42[_0x717a[171]]){return Contact[_0x717a[172]]({where:{email:_0x3924x3e[_0x717a[116]]},defaults:{email:_0x3924x3e[_0x717a[116]],firstName:_0x3924x3e[_0x717a[115]],ListId:_0x3924x42[_0x717a[171]]}})}})[_0x717a[40]](function(){_0x3924x44[_0x717a[185]]();_0x3924x27[_0x717a[38]](_0x3924x26[_0x717a[87]][_0x717a[102]]+ _0x717a[103]+ JSON[_0x717a[104]]({success:true,errors:[]})+ _0x717a[105])})[_0x717a[37]](function(_0x3924x29){_0x3924x44[_0x717a[184]]();_0x3924x28(_0x3924x29)})})};exports[_0x717a[187]]= function(_0x3924x26,_0x3924x27,_0x3924x28){var _0x3924x35=_0x3924x26[_0x717a[48]][_0x717a[47]];if(_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35]&& _0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]]&& _0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]]){ChatMessage[_0x717a[41]]({where:{ChatRoomId:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]]},include:[{model:Agent,attributes:[_0x717a[47],_0x717a[115]]},{model:ChatVisitor,attributes:[_0x717a[47],_0x717a[115]]}]})[_0x717a[40]](function(_0x3924x37){var _0x3924x45=[];_0x3924x37[_0x717a[193]](function(_0x3924x39){var _0x3924x46={name:_0x3924x39[_0x717a[188]]?_0x3924x39[_0x717a[24]][_0x717a[115]]:_0x3924x39[_0x717a[27]][_0x717a[115]],text:_0x3924x39[_0x717a[190]][_0x717a[189]](/(\r\n|\n|\r)/gm,_0x717a[148]),date:_0x3924x39[_0x717a[191]]};_0x3924x45[_0x717a[192]](_0x3924x46)});var _0x3924x47=csv(_0x3924x45);_0x3924x27[_0x717a[155]](_0x717a[194])[_0x717a[39]](200)[_0x717a[38]](_0x3924x47)})[_0x717a[37]](function(_0x3924x29){_0x3924x28(_0x3924x29)})}};exports[_0x717a[195]]= function(_0x3924x26,_0x3924x27,_0x3924x28){return Xchatty[_0x717a[77]](_0x3924x26[_0x717a[48]][_0x717a[47]])[_0x717a[40]](function(_0x3924x48){if(!_0x3924x48){return _0x3924x27[_0x717a[196]](404)};return _0x3924x27[_0x717a[38]](_0x3924x48)})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})};exports[_0x717a[128]]= function(_0x3924x26,_0x3924x27,_0x3924x28){return Xchatty[_0x717a[128]](_0x3924x26[_0x717a[190]])[_0x717a[40]](function(_0x3924x48){return _0x3924x27[_0x717a[39]](201)[_0x717a[38]](_0x3924x48)})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})};exports[_0x717a[132]]= function(_0x3924x26,_0x3924x27,_0x3924x28){if(_0x3924x26[_0x717a[190]][_0x717a[47]]){delete _0x3924x26[_0x717a[190]][_0x717a[47]]};return Xchatty[_0x717a[77]](_0x3924x26[_0x717a[48]][_0x717a[47]])[_0x717a[40]](function(_0x3924x48){if(!_0x3924x48){return _0x3924x27[_0x717a[196]](404)};var _0x3924x49=_[_0x717a[197]](_0x3924x48,_0x3924x26[_0x717a[190]]);_0x3924x49[_0x717a[198]]()[_0x717a[40]](function(){return _0x3924x27[_0x717a[39]](200)[_0x717a[38]](_0x3924x48)})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})};exports[_0x717a[199]]= function(_0x3924x26,_0x3924x27,_0x3924x28){return Xchatty[_0x717a[77]](_0x3924x26[_0x717a[48]][_0x717a[47]])[_0x717a[40]](function(_0x3924x48){if(!_0x3924x48){return _0x3924x27[_0x717a[196]](404)};_0x3924x48[_0x717a[199]]()[_0x717a[40]](function(){return _0x3924x27[_0x717a[196]](204)})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})};exports[_0x717a[200]]= function(_0x3924x26,_0x3924x27,_0x3924x28){var _0x3924x2b,_0x3924x4a;var _0x3924x4b=xchatty_components[_0x717a[201]];return ChatWebsite[_0x717a[77]](_0x3924x26[_0x717a[48]][_0x717a[47]],{include:[{all:true}]})[_0x717a[40]](function(_0x3924x3f){_0x3924x2b= _0x3924x3f;return Settings[_0x717a[77]](1)})[_0x717a[40]](function(_0x3924x4c){if(_0x3924x4c){_0x3924x4a= JSON[_0x717a[139]](license[_0x717a[204]](_0x3924x4c[_0x717a[203]][_0x717a[202]]))}else {_0x3924x4a= demoLicense};var _0x3924x4d={rootPath:Util[_0x717a[50]](_0x3924x2b[_0x717a[49]])+ _0x717a[51],assetBase:Util[_0x717a[50]](_0x3924x2b[_0x717a[49]])+ _0x717a[56],websiteId:_0x3924x2b[_0x717a[47]],headerShape:_0x3924x2b[_0x717a[58]],enquiryEnable:_0x3924x2b[_0x717a[205]],onlineFields:_0x3924x2b[_0x717a[206]],logo:function(){if(_0x3924x4a[_0x717a[207]]&& !_0x3924x2b[_0x717a[208]]&& _0x3924x2b[_0x717a[209]]){return _0x717a[210]+ _0x3924x2b[_0x717a[209]]+ _0x717a[211]}else {return _0x717a[212]}},whiteLabel:function(){if(_0x3924x4a[_0x717a[207]]&& !_0x3924x2b[_0x717a[213]]){return _0x3924x2b[_0x717a[214]]}else {return _0x717a[215]}},renderedOnlineField:function(){var _0x3924x4e=_0x717a[112];var _0x3924x4f=this;switch(this[_0x717a[240]]){case _0x717a[224]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[217],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[218]],_0x3924x4f[_0x717a[219]]?_0x717a[220]:_0x717a[112]);_0x3924x4e+= util[_0x717a[166]](_0x717a[221],_0x3924x4f[_0x717a[218]],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x4f[_0x717a[222]],_0x3924x4f[_0x717a[219]]?_0x717a[219]:_0x717a[112]);_0x3924x4e+= _0x717a[223];break;case _0x717a[226]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[217],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[218]],_0x3924x4f[_0x717a[219]]?_0x717a[220]:_0x717a[112]);_0x3924x4e+= util[_0x717a[166]](_0x717a[225],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[218]],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x4f[_0x717a[222]],_0x3924x4f[_0x717a[219]]?_0x717a[219]:_0x717a[112]);_0x3924x4e+= _0x717a[223];break;case _0x717a[232]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[227],_0x3924x4f[_0x717a[218]]);_[_0x717a[193]](_0x3924x4f[_0x717a[228]],function(_0x3924x50){_0x3924x4e+= _0x717a[229];_0x3924x4e+= util[_0x717a[166]](_0x717a[230],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x50,_0x3924x50);_0x3924x4e+= _0x717a[231]});_0x3924x4e+= _0x717a[223];break;case _0x717a[234]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[227],_0x3924x4f[_0x717a[218]]);_[_0x717a[193]](_0x3924x4f[_0x717a[228]],function(_0x3924x50){_0x3924x4e+= _0x717a[229];_0x3924x4e+= util[_0x717a[166]](_0x717a[233],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x50,_0x3924x50);_0x3924x4e+= _0x717a[231]});_0x3924x4e+= _0x717a[223];break;case _0x717a[239]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[235],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[218]]);_0x3924x4e+= util[_0x717a[166]](_0x717a[236],_0x3924x4f[_0x717a[36]]+ 1);_[_0x717a[193]](_0x3924x4f[_0x717a[228]],function(_0x3924x50){_0x3924x4e+= util[_0x717a[166]](_0x717a[237],_0x3924x50,_0x3924x50)});_0x3924x4e+= _0x717a[238];break};_0x3924x4e+= _0x717a[241];_0x3924x4e+= util[_0x717a[166]](_0x717a[242],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x4f[_0x717a[218]]);return _0x3924x4e},offlineFields:_0x3924x2b[_0x717a[243]],renderedOfflineField:function(){var _0x3924x4e=_0x717a[112];var _0x3924x4f=this;switch(this[_0x717a[240]]){case _0x717a[224]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[244],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[218]],_0x3924x4f[_0x717a[219]]?_0x717a[220]:_0x717a[112]);_0x3924x4e+= util[_0x717a[166]](_0x717a[245],_0x3924x4f[_0x717a[218]],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x4f[_0x717a[222]],_0x3924x4f[_0x717a[219]]?_0x717a[219]:_0x717a[112]);_0x3924x4e+= _0x717a[223];break;case _0x717a[226]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[244],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[218]],_0x3924x4f[_0x717a[219]]?_0x717a[220]:_0x717a[112]);_0x3924x4e+= util[_0x717a[166]](_0x717a[246],_0x3924x4f[_0x717a[36]],_0x3924x4f[_0x717a[218]],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x4f[_0x717a[222]],_0x3924x4f[_0x717a[219]]?_0x717a[219]:_0x717a[112]);_0x3924x4e+= _0x717a[223];break;case _0x717a[232]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[227],_0x3924x4f[_0x717a[218]]);_[_0x717a[193]](_0x3924x4f[_0x717a[228]],function(_0x3924x50){_0x3924x4e+= _0x717a[229];_0x3924x4e+= util[_0x717a[166]](_0x717a[247],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x50,_0x3924x50);_0x3924x4e+= _0x717a[231]});_0x3924x4e+= _0x717a[223];break;case _0x717a[234]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[227],_0x3924x4f[_0x717a[218]]);_[_0x717a[193]](_0x3924x4f[_0x717a[228]],function(_0x3924x50){_0x3924x4e+= _0x717a[229];_0x3924x4e+= util[_0x717a[166]](_0x717a[248],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x50,_0x3924x50);_0x3924x4e+= _0x717a[231]});_0x3924x4e+= _0x717a[223];break;case _0x717a[239]:_0x3924x4e= _0x717a[216];_0x3924x4e+= util[_0x717a[166]](_0x717a[227],_0x3924x4f[_0x717a[218]]);_0x3924x4e+= util[_0x717a[166]](_0x717a[249],_0x3924x4f[_0x717a[36]]+ 1);_[_0x717a[193]](_0x3924x4f[_0x717a[228]],function(_0x3924x50){_0x3924x4e+= util[_0x717a[166]](_0x717a[237],_0x3924x50,_0x3924x50)});_0x3924x4e+= _0x717a[238];break};_0x3924x4e+= _0x717a[241];_0x3924x4e+= util[_0x717a[166]](_0x717a[250],_0x3924x4f[_0x717a[36]]+ 1,_0x3924x4f[_0x717a[218]]);return _0x3924x4e}};_0x3924x4b= Mustache[_0x717a[76]](_0x3924x4b,_0x3924x4d);return _0x3924x27[_0x717a[39]](200)[_0x717a[251]](_0x3924x4b)})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})};exports[_0x717a[252]]= function(_0x3924x26,_0x3924x27,_0x3924x28){return ChatWebsite[_0x717a[77]](_0x3924x26[_0x717a[48]][_0x717a[47]],{include:[{model:ChatProactiveAction}]})[_0x717a[40]](function(_0x3924x2b){if(!_0x3924x2b){return _0x3924x27[_0x717a[39]](400)[_0x717a[251]]({})};return _0x3924x27[_0x717a[39]](200)[_0x717a[251]](_0x3924x2b.ChatProactiveActions)})[_0x717a[37]](function(_0x3924x29){return _0x3924x28(_0x3924x29)})};exports[_0x717a[253]]= function(_0x3924x26,_0x3924x27,_0x3924x28){return ChatRoom[_0x717a[77]](_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[255]][_0x717a[109]])[_0x717a[40]](function(_0x3924x33){if(!_0x3924x33){return _0x3924x27[_0x717a[39]](400)[_0x717a[251]]({})};if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[255]][_0x717a[86]](_0x717a[254])&& _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[255]][_0x717a[86]](_0x717a[126])){return _0x3924x33[_0x717a[132]]({rating:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[255]][_0x717a[254]],ratingMessage:_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[255]][_0x717a[126]]})};return})[_0x717a[40]](function(){return _0x3924x27[_0x717a[39]](200)[_0x717a[251]]({})})[_0x717a[37]](function(_0x3924x29){return _0x3924x27[_0x717a[39]](400)[_0x717a[251]](_0x3924x29)})};exports[_0x717a[256]]= function(_0x3924x26,_0x3924x27,_0x3924x28){var _0x3924x35=_0x3924x26[_0x717a[48]][_0x717a[47]];if(_0x3924x26[_0x717a[100]]&& _0x3924x26[_0x717a[100]][_0x717a[95]]){if(_0x3924x26[_0x717a[100]][_0x717a[95]][_0x717a[86]](_0x3924x35)&& _0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[86]](_0x717a[106])&& _0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]]> 0){return ReportChatSession[_0x717a[258]]({where:{visitorid:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]],leaveAt:null}})[_0x717a[40]](function(_0x3924x51){if(!_0x3924x51){return};return _0x3924x51[_0x717a[132]]({abandon:true,leaveAt:moment()[_0x717a[166]](_0x717a[257])})})[_0x717a[40]](function(){return _0x3924x27[_0x717a[39]](200)[_0x717a[251]]({})})[_0x717a[37]](function(_0x3924x29){_0x3924x27[_0x717a[39]](500)[_0x717a[251]]({})})}};return _0x3924x27[_0x717a[39]](200)[_0x717a[251]]({})};exports[_0x717a[259]]= function(_0x3924x26,_0x3924x27,_0x3924x28){if(!_0x3924x26[_0x717a[100]][_0x717a[95]]){_0x3924x26[_0x717a[100]][_0x717a[95]]= {}};if(!_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x26[_0x717a[48]][_0x717a[47]]]){_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x26[_0x717a[48]][_0x717a[47]]]= {}};var _0x3924x35=_0x3924x26[_0x717a[48]][_0x717a[47]];var _0x3924x52;var _0x3924x31={};var _0x3924x53=[];return ChatWebsite[_0x717a[77]](_0x3924x35)[_0x717a[40]](function(_0x3924x42){if(!_0x3924x42){return _0x3924x27[_0x717a[196]](500)};_0x3924x52= _0x3924x42;return _0x3924x52[_0x717a[269]]({include:[{model:ChatQueue,include:[{model:Agent}]},{model:Agent}]})})[_0x717a[40]](function(_0x3924x55){_[_0x717a[193]](_0x3924x55,function(_0x3924x56){if(_0x3924x56[_0x717a[263]]=== _0x717a[264]){if(_0x3924x56[_0x717a[33]][_0x717a[86]](_0x717a[265])&& _0x3924x56[_0x717a[33]][_0x717a[265]][_0x717a[118]]> 0){_0x3924x53= _[_0x717a[267]](_[_0x717a[197]](_0x3924x53,_[_0x717a[266]](_0x3924x56[_0x717a[33]].Users,_0x717a[47])))}}else {if(_0x3924x56[_0x717a[263]]=== _0x717a[119]){_0x3924x53[_0x717a[192]](_0x3924x56[_0x717a[24]][_0x717a[47]]);_0x3924x53= _[_0x717a[267]](_0x3924x53)}}});return Agent[_0x717a[268]]({where:{online:true,id:{$in:_0x3924x53}}})})[_0x717a[40]](function(_0x3924x54){if(_0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[113]]){_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[113]]= _0x3924x26[_0x717a[87]][_0x717a[114]][_0x717a[113]]=== _0x717a[53]?true:false};_0x3924x31= {success:true,has_session_saf:null,signed_up:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]]?true:false,fullname:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[115]]|| _0x717a[112],email:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[116]]|| _0x717a[112],avatar:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[117]]|| _0x717a[112],open_state:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[113]]|| _0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]]?true:false,online:_0x3924x54[_0x717a[262]]?true:false,is_unserved:false,room_id:0};if(_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]]){return ChatRoom[_0x717a[108]]({where:{ChatVisitorId:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]],status:_0x717a[111],token:{$ne:_0x717a[112]}}})};return})[_0x717a[40]](function(_0x3924x33){if(_0x3924x33){_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[109]]= _0x3924x33[_0x717a[47]];_0x3924x31[_0x717a[109]]= _0x3924x33[_0x717a[47]];_0x3924x31[_0x717a[110]]= true}else {_0x3924x31[_0x717a[110]]= false};if(_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]]){return ChatVisitor[_0x717a[108]]({where:{id:_0x3924x26[_0x717a[100]][_0x717a[95]][_0x3924x35][_0x717a[106]],status:_0x717a[107]}})};return})[_0x717a[40]](function(_0x3924x32){if(_0x3924x32){_0x3924x31[_0x717a[101]]= true};return _0x3924x27[_0x717a[39]](200)[_0x717a[251]](_0x3924x31)})[_0x717a[37]](function(_0x3924x29){console[_0x717a[261]](_0x717a[260],_0x3924x29);return _0x3924x27[_0x717a[39]](500)[_0x717a[251]]({})})}
\ No newline at end of file