@coveo/headless 3.25.1 → 3.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -814,7 +814,7 @@ var import_bueno5 = require("@coveo/bueno");
814
814
  var import_toolkit7 = require("@reduxjs/toolkit");
815
815
 
816
816
  // src/utils/version.ts
817
- var VERSION = "3.25.1";
817
+ var VERSION = "3.25.2";
818
818
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
819
819
 
820
820
  // src/features/configuration/configuration-actions.ts
@@ -803,7 +803,7 @@ import {
803
803
  import { createAction as createAction5 } from "@reduxjs/toolkit";
804
804
 
805
805
  // src/utils/version.ts
806
- var VERSION = "3.25.1";
806
+ var VERSION = "3.25.2";
807
807
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
808
808
 
809
809
  // src/features/configuration/configuration-actions.ts
@@ -1181,7 +1181,7 @@ var import_bueno7 = require("@coveo/bueno");
1181
1181
  var import_toolkit4 = require("@reduxjs/toolkit");
1182
1182
 
1183
1183
  // src/utils/version.ts
1184
- var VERSION = "3.25.1";
1184
+ var VERSION = "3.25.2";
1185
1185
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
1186
1186
 
1187
1187
  // src/features/configuration/configuration-actions.ts
@@ -1125,7 +1125,7 @@ import {
1125
1125
  import { createAction } from "@reduxjs/toolkit";
1126
1126
 
1127
1127
  // src/utils/version.ts
1128
- var VERSION = "3.25.1";
1128
+ var VERSION = "3.25.2";
1129
1129
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
1130
1130
 
1131
1131
  // src/features/configuration/configuration-actions.ts
package/dist/headless.cjs CHANGED
@@ -1380,7 +1380,7 @@ var import_toolkit2 = require("@reduxjs/toolkit");
1380
1380
  var import_toolkit = require("@reduxjs/toolkit");
1381
1381
 
1382
1382
  // src/utils/version.ts
1383
- var VERSION = "3.25.1";
1383
+ var VERSION = "3.25.2";
1384
1384
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
1385
1385
 
1386
1386
  // src/api/analytics/analytics-selectors.ts
@@ -1263,7 +1263,7 @@ import { createSelector as createSelector2 } from "@reduxjs/toolkit";
1263
1263
  import { createSelector } from "@reduxjs/toolkit";
1264
1264
 
1265
1265
  // src/utils/version.ts
1266
- var VERSION = "3.25.1";
1266
+ var VERSION = "3.25.2";
1267
1267
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
1268
1268
 
1269
1269
  // src/api/analytics/analytics-selectors.ts
@@ -1287,7 +1287,7 @@ var import_toolkit2 = require("@reduxjs/toolkit");
1287
1287
  var import_toolkit = require("@reduxjs/toolkit");
1288
1288
 
1289
1289
  // src/utils/version.ts
1290
- var VERSION = "3.25.1";
1290
+ var VERSION = "3.25.2";
1291
1291
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
1292
1292
 
1293
1293
  // src/api/analytics/analytics-selectors.ts
@@ -1229,7 +1229,7 @@ import { createSelector as createSelector2 } from "@reduxjs/toolkit";
1229
1229
  import { createSelector } from "@reduxjs/toolkit";
1230
1230
 
1231
1231
  // src/utils/version.ts
1232
- var VERSION = "3.25.1";
1232
+ var VERSION = "3.25.2";
1233
1233
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
1234
1234
 
1235
1235
  // src/api/analytics/analytics-selectors.ts
@@ -24,7 +24,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24
24
  `)}
25
25
 
26
26
  ${t}
27
- `;return new zo(r)}var zo=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},je=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw Vp(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Rt=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&K(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Bt(e){return e===void 0}function Bp(e){return e===null}function K(e){return Bt(e)||Bp(e)}var xe=class{constructor(e={}){ce(this,"value");this.config=e,this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t||(Qp(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 Qp(e){return Bt(e)||Sa(e)}function Sa(e){return typeof e=="number"&&!isNaN(e)}var pe=class{constructor(e={}){ce(this,"value");this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t||($p(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function $p(e){return Bt(e)||va(e)}function va(e){return typeof e=="boolean"}var Hp=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,W=class{constructor(e={}){ce(this,"value");ce(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Rt(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,s=this.value.validate(e);if(s)return s;if(Bt(e))return null;if(!Ca(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Hp.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function Ca(e){return Object.prototype.toString.call(e)==="[object String]"}var se=class{constructor(e={}){ce(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Bt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Aa(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&K(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=" "+i)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Aa(e){return e!==void 0&&typeof e=="object"}var Xe=class{constructor(e={}){ce(this,"value");this.config=e,this.value=new Rt(this.config)}validate(e){if(!K(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(K(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&K(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=" "+o)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return va(e)||Ca(e)||Sa(e)||Aa(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function ba(e){return Array.isArray(e)}var Go=class{constructor(e){ce(this,"value");this.config=e,this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Bt(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};g();d();f();p();var on=e=>e;g();d();f();p();g();d();f();p();var La=Me(Ta(),1);g();d();f();p();g();d();f();p();var Sf="recommendation-internal-options",oA=Symbol.for(Sf);var Ne=new Error("Failed to load reducers."),Qt=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var It=class extends Error{constructor(r,n){super();ce(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};g();d();f();p();function Oa(e){return Array.isArray(e)}function Fa(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}var vf=new Set(["1",1,"yes",!0]);function Da(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>vf.has(r))}function Ma(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Ir(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}g();d();f();p();function Na(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function qa(e){return typeof e!="object"||!e?!1:Object.values(e).every(Cf)}function Cf(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function _a(e){return e===429}var ct=class e{static async call(t){let r=Af(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...s}=o,u=async()=>{let c=await w(i,s);if(_a(c.status))throw c;return c};try{let c=await(0,La.backOff)(u,{retry:a=>{let h=a&&_a(a.status);return h&&n.info("Platform retrying request"),h}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Qt;case 404:throw new It(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new It(i):c}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:s}=r,{signal:u,...c}=t,a=Ir(c);try{let h=await o(t,n,s);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return a}};function fe(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function $t(e,t="prod"){return`${fe(e,t)}/rest/search/v2`}function an(e,t="prod"){return`${fe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Af(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:s}=e,u=e.method==="POST"||e.method==="PUT",c=bf(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...u&&{body:c},signal:s}}function bf(e,t){return t==="application/x-www-form-urlencoded"?qa(e)?Na(e):"":JSON.stringify(e)}g();d();f();p();g();d();f();p();var Ht=class{constructor(t){ce(this,"_basePath");ce(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}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(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};g();d();f();p();function ri(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var ni=e=>{let{response:t}=e;return t.body?wf(e):xf(t)},wf=e=>Ef(e)?If(e):Rf(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},xf=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Rf(e){return e.body.statusCode!==void 0}function Ef(e){return e.body.exception!==void 0}var If=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});g();d();f();p();function ja(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}g();d();f();p();var oi=(e,t,r,n)=>{let o=new Ht(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Ua=(e,t)=>{let r=new Ht(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},ii=async(e,t)=>{let r=await ct.call({...oi(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ri(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=ja(r),o=await r.arrayBuffer(),s=new TextDecoder(n).decode(o);return Pf(s)?{success:s}:{error:ni({response:r,body:s})}};function Pf(e){return typeof e=="string"}g();d();f();p();function kf(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Tf(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function cn(e,t){if(t&&e.name==="AbortError")return{error:Tf(e)};if(e instanceof It)return{error:kf(e)};throw e}g();d();f();p();g();d();f();p();var un=(e,t,r,n,o={})=>{Of(e);let i=`${e.url}/rest/organizations/${e.organizationId}/caseassists/${e.caseAssistId}${n}`,s=Ff(o),u=s?`${i}?${s}`:i;return{accessToken:e.accessToken,method:t,contentType:r,url:u,origin:"caseAssistApiFetch"}},ln=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r]}),{}),dn=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r].value}),{}),Of=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.");if(!e.caseAssistId)throw new Error("The 'caseAssistId' attribute must contain a valid Case Assist configuration ID.")},Ff=e=>Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&");var Va=e=>{let t=e.debug?{debug:"1"}:{};return{...un(e,"POST","application/json","/classify",t),requestParams:Df(e)}},Df=e=>({clientId:e.clientId,locale:e.locale,fields:ln(e.fields)});g();d();f();p();var Ba=e=>{let t={};return e.debug&&(t.debug="1"),e.numberOfResults&&(t.numberOfResults=e.numberOfResults.toString()),{...un(e,"POST","application/json","/documents/suggest",t),requestParams:Mf(e)}},Mf=e=>({clientId:e.clientId,locale:e.locale,fields:ln(e.fields),context:e.context,analytics:e.analytics});var pn=class{constructor(t){this.options=t}async getCaseClassifications(t){let r=await ct.call({...Va(t),...this.options});if(r instanceof Error)return cn(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async getDocumentSuggestions(t){let r=await ct.call({...Ba(t),...this.options});if(r instanceof Error)return cn(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async html(t){return ii(t,this.options)}};g();d();f();p();g();d();f();p();g();d();f();p();function ye(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 Nf=typeof Symbol=="function"&&Symbol.observable||"@@observable",Qa=Nf,si=()=>Math.random().toString(36).substring(7).split("").join("."),qf={INIT:`@@redux/INIT${si()}`,REPLACE:`@@redux/REPLACE${si()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${si()}`},fn=qf;function Qe(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ai(e,t,r){if(typeof e!="function")throw new Error(ye(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ye(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ye(1));return r(ai)(e,t)}let n=e,o=t,i=new Map,s=i,u=0,c=!1;function a(){s===i&&(s=new Map,i.forEach((E,A)=>{s.set(A,E)}))}function h(){if(c)throw new Error(ye(3));return o}function y(E){if(typeof E!="function")throw new Error(ye(4));if(c)throw new Error(ye(5));let A=!0;a();let k=u++;return s.set(k,E),function(){if(A){if(c)throw new Error(ye(6));A=!1,a(),s.delete(k),i=null}}}function S(E){if(!Qe(E))throw new Error(ye(7));if(typeof E.type>"u")throw new Error(ye(8));if(typeof E.type!="string")throw new Error(ye(17));if(c)throw new Error(ye(9));try{c=!0,o=n(o,E)}finally{c=!1}return(i=s).forEach(k=>{k()}),E}function m(E){if(typeof E!="function")throw new Error(ye(10));n=E,S({type:fn.REPLACE})}function v(){let E=y;return{subscribe(A){if(typeof A!="object"||A===null)throw new Error(ye(11));function k(){let I=A;I.next&&I.next(h())}return k(),{unsubscribe:E(k)}},[Qa](){return this}}}return S({type:fn.INIT}),{dispatch:S,subscribe:y,getState:h,replaceReducer:m,[Qa]:v}}function _f(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:fn.INIT})>"u")throw new Error(ye(12));if(typeof r(void 0,{type:fn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ye(13))})}function zt(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let u=t[s];typeof e[u]=="function"&&(r[u]=e[u])}let n=Object.keys(r),o,i;try{_f(r)}catch(s){i=s}return function(u={},c){if(i)throw i;let a=!1,h={};for(let y=0;y<n.length;y++){let S=n[y],m=r[S],v=u[S],x=m(v,c);if(typeof x>"u"){let E=c&&c.type;throw new Error(ye(14))}h[S]=x,a=a||x!==v}return a=a||n.length!==Object.keys(u).length,a?h:u}}function Gt(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function $a(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(ye(15))},s={getState:o.getState,dispatch:(c,...a)=>i(c,...a)},u=e.map(c=>c(s));return i=Gt(...u)(o.dispatch),{...o,dispatch:i}}}function gn(e){return Qe(e)&&"type"in e&&typeof e.type=="string"}g();d();f();p();var yi=Symbol.for("immer-nothing"),Pr=Symbol.for("immer-draftable"),Re=Symbol.for("immer-state");function Se(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var kt=Object.getPrototypeOf;function ke(e){return!!e&&!!e[Re]}function Ee(e){return e?Ka(e)||Array.isArray(e)||!!e[Pr]||!!e.constructor?.[Pr]||Dr(e)||Mr(e):!1}var Lf=Object.prototype.constructor.toString();function Ka(e){if(!e||typeof e!="object")return!1;let t=kt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Lf}function Si(e){return ke(e)||Se(15,e),e[Re].base_}function kr(e,t){Tt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Tt(e){let t=e[Re];return t?t.type_:Array.isArray(e)?1:Dr(e)?2:Mr(e)?3:0}function Tr(e,t){return Tt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ci(e,t){return Tt(e)===2?e.get(t):e[t]}function Ya(e,t,r){let n=Tt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function jf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Dr(e){return e instanceof Map}function Mr(e){return e instanceof Set}function Pt(e){return e.copy_||e.base_}function di(e,t){if(Dr(e))return new Map(e);if(Mr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Ka(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Re];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let s=o[i],u=n[s];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[s]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[s]})}return Object.create(kt(e),n)}else{let n=kt(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function yn(e,t=!1){return Sn(e)||ke(e)||!Ee(e)||(Tt(e)>1&&(e.set=e.add=e.clear=e.delete=Uf),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>yn(n,!0))),e}function Uf(){Se(2)}function Sn(e){return Object.isFrozen(e)}var pi={};function Ot(e){let t=pi[e];return t||Se(0,e),t}function Vf(e,t){pi[e]||(pi[e]=t)}var Or;function Ja(){return Or}function Bf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ha(e,t){t&&(Ot("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fi(e){gi(e),e.drafts_.forEach(Qf),e.drafts_=null}function gi(e){e===Or&&(Or=e.parent_)}function za(e){return Or=Bf(Or,e)}function Qf(e){let t=e[Re];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ga(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Re].modified_&&(fi(t),Se(4)),Ee(e)&&(e=mn(t,e),t.parent_||hn(t,e)),t.patches_&&Ot("Patches").generateReplacementPatches_(r[Re].base_,e,t.patches_,t.inversePatches_)):e=mn(t,r,[]),fi(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yi?e:void 0}function mn(e,t,r){if(Sn(t))return t;let n=t[Re];if(!n)return kr(t,(o,i)=>Wa(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return hn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,s=!1;n.type_===3&&(i=new Set(o),o.clear(),s=!0),kr(i,(u,c)=>Wa(e,n,o,u,c,r,s)),hn(e,o,!1),r&&e.patches_&&Ot("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Wa(e,t,r,n,o,i,s){if(ke(o)){let u=i&&t&&t.type_!==3&&!Tr(t.assigned_,n)?i.concat(n):void 0,c=mn(e,o,u);if(Ya(r,n,c),ke(c))e.canAutoFreeze_=!1;else return}else s&&r.add(o);if(Ee(o)&&!Sn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;mn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&hn(e,o)}}function hn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yn(t,r)}function $f(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Ja(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=vi;r&&(o=[n],i=Fr);let{revoke:s,proxy:u}=Proxy.revocable(o,i);return n.draft_=u,n.revoke_=s,u}var vi={get(e,t){if(t===Re)return e;let r=Pt(e);if(!Tr(r,t))return Hf(e,r,t);let n=r[t];return e.finalized_||!Ee(n)?n:n===ui(e.base_,t)?(li(e),e.copy_[t]=hi(n,e)):n},has(e,t){return t in Pt(e)},ownKeys(e){return Reflect.ownKeys(Pt(e))},set(e,t,r){let n=Xa(Pt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ui(Pt(e),t),i=o?.[Re];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(jf(r,o)&&(r!==void 0||Tr(e.base_,t)))return!0;li(e),mi(e)}return e.copy_[t]===r&&(r!==void 0||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 ui(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,li(e),mi(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Pt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Se(11)},getPrototypeOf(e){return kt(e.base_)},setPrototypeOf(){Se(12)}},Fr={};kr(vi,(e,t)=>{Fr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Fr.deleteProperty=function(e,t){return Fr.set.call(this,e,t,void 0)};Fr.set=function(e,t,r){return vi.set.call(this,e[0],t,r,e[0])};function ui(e,t){let r=e[Re];return(r?Pt(r):e)[t]}function Hf(e,t,r){let n=Xa(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Xa(e,t){if(!(t in e))return;let r=kt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=kt(r)}}function mi(e){e.modified_||(e.modified_=!0,e.parent_&&mi(e.parent_))}function li(e){e.copy_||(e.copy_=di(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let s=this;return function(c=i,...a){return s.produce(c,h=>r.call(this,h,...a))}}typeof r!="function"&&Se(6),n!==void 0&&typeof n!="function"&&Se(7);let o;if(Ee(t)){let i=za(this),s=hi(t,void 0),u=!0;try{o=r(s),u=!1}finally{u?fi(i):gi(i)}return Ha(i,n),Ga(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===yi&&(o=void 0),this.autoFreeze_&&yn(o,!0),n){let i=[],s=[];Ot("Patches").generateReplacementPatches_(t,o,i,s),n(i,s)}return o}else Se(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...u)=>this.produceWithPatches(s,c=>t(c,...u));let n,o;return[this.produce(t,r,(s,u)=>{n=s,o=u}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ee(e)||Se(8),ke(e)&&(e=Za(e));let t=za(this),r=hi(e,void 0);return r[Re].isManual_=!0,gi(t),r}finishDraft(e,t){let r=e&&e[Re];(!r||!r.isManual_)&&Se(9);let{scope_:n}=r;return Ha(n,t),Ga(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 o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Ot("Patches").applyPatches_;return ke(e)?n(e,t):this.produce(e,o=>n(o,t))}};function hi(e,t){let r=Dr(e)?Ot("MapSet").proxyMap_(e,t):Mr(e)?Ot("MapSet").proxySet_(e,t):$f(e,t);return(t?t.scope_:Ja()).drafts_.push(r),r}function Za(e){return ke(e)||Se(10,e),ec(e)}function ec(e){if(!Ee(e)||Sn(e))return e;let t=e[Re],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=di(e,t.scope_.immer_.useStrictShallowCopy_)}else r=di(e,!0);return kr(r,(n,o)=>{Ya(r,n,ec(o))}),t&&(t.finalized_=!1),r}function tc(){let t="replace",r="add",n="remove";function o(S,m,v,x){switch(S.type_){case 0:case 2:return s(S,m,v,x);case 1:return i(S,m,v,x);case 3:return u(S,m,v,x)}}function i(S,m,v,x){let{base_:E,assigned_:A}=S,k=S.copy_;k.length<E.length&&([E,k]=[k,E],[v,x]=[x,v]);for(let b=0;b<E.length;b++)if(A[b]&&k[b]!==E[b]){let I=m.concat([b]);v.push({op:t,path:I,value:y(k[b])}),x.push({op:t,path:I,value:y(E[b])})}for(let b=E.length;b<k.length;b++){let I=m.concat([b]);v.push({op:r,path:I,value:y(k[b])})}for(let b=k.length-1;E.length<=b;--b){let I=m.concat([b]);x.push({op:n,path:I})}}function s(S,m,v,x){let{base_:E,copy_:A}=S;kr(S.assigned_,(k,b)=>{let I=ci(E,k),N=ci(A,k),O=b?Tr(E,k)?t:r:n;if(I===N&&O===t)return;let P=m.concat(k);v.push(O===n?{op:O,path:P}:{op:O,path:P,value:N}),x.push(O===r?{op:n,path:P}:O===n?{op:r,path:P,value:y(I)}:{op:t,path:P,value:y(I)})})}function u(S,m,v,x){let{base_:E,copy_:A}=S,k=0;E.forEach(b=>{if(!A.has(b)){let I=m.concat([k]);v.push({op:n,path:I,value:b}),x.unshift({op:r,path:I,value:b})}k++}),k=0,A.forEach(b=>{if(!E.has(b)){let I=m.concat([k]);v.push({op:r,path:I,value:b}),x.unshift({op:n,path:I,value:b})}k++})}function c(S,m,v,x){v.push({op:t,path:[],value:m===yi?void 0:m}),x.push({op:t,path:[],value:S})}function a(S,m){return m.forEach(v=>{let{path:x,op:E}=v,A=S;for(let N=0;N<x.length-1;N++){let O=Tt(A),P=x[N];typeof P!="string"&&typeof P!="number"&&(P=""+P),(O===0||O===1)&&(P==="__proto__"||P==="constructor")&&Se(19),typeof A=="function"&&P==="prototype"&&Se(19),A=ci(A,P),typeof A!="object"&&Se(18,x.join("/"))}let k=Tt(A),b=h(v.value),I=x[x.length-1];switch(E){case t:switch(k){case 2:return A.set(I,b);case 3:Se(16);default:return A[I]=b}case r:switch(k){case 1:return I==="-"?A.push(b):A.splice(I,0,b);case 2:return A.set(I,b);case 3:return A.add(b);default:return A[I]=b}case n:switch(k){case 1:return A.splice(I,1);case 2:return A.delete(I);case 3:return A.delete(v.value);default:return delete A[I]}default:Se(17,E)}}),S}function h(S){if(!Ee(S))return S;if(Array.isArray(S))return S.map(h);if(Dr(S))return new Map(Array.from(S.entries()).map(([v,x])=>[v,h(x)]));if(Mr(S))return new Set(Array.from(S).map(h));let m=Object.create(kt(S));for(let v in S)m[v]=h(S[v]);return Tr(S,Pr)&&(m[Pr]=S[Pr]),m}function y(S){return ke(S)?h(S):S}Vf("Patches",{applyPatches_:a,generatePatches_:o,generateReplacementPatches_:c})}var Te=new zf,et=Te.produce,vn=Te.produceWithPatches.bind(Te),iw=Te.setAutoFreeze.bind(Te),sw=Te.setUseStrictShallowCopy.bind(Te),Ci=Te.applyPatches.bind(Te),aw=Te.createDraft.bind(Te),cw=Te.finishDraft.bind(Te);g();d();f();p();function Gf(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Wf(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Kf(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var rc=e=>Array.isArray(e)?e:[e];function Yf(e){let t=Array.isArray(e[0])?e[0]:e;return Kf(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Jf(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var mw=Symbol();var hw=Object.getPrototypeOf({});var Xf=class{constructor(e){this.value=e}deref(){return this.value}},Zf=typeof WeakRef<"u"?WeakRef:Xf,eg=0,nc=1;function Cn(){return{s:eg,v:void 0,o:null,p:null}}function Wt(e,t={}){let r=Cn(),{resultEqualityCheck:n}=t,o,i=0;function s(){let u=r,{length:c}=arguments;for(let y=0,S=c;y<S;y++){let m=arguments[y];if(typeof m=="function"||typeof m=="object"&&m!==null){let v=u.o;v===null&&(u.o=v=new WeakMap);let x=v.get(m);x===void 0?(u=Cn(),v.set(m,u)):u=x}else{let v=u.p;v===null&&(u.p=v=new Map);let x=v.get(m);x===void 0?(u=Cn(),v.set(m,u)):u=x}}let a=u,h;if(u.s===nc)h=u.v;else if(h=e.apply(null,arguments),i++,n){let y=o?.deref?.()??o;y!=null&&n(y,h)&&(h=y,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new Zf(h):h}return a.s=nc,a.v=h,h}return s.clearCache=()=>{r=Cn(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function oc(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,s=0,u,c={},a=o.pop();typeof a=="object"&&(c=a,a=o.pop()),Gf(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let h={...r,...c},{memoize:y,memoizeOptions:S=[],argsMemoize:m=Wt,argsMemoizeOptions:v=[],devModeChecks:x={}}=h,E=rc(S),A=rc(v),k=Yf(o),b=y(function(){return i++,a.apply(null,arguments)},...E),I=!0,N=m(function(){s++;let P=Jf(k,arguments);return u=b.apply(null,P),u},...A);return Object.assign(N,{resultFunc:a,memoizedResultFunc:b,dependencies:k,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>u,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:y,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var ae=oc(Wt),tg=Object.assign((e,t=ae)=>{Wf(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),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((s,u,c)=>(s[r[c]]=u,s),{}))},{withTypes:()=>tg});g();d();f();p();function ic(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var sc=ic(),ac=ic;var rg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Gt:Gt.apply(null,arguments)},Mw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},ng=e=>e&&typeof e.match=="function";function Q(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ue(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>gn(n)&&n.type===e,r}var pc=class Nr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Nr.prototype)}static get[Symbol.species](){return Nr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Nr(...t[0].concat(this)):new Nr(...t.concat(this))}};function cc(e){return Ee(e)?et(e,()=>{}):e}function uc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function og(e){return typeof e=="boolean"}var ig=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},s=new pc;return r&&(og(r)?s.push(sc):s.push(ac(r.extraArgument))),s},qr="RTK_autoBatch",Yt=()=>e=>({payload:e,meta:{[qr]:!0}}),lc=e=>t=>{setTimeout(t,e)},sg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,s=!1,u=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:lc(10):e.type==="callback"?e.queueNotification:lc(e.timeout),a=()=>{s=!1,i&&(i=!1,u.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let y=()=>o&&h(),S=n.subscribe(y);return u.add(h),()=>{S(),u.delete(h)}},dispatch(h){try{return o=!h?.meta?.[qr],i=!o,i&&(s||(s=!0,c(a))),n.dispatch(h)}finally{o=!0}}})},ag=e=>function(r){let{autoBatch:n=!0}=r??{},o=new pc(e);return n&&o.push(sg(typeof n=="object"?n:void 0)),o};function fc(e){let t=ig(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:s=void 0}=e||{},u;if(typeof r=="function")u=r;else if(Qe(r))u=zt(r);else throw new Error(Ue(1));let c;typeof n=="function"?c=n(t):c=t();let a=Gt;o&&(a=rg({trace:!1,...typeof o=="object"&&o}));let h=$a(...c),y=ag(h),S=typeof s=="function"?s(y):y(),m=a(...S);return ai(u,i,m)}function gc(e){let t={},r=[],n,o={addCase(i,s){let u=typeof i=="string"?i:i.type;if(!u)throw new Error(Ue(28));if(u in t)throw new Error(Ue(29));return t[u]=s,o},addMatcher(i,s){return r.push({matcher:i,reducer:s}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function cg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=gc(t),i;if(cg(e))i=()=>cc(e());else{let u=cc(e);i=()=>u}function s(u=i(),c){let a=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return a.filter(h=>!!h).length===0&&(a=[o]),a.reduce((h,y)=>{if(y)if(ke(h)){let m=y(h,c);return m===void 0?h:m}else{if(Ee(h))return et(h,S=>y(S,c));{let S=y(h,c);if(S===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return h},u)}return s.getInitialState=i,s}var mc=(e,t)=>ng(e)?e.match(t):e(t);function $e(...e){return t=>e.some(r=>mc(r,t))}function Kt(...e){return t=>e.every(r=>mc(r,t))}function bn(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function _r(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function wn(...e){return e.length===0?t=>bn(t,["pending"]):_r(e)?$e(...e.map(t=>t.pending)):wn()(e[0])}function Ft(...e){return e.length===0?t=>bn(t,["rejected"]):_r(e)?$e(...e.map(t=>t.rejected)):Ft()(e[0])}function Lr(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Kt(Ft(...e),t):_r(e)?Kt(Ft(...e),t):Lr()(e[0])}function tt(...e){return e.length===0?t=>bn(t,["fulfilled"]):_r(e)?$e(...e.map(t=>t.fulfilled)):tt()(e[0])}function xn(...e){return e.length===0?t=>bn(t,["pending","fulfilled","rejected"]):_r(e)?$e(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):xn()(e[0])}var ug="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Rn=(e=21)=>{let t="",r=e;for(;r--;)t+=ug[Math.random()*64|0];return t},lg=["name","message","stack","code"],Ai=class{constructor(e,t){ce(this,"_type");this.payload=e,this.meta=t}},dc=class{constructor(e,t){ce(this,"_type");this.payload=e,this.meta=t}},dg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of lg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},oe=(()=>{function e(t,r,n){let o=Q(t+"/fulfilled",(c,a,h,y)=>({payload:c,meta:{...y||{},arg:h,requestId:a,requestStatus:"fulfilled"}})),i=Q(t+"/pending",(c,a,h)=>({payload:void 0,meta:{...h||{},arg:a,requestId:c,requestStatus:"pending"}})),s=Q(t+"/rejected",(c,a,h,y,S)=>({payload:y,error:(n&&n.serializeError||dg)(c||"Rejected"),meta:{...S||{},arg:h,requestId:a,rejectedWithValue:!!y,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function u(c){return(a,h,y)=>{let S=n?.idGenerator?n.idGenerator(c):Rn(),m=new l.AbortController,v,x;function E(k){x=k,m.abort()}let A=async function(){let k;try{let I=n?.condition?.(c,{getState:h,extra:y});if(fg(I)&&(I=await I),I===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((O,P)=>{v=()=>{P({name:"AbortError",message:x||"Aborted"})},m.signal.addEventListener("abort",v)});a(i(S,c,n?.getPendingMeta?.({requestId:S,arg:c},{getState:h,extra:y}))),k=await Promise.race([N,Promise.resolve(r(c,{dispatch:a,getState:h,extra:y,requestId:S,signal:m.signal,abort:E,rejectWithValue:(O,P)=>new Ai(O,P),fulfillWithValue:(O,P)=>new dc(O,P)})).then(O=>{if(O instanceof Ai)throw O;return O instanceof dc?o(O.payload,S,c,O.meta):o(O,S,c)})])}catch(I){k=I instanceof Ai?s(null,S,c,I.payload,I.meta):s(I,S,c)}finally{v&&m.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&s.match(k)&&k.meta.condition||a(k),k}();return Object.assign(A,{abort:E,requestId:S,arg:c,unwrap(){return A.then(pg)}})}}return Object.assign(u,{pending:i,rejected:s,fulfilled:o,settled:$e(s,o),typePrefix:t})}return e.withTypes=()=>e,e})();function pg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function fg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var hc=Symbol.for("rtk-slice-createasyncthunk"),jw={[hc]:oe};function gg(e,t){return`${e}/${t}`}function mg({creators:e}={}){let t=e?.asyncThunk?.[hc];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ue(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(yg()):n.reducers)||{},u=Object.keys(s),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(k,b){let I=typeof k=="string"?k:k.type;if(!I)throw new Error(Ue(12));if(I in c.sliceCaseReducersByType)throw new Error(Ue(13));return c.sliceCaseReducersByType[I]=b,a},addMatcher(k,b){return c.sliceMatchers.push({matcher:k,reducer:b}),a},exposeAction(k,b){return c.actionCreators[k]=b,a},exposeCaseReducer(k,b){return c.sliceCaseReducersByName[k]=b,a}};u.forEach(k=>{let b=s[k],I={reducerName:k,type:gg(o,k),createNotation:typeof n.reducers=="function"};vg(b)?Ag(I,b,a,t):Sg(I,b,a)});function h(){let[k={},b=[],I=void 0]=typeof n.extraReducers=="function"?gc(n.extraReducers):[n.extraReducers],N={...k,...c.sliceCaseReducersByType};return ge(n.initialState,O=>{for(let P in N)O.addCase(P,N[P]);for(let P of c.sliceMatchers)O.addMatcher(P.matcher,P.reducer);for(let P of b)O.addMatcher(P.matcher,P.reducer);I&&O.addDefaultCase(I)})}let y=k=>k,S=new Map,m;function v(k,b){return m||(m=h()),m(k,b)}function x(){return m||(m=h()),m.getInitialState()}function E(k,b=!1){function I(O){let P=O[k];return typeof P>"u"&&b&&(P=x()),P}function N(O=y){let P=uc(S,b,()=>new WeakMap);return uc(P,O,()=>{let T={};for(let[F,q]of Object.entries(n.selectors??{}))T[F]=hg(q,O,x,b);return T})}return{reducerPath:k,getSelectors:N,get selectors(){return N(I)},selectSlice:I}}let A={name:o,reducer:v,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:x,...E(i),injectInto(k,{reducerPath:b,...I}={}){let N=b??i;return k.inject({reducerPath:N,reducer:v},I),{...A,...E(N,!0)}}};return A}}function hg(e,t,r,n){function o(i,...s){let u=t(i);return typeof u>"u"&&n&&(u=r()),e(u,...s)}return o.unwrapped=e,o}var Dt=mg();function yg(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Sg({type:e,reducerName:t,createNotation:r},n,o){let i,s;if("reducer"in n){if(r&&!Cg(n))throw new Error(Ue(17));i=n.reducer,s=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Q(e,s):Q(e))}function vg(e){return e._reducerDefinitionType==="asyncThunk"}function Cg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Ag({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ue(18));let{payloadCreator:i,fulfilled:s,pending:u,rejected:c,settled:a,options:h}=r,y=o(e,i,h);n.exposeAction(t,y),s&&n.addCase(y.fulfilled,s),u&&n.addCase(y.pending,u),c&&n.addCase(y.rejected,c),a&&n.addMatcher(y.settled,a),n.exposeCaseReducer(t,{fulfilled:s||An,pending:u||An,rejected:c||An,settled:a||An})}function An(){}var yc="listener",Sc="completed",vc="cancelled",Uw=`task-${vc}`,Vw=`task-${Sc}`,Bw=`${yc}-${vc}`,Qw=`${yc}-${Sc}`;var{assign:Cc}=Object;var bi="listenerMiddleware";var bg=Cc(Q(`${bi}/add`),{withTypes:()=>bg}),$w=Q(`${bi}/removeAll`),wg=Cc(Q(`${bi}/remove`),{withTypes:()=>wg});var Hw=Symbol.for("rtk-state-proxy-original");function Ue(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. `}g();d();f();p();var ee=new W({required:!0,emptyAllowed:!1}),me=new W({required:!1,emptyAllowed:!1}),Ve=new W({required:!0,emptyAllowed:!0}),ox=new W({required:!1,emptyAllowed:!0}),Ac=new Xe({each:ee,required:!0}),bc=new W({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),wc=new W({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),ix=new W({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),xg=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),wi=(e,t)=>{if("required"in t)return{payload:new je({value:t}).validate({value:e}).value};let o=new se({options:{required:!0},values:t}).validate(e);if(o)throw new zo(o);return{payload:e}},z=(e,t)=>{try{return wi(e,t)}catch(r){return{payload:e,error:xg(r)}}};var En=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Rg(e,t,r,o,"Controller initialization error")},Rg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};var In=Q("caseAssistConfiguration/set",e=>z(e,{caseAssistId:ee,locale:me,proxyBaseUrl:new W({required:!1,url:!0})}));g();d();f();p();g();d();f();p();var xc=()=>({caseAssistId:"",locale:"en-US"});var ut=ge(xc(),e=>{e.addCase(In,(t,r)=>{t.caseAssistId=r.payload.caseAssistId,t.locale=r.payload.locale,t.apiBaseUrl=r.payload.proxyBaseUrl})});g();d();f();p();g();d();f();p();g();d();f();p();var Rc={q:new W,enableQuerySyntax:new pe,aq:new W,cq:new W,firstResult:new xe({min:0}),numberOfResults:new xe({min:0}),sortCriteria:new W,f:new se,fExcluded:new se,cf:new se,nf:new se,mnf:new se,df:new se,debug:new pe,sf:new se,tab:new W,af:new se};var Ec=Q("searchParameters/restore",e=>z(e,Rc)),Ic=Q("searchParameters/restoreTab",e=>z(e,ee));g();d();f();p();var Pc=Q("debug/enable"),kc=Q("debug/disable");g();d();f();p();var Pn=()=>!1;var Tc=ge(Pn(),e=>{e.addCase(Pc,()=>!0).addCase(kc,()=>!1).addCase(Ec,(t,r)=>r.payload.debug??t)});g();d();f();p();var kn=Q("searchHub/set",e=>z(e,new W({required:!0,emptyAllowed:!0})));g();d();f();p();g();d();f();p();g();d();f();p();var Jt="3.25.1",Oc=["@coveo/atomic","@coveo/quantic"];var xi=()=>me,Fc=()=>ee,Xt=Q("configuration/updateBasicConfiguration",e=>z(e,{accessToken:me,environment:new W({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:me})),Tn=Q("configuration/updateSearchConfiguration",e=>z(e,{proxyBaseUrl:new W({required:!1,url:!0}),pipeline:new W({required:!1,emptyAllowed:!0}),searchHub:me,timezone:me,locale:me,authenticationProviders:new Xe({required:!1,each:ee})})),Eg={enabled:new pe({default:!0}),originContext:xi(),originLevel2:xi(),originLevel3:xi(),proxyBaseUrl:new W({required:!1,url:!0}),runtimeEnvironment:new Rt,anonymous:new pe({default:!1}),deviceId:me,userDisplayName:me,documentLocation:me,trackingId:wc,analyticsMode:new W({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new se({options:{required:!1},values:Oc.reduce((e,t)=>(e[t]=bc,e),{})})},On=Q("configuration/updateAnalyticsConfiguration",e=>z(e,Eg)),Fn=Q("configuration/analytics/disable"),Dn=Q("configuration/analytics/enable"),Dc=Q("configuration/analytics/originlevel2",e=>z(e,{originLevel2:Fc()})),Mc=Q("configuration/analytics/originlevel3",e=>z(e,{originLevel3:Fc()}));g();d();f();p();var Ig=Q("history/undo"),Pg=Q("history/redo"),He=Q("history/snapshot"),LR=oe("history/back",async(e,{dispatch:t})=>{t(Ig()),await t(Mn())}),jR=oe("history/forward",async(e,{dispatch:t})=>{t(Pg()),await t(Mn())}),Mn=oe("history/change",async(e,{getState:t})=>t().history.present);g();d();f();p();var Zt=()=>"default";var Nc=ge(Zt(),e=>{e.addCase(kn,(t,r)=>r.payload).addCase(Mn.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Tn,(t,r)=>r.payload.searchHub||t)});g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();var qc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function kg(e){return typeof e=="string"&&qc.test(e)}var Ri=kg;g();d();f();p();var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function _c(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}g();d();f();p();var Ei,Tg=new Uint8Array(16);function Ii(){if(!Ei){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ei=crypto.getRandomValues.bind(crypto)}return Ei(Tg)}g();d();f();p();g();d();f();p();var Og=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Pi={randomUUID:Og};function Fg(e,t,r){if(Pi.randomUUID&&!t&&!e)return Pi.randomUUID();e=e||{};let n=e.random??e.rng?.()??Ii();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return _c(n)}var ki=Fg;g();d();f();p();function Lc(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Dg({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:s}=e;s!=="disabled"&&(n.call(r),t.send(o,i,r))}var jc="visitorId";function Mg(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(jc),o=n&&Ri(n)?n:t.generateUUID();return r.setItem(jc,o),o}}}var Vc="1.2.1";function Ng(e){let{trackingId:t}=e;return{trackingId:t}}function qg(e){return(e.source||[]).concat([`relay@${Vc}`])}function Bc(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:s}=r,u=Ng(t),c=n.getClientId();return Object.freeze({type:e,config:u,ts:Date.now(),source:qg(t),clientId:c,userAgent:s(),referrer:o(),location:i()})}function _g(e,t,r,n,o){return{...t,meta:Bc(e,r,n,o)}}var Lg="*";function jg(){let e=[];function t({type:c,callback:a}){return e.findIndex(h=>h.type===c&&h.callback===a)}function r(c,a){return c.type==="*"||a===c.type}function n(c){return t(c)<0&&e.push(c),()=>u(c.type,c.callback)}function o(c){e.forEach(a=>{if(r(a,c.meta.type))try{a.callback(c)}catch(h){console.error(h)}})}function i(c){if(c===Lg)e.length=0;else for(let a=e.length-1;a>=0;a--)e[a].type===c&&e.splice(a,1)}function s(c){let a=t(c);a>=0&&e.splice(a,1)}function u(c,a){a?s({type:c,callback:a}):i(c)}return{add:n,call:o,remove:u}}function Uc({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},...!!n.environment&&{environment:n.environment}})}function Ug(e){let t=Uc(e);return{get:()=>t,update:r=>{t=Uc({...t,...r})}}}var Ti=Vg();function Vg(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let s=i.replace(/^\s+/,"");if(s.lastIndexOf(n,0)===0)return s.substring(n.length,s.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),s=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,u=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${s}${u};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Bg(){return{getItem(e){return Ti.getItem(e)||localStorage.getItem(e)},removeItem(e){Ti.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ti.setItem(e,t,31556952e3)}}}function Qg(){let e=document.referrer;return e===""?null:e}function $g(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Lc().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:()=>Qg(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>ki(),storage:Bg()}}function Hg(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function zg(){return{getItem(){return null},removeItem(){},setItem(){}}}function Gg(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:zg()}}function Wg(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=Gg();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&Kg()&&Hg()?$g():n}function Kg(){try{return typeof window=="object"}catch{return!1}}function Yg(e){return{get:()=>Object.freeze(Wg(e))}}function Qc(e){let t=Ug(e),r=jg(),n=Yg(t),o=Mg(n);return{emit:(i,s)=>{let u=t.get(),c=n.get(),a=_g(i,s,u,c,o);return Dg({config:u,environment:c,event:a,listenerManager:r})},getMeta:i=>Bc(i,t.get(),n.get(),o),on:(i,s)=>r.add({type:i,callback:s}),off:(i,s)=>r.remove(i,s),updateConfig:i=>t.update(i),version:Vc}}g();d();f();p();var er=ae(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Jt}`));var tr=ae(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>er(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},s)=>Qc({mode:i?"emit":"disabled",url:o??an(e,t),token:r,trackingId:n??null,source:s}));g();d();f();p();g();d();f();p();var Oi=e=>({referrer:document.referrer,userAgent:navigator.userAgent,location:window.location.href,clientId:e}),jr=()=>({referrer:null,userAgent:null,location:null,clientId:""});g();d();f();p();var Fi=ae(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...t&&{aq:t},...r&&{cq:r},...n&&{dq:n},...o&&{lq:o}}});g();d();f();p();var rr=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...r&&{actionCause:r.actionCause},...r&&{customData:r.customData},...e.userDisplayName&&{userDisplayName:e.userDisplayName},...e.deviceId&&{deviceId:e.deviceId},...e.trackingId&&{trackingId:e.trackingId},capture:t.capture??t.clientId!=="",source:er(e)}});g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();function rt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function D(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(h){try{a(n.next(h))}catch(y){s(y)}}function c(h){try{a(n.throw(h))}catch(y){s(y)}}function a(h){h.done?i(h.value):o(h.value).then(u,c)}a((n=n.apply(e,t||[])).next())})}var re;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(re||(re={}));function Ni(){return typeof window<"u"}function Wi(){return typeof navigator<"u"}function nr(){return typeof document<"u"}function qi(){try{return typeof localStorage<"u"}catch{return!1}}function Jg(){try{return typeof sessionStorage<"u"}catch{return!1}}function nu(){return Wi()&&navigator.cookieEnabled}var Xg=[re.click,re.custom,re.search,re.view],Zg=(e,t)=>Xg.indexOf(e)!==-1?Object.assign({language:nr()?document.documentElement.lang:"unknown",userAgent:Wi()?navigator.userAgent:"unknown"},t):t,Br=class e{static set(t,r,n){var o,i,s,u;n&&(i=new Date,i.setTime(i.getTime()+n)),u=window.location.hostname,u.indexOf(".")===-1?$c(t,r,i):(s=u.split("."),o=s[s.length-2]+"."+s[s.length-1],$c(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function $c(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function em(){return qi()?localStorage:nu()?new Qr:Jg()?sessionStorage:new ir}var Qr=class e{getItem(t){return Br.get(`${e.prefix}${t}`)}removeItem(t){Br.erase(`${e.prefix}${t}`)}setItem(t,r,n){Br.set(`${e.prefix}${t}`,r,n)}};Qr.prefix="coveo_";var _i=class{constructor(){this.cookieStorage=new Qr}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},ir=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Ur="__coveo.analytics.history",ou=20,iu=1e3*60,su=75,sr=class{constructor(t){this.store=t||em()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return D(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return D(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Ur);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return D(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Ur);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Ur,JSON.stringify(t.slice(0,ou)))}catch{}}clear(){try{this.store.removeItem(Ur)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,su)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>iu:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},au=Object.freeze({__proto__:null,HistoryStore:sr,MAX_NUMBER_OF_HISTORY_ELEMENTS:ou,MAX_VALUE_SIZE:su,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:iu,STORE_KEY:Ur,default:sr}),tm=(e,t)=>D(void 0,void 0,void 0,function*(){return e===re.view?(yield rm(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),rm=e=>D(void 0,void 0,void 0,function*(){let t=new sr,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Nn,nm=new Uint8Array(16);function om(){if(!Nn&&(Nn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Nn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nn(nm)}var im=/^(?:[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 _n(e){return typeof e=="string"&&im.test(e)}var Ce=[];for(let e=0;e<256;++e)Ce.push((e+256).toString(16).slice(1));function cu(e,t=0){return(Ce[e[t+0]]+Ce[e[t+1]]+Ce[e[t+2]]+Ce[e[t+3]]+"-"+Ce[e[t+4]]+Ce[e[t+5]]+"-"+Ce[e[t+6]]+Ce[e[t+7]]+"-"+Ce[e[t+8]]+Ce[e[t+9]]+"-"+Ce[e[t+10]]+Ce[e[t+11]]+Ce[e[t+12]]+Ce[e[t+13]]+Ce[e[t+14]]+Ce[e[t+15]]).toLowerCase()}function sm(e){if(!_n(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]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,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]=t&255,r}function am(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var cm="6ba7b810-9dad-11d1-80b4-00c04fd430c8",um="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function lm(e,t,r){function n(o,i,s,u){var c;if(typeof o=="string"&&(o=am(o)),typeof i=="string"&&(i=sm(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+o.length);if(a.set(i),a.set(o,i.length),a=r(a),a[6]=a[6]&15|t,a[8]=a[8]&63|128,s){u=u||0;for(let h=0;h<16;++h)s[u+h]=a[h];return s}return cu(a)}try{n.name=e}catch{}return n.DNS=cm,n.URL=um,n}var dm=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Hc={randomUUID:dm};function Mt(e,t,r){if(Hc.randomUUID&&!t&&!e)return Hc.randomUUID();e=e||{};let n=e.random||(e.rng||om)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return cu(n)}function pm(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function Di(e,t){return e<<t|e>>>32-t}function fm(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let s=unescape(encodeURIComponent(e));e=[];for(let u=0;u<s.length;++u)e.push(s.charCodeAt(u))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let s=0;s<o;++s){let u=new Uint32Array(16);for(let c=0;c<16;++c)u[c]=e[s*64+c*4]<<24|e[s*64+c*4+1]<<16|e[s*64+c*4+2]<<8|e[s*64+c*4+3];i[s]=u}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<o;++s){let u=new Uint32Array(80);for(let m=0;m<16;++m)u[m]=i[s][m];for(let m=16;m<80;++m)u[m]=Di(u[m-3]^u[m-8]^u[m-14]^u[m-16],1);let c=r[0],a=r[1],h=r[2],y=r[3],S=r[4];for(let m=0;m<80;++m){let v=Math.floor(m/20),x=Di(c,5)+pm(v,a,h,y)+S+t[v]+u[m]>>>0;S=y,y=h,h=Di(a,30)>>>0,a=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+a>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var gm=lm("v5",80,fm),zc=gm,uu="2.30.45",Gc=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Vr={pageview:"pageview",event:"event"},Ln=class{constructor({client:t,uuidGenerator:r=Mt}){this.client=t,this.uuidGenerator=r}},Li=class extends Ln{constructor({client:t,uuidGenerator:r=Mt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Gc(window.location),this.lastReferrer=nr()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:nr()?document.title:"",encoding:nr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Vr.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Vr.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Vr.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Vr.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Gc(window.location)}},lt=class e{constructor(t,r){if(!_n(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/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(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return _n(i)?new e(i,Number.parseInt(o)*1e3):null}};lt.cvo_cid="cvo_cid";lt.expirationTime=120;var ji=class extends Ln{constructor({client:t,uuidGenerator:r=Mt}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return D(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(lt.cvo_cid,new lt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ji.Id="link";var _e=Object.keys;function qn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Mi=128,lu=192,Wc=224,Kc=240;function mm(e){return(e&248)===Kc?4:(e&Kc)===Wc?3:(e&Wc)===lu?2:1}function hm(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);if((n&Mi)!=Mi)break;if(r-=3,(n&lu)!=Mi){t-r>=mm(n)*3&&(r=t);break}}return e.substring(0,r)}var Ui={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"},ym=_e(Ui).map(e=>Ui[e]),Sm=[...ym].join("|"),vm=new RegExp(`^(${Sm}$)`),Cm={svcAction:"svc_action",svcActionData:"svc_action_data"},Am=e=>_e(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ui[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),bm=e=>vm.test(e),wm=[bm],Yc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Jc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ae={action:"pa",list:"pal",listSource:"pls"},jn={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},xm=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Vi={id:"quoteId",affiliation:"quoteAffiliation"},Bi={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Rm={add:Ae,bookmark_add:Ae,bookmark_remove:Ae,click:Ae,checkout:Ae,checkout_option:Ae,detail:Ae,impression:Ae,remove:Ae,refund:Object.assign(Object.assign({},Ae),jn),purchase:Object.assign(Object.assign({},Ae),jn),quickview:Ae,quote:Object.assign(Object.assign({},Ae),Vi),review:Object.assign(Object.assign({},Ae),Bi)},Em=_e(Yc).map(e=>Yc[e]),Im=_e(Jc).map(e=>Jc[e]),Pm=_e(Ae).map(e=>Ae[e]),km=_e(jn).map(e=>jn[e]),Tm=_e(Bi).map(e=>Bi[e]),Om=_e(Vi).map(e=>Vi[e]),Fm=[...Em,"custom"].join("|"),Dm=[...Im,"custom"].join("|"),du="(pr[0-9]+)",pu="(il[0-9]+pi[0-9]+)",Mm=new RegExp(`^${du}(${Fm})$`),Nm=new RegExp(`^(${pu}(${Dm}))|(il[0-9]+nm)$`),qm=new RegExp(`^(${Pm.join("|")})$`),_m=new RegExp(`^(${km.join("|")})$`),Lm=new RegExp(`^${du}custom$`),jm=new RegExp(`^${pu}custom$`),Um=new RegExp(`^(${[...xm,...Tm,...Om].join("|")})$`),Vm=e=>Mm.test(e),Bm=e=>Nm.test(e),Qm=e=>qm.test(e),$m=e=>_m.test(e),Hm=e=>Um.test(e),zm=[Bm,Vm,Qm,$m,Hm],Gm=[Lm,jm],Wm={anonymizeIp:"aip"},Km={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Ym={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Jm=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Xm=Object.assign(Object.assign(Object.assign(Object.assign({},Wm),Km),Ym),Jm.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Qi=Object.assign(Object.assign({},Xm),Cm),Zm=e=>{let t=!!e.action&&Rm[e.action]||{};return _e(e).reduce((r,n)=>{let o=t[n]||Qi[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},eh=_e(Qi).map(e=>Qi[e]),th=e=>eh.indexOf(e)!==-1,rh=e=>e==="custom",nh=e=>[...zm,...wm,th,rh].some(t=>t(e)),oh=e=>_e(e).reduce((t,r)=>{let n=ih(r);return n?Object.assign(Object.assign({},t),sh(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),ih=e=>{let t;return[...Gm].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},sh=(e,t)=>_e(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),$i=class{constructor(t){this.opts=t}sendEvent(t,r){return D(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:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:s,payload:u}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,u),a=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(s,a)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(this,void 0,void 0,function*(){let o=t,i=r;if(n){let s=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:u,body:c}=s;o=u||t;try{i=JSON.parse(c)}catch(a){console.error("Unable to process the request body as a JSON string",a)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return D(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[re.click,re.custom,re.search,re.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Hi=class{sendEvent(t,r){return D(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){return Promise.resolve()})}},Xc=C.fetch,Un=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,s=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",u={url:`${n}/analytics/${t}${s}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},u),i?yield i(u,"analyticsFetch"):{}),{url:a}=c,h=rt(c,["url"]),y;try{y=yield Xc(a,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(y.ok){let S=yield y.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{y.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,y,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Xc(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[re.click,re.custom,re.search,re.view].indexOf(t)!==-1}getVisitorIdParam(){return D(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},zi=class{constructor(t,r){qi()&&nu()?this.storage=new _i:qi()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new ir),this.client=new Un(t),this.beaconClient=new $i(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Gi=class{constructor(t,r){this.storage=r||new ir,this.client=new Un(t)}getClientDependingOnEventType(t){return this.client}},Vn=class{constructor(){this.storage=new ir,this.client=new Hi}getClientDependingOnEventType(t){return this.client}},ah="xx",ch=e=>e?.startsWith(ah)||!1,uh=`
27
+ `;return new zo(r)}var zo=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},je=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw Vp(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Rt=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&K(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Bt(e){return e===void 0}function Bp(e){return e===null}function K(e){return Bt(e)||Bp(e)}var xe=class{constructor(e={}){ce(this,"value");this.config=e,this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t||(Qp(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 Qp(e){return Bt(e)||Sa(e)}function Sa(e){return typeof e=="number"&&!isNaN(e)}var pe=class{constructor(e={}){ce(this,"value");this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t||($p(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function $p(e){return Bt(e)||va(e)}function va(e){return typeof e=="boolean"}var Hp=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,W=class{constructor(e={}){ce(this,"value");ce(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Rt(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,s=this.value.validate(e);if(s)return s;if(Bt(e))return null;if(!Ca(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Hp.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function Ca(e){return Object.prototype.toString.call(e)==="[object String]"}var se=class{constructor(e={}){ce(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Bt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Aa(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&K(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=" "+i)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Aa(e){return e!==void 0&&typeof e=="object"}var Xe=class{constructor(e={}){ce(this,"value");this.config=e,this.value=new Rt(this.config)}validate(e){if(!K(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(K(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&K(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=" "+o)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return va(e)||Ca(e)||Sa(e)||Aa(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function ba(e){return Array.isArray(e)}var Go=class{constructor(e){ce(this,"value");this.config=e,this.value=new Rt(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Bt(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};g();d();f();p();var on=e=>e;g();d();f();p();g();d();f();p();var La=Me(Ta(),1);g();d();f();p();g();d();f();p();var Sf="recommendation-internal-options",oA=Symbol.for(Sf);var Ne=new Error("Failed to load reducers."),Qt=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var It=class extends Error{constructor(r,n){super();ce(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};g();d();f();p();function Oa(e){return Array.isArray(e)}function Fa(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}var vf=new Set(["1",1,"yes",!0]);function Da(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>vf.has(r))}function Ma(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Ir(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}g();d();f();p();function Na(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function qa(e){return typeof e!="object"||!e?!1:Object.values(e).every(Cf)}function Cf(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function _a(e){return e===429}var ct=class e{static async call(t){let r=Af(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...s}=o,u=async()=>{let c=await w(i,s);if(_a(c.status))throw c;return c};try{let c=await(0,La.backOff)(u,{retry:a=>{let h=a&&_a(a.status);return h&&n.info("Platform retrying request"),h}});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Qt;case 404:throw new It(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new It(i):c}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:s}=r,{signal:u,...c}=t,a=Ir(c);try{let h=await o(t,n,s);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return a}};function fe(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function $t(e,t="prod"){return`${fe(e,t)}/rest/search/v2`}function an(e,t="prod"){return`${fe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Af(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:s}=e,u=e.method==="POST"||e.method==="PUT",c=bf(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...u&&{body:c},signal:s}}function bf(e,t){return t==="application/x-www-form-urlencoded"?qa(e)?Na(e):"":JSON.stringify(e)}g();d();f();p();g();d();f();p();var Ht=class{constructor(t){ce(this,"_basePath");ce(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}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(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};g();d();f();p();function ri(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var ni=e=>{let{response:t}=e;return t.body?wf(e):xf(t)},wf=e=>Ef(e)?If(e):Rf(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},xf=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Rf(e){return e.body.statusCode!==void 0}function Ef(e){return e.body.exception!==void 0}var If=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});g();d();f();p();function ja(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}g();d();f();p();var oi=(e,t,r,n)=>{let o=new Ht(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Ua=(e,t)=>{let r=new Ht(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},ii=async(e,t)=>{let r=await ct.call({...oi(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ri(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=ja(r),o=await r.arrayBuffer(),s=new TextDecoder(n).decode(o);return Pf(s)?{success:s}:{error:ni({response:r,body:s})}};function Pf(e){return typeof e=="string"}g();d();f();p();function kf(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Tf(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function cn(e,t){if(t&&e.name==="AbortError")return{error:Tf(e)};if(e instanceof It)return{error:kf(e)};throw e}g();d();f();p();g();d();f();p();var un=(e,t,r,n,o={})=>{Of(e);let i=`${e.url}/rest/organizations/${e.organizationId}/caseassists/${e.caseAssistId}${n}`,s=Ff(o),u=s?`${i}?${s}`:i;return{accessToken:e.accessToken,method:t,contentType:r,url:u,origin:"caseAssistApiFetch"}},ln=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r]}),{}),dn=e=>Object.keys(e).filter(t=>e[t].value!=="").reduce((t,r)=>({...t,[r]:e[r].value}),{}),Of=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.");if(!e.caseAssistId)throw new Error("The 'caseAssistId' attribute must contain a valid Case Assist configuration ID.")},Ff=e=>Object.keys(e).map(t=>`${t}=${encodeURIComponent(e[t])}`).join("&");var Va=e=>{let t=e.debug?{debug:"1"}:{};return{...un(e,"POST","application/json","/classify",t),requestParams:Df(e)}},Df=e=>({clientId:e.clientId,locale:e.locale,fields:ln(e.fields)});g();d();f();p();var Ba=e=>{let t={};return e.debug&&(t.debug="1"),e.numberOfResults&&(t.numberOfResults=e.numberOfResults.toString()),{...un(e,"POST","application/json","/documents/suggest",t),requestParams:Mf(e)}},Mf=e=>({clientId:e.clientId,locale:e.locale,fields:ln(e.fields),context:e.context,analytics:e.analytics});var pn=class{constructor(t){this.options=t}async getCaseClassifications(t){let r=await ct.call({...Va(t),...this.options});if(r instanceof Error)return cn(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async getDocumentSuggestions(t){let r=await ct.call({...Ba(t),...this.options});if(r instanceof Error)return cn(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async html(t){return ii(t,this.options)}};g();d();f();p();g();d();f();p();g();d();f();p();function ye(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 Nf=typeof Symbol=="function"&&Symbol.observable||"@@observable",Qa=Nf,si=()=>Math.random().toString(36).substring(7).split("").join("."),qf={INIT:`@@redux/INIT${si()}`,REPLACE:`@@redux/REPLACE${si()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${si()}`},fn=qf;function Qe(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ai(e,t,r){if(typeof e!="function")throw new Error(ye(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ye(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ye(1));return r(ai)(e,t)}let n=e,o=t,i=new Map,s=i,u=0,c=!1;function a(){s===i&&(s=new Map,i.forEach((E,A)=>{s.set(A,E)}))}function h(){if(c)throw new Error(ye(3));return o}function y(E){if(typeof E!="function")throw new Error(ye(4));if(c)throw new Error(ye(5));let A=!0;a();let k=u++;return s.set(k,E),function(){if(A){if(c)throw new Error(ye(6));A=!1,a(),s.delete(k),i=null}}}function S(E){if(!Qe(E))throw new Error(ye(7));if(typeof E.type>"u")throw new Error(ye(8));if(typeof E.type!="string")throw new Error(ye(17));if(c)throw new Error(ye(9));try{c=!0,o=n(o,E)}finally{c=!1}return(i=s).forEach(k=>{k()}),E}function m(E){if(typeof E!="function")throw new Error(ye(10));n=E,S({type:fn.REPLACE})}function v(){let E=y;return{subscribe(A){if(typeof A!="object"||A===null)throw new Error(ye(11));function k(){let I=A;I.next&&I.next(h())}return k(),{unsubscribe:E(k)}},[Qa](){return this}}}return S({type:fn.INIT}),{dispatch:S,subscribe:y,getState:h,replaceReducer:m,[Qa]:v}}function _f(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:fn.INIT})>"u")throw new Error(ye(12));if(typeof r(void 0,{type:fn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ye(13))})}function zt(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let u=t[s];typeof e[u]=="function"&&(r[u]=e[u])}let n=Object.keys(r),o,i;try{_f(r)}catch(s){i=s}return function(u={},c){if(i)throw i;let a=!1,h={};for(let y=0;y<n.length;y++){let S=n[y],m=r[S],v=u[S],x=m(v,c);if(typeof x>"u"){let E=c&&c.type;throw new Error(ye(14))}h[S]=x,a=a||x!==v}return a=a||n.length!==Object.keys(u).length,a?h:u}}function Gt(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function $a(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(ye(15))},s={getState:o.getState,dispatch:(c,...a)=>i(c,...a)},u=e.map(c=>c(s));return i=Gt(...u)(o.dispatch),{...o,dispatch:i}}}function gn(e){return Qe(e)&&"type"in e&&typeof e.type=="string"}g();d();f();p();var yi=Symbol.for("immer-nothing"),Pr=Symbol.for("immer-draftable"),Re=Symbol.for("immer-state");function Se(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var kt=Object.getPrototypeOf;function ke(e){return!!e&&!!e[Re]}function Ee(e){return e?Ka(e)||Array.isArray(e)||!!e[Pr]||!!e.constructor?.[Pr]||Dr(e)||Mr(e):!1}var Lf=Object.prototype.constructor.toString();function Ka(e){if(!e||typeof e!="object")return!1;let t=kt(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Lf}function Si(e){return ke(e)||Se(15,e),e[Re].base_}function kr(e,t){Tt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Tt(e){let t=e[Re];return t?t.type_:Array.isArray(e)?1:Dr(e)?2:Mr(e)?3:0}function Tr(e,t){return Tt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ci(e,t){return Tt(e)===2?e.get(t):e[t]}function Ya(e,t,r){let n=Tt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function jf(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Dr(e){return e instanceof Map}function Mr(e){return e instanceof Set}function Pt(e){return e.copy_||e.base_}function di(e,t){if(Dr(e))return new Map(e);if(Mr(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Ka(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Re];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let s=o[i],u=n[s];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[s]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[s]})}return Object.create(kt(e),n)}else{let n=kt(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function yn(e,t=!1){return Sn(e)||ke(e)||!Ee(e)||(Tt(e)>1&&(e.set=e.add=e.clear=e.delete=Uf),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>yn(n,!0))),e}function Uf(){Se(2)}function Sn(e){return Object.isFrozen(e)}var pi={};function Ot(e){let t=pi[e];return t||Se(0,e),t}function Vf(e,t){pi[e]||(pi[e]=t)}var Or;function Ja(){return Or}function Bf(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ha(e,t){t&&(Ot("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fi(e){gi(e),e.drafts_.forEach(Qf),e.drafts_=null}function gi(e){e===Or&&(Or=e.parent_)}function za(e){return Or=Bf(Or,e)}function Qf(e){let t=e[Re];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ga(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Re].modified_&&(fi(t),Se(4)),Ee(e)&&(e=mn(t,e),t.parent_||hn(t,e)),t.patches_&&Ot("Patches").generateReplacementPatches_(r[Re].base_,e,t.patches_,t.inversePatches_)):e=mn(t,r,[]),fi(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yi?e:void 0}function mn(e,t,r){if(Sn(t))return t;let n=t[Re];if(!n)return kr(t,(o,i)=>Wa(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return hn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,s=!1;n.type_===3&&(i=new Set(o),o.clear(),s=!0),kr(i,(u,c)=>Wa(e,n,o,u,c,r,s)),hn(e,o,!1),r&&e.patches_&&Ot("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Wa(e,t,r,n,o,i,s){if(ke(o)){let u=i&&t&&t.type_!==3&&!Tr(t.assigned_,n)?i.concat(n):void 0,c=mn(e,o,u);if(Ya(r,n,c),ke(c))e.canAutoFreeze_=!1;else return}else s&&r.add(o);if(Ee(o)&&!Sn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;mn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&hn(e,o)}}function hn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yn(t,r)}function $f(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Ja(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=vi;r&&(o=[n],i=Fr);let{revoke:s,proxy:u}=Proxy.revocable(o,i);return n.draft_=u,n.revoke_=s,u}var vi={get(e,t){if(t===Re)return e;let r=Pt(e);if(!Tr(r,t))return Hf(e,r,t);let n=r[t];return e.finalized_||!Ee(n)?n:n===ui(e.base_,t)?(li(e),e.copy_[t]=hi(n,e)):n},has(e,t){return t in Pt(e)},ownKeys(e){return Reflect.ownKeys(Pt(e))},set(e,t,r){let n=Xa(Pt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ui(Pt(e),t),i=o?.[Re];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(jf(r,o)&&(r!==void 0||Tr(e.base_,t)))return!0;li(e),mi(e)}return e.copy_[t]===r&&(r!==void 0||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 ui(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,li(e),mi(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Pt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Se(11)},getPrototypeOf(e){return kt(e.base_)},setPrototypeOf(){Se(12)}},Fr={};kr(vi,(e,t)=>{Fr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Fr.deleteProperty=function(e,t){return Fr.set.call(this,e,t,void 0)};Fr.set=function(e,t,r){return vi.set.call(this,e[0],t,r,e[0])};function ui(e,t){let r=e[Re];return(r?Pt(r):e)[t]}function Hf(e,t,r){let n=Xa(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Xa(e,t){if(!(t in e))return;let r=kt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=kt(r)}}function mi(e){e.modified_||(e.modified_=!0,e.parent_&&mi(e.parent_))}function li(e){e.copy_||(e.copy_=di(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zf=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let s=this;return function(c=i,...a){return s.produce(c,h=>r.call(this,h,...a))}}typeof r!="function"&&Se(6),n!==void 0&&typeof n!="function"&&Se(7);let o;if(Ee(t)){let i=za(this),s=hi(t,void 0),u=!0;try{o=r(s),u=!1}finally{u?fi(i):gi(i)}return Ha(i,n),Ga(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===yi&&(o=void 0),this.autoFreeze_&&yn(o,!0),n){let i=[],s=[];Ot("Patches").generateReplacementPatches_(t,o,i,s),n(i,s)}return o}else Se(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...u)=>this.produceWithPatches(s,c=>t(c,...u));let n,o;return[this.produce(t,r,(s,u)=>{n=s,o=u}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ee(e)||Se(8),ke(e)&&(e=Za(e));let t=za(this),r=hi(e,void 0);return r[Re].isManual_=!0,gi(t),r}finishDraft(e,t){let r=e&&e[Re];(!r||!r.isManual_)&&Se(9);let{scope_:n}=r;return Ha(n,t),Ga(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 o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Ot("Patches").applyPatches_;return ke(e)?n(e,t):this.produce(e,o=>n(o,t))}};function hi(e,t){let r=Dr(e)?Ot("MapSet").proxyMap_(e,t):Mr(e)?Ot("MapSet").proxySet_(e,t):$f(e,t);return(t?t.scope_:Ja()).drafts_.push(r),r}function Za(e){return ke(e)||Se(10,e),ec(e)}function ec(e){if(!Ee(e)||Sn(e))return e;let t=e[Re],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=di(e,t.scope_.immer_.useStrictShallowCopy_)}else r=di(e,!0);return kr(r,(n,o)=>{Ya(r,n,ec(o))}),t&&(t.finalized_=!1),r}function tc(){let t="replace",r="add",n="remove";function o(S,m,v,x){switch(S.type_){case 0:case 2:return s(S,m,v,x);case 1:return i(S,m,v,x);case 3:return u(S,m,v,x)}}function i(S,m,v,x){let{base_:E,assigned_:A}=S,k=S.copy_;k.length<E.length&&([E,k]=[k,E],[v,x]=[x,v]);for(let b=0;b<E.length;b++)if(A[b]&&k[b]!==E[b]){let I=m.concat([b]);v.push({op:t,path:I,value:y(k[b])}),x.push({op:t,path:I,value:y(E[b])})}for(let b=E.length;b<k.length;b++){let I=m.concat([b]);v.push({op:r,path:I,value:y(k[b])})}for(let b=k.length-1;E.length<=b;--b){let I=m.concat([b]);x.push({op:n,path:I})}}function s(S,m,v,x){let{base_:E,copy_:A}=S;kr(S.assigned_,(k,b)=>{let I=ci(E,k),N=ci(A,k),O=b?Tr(E,k)?t:r:n;if(I===N&&O===t)return;let P=m.concat(k);v.push(O===n?{op:O,path:P}:{op:O,path:P,value:N}),x.push(O===r?{op:n,path:P}:O===n?{op:r,path:P,value:y(I)}:{op:t,path:P,value:y(I)})})}function u(S,m,v,x){let{base_:E,copy_:A}=S,k=0;E.forEach(b=>{if(!A.has(b)){let I=m.concat([k]);v.push({op:n,path:I,value:b}),x.unshift({op:r,path:I,value:b})}k++}),k=0,A.forEach(b=>{if(!E.has(b)){let I=m.concat([k]);v.push({op:r,path:I,value:b}),x.unshift({op:n,path:I,value:b})}k++})}function c(S,m,v,x){v.push({op:t,path:[],value:m===yi?void 0:m}),x.push({op:t,path:[],value:S})}function a(S,m){return m.forEach(v=>{let{path:x,op:E}=v,A=S;for(let N=0;N<x.length-1;N++){let O=Tt(A),P=x[N];typeof P!="string"&&typeof P!="number"&&(P=""+P),(O===0||O===1)&&(P==="__proto__"||P==="constructor")&&Se(19),typeof A=="function"&&P==="prototype"&&Se(19),A=ci(A,P),typeof A!="object"&&Se(18,x.join("/"))}let k=Tt(A),b=h(v.value),I=x[x.length-1];switch(E){case t:switch(k){case 2:return A.set(I,b);case 3:Se(16);default:return A[I]=b}case r:switch(k){case 1:return I==="-"?A.push(b):A.splice(I,0,b);case 2:return A.set(I,b);case 3:return A.add(b);default:return A[I]=b}case n:switch(k){case 1:return A.splice(I,1);case 2:return A.delete(I);case 3:return A.delete(v.value);default:return delete A[I]}default:Se(17,E)}}),S}function h(S){if(!Ee(S))return S;if(Array.isArray(S))return S.map(h);if(Dr(S))return new Map(Array.from(S.entries()).map(([v,x])=>[v,h(x)]));if(Mr(S))return new Set(Array.from(S).map(h));let m=Object.create(kt(S));for(let v in S)m[v]=h(S[v]);return Tr(S,Pr)&&(m[Pr]=S[Pr]),m}function y(S){return ke(S)?h(S):S}Vf("Patches",{applyPatches_:a,generatePatches_:o,generateReplacementPatches_:c})}var Te=new zf,et=Te.produce,vn=Te.produceWithPatches.bind(Te),iw=Te.setAutoFreeze.bind(Te),sw=Te.setUseStrictShallowCopy.bind(Te),Ci=Te.applyPatches.bind(Te),aw=Te.createDraft.bind(Te),cw=Te.finishDraft.bind(Te);g();d();f();p();function Gf(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Wf(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Kf(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var rc=e=>Array.isArray(e)?e:[e];function Yf(e){let t=Array.isArray(e[0])?e[0]:e;return Kf(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Jf(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var mw=Symbol();var hw=Object.getPrototypeOf({});var Xf=class{constructor(e){this.value=e}deref(){return this.value}},Zf=typeof WeakRef<"u"?WeakRef:Xf,eg=0,nc=1;function Cn(){return{s:eg,v:void 0,o:null,p:null}}function Wt(e,t={}){let r=Cn(),{resultEqualityCheck:n}=t,o,i=0;function s(){let u=r,{length:c}=arguments;for(let y=0,S=c;y<S;y++){let m=arguments[y];if(typeof m=="function"||typeof m=="object"&&m!==null){let v=u.o;v===null&&(u.o=v=new WeakMap);let x=v.get(m);x===void 0?(u=Cn(),v.set(m,u)):u=x}else{let v=u.p;v===null&&(u.p=v=new Map);let x=v.get(m);x===void 0?(u=Cn(),v.set(m,u)):u=x}}let a=u,h;if(u.s===nc)h=u.v;else if(h=e.apply(null,arguments),i++,n){let y=o?.deref?.()??o;y!=null&&n(y,h)&&(h=y,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new Zf(h):h}return a.s=nc,a.v=h,h}return s.clearCache=()=>{r=Cn(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function oc(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,s=0,u,c={},a=o.pop();typeof a=="object"&&(c=a,a=o.pop()),Gf(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let h={...r,...c},{memoize:y,memoizeOptions:S=[],argsMemoize:m=Wt,argsMemoizeOptions:v=[],devModeChecks:x={}}=h,E=rc(S),A=rc(v),k=Yf(o),b=y(function(){return i++,a.apply(null,arguments)},...E),I=!0,N=m(function(){s++;let P=Jf(k,arguments);return u=b.apply(null,P),u},...A);return Object.assign(N,{resultFunc:a,memoizedResultFunc:b,dependencies:k,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>u,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:y,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var ae=oc(Wt),tg=Object.assign((e,t=ae)=>{Wf(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),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((s,u,c)=>(s[r[c]]=u,s),{}))},{withTypes:()=>tg});g();d();f();p();function ic(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var sc=ic(),ac=ic;var rg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Gt:Gt.apply(null,arguments)},Mw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},ng=e=>e&&typeof e.match=="function";function Q(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Ue(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>gn(n)&&n.type===e,r}var pc=class Nr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Nr.prototype)}static get[Symbol.species](){return Nr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Nr(...t[0].concat(this)):new Nr(...t.concat(this))}};function cc(e){return Ee(e)?et(e,()=>{}):e}function uc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function og(e){return typeof e=="boolean"}var ig=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},s=new pc;return r&&(og(r)?s.push(sc):s.push(ac(r.extraArgument))),s},qr="RTK_autoBatch",Yt=()=>e=>({payload:e,meta:{[qr]:!0}}),lc=e=>t=>{setTimeout(t,e)},sg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,s=!1,u=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:lc(10):e.type==="callback"?e.queueNotification:lc(e.timeout),a=()=>{s=!1,i&&(i=!1,u.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let y=()=>o&&h(),S=n.subscribe(y);return u.add(h),()=>{S(),u.delete(h)}},dispatch(h){try{return o=!h?.meta?.[qr],i=!o,i&&(s||(s=!0,c(a))),n.dispatch(h)}finally{o=!0}}})},ag=e=>function(r){let{autoBatch:n=!0}=r??{},o=new pc(e);return n&&o.push(sg(typeof n=="object"?n:void 0)),o};function fc(e){let t=ig(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:s=void 0}=e||{},u;if(typeof r=="function")u=r;else if(Qe(r))u=zt(r);else throw new Error(Ue(1));let c;typeof n=="function"?c=n(t):c=t();let a=Gt;o&&(a=rg({trace:!1,...typeof o=="object"&&o}));let h=$a(...c),y=ag(h),S=typeof s=="function"?s(y):y(),m=a(...S);return ai(u,i,m)}function gc(e){let t={},r=[],n,o={addCase(i,s){let u=typeof i=="string"?i:i.type;if(!u)throw new Error(Ue(28));if(u in t)throw new Error(Ue(29));return t[u]=s,o},addMatcher(i,s){return r.push({matcher:i,reducer:s}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function cg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=gc(t),i;if(cg(e))i=()=>cc(e());else{let u=cc(e);i=()=>u}function s(u=i(),c){let a=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return a.filter(h=>!!h).length===0&&(a=[o]),a.reduce((h,y)=>{if(y)if(ke(h)){let m=y(h,c);return m===void 0?h:m}else{if(Ee(h))return et(h,S=>y(S,c));{let S=y(h,c);if(S===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return h},u)}return s.getInitialState=i,s}var mc=(e,t)=>ng(e)?e.match(t):e(t);function $e(...e){return t=>e.some(r=>mc(r,t))}function Kt(...e){return t=>e.every(r=>mc(r,t))}function bn(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function _r(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function wn(...e){return e.length===0?t=>bn(t,["pending"]):_r(e)?$e(...e.map(t=>t.pending)):wn()(e[0])}function Ft(...e){return e.length===0?t=>bn(t,["rejected"]):_r(e)?$e(...e.map(t=>t.rejected)):Ft()(e[0])}function Lr(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Kt(Ft(...e),t):_r(e)?Kt(Ft(...e),t):Lr()(e[0])}function tt(...e){return e.length===0?t=>bn(t,["fulfilled"]):_r(e)?$e(...e.map(t=>t.fulfilled)):tt()(e[0])}function xn(...e){return e.length===0?t=>bn(t,["pending","fulfilled","rejected"]):_r(e)?$e(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):xn()(e[0])}var ug="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Rn=(e=21)=>{let t="",r=e;for(;r--;)t+=ug[Math.random()*64|0];return t},lg=["name","message","stack","code"],Ai=class{constructor(e,t){ce(this,"_type");this.payload=e,this.meta=t}},dc=class{constructor(e,t){ce(this,"_type");this.payload=e,this.meta=t}},dg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of lg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},oe=(()=>{function e(t,r,n){let o=Q(t+"/fulfilled",(c,a,h,y)=>({payload:c,meta:{...y||{},arg:h,requestId:a,requestStatus:"fulfilled"}})),i=Q(t+"/pending",(c,a,h)=>({payload:void 0,meta:{...h||{},arg:a,requestId:c,requestStatus:"pending"}})),s=Q(t+"/rejected",(c,a,h,y,S)=>({payload:y,error:(n&&n.serializeError||dg)(c||"Rejected"),meta:{...S||{},arg:h,requestId:a,rejectedWithValue:!!y,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function u(c){return(a,h,y)=>{let S=n?.idGenerator?n.idGenerator(c):Rn(),m=new l.AbortController,v,x;function E(k){x=k,m.abort()}let A=async function(){let k;try{let I=n?.condition?.(c,{getState:h,extra:y});if(fg(I)&&(I=await I),I===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((O,P)=>{v=()=>{P({name:"AbortError",message:x||"Aborted"})},m.signal.addEventListener("abort",v)});a(i(S,c,n?.getPendingMeta?.({requestId:S,arg:c},{getState:h,extra:y}))),k=await Promise.race([N,Promise.resolve(r(c,{dispatch:a,getState:h,extra:y,requestId:S,signal:m.signal,abort:E,rejectWithValue:(O,P)=>new Ai(O,P),fulfillWithValue:(O,P)=>new dc(O,P)})).then(O=>{if(O instanceof Ai)throw O;return O instanceof dc?o(O.payload,S,c,O.meta):o(O,S,c)})])}catch(I){k=I instanceof Ai?s(null,S,c,I.payload,I.meta):s(I,S,c)}finally{v&&m.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&s.match(k)&&k.meta.condition||a(k),k}();return Object.assign(A,{abort:E,requestId:S,arg:c,unwrap(){return A.then(pg)}})}}return Object.assign(u,{pending:i,rejected:s,fulfilled:o,settled:$e(s,o),typePrefix:t})}return e.withTypes=()=>e,e})();function pg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function fg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var hc=Symbol.for("rtk-slice-createasyncthunk"),jw={[hc]:oe};function gg(e,t){return`${e}/${t}`}function mg({creators:e}={}){let t=e?.asyncThunk?.[hc];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Ue(11));typeof process<"u";let s=(typeof n.reducers=="function"?n.reducers(yg()):n.reducers)||{},u=Object.keys(s),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(k,b){let I=typeof k=="string"?k:k.type;if(!I)throw new Error(Ue(12));if(I in c.sliceCaseReducersByType)throw new Error(Ue(13));return c.sliceCaseReducersByType[I]=b,a},addMatcher(k,b){return c.sliceMatchers.push({matcher:k,reducer:b}),a},exposeAction(k,b){return c.actionCreators[k]=b,a},exposeCaseReducer(k,b){return c.sliceCaseReducersByName[k]=b,a}};u.forEach(k=>{let b=s[k],I={reducerName:k,type:gg(o,k),createNotation:typeof n.reducers=="function"};vg(b)?Ag(I,b,a,t):Sg(I,b,a)});function h(){let[k={},b=[],I=void 0]=typeof n.extraReducers=="function"?gc(n.extraReducers):[n.extraReducers],N={...k,...c.sliceCaseReducersByType};return ge(n.initialState,O=>{for(let P in N)O.addCase(P,N[P]);for(let P of c.sliceMatchers)O.addMatcher(P.matcher,P.reducer);for(let P of b)O.addMatcher(P.matcher,P.reducer);I&&O.addDefaultCase(I)})}let y=k=>k,S=new Map,m;function v(k,b){return m||(m=h()),m(k,b)}function x(){return m||(m=h()),m.getInitialState()}function E(k,b=!1){function I(O){let P=O[k];return typeof P>"u"&&b&&(P=x()),P}function N(O=y){let P=uc(S,b,()=>new WeakMap);return uc(P,O,()=>{let T={};for(let[F,q]of Object.entries(n.selectors??{}))T[F]=hg(q,O,x,b);return T})}return{reducerPath:k,getSelectors:N,get selectors(){return N(I)},selectSlice:I}}let A={name:o,reducer:v,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:x,...E(i),injectInto(k,{reducerPath:b,...I}={}){let N=b??i;return k.inject({reducerPath:N,reducer:v},I),{...A,...E(N,!0)}}};return A}}function hg(e,t,r,n){function o(i,...s){let u=t(i);return typeof u>"u"&&n&&(u=r()),e(u,...s)}return o.unwrapped=e,o}var Dt=mg();function yg(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Sg({type:e,reducerName:t,createNotation:r},n,o){let i,s;if("reducer"in n){if(r&&!Cg(n))throw new Error(Ue(17));i=n.reducer,s=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Q(e,s):Q(e))}function vg(e){return e._reducerDefinitionType==="asyncThunk"}function Cg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Ag({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Ue(18));let{payloadCreator:i,fulfilled:s,pending:u,rejected:c,settled:a,options:h}=r,y=o(e,i,h);n.exposeAction(t,y),s&&n.addCase(y.fulfilled,s),u&&n.addCase(y.pending,u),c&&n.addCase(y.rejected,c),a&&n.addMatcher(y.settled,a),n.exposeCaseReducer(t,{fulfilled:s||An,pending:u||An,rejected:c||An,settled:a||An})}function An(){}var yc="listener",Sc="completed",vc="cancelled",Uw=`task-${vc}`,Vw=`task-${Sc}`,Bw=`${yc}-${vc}`,Qw=`${yc}-${Sc}`;var{assign:Cc}=Object;var bi="listenerMiddleware";var bg=Cc(Q(`${bi}/add`),{withTypes:()=>bg}),$w=Q(`${bi}/removeAll`),wg=Cc(Q(`${bi}/remove`),{withTypes:()=>wg});var Hw=Symbol.for("rtk-state-proxy-original");function Ue(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. `}g();d();f();p();var ee=new W({required:!0,emptyAllowed:!1}),me=new W({required:!1,emptyAllowed:!1}),Ve=new W({required:!0,emptyAllowed:!0}),ox=new W({required:!1,emptyAllowed:!0}),Ac=new Xe({each:ee,required:!0}),bc=new W({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),wc=new W({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),ix=new W({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),xg=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),wi=(e,t)=>{if("required"in t)return{payload:new je({value:t}).validate({value:e}).value};let o=new se({options:{required:!0},values:t}).validate(e);if(o)throw new zo(o);return{payload:e}},z=(e,t)=>{try{return wi(e,t)}catch(r){return{payload:e,error:xg(r)}}};var En=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Rg(e,t,r,o,"Controller initialization error")},Rg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};var In=Q("caseAssistConfiguration/set",e=>z(e,{caseAssistId:ee,locale:me,proxyBaseUrl:new W({required:!1,url:!0})}));g();d();f();p();g();d();f();p();var xc=()=>({caseAssistId:"",locale:"en-US"});var ut=ge(xc(),e=>{e.addCase(In,(t,r)=>{t.caseAssistId=r.payload.caseAssistId,t.locale=r.payload.locale,t.apiBaseUrl=r.payload.proxyBaseUrl})});g();d();f();p();g();d();f();p();g();d();f();p();var Rc={q:new W,enableQuerySyntax:new pe,aq:new W,cq:new W,firstResult:new xe({min:0}),numberOfResults:new xe({min:0}),sortCriteria:new W,f:new se,fExcluded:new se,cf:new se,nf:new se,mnf:new se,df:new se,debug:new pe,sf:new se,tab:new W,af:new se};var Ec=Q("searchParameters/restore",e=>z(e,Rc)),Ic=Q("searchParameters/restoreTab",e=>z(e,ee));g();d();f();p();var Pc=Q("debug/enable"),kc=Q("debug/disable");g();d();f();p();var Pn=()=>!1;var Tc=ge(Pn(),e=>{e.addCase(Pc,()=>!0).addCase(kc,()=>!1).addCase(Ec,(t,r)=>r.payload.debug??t)});g();d();f();p();var kn=Q("searchHub/set",e=>z(e,new W({required:!0,emptyAllowed:!0})));g();d();f();p();g();d();f();p();g();d();f();p();var Jt="3.25.2",Oc=["@coveo/atomic","@coveo/quantic"];var xi=()=>me,Fc=()=>ee,Xt=Q("configuration/updateBasicConfiguration",e=>z(e,{accessToken:me,environment:new W({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:me})),Tn=Q("configuration/updateSearchConfiguration",e=>z(e,{proxyBaseUrl:new W({required:!1,url:!0}),pipeline:new W({required:!1,emptyAllowed:!0}),searchHub:me,timezone:me,locale:me,authenticationProviders:new Xe({required:!1,each:ee})})),Eg={enabled:new pe({default:!0}),originContext:xi(),originLevel2:xi(),originLevel3:xi(),proxyBaseUrl:new W({required:!1,url:!0}),runtimeEnvironment:new Rt,anonymous:new pe({default:!1}),deviceId:me,userDisplayName:me,documentLocation:me,trackingId:wc,analyticsMode:new W({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new se({options:{required:!1},values:Oc.reduce((e,t)=>(e[t]=bc,e),{})})},On=Q("configuration/updateAnalyticsConfiguration",e=>z(e,Eg)),Fn=Q("configuration/analytics/disable"),Dn=Q("configuration/analytics/enable"),Dc=Q("configuration/analytics/originlevel2",e=>z(e,{originLevel2:Fc()})),Mc=Q("configuration/analytics/originlevel3",e=>z(e,{originLevel3:Fc()}));g();d();f();p();var Ig=Q("history/undo"),Pg=Q("history/redo"),He=Q("history/snapshot"),LR=oe("history/back",async(e,{dispatch:t})=>{t(Ig()),await t(Mn())}),jR=oe("history/forward",async(e,{dispatch:t})=>{t(Pg()),await t(Mn())}),Mn=oe("history/change",async(e,{getState:t})=>t().history.present);g();d();f();p();var Zt=()=>"default";var Nc=ge(Zt(),e=>{e.addCase(kn,(t,r)=>r.payload).addCase(Mn.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Tn,(t,r)=>r.payload.searchHub||t)});g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();var qc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function kg(e){return typeof e=="string"&&qc.test(e)}var Ri=kg;g();d();f();p();var ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function _c(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}g();d();f();p();var Ei,Tg=new Uint8Array(16);function Ii(){if(!Ei){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ei=crypto.getRandomValues.bind(crypto)}return Ei(Tg)}g();d();f();p();g();d();f();p();var Og=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Pi={randomUUID:Og};function Fg(e,t,r){if(Pi.randomUUID&&!t&&!e)return Pi.randomUUID();e=e||{};let n=e.random??e.rng?.()??Ii();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return _c(n)}var ki=Fg;g();d();f();p();function Lc(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Dg({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:s}=e;s!=="disabled"&&(n.call(r),t.send(o,i,r))}var jc="visitorId";function Mg(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(jc),o=n&&Ri(n)?n:t.generateUUID();return r.setItem(jc,o),o}}}var Vc="1.2.1";function Ng(e){let{trackingId:t}=e;return{trackingId:t}}function qg(e){return(e.source||[]).concat([`relay@${Vc}`])}function Bc(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:s}=r,u=Ng(t),c=n.getClientId();return Object.freeze({type:e,config:u,ts:Date.now(),source:qg(t),clientId:c,userAgent:s(),referrer:o(),location:i()})}function _g(e,t,r,n,o){return{...t,meta:Bc(e,r,n,o)}}var Lg="*";function jg(){let e=[];function t({type:c,callback:a}){return e.findIndex(h=>h.type===c&&h.callback===a)}function r(c,a){return c.type==="*"||a===c.type}function n(c){return t(c)<0&&e.push(c),()=>u(c.type,c.callback)}function o(c){e.forEach(a=>{if(r(a,c.meta.type))try{a.callback(c)}catch(h){console.error(h)}})}function i(c){if(c===Lg)e.length=0;else for(let a=e.length-1;a>=0;a--)e[a].type===c&&e.splice(a,1)}function s(c){let a=t(c);a>=0&&e.splice(a,1)}function u(c,a){a?s({type:c,callback:a}):i(c)}return{add:n,call:o,remove:u}}function Uc({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},...!!n.environment&&{environment:n.environment}})}function Ug(e){let t=Uc(e);return{get:()=>t,update:r=>{t=Uc({...t,...r})}}}var Ti=Vg();function Vg(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let s=i.replace(/^\s+/,"");if(s.lastIndexOf(n,0)===0)return s.substring(n.length,s.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),s=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,u=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${s}${u};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Bg(){return{getItem(e){return Ti.getItem(e)||localStorage.getItem(e)},removeItem(e){Ti.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ti.setItem(e,t,31556952e3)}}}function Qg(){let e=document.referrer;return e===""?null:e}function $g(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(Lc().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:()=>Qg(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>ki(),storage:Bg()}}function Hg(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function zg(){return{getItem(){return null},removeItem(){},setItem(){}}}function Gg(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:zg()}}function Wg(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=Gg();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&Kg()&&Hg()?$g():n}function Kg(){try{return typeof window=="object"}catch{return!1}}function Yg(e){return{get:()=>Object.freeze(Wg(e))}}function Qc(e){let t=Ug(e),r=jg(),n=Yg(t),o=Mg(n);return{emit:(i,s)=>{let u=t.get(),c=n.get(),a=_g(i,s,u,c,o);return Dg({config:u,environment:c,event:a,listenerManager:r})},getMeta:i=>Bc(i,t.get(),n.get(),o),on:(i,s)=>r.add({type:i,callback:s}),off:(i,s)=>r.remove(i,s),updateConfig:i=>t.update(i),version:Vc}}g();d();f();p();var er=ae(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Jt}`));var tr=ae(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>er(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},s)=>Qc({mode:i?"emit":"disabled",url:o??an(e,t),token:r,trackingId:n??null,source:s}));g();d();f();p();g();d();f();p();var Oi=e=>({referrer:document.referrer,userAgent:navigator.userAgent,location:window.location.href,clientId:e}),jr=()=>({referrer:null,userAgent:null,location:null,clientId:""});g();d();f();p();var Fi=ae(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...t&&{aq:t},...r&&{cq:r},...n&&{dq:n},...o&&{lq:o}}});g();d();f();p();var rr=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...r&&{actionCause:r.actionCause},...r&&{customData:r.customData},...e.userDisplayName&&{userDisplayName:e.userDisplayName},...e.deviceId&&{deviceId:e.deviceId},...e.trackingId&&{trackingId:e.trackingId},capture:t.capture??t.clientId!=="",source:er(e)}});g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();g();d();f();p();function rt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function D(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function u(h){try{a(n.next(h))}catch(y){s(y)}}function c(h){try{a(n.throw(h))}catch(y){s(y)}}function a(h){h.done?i(h.value):o(h.value).then(u,c)}a((n=n.apply(e,t||[])).next())})}var re;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(re||(re={}));function Ni(){return typeof window<"u"}function Wi(){return typeof navigator<"u"}function nr(){return typeof document<"u"}function qi(){try{return typeof localStorage<"u"}catch{return!1}}function Jg(){try{return typeof sessionStorage<"u"}catch{return!1}}function nu(){return Wi()&&navigator.cookieEnabled}var Xg=[re.click,re.custom,re.search,re.view],Zg=(e,t)=>Xg.indexOf(e)!==-1?Object.assign({language:nr()?document.documentElement.lang:"unknown",userAgent:Wi()?navigator.userAgent:"unknown"},t):t,Br=class e{static set(t,r,n){var o,i,s,u;n&&(i=new Date,i.setTime(i.getTime()+n)),u=window.location.hostname,u.indexOf(".")===-1?$c(t,r,i):(s=u.split("."),o=s[s.length-2]+"."+s[s.length-1],$c(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function $c(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function em(){return qi()?localStorage:nu()?new Qr:Jg()?sessionStorage:new ir}var Qr=class e{getItem(t){return Br.get(`${e.prefix}${t}`)}removeItem(t){Br.erase(`${e.prefix}${t}`)}setItem(t,r,n){Br.set(`${e.prefix}${t}`,r,n)}};Qr.prefix="coveo_";var _i=class{constructor(){this.cookieStorage=new Qr}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},ir=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Ur="__coveo.analytics.history",ou=20,iu=1e3*60,su=75,sr=class{constructor(t){this.store=t||em()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return D(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return D(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Ur);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return D(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Ur);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Ur,JSON.stringify(t.slice(0,ou)))}catch{}}clear(){try{this.store.removeItem(Ur)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,su)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>iu:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}},au=Object.freeze({__proto__:null,HistoryStore:sr,MAX_NUMBER_OF_HISTORY_ELEMENTS:ou,MAX_VALUE_SIZE:su,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:iu,STORE_KEY:Ur,default:sr}),tm=(e,t)=>D(void 0,void 0,void 0,function*(){return e===re.view?(yield rm(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),rm=e=>D(void 0,void 0,void 0,function*(){let t=new sr,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Nn,nm=new Uint8Array(16);function om(){if(!Nn&&(Nn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Nn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nn(nm)}var im=/^(?:[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 _n(e){return typeof e=="string"&&im.test(e)}var Ce=[];for(let e=0;e<256;++e)Ce.push((e+256).toString(16).slice(1));function cu(e,t=0){return(Ce[e[t+0]]+Ce[e[t+1]]+Ce[e[t+2]]+Ce[e[t+3]]+"-"+Ce[e[t+4]]+Ce[e[t+5]]+"-"+Ce[e[t+6]]+Ce[e[t+7]]+"-"+Ce[e[t+8]]+Ce[e[t+9]]+"-"+Ce[e[t+10]]+Ce[e[t+11]]+Ce[e[t+12]]+Ce[e[t+13]]+Ce[e[t+14]]+Ce[e[t+15]]).toLowerCase()}function sm(e){if(!_n(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]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,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]=t&255,r}function am(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var cm="6ba7b810-9dad-11d1-80b4-00c04fd430c8",um="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function lm(e,t,r){function n(o,i,s,u){var c;if(typeof o=="string"&&(o=am(o)),typeof i=="string"&&(i=sm(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+o.length);if(a.set(i),a.set(o,i.length),a=r(a),a[6]=a[6]&15|t,a[8]=a[8]&63|128,s){u=u||0;for(let h=0;h<16;++h)s[u+h]=a[h];return s}return cu(a)}try{n.name=e}catch{}return n.DNS=cm,n.URL=um,n}var dm=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Hc={randomUUID:dm};function Mt(e,t,r){if(Hc.randomUUID&&!t&&!e)return Hc.randomUUID();e=e||{};let n=e.random||(e.rng||om)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return cu(n)}function pm(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function Di(e,t){return e<<t|e>>>32-t}function fm(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let s=unescape(encodeURIComponent(e));e=[];for(let u=0;u<s.length;++u)e.push(s.charCodeAt(u))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let s=0;s<o;++s){let u=new Uint32Array(16);for(let c=0;c<16;++c)u[c]=e[s*64+c*4]<<24|e[s*64+c*4+1]<<16|e[s*64+c*4+2]<<8|e[s*64+c*4+3];i[s]=u}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<o;++s){let u=new Uint32Array(80);for(let m=0;m<16;++m)u[m]=i[s][m];for(let m=16;m<80;++m)u[m]=Di(u[m-3]^u[m-8]^u[m-14]^u[m-16],1);let c=r[0],a=r[1],h=r[2],y=r[3],S=r[4];for(let m=0;m<80;++m){let v=Math.floor(m/20),x=Di(c,5)+pm(v,a,h,y)+S+t[v]+u[m]>>>0;S=y,y=h,h=Di(a,30)>>>0,a=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+a>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var gm=lm("v5",80,fm),zc=gm,uu="2.30.45",Gc=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Vr={pageview:"pageview",event:"event"},Ln=class{constructor({client:t,uuidGenerator:r=Mt}){this.client=t,this.uuidGenerator=r}},Li=class extends Ln{constructor({client:t,uuidGenerator:r=Mt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Gc(window.location),this.lastReferrer=nr()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:nr()?document.title:"",encoding:nr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Vr.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Vr.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Vr.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Vr.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Gc(window.location)}},lt=class e{constructor(t,r){if(!_n(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/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(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return _n(i)?new e(i,Number.parseInt(o)*1e3):null}};lt.cvo_cid="cvo_cid";lt.expirationTime=120;var ji=class extends Ln{constructor({client:t,uuidGenerator:r=Mt}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return D(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(lt.cvo_cid,new lt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ji.Id="link";var _e=Object.keys;function qn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Mi=128,lu=192,Wc=224,Kc=240;function mm(e){return(e&248)===Kc?4:(e&Kc)===Wc?3:(e&Wc)===lu?2:1}function hm(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);if((n&Mi)!=Mi)break;if(r-=3,(n&lu)!=Mi){t-r>=mm(n)*3&&(r=t);break}}return e.substring(0,r)}var Ui={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"},ym=_e(Ui).map(e=>Ui[e]),Sm=[...ym].join("|"),vm=new RegExp(`^(${Sm}$)`),Cm={svcAction:"svc_action",svcActionData:"svc_action_data"},Am=e=>_e(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ui[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),bm=e=>vm.test(e),wm=[bm],Yc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Jc={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ae={action:"pa",list:"pal",listSource:"pls"},jn={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},xm=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Vi={id:"quoteId",affiliation:"quoteAffiliation"},Bi={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},Rm={add:Ae,bookmark_add:Ae,bookmark_remove:Ae,click:Ae,checkout:Ae,checkout_option:Ae,detail:Ae,impression:Ae,remove:Ae,refund:Object.assign(Object.assign({},Ae),jn),purchase:Object.assign(Object.assign({},Ae),jn),quickview:Ae,quote:Object.assign(Object.assign({},Ae),Vi),review:Object.assign(Object.assign({},Ae),Bi)},Em=_e(Yc).map(e=>Yc[e]),Im=_e(Jc).map(e=>Jc[e]),Pm=_e(Ae).map(e=>Ae[e]),km=_e(jn).map(e=>jn[e]),Tm=_e(Bi).map(e=>Bi[e]),Om=_e(Vi).map(e=>Vi[e]),Fm=[...Em,"custom"].join("|"),Dm=[...Im,"custom"].join("|"),du="(pr[0-9]+)",pu="(il[0-9]+pi[0-9]+)",Mm=new RegExp(`^${du}(${Fm})$`),Nm=new RegExp(`^(${pu}(${Dm}))|(il[0-9]+nm)$`),qm=new RegExp(`^(${Pm.join("|")})$`),_m=new RegExp(`^(${km.join("|")})$`),Lm=new RegExp(`^${du}custom$`),jm=new RegExp(`^${pu}custom$`),Um=new RegExp(`^(${[...xm,...Tm,...Om].join("|")})$`),Vm=e=>Mm.test(e),Bm=e=>Nm.test(e),Qm=e=>qm.test(e),$m=e=>_m.test(e),Hm=e=>Um.test(e),zm=[Bm,Vm,Qm,$m,Hm],Gm=[Lm,jm],Wm={anonymizeIp:"aip"},Km={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Ym={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Jm=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Xm=Object.assign(Object.assign(Object.assign(Object.assign({},Wm),Km),Ym),Jm.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Qi=Object.assign(Object.assign({},Xm),Cm),Zm=e=>{let t=!!e.action&&Rm[e.action]||{};return _e(e).reduce((r,n)=>{let o=t[n]||Qi[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},eh=_e(Qi).map(e=>Qi[e]),th=e=>eh.indexOf(e)!==-1,rh=e=>e==="custom",nh=e=>[...zm,...wm,th,rh].some(t=>t(e)),oh=e=>_e(e).reduce((t,r)=>{let n=ih(r);return n?Object.assign(Object.assign({},t),sh(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),ih=e=>{let t;return[...Gm].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},sh=(e,t)=>_e(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),$i=class{constructor(t){this.opts=t}sendEvent(t,r){return D(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:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:s,payload:u}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,u),a=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(s,a)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return D(this,void 0,void 0,function*(){let o=t,i=r;if(n){let s=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:u,body:c}=s;o=u||t;try{i=JSON.parse(c)}catch(a){console.error("Unable to process the request body as a JSON string",a)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return D(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[re.click,re.custom,re.search,re.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Hi=class{sendEvent(t,r){return D(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){return Promise.resolve()})}},Xc=C.fetch,Un=class{constructor(t){this.opts=t}sendEvent(t,r){return D(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,s=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",u={url:`${n}/analytics/${t}${s}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},u),i?yield i(u,"analyticsFetch"):{}),{url:a}=c,h=rt(c,["url"]),y;try{y=yield Xc(a,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(y.ok){let S=yield y.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{y.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,y,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return D(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Xc(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[re.click,re.custom,re.search,re.view].indexOf(t)!==-1}getVisitorIdParam(){return D(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},zi=class{constructor(t,r){qi()&&nu()?this.storage=new _i:qi()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new ir),this.client=new Un(t),this.beaconClient=new $i(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Gi=class{constructor(t,r){this.storage=r||new ir,this.client=new Un(t)}getClientDependingOnEventType(t){return this.client}},Vn=class{constructor(){this.storage=new ir,this.client=new Hi}getClientDependingOnEventType(t){return this.client}},ah="xx",ch=e=>e?.startsWith(ah)||!1,uh=`
28
28
  We've detected you're using React Native but have not provided the corresponding runtime,
29
29
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
30
30
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native