1/*! For license information please see 4110.a58adcc123efba1e9450.site-react.js.LICENSE.txt */ 2"use strict";(self.webpackChunkcommscope_web_application=self.webpackChunkcommscope_web_application||[]).push([[4110],{4110:function(e,t,r){r.r(t);var n=r(4348),i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,u=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=r(781),d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),p=(e,t,r)=>(r=null!=e?i(u(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))!c.call(e,r)&&void 0!==r&&a(e,r,{get:()=>t[r],enumerable:!(n=o(t,r))||n.enumerable});return e})(!t&&e&&e.__esModule?r:a(r,"default",{value:e,enumerable:!0}),e)),h=(e,t,r)=>((e,t,r)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),f=d((e,t)=>{t.exports=fetch}),g=d(e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};e.getSanitizedOptions=function(e){var n=t(t({},r),e);return n.numOfAttempts<1&&(n.numOfAttempts=1),n}}),m=d(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fullJitter=function(e){var t=Math.random()*e;return Math.round(t)}}),y=d(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.noJitter=function(e){return e}}),v=d(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=m(),r=y();e.JitterFactory=function(e){return"full"===e.jitter?t.fullJitter:r.noJitter}}),w=d(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=v(),r=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise(function(t){return setTimeout(t,e.jitteredDelay)})},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return t.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var e=this.options.startingDelay,t=this.options.timeMultiple,r=this.numOfDelayedAttempts,n=e*Math.pow(t,r);return Math.min(n,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();e.Delay=r}),b=d(e=>{var t,r=e&&e.__extends||(t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,r)},function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}),n=e&&e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){e.done?i(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(o,s)}u((n=n.apply(e,t||[])).next())})},i=e&&e.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};
2Object.defineProperty(e,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.apply=function(){return n(this,void 0,void 0,function(){return i(this,function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(w().Delay);e.SkipFirstDelay=a}),S=d(e=>{var t,r=e&&e.__extends||(t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,r)},function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(w().Delay);e.AlwaysDelay=n}),k=d(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=b(),r=S();e.DelayFactory=function(e,n){var i=function(e){return e.delayFirstAttempt?new r.AlwaysDelay(e):new t.SkipFirstDelay(e)}(e);return i.setAttemptNumber(n),i}}),I=d(e=>{var t=e&&e.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){e.done?i(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(o,s)}u((n=n.apply(e,t||[])).next())})},r=e&&e.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var n=g(),i=k();e.backOff=function(e,i){return void 0===i&&(i={}),t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return t=n.getSanitizedOptions(i),[4,new a(e,t).execute()];case 1:return[2,r.sent()]}})})};var a=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return t(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return t(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,i.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}})})},e}()}),C=d((e,t)=>{function r(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2+/".indexOf(e);return t<0?void 0:t}t.exports=function(e){if(0===arguments.length)throw new TypeError("1 argument required, but only 0 present.");if((e=(e=`${e}`).replace(/[ \t\n\f\r]/g,"")).length%4==0&&(e=e.replace(/==?$/,"")),e.length%4==1||/[^+/0-9A-Za-z]/.test(e))return null;let t="",n=0,i=0;for(let a=0;a<e.length;a++)n<<=6,n|=r(e[a]),i+=6,24===i&&(t+=String.fromCharCode((16711680&n)>>16),t+=String.fromCharCode((65280&n)>>8),t+=String.fromCharCode(255&n),n=i=0);return 12===i?(n>>=4,t+=String.fromCharCode(n)):18===i&&(n>>=2,t+=String.fromCharCode((65280&n)>>8),t+=String.fromCharCode(255&n)),t}}),O=d((e,t)=>{function r(e){if(e>=0&&e<64)return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e]}t.exports=function(e){if(0===arguments.length)throw new TypeError("1 argument required, but only 0 present.");let t;for(e=`${e}`,t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return null;let n="";for(t=0;t<e.length;t+=3){let i=[void 0,void 0,void 0,void 0];i[0]=e.charCodeAt(t)>>2,i[1]=(3&e.charCodeAt(t))<<4,e.length>t+1&&(i[1]|=e.charCodeAt(t+1)>>4,i[2]=(15&e.charCodeAt(t+1))<<2),e.length>t+2&&(i[2]|=e.charCodeAt(t+2)>>6,i[3]=63&e.charCodeAt(t+2));for(let e=0;e<i.length;e++)typeof i[e]>"u"?n+="=":n+=r(i[e])}return n}}),A=d((e,t)=>{var r=C(),n=O();t.exports={atob:r,btoa:n}}),E=d((e,t)=>{var r=typeof self<"u"?self:typeof window<"u"?window:void 0;if(!r)throw new Error("Unable to find global scope. Are you sure this is running in the browser?");if(!r.AbortController)throw new Error('Could not find "AbortController" in the global scope. You need to polyfill it first');t.exports.AbortController=r.AbortController}),D=d((e,t)=>{var n,i;n=e,i=function(){var e=6e4,t=36e5,r="millisecond",n="second",i="minute",a="hour",o="day",s="week",u="month",c="quarter",l="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},m=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},y={s:m,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+m(n,2,"0")+":"+m(i,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,u),a=r-i<0,o=t.clone().add(n+(a?-1:1),u);return+(-(n+(r-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:l,w:s,d:o,D:d,h:a,m:i,s:n,ms:r,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",w={};w[v]=g;var b="$isDayjsObject",S=function(e){return e instanceof O||!(!e||!e[b])},k=function e(t,r,n){var i;if(!t)return v;if("string"==typeof t){var a=t.toLowerCase();w[a]&&(i=a),r&&(w[a]=r,i=a);var o=t.split("-");if(!i&&o.length>1)return e(o[0])}else{var s=t.name;w[s]=t,i=s}return!n&&i&&(v=i),i||!n&&v},I=function(e,t){if(S(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new O(r)},C=y;C.l=k,C.i=S,C.w=function(e,t){return I(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function g(e){this.$L=k(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var m=g.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(t)}(e),this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return C},m.isValid=function(){return this.$d.toString()!==p},m.isSame=function(e,t){var r=I(e);return this.startOf(t)<=r&&r<=this.endOf(t)},m.isAfter=function(e,t){return I(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<I(e)},m.$g=function(e,t,r){return C.u(e)?this[t]:this.set(r,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var r=this,c=!!C.u(t)||t,p=C.p(e),h=function(e,t){var n=C.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return c?n:n.endOf(o)},f=function(e,t){return C.w(r.toDate()[e].apply(r.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},g=this.$W,m=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case l:return c?h(1,0):h(31,11);case u:return c?h(1,m):h(0,m+1);case s:var w=this.$locale().weekStart||0,b=(g<w?g+7:g)-w;return h(c?y-b:y+(6-b),m);case o:case d:return f(v+"Hours",0);case a:return f(v+"Minutes",1);case i:return f(v+"Seconds",2);case n:return f(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var s,c=C.p(e),p="set"+(this.$u?"UTC":""),h=(s={},s[o]=p+"Date",s[d]=p+"Date",s[u]=p+"Month",s[l]=p+"FullYear",s[a]=p+"Hours",s[i]=p+"Minutes",s[n]=p+"Seconds",s[r]=p+"Milliseconds",s)[c],f=c===o?this.$D+(t-this.$W):t;if(c===u||c===l){var g=this.clone().set(d,1);g.$d[h](f),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](f);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[C.p(e)]()},m.add=function(r,c){var d,p=this;r=Number(r);var h=C.p(c),f=function(e){var t=I(p);return C.w(t.date(t.date()+Math.round(e*r)),p)};if(h===u)return this.set(u,this.$M+r);if(h===l)return this.set(l,this.$y+r);if(h===o)return f(1);if(h===s)return f(7);var g=(d={},d[i]=e,d[a]=t,d[n]=1e3,d)[h]||1,m=this.$d.getTime()+r*g;return C.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=C.z(this),a=this.$H,o=this.$m,s=this.$M,u=r.weekdays,c=r.months,l=r.meridiem,d=function(e,r,i,a){return e&&(e[r]||e(t,n))||i[r].slice(0,a)},h=function(e){return C.s(a%12||12,e,"0")},g=l||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(f,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return C.s(t.$y,4,"0");case"M":return s+1;case"MM":return C.s(s+1,2,"0");case"MMM":return d(r.monthsShort,s,c,3);case"MMMM":return d(c,s);case"D":return t.$D;case"DD":return C.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(r.weekdaysMin,t.$W,u,2);case"ddd":return d(r.weekdaysShort,t.$W,u,3);case"dddd":return u[t.$W];case"H":return String(a);case"HH":return C.s(a,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return g(a,o,!0);case"A":return g(a,o,!1);case"m":return String(o);case"mm":return C.s(o,2,"0");case"s":return String(t.$s);case"ss":return C.s(t.$s,2,"0");case"SSS":return C.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")})}
vendor: 4,488 bytes, line 2
2,m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,p){var h,f=this,g=C.p(d),m=I(r),y=(m.utcOffset()-this.utcOffset())*e,v=this-m,w=function(){return C.m(f,m)};switch(g){case l:h=w()/12;break;case u:h=w();break;case c:h=w()/3;break;case s:h=(v-y)/6048e5;break;case o:h=(v-y)/864e5;break;case a:h=v/t;break;case i:h=v/e;break;case n:h=v/1e3;break;default:h=v}return p?h:C.a(h)},m.daysInMonth=function(){return this.endOf(u).$D},m.$locale=function(){return w[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=k(e,t,!0);return n&&(r.$L=n),r},m.clone=function(){return C.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},g}(),A=O.prototype;return I.prototype=A,[["$ms",r],["$s",n],["$m",i],["$H",a],["$W",o],["$M",u],["$y",l],["$D",d]].forEach(function(e){A[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),I.extend=function(e,t){return e.$i||(e(t,O,I),e.$i=!0),I},I.locale=k,I.isDayjs=S,I.unix=function(e){return I(1e3*e)},I.en=w[v],I.Ls=w,I.p={},I},"object"==typeof e&&typeof t<"u"?t.exports=i():"function"==typeof define&&r.amdO?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs=i()}),R=d((e,t)=>{var n,i;n=e,i=function(){var e="month",t="quarter";return function(r,n){var i=n.prototype;i.quarter=function(e){return this.$utils().u(e)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(e-1))};var a=i.add;i.add=function(r,n){return r=Number(r),this.$utils().p(n)===t?this.add(3*r,e):a.bind(this)(r,n)};var o=i.startOf;i.startOf=function(r,n){var i=this.$utils(),a=!!i.u(n)||n;if(i.p(r)===t){var s=this.quarter()-1;return a?this.month(3*s).startOf(e).startOf("day"):this.month(3*s+2).endOf(e).endOf("day")}return o.bind(this)(r,n)}}},"object"==typeof e&&typeof t<"u"?t.exports=i():"function"==typeof define&&r.amdO?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_quarterOfYear=i()}),x=d((e,t)=>{var n,i;n=e,i=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,n=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},o=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e||"Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),r=60*t[1]+(+t[2]||0);return 0===r?0:"+"===t[0]?-r:r}(e)}],c=function(e){var t=a[e];return t&&(t.indexOf?t:t.s.concat(t.f))},l=function(e,t){var r,n=a.meridiem;if(n){for(var i=1;i<=24;i+=1)if(e.indexOf(n(i,0,t))>-1){r=i>12;break}}else r=e===(t?"pm":"PM");return r},d={A:[i,function(e){this.afternoon=l(e,!1)}],a:[i,function(e){this.afternoon=l(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[n,s("seconds")],ss:[n,s("seconds")],m:[n,s("minutes")],mm:[n,s("minutes")],H:[n,s("hours")],h:[n,s("hours")],HH:[n,s("hours")],hh:[n,s("hours")],D:[n,s("day")],DD:[r,s("day")],Do:[i,function(e){var t=a.ordinal,r=e.match(/\d+/);if(this.day=r[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],M:[n,s("month")],MM:[r,s("month")],MMM:[i,function(e){var t=c("months"),r=(c("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(r<1)throw new Error;this.month=r%12||r}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[r,function(e){this.year=o(e)}],YYYY:[/\d{4}/,s("year")],Z:u,ZZ:u};return function(r,n,i){i.p.customParseFormat=!0,r&&r.parseTwoDigitYear&&(o=r.parseTwoDigitYear);var s=n.prototype,u=s.parse;s.parse=function(r){var n=r.date,o=r.utc,s=r.args;this.$u=o;var c=s[1];if("string"==typeof c){var l=!0===s[2],p=!0===s[3],h=l||p,f=s[2];p&&(f=s[2]),a=this.$locale(),!l&&f&&(a=i.Ls[f]),this.$d=function(r,n,i){try{if(["x","X"].indexOf(n)>-1)return new Date(("X"===n?1e3:1)*r);var o=function(r){var n,i;n=r,i=a&&a.formats;for(var o=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,r,n){var a=n&&n.toUpperCase();return r||i[n]||e[n]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,r){return t||r.slice(1)})})).match(t),s=o.length,u=0;u<s;
2u+=1){var c=o[u],l=d[c],p=l&&l[0],h=l&&l[1];o[u]=h?{regex:p,parser:h}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},r=0,n=0;r<s;r+=1){var i=o[r];if("string"==typeof i)n+=i.length;else{var a=i.regex,u=i.parser,c=e.slice(n),l=a.exec(c)[0];u.call(t,l),e=e.replace(l,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var r=e.hours;t?r<12&&(e.hours+=12):12===r&&(e.hours=0),delete e.afternoon}}(t),t}}(n)(r),s=o.year,u=o.month,c=o.day,l=o.hours,p=o.minutes,h=o.seconds,f=o.milliseconds,g=o.zone,m=new Date,y=c||(s||u?1:m.getDate()),v=s||m.getFullYear(),w=0;s&&!u||(w=u>0?u-1:m.getMonth());var b=l||0,S=p||0,k=h||0,I=f||0;return g?new Date(Date.UTC(v,w,y,b,S,k,I+60*g.offset*1e3)):i?new Date(Date.UTC(v,w,y,b,S,k,I)):new Date(v,w,y,b,S,k,I)}catch{return new Date("")}}(n,c,o),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),h&&n!=this.format(c)&&(this.$d=new Date("")),a={}}else if(c instanceof Array)for(var g=c.length,m=1;m<=g;m+=1){s[1]=c[m-1];var y=i.apply(this,s);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}m===g&&(this.$d=new Date(""))}else u.call(this,r)}}},"object"==typeof e&&typeof t<"u"?t.exports=i():"function"==typeof define&&r.amdO?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_customParseFormat=i()}),T=d((e,t)=>{var r=/(^|; )Coveo-Pendragon=([^;]*)/;t.exports=()=>r.exec(document.cookie)?.pop()||null}),_=d((e,t)=>{var n,i;n=e,i=function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,i){var a,o=function(e,r,n){void 0===n&&(n={});var i=new Date(e);return function(e,r){void 0===r&&(r={});var n=r.timeZoneName||"short",i=e+"|"+n,a=t[i];return a||(a=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:n}),t[i]=a),a}(r,n).formatToParts(i)},s=function(t,r){for(var n=o(t,r),a=[],s=0;s<n.length;s+=1){var u=n[s],c=u.type,l=u.value,d=e[c];d>=0&&(a[d]=parseInt(l,10))}var p=a[3],h=24===p?0:p,f=a[0]+"-"+a[1]+"-"+a[2]+" "+h+":"+a[4]+":"+a[5]+":000",g=+t;return(i.utc(f).valueOf()-(g-=g%1e3))/6e4},u=n.prototype;u.tz=function(e,t){void 0===e&&(e=a);var r,n=this.utcOffset(),o=this.toDate(),s=o.toLocaleString("en-US",{timeZone:e}),u=Math.round((o-new Date(s))/1e3/60),c=15*-Math.round(o.getTimezoneOffset()/15)-u;if(Number(c)){if(r=i(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(c,!0),t){var l=r.utcOffset();r=r.add(n-l,"minute")}}else r=this.utcOffset(0,t);return r.$x.$timezone=e,r},u.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),r=o(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return r&&r.value};var c=u.startOf;u.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var r=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return c.call(r,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,r){var n=r&&t,o=r||t||a,u=s(+i(),o);if("string"!=typeof e)return i(e).tz(o);var c=function(e,t,r){var n=e-60*t*1e3,i=s(n,r);if(t===i)return[n,t];var a=s(n-=60*(i-t)*1e3,r);return i===a?[n,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(i.utc(e,n).valueOf(),u,o),l=c[0],d=c[1],p=i(l).utcOffset(d);return p.$x.$timezone=o,p},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}},"object"==typeof e&&typeof t<"u"?t.exports=i():"function"==typeof define&&r.amdO?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_timezone=i()}),q=d((e,t)=>{var n,i;n=e,i=function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var r=a(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var u=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else u.call(this)};var c=o.utcOffset;o.utcOffset=function(n,i){var a=this.$utils().u;if(a(n))return this.$u?0:a(this.$offset)?c.call(this):this.$offset;if("string"==typeof n&&null===(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],a=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===a?o:-o}(n)))return this;var o=Math.abs(n)<=16?60*n:n,s=this;if(i)return s.$offset=o,s.$u=0===n,s;if(0!==n){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(o+u,e)).$offset=o,s.$x.$localOffset=u}else s=this.utc();return s};var l=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var p=o.diff;o.diff=function(e,t,r){if(e&&this.$u===e.$u)return p.call(this,e,t,r);var n=this.local(),i=a(e).local();return p.call(n,i,t,r)}}}
2,"object"==typeof e&&typeof t<"u"?t.exports=i():"function"==typeof define&&r.amdO?define(i):(n=typeof globalThis<"u"?globalThis:n||self).dayjs_plugin_utc=i()}),U=d((e,t)=>{function r(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}t.exports=function(e,t,n){var i=n&&n.stringify||r;if("object"==typeof e&&null!==e){var a=t.length+1;if(1===a)return e;var o=new Array(a);o[0]=i(e);for(var s=1;s<a;s++)o[s]=i(t[s]);return o.join(" ")}if("string"!=typeof e)return e;var u=t.length;if(0===u)return e;for(var c="",l=0,d=-1,p=e&&e.length||0,h=0;h<p;){if(37===e.charCodeAt(h)&&h+1<p){switch(d=d>-1?d:0,e.charCodeAt(h+1)){case 100:case 102:if(l>=u||null==t[l])break;d<h&&(c+=e.slice(d,h)),c+=Number(t[l]),d=h+2,h++;break;case 105:if(l>=u||null==t[l])break;d<h&&(c+=e.slice(d,h)),c+=Math.floor(Number(t[l])),d=h+2,h++;break;case 79:case 111:case 106:if(l>=u||void 0===t[l])break;d<h&&(c+=e.slice(d,h));var f=typeof t[l];if("string"===f){c+="'"+t[l]+"'",d=h+2,h++;break}if("function"===f){c+=t[l].name||"<anonymous>",d=h+2,h++;break}c+=i(t[l]),d=h+2,h++;break;case 115:if(l>=u)break;d<h&&(c+=e.slice(d,h)),c+=String(t[l]),d=h+2,h++;break;case 37:d<h&&(c+=e.slice(d,h)),c+="%",d=h+2,h++,l--}++l}++h}return-1===d?e:(d<p&&(c+=e.slice(d)),c)}}),j=d((e,t)=>{var r=U();t.exports=l;var n=function(){function e(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}().console||{},i={mapHttpRequest:m,mapHttpResponse:m,wrapRequestSerializer:y,wrapResponseSerializer:y,wrapErrorSerializer:y,req:m,res:m,err:f,errWithCause:f};function a(e,t){return"silent"===e?1/0:t.levels.values[e]}var o=Symbol("pino.logFuncs"),s=Symbol("pino.hierarchy"),u={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function c(e,t){let r={logger:t,parent:e[s]};t[s]=r}function l(e){(e=e||{}).browser=e.browser||{};let t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");let r=e.browser.write||n;e.browser.write&&(e.browser.asObject=!0);let i=e.serializers||{},s=function(e,t){return Array.isArray(e)?e.filter(function(e){return"!stdSerializers.err"!==e}):!0===e&&Object.keys(t)}(e.browser.serialize,i),f=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(f=!1);let m=Object.keys(e.customLevels||{}),y=["error","fatal","warn","info","debug","trace"].concat(m);"function"==typeof r&&y.forEach(function(e){r[e]=r}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let w=e.level||"info",b=Object.create(r);b.log||(b.log=v),function(e,t,r){let i={};t.forEach(e=>{i[e]=r[e]?r[e]:n[e]||n[u[e]||"log"]||v}),e[o]=i}(b,y,r),c({},b),Object.defineProperty(b,"levelVal",{get:function(){return a(this.level,this)}}),Object.defineProperty(b,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,S,b,"error"),d(this,S,b,"fatal"),d(this,S,b,"warn"),d(this,S,b,"info"),d(this,S,b,"debug"),d(this,S,b,"trace"),m.forEach(e=>{d(this,S,b,e)})}});let S={transmit:t,serialize:s,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:y,timestamp:g(e)};return b.levels=function(e){let t=e.customLevels||{},r=Object.assign({},l.levels.values,t),n=Object.assign({},l.levels.labels,function(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}(t));return{values:r,labels:n}}(e),b.level=w,b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prependOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=v,b.serializers=i,b._serialize=s,b._stdErrSerialize=f,b.child=function(r,n){if(!r)throw new Error("missing bindings for child Pino");n=n||{},s&&r.serializers&&(n.serializers=r.serializers);let a=n.serializers;if(s&&a){var o=Object.assign({},i,a),u=!0===e.browser.serialize?Object.keys(o):s;delete r.serializers,p([r],u,o,this._stdErrSerialize)}function l(e){this._childLevel=1+(0|e._childLevel),this.bindings=r,o&&(this.serializers=o,this._serialize=u),t&&(this._logEvent=h([].concat(e._logEvent.bindings,r)))}l.prototype=this;let d=new l(this);return c(this,d),d.level=this.level,d},t&&(b._logEvent=h()),b}function d(e,t,i,u){if(Object.defineProperty(e,u,{value:a(e.level,i)>a(u,i)?v:i[o][u],writable:!0,enumerable:!0,configurable:!0}),!t.transmit&&e[u]===v)return;e[u]=function(e,t,i,s){return function(o){return function(){let u=t.timestamp(),c=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var d=0;d<c.length;d++)c[d]=arguments[d];if(t.serialize&&!t.asObject&&p(c,this._serialize,this.serializers,this._stdErrSerialize),t.asObject||t.formatters?o.call(l,function(e,t,n,i,a={}){let{level:o=()=>e.levels.values[t],log:s=e=>e}=a;
2e._serialize&&p(n,e._serialize,e.serializers,e._stdErrSerialize);let u=n.slice(),c=u[0],l={};i&&(l.time=i),l.level=o(t,e.levels.values[t]);let d=1+(0|e._childLevel);if(d<1&&(d=1),null!==c&&"object"==typeof c){for(;d--&&"object"==typeof u[0];)Object.assign(l,u.shift());c=u.length?r(u.shift(),u):void 0}else"string"==typeof c&&(c=r(u.shift(),u));return void 0!==c&&(l.msg=c),s(l)}(this,s,c,u,t.formatters)):o.apply(l,c),t.transmit){let r=t.transmit.level||e._level,n=i.levels.values[r],o=i.levels.values[s];if(o<n)return;!function(e,t,r){let n=t.send,i=t.ts,a=t.methodLevel,o=t.methodValue,s=t.val,u=e._logEvent.bindings;p(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(e){return-1===u.indexOf(e)}),e._logEvent.level.label=a,e._logEvent.level.value=o,n(a,e._logEvent,s),e._logEvent=h(u)}(this,{ts:u,methodLevel:s,methodValue:o,transmitLevel:r,transmitValue:i.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:a(e._level,i)},c)}}}(e[o][s])}(e,t,i,u);let c=function(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[s];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==c.length&&(e[u]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(c,e[u]))}function p(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=l.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i]))for(let n in e[i])t&&t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function h(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function f(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function g(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?w:b}function m(){return{}}function y(e){return e}function v(){}function w(){return!1}function b(){return Date.now()}l.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},l.stdSerializers=i,l.stdTimeFunctions=Object.assign({},{nullTime:w,epochTime:b,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),t.exports.default=l,t.exports.pino=l}),M=()=>r.g.crypto,P=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},$=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let e in this.definition){let t=this.definition[e].validate(r[e]);t&&n.push(`${e}: ${t}`)}if(n.length)throw function(e,t){let r=`\n The following properties are invalid:\n\n ${e.join("\n\t")}\n \n ${t}\n `;return new P(r)}(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;void 0!==r&&(e[t]=r)}return e}},F=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&N(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return!0===this.baseConfig.required}};function L(e){return void 0===e}function N(e){return L(e)||function(e){return null===e}(e)}var z=class{constructor(e={}){this.config=e,this.value=new F(e)}validate(e){return this.value.validate(e)||(function(e){return L(e)||Q(e)}(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function Q(e){return"number"==typeof e&&!isNaN(e)}var V=class{constructor(e={}){this.value=new F(e)}validate(e){return this.value.validate(e)||(function(e){return L(e)||B(e)}(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function B(e){return"boolean"==typeof e}var H=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i,Y=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,G=class{constructor(e={}){this.config={emptyAllowed:!0,url:!1,...e},this.value=new F(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:i,ISODate:a}=this.config;return this.value.validate(e)||(L(e)?null:K(e)?t||e.length?r&&!H.test(e)?"value is not a valid URL.":n&&!n.test(e)?`value did n
2ot match provided regex ${n}`:i&&!i.includes(e)?`value should be one of: ${i.join(", ")}.`:!a||Y.test(e)&&"Invalid Date"!==new Date(e).toString()?null:"value is not a valid ISO8601 date string":"value is an empty string.":"value is not a string.")}get default(){return this.value.default}get required(){return this.value.required}};function K(e){return"[object String]"===Object.prototype.toString.call(e)}var W=class{constructor(e={}){this.config={options:{required:!1},values:{},...e}}validate(e){if(L(e))return this.config.options.required?"value is required and is currently undefined":null;if(!J(e))return"value is not an object";for(let[t,r]of Object.entries(this.config.values))if(r.required&&N(e[t]))return`value does not contain ${t}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let i=e[r],a=n.validate(i);null!==a&&(t+=" "+a)}return""===t?null:t}get default(){}get required(){return!!this.config.options.required}};function J(e){return void 0!==e&&"object"==typeof e}var Z=class{constructor(e={}){this.config=e,this.value=new F(this.config)}validate(e){if(!N(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(null!==t)return t;if(N(e))return null;if(void 0!==this.config.max&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(void 0!==this.config.min&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(void 0!==this.config.each){let t="";return e.forEach(r=>{this.config.each.required&&N(r)&&(t=`value is null or undefined: ${e.join(",")}`);let n=this.validatePrimitiveValue(r,this.config.each);null!==n&&(t+=" "+n)}),""===t?null:t}return null}validatePrimitiveValue(e,t){return B(e)||K(e)||Q(e)||J(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}},X=class{constructor(e){this.config=e,this.value=new F(e)}validate(e){let t=this.value.validate(e);return null!==t?t:L(e)||Object.values(this.config.enum).find(t=>t===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}},ee=e=>e;function te(e){let{url:t,accessToken:r,organizationId:n,authentication:i,...a}=e;return a}var re=e=>{let{response:t}=e;return t.body?ne(e):ie(t)},ne=e=>function(e){return void 0!==e.body.exception}(e)?ae(e):function(e){return void 0!==e.body.statusCode}(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},ie=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}},ae=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code}),oe=p(f()),se=p(I()),ue=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}},ce=class extends Error{constructor(e,t){super(),this.name="Disconnected",this.message=`Client could not connect to the following URL: ${e}`,this.statusCode=t??0}};p(A());var le=new Set(["1",1,"yes",!0]);function de(e){if("object"!=typeof e||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function pe(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function he(e){return 429===e}var fe=class e{static async call(t){let r=function(e){let{url:t,method:r,requestParams:n,contentType:i,accessToken:a,signal:o}=e,s="POST"===e.method||"PUT"===e.method,u=function(e,t){return"application/x-www-form-urlencoded"===t?function(e){return!("object"!=typeof e||!e)&&Object.values(e).every(pe)}(e)?function(e){let t=[];for(let r in e){let n=encodeURIComponent(r),i=encodeURIComponent(e[r]);t.push(`${n}=${i}`)}return t.join("&")}(e):"":JSON.stringify(e)}(n,i);return{url:t,method:r,headers:{"Content-Type":i,Authorization:`Bearer ${a}`,...e.headers},...s&&{body:u},signal:o}}(t),{logger:n}=t,i=await e.preprocessRequest(r,t);n.info(i,"Platform request");let{url:a,...o}=i,s=async()=>{let e=await(0,oe.default)(a,o);if(he(e.status))throw e;return e};try{let e=await(0,se.backOff)(s,{retry:e=>{let t=e&&he(e.status);return t&&n.info("Platform retrying request"),t}});switch(e.status){case 419:case 401:throw n.info("Platform renewing token"),new ue;case 404:throw new ce(a,e.status);default:return n.info({response:e,requestInfo:i},"Platform response"),e}}catch(e){return"Failed to fetch"===e.message?new ce(a):e}}static async preprocessRequest(e,t){let{origin:r,preprocessRequest:n,logger:i,requestMetadata:a}=t,{signal:o,...s}=e,u=de(s);try{let t=await n(e,r,a);return{...e,...t}}catch(e){i.error(e,"Platform request preprocessing failed. Returning default request options.")}return u}};function ge(e,t){return`https://${e}${t&&t.environment&&"prod"!==t.environment?t.environment:""}${t&&t.region&&"us"!==t.region?`-${t.region}`:""}.cloud.coveo.com`}function me(e,t="prod"){let r="prod"===t?"":t,n=`https://${e}.org${r}.coveo.com`;return{platform:n,analytics:`https://${e}.analytics.org${r}.coveo.com`,search:`${n}/rest/search/v2`,admin:`https://${e}.admin.org${r}.coveo.com`}}function ye(e){return e?.multiRegionSubDomain?`https://${e.multiRegionSubDomain}.org.coveo.com`:ge("platform",e)}var ve=class{constructor(){this.currentAbortController=null}async enqueue(e,t){let r=this.currentAbortController,n=this.currentAbortController=function(){if(typeof window>"u"){let{AbortController:e}=E();return new e}return typeof AbortController>"u"?null:new AbortController}();r&&(t.warnOnAbort&&t.logger.warn("Cancelling current pending search query"),r.abort());try{return await e(n?.signal??null)}finally{this.currentAbortController===n&&(this.currentAbortController=null)}}},we=class{constructor(e){this._params={},this._basePath=e}addParam(e,t){this._params={...this.params,[e]:t}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join("&")}`:this.basePath}},be=e=>{let t=e.match(/^https:\/\/(?<organizationId>\w+)\.org(?<environment>dev|stg|hipaa)?\.coveo\.com/);return t?.groups?t.groups:null},Se=(e,t,r,n)=>{let i=new we(`${e.url}${n}`);return i.addParam("organizationId",e.organizationId),e.authentication&&i.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:i.href,origin:"searchApiFetch"}};function ke(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Ie(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Ce(e,t){if(t&&"AbortError"===e.name)return{error:Ie(e)};if(e instanceof ce)return{error:ke(e)};throw e}var Oe=class{constructor(e){this.options=e,this.apiCallsQueues={unknown:new ve,mainSearch:new ve,facetValues:new ve,foldingCollection:new ve,instantResults:new ve}}async plan(e){let t=await fe.call({...Se(e,"POST","application/json","/plan"),requestParam
2s:te(e),requestMetadata:{method:"plan"},...this.options});if(t instanceof Error)return Ce(t);let r=await t.json();return void 0!==r.preprocessingOutput?{success:r}:{error:re({response:t,body:r})}}async querySuggest(e){let t=await fe.call({...Se(e,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:te(e),...this.options});if(t instanceof Error)return Ce(t);let r=await t.json(),n={response:t,body:r};return void 0!==r.completions?{success:(await this.options.postprocessQuerySuggestResponseMiddleware(n)).body}:{error:re(n)}}async search(e,t){let r=t?.origin??"unknown",n=await this.apiCallsQueues[r].enqueue(r=>fe.call({...Se(e,"POST","application/json",""),requestParams:te(e),requestMetadata:{method:"search",origin:t?.origin},...this.options,signal:r??void 0}),{logger:this.options.logger,warnOnAbort:!t?.disableAbortWarning});if(n instanceof Error)return Ce(n,t?.disableAbortWarning);let i=await n.json(),a={response:n,body:i};return Ae(i)?(a.body=Ee(i),{success:(await this.options.postprocessSearchResponseMiddleware(a)).body}):{error:re(a)}}async facetSearch(e){let t=await fe.call({...Se(e,"POST","application/json","/facet"),requestParams:te(e),requestMetadata:{method:"facetSearch"},...this.options});if(t instanceof Error)throw t;let r=await t.json(),n={response:t,body:r};return(await this.options.postprocessFacetSearchResponseMiddleware(n)).body}async recommendations(e){let t=await fe.call({...Se(e,"POST","application/json",""),requestParams:te(e),requestMetadata:{method:"recommendations"},...this.options});if(t instanceof Error)throw t;let r=await t.json();if(Ae(r)){let e={response:t,body:r};return e.body=Ee(r),{success:(await this.options.postprocessSearchResponseMiddleware(e)).body}}return{error:re({response:t,body:r})}}async html(e){return(async(e,t)=>{let r=await fe.call({...Se(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:te(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=function(e){return((e.headers.get("content-type")||"").split(";").find(e=>-1!==e.indexOf("charset="))||"").split("=")[1]||"UTF-8"}(r),i=await r.arrayBuffer(),a=new TextDecoder(n).decode(i);return function(e){return"string"==typeof e}(a)?{success:a}:{error:re({response:r,body:a})}})(e,{...this.options})}async productRecommendations(e){let t=await fe.call({...Se(e,"POST","application/json",""),requestParams:te(e),requestMetadata:{method:"productRecommendations"},...this.options});if(t instanceof Error)throw t;let r=await t.json();return Ae(r)?{success:r}:{error:re({response:t,body:r})}}async fieldDescriptions(e){let t=await fe.call({...Se(e,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},...this.options});if(t instanceof Error)throw t;let r=await t.json();return void 0!==r.fields?{success:r}:{error:re({response:t,body:r})}}};function Ae(e){return void 0!==e.results}function Ee(e){let t={answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0};return N(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}var De=e=>e,Re=e=>e,xe=e=>e;function Te(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _e="function"==typeof Symbol&&Symbol.observable||"@@observable",qe=()=>Math.random().toString(36).substring(7).split("").join("."),Ue={INIT:`@@redux/INIT${qe()}`,REPLACE:`@@redux/REPLACE${qe()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${qe()}`};function je(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Me(e,t,r){if("function"!=typeof e)throw new Error(Te(2));if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(Te(0));if("function"==typeof t&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if("function"!=typeof r)throw new Error(Te(1));return r(Me)(e,t)}let n=e,i=t,a=new Map,o=a,s=0,u=!1;function c(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function l(){if(u)throw new Error(Te(3));return i}function d(e){if("function"!=typeof e)throw new Error(Te(4));if(u)throw new Error(Te(5));let t=!0;c();let r=s++;return o.set(r,e),function(){if(t){if(u)throw new Error(Te(6));t=!1,c(),o.delete(r),a=null}}}function p(e){if(!je(e))throw new Error(Te(7));if(typeof e.type>"u")throw new Error(Te(8));if("string"!=typeof e.type)throw new Error(Te(17));if(u)throw new Error(Te(9));try{u=!0,i=n(i,e)}finally{u=!1}
2return(a=o).forEach(e=>{e()}),e}return p({type:Ue.INIT}),{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Te(10));n=e,p({type:Ue.REPLACE})},[_e]:function(){let e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Te(11));function r(){let e=t;e.next&&e.next(l())}return r(),{unsubscribe:e(r)}},[_e](){return this}}}}}function Pe(e){let t=Object.keys(e),r={};for(let n=0;n<t.length;n++){let i=t[n];"function"==typeof e[i]&&(r[i]=e[i])}let n,i=Object.keys(r);try{!function(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ue.INIT})>"u")throw new Error(Te(12));if(typeof r(void 0,{type:Ue.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Te(13))})}(r)}catch(e){n=e}return function(e={},t){if(n)throw n;let a=!1,o={};for(let n=0;n<i.length;n++){let s=i[n],u=r[s],c=e[s],l=u(c,t);if(typeof l>"u")throw new Error(Te(14));o[s]=l,a=a||l!==c}return a=a||i.length!==Object.keys(e).length,a?o:e}}function $e(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...r)=>e(t(...r)))}function Fe(e){return je(e)&&"type"in e&&"string"==typeof e.type}var Le=Symbol.for("immer-nothing"),Ne=Symbol.for("immer-draftable"),ze=Symbol.for("immer-state");function Qe(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ve=Object.getPrototypeOf;function Be(e){return!!e&&!!e[ze]}function He(e){return!!e&&(Ge(e)||Array.isArray(e)||!!e[Ne]||!!e.constructor?.[Ne]||et(e)||tt(e))}var Ye=Object.prototype.constructor.toString();function Ge(e){if(!e||"object"!=typeof e)return!1;let t=Ve(e);if(null===t)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Ye}function Ke(e,t){0===We(e)?Object.entries(e).forEach(([r,n])=>{t(r,n,e)}):e.forEach((r,n)=>t(n,r,e))}function We(e){let t=e[ze];return t?t.type_:Array.isArray(e)?1:et(e)?2:tt(e)?3:0}function Je(e,t){return 2===We(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ze(e,t){return 2===We(e)?e.get(t):e[t]}function Xe(e,t,r){let n=We(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function et(e){return e instanceof Map}function tt(e){return e instanceof Set}function rt(e){return e.copy_||e.base_}function nt(e,t){if(et(e))return new Map(e);if(tt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Ge(e))return Ve(e)?{...e}:Object.assign(Object.create(null),e);let r=Object.getOwnPropertyDescriptors(e);delete r[ze];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){let i=n[t],a=r[i];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Ve(e),r)}function it(e,t=!1){return ot(e)||Be(e)||!He(e)||(We(e)>1&&(e.set=e.add=e.clear=e.delete=at),Object.freeze(e),t&&Ke(e,(e,t)=>it(t,!0))),e}function at(){Qe(2)}function ot(e){return Object.isFrozen(e)}var st,ut={};function ct(e){let t=ut[e];return t||Qe(0),t}function lt(){return st}function dt(e,t){t&&(ct("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function pt(e){ht(e),e.drafts_.forEach(gt),e.drafts_=null}function ht(e){e===st&&(st=e.parent_)}function ft(e){return st=function(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}(st,e)}function gt(e){let t=e[ze];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function mt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return void 0!==e&&e!==r?(r[ze].modified_&&(pt(t),Qe(4)),He(e)&&(e=yt(t,e),t.parent_||wt(t,e)),t.patches_&&ct("Patches").generateReplacementPatches_(r[ze].base_,e,t.patches_,t.inversePatches_)):e=yt(t,r,[]),pt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Le?e:void 0}function yt(e,t,r){if(ot(t))return t;let n=t[ze];if(!n)return Ke(t,(i,a)=>vt(e,n,t,i,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return wt(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let t=n.copy_,i=t,a=!1;3===n.type_&&(i=new Set(t),t.clear(),a=!0),Ke(i,(i,o)=>vt(e,n,t,i,o,r,a)),wt(e,t,!1),r&&e.patches_&&ct("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function vt(e,t,r,n,i,a,o){if(Be(i)){let o=yt(e,i,a&&t&&3!==t.type_&&!Je(t.assigned_,n)?a.concat(n):void 0);if(Xe(r,n,o),!Be(o))return;e.canAutoFreeze_=!1}else o&&r.add(i);
2if(He(i)&&!ot(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;yt(e,i),(!t||!t.scope_.parent_)&&wt(e,i)}}function wt(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&it(t,r)}var bt={get(e,t){if(t===ze)return e;let r=rt(e);if(!Je(r,t))return function(e,t,r){let n=It(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);let n=r[t];return e.finalized_||!He(n)?n:n===kt(e.base_,t)?(Ot(e),e.copy_[t]=At(n,e)):n},has(e,t){return t in rt(e)},ownKeys(e){return Reflect.ownKeys(rt(e))},set(e,t,r){let n=It(rt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=kt(rt(e),t),i=n?.[ze];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(r,n)&&(void 0!==r||Je(e.base_,t)))return!0;Ot(e),Ct(e)}return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return void 0!==kt(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ot(e),Ct(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=rt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty(){Qe(11)},getPrototypeOf(e){return Ve(e.base_)},setPrototypeOf(){Qe(12)}},St={};function kt(e,t){let r=e[ze];return(r?rt(r):e)[t]}function It(e,t){if(!(t in e))return;let r=Ve(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Ve(r)}}function Ct(e){e.modified_||(e.modified_=!0,e.parent_&&Ct(e.parent_))}function Ot(e){e.copy_||(e.copy_=nt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function At(e,t){let r=et(e)?ct("MapSet").proxyMap_(e,t):tt(e)?ct("MapSet").proxySet_(e,t):function(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:lt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,a=bt;r&&(i=[n],a=St);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return n.draft_=s,n.revoke_=o,s}(e,t);return(t?t.scope_:lt()).drafts_.push(r),r}function Et(e){if(!He(e)||ot(e))return e;let t,r=e[ze];if(r){if(!r.modified_)return r.base_;r.finalized_=!0,t=nt(e,r.scope_.immer_.useStrictShallowCopy_)}else t=nt(e,!0);return Ke(t,(e,r)=>{Xe(t,e,Et(r))}),r&&(r.finalized_=!1),t}Ke(bt,(e,t)=>{St[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),St.deleteProperty=function(e,t){return St.set.call(this,e,t,void 0)},St.set=function(e,t,r){return bt.set.call(this,e[0],t,r,e[0])};var Dt=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){let r=t;t=e;let n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}let n;if("function"!=typeof t&&Qe(6),void 0!==r&&"function"!=typeof r&&Qe(7),He(e)){let i=ft(this),a=At(e,void 0),o=!0;try{n=t(a),o=!1}finally{o?pt(i):ht(i)}return dt(i,r),mt(n,i)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===Le&&(n=void 0),this.autoFreeze_&&it(n,!0),r){let t=[],i=[];ct("Patches").generateReplacementPatches_(e,n,t,i),r(t,i)}return n}Qe(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,t=>e(t,...r));let r,n;return[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){He(e)||Qe(8),Be(e)&&(e=function(e){return Be(e)||Qe(10),Et(e)}(e));let t=ft(this),r=At(e,void 0);return r[ze].isManual_=!0,ht(t),r}finishDraft(e,t){let r=e&&e[ze];(!r||!r.isManual_)&&Qe(9);let{scope_:n}=r;return dt(n,t),mt(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));let n=ct("Patches").applyPatches_;return Be(e)?n(e,t):this.produce(e,e=>n(e,t))}},Rt=Dt.produce,xt=Dt.produceWithPatches.bind(Dt);Dt.setAutoFreeze.bind(Dt),Dt.setUseStrictShallowCopy.bind(Dt);var Tt=Dt.applyPatches.bind(Dt);Dt.createDraft.bind(Dt),Dt.finishDraft.bind(Dt);var _t=e=>Array.isArray(e)?e:[e];var qt=typeof WeakRef<"u"?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function Ut(){return{s:0,v:void 0,o:null,p:null}}function jt(e,t={}){let r,n={s:0,v:void 0,o:null,p:null},{resultEqualityCheck:i}=t,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,r=o;e<r;e++){let r=arguments[e];if("function"==typeof r||"object"==typeof r&&null!==r){let e=t.o;null===e&&(t.o=e=new WeakMap);let n=e.get(r);void 0===n?(t=Ut(),e.set(r,t)):t=n}else{let e=t.p;null===e&&(t.p=e=new Map);let n=e.get(r);void 0===n?(t=Ut(),e.set(r,t)):t=n}}let s,u=t;if(1===t.s?s=t.v:(s=e.apply(null,arguments),a++),u.s=1,i){let e=r?.deref?.()??r;null!=e&&i(e,s)&&(s=e,0!==a&&a--),r="object"==typeof s&&null!==s||"function"==typeof s?new qt(s):s}return u.v=s,s}return o.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}var Mt=function(e){let t="function"==typeof e?{memoize:e,memoizeOptions:[]}:e,r=(...e)=>{let r,n=0,i=0,a={},o=e.pop();"object"==typeof o&&(a=o,o=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let s={...t,...a},{memoize:u,memoizeOptions:c=[],argsMemoize:l=jt,argsMemoizeOptions:d=[],devModeChecks:p={}}=s,h=_t(c),f=_t(d),g=function(e){let t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){let r=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${r}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),m=u(function(){return n++,o.apply(null,arguments)},...h),y=l(function(){i++;let e=function(e,t){let r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}(g,arguments);return r=m.apply(null,e),r},...f);
2return Object.assign(y,{resultFunc:o,memoizedResultFunc:m,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>r,recomputations:()=>n,resetRecomputations:()=>{n=0},memoize:u,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}(jt),Pt=Object.assign((e,t=Mt)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);let r=Object.keys(e);return t(r.map(t=>e[t]),(...e)=>e.reduce((e,t,n)=>(e[r[n]]=t,e),{}))},{withTypes:()=>Pt});function $t(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var Ft=$t(),Lt=$t,Nt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?$e:$e.apply(null,arguments)};function zt(e,t){function r(...r){if(t){let n=t(...r);if(!n)throw new Error(Or(0));return{type:e,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:e,payload:r[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>Fe(t)&&t.type===e,r}var Qt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Vt(e){return He(e)?Rt(e,()=>{}):e}function Bt(e,t,r){if(e.has(t)){let n=e.get(t);return r.update&&(n=r.update(n,t,e),e.set(t,n)),n}if(!r.insert)throw new Error(Or(10));let n=r.insert(t,e);return e.set(t,n),n}var Ht="RTK_autoBatch",Yt=()=>e=>({payload:e,meta:{[Ht]:!0}}),Gt=e=>t=>{setTimeout(t,e)},Kt=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Gt(10);function Wt(e){let t,r,n=function(e){let{thunk:t=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:i=!0}=e??{},a=new Qt;return t&&("boolean"==typeof t?a.push(Ft):a.push(Lt(t.extraArgument))),a},{reducer:i,middleware:a,devTools:o=!0,preloadedState:s,enhancers:u}=e||{};if("function"==typeof i)t=i;else{if(!je(i))throw new Error(Or(1));t=Pe(i)}r="function"==typeof a?a(n):n();let c=$e;o&&(c=Nt({trace:!1,..."object"==typeof o&&o}));let l=function(...e){return t=>(r,n)=>{let i=t(r,n),a=()=>{throw new Error(Te(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)},s=e.map(e=>e(o));return a=$e(...s)(i.dispatch),{...i,dispatch:a}}}(...r),d=(e=>function(t){let{autoBatch:r=!0}=t??{},n=new Qt(e);return r&&n.push(((e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,a=!1,o=!1,s=new Set,u="tick"===e.type?queueMicrotask:"raf"===e.type?Kt:"callback"===e.type?e.queueNotification:Gt(e.timeout),c=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},n,{subscribe(e){let t=n.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[Ht],a=!i,a&&(o||(o=!0,u(c))),n.dispatch(e)}finally{i=!0}}})})("object"==typeof r?r:void 0)),n})(l);return Me(t,s,c(..."function"==typeof u?u(d):d()))}function Jt(e){let t,r={},n=[],i={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw new Error(Or(28));if(n in r)throw new Error(Or(29));return r[n]=t,i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return t=e,i}};return e(i),[r,n,t]}function Zt(e,t){let r,[n,i,a]=Jt(t);if(function(e){return"function"==typeof e}(e))r=()=>Vt(e());else{let t=Vt(e);r=()=>t}function o(e=r(),t){let o=[n[t.type],...i.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===o.filter(e=>!!e).length&&(o=[a]),o.reduce((e,r)=>{if(r){if(Be(e)){let n=r(e,t);return void 0===n?e:n}if(He(e))return Rt(e,e=>r(e,t));{let n=r(e,t);if(void 0===n){if(null===e)return e;throw new Error(Or(9))}return n}}return e},e)}return o.getInitialState=r,o}var Xt=(e,t)=>(e=>e&&"function"==typeof e.match)(e)?e.match(t):e(t);function er(...e){return t=>e.some(e=>Xt(e,t))}function tr(...e){return t=>e.every(e=>Xt(e,t))}function rr(e,t){if(!e||!e.meta)return!1;let r="string"==typeof e.meta.requestId,n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function nr(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ir(...e){return 0===e.length?e=>rr(e,["pending"]):nr(e)?er(...e.map(e=>e.pending)):ir()(e[0])}function ar(...e){return 0===e.length?e=>rr(e,["rejected"]):nr(e)?er(...e.map(e=>e.rejected)):ar()(e[0])}function or(...e){return 0===e.length||nr(e)?tr(ar(...e),e=>e&&e.meta&&e.meta.rejectedWithValue):or()(e[0])}function sr(...e){return 0===e.length?e=>rr(e,["fulfilled"]):nr(e)?er(...e.map(e=>e.fulfilled)):sr()(e[0])}function ur(...e){return 0===e.length?e=>rr(e,["pending","fulfilled","rejected"]):nr(e)?er(...e.flatMap(e=>[e.pending,e.rejected,e.fulfilled])):ur()(e[0])}var cr=(e=21)=>{let t="",r=e;for(;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},lr=["name","message","stack","code"],dr=class{constructor(e,t){h(this,"_type"),this.payload=e,this.meta=t}},pr=class{constructor(e,t){h(this,"_type"),this.payload=e,this.meta=t}},hr=e=>{if("object"==typeof e&&null!==e){let t={};
2for(let r of lr)"string"==typeof e[r]&&(t[r]=e[r]);return t}return{message:String(e)}},fr=(()=>{function e(e,t,r){let n=zt(e+"/fulfilled",(e,t,r,n)=>({payload:e,meta:{...n||{},arg:r,requestId:t,requestStatus:"fulfilled"}})),i=zt(e+"/pending",(e,t,r)=>({payload:void 0,meta:{...r||{},arg:t,requestId:e,requestStatus:"pending"}})),a=zt(e+"/rejected",(e,t,n,i,a)=>({payload:i,error:(r&&r.serializeError||hr)(e||"Rejected"),meta:{...a||{},arg:n,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}}));return Object.assign(function(e){return(o,s,u)=>{let c,l,d=r?.idGenerator?r.idGenerator(e):cr(),p=new AbortController;function h(e){l=e,p.abort()}let f=async function(){let f;try{let a=r?.condition?.(e,{getState:s,extra:u});if(function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.then}(a)&&(a=await a),!1===a||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let g=new Promise((e,t)=>{c=()=>{t({name:"AbortError",message:l||"Aborted"})},p.signal.addEventListener("abort",c)});o(i(d,e,r?.getPendingMeta?.({requestId:d,arg:e},{getState:s,extra:u}))),f=await Promise.race([g,Promise.resolve(t(e,{dispatch:o,getState:s,extra:u,requestId:d,signal:p.signal,abort:h,rejectWithValue:(e,t)=>new dr(e,t),fulfillWithValue:(e,t)=>new pr(e,t)})).then(t=>{if(t instanceof dr)throw t;return t instanceof pr?n(t.payload,d,e,t.meta):n(t,d,e)})])}catch(t){f=t instanceof dr?a(null,d,e,t.payload,t.meta):a(t,d,e)}finally{c&&p.signal.removeEventListener("abort",c)}return r&&!r.dispatchConditionRejection&&a.match(f)&&f.meta.condition||o(f),f}();return Object.assign(f,{abort:h,requestId:d,arg:e,unwrap(){return f.then(gr)}})}},{pending:i,rejected:a,fulfilled:n,settled:er(a,n),typePrefix:e})}return e.withTypes=()=>e,e})();function gr(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var mr=Symbol.for("rtk-slice-createasyncthunk");function yr(e,t){return`${e}/${t}`}function vr(e,t,r,n){function i(i,...a){let o=t(i);return typeof o>"u"&&n&&(o=r()),e(o,...a)}return i.unwrapped=e,i}var wr=function({creators:e}={}){let t=e?.asyncThunk?.[mr];return function(e){let{name:r,reducerPath:n=r}=e;if(!r)throw new Error(Or(11));let i=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}},asyncThunk:e}}()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let r="string"==typeof e?e:e.type;if(!r)throw new Error(Or(12));if(r in o.sliceCaseReducersByType)throw new Error(Or(13));return o.sliceCaseReducersByType[r]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};function u(){let[t={},r=[],n]="function"==typeof e.extraReducers?Jt(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Zt(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)})}a.forEach(n=>{let a=i[n],o={reducerName:n,type:yr(r,n),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(a)?function({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(n))throw new Error(Or(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?zt(e,o):zt(e))}(o,a,s):function({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Or(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:u,settled:c,options:l}=r,d=i(e,a,l);n.exposeAction(t,d),o&&n.addCase(d.fulfilled,o),s&&n.addCase(d.pending,s),u&&n.addCase(d.rejected,u),c&&n.addMatcher(d.settled,c),n.exposeCaseReducer(t,{fulfilled:o||br,pending:s||br,rejected:u||br,settled:c||br})}(o,a,s,t)});let c,l=e=>e,d=new Map;function p(e,t){return c||(c=u()),c(e,t)}function h(){return c||(c=u()),c.getInitialState()}function f(t,r=!1){function n(e){let n=e[t];return typeof n>"u"&&r&&(n=h()),n}function i(t=l){let n=Bt(d,r,{insert:()=>new WeakMap});return Bt(n,t,{insert:()=>{let n={};for(let[i,a]of Object.entries(e.selectors??{}))n[i]=vr(a,t,h,r);return n}})}return{reducerPath:t,getSelectors:i,get selectors(){return i(n)},selectSlice:n}}let g={name:r,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:h,...f(n),injectInto(e,{reducerPath:t,...r}={}){let i=t??n;return e.inject({reducerPath:i,reducer:p},r),{...g,...f(i,!0)}}};return g}}();function br(){}var{assign:Sr}=Object,kr="listenerMiddleware",Ir=Sr(zt(`${kr}/add`),{withTypes:()=>Ir});zt(`${kr}/removeAll`);var Cr=Sr(zt(`${kr}/remove`),{withTypes:()=>Cr});function Or(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ar=new G({required:!0,emptyAllowed:!1}),Er=new G({required:!1,emptyAllowed:!1}),Dr=new G({required:!0,emptyAllowed:!0});new G({required:!1,emptyAllowed:!0});var Rr,xr,Tr=new Z({each:Ar,required:!0}),_r=new G({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),qr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ur=(e,t)=>
2{if("required"in t)return{payload:new $({value:t}).validate({value:e}).value};let r=new W({options:{required:!0},values:t}).validate(e);if(r)throw new P(r);return{payload:e}},jr=(e,t)=>{try{return Ur(e,t)}catch(t){return{payload:e,error:qr(t)}}},Mr=(e,t,r,n)=>Pr(e,t,r,`Check the options of ${n}`,"Controller initialization error"),Pr=(e,t,r,n,i)=>{try{return t.validate(r,n)}catch(t){throw e.logger.error(t,i),t}},$r="2.80.7",Fr=()=>Er,Lr=()=>Ar,Nr=zt("configuration/updateBasicConfiguration",e=>jr(e,{accessToken:Er,organizationId:Er,platformUrl:Er})),zr=zt("configuration/updateSearchConfiguration",e=>jr(e,{apiBaseUrl:Er,pipeline:new G({required:!1,emptyAllowed:!0}),searchHub:Er,timezone:Er,locale:Er,authenticationProviders:new Z({required:!1,each:Ar})})),Qr={enabled:new V({default:!0}),originContext:Fr(),originLevel2:Fr(),originLevel3:Fr(),apiBaseUrl:Er,nextApiBaseUrl:Er,runtimeEnvironment:new F,anonymous:new V({default:!1}),deviceId:Er,userDisplayName:Er,documentLocation:Er,trackingId:Er,analyticsMode:new G({constrainTo:["legacy","next"],required:!1,default:"legacy"}),source:new W({options:{required:!1},values:["@coveo/atomic","@coveo/quantic"].reduce((e,t)=>(e[t]=_r,e),{})})},Vr=zt("configuration/updateAnalyticsConfiguration",e=>jr(e,Qr)),Br=zt("configuration/analytics/disable"),Hr=zt("configuration/analytics/enable"),Yr=zt("configuration/analytics/originlevel2",e=>jr(e,{originLevel2:Lr()})),Gr=zt("configuration/analytics/originlevel3",e=>jr(e,{originLevel3:Lr()}));function Kr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function Wr(e,t,r,n){return new(r||(r=Promise))(function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){e.done?i(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(o,s)}u((n=n.apply(e,t||[])).next())})}function Jr(){return typeof window<"u"}function Zr(){return typeof navigator<"u"}function Xr(){return typeof document<"u"}function en(){try{return typeof localStorage<"u"}catch{return!1}}function tn(){return Zr()&&navigator.cookieEnabled}(xr=Rr||(Rr={})).search="search",xr.click="click",xr.custom="custom",xr.view="view",xr.collect="collect";var rn=[Rr.click,Rr.custom,Rr.search,Rr.view],nn=(e,t)=>-1!==rn.indexOf(e)?Object.assign({language:Xr()?document.documentElement.lang:"unknown",userAgent:Zr()?navigator.userAgent:"unknown"},t):t,an=class e{static set(e,t,r){var n,i,a;r&&(n=new Date).setTime(n.getTime()+r),-1===(a=window.location.hostname).indexOf(".")?on(e,t,n):on(e,t,n,(i=a.split("."))[i.length-2]+"."+i[i.length-1])}static get(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){var i=r[n];if(0===(i=i.replace(/^\s+/,"")).lastIndexOf(t,0))return i.substring(t.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function on(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}var sn=class e{getItem(t){return an.get(`${e.prefix}${t}`)}removeItem(t){an.erase(`${e.prefix}${t}`)}setItem(t,r,n){an.set(`${e.prefix}${t}`,r,n)}};sn.prefix="coveo_";var un,cn=class{constructor(){this.cookieStorage=new sn}getItem(e){return localStorage.getItem(e)||this.cookieStorage.getItem(e)}removeItem(e){this.cookieStorage.removeItem(e),localStorage.removeItem(e)}setItem(e,t){localStorage.setItem(e,t),this.cookieStorage.setItem(e,t,31556926e3)}},ln=class{getItem(e){return null}removeItem(e){}setItem(e,t){}},dn="__coveo.analytics.history",pn=class{constructor(e){this.store=e||(en()?localStorage:tn()?new sn:function(){try{return typeof sessionStorage<"u"}catch{return!1}}()?sessionStorage:new ln)}addElement(e){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));let t=this.getHistoryWithInternalTime();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])}addElementAsync(e){return Wr(this,void 0,void 0,function*(){e.internalTime=(new Date).getTime(),e=this.cropQueryElement(this.stripEmptyQuery(e));let t=yield this.getHistoryWithInternalTimeAsync();null!=t?this.isValidEntry(e)&&this.setHistory([e].concat(t)):this.setHistory([e])})}getHistory(){let e=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(e))}getHistoryAsync(){return Wr(this,void 0,void 0,function*(){let e=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(e))})}getHistoryWithInternalTime(){try{let e=this.store.getItem(dn);return e&&"string"==typeof e?JSON.parse(e):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return Wr(this,void 0,void 0,function*(){try{let e=yield this.store.getItem(dn);return e?JSON.parse(e):[]}catch{return[]}})}setHistory(e){try{this.store.setItem(dn,JSON.stringify(e.slice(0,20)))}catch{}}clear(){try{this.store.removeItem(dn)}catch{}}getMostRecentElement(){let e=this.getHistoryWithInternalTime();return Array.isArray(e)?e.sort((e,t)=>
2(t.internalTime||0)-(e.internalTime||0))[0]:null}cropQueryElement(e){return e.name&&e.value&&"query"===e.name.toLowerCase()&&(e.value=e.value.slice(0,75)),e}isValidEntry(e){let t=this.getMostRecentElement();return!t||t.value!=e.value||(e.internalTime||0)-(t.internalTime||0)>6e4}stripInternalTime(e){return Array.isArray(e)?e.map(e=>{let{name:t,time:r,value:n}=e;return{name:t,time:r,value:n}}):[]}stripEmptyQuery(e){let{name:t,time:r,value:n}=e;return t&&"string"==typeof n&&"query"===t.toLowerCase()&&""===n.trim()?{name:t,time:r}:e}stripEmptyQueries(e){return e.map(e=>this.stripEmptyQuery(e))}},hn=Object.freeze({__proto__:null,HistoryStore:pn,MAX_NUMBER_OF_HISTORY_ELEMENTS:20,MAX_VALUE_SIZE:75,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:6e4,STORE_KEY:dn,default:pn}),fn=(e,t)=>Wr(void 0,void 0,void 0,function*(){return e===Rr.view?(yield gn(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),gn=e=>Wr(void 0,void 0,void 0,function*(){let t=new pn,r={name:"PageView",value:e,time:(new Date).toISOString()};yield t.addElementAsync(r)}),mn=new Uint8Array(16);function yn(){if(!un&&!(un=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return un(mn)}var vn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function wn(e){return"string"==typeof e&&vn.test(e)}var bn=[];for(let e=0;e<256;++e)bn.push((e+256).toString(16).slice(1));function Sn(e,t=0){return(bn[e[t+0]]+bn[e[t+1]]+bn[e[t+2]]+bn[e[t+3]]+"-"+bn[e[t+4]]+bn[e[t+5]]+"-"+bn[e[t+6]]+bn[e[t+7]]+"-"+bn[e[t+8]]+bn[e[t+9]]+"-"+bn[e[t+10]]+bn[e[t+11]]+bn[e[t+12]]+bn[e[t+13]]+bn[e[t+14]]+bn[e[t+15]]).toLowerCase()}var kn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function In(e,t,r){if(kn.randomUUID&&!t&&!e)return kn.randomUUID();let n=(e=e||{}).random||(e.rng||yn)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return Sn(n)}function Cn(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function On(e,t){return e<<t|e>>>32-t}var An=function(){function e(e,t,r,n){var i;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof t&&(t=function(e){if(!wn(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}(t)),16!==(null===(i=t)||void 0===i?void 0:i.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+e.length);if(a.set(t),a.set(e,t.length),a=function(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){let t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,i=Math.ceil(n/16),a=new Array(i);for(let t=0;t<i;++t){let r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];a[t]=r}a[i-1][14]=8*(e.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<i;++e){let n=new Uint32Array(80);for(let t=0;t<16;++t)n[t]=a[e][t];for(let e=16;e<80;++e)n[e]=On(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let i=r[0],o=r[1],s=r[2],u=r[3],c=r[4];for(let e=0;e<80;++e){let r=Math.floor(e/20),a=On(i,5)+Cn(r,o,s,u)+c+t[r]+n[e]>>>0;c=u,u=s,s=On(o,30)>>>0,o=i,i=a}r[0]=r[0]+i>>>0,r[1]=r[1]+o>>>0,r[2]=r[2]+s>>>0,r[3]=r[3]+u>>>0,r[4]=r[4]+c>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}(a),a[6]=15&a[6]|80,a[8]=63&a[8]|128,r){n=n||0;for(let e=0;e<16;++e)r[n+e]=a[e];return r}return Sn(a)}try{e.name="v5"}catch{}return e.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",e.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",e}(),En=An,Dn="2.30.38",Rn=class e{constructor(e,t){if(!wn(e))throw Error("Not a valid uuid");this.clientId=e,this.creationDate=Math.floor(t/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(e,t){return!this.expired&&this.matchReferrer(e,t)}matchReferrer(e,t){try{let r=new URL(e);return t.some(e=>new RegExp(e.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(r.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(2!==r.length)return null;let[n,i]=r;if(32!==n.length||isNaN(parseInt(i)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return wn(a)?new e(a,1e3*Number.parseInt(i)):null}};Rn.cvo_cid="cvo_cid",Rn.expirationTime=120;var xn=Object.keys;function Tn(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function _n(e){return 240==(248&e)?4:224==(240&e)?3:192==(224&e)?2:1}var qn={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"},Un=xn(qn).map(e=>qn[e]),jn=[...Un].join("|"),Mn=new RegExp(`^(${jn}$)`),Pn=[e=>
2Mn.test(e)],$n={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Fn={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ln={action:"pa",list:"pal",listSource:"pls"},Nn={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},zn={id:"quoteId",affiliation:"quoteAffiliation"},Qn={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Vn={add:Ln,bookmark_add:Ln,bookmark_remove:Ln,click:Ln,checkout:Ln,checkout_option:Ln,detail:Ln,impression:Ln,remove:Ln,refund:Object.assign(Object.assign({},Ln),Nn),purchase:Object.assign(Object.assign({},Ln),Nn),quickview:Ln,quote:Object.assign(Object.assign({},Ln),zn),review:Object.assign(Object.assign({},Ln),Qn)},Bn=xn($n).map(e=>$n[e]),Hn=xn(Fn).map(e=>Fn[e]),Yn=xn(Ln).map(e=>Ln[e]),Gn=xn(Nn).map(e=>Nn[e]),Kn=xn(Qn).map(e=>Qn[e]),Wn=xn(zn).map(e=>zn[e]),Jn=[...Bn,"custom"].join("|"),Zn=[...Hn,"custom"].join("|"),Xn="(pr[0-9]+)",ei="(il[0-9]+pi[0-9]+)",ti=new RegExp(`^${Xn}(${Jn})$`),ri=new RegExp(`^(${ei}(${Zn}))|(il[0-9]+nm)$`),ni=new RegExp(`^(${Yn.join("|")})$`),ii=new RegExp(`^(${Gn.join("|")})$`),ai=new RegExp(`^${Xn}custom$`),oi=new RegExp(`^${ei}custom$`),si=new RegExp(`^(${["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit",...Kn,...Wn].join("|")})$`),ui=[e=>ri.test(e),e=>ti.test(e),e=>ni.test(e),e=>ii.test(e),e=>si.test(e)],ci=[ai,oi],li=Object.assign(Object.assign(Object.assign(Object.assign({},{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","trackingId"].reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),di=Object.assign(Object.assign({},li),{svcAction:"svc_action",svcActionData:"svc_action_data"}),pi=xn(di).map(e=>di[e]),hi=e=>-1!==pi.indexOf(e),fi=e=>"custom"===e,gi=class{constructor(e){this.opts=e}sendEvent(e,t){return Wr(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:r,preprocessRequest:n}=this.opts,i=yield this.getQueryParamsForEventType(e),{url:a,payload:o}=yield this.preProcessRequestAsPotentialJSONString(`${r}/analytics/${e}?${i}`,t,n),s=this.encodeForEventType(e,o),u=new Blob([s],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(e,t,r){return Wr(this,void 0,void 0,function*(){let n=e,i=t;if(r){let a=yield r({url:e,body:JSON.stringify(t)},"analyticsBeacon"),{url:o,body:s}=a;n=o||e;try{i=JSON.parse(s)}catch(e){console.error("Unable to process the request body as a JSON string",e)}}return{payload:i,url:n}})}encodeForEventType(e,t){return this.isEventTypeLegacy(e)?this.encodeEventToJson(e,t):this.encodeEventToJson(e,t,this.opts.token)}getQueryParamsForEventType(e){return Wr(this,void 0,void 0,function*(){let{token:t,visitorIdProvider:r}=this.opts,n=yield r.getCurrentVisitorId();return[t&&this.isEventTypeLegacy(e)?`access_token=${t}`:"",n?`visitorId=${n}`:"","discardVisitInfo=true"].filter(e=>!!e).join("&")})}isEventTypeLegacy(e){return-1!==[Rr.click,Rr.custom,Rr.search,Rr.view].indexOf(e)}encodeEventToJson(e,t,r){let n=`${e}Event=${encodeURIComponent(JSON.stringify(t))}`;return r&&(n=`access_token=${encodeURIComponent(r)}&${n}`),n}},mi=class{sendEvent(e,t){return Wr(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return Wr(this,void 0,void 0,function*(){return Promise.resolve()})}},yi=class{constructor(e){this.opts=e}sendEvent(e,t){return Wr(this,void 0,void 0,function*(){let r,{baseUrl:n,visitorIdProvider:i,preprocessRequest:a}=this.opts,o=this.shouldAppendVisitorId(e)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${e}${o}
2`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(t)},u=Object.assign(Object.assign({},s),a?yield a(s,"analyticsFetch"):{}),{url:c}=u,l=Kr(u,["url"]);try{r=yield fetch(c,l)}catch(e){return void console.error("An error has occured when sending the event.",e)}if(r.ok){let e=yield r.json();return e.visitorId&&i.setCurrentVisitorId(e.visitorId),e}try{r.json()}catch{}throw console.error(`An error has occured when sending the "${e}" event.`,r,t),new Error(`An error has occurred when sending the "${e}" event. Check the console logs for more details.`)})}deleteHttpCookieVisitorId(){return Wr(this,void 0,void 0,function*(){let{baseUrl:e}=this.opts,t=`${e}/analytics/visit`;yield fetch(t,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(e){return-1!==[Rr.click,Rr.custom,Rr.search,Rr.view].indexOf(e)}getVisitorIdParam(){return Wr(this,void 0,void 0,function*(){let{visitorIdProvider:e}=this.opts,t=yield e.getCurrentVisitorId();return t?`?visitor=${t}`:""})}getHeaders(){let{token:e}=this.opts;return Object.assign(Object.assign({},e?{Authorization:`Bearer ${e}`}:{}),{"Content-Type":"application/json"})}},vi=class{constructor(e,t){en()&&tn()?this.storage=new cn:en()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new ln),this.client=new yi(e),this.beaconClient=new gi(e),window.addEventListener("beforeunload",()=>{let e=t();for(let{eventType:t,payload:r}of e)this.beaconClient.sendEvent(t,r)})}getClientDependingOnEventType(e){return"click"===e&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},wi=class{constructor(e,t){this.storage=t||new ln,this.client=new yi(e)}getClientDependingOnEventType(e){return this.client}},bi=class{constructor(){this.storage=new ln,this.client=new mi}getClientDependingOnEventType(e){return this.client}},Si=["1",1,"yes",!0];function ki(){return Zr()&&[navigator.globalPrivacyControl,navigator.doNotTrack,navigator.msDoNotTrack,window.doNotTrack].some(e=>-1!==Si.indexOf(e))}var Ii,Ci,Oi="https://analytics.cloud.coveo.com/rest/ua",Ai=class{get defaultOptions(){return{endpoint:Oi,isCustomEndpoint:!1,token:"",version:"v15",beforeSendHooks:[],afterSendHooks:[]}}get version(){return Dn}constructor(e){if(this.acceptedLinkReferrers=[],!e)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),e),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[fn,nn].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let t={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};ki()?this.runtime=new bi:this.runtime=this.options.runtimeEnvironment||this.initRuntime(t),this.addEventTypeMapping(Rr.view,{newEventType:Rr.view,addClientIdParameter:!0}),this.addEventTypeMapping(Rr.click,{newEventType:Rr.click,addClientIdParameter:!0}),this.addEventTypeMapping(Rr.custom,{newEventType:Rr.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Rr.search,{newEventType:Rr.search,addClientIdParameter:!0})}initRuntime(e){return Jr()&&Xr()?new vi(e,()=>{let e=[...this.bufferedRequests];return this.bufferedRequests=[],e}):(typeof navigator<"u"&&"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 use the \"coveo.analytics/react-native\" subpackage.\n Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native\n "),new wi(e))}get storage(){return this.runtime.storage}determineVisitorId(){return Wr(this,void 0,void 0,function*(){try{return Jr()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||In()}catch(e){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",e),In()}})}getCurrentVisitorId(){return Wr(this,void 0,void 0,function*(){if(!this.visitorId){let e=yield this.determineVisitorId();yield this.setCurrentVisitorId(e)}return this.visitorId})}setCurrentVisitorId(e){return Wr(this,void 0,void 0,function*(){this.visitorId=e,yield this.storage.setItem("visitorId",e)})}setClientId(e,t){return Wr(this,void 0,void 0,function*(){if(wn(e))this.setCurrentVisitorId(e.toLowerCase());else{if(!t)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(En(e,En(t,"38824e1f-37f5-42d3-8372-a4b8fa9df946")))}})}getParameters(e,...t){return Wr(this,void 0,void 0,function*(){return yield this.resolveParameters(e,...t)})}getPayload(e,...t){return Wr(this,void 0,void 0,function*(){let r=yield this.resolveParameters(e,...t);return yield this.resolvePayloadForParameters(e,r)})}get currentVisitorId(){return"string"!=typeof(this.visitorId||this.storage.getItem("visitorId"))&&this.setCurrentVisitorId(In()),this.visitorId}set currentVisitorId(e){this.visitorId=e,this.storage.setItem("visitorId",e)}extractClientIdFromLink(e){if(ki())return null;try{let t=new URL(e).searchParams.get(Rn.cvo_cid);if(null==t)return null;let r=Rn.fromString(t);return r&&Xr()&&r.validate(document.referrer,this.acceptedLinkReferrers)?r.clientId:null}catch{}return null}resolveParameters(e,...t){return Wr(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:r=[],addVisitorIdParameter:n=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[e]||{};return yield[e=>r.length>0?this.parseVariableArgumentsPayload(r,e):e[0],e=>Wr(this,void 0,void 0,function*(){return Object.assign(Object.assign({},e),{visitorId:n?yield this.getCurrentVisitorId():""})}),e=>Wr(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},e),{clientId:yield this.getCurrentVisitorId()}):e}),e=>i?this.ensureAnonymousUserWhenUsingApiKey(e):e,t=>this.beforeSendHooks.reduce((t,r)=>Wr(this,void 0,void 0,function*(){let n=yield t;return yield r(e,n)}),t)].reduce((e,t)=>
2Wr(this,void 0,void 0,function*(){let r=yield e;return yield t(r)}),Promise.resolve(t))})}resolvePayloadForParameters(e,t){return Wr(this,void 0,void 0,function*(){let{usesMeasurementProtocol:r=!1}=this.eventTypeMapping[e]||{};return yield[e=>this.setTrackingIdIfTrackingIdNotPresent(e),t=>this.removeEmptyPayloadValues(t,e),t=>this.validateParams(t,e),e=>r?(e=>{let t=!!e.action&&Vn[e.action]||{};return xn(e).reduce((r,n)=>{let i=t[n]||di[n]||n;return Object.assign(Object.assign({},r),{[i]:e[n]})},{})})(e):e,e=>r?this.removeUnknownParameters(e):e,e=>r?this.processCustomParameters(e):this.mapCustomParametersToCustomData(e)].reduce((e,t)=>Wr(this,void 0,void 0,function*(){let r=yield e;return yield t(r)}),Promise.resolve(t))})}makeEvent(e,...t){return Wr(this,void 0,void 0,function*(){let{newEventType:r=e}=this.eventTypeMapping[e]||{},n=yield this.resolveParameters(e,...t),i=yield this.resolvePayloadForParameters(e,n);return{eventType:r,payload:i,log:t=>Wr(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:r,payload:Object.assign(Object.assign({},i),t)}),yield Promise.all(this.afterSendHooks.map(r=>r(e,Object.assign(Object.assign({},n),t)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(e,...t){return Wr(this,void 0,void 0,function*(){return(yield this.makeEvent(e,...t)).log({})})}deferExecution(){return new Promise(e=>setTimeout(e,0))}sendFromBuffer(){return Wr(this,void 0,void 0,function*(){let e=this.bufferedRequests.shift();if(e){let{eventType:t,payload:r}=e;return this.runtime.getClientDependingOnEventType(t).sendEvent(t,r)}})}clear(){this.storage.removeItem("visitorId"),(new pn).clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(e){return Wr(this,void 0,void 0,function*(){return this.makeEvent(Rr.search,e)})}sendSearchEvent(e){var{searchQueryUid:t}=e,r=Kr(e,["searchQueryUid"]);return Wr(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(r)).log({searchQueryUid:t})})}makeClickEvent(e){return Wr(this,void 0,void 0,function*(){return this.makeEvent(Rr.click,e)})}sendClickEvent(e){var{searchQueryUid:t}=e,r=Kr(e,["searchQueryUid"]);return Wr(this,void 0,void 0,function*(){return(yield this.makeClickEvent(r)).log({searchQueryUid:t})})}makeCustomEvent(e){return Wr(this,void 0,void 0,function*(){return this.makeEvent(Rr.custom,e)})}sendCustomEvent(e){var{lastSearchQueryUid:t}=e,r=Kr(e,["lastSearchQueryUid"]);return Wr(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(r)).log({lastSearchQueryUid:t})})}makeViewEvent(e){return Wr(this,void 0,void 0,function*(){return this.makeEvent(Rr.view,e)})}sendViewEvent(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeViewEvent(e)).log({})})}getVisit(){return Wr(this,void 0,void 0,function*(){let e=yield(yield fetch(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=e.visitorId,e})}getHealth(){return Wr(this,void 0,void 0,function*(){return yield(yield fetch(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(e){this.beforeSendHooks.push(e)}registerAfterSendEventHook(e){this.afterSendHooks.push(e)}addEventTypeMapping(e,t){this.eventTypeMapping[e]=t}setAcceptedLinkReferrers(e){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw Error("Parameter should be an array of domain strings");this.acceptedLinkReferrers=e}parseVariableArgumentsPayload(e,t){let r={};for(let n=0,i=t.length;n<i;n++){let i=t[n];if("string"==typeof i)r[e[n]]=i;else if("object"==typeof i)return Object.assign(Object.assign({},r),i)}return r}isKeyAllowedEmpty(e,t){return-1!==({[Rr.search]:["queryText"]}[e]||[]).indexOf(t)}removeEmptyPayloadValues(e,t){return Object.keys(e).filter(r=>this.isKeyAllowedEmpty(t,r)||(e=>typeof e<"u"&&null!==e&&""!==e)(e[r])).reduce((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]}),{})}removeUnknownParameters(e){return Object.keys(e).filter(e=>{if((e=>[...ui,...Pn,hi,fi].some(t=>t(e)))(e))return!0;console.log(e,"is not processed by coveoua")}).reduce((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]}),{})}processCustomParameters(e){let{custom:t}=e,r=Kr(e,["custom"]),n={};t&&Tn(t)&&(n=this.lowercaseKeys(t));let i=(e=>xn(e).reduce((t,r)=>{let n=(e=>{let t;return[...ci].every(r=>{var n;return t=null===(n=r.exec(e))||void 0===n?void 0:n[1],!t}),t})(r);return n?Object.assign(Object.assign({},t),((e,t)=>xn(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}))(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}))(r);return Object.assign(Object.assign({},n),i)}mapCustomParametersToCustomData(e){let{custom:t}=e,r=Kr(e,["custom"]);if(t&&Tn(t)){let n=this.lowercaseKeys(t);return Object.assign(Object.assign({},r),{customData:Object.assign(Object.assign({},n),e.customData)})}return e}lowercaseKeys(e){let t=Object.keys(e),r={};return t.forEach(t=>{r[t.toLowerCase()]=e[t]}),r}validateParams(e,t){let{anonymizeIp:r}=e,n=Kr(e,["anonymizeIp"]);return void 0!==r&&-1==["0","false","undefined","null","{}","[]",""].indexOf(`${r}`.toLowerCase())&&(n.anonymizeIp=1),(t==Rr.view||t==Rr.click||t==Rr.search||t==Rr.custom)&&(n.originLevel3=this.limit(n.originLevel3,1024)),t==Rr.view&&(n.location=this.limit(n.location,1024)),("pageview"==t||"event"==t)&&(n.referrer=this.limit(n.referrer,2048),n.location=this.limit(n.location,2048),n.page=this.limit(n.page,2048)),n}ensureAnonymousUserWhenUsingApiKey(e){let{userId:t}=e,r=Kr(e,["userId"]);return(e=>e?.startsWith("xx")||!1)(this.options.token)&&!t?(r.userId="anonymous",r):e}setTrackingIdIfTrackingIdNotPresent(e){let{trackingId:t}=e,r=Kr(e,["trackingId"]);return t?e:(r.hasOwnProperty("custom")&&Tn(r.custom)&&(r.custom.hasOwnProperty("context_website")||r.custom.hasOwnProperty("siteName"))&&(r.trackingId=r.custom.context_website||r.custom.siteName),r.hasOwnProperty("customData")&&Tn(r.customData)&&(r.customData.hasOwnProperty("context_website")||r.customData.hasOwnProperty("siteName"))&&(r.trackingId=r.customData.context_website||r.customData.siteName),r)}limit(e,t){return"string"==typeof e?function(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&"%"==e.charAt(r-3);){let n=Number.parseInt(e.substring(r-2,r),16);
2if(128&~n)break;if(r-=3,128!=(192&n)){t-r>=3*_n(n)&&(r=t);break}}return e.substring(0,r)}(e,t):e}get baseUrl(){return function(e=Oi,t="v15",r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}};!function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"}(Ii||(Ii={})),function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2"}(Ci||(Ci={}));var Ei={[Ci.triggerNotify]:"queryPipelineTriggers",[Ci.triggerExecute]:"queryPipelineTriggers",[Ci.triggerQuery]:"queryPipelineTriggers",[Ci.triggerRedirect]:"queryPipelineTriggers",[Ci.queryError]:"errors",[Ci.queryErrorBack]:"errors",[Ci.queryErrorClear]:"errors",[Ci.queryErrorRetry]:"errors",[Ci.pagerNext]:"getMoreResults",[Ci.pagerPrevious]:"getMoreResults",[Ci.pagerNumber]:"getMoreResults",[Ci.pagerResize]:"getMoreResults",[Ci.pagerScrolling]:"getMoreResults",[Ci.facetSearch]:"facet",[Ci.facetShowLess]:"facet",[Ci.facetShowMore]:"facet",[Ci.recommendation]:"recommendation",[Ci.likeSmartSnippet]:"smartSnippet",[Ci.dislikeSmartSnippet]:"smartSnippet",[Ci.expandSmartSnippet]:"smartSnippet",[Ci.collapseSmartSnippet]:"smartSnippet",[Ci.openSmartSnippetFeedbackModal]:"smartSnippet",[Ci.closeSmartSnippetFeedbackModal]:"smartSnippet",[Ci.sendSmartSnippetReason]:"smartSnippet",[Ci.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[Ci.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[Ci.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[Ci.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[Ci.clearRecentQueries]:"recentQueries",[Ci.recentResultClick]:"recentlyClickedDocuments",[Ci.clearRecentResults]:"recentlyClickedDocuments",[Ci.showLessFoldedResults]:"folding",[Ci.caseDetach]:"case",[Ci.likeGeneratedAnswer]:"generatedAnswer",[Ci.dislikeGeneratedAnswer]:"generatedAnswer",[Ci.openGeneratedAnswerSource]:"generatedAnswer",[Ci.generatedAnswerStreamEnd]:"generatedAnswer",[Ci.generatedAnswerSourceHover]:"generatedAnswer",[Ci.generatedAnswerCopyToClipboard]:"generatedAnswer",[Ci.generatedAnswerHideAnswers]:"generatedAnswer",[Ci.generatedAnswerShowAnswers]:"generatedAnswer",[Ci.generatedAnswerExpand]:"generatedAnswer",[Ci.generatedAnswerCollapse]:"generatedAnswer",[Ci.generatedAnswerFeedbackSubmit]:"generatedAnswer",[Ci.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Ii.expandToFullUI]:"interface",[Ii.openUserActions]:"User Actions",[Ii.showPrecedingSessions]:"User Actions",[Ii.show
2FollowingSessions]:"User Actions",[Ii.clickViewedDocument]:"User Actions",[Ii.clickPageView]:"User Actions",[Ii.createArticle]:"createArticle"},Di=class{constructor(){this.runtime=new bi,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(e){return Promise.resolve({eventType:e,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(Rr.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Rr.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Rr.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Rr.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Dn}};function Ri(e){let t=e.join(";");return t.length<=256?t:Ri(e.slice(1))}var xi=e=>{let t=function(e){return e.map(e=>e.replace(/;/g,""))}(e),r=function(e){let t="";return e.filter(e=>{let r=e!==t;return t=e,r})}(t);return Ri(r)};function Ti(e){let t="string"==typeof e.partialQueries?e.partialQueries:xi(e.partialQueries),r="string"==typeof e.suggestions?e.suggestions:xi(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var _i,qi,Ui,ji=class{constructor(e,t){this.opts=e,this.provider=t;let r=!1===e.enableAnalytics||ki();this.coveoAnalyticsClient=r?new Di:new Ai(e)}disable(){this.coveoAnalyticsClient=new Di}enable(){this.coveoAnalyticsClient=new Ai(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(Ci.interfaceLoad)}logInterfaceLoad(){return Wr(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(Ci.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return Wr(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(Ci.recommendation)}logRecommendation(){return Wr(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(e,t){return this.makeClickEvent(Ci.recommendationOpen,e,t)}logRecommendationOpen(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(e){return this.makeSearchEvent(Ci.staticFilterClearAll,e)}logStaticFilterClearAll(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(e)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(e){return this.makeSearchEvent(Ci.staticFilterSelect,e)}logStaticFilterSelect(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(e)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(e){return this.makeSearchEvent(Ci.staticFilterDeselect,e)}logStaticFilterDeselect(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(e)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(Ci.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return Wr(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(e){return this.makeSearchEvent(Ci.interfaceChange,e)}logInterfaceChange(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(e)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(Ci.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return Wr(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(Ci.didyoumeanClick)}logDidYouMeanClick(){return Wr(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(e){return this.makeSearchEvent(Ci.resultsSort,e)}logResultsSort(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeResultsSort(e)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(Ci.searchboxSubmit)}logSearchboxSubmit(){return Wr(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(Ci.searchboxClear)}logSearchboxClear(){return Wr(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(Ci.searchboxAsYouType)}logSearchboxAsYouType(){return Wr(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(e){return this.makeSearchEvent(Ci.breadcrumbFacet,e)}logBreadcrumbFacet(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(e)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(Ci.breadcrumbResetAll)}logBreadcrumbResetAll(){return Wr(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(e,t){return this.makeClickEvent(Ci.documentQuickview,e,t)}logDocumentQuickview(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(e,t){return this.makeClickEvent(Ci.documentOpen,e,t)}logDocumentOpen(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(e){return this.makeSearchEvent(Ci.omniboxAnalytics,Ti(e))}logOmniboxAnalytics(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(e)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(e){return this.makeSearchEvent(Ci.omniboxFromLink,Ti(e))}logOmniboxFromLink(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(e)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(Ci.searchFromLink)}logSearchFromLink(){return Wr(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(e){return this.makeCustomEvent(Ci.triggerNotify,e)}logTriggerNotify(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(e)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(e){return this.makeCustomEvent(Ci.triggerExecute,e)}logTriggerExecute(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(e)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(Ci.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return Wr(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(e){return this.makeSearchEvent(Ci.undoTriggerQuery,e)}logUndoTriggerQuery(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(e)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(e){return this.makeCustomEvent(Ci.triggerRedirect,Object.assign(Object.assign({},e),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(e){return this.makeCustomEvent(Ci.pagerResize,e)}logPagerResize(e){return Wr(this,void 0,void 0,function*(){return(yield this.makePagerResize(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(e){return this.makeCustomEvent(Ci.pagerNumber,e)}logPagerNumber(e){return Wr(this,void 0,void 0,function*(){return(yield this.makePagerNumber(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(e){return this.makeCustomEvent(Ci.pagerNext,e)}logPagerNext(e){return Wr(this,void 0,void 0,function*(){return(yield this.makePagerNext(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(e){return this.makeCustomEvent(Ci.pagerPrevious,e)}logPagerPrevious(e){return Wr(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(e)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(Ci.pagerScrolling)}logPagerScrolling(){return Wr(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(e){return this.makeSearchEvent(Ci.facetClearAll,e)}logFacetClearAll(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(e){return this.makeSearchEvent(Ci.facetSearch,e)}logFacetSearch(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(e){return this.makeSearchEvent(Ci.facetSelect,e)}logFacetSelect(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(e){return this.makeSearchEvent(Ci.facetDeselect,e)}logFacetDeselect(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(e){return this.makeSearchEvent(Ci.facetExclude,e)}logFacetExclude(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(e){return this.makeSearchEvent(Ci.facetUnexclude,e)}logFacetUnexclude(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(e){return this.makeSearchEvent(Ci.facetSelectAll,e)}logFacetSelectAll(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(e){return this.makeSearchEvent(Ci.facetUpdateSort,e)}
vendor: 11,191 bytes, line 2
2logFacetUpdateSort(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(e){return this.makeCustomEvent(Ci.facetShowMore,e)}logFacetShowMore(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(e)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(e){return this.makeCustomEvent(Ci.facetShowLess,e)}logFacetShowLess(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(e)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(e){return this.makeCustomEvent(Ci.queryError,e)}logQueryError(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeQueryError(e)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return Wr(this,void 0,void 0,function*(){let e=yield this.makeCustomEvent(Ci.queryErrorBack);return{description:e.description,log:()=>Wr(this,void 0,void 0,function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(Ci.queryErrorBack)})}})}logQueryErrorBack(){return Wr(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return Wr(this,void 0,void 0,function*(){let e=yield this.makeCustomEvent(Ci.queryErrorRetry);return{description:e.description,log:()=>Wr(this,void 0,void 0,function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(Ci.queryErrorRetry)})}})}logQueryErrorRetry(){return Wr(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return Wr(this,void 0,void 0,function*(){let e=yield this.makeCustomEvent(Ci.queryErrorClear);return{description:e.description,log:()=>Wr(this,void 0,void 0,function*(){return yield e.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(Ci.queryErrorClear)})}})}logQueryErrorClear(){return Wr(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(Ci.likeSmartSnippet)}logLikeSmartSnippet(){return Wr(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(Ci.dislikeSmartSnippet)}logDislikeSmartSnippet(){return Wr(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(Ci.expandSmartSnippet)}logExpandSmartSnippet(){return Wr(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(Ci.collapseSmartSnippet)}logCollapseSmartSnippet(){return Wr(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(Ci.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return Wr(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(Ci.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return Wr(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(e,t){return this.makeCustomEvent(Ci.sendSmartSnippetReason,{reason:e,details:t})}logSmartSnippetFeedbackReason(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(e){return this.makeCustomEvent(Ci.expandSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})}logExpandSmartSnippetSuggestion(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(e){return this.makeCustomEvent(Ci.collapseSmartSnippetSuggestion,"documentId"in e?e:{documentId:e})}logCollapseSmartSnippetSuggestion(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(e){return this.makeCustomEvent(Ci.showMoreSmartSnippetSuggestion,e)}logShowMoreSmartSnippetSuggestion(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(e){return this.makeCustomEvent(Ci.showLessSmartSnippetSuggestion,e)}logShowLessSmartSnippetSuggestion(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(e)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(e,t){return this.makeClickEvent(Ci.openSmartSnippetSource,e,t)}logOpenSmartSnippetSource(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(e,t){return this.makeClickEvent(Ci.openSmartSnippetSuggestionSource,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)}makeCopyToClipboard(e,t){return this.makeClickEvent(Ci.copyToClipboard,e,t)}logCopyToClipboard(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(e,t)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(e,t){return this.makeClickEvent(Ci.openSmartSnippetInlineLink,e,{contentIDKey:t.contentIDKey,contentIDValue:t.contentIDValue},t)}logOpenSmartSnippetInlineLink(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(e,t){return this.makeClickEvent(Ci.openSmartSnippetSuggestionInlineLink,e,{contentIDKey:t.documentId.contentIdKey,contentIDValue:t.documentId.contentIdValue},t)}logOpenSmartSnippetSuggestionInlineLink(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(Ci.recentQueryClick)}logRecentQueryClick(){return Wr(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(Ci.clearRecentQueries)}logClearRecentQueries(){return Wr(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(e,t){return this.makeCustomEvent(Ci.recentResultClick,{info:e,identifier:t})}logRecentResultClick(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(Ci.clearRecentResults)}logClearRecentResults(){return Wr(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(Ci.noResultsBack)}logNoResultsBack(){return Wr(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(e,t){return this.makeClickEvent(Ci.showMoreFoldedResults,e,t)}logShowMoreFoldedResults(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(Ci.showLessFoldedResults)}logShowLessFoldedResults(){return Wr(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(e,t){var r;return{actionCause:t,customData:null===(r=e.payload)||void 0===r?void 0:r.customData}}makeCustomEvent(e,t,r=Ei[e]){return Wr(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(n)),{eventType:r,eventValue:e}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({lastSearchQueryUid:e})}})}logCustomEvent(e,t,r=Ei[e]){return Wr(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(e,t,r)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(e,t,r){return Wr(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(n)),{eventType:t,eventValue:e}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({lastSearchQueryUid:e})}})}logCustomEventWithType(e,t,r){return Wr(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(e,t,r)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(e,t){return Wr(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(e,t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(e,t){return Wr(this,void 0,void 0,function*(){let r=yield this.getBaseSearchEventRequest(e,t),n=yield this.coveoAnalyticsClient.makeSearchEvent(r);return{description:this.makeEventDescription(n,e),log:({searchUID:e})=>n.log({searchQueryUid:e})}})}makeClickEvent(e,t,r,n){return Wr(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},t),yield this.getBaseEventRequest(Object.assign(Object.assign({},r),n))),{queryPipeline:this.provider.getPipeline(),actionCause:e}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,e),log:({searchUID:e})=>a.log({searchQueryUid:e})}})}logClickEvent(e,t,r,n){return Wr(this,void 0,void 0,function*(){return(yield this.makeClickEvent(e,t,r,n)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(e,t){var r,n;return Wr(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},t),null===(n=(r=this.provider).getGeneratedAnswerMetadata)||void 0===n?void 0:n.call(r)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:e})})}getBaseEventRequest(e){return Wr(this,void 0,void 0,function*(){let t=Object.assign(Object.assign({},this.provider.getBaseMetadata()),e);return Object.assign(Object.assign(Object.assign({}
2,this.getOrigins()),this.getSplitTestRun()),{customData:t,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var e,t;return{originContext:null===(t=(e=this.provider).getOriginContext)||void 0===t?void 0:t.call(e),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Ai?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let e=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",t=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},e&&{splitTestRunName:e}),t&&{splitTestRunVersion:t})}makeLikeGeneratedAnswer(e){return this.makeCustomEvent(Ci.likeGeneratedAnswer,e)}logLikeGeneratedAnswer(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(e){return this.makeCustomEvent(Ci.dislikeGeneratedAnswer,e)}logDislikeGeneratedAnswer(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(e){return this.makeCustomEvent(Ci.openGeneratedAnswerSource,e)}logOpenGeneratedAnswerSource(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(e){return this.makeCustomEvent(Ci.generatedAnswerSourceHover,e)}logGeneratedAnswerSourceHover(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(e){return this.makeCustomEvent(Ci.generatedAnswerCopyToClipboard,e)}logGeneratedAnswerCopyToClipboard(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(e){return this.makeCustomEvent(Ci.generatedAnswerHideAnswers,e)}logGeneratedAnswerHideAnswers(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(e){return this.makeCustomEvent(Ci.generatedAnswerShowAnswers,e)}logGeneratedAnswerShowAnswers(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(e){return this.makeCustomEvent(Ci.generatedAnswerExpand,e)}logGeneratedAnswerExpand(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(e){return this.makeCustomEvent(Ci.generatedAnswerCollapse,e)}logGeneratedAnswerCollapse(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(e){return this.makeCustomEvent(Ci.generatedAnswerFeedbackSubmit,e)}logGeneratedAnswerFeedbackSubmit(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(e)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(e){return this.makeCustomEvent(Ci.generatedAnswerFeedbackSubmitV2,e)}logGeneratedAnswerFeedbackSubmitV2(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(e)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(e){return this.makeSearchEvent(Ci.rephraseGeneratedAnswer,e)}logRephraseGeneratedAnswer(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(e)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(Ci.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return Wr(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(e){return this.makeCustomEvent(Ci.generatedAnswerStreamEnd,e)}logGeneratedAnswerStreamEnd(e){return Wr(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(e)).log({searchUID:this.provider.getSearchUID()})})}},Mi=Object.assign({},{pageview:"pageview",event:"event"});Object.keys(Mi).map(e=>Mi[e]),function(e){e.click="click",e.flowStart="flowStart"}(_i||(_i={})),function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.suggestionClick="suggestion_click",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"}
2(qi||(qi={})),function(e){e.quit="Quit",e.solved="Solved"}(Ui||(Ui={}));var Pi=e=>new Ai(e).getCurrentVisitorId(),$i=new hn.HistoryStore,Fi=(e,t)=>"function"==typeof t?(...r)=>{let n=de(r[0]);try{return t.apply(t,r)}catch(t){return e.error(t,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Li=(e,t)=>(...r)=>{let n=de(r[1]);try{return t.apply(t,r)}catch(t){return e.error(t,"Error in analytics hook. Returning original request."),n}},Ni=["uri","urihash","documentUri","documentUriHash","permanentid","ec_name","ec_brand","ec_category","ec_item_group_id","ec_price","ec_promo_price","ec_shortdesc","ec_thumbnails","ec_images","ec_in_stock","ec_rating","childResults","totalNumberOfChildResults"],zi=class{constructor(e){this.getState=e,this.state=e()}getLanguage(){return(()=>{let e=this.state.configuration.search.locale.split("-")[0];return e&&2===e.length?e:"en"})()}getBaseMetadata(){let{context:e,configuration:t}=this.state,r=e?.contextValues||{},n={};for(let[e,t]of Object.entries(r))n[`context_${e}`]=t;return"legacy"===t.analytics.analyticsMode&&(n.coveoHeadlessVersion=$r),n}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||"default"}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}},Qi=class extends zi{constructor(){super(...arguments),this.initialState={id:"",skus:[],maxNumberOfRecommendations:5,filter:{brand:"",category:""},additionalFields:[],recommendations:[],error:null,isLoading:!1,searchUid:"",duration:0}}getPipeline(){return""}getSearchEventRequestPayload(){return{queryText:"",responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().productRecommendations?.searchUid||this.initialState.searchUid}mapResultsToAnalyticsDocument(){return this.state.productRecommendations?.recommendations.map(e=>({documentUri:e.documentUri,documentUriHash:e.documentUriHash,permanentid:e.permanentid}))}get responseTime(){return this.state.productRecommendations?.duration||this.initialState.duration}get numberOfResults(){return this.state.productRecommendations?.recommendations.length||this.initialState.recommendations.length}},Vi=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var Bi="0.7.10";function Hi(e){return(e.source||[]).concat([`relay@${Bi}`])}function Yi(e,t,r,n){let{getReferrer:i,getLocation:a,getUserAgent:o}=r,s=function(e){let{trackingId:t}=e;return{trackingId:t}}(t),u=n.getClientId();return Object.freeze({type:e,config:s,ts:Date.now(),source:Hi(t),clientId:u,userAgent:o(),referrer:i(),location:a()})}function Gi({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...!!n.mode&&{mode:n.mode},...!!n.source&&{source:n.source}})}var Ki=function(){let e="coveo_";return{getItem(t){let r=`${e}${t}=`,n=document.cookie.split(";");for(let e of n){let t=e.replace(/^\s+/,"");if(0===t.lastIndexOf(r,0))return t.substring(r.length,t.length)}return null},setItem(t,r,n){let i=(()=>{let e=window.location.hostname.split(".").slice(-2);return 2==e.length?e.join("."):""})(),a=`;expires=${new Date((new Date).getTime()+n).toUTCString()}`,o=i?`;domain=${i}`:"";document.cookie=`${e}${t}=${r}${a}${o};path=/;SameSite=Lax`},removeItem(e){this.setItem(e,"",-1)}}}();function Wi(e){return"disabled"!==e.get().mode&&function(){try{return"object"==typeof window}catch{return!1}}()&&function(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name&&localStorage&&0!==localStorage.length}}()?{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(function(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>function(){let e=document.referrer;return""===e?null:e}(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>crypto.randomUUID(),storage:{getItem(e){return Ki.getItem(e)||localStorage.getItem(e)},removeItem(e){Ki.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ki.setItem(e,t,31556952e3)}}}:{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:{getItem(){return null},removeItem(){},setItem(){}}}}function Ji(e){let t=function(e){let t=Gi(e);return{get:()=>t,update:e=>{t=Gi({...t,...e})}}}(e),r=function(){let e=[];function t({type:t,callback:r}){return e.findIndex(e=>e.type===t&&e.callback===r)}function r(r,n){n?function(r){let n=t(r);n>=0&&e.splice(n,1)}({type:r,callback:n}):function(t){if("*"===t)e.length=0;else for(let r=e.length-1;r>=0;r--)e[r].type===t&&e.splice(r,1)}(r)}return{add:function(n){return t(n)<0&&e.push(n),()=>r(n.type,n.callback)}
2,call:function(t){e.forEach(e=>{if(function(e,t){return"*"===e.type||t===e.type}(e,t.meta.type))try{e.callback(t)}catch(e){console.error(e)}})},remove:r}}(),n=function(e){return{get:()=>Object.freeze(Wi(e))}}(t),i=function(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,i=n.getItem(t),a=i&&function(e){return"string"==typeof e&&Vi.test(e)}(i)?i:r.generateUUID();return n.setItem(t,a),a}}}(n);return{emit:(e,a)=>{let o=t.get(),s=n.get(),u=function(e,t,r,n,i){return{...t,meta:Yi(e,r,n,i)}}(e,a,o,s,i);return function({config:e,environment:t,event:r,listenerManager:n}){let{url:i,token:a,mode:o}=e;"disabled"!==o&&(n.call(r),t.send(i,a,r))}({config:o,environment:s,event:u,listenerManager:r})},getMeta:e=>Yi(e,t.get(),n.get(),i),on:(e,t)=>r.add({type:e,callback:t}),off:(e,t)=>r.remove(e,t),updateConfig:e=>t.update(e),version:Bi}}var Zi=Mt(e=>e.source,e=>Object.entries(e).map(([e,t])=>`${e}@${t}`).concat(`@coveo/headless@${$r}`)),Xi=Mt(e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Zi(e.configuration.analytics),(e,{trackingId:t,nextApiBaseUrl:r,enabled:n},i)=>Ji({mode:n?"emit":"disabled",url:r,token:e,trackingId:t,source:i}));var ea,ta,ra=(e,t)=>{let r=((e,t)=>e.categoryFacetSet[t]?.request)(e,t);return function(e){let{activeValue:t,ancestryMap:r}=function(e){let t=[...e],r=new Map;for(;t.length>0;){let e=t.shift();if("selected"===e.state)return{activeValue:e,ancestryMap:r};if(r)for(let t of e.children)r.set(t,e);t.unshift(...e.children)}return{}}(e);return t?function(e,t){let r=[];if(!e)return[];let n=e;do{r.unshift(n),n=t.get(n)}while(n);return r}(t,r):[]}(r?.currentValues??[])},na=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),ia=e=>({displayValue:e.value,value:e.value}),aa=(e,t)=>{let r=((e,t)=>ra(e,t).map(e=>e.value).join(";"))(e,t);return{value:r,valuePosition:1,displayValue:r}},oa=(e,t)=>`${e}_${t}`,sa=((ta=sa||{}).Ascending="ascending",ta.Descending="descending",ta),ua=((ea=ua||{}).Relevancy="relevancy",ea.QRE="qre",ea.Date="date",ea.Field="field",ea.NoSort="nosort",ea),ca=e=>{if(function(e){return Array.isArray(e)}(e))return e.map(e=>ca(e)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}};new W({values:{by:new X({enum:ua,required:!0}),order:new X({enum:sa}),field:new G}});var la=class e extends zi{constructor(){super(...arguments),this.getFacetRequest=e=>this.state.facetSet?.[e]?.request||this.state.categoryFacetSet?.[e]?.request||this.state.dateFacetSet?.[e]?.request||this.state.numericFacetSet?.[e]?.request||this.state.automaticFacetSet?.set[e]?.response}getFacetState(){return(e=>{let t=[];return(e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(e=>e.request))(e).forEach((r,n)=>{let i=((e,t)=>{let r=((e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response)(e,t);return r?r.type:"specific"})(e,r.facetId),a=((e,t)=>({title:oa(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}))(r,n+1);if((e=>"hierarchical"===e.type)(r)){if(!ra(e,r.facetId).length)return;t.push({...a,...aa(e,r.facetId),facetType:i,state:"selected"})}else r.currentValues.forEach((e,n)=>{if("idle"===e.state)return;let o=na(e,n+1,i),s=(e=>"specific"===e.type)(r)?ia(e):(e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}))(e);t.push({...a,...o,...s})})}),(e=>[...Object.values(e.automaticFacetSet.set)].map(e=>e.response))(e).forEach((e,r)=>{let n=((e,t)=>({title:oa(e.field,e.field),field:e.field,id:e.field,facetPosition:t}))(e,r+1);e.values.forEach((e,r)=>{if("idle"===e.state)return;let i=na(e,r+1,"specific"),a=ia(e);t.push({...n,...i,...a})})}),t})(function(e){return{facetSet:e.facetSet??{},categoryFacetSet:e.categoryFacetSet??{},dateFacetSet:e.dateFacetSet??{},numericFacetSet:e.numericFacetSet??{},automaticFacetSet:e.automaticFacetSet??{desiredCount:5,numberOfValues:8,set:{}}}}(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||e.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let e=this.getState();return e.search?.searchResponseId||e.search?.response.searchUid||""}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.search?.response.pipeline||this.state.pipeline||e.fallbackPipelineName;return t?r:void 0}getBaseMetadata(){let e=this.getState(),t=super.getBaseMetadata(),r=e.search?.response?.extendedResults?.generativeQuestionAnsweringId;return r&&(t.generativeQuestionAnsweringId=r),t}
2getFacetMetadata(e,t){let r=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:r,facetValue:t,facetTitle:`${r}_${e}`}}getFacetClearAllMetadata(e){let t=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:t,facetTitle:`${t}_${e}`}}getFacetUpdateSortMetadata(e,t){let r=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:r,criteria:t,facetTitle:`${r}_${e}`}}getRangeBreadcrumbFacetMetadata(e,t){let r=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),facetId:e,facetField:r,facetRangeEnd:t.end,facetRangeEndInclusive:t.endInclusive,facetRangeStart:t.start,facetTitle:`${r}_${e}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??ca({by:"relevancy"})}}getStaticFilterToggleMetadata(e,t){return{...this.getBaseMetadata(),staticFilterId:e,staticFilterValue:t}}getStaticFilterClearAllMetadata(e){return{...this.getBaseMetadata(),staticFilterId:e}}getUndoTriggerQueryMetadata(e){return{...this.getBaseMetadata(),undoneQuery:e}}getCategoryBreadcrumbFacetMetadata(e,t){let r=this.getFacetRequest(e)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:e,categoryFacetField:r,categoryFacetPath:t,categoryFacetTitle:`${r}_${e}`}}getOmniboxAnalyticsMetadata(e,t){let r=this.state.querySuggest&&this.state.querySuggest[e],n=r.completions.map(e=>e.expression),i=r.partialQueries.length-1,a=r.partialQueries[i]||"",o=r.responseId;return{...this.getBaseMetadata(),suggestionRanking:n.indexOf(t),partialQuery:a,partialQueries:r.partialQueries.length>0?r.partialQueries:"",suggestions:n.length>0?n:"",querySuggestResponseId:o}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(e){return{...this.getBaseMetadata(),...e}}getGeneratedAnswerMetadata(){let e=this.getState(),t={};return void 0!==e.generatedAnswer?.isVisible&&(t.showGeneratedAnswer=e.generatedAnswer.isVisible),t}get resultURIs(){return this.results?.map(e=>({documentUri:e.uri,documentUriHash:e.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||""}get responseTime(){return this.state.search?.duration||0}get numberOfResults(){return this.state.search?.response.totalCountFiltered||0}};la.fallbackPipelineName="default";var da=la;var pa=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:i,analyticsConfigurator:a,providerClass:o})=>(r??(r=e=>new o(e)),function(e,t){let r=t=>function(e){return Object.assign(e,{instantlyCallable:!0})}(fr(e,t)),n=r(async(e,{getState:r,extra:n})=>{let{analyticsClientMiddleware:i,preprocessRequest:a,logger:o}=n;return await(await t({getState:r,analyticsClientMiddleware:i,preprocessRequest:a,logger:o})).log({state:r(),extra:n})});return Object.assign(n,{prepare:async({getState:e,analyticsClientMiddleware:n,preprocessRequest:i,logger:a})=>{let{description:o,log:s}=await t({getState:e,analyticsClientMiddleware:n,preprocessRequest:i,logger:a});return{description:o,action:r(async(e,{getState:t,extra:r})=>await s({state:t(),extra:r}))}}}),n}(e,async({getState:e,analyticsClientMiddleware:o,preprocessRequest:s,logger:u})=>{let c=[],l={log:async({state:e})=>{for(let t of c)await t(e)}},d=e(),p=a({getState:e,logger:u,analyticsClientMiddleware:o,preprocessRequest:s,provider:r(e)}),h=await t(p,e());l.description=h?.description,c.push(async e=>{(e=>"legacy"===e.configuration.analytics.analyticsMode)(e)&&await async function(e,t,r,n,i){t(()=>r);let a=await(e?.log({searchUID:t(()=>r).getSearchUID()}));n.info({client:i,response:a},"Analytics response")}(h,r,e,u,p.coveoAnalyticsClient)});let{emit:f}=Xi(d);return c.push(async e=>{if((e=>"next"===e.configuration.analytics.analyticsMode)(e)&&i&&n){let t=n(e);await async function(e,t,r){await e(t,r)}(f,i,t)}}),l})),ha=((e,t,r)=>function(...t){let n=1===t.length?{...t[0],__legacy__getBuilder:t[0].__legacy__getBuilder,analyticsConfigurator:e,providerClass:r}:{prefix:t[0],__legacy__getBuilder:t[1],__legacy__provider:t[2],analyticsConfigurator:e,providerClass:r};return pa(n)})(({logger:e,getState:t,analyticsClientMiddleware:r=(e,t)=>
2t,preprocessRequest:n,provider:i=new da(t)})=>{let a=t(),o=a.configuration.accessToken,s=a.configuration.analytics.apiBaseUrl,u=a.configuration.analytics.runtimeEnvironment,c=a.configuration.analytics.enabled,l=new ji({token:o,endpoint:s,runtimeEnvironment:u,preprocessRequest:Fi(e,n),beforeSendHooks:[Li(e,r),(t,r)=>(e.info({...r,type:t,endpoint:s,token:o},"Analytics request"),r)]},i);return c||l.disable(),l},0,da),fa={urihash:new G,sourcetype:new G,permanentid:new G};new W({values:fa}),new G({required:!1,emptyAllowed:!0});var ga=zt("productrecommendations/setId",e=>jr(e,{id:Ar})),ma=zt("productrecommendations/setSku",e=>jr(e,{skus:new Z({required:!0,min:1,each:Er})})),ya=zt("productrecommendations/setBrand",e=>jr(e,{brand:new G({required:!0,emptyAllowed:!0})})),va=zt("productrecommendations/setCategory",e=>jr(e,{category:new G({required:!0,emptyAllowed:!0})})),wa=zt("productrecommendations/setAdditionalFields",e=>jr(e,{additionalFields:new Z({required:!0,each:Er})})),ba=zt("productrecommendations/setMaxNumberOfRecommendations",e=>jr(e,{number:new z({required:!0,max:50,min:1})})),Sa=fr("productRecommendations/get",async(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}})=>{let i=t(),a=(new Date).getTime(),o=await n.productRecommendations(await Ia(i)),s=(new Date).getTime()-a;if((e=>void 0!==e.error)(o))return r(o.error);let u=i.productRecommendations.additionalFields||[];return{recommendations:o.success.results.map(e=>ka(e,{additionalFields:u})),analyticsAction:ha("analytics/productRecommendations/load",e=>e.makeRecommendationInterfaceLoad(),e=>new Qi(e)),searchUid:o.success.searchUid,duration:s}}),ka=(e,{additionalFields:t})=>{let r=e.raw.ec_price,n=e.raw.ec_promo_price,i=e.raw.ec_in_stock,a={documentUri:e.uri,documentUriHash:e.raw.urihash,permanentid:e.raw.permanentid,clickUri:e.clickUri,ec_name:e.raw.ec_name,ec_brand:e.raw.ec_brand,ec_category:e.raw.ec_category,ec_item_group_id:e.raw.ec_item_group_id,ec_price:r,ec_shortdesc:e.raw.ec_shortdesc,ec_thumbnails:e.raw.ec_thumbnails,ec_images:e.raw.ec_images,ec_promo_price:void 0===n||void 0!==r&&n>=r?void 0:n,ec_in_stock:void 0===i?void 0:"yes"===i.toLowerCase()||"true"===i.toLowerCase(),ec_rating:e.raw.ec_rating,additionalFields:t.reduce((t,r)=>({...t,[r]:e.raw[r]}),{}),childResults:[],totalNumberOfChildResults:0};return function(e){return e&&"childResults"in e&&"totalNumberOfChildResults"in e}(e)&&(a.childResults=e.childResults.map(e=>ka(e,{additionalFields:t})),a.totalNumberOfChildResults=e.totalNumberOfChildResults),a},Ia=async e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl,locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,...e.configuration.analytics.enabled&&{visitorId:await Pi(e.configuration.analytics)},recommendation:e.productRecommendations.id,numberOfResults:e.productRecommendations.maxNumberOfRecommendations,fieldsToInclude:[...Ni,...e.productRecommendations.additionalFields||[]],mlParameters:{...e.productRecommendations.skus&&e.productRecommendations.skus.length>0&&{itemIds:e.productRecommendations.skus},...e.productRecommendations.filter.brand&&{brandFilter:e.productRecommendations.filter.brand},...e.productRecommendations.filter.category&&{categoryFilter:e.productRecommendations.filter.category}},actionsHistory:e.configuration.analytics.enabled?$i.getHistory():[],...e.context&&{context:e.context.contextValues},...e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues},...e.searchHub&&{searchHub:e.searchHub}}),Ca=Zt({id:"",skus:[],maxNumberOfRecommendations:5,filter:{brand:"",category:""},additionalFields:[],recommendations:[],error:null,isLoading:!1,searchUid:"",duration:0},e=>{e.addCase(ga,(e,t)=>{e.id=t.payload.id}).addCase(ma,(e,t)=>{e.skus=t.payload.skus}).addCase(ya,(e,t)=>{e.filter.brand=t.payload.brand}).addCase(va,(e,t)=>{e.filter.category=t.payload.category}).addCase(ba,(e,t)=>{e.maxNumberOfRecommendations=t.payload.number}).addCase(wa,(e,t)=>{e.additionalFields=t.payload.additionalFields}).addCase(Sa.rejected,(e,t)=>{e.error=t.payload?t.payload:null,e.isLoading=!1}).addCase(Sa.fulfilled,(e,t)=>{e.error=null,e.searchUid=t.payload.searchUid,e.recommendations=t.payload.recommendations,e.isLoading=!1}).addCase(Sa.pending,e=>{e.isLoading=!0})}),Oa=zt("searchHub/set",e=>jr(e,new G({required:!0,emptyAllowed:!0}))),Aa=zt("history/undo"),Ea=zt("history/redo");zt("history/snapshot"),fr("history/back",async(e,{dispatch:t})=>{t(Aa()),await t(Da())}),fr("history/forward",async(e,{dispatch:t})=>{t(Ea()),await t(Da())});var Da=fr("history/change",async(e,{getState:t})=>t().history.present),Ra=Zt("default",e=>{e.addCase(Oa,(e,t)=>t.payload).addCase(Da.fulfilled,(e,t)=>t.payload?.searchHub??e).addCase(zr,(e,t)=>t.payload.searchHub||e)});var xa="text/event-stream",Ta="last-event-id";function _a(e,t){var{signal:r,headers:n,onopen:i,onmessage:a,onclose:o,onerror:s,openWhenHidden:u,fetch:c}=t,l=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((t,u)=>{let d,p=Object.assign({},n);p.accept||(p.accept=xa);let h=1e3,f=0;function g(){clearTimeout(f),d?.abort()}r?.addEventListener("abort",()=>{g(),t()});let m=c??m,y=i??qa;!async function r(){var n;d=typeof AbortController>"u"?null:new AbortController;try{let r=await m(e,Object.assign(Object.assign({},l),{headers:p,signal:d?.signal}));await y(r),await async function(e,t){let r,n=e.getReader();for(;!(r=await n.read()).done;)t(r.value)}(r.body,function(e){let t,r,n,i=!1;return function(a){void 0===t?(t=a,r=0,n=-1):t=function(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(t,a);let o=t.length,s=0;for(;r<o;){i&&(10===t[r]&&(s=++r),i=!1);let a=-1;for(;r<o&&-1===a;++r)switch(t[r]){case 58:-1===n&&(n=r-s);break;case 13:i=!0;case 10:a=r}if(-1===a)break;e(t.subarray(s,a),n),s=r,n=-1}
2s===o?t=void 0:0!==s&&(t=t.subarray(s),r-=s)}}(function(e,t,r){let n={data:"",event:"",id:"",retry:void 0},i=new TextDecoder;return function(e,t){if(0===e.length)r?.(n),n={data:"",event:"",id:"",retry:void 0};else if(t>0){let r=i.decode(e.subarray(0,t)),o=t+(32===e[t+1]?2:1),s=i.decode(e.subarray(o));switch(r){case"data":n.data=n.data?n.data+"\n"+s:s;break;case"event":n.event=s;break;case"id":(a=n.id=s)?p[Ta]=a:delete p[Ta];break;case"retry":let e=parseInt(s,10);isNaN(e)||(e=>{h=e})(n.retry=e)}}var a}}(0,0,a))),o?.(),g(),t()}catch(e){if(!d?.signal.aborted)try{let t=null!==(n=s?.(e))&&void 0!==n?n:h;clearTimeout(f),f=setTimeout(r,t)}catch(e){g(),u(e)}}}()})}function qa(e){let t=e.headers.get("content-type");if(!t?.startsWith(xa))throw new Error(`Expected content-type to be ${xa}, Actual: ${t}`)}var Ua=Mt(e=>e.query,e=>e);Mt(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(e=>e.id===t)),Mt(e=>Ua(e)?.q,e=>e.search.requestId,(e,t)=>({q:e,requestId:t}));var ja=e=>ha("analytics/generatedAnswer/streamEnd",(t,r)=>{let{id:n,answerAPIEnabled:i}=(e=>(e=>"answer"in e&&"generatedAnswer"in e&&!N(e.generatedAnswer?.answerConfigurationId))(e)?{answerAPIEnabled:!0,id:ds(e).data?.answerId}:(e=>"search"in e)(e)?{answerAPIEnabled:!1,id:e.search.response.extendedResults.generativeQuestionAnsweringId}:{answerAPIEnabled:!1,id:void 0})(r),a=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({...i?{answerAPIStreamId:n}:{generativeQuestionAnsweringId:n},answerGenerated:e,answerTextIsEmpty:a}):null}),Ma=["default","bullet","step","concise"],Pa=new G({required:!0}),$a=new G,Fa=new V({required:!0}),La={id:Pa,title:Pa,uri:Pa,permanentid:Pa,clickUri:$a},Na=new G({required:!0,constrainTo:["text/plain","text/markdown"]});zt("generatedAnswer/setIsVisible",e=>jr(e,Fa));var za=zt("generatedAnswer/updateMessage",e=>jr(e,{textDelta:Pa})),Qa=zt("generatedAnswer/updateCitations",e=>jr(e,{citations:new Z({required:!0,each:new W({values:La})})})),Va=zt("generatedAnswer/updateError",e=>jr(e,{message:$a,code:new z({min:0})})),Ba=zt("generatedAnswer/resetAnswer");zt("generatedAnswer/like"),zt("generatedAnswer/dislike"),zt("generatedAnswer/feedbackModal/open"),zt("generatedAnswer/expand"),zt("generatedAnswer/collapse"),zt("generatedAnswer/setId",e=>jr(e,{id:new G({required:!0})})),zt("generatedAnswer/feedbackModal/close"),zt("generatedAnswer/sendFeedback");var Ha=zt("generatedAnswer/setIsLoading",e=>jr(e,Fa)),Ya=zt("generatedAnswer/setIsStreaming",e=>jr(e,Fa)),Ga=zt("generatedAnswer/setAnswerContentFormat",e=>jr(e,Na));zt("generatedAnswer/updateResponseFormat",e=>jr(e,{answerStyle:new G({required:!0,constrainTo:Ma}),contentFormat:new Z({each:Na,default:["text/plain"]})})),zt("knowledge/updateAnswerConfigurationId",e=>jr(e,Pa)),zt("generatedAnswer/registerFieldsToIncludeInCitations",e=>jr(e,Tr));var Ka=zt("generatedAnswer/setIsAnswerGenerated",e=>jr(e,Fa));fr("generatedAnswer/streamAnswer",async(e,t)=>{let r=t.getState(),{dispatch:n,extra:i}=t,{setAbortControllerRef:a}=e,o=await(async e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.platformUrl,streamId:e.search.extendedResults?.generativeQuestionAnsweringId}))(r);n(Ha(!0));let s=e=>e.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,u=i.streamingClient?.streamGeneratedAnswer(o,{write:e=>{s(o)&&(n(Ha(!1)),e.payload&&e.payloadType&&((e,t)=>{switch(e){case"genqa.headerMessageType":{let e=JSON.parse(t);n(Ga(e.contentFormat));break}case"genqa.messageType":n(za(JSON.parse(t)));break;case"genqa.citationsType":n(Qa(JSON.parse(t)));break;case"genqa.endOfStreamType":{let e=JSON.parse(t).answerGenerated;n(Ya(!1)),n(Ka(e)),n(ja(e));break}default:r.debug&&i.logger.warn(`Unknown payloadType: "${e}"`)}})(e.payloadType,e.payload))},abort:e=>{s(o)&&n(Va(e))},close:()=>{s(o)&&n(Ya(!1))},resetAnswer:()=>{s(o)&&n(Ba())}});u?a(u):n(Ha(!1))});var Wa=Mt(e=>e.pipeline,e=>e),Ja=Mt(e=>e.searchHub,e=>e),Za=p(D()),Xa=p(R()),eo=p(D()),to=p(x());eo.default.extend(to.default),Za.default.extend(Xa.default);var ro=["past","now","next"],no=["minute","hour","day","week","month","quarter","year"];function io(e){return function(e){return e.format("YYYY/MM/DD@HH:mm:ss")}(function(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Za.default)().subtract(r,n);case"next":return(0,Za.default)().add(r,n);case"now":return(0,Za.default)()}}(function(e){let[t,r,n]=ao(e);return"now"===t?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}(e)))}function ao(e){return e.toLocaleLowerCase().split("-")}
2function oo(e){let[t,r,n]=ao(e);if("now"===t)return!0;if(!ro.includes(t)||!no.includes(n))return!1;let i=parseInt(r);return!(isNaN(i)||i<=0)}function so(e){return Object.values(e).map(e=>e.request)}function uo(e){return so(e).map(e=>{let t=e.currentValues.some(({state:e})=>"idle"!==e);return e.generateAutomaticRanges&&!t?{...e,currentValues:[]}:e})}function co(e){return so(e).map(e=>"alphanumericDescending"===e.sortCriteria?{...e,sortCriteria:{type:"alphanumeric",order:"descending"}}:e)}function lo(e){return function(e,t){let r={};e.forEach(e=>r[e.facetId]=e);let n=[];t.forEach(e=>{e in r&&(n.push(r[e]),delete r[e])});let i=Object.values(r);return[...n,...i]}(function(e){return function(e){return[...co(e.facetSet??{}),...uo(e.numericFacetSet??{}),...uo(e.dateFacetSet??{}),...so(e.categoryFacetSet??{})]}(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}(e),e.facetOrder??[])}function po(e){return{status:e,isUninitialized:"uninitialized"===e,isLoading:"pending"===e,isSuccess:"fulfilled"===e,isError:"rejected"===e}}var ho=je;function fo(e,t){if(e===t||!(ho(e)&&ho(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),i=r.length===n.length,a=Array.isArray(t)?[]:{};for(let n of r)a[n]=fo(e[n],t[n]),i&&(i=e[n]===a[n]);return i?e:a}function go(e){let t=0;for(let r in e)t++;return t}var mo=e=>[].concat(...e);function yo(e){return null!=e}var vo=(...e)=>fetch(...e),wo=e=>e.status>=200&&e.status<=299,bo=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function So(e){if(!je(e))return e;let t={...e};for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return t}function ko({baseUrl:e,prepareHeaders:t=e=>e,fetchFn:r=vo,paramsSerializer:n,isJsonContentType:i=bo,jsonContentType:a="application/json",jsonReplacer:o,timeout:s,responseHandler:u,validateStatus:c,...l}={}){return typeof fetch>"u"&&r===vo&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(p,h)=>{let f,{signal:g,getState:m,extra:y,endpoint:v,forced:w,type:b}=h,{url:S,headers:k=new Headers(l.headers),params:I,responseHandler:C=u??"json",validateStatus:O=c??wo,timeout:A=s,...E}="string"==typeof p?{url:p}:p,D={...l,signal:g,...E};k=new Headers(So(k)),D.headers=await t(k,{getState:m,extra:y,endpoint:v,forced:w,type:b})||k;let R=e=>"object"==typeof e&&(je(e)||Array.isArray(e)||"function"==typeof e.toJSON);if(!D.headers.has("content-type")&&R(D.body)&&D.headers.set("content-type",a),R(D.body)&&i(D.headers)&&(D.body=JSON.stringify(D.body,o)),I){let e=~S.indexOf("?")?"&":"?";S+=e+(n?n(I):new URLSearchParams(So(I)))}S=function(e,t){if(!e)return t;if(!t)return e;if(function(e){return new RegExp("(^|:)//").test(e)}(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=(e=>e.replace(/\/$/,""))(e),t=(e=>e.replace(/^\//,""))(t),`${e}${r}${t}`}(e,S);let x=new Request(S,D);f={request:new Request(S,D)};let T,_=!1,q=A&&setTimeout(()=>{_=!0,h.abort()},A);try{T=await r(x)}catch(e){return{error:{status:_?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(e)},meta:f}}finally{q&&clearTimeout(q)}let U=T.clone();f.response=U;let j,M="";try{let e;if(await Promise.all([d(T,C).then(e=>j=e,t=>e=t),U.text().then(e=>M=e,()=>{})]),e)throw e}catch(e){return{error:{status:"PARSING_ERROR",originalStatus:T.status,data:M,error:String(e)},meta:f}}return O(T,j)?{data:j,meta:f}:{error:{status:T.status,data:j},meta:f}};async function d(e,t){if("function"==typeof t)return t(e);if("content-type"===t&&(t=i(e.headers)?"json":"text"),"json"===t){let t=await e.text();return t.length?JSON.parse(t):null}return e.text()}}var Io=class{constructor(e,t=void 0){this.value=e,this.meta=t}};async function Co(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));await new Promise(e=>setTimeout(t=>e(t),n))}var Oo={},Ao=Object.assign((e,t)=>async(r,n,i)=>{let a=[5,(t||Oo).maxRetries,(i||Oo).maxRetries].filter(e=>void 0!==e),[o]=a.slice(-1),s={maxRetries:o,backoff:Co,retryCondition:(e,t,{attempt:r})=>r<=o,...t,...i},u=0;for(;;)try{let t=await e(r,n,i);if(t.error)throw new Io(t);return t}catch(e){if(u++,e.throwImmediately){if(e instanceof Io)return e.value;throw e}if(e instanceof Io&&!s.retryCondition(e.value.error,r,{attempt:u,baseQueryApi:n,extraOptions:i}))return e.value;await s.backoff(u,s.maxRetries)}},{fail:function(e){throw Object.assign(new Io({error:e}),{throwImmediately:!0})}}),Eo=zt("__rtkq/focused"),Do=zt("__rtkq/unfocused"),Ro=zt("__rtkq/online"),xo=zt("__rtkq/offline");function To(e){return"query"===e.type}function _o(e,t,r,n,i,a){return function(e){return"function"==typeof e}(e)?e(t,r,n,i).map(qo).map(a):Array.isArray(e)?e.map(qo).map(a):[]}function qo(e){return"string"==typeof e?{type:e}:e}var Uo=Symbol("forceQueryFn"),jo=e=>"function"==typeof e[Uo];function Mo(e){return e}function Po(e,t,r,n){return _o(r[e.meta.arg.endpointName][t],sr(e)?e.payload:void 0,or(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function $o(e,t,r){let n=e[t];n&&r(n)}function Fo(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Lo(e,t,r){let n=e[Fo(t)];n&&r(n)}var No={};function zo({reducerPath:e,queryThunk:t,mutationThunk:r,context:{endpointDefinitions:n,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:o},assertTagType:s,config:u}){let c=zt(`${e}/resetApiState`),l=wr({name:`${e}/queries`,initialState:No,reducers:{removeQueryResult:{reducer(e,{payload:{queryCacheKey:t}}){delete e[t]},prepare:Yt()},queryResultPatched:{reducer(e,{payload:{queryCacheKey:t,patches:r}}){$o(e,t,e=>{e.data=Tt(e.data,r.concat())})},prepare:Yt()}},extraReducers(e){e.addCase(t.pending,(e,{meta:t,meta:{arg:r}})=>{var n;let i=jo(r);e[n=r.queryCacheKey]??(e[n]={status:"uninitialized",endpointName:r.endpointName}),$o(e,r.queryCacheKey,e=>
2{e.status="pending",e.requestId=i&&e.requestId?e.requestId:t.requestId,void 0!==r.originalArgs&&(e.originalArgs=r.originalArgs),e.startedTimeStamp=t.startedTimeStamp})}).addCase(t.fulfilled,(e,{meta:t,payload:r})=>{$o(e,t.arg.queryCacheKey,e=>{if(e.requestId!==t.requestId&&!jo(t.arg))return;let{merge:i}=n[t.arg.endpointName];if(e.status="fulfilled",i)if(void 0!==e.data){let{fulfilledTimeStamp:n,arg:a,baseQueryMeta:o,requestId:s}=t,u=Rt(e.data,e=>i(e,r,{arg:a.originalArgs,baseQueryMeta:o,fulfilledTimeStamp:n,requestId:s}));e.data=u}else e.data=r;else e.data=n[t.arg.endpointName].structuralSharing??!0?fo(Be(e.data)?function(e){return Be(e)||Qe(15),e[ze].base_}(e.data):e.data,r):r;delete e.error,e.fulfilledTimeStamp=t.fulfilledTimeStamp})}).addCase(t.rejected,(e,{meta:{condition:t,arg:r,requestId:n},error:i,payload:a})=>{$o(e,r.queryCacheKey,e=>{if(!t){if(e.requestId!==n)return;e.status="rejected",e.error=a??i}})}).addMatcher(o,(e,t)=>{let{queries:r}=a(t);for(let[t,n]of Object.entries(r))("fulfilled"===n?.status||"rejected"===n?.status)&&(e[t]=n)})}}),d=wr({name:`${e}/mutations`,initialState:No,reducers:{removeMutationResult:{reducer(e,{payload:t}){let r=Fo(t);r in e&&delete e[r]},prepare:Yt()}},extraReducers(e){e.addCase(r.pending,(e,{meta:t,meta:{requestId:r,arg:n,startedTimeStamp:i}})=>{n.track&&(e[Fo(t)]={requestId:r,status:"pending",endpointName:n.endpointName,startedTimeStamp:i})}).addCase(r.fulfilled,(e,{payload:t,meta:r})=>{r.arg.track&&Lo(e,r,e=>{e.requestId===r.requestId&&(e.status="fulfilled",e.data=t,e.fulfilledTimeStamp=r.fulfilledTimeStamp)})}).addCase(r.rejected,(e,{payload:t,error:r,meta:n})=>{n.arg.track&&Lo(e,n,e=>{e.requestId===n.requestId&&(e.status="rejected",e.error=t??r)})}).addMatcher(o,(e,t)=>{let{mutations:r}=a(t);for(let[t,n]of Object.entries(r))("fulfilled"===n?.status||"rejected"===n?.status)&&t!==n?.requestId&&(e[t]=n)})}}),p=wr({name:`${e}/invalidation`,initialState:No,reducers:{updateProvidedBy:{reducer(e,t){var r,n;let{queryCacheKey:i,providedTags:a}=t.payload;for(let t of Object.values(e))for(let e of Object.values(t)){let t=e.indexOf(i);-1!==t&&e.splice(t,1)}for(let{type:t,id:o}of a){let a=(r=e[t]??(e[t]={}))[n=o||"__internal_without_id"]??(r[n]=[]);a.includes(i)||a.push(i)}},prepare:Yt()}},extraReducers(e){e.addCase(l.actions.removeQueryResult,(e,{payload:{queryCacheKey:t}})=>{for(let r of Object.values(e))for(let e of Object.values(r)){let r=e.indexOf(t);-1!==r&&e.splice(r,1)}}).addMatcher(o,(e,t)=>{var r,n;let{provided:i}=a(t);for(let[t,a]of Object.entries(i))for(let[i,o]of Object.entries(a)){let a=(r=e[t]??(e[t]={}))[n=i||"__internal_without_id"]??(r[n]=[]);for(let e of o)a.includes(e)||a.push(e)}}).addMatcher(er(sr(t),or(t)),(e,t)=>{let r=Po(t,"providesTags",n,s),{queryCacheKey:i}=t.meta.arg;p.caseReducers.updateProvidedBy(e,p.actions.updateProvidedBy({queryCacheKey:i,providedTags:r}))})}}),h=wr({name:`${e}/subscriptions`,initialState:No,reducers:{updateSubscriptionOptions(e,t){},unsubscribeQueryResult(e,t){},internal_getRTKQSubscriptions(){}}}),f=wr({name:`${e}/internalSubscriptions`,initialState:No,reducers:{subscriptionsUpdated:{reducer(e,t){return Tt(e,t.payload)},prepare:Yt()}}}),g=wr({name:`${e}/config`,initialState:{online:typeof navigator>"u"||void 0===navigator.onLine||navigator.onLine,focused:typeof document>"u"||"hidden"!==document.visibilityState,middlewareRegistered:!1,...u},reducers:{middlewareRegistered(e,{payload:t}){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&i===t||"conflict"}},extraReducers:e=>{e.addCase(Ro,e=>{e.online=!0}).addCase(xo,e=>{e.online=!1}).addCase(Eo,e=>{e.focused=!0}).addCase(Do,e=>{e.focused=!1}).addMatcher(o,e=>({...e}))}}),m=Pe({queries:l.reducer,mutations:d.reducer,provided:p.reducer,subscriptions:f.reducer,config:g.reducer});return{reducer:(e,t)=>m(c.match(t)?void 0:e,t),actions:{...g.actions,...l.actions,...h.actions,...f.actions,...d.actions,...p.actions,resetApiState:c}}}var Qo=Symbol.for("RTKQ/skipToken"),Vo={status:"uninitialized"},Bo=Rt(Vo,()=>{}),Ho=Rt(Vo,()=>{}),Yo=WeakMap?new WeakMap:void 0,Go=({endpointName:e,queryArgs:t})=>{let r="",n=Yo?.get(t);if("string"==typeof n)r=n;else{let e=JSON.stringify(t,(e,t)=>t=je(t="bigint"==typeof t?{$bigint:t.toString()}:t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t);je(t)&&Yo?.set(t,e),r=e}return`${e}(${r})`};function Ko(e,...t){return Object.assign(e,...t)}var Wo=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i})=>{let{removeQueryResult:a,unsubscribeQueryResult:o}=t.internalActions,s=er(o.match,r.fulfilled,r.rejected);function u(e){let t=i.currentSubscriptions[e];return!!t&&!function(e){for(let t in e)return!1;return!0}(t)}let c={};
2function l(e,t,r,i){let o=n.endpointDefinitions[t]?.keepUnusedDataFor??i.keepUnusedDataFor;if(o===1/0)return;let s=Math.max(0,Math.min(o,2147482.647));if(!u(e)){let t=c[e];t&&clearTimeout(t),c[e]=setTimeout(()=>{u(e)||r.dispatch(a({queryCacheKey:e})),delete c[e]},1e3*s)}}return(r,i,a)=>{if(s(r)){let t=i.getState()[e],{queryCacheKey:n}=o.match(r)?r.payload:r.meta.arg;l(n,t.queries[n]?.endpointName,i,t.config)}if(t.util.resetApiState.match(r))for(let[e,t]of Object.entries(c))t&&clearTimeout(t),delete c[e];if(n.hasRehydrationInfo(r)){let t=i.getState()[e],{queries:a}=n.extractRehydrationInfo(r);for(let[e,r]of Object.entries(a))l(e,r?.endpointName,i,t.config)}}},Jo=new Error("Promise never resolved before cacheEntryRemoved."),Zo=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:a})=>{let o=ur(n),s=ur(i),u=sr(n,i),c={};function l(t,n,i,a,o){let s=r.endpointDefinitions[t],u=s?.onCacheEntryAdded;if(!u)return;let l={},d=new Promise(e=>{l.cacheEntryRemoved=e}),p=Promise.race([new Promise(e=>{l.valueResolved=e}),d.then(()=>{throw Jo})]);p.catch(()=>{}),c[i]=l;let h=e.endpoints[t].select("query"===s.type?n:i),f=a.dispatch((e,t,r)=>r),g={...a,getCacheEntry:()=>h(a.getState()),requestId:o,extra:f,updateCachedData:"query"===s.type?r=>a.dispatch(e.util.updateQueryData(t,n,r)):void 0,cacheDataLoaded:p,cacheEntryRemoved:d},m=u(n,g);Promise.resolve(m).catch(e=>{if(e!==Jo)throw e})}return(r,a,d)=>{let p=function(t){return o(t)?t.meta.arg.queryCacheKey:s(t)?t.meta.arg.fixedCacheKey??t.meta.requestId:e.internalActions.removeQueryResult.match(t)?t.payload.queryCacheKey:e.internalActions.removeMutationResult.match(t)?Fo(t.payload):""}(r);if(n.pending.match(r)){let e=d[t].queries[p],n=a.getState()[t].queries[p];!e&&n&&l(r.meta.arg.endpointName,r.meta.arg.originalArgs,p,a,r.meta.requestId)}else if(i.pending.match(r))a.getState()[t].mutations[p]&&l(r.meta.arg.endpointName,r.meta.arg.originalArgs,p,a,r.meta.requestId);else if(u(r)){let e=c[p];e?.valueResolved&&(e.valueResolved({data:r.payload,meta:r.meta.baseQueryMeta}),delete e.valueResolved)}else if(e.internalActions.removeQueryResult.match(r)||e.internalActions.removeMutationResult.match(r)){let e=c[p];e&&(delete c[p],e.cacheEntryRemoved())}else if(e.util.resetApiState.match(r))for(let[e,t]of Object.entries(c))delete c[e],t.cacheEntryRemoved()}},Xo=({api:e,context:{apiUid:t},reducerPath:r})=>(r,n)=>{e.util.resetApiState.match(r)&&n.dispatch(e.internalActions.middlewareRegistered(t))},es=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:a,assertTagType:o,refetchQuery:s,internalState:u})=>{let{removeQueryResult:c}=a.internalActions,l=er(sr(n),or(n)),d=er(sr(n,i),ar(n,i)),p=[];function h(r,n){let i=n.getState(),o=i[e];if(p.push(...r),"delayed"===o.config.invalidationBehavior&&function(e){for(let t in e.queries)if("pending"===e.queries[t]?.status)return!0;for(let t in e.mutations)if("pending"===e.mutations[t]?.status)return!0;return!1}(o))return;let l=p;if(p=[],0===l.length)return;let d=a.util.selectInvalidatedBy(i,l);t.batch(()=>{let e=Array.from(d.values());for(let{queryCacheKey:t}of e){let e=o.queries[t],r=u.currentSubscriptions[t]??{};e&&(0===go(r)?n.dispatch(c({queryCacheKey:t})):"uninitialized"!==e.status&&n.dispatch(s(e,t)))}})}return(e,t)=>{l(e)?h(Po(e,"invalidatesTags",r,o),t):d(e)?h([],t):a.util.invalidateTags.match(e)&&h(_o(e.payload,void 0,void 0,void 0,void 0,o),t)}},ts=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{let a={};function o({queryCacheKey:t},r){let s=r.getState()[e],u=s.queries[t],l=i.currentSubscriptions[t];if(!u||"uninitialized"===u.status)return;let{lowestPollingInterval:d,skipPollingIfUnfocused:p}=c(l);if(!Number.isFinite(d))return;let h=a[t];h?.timeout&&(clearTimeout(h.timeout),h.timeout=void 0);
2let f=Date.now()+d;a[t]={nextPollTimestamp:f,pollingInterval:d,timeout:setTimeout(()=>{(s.config.focused||!p)&&r.dispatch(n(u,t)),o({queryCacheKey:t},r)},d)}}function s({queryCacheKey:t},r){let n=r.getState()[e].queries[t],s=i.currentSubscriptions[t];if(!n||"uninitialized"===n.status)return;let{lowestPollingInterval:l}=c(s);if(!Number.isFinite(l))return void u(t);let d=a[t],p=Date.now()+l;(!d||p<d.nextPollTimestamp)&&o({queryCacheKey:t},r)}function u(e){let t=a[e];t?.timeout&&clearTimeout(t.timeout),delete a[e]}function c(e={}){let t=!1,r=Number.POSITIVE_INFINITY;for(let n in e)e[n].pollingInterval&&(r=Math.min(e[n].pollingInterval,r),t=e[n].skipPollingIfUnfocused||t);return{lowestPollingInterval:r,skipPollingIfUnfocused:t}}return(e,n)=>{(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&s(e.payload,n),(t.pending.match(e)||t.rejected.match(e)&&e.meta.condition)&&s(e.meta.arg,n),(t.fulfilled.match(e)||t.rejected.match(e)&&!e.meta.condition)&&o(e.meta.arg,n),r.util.resetApiState.match(e)&&function(){for(let e of Object.keys(a))u(e)}()}},rs=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let i=ir(r,n),a=ar(r,n),o=sr(r,n),s={};return(r,n)=>{if(i(r)){let{requestId:i,arg:{endpointName:a,originalArgs:o}}=r.meta,u=t.endpointDefinitions[a],c=u?.onQueryStarted;if(c){let t={},r=new Promise((e,r)=>{t.resolve=e,t.reject=r});r.catch(()=>{}),s[i]=t;let l=e.endpoints[a].select("query"===u.type?o:i),d=n.dispatch((e,t,r)=>r),p={...n,getCacheEntry:()=>l(n.getState()),requestId:i,extra:d,updateCachedData:"query"===u.type?t=>n.dispatch(e.util.updateQueryData(a,o,t)):void 0,queryFulfilled:r};c(o,p)}}else if(o(r)){let{requestId:e,baseQueryMeta:t}=r.meta;s[e]?.resolve({data:r.payload,meta:t}),delete s[e]}else if(a(r)){let{requestId:e,rejectedWithValue:t,baseQueryMeta:n}=r.meta;s[e]?.reject({error:r.payload??r.error,isUnhandledError:!t,meta:n}),delete s[e]}}};function ns(e){let{reducerPath:t,queryThunk:r,api:n,context:i}=e,{apiUid:a}=i,o={invalidateTags:zt(`${t}/invalidateTags`)},s=e=>e.type.startsWith(`${t}/`),u=[Xo,Wo,es,ts,Zo,rs];return{middleware:r=>{let o=!1,l={...e,internalState:{currentSubscriptions:{}},refetchQuery:c,isThisApiSliceAction:s},d=u.map(e=>e(l)),p=(({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,i=null,a=null,{updateSubscriptionOptions:o,unsubscribeQueryResult:s}=e.internalActions,u=()=>r.currentSubscriptions,c={getSubscriptions:u,getSubscriptionCount:e=>go(u()[e]??{}),isRequestSubscribed:(e,t)=>!!u()?.[e]?.[t]};return(u,l)=>{if(i||(i=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(u))return i=r.currentSubscriptions={},a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(u))return[!1,c];let d=((r,n)=>{var i,a;if(o.match(n)){let{queryCacheKey:e,requestId:t,options:i}=n.payload;return r?.[e]?.[t]&&(r[e][t]=i),!0}if(s.match(n)){let{queryCacheKey:e,requestId:t}=n.payload;return r[e]&&delete r[e][t],!0}if(e.internalActions.removeQueryResult.match(n))return delete r[n.payload.queryCacheKey],!0;if(t.pending.match(n)){let{meta:{arg:e,requestId:t}}=n,a=r[i=e.queryCacheKey]??(r[i]={});return a[`${t}_running`]={},e.subscribe&&(a[t]=e.subscriptionOptions??a[t]??{}),!0}let u=!1;if(t.fulfilled.match(n)||t.rejected.match(n)){let e=r[n.meta.arg.queryCacheKey]||{},t=`${n.meta.requestId}_running`;u||(u=!!e[t]),delete e[t]}if(t.rejected.match(n)){let{meta:{condition:e,arg:t,requestId:i}}=n;if(e&&t.subscribe){let e=r[a=t.queryCacheKey]??(r[a]={});e[i]=t.subscriptionOptions??e[i]??{},u=!0}}return u})(r.currentSubscriptions,u),p=!0;if(d){a||(a=setTimeout(()=>{let t=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,n]=xt(i,()=>t);l.next(e.internalActions.subscriptionsUpdated(n)),i=t,a=null},500));let o="string"==typeof u.type&&!!u.type.startsWith(n),s=t.rejected.match(u)&&u.meta.condition&&!!u.meta.arg.subscribe;p=!o&&!s}return[p,!1]}})(l),h=(({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{let{removeQueryResult:a}=r.internalActions;function o(r,o){let s=r.getState()[e],u=s.queries,c=i.currentSubscriptions;t.batch(()=>{for(let e of Object.keys(c)){let t=u[e],i=c[e];i&&t&&(Object.values(i).some(e=>!0===e[o])||Object.values(i).every(e=>void 0===e[o])&&s.config[o])&&(0===go(i)?r.dispatch(a({queryCacheKey:e})):"uninitialized"!==t.status&&r.dispatch(n(t,e)))}})}return(e,t)=>{Eo.match(e)&&o(t,"refetchOnFocus"),Ro.match(e)&&o(t,"refetchOnReconnect")}})(l);return e=>u=>{if(!Fe(u))return e(u);o||(o=!0,r.dispatch(n.internalActions.middlewareRegistered(a)));let c,l={...r,next:e},f=r.getState(),[g,m]=p(u,l,f);if(c=g?e(u):m,r.getState()[t]&&(h(u,l,f),s(u)||i.hasRehydrationInfo(u)))for(let e of d)e(u,l,f);return c}},actions:o};function c(e,t,n={}){return r({type:"query",endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t,...n})}}var is=Symbol(),as=function(...e){return function(t){let r=jt(e=>t.extractRehydrationInfo?.(e,{reducerPath:t.reducerPath??"api"}
2)),n={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...t,extractRehydrationInfo:r,serializeQueryArgs(e){let r=Go;if("serializeQueryArgs"in e.endpointDefinition){let t=e.endpointDefinition.serializeQueryArgs;r=e=>{let r=t(e);return"string"==typeof r?r:Go({...e,queryArgs:r})}}else t.serializeQueryArgs&&(r=t.serializeQueryArgs);return r(e)},tagTypes:[...t.tagTypes||[]]},i={endpointDefinitions:{},batch(e){e()},apiUid:cr(),extractRehydrationInfo:r,hasRehydrationInfo:jt(e=>null!=r(e))},a={injectEndpoints:function(e){let t=e.endpoints({query:e=>({...e,type:"query"}),mutation:e=>({...e,type:"mutation"})});for(let[r,n]of Object.entries(t))if(!0!==e.overrideExisting&&r in i.endpointDefinitions){if("throw"===e.overrideExisting)throw new Error(Or(39))}else{i.endpointDefinitions[r]=n;for(let e of o)e.injectEndpoint(r,n)}return a},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(let t of e)n.tagTypes.includes(t)||n.tagTypes.push(t);if(t)for(let[e,r]of Object.entries(t))"function"==typeof r?r(i.endpointDefinitions[e]):Object.assign(i.endpointDefinitions[e]||{},r);return a}},o=e.map(e=>e.init(a,n,i));return a.injectEndpoints({endpoints:t.endpoints})}}((({createSelector:e=Mt}={})=>({name:is,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:a,keepUnusedDataFor:o,refetchOnMountOrArgChange:s,refetchOnFocus:u,refetchOnReconnect:c,invalidationBehavior:l},d){!function(){let e="replace",t="add",r="remove";function n(e){if(!He(e))return e;if(Array.isArray(e))return e.map(n);if(et(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,n(t)]));if(tt(e))return new Set(Array.from(e).map(n));let t=Object.create(Ve(e));for(let r in e)t[r]=n(e[r]);return Je(e,Ne)&&(t[Ne]=e[Ne]),t}function i(e){return Be(e)?n(e):e}!function(e,t){ut[e]||(ut[e]=t)}("Patches",{applyPatches_:function(i,a){return a.forEach(a=>{let{path:o,op:s}=a,u=i;for(let e=0;e<o.length-1;e++){let t=We(u),r=o[e];"string"!=typeof r&&"number"!=typeof r&&(r=""+r),(0===t||1===t)&&("__proto__"===r||"constructor"===r)&&Qe(19),"function"==typeof u&&"prototype"===r&&Qe(19),u=Ze(u,r),"object"!=typeof u&&Qe(18,o.join("/"))}let c=We(u),l=n(a.value),d=o[o.length-1];switch(s){case e:switch(c){case 2:return u.set(d,l);case 3:Qe(16);default:return u[d]=l}case t:switch(c){case 1:return"-"===d?u.push(l):u.splice(d,0,l);case 2:return u.set(d,l);case 3:return u.add(l);default:return u[d]=l}case r:switch(c){case 1:return u.splice(d,1);case 2:return u.delete(d);case 3:return u.delete(a.value);default:return delete u[d]}default:Qe(17)}}),i},generatePatches_:function(n,a,o,s){switch(n.type_){case 0:case 2:return function(n,a,o,s){let{base_:u,copy_:c}=n;Ke(n.assigned_,(n,l)=>{let d=Ze(u,n),p=Ze(c,n),h=l?Je(u,n)?e:t:r;if(d===p&&h===e)return;let f=a.concat(n);o.push(h===r?{op:h,path:f}:{op:h,path:f,value:p}),s.push(h===t?{op:r,path:f}:h===r?{op:t,path:f,value:i(d)}:{op:e,path:f,value:i(d)})})}(n,a,o,s);case 1:return function(n,a,o,s){let{base_:u,assigned_:c}=n,l=n.copy_;l.length<u.length&&([u,l]=[l,u],[o,s]=[s,o]);for(let t=0;t<u.length;t++)if(c[t]&&l[t]!==u[t]){let r=a.concat([t]);o.push({op:e,path:r,value:i(l[t])}),s.push({op:e,path:r,value:i(u[t])})}for(let e=u.length;e<l.length;e++){let r=a.concat([e]);o.push({op:t,path:r,value:i(l[e])})}for(let e=l.length-1;u.length<=e;--e){let t=a.concat([e]);s.push({op:r,path:t})}}(n,a,o,s);case 3:return function(e,n,i,a){let{base_:o,copy_:s}=e,u=0;o.forEach(e=>{if(!s.has(e)){let o=n.concat([u]);i.push({op:r,path:o,value:e}),a.unshift({op:t,path:o,value:e})}u++}),u=0,s.forEach(e=>{if(!o.has(e)){let o=n.concat([u]);i.push({op:t,path:o,value:e}),a.unshift({op:r,path:o,value:e})}u++})}(n,a,o,s)}},generateReplacementPatches_:function(t,r,n,i){n.push({op:e,path:[],value:r===Le?void 0:r}),i.push({op:e,path:[],value:t})}})}();let p=e=>e;Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Ro,onOffline:xo,onFocus:Eo,onFocusLost:Do},util:{}});let{queryThunk:h,mutationThunk:f,patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:v,buildMatchThunkActions:w}=function({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:a}){let o=async(e,{signal:n,abort:i,rejectWithValue:a,fulfillWithValue:o,dispatch:u,getState:c,extra:l})=>{let d=r[e.endpointName];try{let r,a=Mo,p={signal:n,abort:i,dispatch:u,getState:c,extra:l,endpoint:e.endpointName,type:e.type,forced:"query"===e.type?s(e,c()):void 0},h="query"===e.type?e[Uo]:void 0;if(h?r=h():d.query?(r=await t(d.query(e.originalArgs),p,d.extraOptions),d.transformResponse&&(a=d.transformResponse)):r=await d.queryFn(e.originalArgs,p,d.extraOptions,e=>t(e,p,d.extraOptions)),r.error)throw new Io(r.error,r.meta);return o(await a(r.data,r.meta,e.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:r.meta,[Ht]:!0})}catch(t){let r=t;if(r instanceof Io){let t=Mo;d.query&&d.transformErrorResponse&&(t=d.transformErrorResponse);try{return a(await t(r.value,r.meta,e.originalArgs),{baseQueryMeta:r.meta,[Ht]:!0})}catch(e){r=e}}throw console.error(r),r}};function s(t,r){let n=r[e]?.queries?.[t.queryCacheKey],i=r[e]?.config.refetchOnMountOrArgChange,a=n?.fulfilledTimeStamp,o=t.forceRefetch??(t.subscribe&&i);return!!o&&(!0===o||(Number(new Date)-Number(a))/1e3>=o)}let u=fr(`${e}/executeQuery`,o,{getPendingMeta(){return{startedTimeStamp:Date.now(),[Ht]:!0}},condition(t,{getState:n}){let i=n(),a=i[e]?.queries?.[t.queryCacheKey],o=a?.fulfilledTimeStamp,u=t.originalArgs,c=a?.originalArgs,l=r[t.endpointName];return!!jo(t)||"pending"!==a?.status&&(!!(s(t,i)||To(l)&&l?.forceRefetch?.({currentArg:u,previousArg:c,endpointState:a,state:i}))||!o)},dispatchConditionRejection:!0}
2);function c(e){return t=>t?.meta?.arg?.endpointName===e}return{queryThunk:u,mutationThunk:fr(`${e}/executeMutation`,o,{getPendingMeta(){return{startedTimeStamp:Date.now(),[Ht]:!0}}}),prefetch:(e,t,r)=>(n,a)=>{let o=(e=>"force"in e)(r)&&r.force,s=(e=>"ifOlderThan"in e)(r)&&r.ifOlderThan,u=(r=!0)=>{let n={forceRefetch:r,isPrefetch:!0};return i.endpoints[e].initiate(t,n)},c=i.endpoints[e].select(t)(a());if(o)n(u());else if(s){let e=c?.fulfilledTimeStamp;if(!e)return void n(u());(Number(new Date)-Number(new Date(e)))/1e3>=s&&n(u())}else n(u(!1))},updateQueryData:(e,t,r,n=!0)=>(a,o)=>{let s,u=i.endpoints[e].select(t)(o()),c={patches:[],inversePatches:[],undo:()=>a(i.util.patchQueryData(e,t,c.inversePatches,n))};if("uninitialized"===u.status)return c;if("data"in u)if(He(u.data)){let[e,t,n]=xt(u.data,r);c.patches.push(...t),c.inversePatches.push(...n),s=e}else s=r(u.data),c.patches.push({op:"replace",path:[],value:s}),c.inversePatches.push({op:"replace",path:[],value:u.data});return 0===c.patches.length||a(i.util.patchQueryData(e,t,c.patches,n)),c},upsertQueryData:(e,t,r)=>n=>n(i.endpoints[e].initiate(t,{subscribe:!1,forceRefetch:!0,[Uo]:()=>({data:r})})),patchQueryData:(e,t,o,s)=>(u,c)=>{let l=r[e],d=n({queryArgs:t,endpointDefinition:l,endpointName:e});if(u(i.internalActions.queryResultPatched({queryCacheKey:d,patches:o})),!s)return;let p=i.endpoints[e].select(t)(c()),h=_o(l.providesTags,p.data,void 0,t,{},a);u(i.internalActions.updateProvidedBy({queryCacheKey:d,providedTags:h}))},buildMatchThunkActions:function(e,t){return{matchPending:tr(ir(e),c(t)),matchFulfilled:tr(sr(e),c(t)),matchRejected:tr(ar(e),c(t))}}}}({baseQuery:r,reducerPath:i,context:d,api:t,serializeQueryArgs:a,assertTagType:p}),{reducer:b,actions:S}=zo({context:d,queryThunk:h,mutationThunk:f,reducerPath:i,assertTagType:p,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:s,keepUnusedDataFor:o,reducerPath:i,invalidationBehavior:l}});Ko(t.util,{patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:v,resetApiState:S.resetApiState}),Ko(t.internalActions,S);let{middleware:k,actions:I}=ns({reducerPath:i,context:d,queryThunk:h,mutationThunk:f,api:t,assertTagType:p});Ko(t.util,I),Ko(t,{reducer:b,middleware:k});let{buildQuerySelector:C,buildMutationSelector:O,selectInvalidatedBy:A,selectCachedArgsForQuery:E}=function({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=e=>Bo,i=e=>Ho;return{buildQuerySelector:function(t,i){return s=>{let u=e({queryArgs:s,endpointDefinition:i,endpointName:t});return r(s===Qo?n:e=>o(e)?.queries?.[u]??Bo,a)}},buildMutationSelector:function(){return e=>{let t;return t="object"==typeof e?Fo(e)??Qo:e,r(t===Qo?i:e=>o(e)?.mutations?.[t]??Ho,a)}},selectInvalidatedBy:function(e,r){let n=e[t],i=new Set;for(let e of r.map(qo)){let t=n.provided[e.type];if(!t)continue;let r=(void 0!==e.id?t[e.id]:mo(Object.values(t)))??[];for(let e of r)i.add(e)}return mo(Array.from(i.values()).map(e=>{let t=n.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]}))},selectCachedArgsForQuery:function(e,r){return Object.values(e[t].queries).filter(e=>e?.endpointName===r&&"uninitialized"!==e.status).map(e=>e.originalArgs)}};function a(e){return{...e,...po(e.status)}}function o(e){return e[t]}}({serializeQueryArgs:a,reducerPath:i,createSelector:e});Ko(t.util,{selectInvalidatedBy:A,selectCachedArgsForQuery:E});let{buildInitiateQuery:D,buildInitiateMutation:R,getRunningMutationThunk:x,getRunningMutationsThunk:T,getRunningQueriesThunk:_,getRunningQueryThunk:q}=function({serializeQueryArgs:e,queryThunk:t,mutationThunk:r,api:n,context:i}){let a=new Map,o=new Map,{unsubscribeQueryResult:s,removeMutationResult:u,updateSubscriptionOptions:c}=n.internalActions;return{buildInitiateQuery:function(r,i){let o=(u,{subscribe:l=!0,forceRefetch:d,subscriptionOptions:p,[Uo]:h,...f}={})=>(g,m)=>{let y=e({queryArgs:u,endpointDefinition:i,endpointName:r}),v=t({...f,type:"query",subscribe:l,forceRefetch:d,subscriptionOptions:p,endpointName:r,originalArgs:u,queryCacheKey:y,[Uo]:h}
2),w=n.endpoints[r].select(u),b=g(v),S=w(m()),{requestId:k,abort:I}=b,C=S.requestId!==k,O=a.get(g)?.[y],A=()=>w(m()),E=Object.assign(h?b.then(A):C&&!O?Promise.resolve(S):Promise.all([O,b]).then(A),{arg:u,requestId:k,subscriptionOptions:p,queryCacheKey:y,abort:I,async unwrap(){let e=await E;if(e.isError)throw e.error;return e.data},refetch:()=>g(o(u,{subscribe:!1,forceRefetch:!0})),unsubscribe(){l&&g(s({queryCacheKey:y,requestId:k}))},updateSubscriptionOptions(e){E.subscriptionOptions=e,g(c({endpointName:r,requestId:k,queryCacheKey:y,options:e}))}});if(!O&&!C&&!h){let e=a.get(g)||{};e[y]=E,a.set(g,e),E.then(()=>{delete e[y],go(e)||a.delete(g)})}return E};return o},buildInitiateMutation:function(e){return(t,{track:n=!0,fixedCacheKey:i}={})=>(a,s)=>{let c=r({type:"mutation",endpointName:e,originalArgs:t,track:n,fixedCacheKey:i}),l=a(c),{requestId:d,abort:p,unwrap:h}=l,f=function(e){return e.catch(e=>({error:e}))}(l.unwrap().then(e=>({data:e}))),g=Object.assign(f,{arg:l.arg,requestId:d,abort:p,unwrap:h,reset:()=>{a(u({requestId:d,fixedCacheKey:i}))}}),m=o.get(a)||{};return o.set(a,m),m[d]=g,g.then(()=>{delete m[d],go(m)||o.delete(a)}),i&&(m[i]=g,g.then(()=>{m[i]===g&&(delete m[i],go(m)||o.delete(a))})),g}},getRunningQueryThunk:function(t,r){return n=>{let o=i.endpointDefinitions[t],s=e({queryArgs:r,endpointDefinition:o,endpointName:t});return a.get(n)?.[s]}},getRunningMutationThunk:function(e,t){return e=>o.get(e)?.[t]},getRunningQueriesThunk:function(){return e=>Object.values(a.get(e)||{}).filter(yo)},getRunningMutationsThunk:function(){return e=>Object.values(o.get(e)||{}).filter(yo)}}}({queryThunk:h,mutationThunk:f,api:t,serializeQueryArgs:a,context:d});return Ko(t.util,{getRunningMutationThunk:x,getRunningMutationsThunk:T,getRunningQueryThunk:q,getRunningQueriesThunk:_}),{name:is,injectEndpoint(e,r){var n;let i=t;(n=i.endpoints)[e]??(n[e]={}),To(r)?Ko(i.endpoints[e],{name:e,select:C(e,r),initiate:D(e,r)},w(h,e)):function(e){return"mutation"===e.type}(r)&&Ko(i.endpoints[e],{name:e,select:O(),initiate:R(e)},w(f,e))}}}}))()),os=as({reducerPath:"answer",baseQuery:Ao(async(e,t,r)=>{let n=t.getState(),{accessToken:i,organizationId:a,platformUrl:o}=n.configuration,s=n.generatedAnswer.answerConfigurationId,u={...e,headers:{...e?.headers||{},Authorization:`Bearer ${i}`}};try{return{data:ko({baseUrl:`${o}/rest/organizations/${a}/answer/v1/configs/${s}`})(u,t,r)}}catch(e){return{error:e}}},{maxRetries:3}),endpoints:()=>({})}),ss=os.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{answerStyle:void 0,contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),async onCacheEntryAdded(e,{getState:t,cacheDataLoaded:r,updateCachedData:n,dispatch:i}){await r;let{configuration:a,generatedAnswer:o}=t(),{platformUrl:s,organizationId:u,accessToken:c}=a;await _a(`${s}/rest/organizations/${u}/answer/v1/configs/${o.answerConfigurationId}/generate`,{method:"POST",body:JSON.stringify(e),headers:{Authorization:`Bearer ${c}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:fetch,onopen:async e=>{let t=e.headers.get("x-answer-id");t&&n(e=>{e.answerId=t})},onmessage:e=>{n(t=>{((e,t,r)=>{let n=JSON.parse(e.data);"ERROR"===n.finishReason&&n.errorMessage&&((e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)})(t,n);let i=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":i.answerStyle&&i.contentFormat&&(((e,t)=>{let{answerStyle:r,contentFormat:n}=t;e.answerStyle=r,e.contentFormat=n,e.isStreaming=!0,e.isLoading=!1})(t,i),r(Ga(i.contentFormat)));break;case"genqa.messageType":i.textDelta&&(((e,t)=>{void 0===e.answer?e.answer=t.textDelta:"string"==typeof t.textDelta&&(e.answer=e.answer.concat(t.textDelta))})(t,i),r(za({textDelta:i.textDelta})));break;case"genqa.citationsType":i.citations&&(((e,t)=>{e.citations=t.citations})(t,i),r(Qa({citations:i.citations})));break;case"genqa.endOfStreamType":((e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1})(t,i),r(ja(i.answerGenerated??!1))}})(e,t,i)})},onerror:e=>{throw e}})}})})});Mt(e=>Ua(e)?.q,e=>e.search.requestId,(e,t)=>({q:e,requestId:t}));var us={},cs=e=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,ls=(e,t)=>
2{let r=Ua(e)?.q,n=Ja(e),i=Wa(e),a=(e=>e.generatedAnswer?.fieldsToIncludeInCitations)(e)??[];return r&&"fetch"===t&&(us=((e,t)=>({...us,[e]:lo(t)?.map(e=>function(e,t){if(function(e){return"dateRange"===e.type}(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(e=>function(e,t,r){let n=e.start,i=e.end;return oo(n)&&(n=io(n),r.dateFacetValueMap[t][function(e){return`start${e}`}(n)]=e.start),oo(i)&&(i=io(i),r.dateFacetValueMap[t][function(e){return`end${e}`}(i)]=e.end),{...e,start:n,end:i}}(e,r,t))}}return e}(e,{dateFacetValueMap:{}})).sort((e,t)=>e.facetId>t.facetId?1:t.facetId>e.facetId?-1:0)}))(r,e)),{q:r,pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:a}},...n?.length&&{searchHub:n},...i?.length&&{pipeline:i},...us[r]?.length&&{facets:us[r]},...e.fields&&{fieldsToInclude:e.fields.fieldsToInclude},...e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&"next"===e.didYouMean.queryCorrectionMode,options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&"legacy"===e.didYouMean.queryCorrectionMode},...e.pagination&&{numberOfResults:cs(e),firstResult:e.pagination.firstResult},tab:e.configuration.analytics.originLevel2}},ds=e=>ss.endpoints.getAnswer.select(ls(e,"select"))(e),ps=Zt($r,e=>e);function hs(){return typeof window<"u"&&typeof document<"u"}function fs(e){return"type"in e}var gs=e=>t=>r=>{let n;(function(e){let t=e.payload?.analyticsAction;return fs(e)&&!N(t)})(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let i=t(r);return fs(r)&&("search/executeSearch/fullfilled"===r.type&&void 0===n&&console.error("No anal
2ytics action associated with search:",r),"recommendation/get/fullfilled"===r.type&&void 0===n&&console.error("No analytics action associated with recommendation:",r),"productRecommendations/get/fullfilled"===r.type&&void 0===n&&console.error("No analytics action associated with product recommendation:",r)),void 0!==n&&e.dispatch(n),i},ms=p(T()),ys=zt("commerce/configuration/updateBasicConfiguration",e=>jr(e,{accessToken:Er,organizationId:Er,platformUrl:Er})),vs=zt("commerce/configuration/updateAnalyticsConfiguration",e=>jr(e,{enabled:Qr.enabled,source:Qr.source,trackingId:Qr.trackingId})),ws=zt("commerce/configuration/analytics/disable"),bs=zt("commerce/configuration/analytics/enable"),Ss={q:new G,enableQuerySyntax:new V,aq:new G,cq:new G,firstResult:new z({min:0}),numberOfResults:new z({min:0}),sortCriteria:new G,f:new W,fExcluded:new W,cf:new W,nf:new W,mnf:new W,df:new W,debug:new V,sf:new W,tab:new G,af:new W},ks=zt("searchParameters/restore",e=>jr(e,Ss));zt("tab/register",e=>{let t=new W({values:{id:Ar,expression:Dr}});return jr(e,t)});var Is=zt("tab/updateActiveTab",e=>jr(e,Ar)),Cs=p(D()),Os=p(_()),As=p(q());Cs.default.extend(As.default),Cs.default.extend(Os.default);var Es="/rest/search/v2",Ds="/rest/ua";var Rs=Zt({organizationId:"",accessToken:"",platformUrl:ye(),search:{apiBaseUrl:`${ye()}${Es}`,locale:"en-US",timezone:Cs.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,apiBaseUrl:`${function(e){return ge("analytics",e)}()}${Ds}`,nextApiBaseUrl:"",originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",trackingId:"",analyticsMode:"legacy",source:{}},knowledge:{answerConfigurationId:""}},e=>e.addCase(Nr,(e,t)=>{xs(e,t.payload)}).addCase(ys,(e,t)=>{xs(e,t.payload)}).addCase(zr,(e,t)=>{t.payload.apiBaseUrl&&(e.search.apiBaseUrl=t.payload.apiBaseUrl),t.payload.locale&&(e.search.locale=t.payload.locale),t.payload.timezone&&(e.search.timezone=t.payload.timezone),t.payload.authenticationProviders&&(e.search.authenticationProviders=t.payload.authenticationProviders)}).addCase(Vr,(e,t)=>{N(t.payload.enabled)||(e.analytics.enabled=t.payload.enabled),N(t.payload.originContext)||(e.analytics.originContext=t.payload.originContext),N(t.payload.originLevel2)||(e.analytics.originLevel2=t.payload.originLevel2),N(t.payload.originLevel3)||(e.analytics.originLevel3=t.payload.originLevel3),N(t.payload.apiBaseUrl)||(e.analytics.apiBaseUrl=t.payload.apiBaseUrl),N(t.payload.nextApiBaseUrl)||(e.analytics.nextApiBaseUrl=t.payload.nextApiBaseUrl),N(t.payload.trackingId)||(e.analytics.trackingId=t.payload.trackingId),N(t.payload.analyticsMode)||(e.analytics.analyticsMode=t.payload.analyticsMode),N(t.payload.source)||(e.analytics.source=t.payload.source);let r=(0,ms.default)();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r),N(t.payload.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.payload.runtimeEnvironment),N(t.payload.anonymous)||(e.analytics.anonymous=t.payload.anonymous),N(t.payload.deviceId)||(e.analytics.deviceId=t.payload.deviceId),N(t.payload.userDisplayName)||(e.analytics.userDisplayName=t.payload.userDisplayName),N(t.payload.documentLocation)||(e.analytics.documentLocation=t.payload.documentLocation)}).addCase(vs,(e,t)=>{N(t.payload.enabled)||(e.analytics.enabled=t.payload.enabled),N(t.payload.trackingId)||(e.analytics.trackingId=t.payload.trackingId),N(t.payload.source)||(e.analytics.source=t.payload.source)}).addCase(Br,e=>{e.analytics.enabled=!1}).addCase(ws,e=>{e.analytics.enabled=!1}).addCase(Hr,e=>{e.analytics.enabled=!0}).addCase(bs,e=>{e.analytics.enabled=!0}).addCase(Yr,(e,t)=>{e.analytics.originLevel2=t.payload.originLevel2}).addCase(Gr,(e,t)=>{e.analytics.originLevel3=t.payload.originLevel3}).addCase(Is,(e,t)=>{e.analytics.originLevel2=t.payload}).addCase(ks,(e,t)=>{e.analytics.originLevel2=t.payload.tab||e.analytics.originLevel2}));function xs(e,t){t.accessToken&&(e.accessToken=t.accessToken),t.organizationId&&(e.organizationId=t.organizationId),t.platformUrl&&(e.platformUrl=t.platformUrl,e.search.apiBaseUrl=`${t.platformUrl}${Es}`,e.analytics.apiBaseUrl=function(e,t){if((e=>/^https:\/\/platform(dev|stg|hipaa)?(-)?(eu|au)?\.cloud\.coveo\.com/.test(e))(e))return e.replace(/^(https:\/\/)platform/,"$1analytics")+Ds;let r=((e,t)=>{let r=be(e);return r&&r.organizationId===t?r:null})(e,t);return r?me(t,r.environment).analytics:e}(t.platformUrl,e.organizationId))}var Ts=Rs,_s=()=>e=>t=>e(function(e){return e.instantlyCallable}(t)?t():t),qs=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let i=n.error;return n.payload?.ignored||e.error(i.stack||i.message||i.name||"Error",`Action dispatch error ${n.type}`,r),"SchemaValidationError"!==n.error.name?t(r):void 0},Us=e=>({referrer:document.referrer,userAgent:navigator.userAgent,location:window.location.href,clientId:e});function js(e,t){let r=0,n=function(e,t,r){var n,i,a;void 0===t&&(t=50),void 0===r&&(r={});var o=null!=(n=r.isImmediate)&&n,s=null!=(i=r.callback)&&i,u=r.maxWait,c=Date.now(),l=[],d=function(){var r=[].slice.call(arguments),n=this;return new Promise(function(i,d){var p=o&&void 0===a;if(void 0!==a&&clearTimeout(a),a=setTimeout(function(){if(a=void 0,c=Date.now(),!o){var t=e.apply(n,r);s&&s(t),l.forEach(function(e){return(0,e.resolve)(t)}),l=[]}},function(){if(void 0!==u){var e=Date.now()-c;if(e+t>=u)return u-e}return t}()),p){var h=e.apply(n,r);return s&&s(h),i(h)}l.push({resolve:i,reject:d})})};return d.cancel=function(e){void 0!==a&&clearTimeout(a),l.forEach(function(t){return(0,t.reject)(e)}),l=[]},d}(()=>r=0,500);return i=>
2a=>async o=>{if("function"!=typeof o)return a(o);let s=await a(o);if(!function(e){return e?.error?.name===(new ue).name}(s))return s;if("function"!=typeof t)return e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),s;if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),s;r++,n();let u=await async function(e){try{return await e()}catch{return""}}(t);i.dispatch(Nr({accessToken:u})),i.dispatch(o)}}var Ms={configuration:Ts,version:ps};function Ps(e,t){let r=function(e,t){let{reducers:r}=e,n=function(e,t){let r,n={...e};return{get combinedReducer(){let e=function(e){let t={};for(let[r,n]of e)t[r]=n;return t}(Object.entries(t).filter(([e])=>!(e in n)).map(([e,t])=>[e,()=>t]));return(e=>(t,n)=>{let i=e(t,n);return r?r(i,n):i})(Pe({...e,...n}))},containsAll(e){return Object.keys(e).every(e=>e in n)},add(e){Object.keys(e).filter(e=>!(e in n)).forEach(t=>n[t]=e[t])},addCrossReducer(e){r=e}}}({...Ms,...r},e.preloadedState??{});e.crossReducer&&n.addCrossReducer(e.crossReducer);let i=t.logger,a=()=>{let e="";try{e=Xi(u.state).getMeta("").clientId}catch(e){i.warn("Error while obtaining clientID from relay",e)}return e},o={...t,get relay(){return Xi(u.state)},get navigatorContext(){return e.navigatorContextProvider?e.navigatorContextProvider():hs()?Us(a()):{referrer:null,userAgent:null,location:null,clientId:""}}},s=function(e,t,r){let{preloadedState:n,configuration:i}=e,a=i.name||"coveo-headless",o=function(e,t){let{renewAccessToken:r}=e.configuration,n=js(t,r);return[_s,n,qs(t),gs].concat(ss.middleware,e.middlewares||[])}(e,t.logger);return function({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:i}){return Wt({reducer:e,preloadedState:t,devTools:{stateSanitizer:e=>e.history?{...e,history:"<<OMIT>>"}:e,name:i,shouldHotReload:!1},middleware:e=>e({thunk:{extraArgument:n}}).prepend(...r).concat((e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n)))(n.logger))})}({preloadedState:n,reducer:r.combinedReducer,middlewares:o,thunkExtraArguments:t,name:a})}(e,o,n),u={addReducers(e){n.containsAll(e)||(n.add(e),s.replaceReducer(n.combinedReducer))},dispatch:s.dispatch,subscribe:s.subscribe,enableAnalytics(){s.dispatch(Hr())},disableAnalytics(){s.dispatch(Br())},get state(){return s.getState()},get relay(){return Xi(this.state)},get navigatorContext(){return e.navigatorContextProvider?e.navigatorContextProvider():hs()?Us(a()):{referrer:null,userAgent:null,location:null,clientId:""}},logger:i,store:s};return u}(e,t),{accessToken:n,organizationId:i}=e.configuration,{organizationEndpoints:a}=e.configuration,o=a?.platform||e.configuration.platformUrl;(function(e){return!N(e.platformUrl)||N(e.organizationEndpoints?.platform)})(e.configuration)&&r.logger.warn(`The \`platformUrl\` (${e.configuration.platformUrl}
2) option will be deprecated in the next major version. Consider using the \`organizationEndpoints\` option instead. See [Organization endpoints](https://docs.coveo.com/en/mcc80216).`),function(e){return L(e.organizationEndpoints)}(e.configuration)?r.logger.warn("The `organizationEndpoints` options was not explicitly set in the Headless engine configuration. Coveo recommends setting this option, as it has resiliency benefits and simplifies the overall configuration for multi-region deployments. See [Organization endpoints](https://docs.coveo.com/en/mcc80216)."):function(e){let{platform:t}=e.organizationEndpoints;if(L(t))return!1;let r=be(t);return r&&r.organizationId!==e.organizationId}(e.configuration)&&r.logger.warn(`There is a mismatch between the \`organizationId\` option (${e.configuration.organizationId}) and the organization configured in the \`organizationEndpoints\` option (${e.configuration.organizationEndpoints?.platform}). This could lead to issues that are complex to troubleshoot. Please make sure both values match.`),r.dispatch(Nr({accessToken:n,organizationId:i,platformUrl:o}));let s=function(e,t){let r=e.organizationEndpoints?.analytics||void 0,{analyticsClientMiddleware:n,...i}=e.analytics??{},a={...i,nextApiBaseUrl:`${r}/rest/organizations/${e.organizationId}/events/v1`,apiBaseUrl:r};if("next"!==a.analyticsMode&&function(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(e=>le.has(e))}())return t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1};if("next"===a.analyticsMode&&!i.trackingId)throw new $s('analytics.trackingId is required when analytics.analyticsMode="next"');return a}(e.configuration,r.logger);return s&&r.dispatch(Vr(s)),r}var $s=class extends Error{constructor(e){super(e),this.name="InvalidEngineConfiguration"}},Fs=p(j());function Ls(e,t){let r=function(e){let{analytics:t}=e;return t?.analyticsClientMiddleware||((e,t)=>t)}(e),n=Ur,i=function(e){return e.preprocessRequest||ee}(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:i,logger:t}}new G({required:!1,emptyAllowed:!1}),new G({required:!1,emptyAllowed:!1}),new W({options:{required:!1},values:{enabled:new V({required:!1}),originContext:new G({required:!1}),originLevel2:new G({required:!1}),originLevel3:new G({required:!1}),analyticsMode:new G({constrainTo:["legacy","next"],required:!1})}});var Ns={organizationId:Ar,accessToken:Ar,platformUrl:new G({required:!1,emptyAllowed:!1}),name:new G({required:!1,emptyAllowed:!1}),analytics:new W({options:{required:!1},values:{enabled:new V({required:!1}),originContext:new G({required:!1}),originLevel2:new G({required:!1}),originLevel3:new G({required:!1}),analyticsMode:new G({constrainTo:["legacy"],required:!1})}}),searchHub:Er,locale:Er,timezone:Er},zs=new $(Ns),Qs={searchHub:Ra,productRecommendations:Ca};var Vs=new Z({each:Ar,required:!0}),Bs=(e,t)=>(jr(e,Ar),K(t)?jr(t,Ar):jr(t,Vs),{payload:{contextKey:e,contextValue:t}}),Hs=zt("context/set",e=>{for(let[t,r]of Object.entries(e))Bs(t,r);return{payload:e}}),Ys=zt("context/add",e=>Bs(e.contextKey,e.contextValue)),Gs=zt("context/remove",e=>jr(e,Ar));Zt({contextValues:{}},e=>{e.addCase(Hs,(e,t)=>{e.contextValues=t.payload}).addCase(Ys,(e,t)=>{e.contextValues[t.payload.contextKey]=t.payload.contextValue}).addCase(Gs,(e,t)=>{delete e.contextValues[t.payload]}).addCase(Da.fulfilled,(e,t)=>{t.payload&&(e.contextValues=t.payload.context.contextValues)})});var Ks=zt("dictionaryFieldContext/set",e=>{let t=new W({options:{required:!0}}),r=jr(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),i=new Z({each:Dr}),a=jr(n,i).error;return a?{payload:e,error:a}:{payload:e}}),Ws=zt("dictionaryFieldContext/add",e=>{let t=new W({options:{required:!0},values:{field:Dr,key:Dr}});return jr(e,t)}),Js=zt("dictionaryFieldContext/remove",e=>jr(e,Dr));Zt({contextValues:{}},e=>{e.addCase(Ks,(e,t)=>{e.contextValues=t.payload}).addCase(Ws,(e,t)=>{let{field:r,key:n}=t.payload;e.contextValues[r]=n}).addCase(Js,(e,t)=>{delete e.contextValues[t.payload]}).addCase(Da.fulfilled,(e,t)=>{t.payload&&(e.contextValues=t.payload.dictionaryFieldContext.contextValues)})});var Zs={additionalFields:new Z({required:!1,each:Er}),skus:new Z({required:!1,each:Er}),maxNumberOfRecommendations:new z({required:!1,max:50,min:1,default:5})},Xs=new $({id:Ar,...Zs}),eu=(e,t={})=>{!function(e){e.addReducers({productRecommendations:Ca,configuration:Ts})}(e);let r=function(e){let t,r=new Map,n=()=>
20===r.size;return{subscribe(i){i();let a,o=Symbol();return n()&&(t=JSON.stringify(this.state),a=e.subscribe(()=>{(e=>{try{let r=JSON.stringify(e),n=t!==r;return t=r,n}catch(e){return console.warn('Could not detect if state has changed, check the controller "get state method"',e),!0}})(this.state)&&r.forEach(e=>e())})),r.set(o,i),()=>{r.delete(o),n()&&a&&a()}},get state(){return{}}}}(e),{dispatch:n}=e,i=Mr(e,Xs,t.options,"buildBaseProductRecommendationsList");return n(ga({id:i.id})),n(ba({number:i.maxNumberOfRecommendations})),i.additionalFields&&n(wa({additionalFields:i.additionalFields})),i.skus&&n(ma({skus:i.skus})),{...r,setSkus(e){n(ma({skus:e}))},refresh(){n(Sa())},get state(){let{skus:t,maxNumberOfRecommendations:r,recommendations:n,error:i,isLoading:a}=e.state.productRecommendations;return{skus:t,maxNumberOfRecommendations:r,recommendations:n,error:i,isLoading:a}}}},tu=new $({sku:new G({required:!0,emptyAllowed:!1}),maxNumberOfRecommendations:Zs.maxNumberOfRecommendations,additionalFields:Zs.additionalFields});new $({...Zs}),new $({...Zs}),new $({maxNumberOfRecommendations:Zs.maxNumberOfRecommendations,additionalFields:Zs.additionalFields}),new $({maxNumberOfRecommendations:Zs.maxNumberOfRecommendations,additionalFields:Zs.additionalFields}),new $({maxNumberOfRecommendations:Zs.maxNumberOfRecommendations,additionalFields:Zs.additionalFields}),new $({values:new W({options:{required:!1}})}),new $({...Zs}),new $({...Zs}),typeof window<"u"||(M()||(r.g.crypto=l("crypto")),!M().getRandomValues&&M().webcrypto&&(r.g.crypto.getRandomValues=M().webcrypto.getRandomValues.bind(M().webcrypto))),r.d(t,["atomic_frequently_bought_together",0,class{constructor(e){(0,n.r)(this,e),this.unsubscribe=()=>{},this.state=void 0}componentWillLoad(){const e={organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457",organizationEndpoints:me("searchuisamples"),searchHub:"default"};this.engine=function(e){let t=function(e){return(0,Fs.default)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}(e.loggerOptions);!function(e,t){try{zs.validate(e)}catch(e){throw t.error("Product Recommendation engine configuration error",e),e}}(e.configuration,t);let r=function(e,t){return new Oe({logger:t,preprocessRequest:e.preprocessRequest||ee,postprocessSearchResponseMiddleware:De,postprocessFacetSearchResponseMiddleware:Re,postprocessQuerySuggestResponseMiddleware:xe})}(e.configuration,t),n={...Ls(e.configuration,t),apiClient:r},i=Ps({...e,reducers:Qs},n),{searchHub:a,timezone:o,locale:s}=e.configuration;return i.dispatch(zr({timezone:o,locale:s})),N(a)||i.dispatch(Oa(a)),{...i,get state(){return i.state}}}({configuration:{...e,searchHub:"frequently_bought_recommendations"}}),this.frequentlyBoughtTogether=function(e,t){let r=Mr(e,tu,t.options,"buildFrequentlyBoughtTogetherList"),n=eu(e,{...t,options:{maxNumberOfRecommendations:r.maxNumberOfRecommendations,additionalFields:r.additionalFields,skus:[r.sku],id:"frequentBought"}}),{setSkus:i,...a}=n;return{...a,setSku(e){i([e])},get state(){let{skus:e,...t}=n.state;return{...t,sku:e[0]}}}}(this.engine,{options:{sku:"abc"}}),this.unsubscribe=this.frequentlyBoughtTogether.subscribe(()=>this.updateState()),this.frequentlyBoughtTogether.refresh()}disconnectedCallback(){this.unsubscribe()}updateState(){this.state=this.frequentlyBoughtTogether.state}render(){return(0,n.h)("div",{key:"b64870885d668475b543f5382ce2c9bca593ad95"},"FREQUENTLY BOUGHT TOGETHER:",(0,n.h)("ul",{key:"153108ef11d145bff7435dce9ac7fd15e8ec71e7"},this.state.recommendations.map(e=>(0,n.h)("li",null,e.ec_name))))}}])}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.