{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/date-fns/esm/_lib/requiredArgs/index.js","webpack:///./app/javascript/widget/helpers/urlParamsHelper.js","webpack:///./node_modules/date-fns/esm/addMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/toDate/index.js","webpack:///./app/javascript/widget/constants/errorTypes.js","webpack:///./app/javascript/widget/helpers/popoutHelper.js","webpack:///./node_modules/date-fns/esm/addHours/index.js","webpack:///./app/javascript/shared/constants/sharedFrameEvents.js","webpack:///./app/javascript/widget/constants/sdkEvents.js","webpack:///./node_modules/charenc/charenc.js","webpack:///./node_modules/md5/md5.js","webpack:///./node_modules/date-fns/esm/_lib/toInteger/index.js","webpack:///./node_modules/crypt/crypt.js","webpack:///./node_modules/is-buffer/index.js","webpack:///./app/javascript/sdk/sdk.js","webpack:///./app/javascript/sdk/DOMHelpers.js","webpack:///./app/javascript/sdk/constants.js","webpack:///./app/javascript/sdk/settingsHelper.js","webpack:///./app/javascript/sdk/bubbleHelpers.js","webpack:///./app/javascript/shared/helpers/CustomEventHelper.js","webpack:///./app/javascript/sdk/cookieHelpers.js","webpack:///./app/javascript/sdk/IFrameHelper.js","webpack:///./app/javascript/packs/sdk.js","webpack:///./node_modules/color2k/dist/index.module.es.js","webpack:///./app/javascript/shared/helpers/colorHelper.js","webpack:///./node_modules/js-cookie/dist/js.cookie.js","webpack:///./app/javascript/shared/helpers/AudioNotificationHelper.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","requiredArgs","required","args","length","TypeError","buildSearchParamsWithLocale","search","locale","window","APP_WIDGET","$root","$i18n","params","URLSearchParams","append","getLocale","arguments","undefined","buildPopoutURL","_ref","origin","conversationCookie","websiteToken","popoutUrl","URL","searchParams","toString","addMilliseconds","dirtyDate","dirtyAmount","timestamp","getTime","amount","Date","toDate","argument","argStr","console","warn","Error","stack","NaN","SET_USER_ERROR","popoutChatWindow","windowUrl","open","focus","err","log","MILLISECONDS_IN_HOUR","addHours","SDK_SET_BUBBLE_VISIBILITY","MULTICHAT_ERROR","MULTICHAT_ON_MESSAGE","MULTICHAT_ON_START_CONVERSATION","MULTICHAT_READY","charenc","utf8","stringToBytes","str","bin","unescape","encodeURIComponent","bytesToString","bytes","decodeURIComponent","escape","push","charCodeAt","String","fromCharCode","join","crypt","isBuffer","md5","message","options","constructor","encoding","Array","slice","isArray","Uint8Array","bytesToWords","a","b","FF","_ff","GG","_gg","HH","_hh","II","_ii","aa","bb","cc","dd","endian","x","_blocksize","_digestsize","digestbytes","wordsToBytes","asBytes","asString","bytesToHex","toInteger","dirtyNumber","number","Number","isNaN","Math","ceil","floor","base64map","rotl","rotr","randomBytes","random","words","hex","hexToBytes","parseInt","substr","bytesToBase64","base64","triplet","j","charAt","base64ToBytes","replace","imod4","indexOf","pow","obj","readFloatLE","isSlowBuffer","_isBuffer","addClasses","elm","classes","classList","add","split","toggleClass","toggle","removeClasses","remove","onLocationChange","referrerURL","referrerHost","IFrameHelper","events","BUBBLE_DESIGN","WIDGET_DESIGN","DARK_MODE","getBubbleView","type","includes","isExpandedView","isFlatWidgetStyle","style","getDarkMode","darkMode","body","document","getElementsByTagName","widgetHolder","createElement","bubbleHolder","chatBubble","closeBubble","notificationBubble","onBubbleClick","props","toggleValue","isOpen","$multichat","newIsOpen","onBubbleToggle","removeUnreadClass","holderEl","querySelector","dispatchWindowEvent","_ref2","eventName","data","event","CustomEvent","detail","createEvent","initCustomEvent","dispatchEvent","REQUIRED_USER_KEYS","ALLOWED_USER_ATTRIBUTES","getUserCookieName","websiteIdentifier","computeHashForUserData","identifier","user","reduce","acc","getUserString","setCookieWithDomain","expires","baseDomain","cookieOptions","sameSite","domain","JSON","stringify","Cookies","set","updateAuthCookie","cookieContent","getUrl","baseUrl","createFrame","getAppFrame","loadCSS","css","innerHTML","appendChild","iframe","cwCookie","widgetUrl","src","allow","id","visibility","holderClassName","position","hideMessageBubble","widgetStyle","initPostMessageCommunication","initWindowSizeListener","preventDefaultScroll","getElementById","getBubbleHolder","getElementsByClassName","sendMessage","contentWindow","postMessage","onmessage","e","parse","addEventListener","toggleCloseButton","deltaY","contentHeight","scrollHeight","visibleHeight","offsetHeight","scrollTop","preventDefault","setFrameHeightToFitContent","extraHeight","isFixedHeight","updatedIframeHeight","setAttribute","setupAudioListeners","getAlertAudio","alertTone","then","initOnEvents","forEach","removeEventListener","loaded","config","authToken","hasLoaded","campaignsSnoozedTill","showPopoutButton","onLoad","widgetColor","channelConfig","bubbleImg","playAudioAlert","resetTriggered","error","_ref3","errorType","onEvent","_ref4","eventIdentifier","setBubbleLabel","bubbleText","launcherTitle","label","innerText","setAuthCookie","_ref5","widgetAuthToken","$chatwoot","setCampaignReadOn","expireBy","updateCampaignReadStatus","toggleBubble","state","bubbleState","_ref6","closeWindow","pushEvent","_ref7","updateIframeHeight","setUnreadMode","addUnreadClass","resetUnreadMode","handleNotificationDot","bubbleElement","unreadMessageCount","contains","closeChat","playAudio","_ref8","onLocationChangeListener","oldHref","location","href","host","bodyList","MutationObserver","mutations","observe","childList","subtree","className","closeBtnClassName","isWidgetColorLighter","chatIcon","target","bubbleClassName","bubbleIcon","alt","textNode","title","createBubbleIcon","background","isMobile","matchMedia","matches","appSDK","run","appSettings","useBrowserLanguage","navigator","language","toggleBubbleVisibility","widgetElm","setUser","hasUserKeys","userCookieName","existingCookieValue","hashToBeStored","setCustomAttributes","customAttributes","keys","deleteCustomAttribute","customAttribute","setConversationCustomAttributes","deleteConversationCustomAttribute","setLabel","removeLabel","setLocale","localeToBeUsed","setColorScheme","reset","guard","low","high","min","max","ColorError","color","super","ColorError$1","parseToRgba","trim","toLowerCase","normalizedColor","namedColorRegex","test","normalizedColorName","result","compressedColorMap","hash","nameToHex","reducedHexMatch","reducedHexRegex","exec","arr","from","map","hexMatch","hexRegex","rgbaMatch","rgbaRegex","parseFloat","hslaMatch","hslaRegex","h","hslToRgb","colorToInt","next","substring","prefix","RegExp","roundColor","round","hue","saturation","lightness","huePrime","chroma","abs","secondComponent","red","green","blue","lightnessModification","getLuminance","f","channel","g","getContrast","color1","color2","luminance1","luminance2","rgba","alpha","toFixed","mix","weight","normalize","index","r1","g1","b1","a1","r2","g2","b2","a2","alphaDelta","normalizedWeight","weight2","weight1","colorToCheck","adjustColorForContrast","backgroundColor","adjustedColor","iteration","toHex","assign","source","init","converter","defaultAttributes","attributes","now","toUTCString","stringifiedAttributes","attributeName","cookie","write","cookies","jar","parts","found","read","withAttributes","this","withConverter","freeze","path","factory","async","requestContext","audioCtx","getAudioContext","AudioContext","webkitAudioContext","playSound","audioBuffer","createBufferSource","buffer","connect","destination","loop","start","audioRequest","Request","fetch","response","arrayBuffer","decodeAudioData","Promise","res","catch"],"mappings":";aACE,IAAIA,EAAmB,CAAC,EAGxB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,CAAC,GAUX,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,OACf,CAIAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,GAEhE,EAGAZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,GACvD,EAOArB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC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OkJ,QAAQ,2CAA4ClE,mBACvF,GAqF+B,CAC/B2Z,KAAM,KAKV,CA5HkFC,E,kCCHlF,oEAAO,MAAMpN,EAAe,CAAC,QAAS,aAAc,WAAY,WAanDH,EAAgBwN,iBAAyC,IAAlCrQ,EAAOzM,UAAAb,OAAA,QAAAc,IAAAD,UAAA,GAAAA,UAAA,GAAG,GAAI+c,EAAc/c,UAAAb,OAAA,EAAAa,UAAA,QAAAC,EAC9D,MAAM+c,EAZuBC,MAC7B,IAAID,EACJ,IACEA,EAAW,IAAKxd,OAAO0d,cAAgB1d,OAAO2d,mBAChD,CAAE,MACA,CAEF,OAAOH,CAAQ,EAKEC,GACXG,EAAYC,IAChB7d,OAAO8Q,eAAiB,KACtB,GAAI0M,EAAU,CACZ,MAAMxB,EAASwB,EAASM,qBACxB9B,EAAO+B,OAASF,EAChB7B,EAAOgC,QAAQR,EAASS,aACxBjC,EAAOkC,MAAO,EACdlC,EAAOmC,OACT,EACD,EAGH,GAAIX,EAAU,CACZ,MAAM,KAAElU,EAAO,YAAW,UAAEyG,EAAY,QAAWwN,GAAkB,CAAC,EAEhEa,EAAe,IAAIC,QADL,GAAGpR,WAAiB3D,KAAQyG,SAGhDuO,MAAMF,GACHpO,MAAKuO,GAAYA,EAASC,gBAC1BxO,MAAK+N,IACJP,EAASiB,gBAAgBV,GAAQ/N,KAAK4N,GAE/B,IAAIc,SAAQC,GAAOA,SAE3BC,OAAM,QAGX,CACF,C","file":"js/sdk.js","sourcesContent":[" \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 = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2421);\n","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","export const buildSearchParamsWithLocale = search => {\n const locale = window.APP_WIDGET.$root.$i18n.locale;\n const params = new URLSearchParams(search);\n params.append('locale', locale);\n\n return `?${params}`;\n};\n\nexport const getLocale = (search = '') => {\n return new URLSearchParams(search).get('locale');\n};\n\nexport const buildPopoutURL = ({\n origin,\n conversationCookie,\n websiteToken,\n locale,\n}) => {\n const popoutUrl = new URL('/widget', origin);\n popoutUrl.searchParams.append('cw_conversation', conversationCookie);\n popoutUrl.searchParams.append('website_token', websiteToken);\n popoutUrl.searchParams.append('locale', locale);\n\n return popoutUrl.toString();\n};\n","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","export const SET_USER_ERROR = 'SET_USER_ERROR';\n","import { buildPopoutURL } from './urlParamsHelper';\n\nexport const popoutChatWindow = (\n origin,\n websiteToken,\n locale,\n conversationCookie\n) => {\n try {\n const windowUrl = buildPopoutURL({\n origin,\n websiteToken,\n locale,\n conversationCookie,\n });\n const popoutWindow = window.open(\n windowUrl,\n `webwidget_session_${websiteToken}`,\n 'resizable=off,width=400,height=600'\n );\n popoutWindow.focus();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log(err);\n }\n};\n","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the hours added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\n\nexport default function addHours(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);\n}","export const SDK_SET_BUBBLE_VISIBILITY = 'sdk-set-bubble-visibility';\n","export const MULTICHAT_ERROR = 'multichat:error';\nexport const MULTICHAT_ON_MESSAGE = 'multichat:on-message';\nexport const MULTICHAT_ON_START_CONVERSATION = 'multichat:on-start-conversation';\nexport const MULTICHAT_READY = 'multichat:ready';\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function (str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n // Convert a byte array to a string\n bytesToString: function (bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function (str) {\n for (var bytes = [], i = 0; i < str.length; i++) bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n // Convert a byte array to a string\n bytesToString: function (bytes) {\n for (var str = [], i = 0; i < bytes.length; i++) str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\nmodule.exports = charenc;","(function () {\n var crypt = require('crypt'),\n utf8 = require('charenc').utf8,\n isBuffer = require('is-buffer'),\n bin = require('charenc').bin,\n // The core\n md5 = function (message, options) {\n // Convert to byte array\n if (message.constructor == String) {\n if (options && options.encoding === 'binary') message = bin.stringToBytes(message);else message = utf8.stringToBytes(message);\n } else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0);else if (!Array.isArray(message) && message.constructor !== Uint8Array) message = message.toString();\n // else, assume byte array already\n\n var m = crypt.bytesToWords(message),\n l = message.length * 8,\n a = 1732584193,\n b = -271733879,\n c = -1732584194,\n d = 271733878;\n\n // Swap endian\n for (var i = 0; i < m.length; i++) {\n m[i] = (m[i] << 8 | m[i] >>> 24) & 0x00FF00FF | (m[i] << 24 | m[i] >>> 8) & 0xFF00FF00;\n }\n\n // Padding\n m[l >>> 5] |= 0x80 << l % 32;\n m[(l + 64 >>> 9 << 4) + 14] = l;\n\n // Method shortcuts\n var FF = md5._ff,\n GG = md5._gg,\n HH = md5._hh,\n II = md5._ii;\n for (var i = 0; i < m.length; i += 16) {\n var aa = a,\n bb = b,\n cc = c,\n dd = d;\n a = FF(a, b, c, d, m[i + 0], 7, -680876936);\n d = FF(d, a, b, c, m[i + 1], 12, -389564586);\n c = FF(c, d, a, b, m[i + 2], 17, 606105819);\n b = FF(b, c, d, a, m[i + 3], 22, -1044525330);\n a = FF(a, b, c, d, m[i + 4], 7, -176418897);\n d = FF(d, a, b, c, m[i + 5], 12, 1200080426);\n c = FF(c, d, a, b, m[i + 6], 17, -1473231341);\n b = FF(b, c, d, a, m[i + 7], 22, -45705983);\n a = FF(a, b, c, d, m[i + 8], 7, 1770035416);\n d = FF(d, a, b, c, m[i + 9], 12, -1958414417);\n c = FF(c, d, a, b, m[i + 10], 17, -42063);\n b = FF(b, c, d, a, m[i + 11], 22, -1990404162);\n a = FF(a, b, c, d, m[i + 12], 7, 1804603682);\n d = FF(d, a, b, c, m[i + 13], 12, -40341101);\n c = FF(c, d, a, b, m[i + 14], 17, -1502002290);\n b = FF(b, c, d, a, m[i + 15], 22, 1236535329);\n a = GG(a, b, c, d, m[i + 1], 5, -165796510);\n d = GG(d, a, b, c, m[i + 6], 9, -1069501632);\n c = GG(c, d, a, b, m[i + 11], 14, 643717713);\n b = GG(b, c, d, a, m[i + 0], 20, -373897302);\n a = GG(a, b, c, d, m[i + 5], 5, -701558691);\n d = GG(d, a, b, c, m[i + 10], 9, 38016083);\n c = GG(c, d, a, b, m[i + 15], 14, -660478335);\n b = GG(b, c, d, a, m[i + 4], 20, -405537848);\n a = GG(a, b, c, d, m[i + 9], 5, 568446438);\n d = GG(d, a, b, c, m[i + 14], 9, -1019803690);\n c = GG(c, d, a, b, m[i + 3], 14, -187363961);\n b = GG(b, c, d, a, m[i + 8], 20, 1163531501);\n a = GG(a, b, c, d, m[i + 13], 5, -1444681467);\n d = GG(d, a, b, c, m[i + 2], 9, -51403784);\n c = GG(c, d, a, b, m[i + 7], 14, 1735328473);\n b = GG(b, c, d, a, m[i + 12], 20, -1926607734);\n a = HH(a, b, c, d, m[i + 5], 4, -378558);\n d = HH(d, a, b, c, m[i + 8], 11, -2022574463);\n c = HH(c, d, a, b, m[i + 11], 16, 1839030562);\n b = HH(b, c, d, a, m[i + 14], 23, -35309556);\n a = HH(a, b, c, d, m[i + 1], 4, -1530992060);\n d = HH(d, a, b, c, m[i + 4], 11, 1272893353);\n c = HH(c, d, a, b, m[i + 7], 16, -155497632);\n b = HH(b, c, d, a, m[i + 10], 23, -1094730640);\n a = HH(a, b, c, d, m[i + 13], 4, 681279174);\n d = HH(d, a, b, c, m[i + 0], 11, -358537222);\n c = HH(c, d, a, b, m[i + 3], 16, -722521979);\n b = HH(b, c, d, a, m[i + 6], 23, 76029189);\n a = HH(a, b, c, d, m[i + 9], 4, -640364487);\n d = HH(d, a, b, c, m[i + 12], 11, -421815835);\n c = HH(c, d, a, b, m[i + 15], 16, 530742520);\n b = HH(b, c, d, a, m[i + 2], 23, -995338651);\n a = II(a, b, c, d, m[i + 0], 6, -198630844);\n d = II(d, a, b, c, m[i + 7], 10, 1126891415);\n c = II(c, d, a, b, m[i + 14], 15, -1416354905);\n b = II(b, c, d, a, m[i + 5], 21, -57434055);\n a = II(a, b, c, d, m[i + 12], 6, 1700485571);\n d = II(d, a, b, c, m[i + 3], 10, -1894986606);\n c = II(c, d, a, b, m[i + 10], 15, -1051523);\n b = II(b, c, d, a, m[i + 1], 21, -2054922799);\n a = II(a, b, c, d, m[i + 8], 6, 1873313359);\n d = II(d, a, b, c, m[i + 15], 10, -30611744);\n c = II(c, d, a, b, m[i + 6], 15, -1560198380);\n b = II(b, c, d, a, m[i + 13], 21, 1309151649);\n a = II(a, b, c, d, m[i + 4], 6, -145523070);\n d = II(d, a, b, c, m[i + 11], 10, -1120210379);\n c = II(c, d, a, b, m[i + 2], 15, 718787259);\n b = II(b, c, d, a, m[i + 9], 21, -343485551);\n a = a + aa >>> 0;\n b = b + bb >>> 0;\n c = c + cc >>> 0;\n d = d + dd >>> 0;\n }\n return crypt.endian([a, b, c, d]);\n };\n\n // Auxiliary functions\n md5._ff = function (a, b, c, d, x, s, t) {\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n md5._gg = function (a, b, c, d, x, s, t) {\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n md5._hh = function (a, b, c, d, x, s, t) {\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n md5._ii = function (a, b, c, d, x, s, t) {\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n\n // Package private blocksize\n md5._blocksize = 16;\n md5._digestsize = 16;\n module.exports = function (message, options) {\n if (message === undefined || message === null) throw new Error('Illegal argument ' + message);\n var digestbytes = crypt.wordsToBytes(md5(message, options));\n return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes);\n };\n})();","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n var number = Number(dirtyNumber);\n if (isNaN(number)) {\n return number;\n }\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","(function () {\n var base64map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n crypt = {\n // Bit-wise rotation left\n rotl: function (n, b) {\n return n << b | n >>> 32 - b;\n },\n // Bit-wise rotation right\n rotr: function (n, b) {\n return n << 32 - b | n >>> b;\n },\n // Swap big-endian to little-endian and vice versa\n endian: function (n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++) n[i] = crypt.endian(n[i]);\n return n;\n },\n // Generate an array of any length of random bytes\n randomBytes: function (n) {\n for (var bytes = []; n > 0; n--) bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function (bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << 24 - b % 32;\n return words;\n },\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function (words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push(words[b >>> 5] >>> 24 - b % 32 & 0xFF);\n return bytes;\n },\n // Convert a byte array to a hex string\n bytesToHex: function (bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n // Convert a hex string to a byte array\n hexToBytes: function (hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n // Convert a byte array to a base-64 string\n bytesToBase64: function (bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2];\n for (var j = 0; j < 4; j++) if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 0x3F));else base64.push('=');\n }\n return base64.join('');\n },\n // Convert a base-64 string to a byte array\n base64ToBytes: function (base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push((base64map.indexOf(base64.charAt(i - 1)) & Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i)) >>> 6 - imod4 * 2);\n }\n return bytes;\n }\n };\n module.exports = crypt;\n})();","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);\n};\nfunction isBuffer(obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer(obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0));\n}","export const SDK_CSS = `\n:root {\n --b-100: #F2F3F7;\n --s-700: #37546D;\n}\n\n.woot-widget-holder {\n box-shadow: 0 5px 40px rgba(0, 0, 0, .16);\n opacity: 1;\n will-change: transform, opacity;\n transform: translateY(0);\n overflow: hidden !important;\n position: fixed !important;\n transition: opacity 0.2s linear, transform 0.25s linear;\n z-index: 2147483000 !important;\n}\n\n.woot-widget-holder.woot-widget-holder--flat {\n box-shadow: none;\n border-radius: 0;\n border: 1px solid var(--b-100);\n}\n\n.woot-widget-holder iframe {\n border: 0;\n height: 100% !important;\n width: 100% !important;\n max-height: 100vh !important;\n}\n\n.woot-widget-holder.has-unread-view {\n border-radius: 0 !important;\n min-height: 80px !important;\n height: auto;\n bottom: 94px;\n box-shadow: none !important;\n border: 0;\n}\n\n.woot-widget-bubble {\n background: #1f93ff;\n border-radius: 100px;\n border-width: 0px;\n bottom: 20px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, .16) !important;\n cursor: pointer;\n height: 64px;\n padding: 0px;\n position: fixed;\n user-select: none;\n width: 64px;\n z-index: 2147483000 !important;\n}\n\n.woot-widget-bubble.woot-widget-bubble--flat {\n border-radius: 0;\n}\n\n.woot-widget-holder.woot-widget-holder--flat {\n bottom: 90px;\n}\n\n.woot-widget-bubble.woot-widget-bubble--flat {\n height: 56px;\n width: 56px;\n}\n\n.woot-widget-bubble.woot-widget-bubble--flat svg {\n margin: 16px;\n}\n\n.woot-widget-bubble.woot-widget-bubble--flat.woot--close::before,\n.woot-widget-bubble.woot-widget-bubble--flat.woot--close::after {\n left: 28px;\n top: 16px;\n}\n\n.woot-widget-bubble.unread-notification::after {\n content: '';\n position: absolute;\n width: 12px;\n height: 12px;\n background: #ff4040;\n border-radius: 100%;\n top: 0px;\n right: 0px;\n border: 2px solid #ffffff;\n transition: background 0.2s ease;\n}\n\n.woot-widget-bubble.woot-widget--expanded {\n bottom: 24px;\n display: flex;\n height: 48px !important;\n width: auto !important;\n align-items: center;\n}\n\n.woot-widget-bubble.woot-widget--expanded div {\n align-items: center;\n color: #fff;\n display: flex;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, Arial, sans-serif;\n font-size: 16px;\n font-weight: 500;\n justify-content: center;\n padding-right: 20px;\n width: auto !important;\n}\n\n.woot-widget-bubble.woot-widget--expanded.woot-widget-bubble-color--lighter div{\n color: var(--s-700);\n}\n\n.woot-widget-bubble.woot-widget--expanded svg {\n height: 20px;\n margin: 14px 8px 14px 16px;\n width: 20px;\n}\n\n.woot-widget-bubble.woot-elements--left {\n left: 20px;\n}\n\n.woot-widget-bubble.woot-elements--right {\n right: 20px;\n}\n\n.woot-widget-bubble:hover {\n background: #1f93ff;\n box-shadow: 0 8px 32px rgba(0, 0, 0, .4) !important;\n}\n\n.woot-widget-bubble svg {\n all: revert;\n height: 24px;\n margin: 20px;\n width: 24px;\n}\n\n.woot-widget-bubble.woot-widget-bubble-color--lighter path{\n fill: var(--s-700);\n}\n\n@media only screen and (min-width: 667px) {\n .woot-widget-holder.woot-elements--left {\n left: 20px;\n }\n .woot-widget-holder.woot-elements--right {\n right: 20px;\n }\n}\n\n.woot--close:hover {\n opacity: 1;\n}\n\n.woot--close::before, .woot--close::after {\n background-color: #fff;\n content: ' ';\n display: inline;\n height: 24px;\n left: 32px;\n position: absolute;\n top: 20px;\n width: 2px;\n}\n\n.woot-widget-bubble-color--lighter.woot--close::before, .woot-widget-bubble-color--lighter.woot--close::after {\n background-color: var(--s-700);\n}\n\n.woot--close::before {\n transform: rotate(45deg);\n}\n\n.woot--close::after {\n transform: rotate(-45deg);\n}\n\n.woot--hide {\n bottom: -100vh !important;\n top: unset !important;\n opacity: 0;\n visibility: hidden !important;\n z-index: -1 !important;\n}\n\n.woot-widget--without-bubble {\n bottom: 20px !important;\n}\n.woot-widget-holder.woot--hide{\n transform: translateY(40px);\n}\n.woot-widget-bubble.woot--close {\n transform: translateX(0px) scale(1) rotate(0deg);\n transition: transform 300ms ease, opacity 100ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot--close.woot--hide {\n transform: translateX(8px) scale(.75) rotate(45deg);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n\n.woot-widget-bubble {\n transform-origin: center;\n will-change: transform, opacity;\n transform: translateX(0) scale(1) rotate(0deg);\n transition: transform 300ms ease, opacity 100ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot--hide {\n transform: translateX(8px) scale(.75) rotate(-30deg);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n\n.woot-widget-bubble.woot-widget--expanded {\n transform: translateX(0px);\n transition: transform 300ms ease, opacity 100ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot-widget--expanded.woot--hide {\n transform: translateX(8px);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n.woot-widget-bubble.woot-widget-bubble--flat.woot--close {\n transform: translateX(0px);\n transition: transform 300ms ease, opacity 10ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot-widget-bubble--flat.woot--close.woot--hide {\n transform: translateX(8px);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n.woot-widget-bubble.woot-widget--expanded.woot-widget-bubble--flat {\n transform: translateX(0px);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot-widget--expanded.woot-widget-bubble--flat.woot--hide {\n transform: translateX(8px);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n\n@media only screen and (max-width: 667px) {\n .woot-widget-holder {\n height: 100%;\n right: 0;\n top: 0;\n width: 100%;\n }\n\n .woot-widget-holder iframe {\n min-height: 100% !important;\n }\n\n\n .woot-widget-holder.has-unread-view {\n height: auto;\n right: 0;\n width: auto;\n bottom: 0;\n top: auto;\n max-height: 100vh;\n padding: 0 8px;\n }\n\n .woot-widget-holder.has-unread-view iframe {\n min-height: unset !important;\n }\n\n .woot-widget-holder.has-unread-view.woot-elements--left {\n left: 0;\n }\n\n .woot-widget-bubble.woot--close {\n bottom: 60px;\n opacity: 0;\n visibility: hidden !important;\n z-index: -1 !important;\n }\n}\n\n@media only screen and (min-width: 667px) {\n .woot-widget-holder {\n border-radius: 16px;\n bottom: 104px;\n height: calc(90% - 64px - 20px);\n max-height: 640px !important;\n min-height: 250px !important;\n width: 400px !important;\n }\n}\n\n.woot-hidden {\n display: none !important;\n}\n`;\n","import { SDK_CSS } from './sdk.js';\nimport { IFrameHelper } from './IFrameHelper';\n\nexport const loadCSS = () => {\n const css = document.createElement('style');\n css.innerHTML = `${SDK_CSS}`;\n document.body.appendChild(css);\n};\n\nexport const addClasses = (elm, classes) => {\n elm.classList.add(...classes.split(' '));\n};\n\nexport const toggleClass = (elm, classes) => {\n elm.classList.toggle(classes);\n};\n\nexport const removeClasses = (elm, classes) => {\n elm.classList.remove(...classes.split(' '));\n};\n\nexport const onLocationChange = ({ referrerURL, referrerHost }) => {\n IFrameHelper.events.onLocationChange({\n referrerURL,\n referrerHost,\n });\n};\n\nexport const onLocationChangeListener = () => {\n let oldHref = document.location.href;\n const referrerHost = document.location.host;\n const config = {\n childList: true,\n subtree: true,\n };\n onLocationChange({\n referrerURL: oldHref,\n referrerHost,\n });\n\n const bodyList = document.querySelector('body');\n const observer = new MutationObserver(mutations => {\n mutations.forEach(() => {\n if (oldHref !== document.location.href) {\n oldHref = document.location.href;\n onLocationChange({\n referrerURL: oldHref,\n referrerHost,\n });\n }\n });\n });\n\n observer.observe(bodyList, config);\n};\n","export const BUBBLE_DESIGN = ['standard', 'expanded_bubble'];\nexport const WIDGET_DESIGN = ['standard', 'flat'];\nexport const DARK_MODE = ['light', 'auto', 'dark'];\n","import { BUBBLE_DESIGN, DARK_MODE, WIDGET_DESIGN } from './constants';\n\nexport const getBubbleView = type =>\n BUBBLE_DESIGN.includes(type) ? type : BUBBLE_DESIGN[0];\n\nexport const isExpandedView = type => getBubbleView(type) === BUBBLE_DESIGN[1];\n\nexport const getWidgetStyle = style =>\n WIDGET_DESIGN.includes(style) ? style : WIDGET_DESIGN[0];\n\nexport const isFlatWidgetStyle = style => style === 'flat';\n\nexport const getDarkMode = darkMode =>\n DARK_MODE.includes(darkMode) ? darkMode : DARK_MODE[0];\n","import { addClasses, removeClasses, toggleClass } from './DOMHelpers';\nimport { IFrameHelper } from './IFrameHelper';\nimport { isExpandedView } from './settingsHelper';\n\nexport const bubbleImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw1AUhU9bpaIVQTuIOGSoThbEioiTVqEIFUKt0KqDyUv/oElDkuLiKLgWHPxZrDq4OOvq4CoIgj8gjk5Oii5S4n1JoUWMDy7v47x3DvfdB/jrZaaaHeOAqllGKhEXMtlVIfiKHvRTzSAmMVOfE8UkPNfXPXx8v4vyLO97f65eJWcywCcQzzLdsIg3iKc2LZ3zPnGYFSWF+Jx4zKAGiR+5Lrv8xrngsJ9nho10ap44TCwU2lhuY1Y0VOJJ4oiiapTvz7iscN7irJarrNknf2Eop60sc51qGAksYgkiBMioooQyLERp10gxkaLzuId/yPGL5JLJVQIjxwIqUCE5fvA/+D1bMx+bcJNCcaDzxbY/RoDgLtCo2fb3sW03ToDAM3CltfyVOjD9SXqtpUWOgL5t4OK6pcl7wOUOMPikS4bkSAEqfz4PvJ/RN2WBgVuge82dW/Mcpw9AmmaVvAEODoHRAmWve7y7q31u/95pzu8H41Jy1MV5Pg0AAAAGYktHRAD/AAAAADMnfPMAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCxIMARcS27HYAAAOXElEQVR42u3dP3IjxxUH4G4ACpzulqpUu7mvYAWqEu7gAk9gRU58gwVzRw6ULE8AKNANQIe6gI+gxOWtUmRVmUA7EF3eXWEpkpg/3f2+7wC75OvBvF+/HgxTAgAAAAAAAA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gEjpTOMHYCQeAqzQ6eXrG80fABOAsex2S7t+ACIK3WxqOv/X+AGYkiMAzR+AgDwEqPEDYAIQx5zj/3ydlpo/ACYAdv0AIABo/AAwLg8Bav4AROxNEX/pqc7/NX4AauUIQOMHICBHAJo/ACYAaPwAmAB0aOjz/7zfrzR/AEwA7PoBQADQ+AGgPh4C1PwBiNjPIv2yl5z/a/wA9MQRgMYPQECOADR/AEwAOrYtjw47Gj8AdKI8QtrtlioFgAlAIHb9AAgAGj8AdC3EQ4DHF6/eav4A8F4PjPBLfvz9f40fgOhCHQHklBYp52LZASDGCMCOHwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGBQ/wX6UJxq/bvqHAAAAABJRU5ErkJggg=='\n\nexport const body = document.getElementsByTagName('body')[0];\nexport const widgetHolder = document.createElement('div');\n\nexport const bubbleHolder = document.createElement('div');\nexport const chatBubble = document.createElement('button');\nexport const closeBubble = document.createElement('button');\nexport const notificationBubble = document.createElement('span');\n\nexport const setBubbleText = bubbleText => {\n if (isExpandedView(window.$multichat.type)) {\n const textNode = document.getElementById('woot-widget--expanded__text');\n textNode.innerText = bubbleText;\n }\n};\n\nexport const createBubbleIcon = ({ className, src, target }) => {\n let bubbleClassName = `${className} woot-elements--${window.$multichat.position}`;\n const bubbleIcon = document.createElement('img');\n bubbleIcon.src = src;\n bubbleIcon.alt = 'bubble-icon';\n bubbleIcon.style = 'height: 48px;';\n\n target.appendChild(bubbleIcon);\n\n if (isExpandedView(window.$multichat.type)) {\n const textNode = document.createElement('div');\n textNode.id = 'woot-widget--expanded__text';\n textNode.innerText = '';\n target.appendChild(textNode);\n bubbleClassName += ' woot-widget--expanded';\n bubbleIcon.style = 'height: 48px; margin: 10px 5px 10px 10px;'\n }\n\n target.className = bubbleClassName;\n target.title = 'Open chat window';\n return target;\n};\n\nexport const createBubbleHolder = hideMessageBubble => {\n if (hideMessageBubble) {\n addClasses(bubbleHolder, 'woot-hidden');\n }\n addClasses(bubbleHolder, 'woot--bubble-holder');\n body.appendChild(bubbleHolder);\n};\n\nexport const createNotificationBubble = () => {\n addClasses(notificationBubble, 'woot--notification');\n return notificationBubble;\n};\n\nexport const onBubbleClick = (props = {}) => {\n const { toggleValue } = props;\n const { isOpen } = window.$multichat;\n if (isOpen !== toggleValue) {\n const newIsOpen = toggleValue === undefined ? !isOpen : toggleValue;\n window.$multichat.isOpen = newIsOpen;\n\n toggleClass(chatBubble, 'woot--hide');\n toggleClass(closeBubble, 'woot--hide');\n toggleClass(widgetHolder, 'woot--hide');\n IFrameHelper.events.onBubbleToggle(newIsOpen);\n\n if (!newIsOpen) {\n chatBubble.focus();\n }\n }\n};\n\nexport const onClickChatBubble = () => {\n bubbleHolder.addEventListener('click', onBubbleClick);\n};\n\nexport const addUnreadClass = () => {\n const holderEl = document.querySelector('.woot-widget-holder');\n addClasses(holderEl, 'has-unread-view');\n};\n\nexport const removeUnreadClass = () => {\n const holderEl = document.querySelector('.woot-widget-holder');\n removeClasses(holderEl, 'has-unread-view');\n};\n","export const createEvent = ({ eventName, data = null }) => {\n let event;\n if (typeof window.CustomEvent === 'function') {\n event = new CustomEvent(eventName, { detail: data });\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(eventName, false, false, data);\n }\n return event;\n};\n\nexport const dispatchWindowEvent = ({ eventName, data }) => {\n const event = createEvent({ eventName, data });\n window.dispatchEvent(event);\n};\n","import md5 from 'md5';\nimport Cookies from 'js-cookie';\n\nconst REQUIRED_USER_KEYS = ['avatar_url', 'email', 'name'];\nconst ALLOWED_USER_ATTRIBUTES = [...REQUIRED_USER_KEYS, 'identifier_hash'];\n\nexport const getUserCookieName = () => {\n const SET_USER_COOKIE_PREFIX = 'cw_user_';\n const { websiteToken: websiteIdentifier } = window.$multichat;\n return `${SET_USER_COOKIE_PREFIX}${websiteIdentifier}`;\n};\n\nexport const getUserString = ({ identifier = '', user }) => {\n const userStringWithSortedKeys = ALLOWED_USER_ATTRIBUTES.reduce(\n (acc, key) => `${acc}${key}${user[key] || ''}`,\n ''\n );\n return `${userStringWithSortedKeys}identifier${identifier}`;\n};\n\nexport const computeHashForUserData = (...args) => md5(getUserString(...args));\n\nexport const hasUserKeys = user =>\n REQUIRED_USER_KEYS.reduce((acc, key) => acc || !!user[key], false);\n\nexport const setCookieWithDomain = (\n name,\n value,\n { expires = 365, baseDomain = undefined } = {}\n) => {\n const cookieOptions = {\n expires,\n sameSite: 'Lax',\n domain: baseDomain,\n };\n\n // if type of value is object, stringify it\n // this is because js-cookies 3.0 removed builtin json support\n // ref: https://github.com/js-cookie/js-cookie/releases/tag/v3.0.0\n if (typeof value === 'object') {\n value = JSON.stringify(value);\n }\n\n Cookies.set(name, value, cookieOptions);\n};\n","import Cookies from 'js-cookie';\nimport {\n addClasses,\n loadCSS,\n removeClasses,\n onLocationChangeListener,\n} from './DOMHelpers';\nimport {\n body,\n widgetHolder,\n createBubbleHolder,\n createBubbleIcon,\n bubbleImg,\n chatBubble,\n closeBubble,\n bubbleHolder,\n createNotificationBubble,\n onClickChatBubble,\n onBubbleClick,\n setBubbleText,\n addUnreadClass,\n removeUnreadClass,\n} from './bubbleHelpers';\nimport { isWidgetColorLighter } from 'shared/helpers/colorHelper';\nimport { dispatchWindowEvent } from 'shared/helpers/CustomEventHelper';\nimport {\n MULTICHAT_ERROR,\n MULTICHAT_READY\n} from '../widget/constants/sdkEvents';\nimport { SET_USER_ERROR } from '../widget/constants/errorTypes';\nimport { getUserCookieName, setCookieWithDomain } from './cookieHelpers';\nimport {\n getAlertAudio,\n initOnEvents,\n} from 'shared/helpers/AudioNotificationHelper';\nimport { isFlatWidgetStyle } from './settingsHelper';\nimport { popoutChatWindow } from '../widget/helpers/popoutHelper';\nimport addHours from 'date-fns/addHours';\n\nconst updateAuthCookie = (cookieContent, baseDomain = '') =>\n setCookieWithDomain('cw_conversation', cookieContent, {\n baseDomain,\n });\n\nconst updateCampaignReadStatus = baseDomain => {\n const expireBy = addHours(new Date(), 1);\n setCookieWithDomain('cw_snooze_campaigns_till', Number(expireBy), {\n expires: expireBy,\n baseDomain,\n });\n};\n\nexport const IFrameHelper = {\n getUrl({ baseUrl, websiteToken }) {\n return `${baseUrl}/widget?website_token=${websiteToken}`;\n },\n createFrame: ({ baseUrl, websiteToken }) => {\n if (IFrameHelper.getAppFrame()) {\n return;\n }\n\n loadCSS();\n const iframe = document.createElement('iframe');\n const cwCookie = Cookies.get('cw_conversation');\n let widgetUrl = IFrameHelper.getUrl({ baseUrl, websiteToken });\n if (cwCookie) {\n widgetUrl = `${widgetUrl}&cw_conversation=${cwCookie}`;\n }\n iframe.src = widgetUrl;\n iframe.allow =\n 'camera;microphone;fullscreen;display-capture;picture-in-picture;clipboard-write;';\n iframe.id = 'multichat_live_chat_widget';\n iframe.style.visibility = 'hidden';\n\n let holderClassName = `woot-widget-holder woot--hide woot-elements--${window.$multichat.position}`;\n if (window.$multichat.hideMessageBubble) {\n holderClassName += ` woot-widget--without-bubble`;\n }\n if (isFlatWidgetStyle(window.$multichat.widgetStyle)) {\n holderClassName += ` woot-widget-holder--flat`;\n }\n\n addClasses(widgetHolder, holderClassName);\n widgetHolder.appendChild(iframe);\n body.appendChild(widgetHolder);\n IFrameHelper.initPostMessageCommunication();\n IFrameHelper.initWindowSizeListener();\n IFrameHelper.preventDefaultScroll();\n },\n getAppFrame: () => document.getElementById('multichat_live_chat_widget'),\n getBubbleHolder: () => document.getElementsByClassName('woot--bubble-holder'),\n sendMessage: (key, value) => {\n const element = IFrameHelper.getAppFrame();\n element.contentWindow.postMessage(\n `multichat-widget:${JSON.stringify({ event: key, ...value })}`,\n '*'\n );\n },\n initPostMessageCommunication: () => {\n window.onmessage = e => {\n if (\n typeof e.data !== 'string' ||\n e.data.indexOf('multichat-widget:') !== 0\n ) {\n return;\n }\n const message = JSON.parse(e.data.replace('multichat-widget:', ''));\n if (typeof IFrameHelper.events[message.event] === 'function') {\n IFrameHelper.events[message.event](message);\n }\n };\n },\n initWindowSizeListener: () => {\n window.addEventListener('resize', () => IFrameHelper.toggleCloseButton());\n },\n preventDefaultScroll: () => {\n widgetHolder.addEventListener('wheel', event => {\n const deltaY = event.deltaY;\n const contentHeight = widgetHolder.scrollHeight;\n const visibleHeight = widgetHolder.offsetHeight;\n const scrollTop = widgetHolder.scrollTop;\n\n if (\n (scrollTop === 0 && deltaY < 0) ||\n (visibleHeight + scrollTop === contentHeight && deltaY > 0)\n ) {\n event.preventDefault();\n }\n });\n },\n\n setFrameHeightToFitContent: (extraHeight, isFixedHeight) => {\n const iframe = IFrameHelper.getAppFrame();\n const updatedIframeHeight = isFixedHeight ? `${extraHeight}px` : '100%';\n\n if (iframe)\n iframe.setAttribute('style', `height: ${updatedIframeHeight} !important`);\n },\n\n setupAudioListeners: () => {\n const { baseUrl = '' } = window.$multichat;\n getAlertAudio(baseUrl, { type: 'widget', alertTone: 'ding' }).then(() =>\n initOnEvents.forEach(event => {\n document.removeEventListener(\n event,\n IFrameHelper.setupAudioListeners,\n false\n );\n })\n );\n },\n\n events: {\n loaded: message => {\n updateAuthCookie(message.config.authToken, window.$multichat.baseDomain);\n window.$multichat.hasLoaded = true;\n const campaignsSnoozedTill = Cookies.get('cw_snooze_campaigns_till');\n IFrameHelper.sendMessage('config-set', {\n locale: window.$multichat.locale,\n position: window.$multichat.position,\n hideMessageBubble: window.$multichat.hideMessageBubble,\n showPopoutButton: window.$multichat.showPopoutButton,\n widgetStyle: window.$multichat.widgetStyle,\n darkMode: window.$multichat.darkMode,\n campaignsSnoozedTill,\n });\n IFrameHelper.onLoad({\n widgetColor: message.config.channelConfig.widgetColor,\n bubbleImg: message.config.channelConfig.bubbleImg,\n });\n IFrameHelper.toggleCloseButton();\n\n if (window.$multichat.user) {\n IFrameHelper.sendMessage('set-user', window.$multichat.user);\n }\n\n window.playAudioAlert = () => {};\n\n initOnEvents.forEach(e => {\n document.addEventListener(e, IFrameHelper.setupAudioListeners, false);\n });\n\n if (!window.$multichat.resetTriggered) {\n dispatchWindowEvent({ eventName: MULTICHAT_READY });\n }\n },\n error: ({ errorType, data }) => {\n dispatchWindowEvent({ eventName: MULTICHAT_ERROR, data: data });\n\n if (errorType === SET_USER_ERROR) {\n Cookies.remove(getUserCookieName());\n }\n },\n onEvent({ eventIdentifier: eventName, data }) {\n dispatchWindowEvent({ eventName, data });\n },\n setBubbleLabel(message) {\n setBubbleText(window.$multichat.launcherTitle || message.label);\n },\n\n setAuthCookie({ data: { widgetAuthToken } }) {\n updateAuthCookie(widgetAuthToken, window.$chatwoot.baseDomain);\n },\n\n setCampaignReadOn() {\n updateCampaignReadStatus(window.$chatwoot.baseDomain);\n },\n\n toggleBubble: state => {\n let bubbleState = {};\n if (state === 'open') {\n bubbleState.toggleValue = true;\n } else if (state === 'close') {\n bubbleState.toggleValue = false;\n }\n\n onBubbleClick(bubbleState);\n },\n\n popoutChatWindow: ({ baseUrl, websiteToken, locale }) => {\n const cwCookie = Cookies.get('cw_conversation');\n window.$multichat.toggle('close');\n popoutChatWindow(baseUrl, websiteToken, locale, cwCookie);\n },\n\n closeWindow: () => {\n onBubbleClick({ toggleValue: false });\n removeUnreadClass();\n },\n\n onBubbleToggle: isOpen => {\n IFrameHelper.sendMessage('toggle-open', { isOpen });\n if (isOpen) {\n IFrameHelper.pushEvent('webwidget.triggered');\n }\n },\n onLocationChange: ({ referrerURL, referrerHost }) => {\n IFrameHelper.sendMessage('change-url', {\n referrerURL,\n referrerHost,\n });\n },\n updateIframeHeight: message => {\n const { extraHeight = 0, isFixedHeight } = message;\n\n IFrameHelper.setFrameHeightToFitContent(extraHeight, isFixedHeight);\n },\n\n setUnreadMode: () => {\n addUnreadClass();\n onBubbleClick({ toggleValue: true });\n },\n\n resetUnreadMode: () => removeUnreadClass(),\n handleNotificationDot: event => {\n if (window.$multichat.hideMessageBubble) {\n return;\n }\n\n const bubbleElement = document.querySelector('.woot-widget-bubble');\n if (\n event.unreadMessageCount > 0 &&\n !bubbleElement.classList.contains('unread-notification')\n ) {\n addClasses(bubbleElement, 'unread-notification');\n } else if (event.unreadMessageCount === 0) {\n removeClasses(bubbleElement, 'unread-notification');\n }\n },\n\n closeChat: () => {\n onBubbleClick({ toggleValue: false });\n },\n\n playAudio: () => {\n window.playAudioAlert();\n },\n },\n pushEvent: eventName => {\n IFrameHelper.sendMessage('push-event', { eventName });\n },\n\n onLoad: ({ widgetColor, bubbleImg }) => {\n const iframe = IFrameHelper.getAppFrame();\n iframe.style.visibility = '';\n iframe.setAttribute('id', `multichat_live_chat_widget`);\n\n if (IFrameHelper.getBubbleHolder().length) {\n return;\n }\n createBubbleHolder(window.$multichat.hideMessageBubble);\n onLocationChangeListener();\n\n let className = 'woot-widget-bubble';\n let closeBtnClassName = `woot-elements--${window.$multichat.position} woot-widget-bubble woot--close woot--hide`;\n\n if (isFlatWidgetStyle(window.$multichat.widgetStyle)) {\n className += ' woot-widget-bubble--flat';\n closeBtnClassName += ' woot-widget-bubble--flat';\n }\n\n if (isWidgetColorLighter(widgetColor)) {\n className += ' woot-widget-bubble-color--lighter';\n closeBtnClassName += ' woot-widget-bubble-color--lighter';\n }\n\n const chatIcon = createBubbleIcon({\n className,\n src: bubbleImg,\n target: chatBubble,\n });\n\n addClasses(closeBubble, closeBtnClassName);\n\n chatIcon.style.background = widgetColor;\n closeBubble.style.background = widgetColor;\n\n bubbleHolder.appendChild(chatIcon);\n bubbleHolder.appendChild(closeBubble);\n bubbleHolder.appendChild(createNotificationBubble());\n onClickChatBubble();\n },\n toggleCloseButton: () => {\n let isMobile = false;\n if (window.matchMedia('(max-width: 668px)').matches) {\n isMobile = true;\n }\n IFrameHelper.sendMessage('toggle-close-button', { isMobile });\n },\n};\n","import Cookies from 'js-cookie';\nimport { IFrameHelper } from '../sdk/IFrameHelper';\nimport {\n getBubbleView,\n getDarkMode,\n getWidgetStyle,\n} from '../sdk/settingsHelper';\nimport {\n computeHashForUserData,\n getUserCookieName,\n hasUserKeys,\n} from '../sdk/cookieHelpers';\nimport { addClasses, removeClasses } from '../sdk/DOMHelpers';\nimport { setCookieWithDomain } from '../sdk/cookieHelpers';\nimport { SDK_SET_BUBBLE_VISIBILITY } from 'shared/constants/sharedFrameEvents';\nconst runSDK = ({ baseUrl, websiteToken }) => {\n if (window.$multichat) {\n return;\n }\n\n const appSettings = window.appSettings || {};\n let locale = appSettings.locale;\n let baseDomain = appSettings.baseDomain;\n\n if (appSettings.useBrowserLanguage) {\n locale = window.navigator.language.replace('-', '_');\n }\n\n window.$multichat = {\n baseUrl,\n baseDomain,\n hasLoaded: false,\n hideMessageBubble: appSettings.hideMessageBubble || false,\n isOpen: false,\n position: appSettings.position === 'left' ? 'left' : 'right',\n websiteToken,\n locale,\n useBrowserLanguage: appSettings.useBrowserLanguage || false,\n type: getBubbleView(appSettings.type),\n launcherTitle: appSettings.launcherTitle || '',\n showPopoutButton: appSettings.showPopoutButton || false,\n widgetStyle: getWidgetStyle(appSettings.widgetStyle) || 'standard',\n resetTriggered: false,\n darkMode: getDarkMode(appSettings.darkMode),\n\n toggle(state) {\n IFrameHelper.events.toggleBubble(state);\n },\n\n toggleBubbleVisibility(visibility) {\n let widgetElm = document.querySelector('.woot--bubble-holder');\n let widgetHolder = document.querySelector('.woot-widget-holder');\n if (visibility === 'hide') {\n addClasses(widgetHolder, 'woot-widget--without-bubble');\n addClasses(widgetElm, 'woot-hidden');\n window.$multichat.hideMessageBubble = true;\n } else if (visibility === 'show') {\n removeClasses(widgetElm, 'woot-hidden');\n removeClasses(widgetHolder, 'woot-widget--without-bubble');\n window.$multichat.hideMessageBubble = false;\n }\n IFrameHelper.sendMessage(SDK_SET_BUBBLE_VISIBILITY, {\n hideMessageBubble: window.$multichat.hideMessageBubble,\n });\n },\n\n popoutChatWindow() {\n IFrameHelper.events.popoutChatWindow({\n baseUrl: window.$multichat.baseUrl,\n websiteToken: window.$multichat.websiteToken,\n locale,\n });\n },\n\n setUser(identifier, user) {\n if (typeof identifier !== 'string' && typeof identifier !== 'number') {\n throw new Error('Identifier should be a string or a number');\n }\n\n if (!hasUserKeys(user)) {\n throw new Error(\n 'User object should have one of the keys [avatar_url, email, name]'\n );\n }\n\n const userCookieName = getUserCookieName();\n const existingCookieValue = Cookies.get(userCookieName);\n const hashToBeStored = computeHashForUserData({ identifier, user });\n if (hashToBeStored === existingCookieValue) {\n return;\n }\n\n window.$multichat.identifier = identifier;\n window.$multichat.user = user;\n IFrameHelper.sendMessage('set-user', { identifier, user });\n\n setCookieWithDomain(userCookieName, hashToBeStored, {\n baseDomain,\n });\n },\n\n setCustomAttributes(customAttributes = {}) {\n if (!customAttributes || !Object.keys(customAttributes).length) {\n throw new Error('Custom attributes should have atleast one key');\n } else {\n IFrameHelper.sendMessage('set-custom-attributes', { customAttributes });\n }\n },\n\n deleteCustomAttribute(customAttribute = '') {\n if (!customAttribute) {\n throw new Error('Custom attribute is required');\n } else {\n IFrameHelper.sendMessage('delete-custom-attribute', {\n customAttribute,\n });\n }\n },\n\n setConversationCustomAttributes(customAttributes = {}) {\n if (!customAttributes || !Object.keys(customAttributes).length) {\n throw new Error('Custom attributes should have atleast one key');\n } else {\n IFrameHelper.sendMessage('set-conversation-custom-attributes', {\n customAttributes,\n });\n }\n },\n\n deleteConversationCustomAttribute(customAttribute = '') {\n if (!customAttribute) {\n throw new Error('Custom attribute is required');\n } else {\n IFrameHelper.sendMessage('delete-conversation-custom-attribute', {\n customAttribute,\n });\n }\n },\n\n setLabel(label = '') {\n IFrameHelper.sendMessage('set-label', { label });\n },\n\n removeLabel(label = '') {\n IFrameHelper.sendMessage('remove-label', { label });\n },\n\n setLocale(localeToBeUsed = 'en') {\n IFrameHelper.sendMessage('set-locale', { locale: localeToBeUsed });\n },\n\n setColorScheme(darkMode = 'light') {\n IFrameHelper.sendMessage('set-color-scheme', {\n darkMode: getDarkMode(darkMode),\n });\n },\n\n reset() {\n if (window.$multichat.isOpen) {\n IFrameHelper.events.toggleBubble();\n }\n\n Cookies.remove('cw_conversation');\n Cookies.remove(getUserCookieName());\n\n const iframe = IFrameHelper.getAppFrame();\n iframe.src = IFrameHelper.getUrl({\n baseUrl: window.$multichat.baseUrl,\n websiteToken: window.$multichat.websiteToken,\n });\n\n window.$multichat.resetTriggered = true;\n },\n };\n IFrameHelper.createFrame({\n baseUrl,\n websiteToken,\n });\n};\n\nwindow.appSDK = {\n run: runSDK,\n};\n","/**\n * A simple guard function:\n *\n * ```js\n * Math.min(Math.max(low, value), high)\n * ```\n */\nfunction guard(low, high, value) {\n return Math.min(Math.max(low, value), high);\n}\nclass ColorError extends Error {\n constructor(color) {\n super(`Failed to parse color: \"${color}\"`);\n }\n}\nvar ColorError$1 = ColorError;\n\n/**\n * Parses a color into red, gree, blue, alpha parts\n *\n * @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color\n */\nfunction parseToRgba(color) {\n if (typeof color !== 'string') throw new ColorError$1(color);\n if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0];\n let normalizedColor = color.trim();\n normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color;\n const reducedHexMatch = reducedHexRegex.exec(normalizedColor);\n if (reducedHexMatch) {\n const arr = Array.from(reducedHexMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(r(x, 2), 16)), parseInt(r(arr[3] || 'f', 2), 16) / 255];\n }\n const hexMatch = hexRegex.exec(normalizedColor);\n if (hexMatch) {\n const arr = Array.from(hexMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(x, 16)), parseInt(arr[3] || 'ff', 16) / 255];\n }\n const rgbaMatch = rgbaRegex.exec(normalizedColor);\n if (rgbaMatch) {\n const arr = Array.from(rgbaMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(x, 10)), parseFloat(arr[3] || '1')];\n }\n const hslaMatch = hslaRegex.exec(normalizedColor);\n if (hslaMatch) {\n const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);\n if (guard(0, 100, s) !== s) throw new ColorError$1(color);\n if (guard(0, 100, l) !== l) throw new ColorError$1(color);\n return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a];\n }\n throw new ColorError$1(color);\n}\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i) {\n hash = hash * 33 ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return (hash >>> 0) % 2341;\n}\nconst colorToInt = x => parseInt(x.replace(/_/g, ''), 36);\nconst compressedColorMap = '1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm'.split(' ').reduce((acc, next) => {\n const key = colorToInt(next.substring(0, 3));\n const hex = colorToInt(next.substring(3)).toString(16);\n\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n let prefix = '';\n for (let i = 0; i < 6 - hex.length; i++) {\n prefix += '0';\n }\n acc[key] = `${prefix}${hex}`;\n return acc;\n}, {});\n\n/**\n * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.\n */\nfunction nameToHex(color) {\n const normalizedColorName = color.toLowerCase().trim();\n const result = compressedColorMap[hash(normalizedColorName)];\n if (!result) throw new ColorError$1(color);\n return `#${result}`;\n}\nconst r = (str, amount) => Array.from(Array(amount)).map(() => str).join('');\nconst reducedHexRegex = new RegExp(`^#${r('([a-f0-9])', 3)}([a-f0-9])?$`, 'i');\nconst hexRegex = new RegExp(`^#${r('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i');\nconst rgbaRegex = new RegExp(`^rgba?\\\\(\\\\s*(\\\\d+)\\\\s*${r(',\\\\s*(\\\\d+)\\\\s*', 2)}(?:,\\\\s*([\\\\d.]+))?\\\\s*\\\\)$`, 'i');\nconst hslaRegex = /^hsla?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)%\\s*,\\s*([\\d.]+)%(?:\\s*,\\s*([\\d.]+))?\\s*\\)$/i;\nconst namedColorRegex = /^[a-z]+$/i;\nconst roundColor = color => {\n return Math.round(color * 255);\n};\nconst hslToRgb = (hue, saturation, lightness) => {\n let l = lightness / 100;\n if (saturation === 0) {\n // achromatic\n return [l, l, l].map(roundColor);\n }\n\n // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV\n const huePrime = (hue % 360 + 360) % 360 / 60;\n const chroma = (1 - Math.abs(2 * l - 1)) * (saturation / 100);\n const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n let red = 0;\n let green = 0;\n let blue = 0;\n if (huePrime >= 0 && huePrime < 1) {\n red = chroma;\n green = secondComponent;\n } else if (huePrime >= 1 && huePrime < 2) {\n red = secondComponent;\n green = chroma;\n } else if (huePrime >= 2 && huePrime < 3) {\n green = chroma;\n blue = secondComponent;\n } else if (huePrime >= 3 && huePrime < 4) {\n green = secondComponent;\n blue = chroma;\n } else if (huePrime >= 4 && huePrime < 5) {\n red = secondComponent;\n blue = chroma;\n } else if (huePrime >= 5 && huePrime < 6) {\n red = chroma;\n blue = secondComponent;\n }\n const lightnessModification = l - chroma / 2;\n const finalRed = red + lightnessModification;\n const finalGreen = green + lightnessModification;\n const finalBlue = blue + lightnessModification;\n return [finalRed, finalGreen, finalBlue].map(roundColor);\n};\n\n// taken from:\n// https://github.com/styled-components/polished/blob/a23a6a2bb26802b3d922d9c3b67bac3f3a54a310/src/internalHelpers/_rgbToHsl.js\n\n/**\n * Parses a color in hue, saturation, lightness, and the alpha channel.\n *\n * Hue is a number between 0 and 360, saturation, lightness, and alpha are\n * decimal percentages between 0 and 1\n */\nfunction parseToHsla(color) {\n const [red, green, blue, alpha] = parseToRgba(color).map((value, index) =>\n // 3rd index is alpha channel which is already normalized\n index === 3 ? value : value / 255);\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const lightness = (max + min) / 2;\n\n // achromatic\n if (max === min) return [0, 0, lightness, alpha];\n const delta = max - min;\n const saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);\n const hue = 60 * (red === max ? (green - blue) / delta + (green < blue ? 6 : 0) : green === max ? (blue - red) / delta + 2 : (red - green) / delta + 4);\n return [hue, saturation, lightness, alpha];\n}\n\n/**\n * Takes in hsla parts and constructs an hsla string\n *\n * @param hue The color circle (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue\n * @param saturation Percentage of saturation, given as a decimal between 0 and 1\n * @param lightness Percentage of lightness, given as a decimal between 0 and 1\n * @param alpha Percentage of opacity, given as a decimal between 0 and 1\n */\nfunction hsla(hue, saturation, lightness, alpha) {\n return `hsla(${(hue % 360).toFixed()}, ${guard(0, 100, saturation * 100).toFixed()}%, ${guard(0, 100, lightness * 100).toFixed()}%, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`;\n}\n\n/**\n * Adjusts the current hue of the color by the given degrees. Wraps around when\n * over 360.\n *\n * @param color input color\n * @param degrees degrees to adjust the input color, accepts degree integers\n * (0 - 360) and wraps around on overflow\n */\nfunction adjustHue(color, degrees) {\n const [h, s, l, a] = parseToHsla(color);\n return hsla(h + degrees, s, l, a);\n}\n\n/**\n * Darkens using lightness. This is equivalent to subtracting the lightness\n * from the L in HSL.\n *\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction darken(color, amount) {\n const [hue, saturation, lightness, alpha] = parseToHsla(color);\n return hsla(hue, saturation, lightness - amount, alpha);\n}\n\n/**\n * Desaturates the input color by the given amount via subtracting from the `s`\n * in `hsla`.\n *\n * @param amount The amount to desaturate, given as a decimal between 0 and 1\n */\nfunction desaturate(color, amount) {\n const [h, s, l, a] = parseToHsla(color);\n return hsla(h, s - amount, l, a);\n}\n\n// taken from:\n// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getLuminance.js\n\n/**\n * Returns a number (float) representing the luminance of a color.\n */\nfunction getLuminance(color) {\n if (color === 'transparent') return 0;\n function f(x) {\n const channel = x / 255;\n return channel <= 0.04045 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);\n }\n const [r, g, b] = parseToRgba(color);\n return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);\n}\n\n// taken from:\n// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getContrast.js\n\n/**\n * Returns the contrast ratio between two colors based on\n * [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef).\n */\nfunction getContrast(color1, color2) {\n const luminance1 = getLuminance(color1);\n const luminance2 = getLuminance(color2);\n return luminance1 > luminance2 ? (luminance1 + 0.05) / (luminance2 + 0.05) : (luminance2 + 0.05) / (luminance1 + 0.05);\n}\n\n/**\n * Takes in rgba parts and returns an rgba string\n *\n * @param red The amount of red in the red channel, given in a number between 0 and 255 inclusive\n * @param green The amount of green in the red channel, given in a number between 0 and 255 inclusive\n * @param blue The amount of blue in the red channel, given in a number between 0 and 255 inclusive\n * @param alpha Percentage of opacity, given as a decimal between 0 and 1\n */\nfunction rgba(red, green, blue, alpha) {\n return `rgba(${guard(0, 255, red).toFixed()}, ${guard(0, 255, green).toFixed()}, ${guard(0, 255, blue).toFixed()}, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`;\n}\n\n/**\n * Mixes two colors together. Taken from sass's implementation.\n */\nfunction mix(color1, color2, weight) {\n const normalize = (n, index) =>\n // 3rd index is alpha channel which is already normalized\n index === 3 ? n : n / 255;\n const [r1, g1, b1, a1] = parseToRgba(color1).map(normalize);\n const [r2, g2, b2, a2] = parseToRgba(color2).map(normalize);\n\n // The formula is copied from the original Sass implementation:\n // http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method\n const alphaDelta = a2 - a1;\n const normalizedWeight = weight * 2 - 1;\n const combinedWeight = normalizedWeight * alphaDelta === -1 ? normalizedWeight : normalizedWeight + alphaDelta / (1 + normalizedWeight * alphaDelta);\n const weight2 = (combinedWeight + 1) / 2;\n const weight1 = 1 - weight2;\n const r = (r1 * weight1 + r2 * weight2) * 255;\n const g = (g1 * weight1 + g2 * weight2) * 255;\n const b = (b1 * weight1 + b2 * weight2) * 255;\n const a = a2 * weight + a1 * (1 - weight);\n return rgba(r, g, b, a);\n}\n\n/**\n * Given a series colors, this function will return a `scale(x)` function that\n * accepts a percentage as a decimal between 0 and 1 and returns the color at\n * that percentage in the scale.\n *\n * ```js\n * const scale = getScale('red', 'yellow', 'green');\n * console.log(scale(0)); // rgba(255, 0, 0, 1)\n * console.log(scale(0.5)); // rgba(255, 255, 0, 1)\n * console.log(scale(1)); // rgba(0, 128, 0, 1)\n * ```\n *\n * If you'd like to limit the domain and range like chroma-js, we recommend\n * wrapping scale again.\n *\n * ```js\n * const _scale = getScale('red', 'yellow', 'green');\n * const scale = x => _scale(x / 100);\n *\n * console.log(scale(0)); // rgba(255, 0, 0, 1)\n * console.log(scale(50)); // rgba(255, 255, 0, 1)\n * console.log(scale(100)); // rgba(0, 128, 0, 1)\n * ```\n */\nfunction getScale() {\n for (var _len = arguments.length, colors = new Array(_len), _key = 0; _key < _len; _key++) {\n colors[_key] = arguments[_key];\n }\n return n => {\n const lastIndex = colors.length - 1;\n const lowIndex = guard(0, lastIndex, Math.floor(n * lastIndex));\n const highIndex = guard(0, lastIndex, Math.ceil(n * lastIndex));\n const color1 = colors[lowIndex];\n const color2 = colors[highIndex];\n const unit = 1 / lastIndex;\n const weight = (n - unit * lowIndex) / unit;\n return mix(color1, color2, weight);\n };\n}\nconst guidelines = {\n decorative: 1.5,\n readable: 3,\n aa: 4.5,\n aaa: 7\n};\n\n/**\n * Returns whether or not a color has bad contrast against a background\n * according to a given standard.\n */\nfunction hasBadContrast(color) {\n let standard = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'aa';\n let background = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '#fff';\n return getContrast(color, background) < guidelines[standard];\n}\n\n/**\n * Lightens a color by a given amount. This is equivalent to\n * `darken(color, -amount)`\n *\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction lighten(color, amount) {\n return darken(color, -amount);\n}\n\n/**\n * Takes in a color and makes it more transparent by convert to `rgba` and\n * decreasing the amount in the alpha channel.\n *\n * @param amount The amount to increase the transparency by, given as a decimal between 0 and 1\n */\nfunction transparentize(color, amount) {\n const [r, g, b, a] = parseToRgba(color);\n return rgba(r, g, b, a - amount);\n}\n\n/**\n * Takes a color and un-transparentizes it. Equivalent to\n * `transparentize(color, -amount)`\n *\n * @param amount The amount to increase the opacity by, given as a decimal between 0 and 1\n */\nfunction opacify(color, amount) {\n return transparentize(color, -amount);\n}\n\n/**\n * An alternative function to `readableColor`. Returns whether or not the \n * readable color (i.e. the color to be place on top the input color) should be\n * black.\n */\nfunction readableColorIsBlack(color) {\n return getLuminance(color) > 0.179;\n}\n\n/**\n * Returns black or white for best contrast depending on the luminosity of the\n * given color.\n */\nfunction readableColor(color) {\n return readableColorIsBlack(color) ? '#000' : '#fff';\n}\n\n/**\n * Saturates a color by converting it to `hsl` and increasing the saturation\n * amount. Equivalent to `desaturate(color, -amount)`\n * \n * @param color Input color\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction saturate(color, amount) {\n return desaturate(color, -amount);\n}\n\n/**\n * Takes in any color and returns it as a hex code.\n */\nfunction toHex(color) {\n const [r, g, b, a] = parseToRgba(color);\n let hex = x => {\n const h = guard(0, 255, x).toString(16);\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n return h.length === 1 ? `0${h}` : h;\n };\n return `#${hex(r)}${hex(g)}${hex(b)}${a < 1 ? hex(Math.round(a * 255)) : ''}`;\n}\n\n/**\n * Takes in any color and returns it as an rgba string.\n */\nfunction toRgba(color) {\n return rgba(...parseToRgba(color));\n}\n\n/**\n * Takes in any color and returns it as an hsla string.\n */\nfunction toHsla(color) {\n return hsla(...parseToHsla(color));\n}\nexport { ColorError$1 as ColorError, adjustHue, darken, desaturate, getContrast, getLuminance, getScale, guard, hasBadContrast, hsla, lighten, mix, opacify, parseToHsla, parseToRgba, readableColor, readableColorIsBlack, rgba, saturate, toHex, toHsla, toRgba, transparentize };","import { toHex, mix, getLuminance, getContrast } from 'color2k';\n\nexport const isWidgetColorLighter = color => {\n const colorToCheck = color.replace('#', '');\n const c_r = parseInt(colorToCheck.substr(0, 2), 16);\n const c_g = parseInt(colorToCheck.substr(2, 2), 16);\n const c_b = parseInt(colorToCheck.substr(4, 2), 16);\n const brightness = (c_r * 299 + c_g * 587 + c_b * 114) / 1000;\n return brightness > 225;\n};\n\nexport const adjustColorForContrast = (color, backgroundColor) => {\n const targetRatio = 3.1;\n const MAX_ITERATIONS = 20;\n let adjustedColor = color;\n\n for (let iteration = 0; iteration < MAX_ITERATIONS; iteration += 1) {\n const currentRatio = getContrast(adjustedColor, backgroundColor);\n if (currentRatio >= targetRatio) {\n break;\n }\n const adjustmentDirection =\n getLuminance(adjustedColor) < 0.5 ? '#fff' : '#151718';\n adjustedColor = mix(adjustedColor, adjustmentDirection, 0.05);\n }\n\n return toHex(adjustedColor);\n};\n","/*! js-cookie v3.0.5 | MIT */\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, function () {\n var current = global.Cookies;\n var exports = global.Cookies = factory();\n exports.noConflict = function () {\n global.Cookies = current;\n return exports;\n };\n }());\n})(this, function () {\n 'use strict';\n\n /* eslint-disable no-var */\n function assign(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target;\n }\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n var defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent);\n },\n write: function (value) {\n return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);\n }\n };\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n\n function init(converter, defaultAttributes) {\n function set(name, value, attributes) {\n if (typeof document === 'undefined') {\n return;\n }\n attributes = assign({}, defaultAttributes, attributes);\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue;\n }\n stringifiedAttributes += '; ' + attributeName;\n if (attributes[attributeName] === true) {\n continue;\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n return document.cookie = name + '=' + converter.write(value, name) + stringifiedAttributes;\n }\n function get(name) {\n if (typeof document === 'undefined' || arguments.length && !name) {\n return;\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n if (name === found) {\n break;\n }\n } catch (e) {}\n }\n return name ? jar[name] : jar;\n }\n return Object.create({\n set,\n get,\n remove: function (name, attributes) {\n set(name, '', assign({}, attributes, {\n expires: -1\n }));\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes));\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes);\n }\n }, {\n attributes: {\n value: Object.freeze(defaultAttributes)\n },\n converter: {\n value: Object.freeze(converter)\n }\n });\n }\n var api = init(defaultConverter, {\n path: '/'\n });\n /* eslint-enable no-var */\n\n return api;\n});","export const initOnEvents = ['click', 'touchstart', 'keypress', 'keydown'];\n\nexport const getAudioContext = () => {\n let audioCtx;\n try {\n audioCtx = new (window.AudioContext || window.webkitAudioContext)();\n } catch {\n // AudioContext is not available.\n }\n return audioCtx;\n};\n\n// eslint-disable-next-line default-param-last\nexport const getAlertAudio = async (baseUrl = '', requestContext) => {\n const audioCtx = getAudioContext();\n const playSound = audioBuffer => {\n window.playAudioAlert = () => {\n if (audioCtx) {\n const source = audioCtx.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(audioCtx.destination);\n source.loop = false;\n source.start();\n }\n };\n };\n\n if (audioCtx) {\n const { type = 'dashboard', alertTone = 'ding' } = requestContext || {};\n const resourceUrl = `${baseUrl}/audio/${type}/${alertTone}.mp3`;\n const audioRequest = new Request(resourceUrl);\n\n fetch(audioRequest)\n .then(response => response.arrayBuffer())\n .then(buffer => {\n audioCtx.decodeAudioData(buffer).then(playSound);\n // eslint-disable-next-line no-promise-executor-return\n return new Promise(res => res());\n })\n .catch(() => {\n // error\n });\n }\n};\n"],"sourceRoot":""}