Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coveo.analytics

Package Overview
Dependencies
Maintainers
3
Versions
259
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coveo.analytics - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

1

dist/analytics.d.ts
/// <reference types="whatwg-fetch" />
import { SearchEventRequest, SearchEventResponse, ClickEventRequest, ClickEventResponse, CustomEventRequest, CustomEventResponse, ViewEventRequest, ViewEventResponse, VisitResponse, HealthResponse } from './events';
import { AnalyticsClient } from './analyticsclient';
import 'whatwg-fetch';
export declare const Version: string;

@@ -5,0 +6,0 @@ export declare const Endpoints: {

"use strict";
var history_1 = require('./history');
var detector_1 = require('./detector');
require('whatwg-fetch');
exports.Version = 'v15';

@@ -5,0 +6,0 @@ exports.Endpoints = {

@@ -1,2 +0,9 @@

!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(t){"use strict";var r=n(1),o=n(10),i=t.coveoua||{};t.coveoua=r.default,t.coveoanalytics=o,i.q&&i.q.forEach(function(t){return r.default.apply(void 0,t)}),Object.defineProperty(e,"__esModule",{value:!0}),e.default=i}).call(e,function(){return this}())},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(2),i=n(8),s=n(9),a=function(){function t(){}return t.prototype.init=function(t,e){if("undefined"==typeof t)throw new Error("You must pass your token when you call 'init'");if("string"==typeof t)e=e||o.Endpoints.default,this.client=new o.Client({token:t,endpoint:e});else{if("object"!==("undefined"==typeof t?"undefined":r(t))||"undefined"==typeof t.sendEvent)throw new Error("You must pass either your token or a valid object when you call 'init'");this.client=t}},t.prototype.send=function(t,e){if("undefined"==typeof this.client)throw new Error("You must call init before sending an event");switch(e=i.default({},{hash:window.location.hash},e),t){case"pageview":return void this.client.sendViewEvent({location:window.location.toString(),referrer:document.referrer,language:document.documentElement.lang,title:document.title,contentIdKey:s.popFromObject(e,"contentIdKey"),contentIdValue:s.popFromObject(e,"contentIdValue"),contentType:s.popFromObject(e,"contentType"),customData:e});default:throw new Error("Event type: '"+t+"' not implemented")}},t.prototype.onLoad=function(t){if("undefined"==typeof t)throw new Error("You must pass a function when you call 'onLoad'");t()},t}();e.SimpleAPI=a;var u=new a;e.SimpleAnalytics=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=u[t];if(r)return r.apply(u,e)},Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SimpleAnalytics},function(t,e,n){(function(t){"use strict";function r(t){return t.json().then(function(e){return e.raw=t,e})}var o=n(4),i=n(6);e.Version="v15",e.Endpoints={default:"https://usageanalytics.coveo.com",production:"https://usageanalytics.coveo.com",dev:"https://usageanalyticsdev.coveo.com",staging:"https://usageanalyticsstaging.coveo.com"};var s=function(){function n(t){if("undefined"==typeof t)throw new Error("You have to pass options to this constructor");this.endpoint=t.endpoint||e.Endpoints.default,this.token=t.token,this.version=t.version||e.Version}return n.prototype.sendEvent=function(e,n){return t(this.getRestEndpoint()+"/analytics/"+e,{method:"POST",headers:this.getHeaders(),mode:"cors",body:JSON.stringify(n),credentials:"include"})},n.prototype.sendSearchEvent=function(t){return this.sendEvent("search",t).then(r)},n.prototype.sendClickEvent=function(t){return this.sendEvent("click",t).then(r)},n.prototype.sendCustomEvent=function(t){return this.sendEvent("custom",t).then(r)},n.prototype.sendViewEvent=function(t){if(""===t.referrer&&delete t.referrer,i.hasDocumentLocation()){var e=new o.HistoryStore,n={name:"PageView",value:document.location.toString(),time:JSON.stringify(new Date),title:document.title};e.addElement(n)}return this.sendEvent("view",t).then(r)},n.prototype.getVisit=function(){return t(this.getRestEndpoint()+"/analytics/visit").then(r)},n.prototype.getHealth=function(){return t(this.getRestEndpoint()+"/analytics/monitoring/health").then(r)},n.prototype.getRestEndpoint=function(){return this.endpoint+"/rest/"+this.version},n.prototype.getHeaders=function(){var t={"Content-Type":"application/json"};return this.token&&(t.Authorization="Bearer "+this.token),t},n}();e.Client=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}).call(e,n(3))},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function n(t){return"string"!=typeof t&&(t=String(t)),t}function r(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return v.iterable&&(e[Symbol.iterator]=function(){return e}),e}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function s(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function a(t){var e=new FileReader,n=s(e);return e.readAsArrayBuffer(t),n}function u(t){var e=new FileReader,n=s(e);return e.readAsText(t),n}function c(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}function f(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(v.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(v.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(v.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(v.arrayBuffer&&v.blob&&w(t))this._bodyArrayBuffer=f(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!v.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!g(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=f(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):v.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},v.blob&&(this.blob=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(a)}),this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(c(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},v.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(t){var e=t.toUpperCase();return E.indexOf(e)>-1?e:t}function h(t,e){e=e||{};var n=e.body;if("string"==typeof t)this.url=t;else{if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=d(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}}),e}function y(t){var e=new o;return t.split("\r\n").forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();e.append(r,o)}}),e}function m(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var v={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(v.arrayBuffer)var b=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=function(t){return t&&DataView.prototype.isPrototypeOf(t)},g=ArrayBuffer.isView||function(t){return t&&b.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,r){t=e(t),r=n(r);var o=this.map[t];this.map[t]=o?o+","+r:r},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,r){this.map[e(t)]=n(r)},o.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},o.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),r(t)},o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),r(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),r(t)},v.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},l.call(h.prototype),l.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];m.redirect=function(t,e){if(_.indexOf(e)===-1)throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=h,t.Response=m,t.fetch=function(t,e){return new Promise(function(n,r){var o=new h(t,e),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:y(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var e="response"in i?i.response:i.responseText;n(new m(e,t))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&v.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this),t.exports=self.fetch},function(t,e,n){"use strict";var r=n(5),o=n(6);e.STORE_KEY="__coveo.analytics.history",e.MAX_NUMBER_OF_HISTORY_ELEMENTS=20,e.MIN_THRESHOLD_FOR_DUPLICATE_VALUE=6e4,e.MAX_VALUE_SIZE=75;var i=function(){function t(t){this.store=t||r.getAvailableStorage(),this.store instanceof r.CookieStorage||!o.hasCookieStorage()||(new r.CookieStorage).removeItem(e.STORE_KEY)}return t.prototype.addElement=function(t){t.internalTime=(new Date).getTime(),this.cropQueryElement(t);var e=this.getHistory();null!=e?this.isValidEntry(t)&&this.setHistory([t].concat(e)):this.setHistory([t])},t.prototype.getHistory=function(){try{return JSON.parse(this.store.getItem(e.STORE_KEY))}catch(t){return[]}},t.prototype.setHistory=function(t){try{this.store.setItem(e.STORE_KEY,JSON.stringify(t.slice(0,e.MAX_NUMBER_OF_HISTORY_ELEMENTS)))}catch(t){}},t.prototype.clear=function(){try{this.store.removeItem(e.STORE_KEY)}catch(t){}},t.prototype.getMostRecentElement=function(){var t=this.getHistory();if(null!=t){var e=t.sort(function(t,e){return null==t.internalTime&&null==e.internalTime?0:null==t.internalTime&&null!=e.internalTime?1:null!=t.internalTime&&null==e.internalTime?-1:e.internalTime-t.internalTime});return e[0]}return null},t.prototype.cropQueryElement=function(t){t.name&&"query"==t.name.toLowerCase()&&null!=t.value&&(t.value=t.value.slice(0,e.MAX_VALUE_SIZE))},t.prototype.isValidEntry=function(t){var n=this.getMostRecentElement();return!n||n.value!=t.value||t.internalTime-n.internalTime>e.MIN_THRESHOLD_FOR_DUPLICATE_VALUE},t}();e.HistoryStore=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function r(){return e.preferredStorage?e.preferredStorage:o.hasLocalStorage()?localStorage:o.hasCookieStorage()?new s:o.hasSessionStorage()?sessionStorage:new a}var o=n(6),i=n(7);e.preferredStorage=null,e.getAvailableStorage=r;var s=function(){function t(){}return t.prototype.getItem=function(t){return i.Cookie.get(t)},t.prototype.removeItem=function(t){i.Cookie.erase(t)},t.prototype.setItem=function(t,e){i.Cookie.set(t,e)},t}();e.CookieStorage=s;var a=function(){function t(){}return t.prototype.getItem=function(t){return null},t.prototype.removeItem=function(t){},t.prototype.setItem=function(t,e){},t}();e.NullStorage=a},function(t,e){"use strict";function n(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}}function r(){try{return"sessionStorage"in window&&null!==window.sessionStorage}catch(t){return!1}}function o(){return navigator.cookieEnabled}function i(){return null!==document}function s(){return i()&&null!==document.location}e.hasLocalStorage=n,e.hasSessionStorage=r,e.hasCookieStorage=o,e.hasDocument=i,e.hasDocumentLocation=s},function(t,e){"use strict";var n=function(){function t(){}return t.set=function(e,n,r){var o,i,s,a,u;r?(s=new Date,s.setTime(s.getTime()+r),a="; expires="+s.toGMTString()):a="",u=location.hostname,u.indexOf(".")===-1?document.cookie=e+"="+n+a+"; path=/":(i=u.split("."),i.shift(),o="."+i.join("."),document.cookie=e+"="+n+a+"; path=/; domain="+o,null!=t.get(e)&&t.get(e)==n||(o="."+u,document.cookie=e+"="+n+a+"; path=/; domain="+o))},t.get=function(t){for(var e=t+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){var o=n[r];if(o=o.replace(/^\s+/,""),0==o.indexOf(e))return o.substring(e.length,o.length)}return null},t.erase=function(e){t.set(e,"",-1)},t}();e.Cookie=n},function(t,e){"use strict";var n=Object.prototype.hasOwnProperty,r=Object.getOwnPropertySymbols,o=Object.prototype.propertyIsEnumerable,i=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");var s=Object(t);return e.forEach(function(t){var e=Object(t);for(var i in e)n.call(e,i)&&(s[i]=e[i]);if(r){var a=r(e);a.forEach(function(t){o.call(e,t)&&(s[t]=e[t])})}}),s};e.ponyfill=i,e.assign="function"==typeof Object.assign?Object.assign:i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.assign},function(t,e){"use strict";function n(t,e){if(t){var n=t[e];return delete t[e],n}}e.popFromObject=n},function(t,e,n){"use strict";var r=n(2);e.analytics=r;var o=n(1);e.SimpleAnalytics=o;var i=n(4);e.history=i;var s=n(11);e.donottrack=s;var a=n(5);e.storage=a},function(t,e){"use strict";e.doNotTrack=[!0,"yes","1"].indexOf(navigator.doNotTrack||navigator.msDoNotTrack||window.doNotTrack),Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.doNotTrack}]);
!function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){(function(t){"use strict";var n=r(1),o=r(15),i=t.coveoua||{};t.coveoua=n.default,t.coveoanalytics=o,i.q&&i.q.forEach(function(t){return n.default.apply(void 0,t)}),Object.defineProperty(e,"__esModule",{value:!0}),e.default=i}).call(e,function(){return this}())},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=r(2),i=r(13),s=r(14),a=function(){function t(){}return t.prototype.init=function(t,e){if("undefined"==typeof t)throw new Error("You must pass your token when you call 'init'");if("string"==typeof t)e=e||o.Endpoints.default,this.client=new o.Client({token:t,endpoint:e});else{if("object"!==("undefined"==typeof t?"undefined":n(t))||"undefined"==typeof t.sendEvent)throw new Error("You must pass either your token or a valid object when you call 'init'");this.client=t}},t.prototype.send=function(t,e){if("undefined"==typeof this.client)throw new Error("You must call init before sending an event");switch(e=i.default({},{hash:window.location.hash},e),t){case"pageview":return void this.client.sendViewEvent({location:window.location.toString(),referrer:document.referrer,language:document.documentElement.lang,title:document.title,contentIdKey:s.popFromObject(e,"contentIdKey"),contentIdValue:s.popFromObject(e,"contentIdValue"),contentType:s.popFromObject(e,"contentType"),customData:e});default:throw new Error("Event type: '"+t+"' not implemented")}},t.prototype.onLoad=function(t){if("undefined"==typeof t)throw new Error("You must pass a function when you call 'onLoad'");t()},t}();e.SimpleAPI=a;var u=new a;e.SimpleAnalytics=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=u[t];if(n)return n.apply(u,e)},Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SimpleAnalytics},function(t,e,r){(function(t){"use strict";function n(t){return t.json().then(function(e){return e.raw=t,e})}var o=r(8),i=r(10);r(12),e.Version="v15",e.Endpoints={default:"https://usageanalytics.coveo.com",production:"https://usageanalytics.coveo.com",dev:"https://usageanalyticsdev.coveo.com",staging:"https://usageanalyticsstaging.coveo.com"};var s=function(){function r(t){if("undefined"==typeof t)throw new Error("You have to pass options to this constructor");this.endpoint=t.endpoint||e.Endpoints.default,this.token=t.token,this.version=t.version||e.Version}return r.prototype.sendEvent=function(e,r){return t(this.getRestEndpoint()+"/analytics/"+e,{method:"POST",headers:this.getHeaders(),mode:"cors",body:JSON.stringify(r),credentials:"include"})},r.prototype.sendSearchEvent=function(t){return this.sendEvent("search",t).then(n)},r.prototype.sendClickEvent=function(t){return this.sendEvent("click",t).then(n)},r.prototype.sendCustomEvent=function(t){return this.sendEvent("custom",t).then(n)},r.prototype.sendViewEvent=function(t){if(""===t.referrer&&delete t.referrer,i.hasDocumentLocation()){var e=new o.HistoryStore,r={name:"PageView",value:document.location.toString(),time:JSON.stringify(new Date),title:document.title};e.addElement(r)}return this.sendEvent("view",t).then(n)},r.prototype.getVisit=function(){return t(this.getRestEndpoint()+"/analytics/visit").then(n)},r.prototype.getHealth=function(){return t(this.getRestEndpoint()+"/analytics/monitoring/health").then(n)},r.prototype.getRestEndpoint=function(){return this.endpoint+"/rest/"+this.version},r.prototype.getHeaders=function(){var t={"Content-Type":"application/json"};return this.token&&(t.Authorization="Bearer "+this.token),t},r}();e.Client=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}).call(e,r(3))},function(t,e,r){(function(e){!function(t){"use strict";function r(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function n(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return v.iterable&&(e[Symbol.iterator]=function(){return e}),e}function i(t){this.map={},t instanceof i?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function s(t){return t.bodyUsed?e.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function a(t){return new e(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function u(t){var e=new FileReader,r=a(e);return e.readAsArrayBuffer(t),r}function c(t){var e=new FileReader,r=a(e);return e.readAsText(t),r}function f(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function l(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(v.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(v.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(v.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(v.arrayBuffer&&v.blob&&_(t))this._bodyArrayBuffer=l(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!v.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!g(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=l(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):v.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},v.blob&&(this.blob=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return e.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return e.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return e.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?s(this)||e.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var t=s(this);if(t)return t;if(this._bodyBlob)return c(this._bodyBlob);if(this._bodyArrayBuffer)return e.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return e.resolve(this._bodyText)},v.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(t){var e=t.toUpperCase();return E.indexOf(e)>-1?e:t}function p(t,e){e=e||{};var r=e.body;if(t instanceof p){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new i(t.headers)),this.method=t.method,this.mode=t.mode,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new i(e.headers)),this.method=d(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function b(t){var e=new i;return t.split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}}),e}function m(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new i(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var v={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(v.arrayBuffer)var w=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_=function(t){return t&&DataView.prototype.isPrototypeOf(t)},g=ArrayBuffer.isView||function(t){return t&&w.indexOf(Object.prototype.toString.call(t))>-1};i.prototype.append=function(t,e){t=r(t),e=n(e);var o=this.map[t];this.map[t]=o?o+","+e:e},i.prototype.delete=function(t){delete this.map[r(t)]},i.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},i.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},i.prototype.set=function(t,e){this.map[r(t)]=n(e)},i.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},i.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),o(t)},i.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},i.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),o(t)},v.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},h.call(p.prototype),h.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var T=[301,302,303,307,308];m.redirect=function(t,e){if(T.indexOf(e)===-1)throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},t.Headers=i,t.Request=p,t.Response=m,t.fetch=function(t,r){return new e(function(e,n){var o=new p(t,r),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:b(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var r="response"in i?i.response:i.responseText;e(new m(r,t))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&v.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this),t.exports=self.fetch}).call(e,r(4))},function(t,e,r){(function(e){"use strict";t.exports=r(5).polyfill(),t.exports=e.Promise}).call(e,function(){return this}())},function(t,e,r){(function(e,n,o){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version 4.0.2
*/
!function(e,r){t.exports=r()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function n(t){return"function"==typeof t}function i(t){z=t}function s(t){Q=t}function a(){return function(){return e.nextTick(h)}}function u(){return function(){J(h)}}function c(){var t=0,e=new W(h),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function f(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}function l(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;t<X;t+=2){var e=rt[t],r=rt[t+1];e(r),rt[t]=void 0,rt[t+1]=void 0}X=0}function d(){try{var t=r(7);return J=t.runOnLoop||t.runOnContext,u()}catch(t){return l()}}function p(t,e){var r=arguments,n=this,o=new this.constructor(b);void 0===o[ot]&&k(o);var i=n._state;return i?!function(){var t=r[i-1];Q(function(){return P(i,o,t,n._result)})}():x(n,o,t,e),o}function y(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(b);return A(r,t),r}function b(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(t){return ut.error=t,ut}}function _(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function g(t,e,r){Q(function(t){var n=!1,o=_(r,e,function(r){n||(n=!0,e!==r?A(t,r):O(t,r))},function(e){n||(n=!0,B(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&o&&(n=!0,B(t,o))},t)}function E(t,e){e._state===st?O(t,e._result):e._state===at?B(t,e._result):x(e,void 0,function(e){return A(t,e)},function(e){return B(t,e)})}function T(t,e,r){e.constructor===t.constructor&&r===p&&e.constructor.resolve===y?E(t,e):r===ut?B(t,ut.error):void 0===r?O(t,e):n(r)?g(t,e,r):O(t,e)}function A(e,r){e===r?B(e,m()):t(r)?T(e,r,w(r)):O(e,r)}function S(t){t._onerror&&t._onerror(t._result),j(t)}function O(t,e){t._state===it&&(t._result=e,t._state=st,0!==t._subscribers.length&&Q(j,t))}function B(t,e){t._state===it&&(t._state=at,t._result=e,Q(S,t))}function x(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+st]=r,o[i+at]=n,0===i&&t._state&&Q(j,t)}function j(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)n=e[s],o=e[s+r],n?P(r,n,o,i):o(i);t._subscribers.length=0}}function I(){this.error=null}function U(t,e){try{return t(e)}catch(t){return ct.error=t,ct}}function P(t,e,r,o){var i=n(r),s=void 0,a=void 0,u=void 0,c=void 0;if(i){if(s=U(r,o),s===ct?(c=!0,a=s.error,s=null):u=!0,e===s)return void B(e,v())}else s=o,u=!0;e._state!==it||(i&&u?A(e,s):c?B(e,a):t===st?O(e,s):t===at&&B(e,s))}function R(t,e){try{e(function(e){A(t,e)},function(e){B(t,e)})}catch(e){B(t,e)}}function D(){return ft++}function k(t){t[ot]=ft++,t._state=void 0,t._result=void 0,t._subscribers=[]}function C(t,e){this._instanceConstructor=t,this.promise=new t(b),this.promise[ot]||k(this.promise),G(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&O(this.promise,this._result))):B(this.promise,L())}function L(){return new Error("Array Methods must be provided an Array")}function F(t){return new C(this,t).promise}function H(t){var e=this;return new e(G(t)?function(r,n){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function M(t){var e=this,r=new e(b);return B(r,t),r}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function V(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function q(t){this[ot]=D(),this._result=this._state=void 0,this._subscribers=[],b!==t&&("function"!=typeof t&&N(),this instanceof q?R(this,t):V())}function Y(){var t=void 0;if("undefined"!=typeof o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=q}var K=void 0;K=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G=K,X=0,J=void 0,z=void 0,Q=function(t,e){rt[X]=t,rt[X+1]=e,X+=2,2===X&&(z?z(h):nt())},Z="undefined"!=typeof window?window:void 0,$=Z||{},W=$.MutationObserver||$.WebKitMutationObserver,tt="undefined"==typeof self&&"undefined"!=typeof e&&"[object process]"==={}.toString.call(e),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3),nt=void 0;nt=tt?a():W?c():et?f():void 0===Z?d():l();var ot=Math.random().toString(36).substring(16),it=void 0,st=1,at=2,ut=new I,ct=new I,ft=0;return C.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===it&&r<t;r++)this._eachEntry(e[r],r)},C.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===y){var o=w(t);if(o===p&&t._state!==it)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===q){var i=new r(b);T(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},C.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===it&&(this._remaining--,t===at?B(n,r):this._result[e]=r),0===this._remaining&&O(n,this._result)},C.prototype._willSettleAt=function(t,e){var r=this;x(t,void 0,function(t){return r._settledAt(st,e,t)},function(t){return r._settledAt(at,e,t)})},q.all=F,q.race=H,q.resolve=y,q.reject=M,q._setScheduler=i,q._setAsap=s,q._asap=Q,q.prototype={constructor:q,then:p,catch:function(t){return this.then(null,t)}},q.polyfill=Y,q.Promise=q,q})}).call(e,r(6),r(4),function(){return this}())},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===n||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function s(){y&&d&&(y=!1,d.length?p=d.concat(p):b=-1,p.length&&a())}function a(){if(!y){var t=o(s);y=!0;for(var e=p.length;e;){for(d=p,p=[];++b<e;)d&&d[b].run();b=-1,e=p.length}d=null,y=!1,i(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var f,l,h=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(t){f=r}try{l="function"==typeof clearTimeout?clearTimeout:n}catch(t){l=n}}();var d,p=[],y=!1,b=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];p.push(new u(t,e)),1!==p.length||y||o(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e){},function(t,e,r){"use strict";var n=r(9),o=r(10);e.STORE_KEY="__coveo.analytics.history",e.MAX_NUMBER_OF_HISTORY_ELEMENTS=20,e.MIN_THRESHOLD_FOR_DUPLICATE_VALUE=6e4,e.MAX_VALUE_SIZE=75;var i=function(){function t(t){this.store=t||n.getAvailableStorage(),this.store instanceof n.CookieStorage||!o.hasCookieStorage()||(new n.CookieStorage).removeItem(e.STORE_KEY)}return t.prototype.addElement=function(t){t.internalTime=(new Date).getTime(),this.cropQueryElement(t);var e=this.getHistory();null!=e?this.isValidEntry(t)&&this.setHistory([t].concat(e)):this.setHistory([t])},t.prototype.getHistory=function(){try{return JSON.parse(this.store.getItem(e.STORE_KEY))}catch(t){return[]}},t.prototype.setHistory=function(t){try{this.store.setItem(e.STORE_KEY,JSON.stringify(t.slice(0,e.MAX_NUMBER_OF_HISTORY_ELEMENTS)))}catch(t){}},t.prototype.clear=function(){try{this.store.removeItem(e.STORE_KEY)}catch(t){}},t.prototype.getMostRecentElement=function(){var t=this.getHistory();if(null!=t){var e=t.sort(function(t,e){return null==t.internalTime&&null==e.internalTime?0:null==t.internalTime&&null!=e.internalTime?1:null!=t.internalTime&&null==e.internalTime?-1:e.internalTime-t.internalTime});return e[0]}return null},t.prototype.cropQueryElement=function(t){t.name&&"query"==t.name.toLowerCase()&&null!=t.value&&(t.value=t.value.slice(0,e.MAX_VALUE_SIZE))},t.prototype.isValidEntry=function(t){var r=this.getMostRecentElement();return!r||r.value!=t.value||t.internalTime-r.internalTime>e.MIN_THRESHOLD_FOR_DUPLICATE_VALUE},t}();e.HistoryStore=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,r){"use strict";function n(){return e.preferredStorage?e.preferredStorage:o.hasLocalStorage()?localStorage:o.hasCookieStorage()?new s:o.hasSessionStorage()?sessionStorage:new a}var o=r(10),i=r(11);e.preferredStorage=null,e.getAvailableStorage=n;var s=function(){function t(){}return t.prototype.getItem=function(t){return i.Cookie.get(t)},t.prototype.removeItem=function(t){i.Cookie.erase(t)},t.prototype.setItem=function(t,e){i.Cookie.set(t,e)},t}();e.CookieStorage=s;var a=function(){function t(){}return t.prototype.getItem=function(t){return null},t.prototype.removeItem=function(t){},t.prototype.setItem=function(t,e){},t}();e.NullStorage=a},function(t,e){"use strict";function r(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}}function n(){try{return"sessionStorage"in window&&null!==window.sessionStorage}catch(t){return!1}}function o(){return navigator.cookieEnabled}function i(){return null!==document}function s(){return i()&&null!==document.location}e.hasLocalStorage=r,e.hasSessionStorage=n,e.hasCookieStorage=o,e.hasDocument=i,e.hasDocumentLocation=s},function(t,e){"use strict";var r=function(){function t(){}return t.set=function(e,r,n){var o,i,s,a,u;n?(s=new Date,s.setTime(s.getTime()+n),a="; expires="+s.toGMTString()):a="",u=location.hostname,u.indexOf(".")===-1?document.cookie=e+"="+r+a+"; path=/":(i=u.split("."),i.shift(),o="."+i.join("."),document.cookie=e+"="+r+a+"; path=/; domain="+o,null!=t.get(e)&&t.get(e)==r||(o="."+u,document.cookie=e+"="+r+a+"; path=/; domain="+o))},t.get=function(t){for(var e=t+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){var o=r[n];if(o=o.replace(/^\s+/,""),0==o.indexOf(e))return o.substring(e.length,o.length)}return null},t.erase=function(e){t.set(e,"",-1)},t}();e.Cookie=r},function(t,e,r){(function(t){!function(e){"use strict";function r(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function n(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return v.iterable&&(e[Symbol.iterator]=function(){return e}),e}function i(t){this.map={},t instanceof i?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function s(e){return e.bodyUsed?t.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function a(e){return new t(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function u(t){var e=new FileReader,r=a(e);return e.readAsArrayBuffer(t),r}function c(t){var e=new FileReader,r=a(e);return e.readAsText(t),r}function f(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function l(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(v.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(v.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(v.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(v.arrayBuffer&&v.blob&&_(t))this._bodyArrayBuffer=l(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!v.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!g(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=l(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):v.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},v.blob&&(this.blob=function(){var e=s(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?s(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var e=s(this);if(e)return e;if(this._bodyBlob)return c(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},v.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(t){var e=t.toUpperCase();return E.indexOf(e)>-1?e:t}function p(t,e){e=e||{};var r=e.body;if(t instanceof p){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new i(t.headers)),this.method=t.method,this.mode=t.mode,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new i(e.headers)),this.method=d(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function b(t){var e=new i;return t.split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}}),e}function m(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new i(e.headers),this.url=e.url||"",this._initBody(t)}if(!e.fetch){var v={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(v.arrayBuffer)var w=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_=function(t){return t&&DataView.prototype.isPrototypeOf(t)},g=ArrayBuffer.isView||function(t){return t&&w.indexOf(Object.prototype.toString.call(t))>-1};i.prototype.append=function(t,e){t=r(t),e=n(e);var o=this.map[t];this.map[t]=o?o+","+e:e},i.prototype.delete=function(t){delete this.map[r(t)]},i.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},i.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},i.prototype.set=function(t,e){this.map[r(t)]=n(e)},i.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},i.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),o(t)},i.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},i.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),o(t)},v.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},h.call(p.prototype),h.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var T=[301,302,303,307,308];m.redirect=function(t,e){if(T.indexOf(e)===-1)throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},e.Headers=i,e.Request=p,e.Response=m,e.fetch=function(e,r){return new t(function(t,n){var o=new p(e,r),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:b(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var r="response"in i?i.response:i.responseText;t(new m(r,e))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&v.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)}).call(e,r(4))},function(t,e){"use strict";var r=Object.prototype.hasOwnProperty,n=Object.getOwnPropertySymbols,o=Object.prototype.propertyIsEnumerable,i=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");var s=Object(t);return e.forEach(function(t){var e=Object(t);for(var i in e)r.call(e,i)&&(s[i]=e[i]);if(n){var a=n(e);a.forEach(function(t){o.call(e,t)&&(s[t]=e[t])})}}),s};e.ponyfill=i,e.assign="function"==typeof Object.assign?Object.assign:i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.assign},function(t,e){"use strict";function r(t,e){if(t){var r=t[e];return delete t[e],r}}e.popFromObject=r},function(t,e,r){"use strict";var n=r(2);e.analytics=n;var o=r(1);e.SimpleAnalytics=o;var i=r(8);e.history=i;var s=r(16);e.donottrack=s;var a=r(9);e.storage=a},function(t,e){"use strict";e.doNotTrack=[!0,"yes","1"].indexOf(navigator.doNotTrack||navigator.msDoNotTrack||window.doNotTrack),Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.doNotTrack}]);
//# sourceMappingURL=coveoua.js.map

4

package.json
{
"name": "coveo.analytics",
"version": "0.7.0",
"version": "0.7.1",
"description": "📈 Coveo analytics client (node and browser compatible) ",

@@ -43,3 +43,3 @@ "main": "dist/index.js",

"jsdom": "9.8.2",
"nyc": "9.0.1",
"nyc": "10.1.0",
"sinon": "1.17.6",

@@ -46,0 +46,0 @@ "ts-loader": "^1.2.0",

@@ -11,2 +11,3 @@ import {

import { hasDocumentLocation } from './detector';
import 'whatwg-fetch';

@@ -13,0 +14,0 @@ export const Version = 'v15';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc