coveo.analytics 2.20.24 → 2.20.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var coveoua=function(){"use strict";var q=function(e,t){return(q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function M(e,t){function n(){this.constructor=e}q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o,h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function v(e,t){var n={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function g(e,s,a,c){return new(a=a||Promise)(function(n,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function o(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}i((c=c.apply(e,s||[])).next())})}function f(r,o){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,s=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){c.label=t[1];break}if(6===t[0]&&c.label<a[1]){c.label=a[1],a=t;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(t);break}a[2]&&c.ops.pop(),c.trys.pop();continue}t=o.call(r,c)}catch(e){t=[6,e],s=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function c(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}function D(){return"undefined"!=typeof navigator}function N(){return"undefined"!=typeof document}function H(){try{return"undefined"!=typeof localStorage}catch(e){return}}function U(){return D()&&navigator.cookieEnabled}function j(){return"undefined"!=typeof crypto&&void 0!==crypto.getRandomValues}(e=o=o||{}).search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect";var B=[o.click,o.custom,o.search,o.view],Q=(i.set=function(e,t,n){var r,n=n?((o=new Date).setTime(o.getTime()+n),"; expires="+o.toGMTString()):"",o=location.hostname;-1===o.indexOf(".")?document.cookie=e+"="+t+n+"; path=/":((r=o.split(".")).shift(),Y({name:e,value:t,expires:n,domain:"."+r.join(".")}),null!=i.get(e)&&i.get(e)==t||Y({name:e,value:t,expires:n,domain:"."+o}))},i.get=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){var o=n[r];if(0==(o=o.replace(/^\s+/,"")).indexOf(t))return o.substring(t.length,o.length)}return null},i.erase=function(e){i.set(e,"",-1)},i);function i(){}function Y(e){var t=e.name,n=e.value,r=e.expires,e=e.domain;document.cookie=t+"="+n+r+"; path=/; domain="+e+"; SameSite=Lax"}function z(){return H()?localStorage:U()?new K:function(){try{return"undefined"!=typeof sessionStorage}catch(e){return}}()?sessionStorage:new r}n.prototype.getItem=function(e){return Q.get(""+n.prefix+e)},n.prototype.removeItem=function(e){Q.erase(""+n.prefix+e)},n.prototype.setItem=function(e,t){Q.set(""+n.prefix+e,t)},n.prefix="coveo_";var K=n;function n(){}$.prototype.getItem=function(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)},$.prototype.removeItem=function(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)},$.prototype.setItem=function(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t)};var W=$;function $(){this.cookieStorage=new K}G.prototype.getItem=function(e){return null},G.prototype.removeItem=function(e){},G.prototype.setItem=function(e,t){};var r=G;function G(){}var e=Object.freeze({__proto__:null,preferredStorage:null,getAvailableStorage:z,CookieStorage:K,CookieAndLocalStorage:W,NullStorage:r}),J="__coveo.analytics.history",X=(t.prototype.addElement=function(e){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));var t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])},t.prototype.addElementAsync=function(n){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return n.internalTime=(new Date).getTime(),n=this.cropQueryElement(this.stripEmptyQuery(n)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(t=e.sent())?this.isValidEntry(n)&&this.setHistory([n].concat(t)):this.setHistory([n]),[2]}})})},t.prototype.getHistory=function(){var e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))},t.prototype.getHistoryAsync=function(){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,this.getHistoryWithInternalTimeAsync()];case 1:return t=e.sent(),[2,this.stripEmptyQueries(this.stripInternalTime(t))]}})})},t.prototype.getHistoryWithInternalTime=function(){try{var e=this.store.getItem(J);return e&&"string"==typeof e?JSON.parse(e):[]}catch(e){return[]}},t.prototype.getHistoryWithInternalTimeAsync=function(){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.store.getItem(J)];case 1:return(t=e.sent())?[2,JSON.parse(t)]:[2,[]];case 2:return e.sent(),[2,[]];case 3:return[2]}})})},t.prototype.setHistory=function(e){try{this.store.setItem(J,JSON.stringify(e.slice(0,20)))}catch(e){}},t.prototype.clear=function(){try{this.store.removeItem(J)}catch(e){}},t.prototype.getMostRecentElement=function(){var e=this.getHistoryWithInternalTime();return null!=e?e.sort(function(e,t){return(t.internalTime||0)-(e.internalTime||0)})[0]:null},t.prototype.cropQueryElement=function(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e},t.prototype.isValidEntry=function(e){var t=this.getMostRecentElement();return!t||t.value!=e.value||6e4<(e.internalTime||0)-(t.internalTime||0)},t.prototype.stripInternalTime=function(e){return e.map(function(e){return{name:e.name,time:e.time,value:e.value}})},t.prototype.stripEmptyQuery=function(e){var t=e.name,n=e.time,r=e.value;return t&&"string"==typeof r&&"query"===t.toLowerCase()&&""===r.trim()?{name:t,time:n}:e},t.prototype.stripEmptyQueries=function(e){var t=this;return e.map(function(e){return t.stripEmptyQuery(e)})},t);function t(e){this.store=e||z()}function s(e){return e?(Number(e)^function(e){if(j())return crypto.getRandomValues(e);for(var t=0,n=0;t<e.length;t++){if((t&3)===0)n=Math.random()*4294967296;e[t]=n>>>((t&3)<<3)&255}return e}(new Uint8Array(1))[0]%16>>Number(e)/4).toString(16):(""+1e7+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,s)}function Z(e,a,c){var t=e.impressions.reduce(function(e,t,n){return h(h({},e),(o=a,i=n,s=c,u(r=t).reduce(function(e,t){var n="il"+(o+1)+s+(i+1)+(ue[t]||t);return h(h({},e),((e={})[n]=r[t],e))},{})));var r,o,i,s},{});return e.listName&&(t["il"+(a+1)+"nm"]=e.listName),t}function ee(e){return-1!==Re.indexOf(e)}function te(e){return"custom"===e}function ne(a){return u(a).reduce(function(e,t){n=t,r=void 0,c(Ie).every(function(e){return r=null==(e=e.exec(n))?void 0:e[1],!Boolean(r)});var n,r,o,i,s=r;return h(h({},e),s?(o=s,i=a[t],u(i).reduce(function(e,t){return h(h({},e),((e={})[""+o+t]=i[t],e))},{})):((e={})[t]=a[t],e))},{})}var re=Object.freeze({__proto__:null,STORE_KEY:J,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,MAX_VALUE_SIZE:75,HistoryStore:X,default:X}),oe=function(r){return g(void 0,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return t=new X,n={name:"PageView",value:r,time:JSON.stringify(new Date)},[4,t.addElementAsync(n)];case 1:return e.sent(),[2]}})})},u=Object.keys,ie={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},a=c(u(ie).map(function(e){return ie[e]})).join("|"),se=new RegExp("^("+a+"$)"),ae=[function(e){return se.test(e)}],ce={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ue={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},l={action:"pa",list:"pal",listSource:"pls"},le={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},pe={id:"quoteId",affiliation:"quoteAffiliation"},de={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},he={add:l,bookmark_add:l,bookmark_remove:l,click:l,checkout:l,checkout_option:l,detail:l,impression:l,remove:l,refund:h(h({},l),le),purchase:h(h({},l),le),quickview:l,quote:h(h({},l),pe),review:h(h({},l),de)},a=u(ce).map(function(e){return ce[e]}),p=u(ue).map(function(e){return ue[e]}),d=u(l).map(function(e){return l[e]}),ve=u(le).map(function(e){return le[e]}),ge=u(de).map(function(e){return de[e]}),fe=u(pe).map(function(e){return pe[e]}),a=c(a,["custom"]).join("|"),p=c(p,["custom"]).join("|"),ye="(pr[0-9]+)",me="(il[0-9]+pi[0-9]+)",Se=new RegExp("^"+ye+"("+a+")$"),Ee=new RegExp("^("+me+"("+p+"))|(il[0-9]+nm)$"),we=new RegExp("^("+d.join("|")+")$"),Ce=new RegExp("^("+ve.join("|")+")$"),a=new RegExp("^"+ye+"custom$"),p=new RegExp("^"+me+"custom$"),be=new RegExp("^("+c(["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],ge,fe).join("|")+")$"),ke=[function(e){return Ee.test(e)},function(e){return Se.test(e)},function(e){return we.test(e)},function(e){return Ce.test(e)},function(e){return be.test(e)}],Ie=[a,p],d=h(h(h(h({},{anonymizeIp:"aip"}),{eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"}),{hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"}),["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale"].reduce(function(e,t){return h(h({},e),((e={})[t]=t,e))},{})),Pe=h(h({},d),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Re=u(Pe).map(function(e){return Pe[e]}),xe=(y.prototype.sendEvent=function(u,l){return g(this,void 0,void 0,function(){var t,n,r,o,i,s,a,c;return f(this,function(e){switch(e.label){case 0:if(navigator.sendBeacon)return n=this.opts,t=n.baseUrl,n=n.preprocessRequest,r=this.encodeForEventType(u,l),[4,this.getQueryParamsForEventType(u)];throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');case 1:return(o=e.sent(),o={url:t+"/analytics/"+u+"?"+o,body:new Blob([r],{type:"application/x-www-form-urlencoded"})},a=[h({},o)],n)?[4,n(o,"analyticsBeacon")]:[3,3];case 2:return c=e.sent(),[3,4];case 3:c={},e.label=4;case 4:return o=h.apply(void 0,a.concat([c])),i=o.url,s=o.body,console.log('Sending beacon for "'+u+'" with: ',JSON.stringify(l)),navigator.sendBeacon(i,s),[2]}})})},y.prototype.deleteHttpCookieVisitorId=function(){return Promise.resolve()},y.prototype.encodeForEventType=function(e,t){return this.isEventTypeLegacy(e)?this.encodeForLegacyType(e,t):this.encodeForFormUrlEncoded(h({access_token:this.opts.token},t))},y.prototype.getQueryParamsForEventType=function(r){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return n=this.opts,t=n.token,[4,n.visitorIdProvider.getCurrentVisitorId()];case 1:return n=e.sent(),[2,[t&&this.isEventTypeLegacy(r)?"access_token="+t:"",n?"visitorId="+n:"","discardVisitInfo=true"].filter(function(e){return!!e}).join("&")]}})})},y.prototype.isEventTypeLegacy=function(e){return-1!==[o.click,o.custom,o.search,o.view].indexOf(e)},y.prototype.encodeForLegacyType=function(e,t){return e+"Event="+encodeURIComponent(JSON.stringify(t))},y.prototype.encodeForFormUrlEncoded=function(t){var n=this;return Object.keys(t).filter(function(e){return!!t[e]}).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(n.encodeValue(t[e]))}).join("&")},y.prototype.encodeValue=function(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e?e:JSON.stringify(e)},y);function y(e){this.opts=e}Te.prototype.sendEvent=function(e,t){return g(this,void 0,void 0,function(){return f(this,function(e){return[2,Promise.resolve()]})})},Te.prototype.deleteHttpCookieVisitorId=function(){return g(this,void 0,void 0,function(){return f(this,function(e){return[2,Promise.resolve()]})})};var Ae=Te;function Te(){}var Fe=window.fetch,Le=(m.prototype.sendEvent=function(p,d){return g(this,void 0,void 0,function(){var t,n,r,o,i,s,a,c,u,l;return f(this,function(e){switch(e.label){case 0:return(r=this.opts,t=r.baseUrl,n=r.visitorIdProvider,r=r.preprocessRequest,this.shouldAppendVisitorId(p))?[4,this.getVisitorIdParam()]:[3,2];case 1:return o=e.sent(),[3,3];case 2:o="",e.label=3;case 3:return(i={url:t+"/analytics/"+p+o,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(d)},a=[h({},i)],r)?[4,r(i,"analyticsFetch")]:[3,5];case 4:return c=e.sent(),[3,6];case 5:c={},e.label=6;case 6:return i=h.apply(void 0,a.concat([c])),l=i.url,s=v(i,["url"]),[4,Fe(l,s)];case 7:return(u=e.sent()).ok?[4,u.json()]:[3,9];case 8:return(l=e.sent()).visitorId&&n.setCurrentVisitorId(l.visitorId),[2,l];case 9:try{u.json()}catch(e){}throw console.error('An error has occured when sending the "'+p+'" event.',u,d),new Error('An error has occurred when sending the "'+p+'" event. Check the console logs for more details.')}})})},m.prototype.deleteHttpCookieVisitorId=function(){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return t=this.opts.baseUrl,[4,Fe(t+"/analytics/visit",{headers:this.getHeaders(),method:"DELETE"})];case 1:return e.sent(),[2]}})})},m.prototype.shouldAppendVisitorId=function(e){return-1!==[o.click,o.custom,o.search,o.view].indexOf(e)},m.prototype.getVisitorIdParam=function(){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,this.opts.visitorIdProvider.getCurrentVisitorId()];case 1:return[2,(t=e.sent())?"?visitor="+t:""]}})})},m.prototype.getHeaders=function(){var e=this.opts.token;return h(h({},e?{Authorization:"Bearer "+e}:{}),{"Content-Type":"application/json"})},m);function m(e){this.opts=e}var Oe=function(e,o){var i=this;H()&&U()?this.storage=new W:H()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new r),this.client=new Le(e),this.beaconClient=new xe(e),window.addEventListener("beforeunload",function(){for(var e=0,t=o();e<t.length;e++){var n=t[e],r=n.eventType,n=n.payload;i.beaconClient.sendEvent(r,n)}})},Ve=function(e,t){this.storage=t||new r,this.client=new Le(e)},_e=function(){this.storage=new r,this.client=new Ae};var qe=["1",1,"yes",!0];function S(){return D()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some(function(e){return-1!==qe.indexOf(e)})}var ve=Object.freeze({__proto__:null,doNotTrack:S,default:S}),Me={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"},E=(Object.defineProperty(w.prototype,"defaultOptions",{get:function(){return{endpoint:Me.default,token:"",version:"v15",beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),w.prototype.initRuntime=function(e){var t=this;return"undefined"!=typeof window&&N()?new Oe(e,function(){var e=c(t.bufferedRequests);return t.bufferedRequests=[],e}):("undefined"!=typeof navigator&&"ReactNative"==navigator.product&&console.warn("\n We've detected you're using React Native but have not provided the corresponding runtime, \n for an optimal experience please install @react-native-async-storage/async-storage and instantiate \n your analytics client as follows:\n \n import {ReactNativeRuntime} from 'coveo.analytics/src/react-native';\n \n const analytics = new CoveoAnalyticsClient({\n ...your options,\n runtimeEnvironment: new ReactNativeRuntime({\n baseUrl: '...',\n });\n })\n "),new Ve(e))},Object.defineProperty(w.prototype,"storage",{get:function(){return this.runtime.storage},enumerable:!1,configurable:!0}),w.prototype.determineVisitorId=function(){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.storage.getItem("visitorId")];case 1:return[2,e.sent()||s()];case 2:return t=e.sent(),console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),[2,s()];case 3:return[2]}})})},w.prototype.getCurrentVisitorId=function(){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return this.visitorId?[3,3]:[4,this.determineVisitorId()];case 1:return t=e.sent(),[4,this.setCurrentVisitorId(t)];case 2:e.sent(),e.label=3;case 3:return[2,this.visitorId]}})})},w.prototype.setCurrentVisitorId=function(t){return g(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return this.visitorId=t,[4,this.storage.setItem("visitorId",t)];case 1:return e.sent(),[2]}})})},w.prototype.getParameters=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return g(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return[4,this.resolveParameters.apply(this,c([t],n))];case 1:return[2,e.sent()]}})})},w.prototype.getPayload=function(n){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,this.resolveParameters.apply(this,c([n],r))];case 1:return t=e.sent(),[4,this.resolvePayloadForParameters(n,t)];case 2:return[2,e.sent()]}})})},Object.defineProperty(w.prototype,"currentVisitorId",{get:function(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(s()),this.visitorId},set:function(e){this.visitorId=e,this.storage.setItem("visitorId",e)},enumerable:!1,configurable:!0}),w.prototype.resolveParameters=function(c){for(var u=[],e=1;e<arguments.length;e++)u[e-1]=arguments[e];return g(this,void 0,void 0,function(){var t,n,i,r,o,s,a=this;return f(this,function(e){switch(e.label){case 0:return t=this.eventTypeMapping[c]||{},o=t.variableLengthArgumentsNames,n=void 0===o?[]:o,o=t.addVisitorIdParameter,i=void 0!==o&&o,o=t.usesMeasurementProtocol,r=void 0!==o&&o,o=t.addClientIdParameter,s=void 0!==o&&o,[4,[function(e){return 0<n.length?a.parseVariableArgumentsPayload(n,e):e[0]},function(o){return g(a,void 0,void 0,function(){var t,n,r;return f(this,function(e){switch(e.label){case 0:return(t=[h({},o)],n={},i)?[4,this.getCurrentVisitorId()]:[3,2];case 1:return r=e.sent(),[3,3];case 2:r="",e.label=3;case 3:return[2,h.apply(void 0,t.concat([(n.visitorId=r,n)]))]}})})},function(r){return g(a,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return s?(t=[h({},r)],n={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,h.apply(void 0,t.concat([(n.clientId=e.sent(),n)]))];case 2:return[2,r]}})})},function(e){return r?a.ensureAnonymousUserWhenUsingApiKey(e):e},function(e){return a.beforeSendHooks.reduce(function(n,r){return g(a,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,n];case 1:return t=e.sent(),[4,r(c,t)];case 2:return[2,e.sent()]}})})},e)}].reduce(function(n,r){return g(a,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,n];case 1:return t=e.sent(),[4,r(t)];case 2:return[2,e.sent()]}})})},Promise.resolve(u))];case 1:return[2,e.sent()]}})})},w.prototype.resolvePayloadForParameters=function(r,i){return g(this,void 0,void 0,function(){var t,n,o=this;return f(this,function(e){switch(e.label){case 0:return t=(this.eventTypeMapping[r]||{}).usesMeasurementProtocol,n=void 0!==t&&t,[4,[function(e){return o.removeEmptyPayloadValues(e,r)},function(e){return o.validateParams(e)},function(e){return n?(o=!!(r=e).action&&he[r.action]||{},u(r).reduce(function(e,t){var n=o[t]||Pe[t]||t;return h(h({},e),((e={})[n]=r[t],e))},{})):e;var r,o},function(e){return n?o.removeUnknownParameters(e):e},function(e){return n?o.processCustomParameters(e):e}].reduce(function(n,r){return g(o,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,n];case 1:return t=e.sent(),[4,r(t)];case 2:return[2,e.sent()]}})})},Promise.resolve(i))];case 1:return[2,e.sent()]}})})},w.prototype.sendEvent=function(o){for(var i=[],e=1;e<arguments.length;e++)i[e-1]=arguments[e];return g(this,void 0,void 0,function(){var t,n,r;return f(this,function(e){switch(e.label){case 0:return t=(this.eventTypeMapping[o]||{}).newEventType,t=void 0===t?o:t,[4,this.resolveParameters.apply(this,c([o],i))];case 1:return n=e.sent(),[4,this.resolvePayloadForParameters(o,n)];case 2:return r=e.sent(),this.bufferedRequests.push({eventType:t,payload:r}),[4,Promise.all(this.afterSendHooks.map(function(e){return e(o,n)}))];case 3:return e.sent(),[4,this.deferExecution()];case 4:return e.sent(),[4,this.sendFromBufferWithFetch()];case 5:return[2,e.sent()]}})})},w.prototype.deferExecution=function(){return new Promise(function(e){return setTimeout(e,0)})},w.prototype.sendFromBufferWithFetch=function(){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){return(n=this.bufferedRequests.shift())?(t=n.eventType,n=n.payload,[2,this.runtime.client.sendEvent(t,n)]):[2]})})},w.prototype.clear=function(){this.storage.removeItem("visitorId"),(new X).clear()},w.prototype.deleteHttpOnlyVisitorId=function(){this.runtime.client.deleteHttpCookieVisitorId()},w.prototype.sendSearchEvent=function(t){return g(this,void 0,void 0,function(){return f(this,function(e){return[2,this.sendEvent(o.search,t)]})})},w.prototype.sendClickEvent=function(t){return g(this,void 0,void 0,function(){return f(this,function(e){return[2,this.sendEvent(o.click,t)]})})},w.prototype.sendCustomEvent=function(t){return g(this,void 0,void 0,function(){return f(this,function(e){return[2,this.sendEvent(o.custom,t)]})})},w.prototype.sendViewEvent=function(t){return g(this,void 0,void 0,function(){return f(this,function(e){return[2,this.sendEvent(o.view,t)]})})},w.prototype.getVisit=function(){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,fetch(this.baseUrl+"/analytics/visit")];case 1:return[4,e.sent().json()];case 2:return t=e.sent(),this.visitorId=t.visitorId,[2,t]}})})},w.prototype.getHealth=function(){return g(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return[4,fetch(this.baseUrl+"/analytics/monitoring/health")];case 1:return[4,e.sent().json()];case 2:return[2,e.sent()]}})})},w.prototype.registerBeforeSendEventHook=function(e){this.beforeSendHooks.push(e)},w.prototype.registerAfterSendEventHook=function(e){this.afterSendHooks.push(e)},w.prototype.addEventTypeMapping=function(e,t){this.eventTypeMapping[e]=t},w.prototype.parseVariableArgumentsPayload=function(e,t){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];if("string"==typeof i)n[e[r]]=i;else if("object"==typeof i)return h(h({},n),i)}return n},w.prototype.isKeyAllowedEmpty=function(e,t){var n;return(n={})[o.search]=["queryText"],-1!==(n[e]||[]).indexOf(t)},w.prototype.removeEmptyPayloadValues=function(n,t){var r=this;return Object.keys(n).filter(function(e){return r.isKeyAllowedEmpty(t,e)||null!=(e=n[e])&&""!==e}).reduce(function(e,t){return h(h({},e),((e={})[t]=n[t],e))},{})},w.prototype.removeUnknownParameters=function(n){return Object.keys(n).filter(function(e){if(t=e,c(ke,ae,[ee,te]).some(function(e){return e(t)}))return!0;var t;console.log(e,"is not processed by coveoua")}).reduce(function(e,t){return h(h({},e),((e={})[t]=n[t],e))},{})},w.prototype.processCustomParameters=function(e){var t=e.custom,e=v(e,["custom"]),t=this.lowercaseKeys(t),e=ne(e);return h(h({},t),e)},w.prototype.lowercaseKeys=function(n){return Object.keys(n||{}).reduce(function(e,t){return h(h({},e),((e={})[t.toLowerCase()]=n[t],e))},{})},w.prototype.validateParams=function(e){var t=e.anonymizeIp,e=v(e,["anonymizeIp"]);return void 0!==t&&-1==["0","false","undefined","null","{}","[]",""].indexOf((""+t).toLowerCase())&&(e.anonymizeIp=1),e},w.prototype.ensureAnonymousUserWhenUsingApiKey=function(e){var t,n=e.userId,r=v(e,["userId"]);return null!=(t=this.options.token)&&t.startsWith("xx")&&!n?(r.userId="anonymous",r):e},Object.defineProperty(w.prototype,"baseUrl",{get:function(){var e=this.options,t=e.version,e=e.endpoint,n=-1!==e.indexOf(".cloud.coveo.com");return e+(n?"":"/rest")+"/"+t},enumerable:!1,configurable:!0}),w);function w(e){if(!e)throw new Error("You have to pass options to this constructor");this.options=h(h({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[function(t,n){return g(void 0,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return t!==o.view?[3,2]:[4,oe(n.contentIdValue)];case 1:return e.sent(),[2,h({location:window.location.toString(),referrer:document.referrer,title:document.title},n)];case 2:return[2,n]}})})},function(e,t){return-1!==B.indexOf(e)?h({language:N()?document.documentElement.lang:"unknown",userAgent:D()?navigator.userAgent:"unknown"},t):t}].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};e={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};this.runtime=this.options.runtimeEnvironment||this.initRuntime(e),S()&&(this.clear(),this.runtime.storage=new r)}function De(e){return e.protocol+"//"+e.hostname+(0===e.pathname.indexOf("/")?e.pathname:"/"+e.pathname)+e.search}var ye=Object.freeze({__proto__:null,Version:"v15",Endpoints:Me,CoveoAnalyticsClient:E,default:E}),C={pageview:"pageview",event:"event"},me=(b.prototype.setAction=function(e,t){this.action=e,this.actionData=t},b.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},b.prototype.getLocationInformation=function(e,t){return h({hitType:e},this.getNextValues(e,t))},b.prototype.updateLocationInformation=function(e,t){this.updateLocationForNextPageView(e,t)},b.prototype.getDefaultContextInformation=function(e){var t={title:document.title,encoding:document.characterSet},n={screenResolution:screen.width+"x"+screen.height,screenColor:screen.colorDepth+"-bit"},r={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now().toString(),eventId:this.uuidGenerator()};return h(h(h(h({},o),n),r),t)},b.prototype.updateLocationForNextPageView=function(e,t){var t=this.getNextValues(e,t),n=t.pageViewId,r=t.referrer,t=t.location;this.lastReferrer=r,this.pageViewId=n,this.currentLocation=t,e===C.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},b.prototype.getNextValues=function(e,t){return{pageViewId:e===C.pageview?this.nextPageViewId:this.pageViewId,referrer:e===C.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===C.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}},b.prototype.getCurrentLocationFromPayload=function(e){return e.page?""+this.currentLocation.split("/").slice(0,3).join("/")+e.page.replace(/^\/?(.*)$/,"/$1"):De(window.location)},b);function b(e){var t=e.client,e=e.uuidGenerator,e=void 0===e?s:e;this.actionData={},this.client=t,this.uuidGenerator=e,this.pageViewId=e(),this.nextPageViewId=this.pageViewId,this.currentLocation=De(window.location),this.lastReferrer=document.referrer,this.addHooks()}var Ne,He=h({},C),Ue=Object.keys(He).map(function(e){return He[e]});function k(e){var t=e.client,e=e.uuidGenerator,t=Ne.call(this,{client:t,uuidGenerator:void 0===e?s:e})||this;return t.products=[],t.impressions=[],t}M(k,Ne=me),k.prototype.addHooks=function(){this.addHooksForPageView(),this.addHooksForEvent(),this.addHooksForECEvents()},k.prototype.addProduct=function(e){this.products.push(e)},k.prototype.addImpression=function(e){this.impressions.push(e)},k.prototype.clearPluginData=function(){this.products=[],this.impressions=[]},k.prototype.addHooksForECEvents=function(){var o=this;this.client.registerBeforeSendEventHook(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t[0];return-1!==Ue.indexOf(e)?o.addECDataToPayload(e,r):r}),this.client.registerAfterSendEventHook(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t[0];return-1!==Ue.indexOf(e)&&o.updateLocationInformation(e,r),r})},k.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(He.pageview,{newEventType:o.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},k.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(He.event,{newEventType:o.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},k.prototype.addECDataToPayload=function(e,t){var e=h(h(h(h({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{action:this.action}:{}),this.actionData||{}),n=this.getProductPayload(),r=this.getImpressionPayload();return this.clearData(),h(h(h(h({},r),n),e),t)},k.prototype.getProductPayload=function(){var t=this;return this.products.map(function(e){return t.assureProductValidity(e)}).reduce(function(e,t,n){return h(h({},e),(o=n,u(r=t).reduce(function(e,t){var n="pr"+(o+1)+(ce[t]||t);return h(h({},e),((e={})[n]=r[t],e))},{})));var r,o},{})},k.prototype.getImpressionPayload=function(){var n=this;return this.getImpressionsByList().map(function(e){var t=e.impressions,e=v(e,["impressions"]);return h(h({},e),{impressions:t.map(function(e){return n.assureBaseImpressionValidity(e)})})}).reduce(function(e,t,n){return h(h({},e),Z(t,n,"pi"))},{})},k.prototype.assureProductValidity=function(e){var t=e.position,n=v(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for product '"+(e.name||e.id)+"' must be greater than 0 when provided."),n):e},k.prototype.assureBaseImpressionValidity=function(e){var t=e.position,n=v(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for impression '"+(e.name||e.id)+"' must be greater than 0 when provided."),n):e},k.prototype.getImpressionsByList=function(){return this.impressions.reduce(function(e,t){var n=t.list,t=v(t,["list"]),r=e.find(function(e){return e.listName===n});return r?r.impressions.push(t):e.push({listName:n,impressions:[t]}),e},[])},k.Id="ec";var je,Be=k,Qe=h({},C),Ye=Object.keys(Qe).map(function(e){return Qe[e]}),ze=(M(I,je=me),I.prototype.addHooks=function(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()},I.prototype.setTicket=function(e){this.ticket=e},I.prototype.clearPluginData=function(){this.ticket={}},I.prototype.addHooksForSVCEvents=function(){var o=this;this.client.registerBeforeSendEventHook(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t[0];return-1!==Ye.indexOf(e)?o.addSVCDataToPayload(e,r):r}),this.client.registerAfterSendEventHook(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t[0];return-1!==Ye.indexOf(e)&&o.updateLocationInformation(e,r),r})},I.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Qe.pageview,{newEventType:o.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},I.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Qe.event,{newEventType:o.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},I.prototype.addSVCDataToPayload=function(e,t){var e=h(h(h(h({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),0<Object.keys(null!=(e=this.actionData)?e:{}).length?{svcActionData:this.actionData}:{}),n=this.getTicketPayload();return this.clearData(),h(h(h({},n),e),t)},I.prototype.getTicketPayload=function(){return r=this.ticket,u(r).filter(function(e){return void 0!==r[e]}).reduce(function(e,t){var n=ie[t]||t;return h(h({},e),((e={})[n]=r[t],e))},{});var r},I.Id="svc",I);function I(e){var t=e.client,e=e.uuidGenerator,t=je.call(this,{client:t,uuidGenerator:void 0===e?s:e})||this;return t.ticket={},t}var Ke=ze,We=(P.prototype.require=function(e,t){var n=this.registeredPluginsMap[e];if(!n)throw new Error('No plugin named "'+e+"\" is currently registered. If you use a custom plugin, use 'provide' first.");this.requiredPlugins[e]=new n(t)},P.prototype.provide=function(e,t){this.registeredPluginsMap[e]=t},P.prototype.clearRequired=function(){this.requiredPlugins={}},P.prototype.execute=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this.requiredPlugins[e];if(!o)throw new Error('The plugin "'+e+'" is not required. Check that you required it on initialization.');var i=o[t];if(!i)throw new Error('The function "'+t+'" does not exists on the plugin "'+e+'".');if("function"!=typeof i)throw new Error('"'+t+'" of the plugin "'+e+'" is not a function.');return i.apply(o,n)},P.DefaultPlugins=[Be.Id,Ke.Id],P);function P(){var e;this.registeredPluginsMap=((e={})[Be.Id]=Be,e[Ke.Id]=Ke,e),this.requiredPlugins={}}R.prototype.init=function(e,t){var n=this;if(!e)throw new Error("You must pass your token when you call 'init'");if("string"==typeof e?this.client=new E({token:e,endpoint:this.getEndpoint(t)}):this.isAnalyticsClient(e)&&(this.client=e),!this.client)throw new Error("You must pass either your token or a valid object when you call 'init'");var r={client:this.client};this.plugins.clearRequired(),this.getPluginKeys(t).forEach(function(e){return n.plugins.require(e,r)}),this.client.registerBeforeSendEventHook(function(e,t){return h(h({},t),n.params)}),this.client.addEventTypeMapping(o.view,{newEventType:o.view,addClientIdParameter:!0})},R.prototype.isAnalyticsClient=function(e){return"object"==typeof e&&void 0!==e.sendEvent},R.prototype.getPluginKeys=function(e){return"string"!=typeof e&&Array.isArray(null==e?void 0:e.plugins)?e.plugins:We.DefaultPlugins},R.prototype.getEndpoint=function(e){return"string"==typeof e?e||Me.default:null!=e&&e.endpoint?e.endpoint:Me.default},R.prototype.initForProxy=function(e){if(!e)throw new Error("You must pass your endpoint when you call 'initForProxy'");if("string"!=typeof e)throw new Error("You must pass a string as the endpoint parameter when you call 'initForProxy'");this.client=new E({endpoint:e})},R.prototype.set=function(t,e){var n=this;"string"==typeof t?this.params[t]=e:Object.keys(t).map(function(e){n.params[e]=t[e]})},R.prototype.send=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0],o=t.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(r)return(e=this.client).sendEvent.apply(e,c([r.toLowerCase()],o));throw new Error('You must provide an event type when calling "send".')},R.prototype.onLoad=function(e){if(void 0===e)throw new Error("You must pass a function when you call 'onLoad'");e()},R.prototype.provide=function(e,t){this.plugins.provide(e,t)},R.prototype.require=function(e,t){if(!this.client)throw new Error("You must call init before requiring a plugin");this.plugins.require(e,h(h({},t),{client:this.client}))},R.prototype.callPlugin=function(e,t){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];(n=this.plugins).execute.apply(n,c([e,t],r))},R.prototype.reset=function(){this.client=void 0,this.plugins=new We,this.params={}};ge=R;function R(){this.plugins=new We,this.params={}}function $e(){return T.client}function x(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];(o=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(e))[1];var r=o[2],o=o[3],i=T[o];if(r&&o)return T.callPlugin.apply(T,c([r,o],t));if(i)return i.apply(T,t);throw new Error('The action "'+e+'" does not exist. Available actions: '+["init","set","send","onLoad","callPlugin","reset","require","provide"].join(", ")+".")}var Ge,A,T=new ge,fe=Object.freeze({__proto__:null,CoveoUA:ge,coveoua:T,getCurrentClient:$e,handleOneAnalyticsEvent:x,default:x}),Je=((a=Ge=Ge||{}).contextChanged="contextChanged",a.expandToFullUI="expandToFullUI",(p=A=A||{}).interfaceLoad="interfaceLoad",p.interfaceChange="interfaceChange",p.didyoumeanAutomatic="didyoumeanAutomatic",p.didyoumeanClick="didyoumeanClick",p.resultsSort="resultsSort",p.searchboxSubmit="searchboxSubmit",p.searchboxClear="searchboxClear",p.searchboxAsYouType="searchboxAsYouType",p.breadcrumbFacet="breadcrumbFacet",p.breadcrumbResetAll="breadcrumbResetAll",p.documentQuickview="documentQuickview",p.documentOpen="documentOpen",p.omniboxAnalytics="omniboxAnalytics",p.omniboxFromLink="omniboxFromLink",p.searchFromLink="searchFromLink",p.triggerNotify="notify",p.triggerExecute="execute",p.triggerQuery="query",p.undoTriggerQuery="undoQuery",p.triggerRedirect="redirect",p.pagerResize="pagerResize",p.pagerNumber="pagerNumber",p.pagerNext="pagerNext",p.pagerPrevious="pagerPrevious",p.pagerScrolling="pagerScrolling",p.staticFilterClearAll="staticFilterClearAll",p.staticFilterSelect="staticFilterSelect",p.staticFilterDeselect="staticFilterDeselect",p.facetClearAll="facetClearAll",p.facetSearch="facetSearch",p.facetSelect="facetSelect",p.facetSelectAll="facetSelectAll",p.facetDeselect="facetDeselect",p.facetExclude="facetExclude",p.facetUnexclude="facetUnexclude",p.facetUpdateSort="facetUpdateSort",p.facetShowMore="showMoreFacetResults",p.facetShowLess="showLessFacetResults",p.queryError="query",p.queryErrorBack="errorBack",p.queryErrorClear="errorClearQuery",p.queryErrorRetry="errorRetry",p.recommendation="recommendation",p.recommendationInterfaceLoad="recommendationInterfaceLoad",p.recommendationOpen="recommendationOpen",p.likeSmartSnippet="likeSmartSnippet",p.dislikeSmartSnippet="dislikeSmartSnippet",p.expandSmartSnippet="expandSmartSnippet",p.collapseSmartSnippet="collapseSmartSnippet",p.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",p.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",p.sendSmartSnippetReason="sendSmartSnippetReason",p.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",p.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",p.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",p.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",p.openSmartSnippetSource="openSmartSnippetSource",p.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",p.openSmartSnippetInlineLink="openSmartSnippetInlineLink",p.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",p.recentQueryClick="recentQueriesClick",p.clearRecentQueries="clearRecentQueries",p.recentResultClick="recentResultClick",p.clearRecentResults="clearRecentResults",p.noResultsBack="noResultsBack",p.showMoreFoldedResults="showMoreFoldedResults",p.showLessFoldedResults="showLessFoldedResults",(d={})[A.triggerNotify]="queryPipelineTriggers",d[A.triggerExecute]="queryPipelineTriggers",d[A.triggerQuery]="queryPipelineTriggers",d[A.triggerRedirect]="queryPipelineTriggers",d[A.queryError]="errors",d[A.queryErrorBack]="errors",d[A.queryErrorClear]="errors",d[A.queryErrorRetry]="errors",d[A.pagerNext]="getMoreResults",d[A.pagerPrevious]="getMoreResults",d[A.pagerNumber]="getMoreResults",d[A.pagerResize]="getMoreResults",d[A.pagerScrolling]="getMoreResults",d[A.facetSearch]="facet",d[A.facetShowLess]="facet",d[A.facetShowMore]="facet",d[A.recommendation]="recommendation",d[A.likeSmartSnippet]="smartSnippet",d[A.dislikeSmartSnippet]="smartSnippet",d[A.expandSmartSnippet]="smartSnippet",d[A.collapseSmartSnippet]="smartSnippet",d[A.openSmartSnippetFeedbackModal]="smartSnippet",d[A.closeSmartSnippetFeedbackModal]="smartSnippet",d[A.sendSmartSnippetReason]="smartSnippet",d[A.expandSmartSnippetSuggestion]="smartSnippetSuggestions",d[A.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",d[A.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",d[A.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",d[A.clearRecentQueries]="recentQueries",d[A.recentResultClick]="recentlyClickedDocuments",d[A.clearRecentResults]="recentlyClickedDocuments",d[A.showLessFoldedResults]="folding",d[Ge.expandToFullUI]="interface",d),Xe=(F.prototype.getPayload=function(){return Promise.resolve()},F.prototype.getParameters=function(){return Promise.resolve()},F.prototype.sendEvent=function(){return Promise.resolve()},F.prototype.sendSearchEvent=function(){return Promise.resolve()},F.prototype.sendClickEvent=function(){return Promise.resolve()},F.prototype.sendCustomEvent=function(){return Promise.resolve()},F.prototype.sendViewEvent=function(){return Promise.resolve()},F.prototype.getVisit=function(){return Promise.resolve({id:"",visitorId:""})},F.prototype.getHealth=function(){return Promise.resolve({status:""})},F.prototype.registerBeforeSendEventHook=function(){},F.prototype.registerAfterSendEventHook=function(){},F.prototype.addEventTypeMapping=function(){},F);function F(){this.runtime=new _e,this.currentVisitorId=""}function Ze(e){var n,e=e.map(function(e){return e.replace(/;/g,"")});return n="",function e(t){var n=t.join(";");return n.length<=256?n:e(t.slice(1))}(e.filter(function(e){var t=e!==n;return n=e,t}))}function et(e){var t="string"==typeof e.partialQueries?e.partialQueries:Ze(e.partialQueries),n="string"==typeof e.suggestions?e.suggestions:Ze(e.suggestions);return h(h({},e),{partialQueries:t,suggestions:n})}O.prototype.disable=function(){this.coveoAnalyticsClient instanceof E&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new Xe},O.prototype.enable=function(){this.coveoAnalyticsClient=new E(this.opts)},O.prototype.logInterfaceLoad=function(){return this.logSearchEvent(A.interfaceLoad)},O.prototype.logRecommendationInterfaceLoad=function(){return this.logSearchEvent(A.recommendationInterfaceLoad)},O.prototype.logRecommendation=function(){return this.logCustomEvent(A.recommendation)},O.prototype.logRecommendationOpen=function(e,t){return this.logClickEvent(A.recommendationOpen,e,t)},O.prototype.logStaticFilterClearAll=function(e){return this.logSearchEvent(A.staticFilterClearAll,e)},O.prototype.logStaticFilterSelect=function(e){return this.logSearchEvent(A.staticFilterSelect,e)},O.prototype.logStaticFilterDeselect=function(e){return this.logSearchEvent(A.staticFilterDeselect,e)},O.prototype.logFetchMoreResults=function(){return this.logCustomEvent(A.pagerScrolling,{type:"getMoreResults"})},O.prototype.logInterfaceChange=function(e){return this.logSearchEvent(A.interfaceChange,e)},O.prototype.logDidYouMeanAutomatic=function(){return this.logSearchEvent(A.didyoumeanAutomatic)},O.prototype.logDidYouMeanClick=function(){return this.logSearchEvent(A.didyoumeanClick)},O.prototype.logResultsSort=function(e){return this.logSearchEvent(A.resultsSort,e)},O.prototype.logSearchboxSubmit=function(){return this.logSearchEvent(A.searchboxSubmit)},O.prototype.logSearchboxClear=function(){return this.logSearchEvent(A.searchboxClear)},O.prototype.logSearchboxAsYouType=function(){return this.logSearchEvent(A.searchboxAsYouType)},O.prototype.logBreadcrumbFacet=function(e){return this.logSearchEvent(A.breadcrumbFacet,e)},O.prototype.logBreadcrumbResetAll=function(){return this.logSearchEvent(A.breadcrumbResetAll)},O.prototype.logDocumentQuickview=function(e,t){return this.logClickEvent(A.documentQuickview,e,t)},O.prototype.logDocumentOpen=function(e,t){return this.logClickEvent(A.documentOpen,e,t)},O.prototype.logOmniboxAnalytics=function(e){return this.logSearchEvent(A.omniboxAnalytics,et(e))},O.prototype.logOmniboxFromLink=function(e){return this.logSearchEvent(A.omniboxFromLink,et(e))},O.prototype.logSearchFromLink=function(){return this.logSearchEvent(A.searchFromLink)},O.prototype.logTriggerNotify=function(e){return this.logCustomEvent(A.triggerNotify,e)},O.prototype.logTriggerExecute=function(e){return this.logCustomEvent(A.triggerExecute,e)},O.prototype.logTriggerQuery=function(){var e={query:this.provider.getSearchEventRequestPayload().queryText};return this.logCustomEvent(A.triggerQuery,e,"queryPipelineTriggers")},O.prototype.logUndoTriggerQuery=function(e){return this.logSearchEvent(A.undoTriggerQuery,e)},O.prototype.logTriggerRedirect=function(e){e=h(h({},e),{query:this.provider.getSearchEventRequestPayload().queryText});return this.logCustomEvent(A.triggerRedirect,e)},O.prototype.logPagerResize=function(e){return this.logCustomEvent(A.pagerResize,e)},O.prototype.logPagerNumber=function(e){return this.logCustomEvent(A.pagerNumber,e)},O.prototype.logPagerNext=function(e){return this.logCustomEvent(A.pagerNext,e)},O.prototype.logPagerPrevious=function(e){return this.logCustomEvent(A.pagerPrevious,e)},O.prototype.logPagerScrolling=function(){return this.logCustomEvent(A.pagerScrolling)},O.prototype.logFacetClearAll=function(e){return this.logSearchEvent(A.facetClearAll,e)},O.prototype.logFacetSearch=function(e){return this.logSearchEvent(A.facetSearch,e)},O.prototype.logFacetSelect=function(e){return this.logSearchEvent(A.facetSelect,e)},O.prototype.logFacetDeselect=function(e){return this.logSearchEvent(A.facetDeselect,e)},O.prototype.logFacetExclude=function(e){return this.logSearchEvent(A.facetExclude,e)},O.prototype.logFacetUnexclude=function(e){return this.logSearchEvent(A.facetUnexclude,e)},O.prototype.logFacetSelectAll=function(e){return this.logSearchEvent(A.facetSelectAll,e)},O.prototype.logFacetUpdateSort=function(e){return this.logSearchEvent(A.facetUpdateSort,e)},O.prototype.logFacetShowMore=function(e){return this.logCustomEvent(A.facetShowMore,e)},O.prototype.logFacetShowLess=function(e){return this.logCustomEvent(A.facetShowLess,e)},O.prototype.logQueryError=function(e){return this.logCustomEvent(A.queryError,e)},O.prototype.logQueryErrorBack=function(){return g(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return[4,this.logCustomEvent(A.queryErrorBack)];case 1:return e.sent(),[2,this.logSearchEvent(A.queryErrorBack)]}})})},O.prototype.logQueryErrorRetry=function(){return g(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return[4,this.logCustomEvent(A.queryErrorRetry)];case 1:return e.sent(),[2,this.logSearchEvent(A.queryErrorRetry)]}})})},O.prototype.logQueryErrorClear=function(){return g(this,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return[4,this.logCustomEvent(A.queryErrorClear)];case 1:return e.sent(),[2,this.logSearchEvent(A.queryErrorClear)]}})})},O.prototype.logLikeSmartSnippet=function(){return this.logCustomEvent(A.likeSmartSnippet)},O.prototype.logDislikeSmartSnippet=function(){return this.logCustomEvent(A.dislikeSmartSnippet)},O.prototype.logExpandSmartSnippet=function(){return this.logCustomEvent(A.expandSmartSnippet)},O.prototype.logCollapseSmartSnippet=function(){return this.logCustomEvent(A.collapseSmartSnippet)},O.prototype.logOpenSmartSnippetFeedbackModal=function(){return this.logCustomEvent(A.openSmartSnippetFeedbackModal)},O.prototype.logCloseSmartSnippetFeedbackModal=function(){return this.logCustomEvent(A.closeSmartSnippetFeedbackModal)},O.prototype.logSmartSnippetFeedbackReason=function(e,t){return this.logCustomEvent(A.sendSmartSnippetReason,{reason:e,details:t})},O.prototype.logExpandSmartSnippetSuggestion=function(e){return this.logCustomEvent(A.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},O.prototype.logCollapseSmartSnippetSuggestion=function(e){return this.logCustomEvent(A.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},O.prototype.logShowMoreSmartSnippetSuggestion=function(e){return this.logCustomEvent(A.showMoreSmartSnippetSuggestion,e)},O.prototype.logShowLessSmartSnippetSuggestion=function(e){return this.logCustomEvent(A.showLessSmartSnippetSuggestion,e)},O.prototype.logOpenSmartSnippetSource=function(e,t){return this.logClickEvent(A.openSmartSnippetSource,e,t)},O.prototype.logOpenSmartSnippetSuggestionSource=function(e,t){return this.logClickEvent(A.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},O.prototype.logOpenSmartSnippetInlineLink=function(e,t){return this.logClickEvent(A.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)},O.prototype.logOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.logClickEvent(A.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},O.prototype.logRecentQueryClick=function(){return this.logSearchEvent(A.recentQueryClick)},O.prototype.logClearRecentQueries=function(){return this.logCustomEvent(A.clearRecentQueries)},O.prototype.logRecentResultClick=function(e,t){return this.logCustomEvent(A.recentResultClick,{info:e,identifier:t})},O.prototype.logClearRecentResults=function(){return this.logCustomEvent(A.clearRecentResults)},O.prototype.logNoResultsBack=function(){return this.logSearchEvent(A.noResultsBack)},O.prototype.logShowMoreFoldedResults=function(e,t){return this.logClickEvent(A.showMoreFoldedResults,e,t)},O.prototype.logShowLessFoldedResults=function(){return this.logCustomEvent(A.showLessFoldedResults)},O.prototype.logCustomEvent=function(r,o,i){return void 0===i&&(i=Je[r]),g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return t=h(h({},this.provider.getBaseMetadata()),o),n=[{}],[4,this.getBaseCustomEventRequest(t)];case 1:return t=h.apply(void 0,[h.apply(void 0,n.concat([e.sent()])),{eventType:i,eventValue:r}]),[2,this.coveoAnalyticsClient.sendCustomEvent(t)]}})})},O.prototype.logCustomEventWithType=function(r,o,i){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return t=h(h({},this.provider.getBaseMetadata()),i),n=[{}],[4,this.getBaseCustomEventRequest(t)];case 1:return t=h.apply(void 0,[h.apply(void 0,n.concat([e.sent()])),{eventType:o,eventValue:r}]),[2,this.coveoAnalyticsClient.sendCustomEvent(t)]}})})},O.prototype.logSearchEvent=function(r,o){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return n=(t=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(r,o)];case 1:return[2,n.apply(t,[e.sent()])]}})})},O.prototype.logClickEvent=function(r,o,i,s){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return n=[h({},o)],[4,this.getBaseEventRequest(h(h({},i),s))];case 1:return t=h.apply(void 0,[h.apply(void 0,n.concat([e.sent()])),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:r}]),[2,this.coveoAnalyticsClient.sendClickEvent(t)]}})})},O.prototype.getBaseSearchEventRequest=function(n,r){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return t=[{}],[4,this.getBaseEventRequest(r)];case 1:return[2,h.apply(void 0,[h.apply(void 0,[h.apply(void 0,t.concat([e.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:n}])]}})})},O.prototype.getBaseCustomEventRequest=function(n){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return t=[{}],[4,this.getBaseEventRequest(n)];case 1:return[2,h.apply(void 0,[h.apply(void 0,t.concat([e.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}})})},O.prototype.getBaseEventRequest=function(r){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return n=h(h({},this.provider.getBaseMetadata()),r),t=[h(h({},this.getOrigins()),this.getSplitTestRun())],n={customData:n,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,h.apply(void 0,t.concat([(n.clientId=e.sent(),n)]))]}})})},O.prototype.getOrigins=function(){var e,t;return{originContext:null==(t=(e=this.provider).getOriginContext)?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},O.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof E?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},O.prototype.getSplitTestRun=function(){var e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return h(h({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})};var tt,L,nt,me=O;function O(e,t){this.opts=e,this.provider=t;t=!1===e.enableAnalytics||S();this.coveoAnalyticsClient=t?new Xe:new E(e)}(a=tt=tt||{}).click="click",a.flowStart="flowStart",(p=L=L||{}).enterInterface="ticket_create_start",p.fieldUpdate="ticket_field_update",p.fieldSuggestionClick="ticket_classification_click",p.suggestionClick="suggestion_click",p.suggestionRate="suggestion_rate",p.nextCaseStep="ticket_next_stage",p.caseCancelled="ticket_cancel",p.caseSolved="ticket_cancel",p.caseCreated="ticket_create",(d=nt=nt||{}).quit="Quit",d.solved="Solved";V.prototype.disable=function(){this.coveoAnalyticsClient instanceof E&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new Xe,this.svc=new ze({client:this.coveoAnalyticsClient})},V.prototype.enable=function(){this.coveoAnalyticsClient=new E(this.options),this.svc=new ze({client:this.coveoAnalyticsClient})},V.prototype.logEnterInterface=function(e){return this.svc.setAction(L.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()},V.prototype.logUpdateCaseField=function(e){return this.svc.setAction(L.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()},V.prototype.logSelectFieldSuggestion=function(e){return this.svc.setAction(L.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},V.prototype.logSelectDocumentSuggestion=function(e){return this.svc.setAction(L.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},V.prototype.logRateDocumentSuggestion=function(e){return this.svc.setAction(L.suggestionRate,h({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()},V.prototype.logMoveToNextCaseStep=function(e){return this.svc.setAction(L.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()},V.prototype.logCaseCancelled=function(e){return this.svc.setAction(L.caseCancelled,{reason:nt.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()},V.prototype.logCaseSolved=function(e){return this.svc.setAction(L.caseSolved,{reason:nt.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()},V.prototype.logCaseCreated=function(e){return this.svc.setAction(L.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()},V.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",tt.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},V.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",tt.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)};a=V;function V(e,t){this.options=e,this.provider=t;t=(null==(t=e.enableAnalytics)||t)&&!S();this.coveoAnalyticsClient=t?new E(e):new Xe,this.svc=new ze({client:this.coveoAnalyticsClient})}function rt(t){var n={};return Object.keys(t.caseContext).forEach(function(e){n["context_"+e]=t.caseContext[e]}),n}function _(e,t){this.opts=e,this.provider=t;t=!1===e.enableAnalytics||S();this.coveoAnalyticsClient=t?new Xe:new E(e)}_.prototype.disable=function(){this.coveoAnalyticsClient instanceof E&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new Xe},_.prototype.enable=function(){this.coveoAnalyticsClient=new E(this.opts)},_.prototype.logInterfaceLoad=function(){return this.logSearchEvent(A.interfaceLoad)},_.prototype.logInterfaceChange=function(e){return this.logSearchEvent(A.interfaceChange,e)},_.prototype.logStaticFilterDeselect=function(e){return this.logSearchEvent(A.staticFilterDeselect,e)},_.prototype.logFetchMoreResults=function(){return this.logCustomEvent(A.pagerScrolling,{type:"getMoreResults"})},_.prototype.logBreadcrumbFacet=function(e){return this.logSearchEvent(A.breadcrumbFacet,e)},_.prototype.logBreadcrumbResetAll=function(){return this.logSearchEvent(A.breadcrumbResetAll)},_.prototype.logFacetSelect=function(e){return this.logSearchEvent(A.facetSelect,e)},_.prototype.logFacetDeselect=function(e){return this.logSearchEvent(A.facetDeselect,e)},_.prototype.logFacetUpdateSort=function(e){return this.logSearchEvent(A.facetUpdateSort,e)},_.prototype.logFacetClearAll=function(e){return this.logSearchEvent(A.facetClearAll,e)},_.prototype.logFacetShowMore=function(e){return this.logCustomEvent(A.facetShowMore,e)},_.prototype.logFacetShowLess=function(e){return this.logCustomEvent(A.facetShowLess,e)},_.prototype.logQueryError=function(e){return this.logCustomEvent(A.queryError,e)},_.prototype.logCustomEvent=function(r,o){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return t=h(h({},this.provider.getBaseMetadata()),o),n=[{}],[4,this.getBaseCustomEventRequest(t)];case 1:return t=h.apply(void 0,[h.apply(void 0,n.concat([e.sent()])),{eventType:Je[r],eventValue:r}]),[2,this.coveoAnalyticsClient.sendCustomEvent(t)]}})})},_.prototype.logSearchEvent=function(r,o){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return n=(t=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(r,o)];case 1:return[2,n.apply(t,[e.sent()])]}})})},_.prototype.logPagerNumber=function(e){return this.logCustomEvent(A.pagerNumber,e)},_.prototype.logPagerNext=function(e){return this.logCustomEvent(A.pagerNext,e)},_.prototype.logPagerPrevious=function(e){return this.logCustomEvent(A.pagerPrevious,e)},_.prototype.logDidYouMeanAutomatic=function(){return this.logSearchEvent(A.didyoumeanAutomatic)},_.prototype.logDidYouMeanClick=function(){return this.logSearchEvent(A.didyoumeanClick)},_.prototype.logResultsSort=function(e){return this.logSearchEvent(A.resultsSort,e)},_.prototype.logSearchboxSubmit=function(){return this.logSearchEvent(A.searchboxSubmit)},_.prototype.logContextChanged=function(e){var t=rt(e),n=e.caseId,e=e.caseNumber,n=h(h({CaseId:n,CaseNumber:e},!!t.context_Case_Subject&&{CaseSubject:t.context_Case_Subject}),t);return this.logSearchEvent(Ge.contextChanged,n)},_.prototype.logExpandToFullUI=function(e){var t=rt(e),n=e.caseId,r=e.caseNumber,o=e.triggeredBy,e=e.fullSearchComponentName,n=h({CaseId:n,CaseNumber:r,triggeredBy:o,fullSearchComponentName:e},!!t.context_Case_Subject&&{CaseSubject:t.context_Case_Subject});return this.logCustomEvent(Ge.expandToFullUI,n)},_.prototype.getBaseCustomEventRequest=function(n){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return t=[{}],[4,this.getBaseEventRequest(n)];case 1:return[2,h.apply(void 0,[h.apply(void 0,t.concat([e.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}})})},_.prototype.getBaseSearchEventRequest=function(n,r){return g(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return t=[{}],[4,this.getBaseEventRequest(r)];case 1:return[2,h.apply(void 0,[h.apply(void 0,[h.apply(void 0,t.concat([e.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:n}])]}})})},_.prototype.getBaseEventRequest=function(r){return g(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return n=h(h({},this.provider.getBaseMetadata()),r),t=[h({},this.getOrigins())],n={customData:n,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,h.apply(void 0,t.concat([(n.clientId=e.sent(),n)]))]}})})},_.prototype.getOrigins=function(){var e,t;return{originContext:null==(t=(e=this.provider).getOriginContext)?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},_.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof E?this.coveoAnalyticsClient.getCurrentVisitorId():void 0};p=Object.freeze({__proto__:null,analytics:ye,donottrack:ve,history:re,SimpleAnalytics:fe,storage:e,CoveoAnalyticsClient:E,CoveoUA:ge,getCurrentClient:$e,handleOneAnalyticsEvent:x,CoveoSearchPageClient:me,CaseAssistClient:a,CoveoInsightClient:_});window.Promise instanceof Function||console.error('This script uses window.Promise which is not supported in your browser. Consider adding a polyfill like "es6-promise".');window.fetch instanceof Function||console.error('This script uses window.fetch which is not supported in your browser. Consider adding a polyfill like "fetch".');d=self.coveoua||x;return self.coveoua=x,self.coveoanalytics=p,d.q&&c(d.q.filter(function(e){return"init"===e[0]}),d.q.filter(function(e){return"init"!==e[0]})).forEach(function(e){return x.apply(void 0,e)}),self.coveoua}();
1
+ var coveoua=function(){"use strict";var M=function(e,t){return(M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function q(e,t){function n(){this.constructor=e}M(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o,h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function g(e,t){var n={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function f(e,s,a,c){return new(a=a||Promise)(function(n,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function o(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}i((c=c.apply(e,s||[])).next())})}function m(r,o){var i,s,a,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,s=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){c.label=t[1];break}if(6===t[0]&&c.label<a[1]){c.label=a[1],a=t;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(t);break}a[2]&&c.ops.pop(),c.trys.pop();continue}t=o.call(r,c)}catch(e){t=[6,e],s=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function c(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r}function _(){return"undefined"!=typeof navigator}function N(){return"undefined"!=typeof document}function Q(){try{return"undefined"!=typeof localStorage}catch(e){return}}function B(){return _()&&navigator.cookieEnabled}function H(){return"undefined"!=typeof crypto&&void 0!==crypto.getRandomValues}(e=o=o||{}).search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect";var U=[o.click,o.custom,o.search,o.view],j=(i.set=function(e,t,n){var r,n=n?((o=new Date).setTime(o.getTime()+n),"; expires="+o.toGMTString()):"",o=location.hostname;-1===o.indexOf(".")?document.cookie=e+"="+t+n+"; path=/":((r=o.split(".")).shift(),Y({name:e,value:t,expires:n,domain:"."+r.join(".")}),null!=i.get(e)&&i.get(e)==t||Y({name:e,value:t,expires:n,domain:"."+o}))},i.get=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){var o=n[r];if(0==(o=o.replace(/^\s+/,"")).indexOf(t))return o.substring(t.length,o.length)}return null},i.erase=function(e){i.set(e,"",-1)},i);function i(){}function Y(e){var t=e.name,n=e.value,r=e.expires,e=e.domain;document.cookie=t+"="+n+r+"; path=/; domain="+e+"; SameSite=Lax"}function z(){return Q()?localStorage:B()?new K:function(){try{return"undefined"!=typeof sessionStorage}catch(e){return}}()?sessionStorage:new r}n.prototype.getItem=function(e){return j.get(""+n.prefix+e)},n.prototype.removeItem=function(e){j.erase(""+n.prefix+e)},n.prototype.setItem=function(e,t){j.set(""+n.prefix+e,t)},n.prefix="coveo_";var K=n;function n(){}$.prototype.getItem=function(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)},$.prototype.removeItem=function(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)},$.prototype.setItem=function(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t)};var W=$;function $(){this.cookieStorage=new K}G.prototype.getItem=function(e){return null},G.prototype.removeItem=function(e){},G.prototype.setItem=function(e,t){};var r=G;function G(){}var e=Object.freeze({__proto__:null,preferredStorage:null,getAvailableStorage:z,CookieStorage:K,CookieAndLocalStorage:W,NullStorage:r}),J="__coveo.analytics.history",X=(t.prototype.addElement=function(e){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));var t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])},t.prototype.addElementAsync=function(n){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return n.internalTime=(new Date).getTime(),n=this.cropQueryElement(this.stripEmptyQuery(n)),[4,this.getHistoryWithInternalTimeAsync()];case 1:return null!=(t=e.sent())?this.isValidEntry(n)&&this.setHistory([n].concat(t)):this.setHistory([n]),[2]}})})},t.prototype.getHistory=function(){var e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))},t.prototype.getHistoryAsync=function(){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return[4,this.getHistoryWithInternalTimeAsync()];case 1:return t=e.sent(),[2,this.stripEmptyQueries(this.stripInternalTime(t))]}})})},t.prototype.getHistoryWithInternalTime=function(){try{var e=this.store.getItem(J);return e&&"string"==typeof e?JSON.parse(e):[]}catch(e){return[]}},t.prototype.getHistoryWithInternalTimeAsync=function(){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.store.getItem(J)];case 1:return(t=e.sent())?[2,JSON.parse(t)]:[2,[]];case 2:return e.sent(),[2,[]];case 3:return[2]}})})},t.prototype.setHistory=function(e){try{this.store.setItem(J,JSON.stringify(e.slice(0,20)))}catch(e){}},t.prototype.clear=function(){try{this.store.removeItem(J)}catch(e){}},t.prototype.getMostRecentElement=function(){var e=this.getHistoryWithInternalTime();return null!=e?e.sort(function(e,t){return(t.internalTime||0)-(e.internalTime||0)})[0]:null},t.prototype.cropQueryElement=function(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e},t.prototype.isValidEntry=function(e){var t=this.getMostRecentElement();return!t||t.value!=e.value||6e4<(e.internalTime||0)-(t.internalTime||0)},t.prototype.stripInternalTime=function(e){return e.map(function(e){return{name:e.name,time:e.time,value:e.value}})},t.prototype.stripEmptyQuery=function(e){var t=e.name,n=e.time,r=e.value;return t&&"string"==typeof r&&"query"===t.toLowerCase()&&""===r.trim()?{name:t,time:n}:e},t.prototype.stripEmptyQueries=function(e){var t=this;return e.map(function(e){return t.stripEmptyQuery(e)})},t);function t(e){this.store=e||z()}function s(e){return e?(Number(e)^function(e){if(H())return crypto.getRandomValues(e);for(var t=0,n=0;t<e.length;t++){if((t&3)===0)n=Math.random()*4294967296;e[t]=n>>>((t&3)<<3)&255}return e}(new Uint8Array(1))[0]%16>>Number(e)/4).toString(16):(""+1e7+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,s)}function Z(e,a,c){var t=e.impressions.reduce(function(e,t,n){return h(h({},e),(o=a,i=n,s=c,u(r=t).reduce(function(e,t){var n="il"+(o+1)+s+(i+1)+(ue[t]||t);return h(h({},e),((e={})[n]=r[t],e))},{})));var r,o,i,s},{});return e.listName&&(t["il"+(a+1)+"nm"]=e.listName),t}function ee(e){return-1!==Pe.indexOf(e)}function te(e){return"custom"===e}function ne(a){return u(a).reduce(function(e,t){n=t,r=void 0,c(Ie).every(function(e){return r=null==(e=e.exec(n))?void 0:e[1],!Boolean(r)});var n,r,o,i,s=r;return h(h({},e),s?(o=s,i=a[t],u(i).reduce(function(e,t){return h(h({},e),((e={})[""+o+t]=i[t],e))},{})):((e={})[t]=a[t],e))},{})}var re=Object.freeze({__proto__:null,STORE_KEY:J,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,MAX_VALUE_SIZE:75,HistoryStore:X,default:X}),oe=function(r){return f(void 0,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return t=new X,n={name:"PageView",value:r,time:JSON.stringify(new Date)},[4,t.addElementAsync(n)];case 1:return e.sent(),[2]}})})},u=Object.keys,ie={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},a=c(u(ie).map(function(e){return ie[e]})).join("|"),se=new RegExp("^("+a+"$)"),ae=[function(e){return se.test(e)}],ce={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ue={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},p={action:"pa",list:"pal",listSource:"pls"},pe={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},le={id:"quoteId",affiliation:"quoteAffiliation"},de={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},he={add:p,bookmark_add:p,bookmark_remove:p,click:p,checkout:p,checkout_option:p,detail:p,impression:p,remove:p,refund:h(h({},p),pe),purchase:h(h({},p),pe),quickview:p,quote:h(h({},p),le),review:h(h({},p),de)},a=u(ce).map(function(e){return ce[e]}),l=u(ue).map(function(e){return ue[e]}),d=u(p).map(function(e){return p[e]}),ge=u(pe).map(function(e){return pe[e]}),fe=u(de).map(function(e){return de[e]}),me=u(le).map(function(e){return le[e]}),a=c(a,["custom"]).join("|"),l=c(l,["custom"]).join("|"),ve="(pr[0-9]+)",ye="(il[0-9]+pi[0-9]+)",Se=new RegExp("^"+ve+"("+a+")$"),ke=new RegExp("^("+ye+"("+l+"))|(il[0-9]+nm)$"),Ee=new RegExp("^("+d.join("|")+")$"),we=new RegExp("^("+ge.join("|")+")$"),a=new RegExp("^"+ve+"custom$"),l=new RegExp("^"+ye+"custom$"),Ce=new RegExp("^("+c(["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],fe,me).join("|")+")$"),be=[function(e){return ke.test(e)},function(e){return Se.test(e)},function(e){return Ee.test(e)},function(e){return we.test(e)},function(e){return Ce.test(e)}],Ie=[a,l],d=h(h(h(h({},{anonymizeIp:"aip"}),{eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"}),{hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"}),["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale"].reduce(function(e,t){return h(h({},e),((e={})[t]=t,e))},{})),Re=h(h({},d),{svcAction:"svc_action",svcActionData:"svc_action_data"}),Pe=u(Re).map(function(e){return Re[e]}),xe=(v.prototype.sendEvent=function(u,p){return f(this,void 0,void 0,function(){var t,n,r,o,i,s,a,c;return m(this,function(e){switch(e.label){case 0:if(navigator.sendBeacon)return n=this.opts,t=n.baseUrl,n=n.preprocessRequest,r=this.encodeForEventType(u,p),[4,this.getQueryParamsForEventType(u)];throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');case 1:return(o=e.sent(),o={url:t+"/analytics/"+u+"?"+o,body:new Blob([r],{type:"application/x-www-form-urlencoded"})},a=[h({},o)],n)?[4,n(o,"analyticsBeacon")]:[3,3];case 2:return c=e.sent(),[3,4];case 3:c={},e.label=4;case 4:return o=h.apply(void 0,a.concat([c])),i=o.url,s=o.body,console.log('Sending beacon for "'+u+'" with: ',JSON.stringify(p)),navigator.sendBeacon(i,s),[2]}})})},v.prototype.deleteHttpCookieVisitorId=function(){return Promise.resolve()},v.prototype.encodeForEventType=function(e,t){return this.isEventTypeLegacy(e)?this.encodeForLegacyType(e,t):this.encodeForFormUrlEncoded(h({access_token:this.opts.token},t))},v.prototype.getQueryParamsForEventType=function(r){return f(this,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return n=this.opts,t=n.token,[4,n.visitorIdProvider.getCurrentVisitorId()];case 1:return n=e.sent(),[2,[t&&this.isEventTypeLegacy(r)?"access_token="+t:"",n?"visitorId="+n:"","discardVisitInfo=true"].filter(function(e){return!!e}).join("&")]}})})},v.prototype.isEventTypeLegacy=function(e){return-1!==[o.click,o.custom,o.search,o.view].indexOf(e)},v.prototype.encodeForLegacyType=function(e,t){return e+"Event="+encodeURIComponent(JSON.stringify(t))},v.prototype.encodeForFormUrlEncoded=function(t){var n=this;return Object.keys(t).filter(function(e){return!!t[e]}).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(n.encodeValue(t[e]))}).join("&")},v.prototype.encodeValue=function(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e?e:JSON.stringify(e)},v);function v(e){this.opts=e}Ae.prototype.sendEvent=function(e,t){return f(this,void 0,void 0,function(){return m(this,function(e){return[2,Promise.resolve()]})})},Ae.prototype.deleteHttpCookieVisitorId=function(){return f(this,void 0,void 0,function(){return m(this,function(e){return[2,Promise.resolve()]})})};var Fe=Ae;function Ae(){}var Te=window.fetch,Le=(y.prototype.sendEvent=function(l,d){return f(this,void 0,void 0,function(){var t,n,r,o,i,s,a,c,u,p;return m(this,function(e){switch(e.label){case 0:return(r=this.opts,t=r.baseUrl,n=r.visitorIdProvider,r=r.preprocessRequest,this.shouldAppendVisitorId(l))?[4,this.getVisitorIdParam()]:[3,2];case 1:return o=e.sent(),[3,3];case 2:o="",e.label=3;case 3:return(i={url:t+"/analytics/"+l+o,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(d)},a=[h({},i)],r)?[4,r(i,"analyticsFetch")]:[3,5];case 4:return c=e.sent(),[3,6];case 5:c={},e.label=6;case 6:return i=h.apply(void 0,a.concat([c])),p=i.url,s=g(i,["url"]),[4,Te(p,s)];case 7:return(u=e.sent()).ok?[4,u.json()]:[3,9];case 8:return(p=e.sent()).visitorId&&n.setCurrentVisitorId(p.visitorId),[2,p];case 9:try{u.json()}catch(e){}throw console.error('An error has occured when sending the "'+l+'" event.',u,d),new Error('An error has occurred when sending the "'+l+'" event. Check the console logs for more details.')}})})},y.prototype.deleteHttpCookieVisitorId=function(){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return t=this.opts.baseUrl,[4,Te(t+"/analytics/visit",{headers:this.getHeaders(),method:"DELETE"})];case 1:return e.sent(),[2]}})})},y.prototype.shouldAppendVisitorId=function(e){return-1!==[o.click,o.custom,o.search,o.view].indexOf(e)},y.prototype.getVisitorIdParam=function(){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return[4,this.opts.visitorIdProvider.getCurrentVisitorId()];case 1:return[2,(t=e.sent())?"?visitor="+t:""]}})})},y.prototype.getHeaders=function(){var e=this.opts.token;return h(h({},e?{Authorization:"Bearer "+e}:{}),{"Content-Type":"application/json"})},y);function y(e){this.opts=e}var Oe=function(e,o){var i=this;Q()&&B()?this.storage=new W:Q()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new r),this.client=new Le(e),this.beaconClient=new xe(e),window.addEventListener("beforeunload",function(){for(var e=0,t=o();e<t.length;e++){var n=t[e],r=n.eventType,n=n.payload;i.beaconClient.sendEvent(r,n)}})},De=function(e,t){this.storage=t||new r,this.client=new Le(e)},Ve=function(){this.storage=new r,this.client=new Fe};var Me=["1",1,"yes",!0];function S(){return _()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some(function(e){return-1!==Me.indexOf(e)})}var ge=Object.freeze({__proto__:null,doNotTrack:S,default:S}),qe={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"},k=(Object.defineProperty(E.prototype,"defaultOptions",{get:function(){return{endpoint:qe.default,token:"",version:"v15",beforeSendHooks:[],afterSendHooks:[]}},enumerable:!1,configurable:!0}),E.prototype.initRuntime=function(e){var t=this;return"undefined"!=typeof window&&N()?new Oe(e,function(){var e=c(t.bufferedRequests);return t.bufferedRequests=[],e}):("undefined"!=typeof navigator&&"ReactNative"==navigator.product&&console.warn("\n We've detected you're using React Native but have not provided the corresponding runtime, \n for an optimal experience please install @react-native-async-storage/async-storage and instantiate \n your analytics client as follows:\n \n import {ReactNativeRuntime} from 'coveo.analytics/src/react-native';\n \n const analytics = new CoveoAnalyticsClient({\n ...your options,\n runtimeEnvironment: new ReactNativeRuntime({\n baseUrl: '...',\n });\n })\n "),new De(e))},Object.defineProperty(E.prototype,"storage",{get:function(){return this.runtime.storage},enumerable:!1,configurable:!0}),E.prototype.determineVisitorId=function(){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.storage.getItem("visitorId")];case 1:return[2,e.sent()||s()];case 2:return t=e.sent(),console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),[2,s()];case 3:return[2]}})})},E.prototype.getCurrentVisitorId=function(){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return this.visitorId?[3,3]:[4,this.determineVisitorId()];case 1:return t=e.sent(),[4,this.setCurrentVisitorId(t)];case 2:e.sent(),e.label=3;case 3:return[2,this.visitorId]}})})},E.prototype.setCurrentVisitorId=function(t){return f(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return this.visitorId=t,[4,this.storage.setItem("visitorId",t)];case 1:return e.sent(),[2]}})})},E.prototype.getParameters=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return f(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,this.resolveParameters.apply(this,c([t],n))];case 1:return[2,e.sent()]}})})},E.prototype.getPayload=function(n){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return[4,this.resolveParameters.apply(this,c([n],r))];case 1:return t=e.sent(),[4,this.resolvePayloadForParameters(n,t)];case 2:return[2,e.sent()]}})})},Object.defineProperty(E.prototype,"currentVisitorId",{get:function(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(s()),this.visitorId},set:function(e){this.visitorId=e,this.storage.setItem("visitorId",e)},enumerable:!1,configurable:!0}),E.prototype.resolveParameters=function(c){for(var u=[],e=1;e<arguments.length;e++)u[e-1]=arguments[e];return f(this,void 0,void 0,function(){var t,n,i,r,o,s,a=this;return m(this,function(e){switch(e.label){case 0:return t=this.eventTypeMapping[c]||{},o=t.variableLengthArgumentsNames,n=void 0===o?[]:o,o=t.addVisitorIdParameter,i=void 0!==o&&o,o=t.usesMeasurementProtocol,r=void 0!==o&&o,o=t.addClientIdParameter,s=void 0!==o&&o,[4,[function(e){return 0<n.length?a.parseVariableArgumentsPayload(n,e):e[0]},function(o){return f(a,void 0,void 0,function(){var t,n,r;return m(this,function(e){switch(e.label){case 0:return(t=[h({},o)],n={},i)?[4,this.getCurrentVisitorId()]:[3,2];case 1:return r=e.sent(),[3,3];case 2:r="",e.label=3;case 3:return[2,h.apply(void 0,t.concat([(n.visitorId=r,n)]))]}})})},function(r){return f(a,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return s?(t=[h({},r)],n={},[4,this.getCurrentVisitorId()]):[3,2];case 1:return[2,h.apply(void 0,t.concat([(n.clientId=e.sent(),n)]))];case 2:return[2,r]}})})},function(e){return r?a.ensureAnonymousUserWhenUsingApiKey(e):e},function(e){return a.beforeSendHooks.reduce(function(n,r){return f(a,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return[4,n];case 1:return t=e.sent(),[4,r(c,t)];case 2:return[2,e.sent()]}})})},e)}].reduce(function(n,r){return f(a,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return[4,n];case 1:return t=e.sent(),[4,r(t)];case 2:return[2,e.sent()]}})})},Promise.resolve(u))];case 1:return[2,e.sent()]}})})},E.prototype.resolvePayloadForParameters=function(r,i){return f(this,void 0,void 0,function(){var t,n,o=this;return m(this,function(e){switch(e.label){case 0:return t=(this.eventTypeMapping[r]||{}).usesMeasurementProtocol,n=void 0!==t&&t,[4,[function(e){return o.removeEmptyPayloadValues(e,r)},function(e){return o.validateParams(e)},function(e){return n?(o=!!(r=e).action&&he[r.action]||{},u(r).reduce(function(e,t){var n=o[t]||Re[t]||t;return h(h({},e),((e={})[n]=r[t],e))},{})):e;var r,o},function(e){return n?o.removeUnknownParameters(e):e},function(e){return n?o.processCustomParameters(e):e}].reduce(function(n,r){return f(o,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return[4,n];case 1:return t=e.sent(),[4,r(t)];case 2:return[2,e.sent()]}})})},Promise.resolve(i))];case 1:return[2,e.sent()]}})})},E.prototype.sendEvent=function(o){for(var i=[],e=1;e<arguments.length;e++)i[e-1]=arguments[e];return f(this,void 0,void 0,function(){var t,n,r;return m(this,function(e){switch(e.label){case 0:return t=(this.eventTypeMapping[o]||{}).newEventType,t=void 0===t?o:t,[4,this.resolveParameters.apply(this,c([o],i))];case 1:return n=e.sent(),[4,this.resolvePayloadForParameters(o,n)];case 2:return r=e.sent(),this.bufferedRequests.push({eventType:t,payload:r}),[4,Promise.all(this.afterSendHooks.map(function(e){return e(o,n)}))];case 3:return e.sent(),[4,this.deferExecution()];case 4:return e.sent(),[4,this.sendFromBufferWithFetch()];case 5:return[2,e.sent()]}})})},E.prototype.deferExecution=function(){return new Promise(function(e){return setTimeout(e,0)})},E.prototype.sendFromBufferWithFetch=function(){return f(this,void 0,void 0,function(){var t,n;return m(this,function(e){return(n=this.bufferedRequests.shift())?(t=n.eventType,n=n.payload,[2,this.runtime.client.sendEvent(t,n)]):[2]})})},E.prototype.clear=function(){this.storage.removeItem("visitorId"),(new X).clear()},E.prototype.deleteHttpOnlyVisitorId=function(){this.runtime.client.deleteHttpCookieVisitorId()},E.prototype.sendSearchEvent=function(t){return f(this,void 0,void 0,function(){return m(this,function(e){return[2,this.sendEvent(o.search,t)]})})},E.prototype.sendClickEvent=function(t){return f(this,void 0,void 0,function(){return m(this,function(e){return[2,this.sendEvent(o.click,t)]})})},E.prototype.sendCustomEvent=function(t){return f(this,void 0,void 0,function(){return m(this,function(e){return[2,this.sendEvent(o.custom,t)]})})},E.prototype.sendViewEvent=function(t){return f(this,void 0,void 0,function(){return m(this,function(e){return[2,this.sendEvent(o.view,t)]})})},E.prototype.getVisit=function(){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return[4,fetch(this.baseUrl+"/analytics/visit")];case 1:return[4,e.sent().json()];case 2:return t=e.sent(),this.visitorId=t.visitorId,[2,t]}})})},E.prototype.getHealth=function(){return f(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,fetch(this.baseUrl+"/analytics/monitoring/health")];case 1:return[4,e.sent().json()];case 2:return[2,e.sent()]}})})},E.prototype.registerBeforeSendEventHook=function(e){this.beforeSendHooks.push(e)},E.prototype.registerAfterSendEventHook=function(e){this.afterSendHooks.push(e)},E.prototype.addEventTypeMapping=function(e,t){this.eventTypeMapping[e]=t},E.prototype.parseVariableArgumentsPayload=function(e,t){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];if("string"==typeof i)n[e[r]]=i;else if("object"==typeof i)return h(h({},n),i)}return n},E.prototype.isKeyAllowedEmpty=function(e,t){var n;return(n={})[o.search]=["queryText"],-1!==(n[e]||[]).indexOf(t)},E.prototype.removeEmptyPayloadValues=function(n,t){var r=this;return Object.keys(n).filter(function(e){return r.isKeyAllowedEmpty(t,e)||null!=(e=n[e])&&""!==e}).reduce(function(e,t){return h(h({},e),((e={})[t]=n[t],e))},{})},E.prototype.removeUnknownParameters=function(n){return Object.keys(n).filter(function(e){if(t=e,c(be,ae,[ee,te]).some(function(e){return e(t)}))return!0;var t;console.log(e,"is not processed by coveoua")}).reduce(function(e,t){return h(h({},e),((e={})[t]=n[t],e))},{})},E.prototype.processCustomParameters=function(e){var t=e.custom,e=g(e,["custom"]),t=this.lowercaseKeys(t),e=ne(e);return h(h({},t),e)},E.prototype.lowercaseKeys=function(n){return Object.keys(n||{}).reduce(function(e,t){return h(h({},e),((e={})[t.toLowerCase()]=n[t],e))},{})},E.prototype.validateParams=function(e){var t=e.anonymizeIp,e=g(e,["anonymizeIp"]);return void 0!==t&&-1==["0","false","undefined","null","{}","[]",""].indexOf((""+t).toLowerCase())&&(e.anonymizeIp=1),e},E.prototype.ensureAnonymousUserWhenUsingApiKey=function(e){var t,n=e.userId,r=g(e,["userId"]);return null!=(t=this.options.token)&&t.startsWith("xx")&&!n?(r.userId="anonymous",r):e},Object.defineProperty(E.prototype,"baseUrl",{get:function(){var e=this.options,t=e.version,e=e.endpoint,n=-1!==e.indexOf(".cloud.coveo.com");return e+(n?"":"/rest")+"/"+t},enumerable:!1,configurable:!0}),E);function E(e){if(!e)throw new Error("You have to pass options to this constructor");this.options=h(h({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[function(t,n){return f(void 0,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return t!==o.view?[3,2]:[4,oe(n.contentIdValue)];case 1:return e.sent(),[2,h({location:window.location.toString(),referrer:document.referrer,title:document.title},n)];case 2:return[2,n]}})})},function(e,t){return-1!==U.indexOf(e)?h({language:N()?document.documentElement.lang:"unknown",userAgent:_()?navigator.userAgent:"unknown"},t):t}].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};e={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};this.runtime=this.options.runtimeEnvironment||this.initRuntime(e),S()&&(this.clear(),this.runtime.storage=new r)}function _e(e){return e.protocol+"//"+e.hostname+(0===e.pathname.indexOf("/")?e.pathname:"/"+e.pathname)+e.search}var ve=Object.freeze({__proto__:null,Version:"v15",Endpoints:qe,CoveoAnalyticsClient:k,default:k}),w={pageview:"pageview",event:"event"},ye=(C.prototype.setAction=function(e,t){this.action=e,this.actionData=t},C.prototype.clearData=function(){this.clearPluginData(),this.action=void 0,this.actionData={}},C.prototype.getLocationInformation=function(e,t){return h({hitType:e},this.getNextValues(e,t))},C.prototype.updateLocationInformation=function(e,t){this.updateLocationForNextPageView(e,t)},C.prototype.getDefaultContextInformation=function(e){var t={title:document.title,encoding:document.characterSet},n={screenResolution:screen.width+"x"+screen.height,screenColor:screen.colorDepth+"-bit"},r={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now().toString(),eventId:this.uuidGenerator()};return h(h(h(h({},o),n),r),t)},C.prototype.updateLocationForNextPageView=function(e,t){var t=this.getNextValues(e,t),n=t.pageViewId,r=t.referrer,t=t.location;this.lastReferrer=r,this.pageViewId=n,this.currentLocation=t,e===w.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)},C.prototype.getNextValues=function(e,t){return{pageViewId:e===w.pageview?this.nextPageViewId:this.pageViewId,referrer:e===w.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:e===w.pageview?this.getCurrentLocationFromPayload(t):this.currentLocation}},C.prototype.getCurrentLocationFromPayload=function(e){return e.page?""+this.currentLocation.split("/").slice(0,3).join("/")+e.page.replace(/^\/?(.*)$/,"/$1"):_e(window.location)},C);function C(e){var t=e.client,e=e.uuidGenerator,e=void 0===e?s:e;this.actionData={},this.client=t,this.uuidGenerator=e,this.pageViewId=e(),this.nextPageViewId=this.pageViewId,this.currentLocation=_e(window.location),this.lastReferrer=document.referrer,this.addHooks()}var Ne,Qe=h({},w),Be=Object.keys(Qe).map(function(e){return Qe[e]});function b(e){var t=e.client,e=e.uuidGenerator,t=Ne.call(this,{client:t,uuidGenerator:void 0===e?s:e})||this;return t.products=[],t.impressions=[],t}q(b,Ne=ye),b.prototype.addHooks=function(){this.addHooksForPageView(),this.addHooksForEvent(),this.addHooksForECEvents()},b.prototype.addProduct=function(e){this.products.push(e)},b.prototype.addImpression=function(e){this.impressions.push(e)},b.prototype.clearPluginData=function(){this.products=[],this.impressions=[]},b.prototype.addHooksForECEvents=function(){var o=this;this.client.registerBeforeSendEventHook(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t[0];return-1!==Be.indexOf(e)?o.addECDataToPayload(e,r):r}),this.client.registerAfterSendEventHook(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t[0];return-1!==Be.indexOf(e)&&o.updateLocationInformation(e,r),r})},b.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(Qe.pageview,{newEventType:o.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},b.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(Qe.event,{newEventType:o.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},b.prototype.addECDataToPayload=function(e,t){var e=h(h(h(h({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{action:this.action}:{}),this.actionData||{}),n=this.getProductPayload(),r=this.getImpressionPayload();return this.clearData(),h(h(h(h({},r),n),e),t)},b.prototype.getProductPayload=function(){var t=this;return this.products.map(function(e){return t.assureProductValidity(e)}).reduce(function(e,t,n){return h(h({},e),(o=n,u(r=t).reduce(function(e,t){var n="pr"+(o+1)+(ce[t]||t);return h(h({},e),((e={})[n]=r[t],e))},{})));var r,o},{})},b.prototype.getImpressionPayload=function(){var n=this;return this.getImpressionsByList().map(function(e){var t=e.impressions,e=g(e,["impressions"]);return h(h({},e),{impressions:t.map(function(e){return n.assureBaseImpressionValidity(e)})})}).reduce(function(e,t,n){return h(h({},e),Z(t,n,"pi"))},{})},b.prototype.assureProductValidity=function(e){var t=e.position,n=g(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for product '"+(e.name||e.id)+"' must be greater than 0 when provided."),n):e},b.prototype.assureBaseImpressionValidity=function(e){var t=e.position,n=g(e,["position"]);return void 0!==t&&t<1?(console.warn("The position for impression '"+(e.name||e.id)+"' must be greater than 0 when provided."),n):e},b.prototype.getImpressionsByList=function(){return this.impressions.reduce(function(e,t){var n=t.list,t=g(t,["list"]),r=e.find(function(e){return e.listName===n});return r?r.impressions.push(t):e.push({listName:n,impressions:[t]}),e},[])},b.Id="ec";var He,Ue=b,je=h({},w),Ye=Object.keys(je).map(function(e){return je[e]}),ze=(q(I,He=ye),I.prototype.addHooks=function(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()},I.prototype.setTicket=function(e){this.ticket=e},I.prototype.clearPluginData=function(){this.ticket={}},I.prototype.addHooksForSVCEvents=function(){var o=this;this.client.registerBeforeSendEventHook(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t[0];return-1!==Ye.indexOf(e)?o.addSVCDataToPayload(e,r):r}),this.client.registerAfterSendEventHook(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t[0];return-1!==Ye.indexOf(e)&&o.updateLocationInformation(e,r),r})},I.prototype.addHooksForPageView=function(){this.client.addEventTypeMapping(je.pageview,{newEventType:o.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},I.prototype.addHooksForEvent=function(){this.client.addEventTypeMapping(je.event,{newEventType:o.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})},I.prototype.addSVCDataToPayload=function(e,t){var e=h(h(h(h({},this.getLocationInformation(e,t)),this.getDefaultContextInformation(e)),this.action?{svcAction:this.action}:{}),0<Object.keys(null!=(e=this.actionData)?e:{}).length?{svcActionData:this.actionData}:{}),n=this.getTicketPayload();return this.clearData(),h(h(h({},n),e),t)},I.prototype.getTicketPayload=function(){return r=this.ticket,u(r).filter(function(e){return void 0!==r[e]}).reduce(function(e,t){var n=ie[t]||t;return h(h({},e),((e={})[n]=r[t],e))},{});var r},I.Id="svc",I);function I(e){var t=e.client,e=e.uuidGenerator,t=He.call(this,{client:t,uuidGenerator:void 0===e?s:e})||this;return t.ticket={},t}var Ke=ze,We=(R.prototype.require=function(e,t){var n=this.registeredPluginsMap[e];if(!n)throw new Error('No plugin named "'+e+"\" is currently registered. If you use a custom plugin, use 'provide' first.");this.requiredPlugins[e]=new n(t)},R.prototype.provide=function(e,t){this.registeredPluginsMap[e]=t},R.prototype.clearRequired=function(){this.requiredPlugins={}},R.prototype.execute=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this.requiredPlugins[e];if(!o)throw new Error('The plugin "'+e+'" is not required. Check that you required it on initialization.');var i=o[t];if(!i)throw new Error('The function "'+t+'" does not exists on the plugin "'+e+'".');if("function"!=typeof i)throw new Error('"'+t+'" of the plugin "'+e+'" is not a function.');return i.apply(o,n)},R.DefaultPlugins=[Ue.Id,Ke.Id],R);function R(){var e;this.registeredPluginsMap=((e={})[Ue.Id]=Ue,e[Ke.Id]=Ke,e),this.requiredPlugins={}}P.prototype.init=function(e,t){var n=this;if(!e)throw new Error("You must pass your token when you call 'init'");if("string"==typeof e?this.client=new k({token:e,endpoint:this.getEndpoint(t)}):this.isAnalyticsClient(e)&&(this.client=e),!this.client)throw new Error("You must pass either your token or a valid object when you call 'init'");var r={client:this.client};this.plugins.clearRequired(),this.getPluginKeys(t).forEach(function(e){return n.plugins.require(e,r)}),this.client.registerBeforeSendEventHook(function(e,t){return h(h({},t),n.params)}),this.client.addEventTypeMapping(o.view,{newEventType:o.view,addClientIdParameter:!0})},P.prototype.isAnalyticsClient=function(e){return"object"==typeof e&&void 0!==e.sendEvent},P.prototype.getPluginKeys=function(e){return"string"!=typeof e&&Array.isArray(null==e?void 0:e.plugins)?e.plugins:We.DefaultPlugins},P.prototype.getEndpoint=function(e){return"string"==typeof e?e||qe.default:null!=e&&e.endpoint?e.endpoint:qe.default},P.prototype.initForProxy=function(e){if(!e)throw new Error("You must pass your endpoint when you call 'initForProxy'");if("string"!=typeof e)throw new Error("You must pass a string as the endpoint parameter when you call 'initForProxy'");this.client=new k({endpoint:e})},P.prototype.set=function(t,e){var n=this;"string"==typeof t?this.params[t]=e:Object.keys(t).map(function(e){n.params[e]=t[e]})},P.prototype.send=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0],o=t.slice(1);if(void 0===this.client)throw new Error("You must call init before sending an event");if(r)return(e=this.client).sendEvent.apply(e,c([r.toLowerCase()],o));throw new Error('You must provide an event type when calling "send".')},P.prototype.onLoad=function(e){if(void 0===e)throw new Error("You must pass a function when you call 'onLoad'");e()},P.prototype.provide=function(e,t){this.plugins.provide(e,t)},P.prototype.require=function(e,t){if(!this.client)throw new Error("You must call init before requiring a plugin");this.plugins.require(e,h(h({},t),{client:this.client}))},P.prototype.callPlugin=function(e,t){for(var n,r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];(n=this.plugins).execute.apply(n,c([e,t],r))},P.prototype.reset=function(){this.client=void 0,this.plugins=new We,this.params={}};fe=P;function P(){this.plugins=new We,this.params={}}function $e(){return Je.client}function x(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];(o=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(e))[1];var r=o[2],o=o[3],i=Je[o];if(r&&o)return Je.callPlugin.apply(Je,c([r,o],t));if(i)return i.apply(Je,t);throw new Error('The action "'+e+'" does not exist. Available actions: '+["init","set","send","onLoad","callPlugin","reset","require","provide"].join(", ")+".")}var Ge,F,Je=new fe,me=Object.freeze({__proto__:null,CoveoUA:fe,coveoua:Je,getCurrentClient:$e,handleOneAnalyticsEvent:x,default:x}),Xe=((a=Ge=Ge||{}).contextChanged="contextChanged",a.expandToFullUI="expandToFullUI",(l=F=F||{}).interfaceLoad="interfaceLoad",l.interfaceChange="interfaceChange",l.didyoumeanAutomatic="didyoumeanAutomatic",l.didyoumeanClick="didyoumeanClick",l.resultsSort="resultsSort",l.searchboxSubmit="searchboxSubmit",l.searchboxClear="searchboxClear",l.searchboxAsYouType="searchboxAsYouType",l.breadcrumbFacet="breadcrumbFacet",l.breadcrumbResetAll="breadcrumbResetAll",l.documentQuickview="documentQuickview",l.documentOpen="documentOpen",l.omniboxAnalytics="omniboxAnalytics",l.omniboxFromLink="omniboxFromLink",l.searchFromLink="searchFromLink",l.triggerNotify="notify",l.triggerExecute="execute",l.triggerQuery="query",l.undoTriggerQuery="undoQuery",l.triggerRedirect="redirect",l.pagerResize="pagerResize",l.pagerNumber="pagerNumber",l.pagerNext="pagerNext",l.pagerPrevious="pagerPrevious",l.pagerScrolling="pagerScrolling",l.staticFilterClearAll="staticFilterClearAll",l.staticFilterSelect="staticFilterSelect",l.staticFilterDeselect="staticFilterDeselect",l.facetClearAll="facetClearAll",l.facetSearch="facetSearch",l.facetSelect="facetSelect",l.facetSelectAll="facetSelectAll",l.facetDeselect="facetDeselect",l.facetExclude="facetExclude",l.facetUnexclude="facetUnexclude",l.facetUpdateSort="facetUpdateSort",l.facetShowMore="showMoreFacetResults",l.facetShowLess="showLessFacetResults",l.queryError="query",l.queryErrorBack="errorBack",l.queryErrorClear="errorClearQuery",l.queryErrorRetry="errorRetry",l.recommendation="recommendation",l.recommendationInterfaceLoad="recommendationInterfaceLoad",l.recommendationOpen="recommendationOpen",l.likeSmartSnippet="likeSmartSnippet",l.dislikeSmartSnippet="dislikeSmartSnippet",l.expandSmartSnippet="expandSmartSnippet",l.collapseSmartSnippet="collapseSmartSnippet",l.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",l.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",l.sendSmartSnippetReason="sendSmartSnippetReason",l.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",l.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",l.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",l.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",l.openSmartSnippetSource="openSmartSnippetSource",l.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",l.openSmartSnippetInlineLink="openSmartSnippetInlineLink",l.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",l.recentQueryClick="recentQueriesClick",l.clearRecentQueries="clearRecentQueries",l.recentResultClick="recentResultClick",l.clearRecentResults="clearRecentResults",l.noResultsBack="noResultsBack",l.showMoreFoldedResults="showMoreFoldedResults",l.showLessFoldedResults="showLessFoldedResults",(d={})[F.triggerNotify]="queryPipelineTriggers",d[F.triggerExecute]="queryPipelineTriggers",d[F.triggerQuery]="queryPipelineTriggers",d[F.triggerRedirect]="queryPipelineTriggers",d[F.queryError]="errors",d[F.queryErrorBack]="errors",d[F.queryErrorClear]="errors",d[F.queryErrorRetry]="errors",d[F.pagerNext]="getMoreResults",d[F.pagerPrevious]="getMoreResults",d[F.pagerNumber]="getMoreResults",d[F.pagerResize]="getMoreResults",d[F.pagerScrolling]="getMoreResults",d[F.facetSearch]="facet",d[F.facetShowLess]="facet",d[F.facetShowMore]="facet",d[F.recommendation]="recommendation",d[F.likeSmartSnippet]="smartSnippet",d[F.dislikeSmartSnippet]="smartSnippet",d[F.expandSmartSnippet]="smartSnippet",d[F.collapseSmartSnippet]="smartSnippet",d[F.openSmartSnippetFeedbackModal]="smartSnippet",d[F.closeSmartSnippetFeedbackModal]="smartSnippet",d[F.sendSmartSnippetReason]="smartSnippet",d[F.expandSmartSnippetSuggestion]="smartSnippetSuggestions",d[F.collapseSmartSnippetSuggestion]="smartSnippetSuggestions",d[F.showMoreSmartSnippetSuggestion]="smartSnippetSuggestions",d[F.showLessSmartSnippetSuggestion]="smartSnippetSuggestions",d[F.clearRecentQueries]="recentQueries",d[F.recentResultClick]="recentlyClickedDocuments",d[F.clearRecentResults]="recentlyClickedDocuments",d[F.showLessFoldedResults]="folding",d[Ge.expandToFullUI]="interface",d),Ze=(A.prototype.getPayload=function(){return Promise.resolve()},A.prototype.getParameters=function(){return Promise.resolve()},A.prototype.sendEvent=function(){return Promise.resolve()},A.prototype.sendSearchEvent=function(){return Promise.resolve()},A.prototype.sendClickEvent=function(){return Promise.resolve()},A.prototype.sendCustomEvent=function(){return Promise.resolve()},A.prototype.sendViewEvent=function(){return Promise.resolve()},A.prototype.getVisit=function(){return Promise.resolve({id:"",visitorId:""})},A.prototype.getHealth=function(){return Promise.resolve({status:""})},A.prototype.registerBeforeSendEventHook=function(){},A.prototype.registerAfterSendEventHook=function(){},A.prototype.addEventTypeMapping=function(){},A);function A(){this.runtime=new Ve,this.currentVisitorId=""}function et(e){var n,e=e.map(function(e){return e.replace(/;/g,"")});return n="",function e(t){var n=t.join(";");return n.length<=256?n:e(t.slice(1))}(e.filter(function(e){var t=e!==n;return n=e,t}))}function tt(e){var t="string"==typeof e.partialQueries?e.partialQueries:et(e.partialQueries),n="string"==typeof e.suggestions?e.suggestions:et(e.suggestions);return h(h({},e),{partialQueries:t,suggestions:n})}L.prototype.disable=function(){this.coveoAnalyticsClient instanceof k&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new Ze},L.prototype.enable=function(){this.coveoAnalyticsClient=new k(this.opts)},L.prototype.makeInterfaceLoad=function(){return this.makeSearchEvent(F.interfaceLoad)},L.prototype.logInterfaceLoad=function(){return this.makeInterfaceLoad().log()},L.prototype.makeRecommendationInterfaceLoad=function(){return this.makeSearchEvent(F.recommendationInterfaceLoad)},L.prototype.logRecommendationInterfaceLoad=function(){return this.makeRecommendationInterfaceLoad().log()},L.prototype.makeRecommendation=function(){return this.makeCustomEvent(F.recommendation)},L.prototype.logRecommendation=function(){return this.makeRecommendation().log()},L.prototype.makeRecommendationOpen=function(e,t){return this.makeClickEvent(F.recommendationOpen,e,t)},L.prototype.logRecommendationOpen=function(e,t){return this.makeRecommendationOpen(e,t).log()},L.prototype.makeStaticFilterClearAll=function(e){return this.makeSearchEvent(F.staticFilterClearAll,e)},L.prototype.logStaticFilterClearAll=function(e){return this.makeStaticFilterClearAll(e).log()},L.prototype.makeStaticFilterSelect=function(e){return this.makeSearchEvent(F.staticFilterSelect,e)},L.prototype.logStaticFilterSelect=function(e){return this.makeStaticFilterSelect(e).log()},L.prototype.makeStaticFilterDeselect=function(e){return this.makeSearchEvent(F.staticFilterDeselect,e)},L.prototype.logStaticFilterDeselect=function(e){return this.makeStaticFilterDeselect(e).log()},L.prototype.makeFetchMoreResults=function(){return this.makeCustomEvent(F.pagerScrolling,{type:"getMoreResults"})},L.prototype.logFetchMoreResults=function(){return this.makeFetchMoreResults().log()},L.prototype.makeInterfaceChange=function(e){return this.makeSearchEvent(F.interfaceChange,e)},L.prototype.logInterfaceChange=function(e){return this.makeInterfaceChange(e).log()},L.prototype.makeDidYouMeanAutomatic=function(){return this.makeSearchEvent(F.didyoumeanAutomatic)},L.prototype.logDidYouMeanAutomatic=function(){return this.makeDidYouMeanAutomatic().log()},L.prototype.makeDidYouMeanClick=function(){return this.makeSearchEvent(F.didyoumeanClick)},L.prototype.logDidYouMeanClick=function(){return this.makeDidYouMeanClick().log()},L.prototype.makeResultsSort=function(e){return this.makeSearchEvent(F.resultsSort,e)},L.prototype.logResultsSort=function(e){return this.makeResultsSort(e).log()},L.prototype.makeSearchboxSubmit=function(){return this.makeSearchEvent(F.searchboxSubmit)},L.prototype.logSearchboxSubmit=function(){return this.makeSearchboxSubmit().log()},L.prototype.makeSearchboxClear=function(){return this.makeSearchEvent(F.searchboxClear)},L.prototype.logSearchboxClear=function(){return this.makeSearchboxClear().log()},L.prototype.makeSearchboxAsYouType=function(){return this.makeSearchEvent(F.searchboxAsYouType)},L.prototype.logSearchboxAsYouType=function(){return this.makeSearchboxAsYouType().log()},L.prototype.makeBreadcrumbFacet=function(e){return this.makeSearchEvent(F.breadcrumbFacet,e)},L.prototype.logBreadcrumbFacet=function(e){return this.makeBreadcrumbFacet(e).log()},L.prototype.makeBreadcrumbResetAll=function(){return this.makeSearchEvent(F.breadcrumbResetAll)},L.prototype.logBreadcrumbResetAll=function(){return this.makeBreadcrumbResetAll().log()},L.prototype.makeDocumentQuickview=function(e,t){return this.makeClickEvent(F.documentQuickview,e,t)},L.prototype.logDocumentQuickview=function(e,t){return this.makeDocumentQuickview(e,t).log()},L.prototype.makeDocumentOpen=function(e,t){return this.makeClickEvent(F.documentOpen,e,t)},L.prototype.logDocumentOpen=function(e,t){return this.makeDocumentOpen(e,t).log()},L.prototype.makeOmniboxAnalytics=function(e){return this.makeSearchEvent(F.omniboxAnalytics,tt(e))},L.prototype.logOmniboxAnalytics=function(e){return this.makeOmniboxAnalytics(e).log()},L.prototype.makeOmniboxFromLink=function(e){return this.makeSearchEvent(F.omniboxFromLink,tt(e))},L.prototype.logOmniboxFromLink=function(e){return this.makeOmniboxFromLink(e).log()},L.prototype.makeSearchFromLink=function(){return this.makeSearchEvent(F.searchFromLink)},L.prototype.logSearchFromLink=function(){return this.makeSearchFromLink().log()},L.prototype.makeTriggerNotify=function(e){return this.makeCustomEvent(F.triggerNotify,e)},L.prototype.logTriggerNotify=function(e){return this.makeTriggerNotify(e).log()},L.prototype.makeTriggerExecute=function(e){return this.makeCustomEvent(F.triggerExecute,e)},L.prototype.logTriggerExecute=function(e){return this.makeTriggerExecute(e).log()},L.prototype.makeTriggerQuery=function(){return this.makeCustomEvent(F.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")},L.prototype.logTriggerQuery=function(){return this.makeTriggerQuery().log()},L.prototype.makeUndoTriggerQuery=function(e){return this.makeSearchEvent(F.undoTriggerQuery,e)},L.prototype.logUndoTriggerQuery=function(e){return this.makeUndoTriggerQuery(e).log()},L.prototype.makeTriggerRedirect=function(e){return this.makeCustomEvent(F.triggerRedirect,h(h({},e),{query:this.provider.getSearchEventRequestPayload().queryText}))},L.prototype.logTriggerRedirect=function(e){return this.makeTriggerRedirect(e).log()},L.prototype.makePagerResize=function(e){return this.makeCustomEvent(F.pagerResize,e)},L.prototype.logPagerResize=function(e){return this.makePagerResize(e).log()},L.prototype.makePagerNumber=function(e){return this.makeCustomEvent(F.pagerNumber,e)},L.prototype.logPagerNumber=function(e){return this.makePagerNumber(e).log()},L.prototype.makePagerNext=function(e){return this.makeCustomEvent(F.pagerNext,e)},L.prototype.logPagerNext=function(e){return this.makePagerNext(e).log()},L.prototype.makePagerPrevious=function(e){return this.makeCustomEvent(F.pagerPrevious,e)},L.prototype.logPagerPrevious=function(e){return this.makePagerPrevious(e).log()},L.prototype.makePagerScrolling=function(){return this.makeCustomEvent(F.pagerScrolling)},L.prototype.logPagerScrolling=function(){return this.makePagerScrolling().log()},L.prototype.makeFacetClearAll=function(e){return this.makeSearchEvent(F.facetClearAll,e)},L.prototype.logFacetClearAll=function(e){return this.makeFacetClearAll(e).log()},L.prototype.makeFacetSearch=function(e){return this.makeSearchEvent(F.facetSearch,e)},L.prototype.logFacetSearch=function(e){return this.makeFacetSearch(e).log()},L.prototype.makeFacetSelect=function(e){return this.makeSearchEvent(F.facetSelect,e)},L.prototype.logFacetSelect=function(e){return this.makeFacetSelect(e).log()},L.prototype.makeFacetDeselect=function(e){return this.makeSearchEvent(F.facetDeselect,e)},L.prototype.logFacetDeselect=function(e){return this.makeFacetDeselect(e).log()},L.prototype.makeFacetExclude=function(e){return this.makeSearchEvent(F.facetExclude,e)},L.prototype.logFacetExclude=function(e){return this.makeFacetExclude(e).log()},L.prototype.makeFacetUnexclude=function(e){return this.makeSearchEvent(F.facetUnexclude,e)},L.prototype.logFacetUnexclude=function(e){return this.makeFacetUnexclude(e).log()},L.prototype.makeFacetSelectAll=function(e){return this.makeSearchEvent(F.facetSelectAll,e)},L.prototype.logFacetSelectAll=function(e){return this.makeFacetSelectAll(e).log()},L.prototype.makeFacetUpdateSort=function(e){return this.makeSearchEvent(F.facetUpdateSort,e)},L.prototype.logFacetUpdateSort=function(e){return this.makeFacetUpdateSort(e).log()},L.prototype.makeFacetShowMore=function(e){return this.makeCustomEvent(F.facetShowMore,e)},L.prototype.logFacetShowMore=function(e){return this.makeFacetShowMore(e).log()},L.prototype.makeFacetShowLess=function(e){return this.makeCustomEvent(F.facetShowLess,e)},L.prototype.logFacetShowLess=function(e){return this.makeFacetShowLess(e).log()},L.prototype.makeQueryError=function(e){return this.makeCustomEvent(F.queryError,e)},L.prototype.logQueryError=function(e){return this.makeQueryError(e).log()},L.prototype.makeQueryErrorBack=function(){var e=this;return{description:this.makeDescription(F.queryErrorBack),log:function(){return f(e,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,this.logCustomEvent(F.queryErrorBack)];case 1:return e.sent(),[2,this.logSearchEvent(F.queryErrorBack)]}})})}}},L.prototype.logQueryErrorBack=function(){return this.makeQueryErrorBack().log()},L.prototype.makeQueryErrorRetry=function(){var e=this;return{description:this.makeDescription(F.queryErrorRetry),log:function(){return f(e,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,this.logCustomEvent(F.queryErrorRetry)];case 1:return e.sent(),[2,this.logSearchEvent(F.queryErrorRetry)]}})})}}},L.prototype.logQueryErrorRetry=function(){return this.makeQueryErrorRetry().log()},L.prototype.makeQueryErrorClear=function(){var e=this;return{description:this.makeDescription(F.queryErrorClear),log:function(){return f(e,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,this.logCustomEvent(F.queryErrorClear)];case 1:return e.sent(),[2,this.logSearchEvent(F.queryErrorClear)]}})})}}},L.prototype.logQueryErrorClear=function(){return this.makeQueryErrorClear().log()},L.prototype.makeLikeSmartSnippet=function(){return this.makeCustomEvent(F.likeSmartSnippet)},L.prototype.logLikeSmartSnippet=function(){return this.makeLikeSmartSnippet().log()},L.prototype.makeDislikeSmartSnippet=function(){return this.makeCustomEvent(F.dislikeSmartSnippet)},L.prototype.logDislikeSmartSnippet=function(){return this.makeDislikeSmartSnippet().log()},L.prototype.makeExpandSmartSnippet=function(){return this.makeCustomEvent(F.expandSmartSnippet)},L.prototype.logExpandSmartSnippet=function(){return this.makeExpandSmartSnippet().log()},L.prototype.makeCollapseSmartSnippet=function(){return this.makeCustomEvent(F.collapseSmartSnippet)},L.prototype.logCollapseSmartSnippet=function(){return this.makeCollapseSmartSnippet().log()},L.prototype.makeOpenSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(F.openSmartSnippetFeedbackModal)},L.prototype.logOpenSmartSnippetFeedbackModal=function(){return this.makeOpenSmartSnippetFeedbackModal().log()},L.prototype.makeCloseSmartSnippetFeedbackModal=function(){return this.makeCustomEvent(F.closeSmartSnippetFeedbackModal)},L.prototype.logCloseSmartSnippetFeedbackModal=function(){return this.makeCloseSmartSnippetFeedbackModal().log()},L.prototype.makeSmartSnippetFeedbackReason=function(e,t){return this.makeCustomEvent(F.sendSmartSnippetReason,{reason:e,details:t})},L.prototype.logSmartSnippetFeedbackReason=function(e,t){return this.makeSmartSnippetFeedbackReason(e,t).log()},L.prototype.makeExpandSmartSnippetSuggestion=function(e){return this.makeCustomEvent(F.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},L.prototype.logExpandSmartSnippetSuggestion=function(e){return this.makeExpandSmartSnippetSuggestion(e).log()},L.prototype.makeCollapseSmartSnippetSuggestion=function(e){return this.makeCustomEvent(F.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})},L.prototype.logCollapseSmartSnippetSuggestion=function(e){return this.makeCollapseSmartSnippetSuggestion(e).log()},L.prototype.makeShowMoreSmartSnippetSuggestion=function(e){return this.makeCustomEvent(F.showMoreSmartSnippetSuggestion,e)},L.prototype.logShowMoreSmartSnippetSuggestion=function(e){return this.makeShowMoreSmartSnippetSuggestion(e).log()},L.prototype.makeShowLessSmartSnippetSuggestion=function(e){return this.makeCustomEvent(F.showLessSmartSnippetSuggestion,e)},L.prototype.logShowLessSmartSnippetSuggestion=function(e){return this.makeShowLessSmartSnippetSuggestion(e).log()},L.prototype.makeOpenSmartSnippetSource=function(e,t){return this.makeClickEvent(F.openSmartSnippetSource,e,t)},L.prototype.logOpenSmartSnippetSource=function(e,t){return this.makeOpenSmartSnippetSource(e,t).log()},L.prototype.makeOpenSmartSnippetSuggestionSource=function(e,t){return this.makeClickEvent(F.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},L.prototype.logOpenSmartSnippetSuggestionSource=function(e,t){return this.makeOpenSmartSnippetSuggestionSource(e,t).log()},L.prototype.makeOpenSmartSnippetInlineLink=function(e,t){return this.makeClickEvent(F.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)},L.prototype.logOpenSmartSnippetInlineLink=function(e,t){return this.makeOpenSmartSnippetInlineLink(e,t).log()},L.prototype.makeOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.makeClickEvent(F.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)},L.prototype.logOpenSmartSnippetSuggestionInlineLink=function(e,t){return this.makeOpenSmartSnippetSuggestionInlineLink(e,t).log()},L.prototype.makeRecentQueryClick=function(){return this.makeSearchEvent(F.recentQueryClick)},L.prototype.logRecentQueryClick=function(){return this.makeRecentQueryClick().log()},L.prototype.makeClearRecentQueries=function(){return this.makeCustomEvent(F.clearRecentQueries)},L.prototype.logClearRecentQueries=function(){return this.makeClearRecentQueries().log()},L.prototype.makeRecentResultClick=function(e,t){return this.makeCustomEvent(F.recentResultClick,{info:e,identifier:t})},L.prototype.logRecentResultClick=function(e,t){return this.makeRecentResultClick(e,t).log()},L.prototype.makeClearRecentResults=function(){return this.makeCustomEvent(F.clearRecentResults)},L.prototype.logClearRecentResults=function(){return this.makeClearRecentResults().log()},L.prototype.makeNoResultsBack=function(){return this.makeSearchEvent(F.noResultsBack)},L.prototype.logNoResultsBack=function(){return this.makeNoResultsBack().log()},L.prototype.makeShowMoreFoldedResults=function(e,t){return this.makeClickEvent(F.showMoreFoldedResults,e,t)},L.prototype.logShowMoreFoldedResults=function(e,t){return this.makeShowMoreFoldedResults(e,t).log()},L.prototype.makeShowLessFoldedResults=function(){return this.makeCustomEvent(F.showLessFoldedResults)},L.prototype.logShowLessFoldedResults=function(){return this.makeShowLessFoldedResults().log()},L.prototype.makeCustomEvent=function(r,e,o){var t=this,i=(void 0===o&&(o=Xe[r]),h(h({},this.provider.getBaseMetadata()),e));return{description:this.makeDescription(r,e),log:function(){return f(t,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return n=[{}],[4,this.getBaseCustomEventRequest(i)];case 1:return t=h.apply(void 0,[h.apply(void 0,n.concat([e.sent()])),{eventType:o,eventValue:r}]),[2,this.coveoAnalyticsClient.sendCustomEvent(t)]}})})}}},L.prototype.logCustomEvent=function(e,t,n){return void 0===n&&(n=Xe[e]),this.makeCustomEvent(e,t,n).log()},L.prototype.makeCustomEventWithType=function(r,o,e){var t=this,i=h(h({},this.provider.getBaseMetadata()),e);return{description:{actionCause:r,customData:i},log:function(){return f(t,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return n=[{}],[4,this.getBaseCustomEventRequest(i)];case 1:return t=h.apply(void 0,[h.apply(void 0,n.concat([e.sent()])),{eventType:o,eventValue:r}]),[2,this.coveoAnalyticsClient.sendCustomEvent(t)]}})})}}},L.prototype.logCustomEventWithType=function(e,t,n){return this.makeCustomEventWithType(e,t,n).log()},L.prototype.logSearchEvent=function(r,o){return f(this,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return n=(t=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(r,o)];case 1:return[2,n.apply(t,[e.sent()])]}})})},L.prototype.makeDescription=function(e,t){return{actionCause:e,customData:h(h({},this.provider.getBaseMetadata()),t)}},L.prototype.makeSearchEvent=function(e,t){var n=this;return{description:this.makeDescription(e,t),log:function(){return n.logSearchEvent(e,t)}}},L.prototype.logClickEvent=function(r,o,i,s){return f(this,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return n=[h({},o)],[4,this.getBaseEventRequest(h(h({},i),s))];case 1:return t=h.apply(void 0,[h.apply(void 0,n.concat([e.sent()])),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:r}]),[2,this.coveoAnalyticsClient.sendClickEvent(t)]}})})},L.prototype.makeClickEvent=function(e,t,n,r){var o=this;return{description:this.makeDescription(e,h(h({},n),r)),log:function(){return o.logClickEvent(e,t,n,r)}}},L.prototype.getBaseSearchEventRequest=function(n,r){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return t=[{}],[4,this.getBaseEventRequest(r)];case 1:return[2,h.apply(void 0,[h.apply(void 0,[h.apply(void 0,t.concat([e.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:n}])]}})})},L.prototype.getBaseCustomEventRequest=function(n){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return t=[{}],[4,this.getBaseEventRequest(n)];case 1:return[2,h.apply(void 0,[h.apply(void 0,t.concat([e.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}})})},L.prototype.getBaseEventRequest=function(r){return f(this,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return n=h(h({},this.provider.getBaseMetadata()),r),t=[h(h({},this.getOrigins()),this.getSplitTestRun())],n={customData:n,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,h.apply(void 0,t.concat([(n.clientId=e.sent(),n)]))]}})})},L.prototype.getOrigins=function(){var e,t;return{originContext:null==(t=(e=this.provider).getOriginContext)?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},L.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof k?this.coveoAnalyticsClient.getCurrentVisitorId():void 0},L.prototype.getSplitTestRun=function(){var e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return h(h({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})};var nt,T,rt,ye=L;function L(e,t){this.opts=e,this.provider=t;t=!1===e.enableAnalytics||S();this.coveoAnalyticsClient=t?new Ze:new k(e)}(a=nt=nt||{}).click="click",a.flowStart="flowStart",(l=T=T||{}).enterInterface="ticket_create_start",l.fieldUpdate="ticket_field_update",l.fieldSuggestionClick="ticket_classification_click",l.suggestionClick="suggestion_click",l.suggestionRate="suggestion_rate",l.nextCaseStep="ticket_next_stage",l.caseCancelled="ticket_cancel",l.caseSolved="ticket_cancel",l.caseCreated="ticket_create",(d=rt=rt||{}).quit="Quit",d.solved="Solved";O.prototype.disable=function(){this.coveoAnalyticsClient instanceof k&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new Ze,this.svc=new ze({client:this.coveoAnalyticsClient})},O.prototype.enable=function(){this.coveoAnalyticsClient=new k(this.options),this.svc=new ze({client:this.coveoAnalyticsClient})},O.prototype.logEnterInterface=function(e){return this.svc.setAction(T.enterInterface),this.svc.setTicket(e.ticket),this.sendFlowStartEvent()},O.prototype.logUpdateCaseField=function(e){return this.svc.setAction(T.fieldUpdate,{fieldName:e.fieldName}),this.svc.setTicket(e.ticket),this.sendClickEvent()},O.prototype.logSelectFieldSuggestion=function(e){return this.svc.setAction(T.fieldSuggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},O.prototype.logSelectDocumentSuggestion=function(e){return this.svc.setAction(T.suggestionClick,e.suggestion),this.svc.setTicket(e.ticket),this.sendClickEvent()},O.prototype.logRateDocumentSuggestion=function(e){return this.svc.setAction(T.suggestionRate,h({rate:e.rating},e.suggestion)),this.svc.setTicket(e.ticket),this.sendClickEvent()},O.prototype.logMoveToNextCaseStep=function(e){return this.svc.setAction(T.nextCaseStep,{stage:null==e?void 0:e.stage}),this.svc.setTicket(e.ticket),this.sendClickEvent()},O.prototype.logCaseCancelled=function(e){return this.svc.setAction(T.caseCancelled,{reason:rt.quit}),this.svc.setTicket(e.ticket),this.sendClickEvent()},O.prototype.logCaseSolved=function(e){return this.svc.setAction(T.caseSolved,{reason:rt.solved}),this.svc.setTicket(e.ticket),this.sendClickEvent()},O.prototype.logCaseCreated=function(e){return this.svc.setAction(T.caseCreated),this.svc.setTicket(e.ticket),this.sendClickEvent()},O.prototype.sendFlowStartEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",nt.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)},O.prototype.sendClickEvent=function(){return this.coveoAnalyticsClient.sendEvent("event","svc",nt.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)};a=O;function O(e,t){this.options=e,this.provider=t;t=(null==(t=e.enableAnalytics)||t)&&!S();this.coveoAnalyticsClient=t?new k(e):new Ze,this.svc=new ze({client:this.coveoAnalyticsClient})}function D(e,t){void 0===t&&(t=!0),e.caseContext;var n,r,o=e.caseId,i=e.caseNumber,s=g(e,["caseContext","caseId","caseNumber"]),e=(r={},(n=e).caseContext&&Object.keys(n.caseContext).forEach(function(e){var t=null==(t=n.caseContext)?void 0:t[e];t&&(r["context_"+e]=t)}),r);return h(h(h({CaseId:o,CaseNumber:i},s),!!e.context_Case_Subject&&{CaseSubject:e.context_Case_Subject}),t&&e)}function V(e,t){this.opts=e,this.provider=t;t=!1===e.enableAnalytics||S();this.coveoAnalyticsClient=t?new Ze:new k(e)}V.prototype.disable=function(){this.coveoAnalyticsClient instanceof k&&this.coveoAnalyticsClient.clear(),this.coveoAnalyticsClient=new Ze},V.prototype.enable=function(){this.coveoAnalyticsClient=new k(this.opts)},V.prototype.logInterfaceLoad=function(e){return e?(e=D(e),this.logSearchEvent(F.interfaceLoad,e)):this.logSearchEvent(F.interfaceLoad)},V.prototype.logInterfaceChange=function(e){e=D(e);return this.logSearchEvent(F.interfaceChange,e)},V.prototype.logStaticFilterDeselect=function(e){e=D(e);return this.logSearchEvent(F.staticFilterDeselect,e)},V.prototype.logFetchMoreResults=function(e){return e?(e=D(e),this.logCustomEvent(F.pagerScrolling,h(h({},e),{type:"getMoreResults"}))):this.logCustomEvent(F.pagerScrolling,{type:"getMoreResults"})},V.prototype.logBreadcrumbFacet=function(e){e=D(e);return this.logSearchEvent(F.breadcrumbFacet,e)},V.prototype.logBreadcrumbResetAll=function(e){return e?(e=D(e),this.logSearchEvent(F.breadcrumbResetAll,e)):this.logSearchEvent(F.breadcrumbResetAll)},V.prototype.logFacetSelect=function(e){e=D(e);return this.logSearchEvent(F.facetSelect,e)},V.prototype.logFacetDeselect=function(e){e=D(e);return this.logSearchEvent(F.facetDeselect,e)},V.prototype.logFacetUpdateSort=function(e){e=D(e);return this.logSearchEvent(F.facetUpdateSort,e)},V.prototype.logFacetClearAll=function(e){e=D(e);return this.logSearchEvent(F.facetClearAll,e)},V.prototype.logFacetShowMore=function(e){e=D(e,!1);return this.logCustomEvent(F.facetShowMore,e)},V.prototype.logFacetShowLess=function(e){e=D(e,!1);return this.logCustomEvent(F.facetShowLess,e)},V.prototype.logQueryError=function(e){e=D(e,!1);return this.logCustomEvent(F.queryError,e)},V.prototype.logPagerNumber=function(e){e=D(e,!1);return this.logCustomEvent(F.pagerNumber,e)},V.prototype.logPagerNext=function(e){e=D(e,!1);return this.logCustomEvent(F.pagerNext,e)},V.prototype.logPagerPrevious=function(e){e=D(e,!1);return this.logCustomEvent(F.pagerPrevious,e)},V.prototype.logDidYouMeanAutomatic=function(e){return e?(e=D(e),this.logSearchEvent(F.didyoumeanAutomatic,e)):this.logSearchEvent(F.didyoumeanAutomatic)},V.prototype.logDidYouMeanClick=function(e){return e?(e=D(e),this.logSearchEvent(F.didyoumeanClick,e)):this.logSearchEvent(F.didyoumeanClick)},V.prototype.logResultsSort=function(e){e=D(e);return this.logSearchEvent(F.resultsSort,e)},V.prototype.logSearchboxSubmit=function(e){return e?(e=D(e),this.logSearchEvent(F.searchboxSubmit,e)):this.logSearchEvent(F.searchboxSubmit)},V.prototype.logContextChanged=function(e){e=D(e);return this.logSearchEvent(Ge.contextChanged,e)},V.prototype.logExpandToFullUI=function(e){e=D(e);return this.logCustomEvent(Ge.expandToFullUI,e)},V.prototype.logCustomEvent=function(r,o){return f(this,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return t=h(h({},this.provider.getBaseMetadata()),o),n=[{}],[4,this.getBaseCustomEventRequest(t)];case 1:return t=h.apply(void 0,[h.apply(void 0,n.concat([e.sent()])),{eventType:Xe[r],eventValue:r}]),[2,this.coveoAnalyticsClient.sendCustomEvent(t)]}})})},V.prototype.logSearchEvent=function(r,o){return f(this,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return n=(t=this.coveoAnalyticsClient).sendSearchEvent,[4,this.getBaseSearchEventRequest(r,o)];case 1:return[2,n.apply(t,[e.sent()])]}})})},V.prototype.getBaseCustomEventRequest=function(n){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return t=[{}],[4,this.getBaseEventRequest(n)];case 1:return[2,h.apply(void 0,[h.apply(void 0,t.concat([e.sent()])),{lastSearchQueryUid:this.provider.getSearchUID()}])]}})})},V.prototype.getBaseSearchEventRequest=function(n,r){return f(this,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return t=[{}],[4,this.getBaseEventRequest(r)];case 1:return[2,h.apply(void 0,[h.apply(void 0,[h.apply(void 0,t.concat([e.sent()])),this.provider.getSearchEventRequestPayload()]),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:n}])]}})})},V.prototype.getBaseEventRequest=function(r){return f(this,void 0,void 0,function(){var t,n;return m(this,function(e){switch(e.label){case 0:return n=h(h({},this.provider.getBaseMetadata()),r),t=[h({},this.getOrigins())],n={customData:n,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous()},[4,this.getClientId()];case 1:return[2,h.apply(void 0,t.concat([(n.clientId=e.sent(),n)]))]}})})},V.prototype.getOrigins=function(){var e,t;return{originContext:null==(t=(e=this.provider).getOriginContext)?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}},V.prototype.getClientId=function(){return this.coveoAnalyticsClient instanceof k?this.coveoAnalyticsClient.getCurrentVisitorId():void 0};l=Object.freeze({__proto__:null,analytics:ve,donottrack:ge,history:re,SimpleAnalytics:me,storage:e,CoveoAnalyticsClient:k,CoveoUA:fe,getCurrentClient:$e,handleOneAnalyticsEvent:x,CoveoSearchPageClient:ye,CaseAssistClient:a,CoveoInsightClient:V});window.Promise instanceof Function||console.error('This script uses window.Promise which is not supported in your browser. Consider adding a polyfill like "es6-promise".');window.fetch instanceof Function||console.error('This script uses window.fetch which is not supported in your browser. Consider adding a polyfill like "fetch".');d=self.coveoua||x;return self.coveoua=x,self.coveoanalytics=l,d.q&&c(d.q.filter(function(e){return"init"===e[0]}),d.q.filter(function(e){return"init"!==e[0]})).forEach(function(e){return x.apply(void 0,e)}),self.coveoua}();
2
2
  //# sourceMappingURL=coveoua.browser.js.map