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AAU,QAAQ,CAAC,KAAM,IACtD,OAAO,KAAK,KAAO,SAAkB,GACV,IAArB,UAAU,QACZ,EAAK,uDAAyD,KAAK,UAAU,YAEpD,mBAAhB,EACT,EACE,iGACE,GAE4B,iBAAhB,GAChB,EAAK,mDAEP,EAAgB,YAAY,CAAC,aAAc,GAC7C,EAGA,KAAK,SAAQ,SAAoB,GAC/B,KAAK,KAAK,EACZ,GACF,CAEF,EAEoB,oBAAT,MACT,YAAY","file":"/npm/kiss-include@1.1.3/kiss-include.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/kiss-include@1.1.3/kiss-include.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/* kiss-include.js - this transparently patchs the KissMetrics javascript api to work perfectly everywhere in chrome extensions. \n * YOU NEED TO INCLUDE IT EVERYWHERE*\n * \n * See the docs online or in the repo for extra details on usage.\n * \n * It detects and acts accordingly when it's included in a background page, with content scripts, or even with executeScript.\n * \n * Send questions/problems/critiques on code to: DevinRhode2@gmail.com (put \"kiss-include.js\" in the title)\n */\n\n// Assign to window because this is a library.\nwindow.kissInclude = function kissInclude(_kmk) {\n  'use strict';\n  \n  // A nicer wrapper, instead of _kmq.push(['asdf', 'adf']) it's just event('asdf', 'adf')\n  window.event = function event() {\n    if (typeof _kmq === 'undefined') {\n      window._kmq = [];\n    }\n    var argsArray = [].slice.call(arguments);\n    if (argsArray.length === 1) {\n      _kmq.push(['record', argsArray[0]]);\n    } else {\n      _kmq.push(argsArray);\n    }\n  };\n  \n  /**\n   * fail\n   * alerts and throws message, may also output additonal parameters, like objects.\n   */\n  var fail = function fail(message, optionalObjects) {\n    \n    optionalObjects = [].slice.call(arguments);\n    \n    // First arg should be a string, which shouldn't belong in optionalObjects\n    if (typeof message === 'string') {\n      \n      optionalObjects.shift();\n      \n    } else {\n      message = 'First arg to fail should be a string message, even if its an empty string';\n    }\n    \n    if (optionalObjects && optionalObjects.length > 0) {\n      \n      // For alert\n      (function newScope(){ //So I can re-use the message variable non-destructively\n        var message = message + '\\n';\n        optionalObjects.forEach(function forEachObject(item){\n          message += '\\n' + typeof item + ': ' + JSON.stringify(item);\n        });\n        alert(message);\n      }());\n      \n      // prefix objects with message\n      optionalObjects.unshift(message);\n      \n      // Do apply instead of optionalObjects so we get a clean message prefix output\n      console.error.apply(console, optionalObjects);\n    } else {\n      alert(message);\n    }\n    throw new Error(message);\n  };\n  \n  if (typeof _kmk === 'undefined') {\n    fail('Please pass in a kiss metrics _kmk id.'+\n         'You can find this at http://kissmetrics.com/settings just below the fold! \\n\\n'+\n         'Do this like: kissInclude(\\'asdeiorfhaksjnaoiewhoasdhjf\\');');\n  } else {\n    window._kmk = _kmk;//make sure it's global.\n  }\n  if (typeof KM_COOKIE_DOMAIN === 'undefined') {\n    console.warn('KM_COOKIE_DOMAIN is not defined. You probably want to define this'+\n                 ' like so: window.KM_COOKIE_DOMAIN = \\'extension.domain.com\\';');\n  }\n  \n  if (typeof _kmq === 'undefined') {\n    window._kmq = []; //Note on global declarations: shit hit the fan without _km<vars> being global.\n  }\n  \n  var KissIncludePortName = 'kissInclude';//presumably you aren't using this port name. You can just change this if you are though, things won't break.\n  if (chrome.browserAction) {\n    \n    //background page or popup, inject the scripts normally!\n    window._kms = function _kms(u) {\n      setTimeout(function slightTimout() {\n        var d = document, f = d.head,\n        s = d.createElement('script');\n        s.type = 'text/javascript'; s.async = true; s.src = u;\n        f.parentNode.insertBefore(s, f);\n      }, 1);\n    };\n    _kms('https://i.kissmetrics.com/i.js');\n    _kms('https://doug1izaerwt3.cloudfront.net/' + _kmk + '.1.js');\n    \n    chrome.extension.onConnect.addListener(function KissIncludeOnConnect(port) {\n      if (port.name === KissIncludePortName) {\n        port.onMessage.addListener(function portOnmessage(msg) {\n          if (msg.bufferedPush) {\n            _kmq.push(msg.bufferedPush);\n          } else {\n            fail('unhandled message to kiss-include.js background receiver: ', msg);\n          }\n        });\n      }\n    });\n  } else {\n    \n    //content script, setup api buffer\n    var KissIncludePort = chrome.extension.connect({name: KissIncludePortName});\n    window._kmq.push = function _kmqPush(pushedArray) {\n      if (arguments.length !== 1) {\n        fail('too many arguments, only one is expected. arguments:' + JSON.stringify(arguments));\n      }\n      if (typeof pushedArray === 'function') {\n        fail(\n          '_kmq.push doesnt accept a function in content scripts. This eliminates unnecessary complexity.'\n          , pushedArray\n        );\n      } else if (typeof pushedArray !== 'object') {\n        fail('_kmq.push only accepts an object/array argument');\n      }\n      KissIncludePort.postMessage({bufferedPush: pushedArray});\n    };\n    \n    //re-push events\n    _kmq.forEach(function kmqForEach(event) {\n      _kmq.push(event);\n    });\n  }\n  \n}; // End window.kissInclude\n\nif (typeof _kmk !== 'undefined') {\n  kissInclude(_kmk);\n}"]}