{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./src/livechat.load.js"],"names":["LiveChatWidgetLoader","parseQueryString","url","a","document","createElement","href","pairs","search","slice","split","result","forEach","pair","decodeURIComponent","JSON","parse","stringify","console","log","HOSTING_URL","LiveChatUrl","LiveChatCssUrl","els","getElementsByTagName","re","i","length","el","src","match","info","settings","warn","container","parentNode","insertBefore","l","rel","head","appendChild","s","async","body"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,CAAC,UAACA,oBAAD,EAA0B;AACzB,MAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,GAAD,EAAS;AAChC,QAAMC,CAAC,GAAGC,QAAQ,CAACC,aAAT,CAAuB,GAAvB,CAAV;AACAF,KAAC,CAACG,IAAF,GAASJ,GAAT;AACA,QAAIK,KAAK,GAAGJ,CAAC,CAACK,MAAF,CAASC,KAAT,CAAe,CAAf,EAAkBC,KAAlB,CAAwB,GAAxB,CAAZ;AAEA,QAAIC,MAAM,GAAG,EAAb;AACAJ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CD,IAAhC;AACD;AACF;;AAED,MAAI,CAAC/B,oBAAoB,CAACgC,QAA1B,EAAoC;AAClC;AACA;AACD,GAhDwB,CAkDzB;;;AACA,MAAMK,CAAC,GAAGjC,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CAAV;AACAgC,GAAC,CAACC,GAAF,GAAQ,YAAR;AACAD,GAAC,CAAC/B,IAAF,GAASgB,cAAT;AACAlB,UAAQ,CAACmC,IAAT,CAAcC,WAAd,CAA0BH,CAA1B,EAtDyB,CAwDzB;;AACA,MAAMI,CAAC,GAAGrC,QAAQ,CAACC,aAAT,CAAuB,QAAvB,CAAV;AACAoC,GAAC,CAACC,KAAF,GAAU,IAAV;AACAD,GAAC,CAACZ,GAAF,GAAQR,WAAR;AACAjB,UAAQ,CAACuC,IAAT,CAAcH,WAAd,CAA0BC,CAA1B;AAED,CA9DD,EA8DG,IA9DH,E","file":"LiveChatWidgetLoader.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"LiveChatWidgetLoader\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"LiveChatWidgetLoader\"] = factory();\n\telse\n\t\troot[\"LiveChatWidgetLoader\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/livechat.load.js\");\n","((LiveChatWidgetLoader) => {\n const parseQueryString = (url) => {\n const a = document.createElement('a');\n a.href = url;\n var pairs = a.search.slice(1).split('&');\n\n var result = {};\n pairs.forEach(function (pair) {\n pair = pair.split('=');\n result[pair[0]] = decodeURIComponent(pair[1] || '');\n });\n\n return JSON.parse(JSON.stringify(result));\n };\n\n console.log('widget hosting url:', HOSTING_URL);\n const LiveChatUrl = HOSTING_URL + '/LiveChatWidget.js';\n const LiveChatCssUrl = HOSTING_URL + '/LiveChatWidget.css';\n\n // const LiveChatUrl = 'https://widget.mix-chat.com/LiveChatWidget.js';\n // const LiveChatCssUrl = 'https://widget.mix-chat.com/LiveChatWidget.css';\n\n const els = document.getElementsByTagName('script');\n const re = /.*LiveChatWidgetLoader\\.([^/]+\\.)?js/;\n\n // tslint:disable-next-line:prefer-for-of\n for (let i = 0; i < els.length; i++) {\n const el = els[i];\n\n if (el.src.match(re)) {\n const info = parseQueryString(el.src);\n if (LiveChatWidgetLoader.settings) {\n console.warn('LiveChad.load.js embedded more than once, ignoring');\n break;\n }\n\n // Create container div\n const container = document.createElement('div');\n el.parentNode.insertBefore(container, el);\n info.container = container;\n\n LiveChatWidgetLoader.settings = info;\n }\n }\n\n if (!LiveChatWidgetLoader.settings) {\n // nothing to do here\n return;\n }\n\n // Load main CSS\n const l = document.createElement('link');\n l.rel = 'stylesheet';\n l.href = LiveChatCssUrl;\n document.head.appendChild(l);\n\n // Load main javascript\n const s = document.createElement('script');\n s.async = true;\n s.src = LiveChatUrl;\n document.body.appendChild(s);\n\n})(this);"],"sourceRoot":""}