@coveo/quantic 3.30.2-pre.ebbb6c85a7 → 3.30.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.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +3 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/knowledge/generated-answer/headless-answerapi-generated-answer-mocks.d.ts +7737 -704
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-request.d.ts +20 -1961
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/headless.js +3 -5
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +3 -5
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +3 -5
- package/package.json +3 -3
|
@@ -23,11 +23,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
23
23
|
`)}
|
|
24
24
|
|
|
25
25
|
${t}
|
|
26
|
-
`;return new Wr(r)}var Wr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=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 tm(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}},fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&X(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 ve(e){return e===void 0}function rm(e){return e===null}function X(e){return ve(e)||rm(e)}var ne=class{constructor(e={}){de(this,"value");this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(nm(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function nm(e){return ve(e)||mc(e)}function mc(e){return typeof e=="boolean"}var J=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(om(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 om(e){return ve(e)||gc(e)}function gc(e){return typeof e=="number"&&!Number.isNaN(e)}var im=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){de(this,"value");de(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ve(e))return null;if(!Mn(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&&!(im.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 Mn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ve(e))return this.config.options.required?"value is required and is currently undefined":null;if(!yc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(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 yc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(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&&X(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 mc(e)||Mn(e)||gc(e)||yc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function hc(e){return Array.isArray(e)}var Vi=class{constructor(e){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ve(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}};d();c();l();u();function Sc(e){return Array.isArray(e)}function Nn(e){return e.trim()===""}var am=new Set(["1",1,"yes",!0]);function vc(){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=>am.has(r))}function bc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Kr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function sm(e){if(Nn(e.openingDelimiter)||Nn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||Nn(e.content))return e.content;if(e.highlights.length===0)return Zt(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,m=a+i.length;if(m>t)break;r+=Zt(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Zt(e.content.slice(a,m)),r+=e.closingDelimiter,n=m}return n!==t&&(r+=Zt(e.content.slice(n))),r}function cm(e,t){return e=Zt(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Li(n,t.notMatchDelimiters):o?Li(o,t.exactMatchDelimiters):i?Li(i,t.correctionDelimiters):r)}function Li(e,t){return t?t.open+e+t.close:e}function Zt(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var Tc=Qe(kc(),1);d();c();l();u();var ze=new Error("Failed to load reducers."),er=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},jt=class extends Error{constructor(r,n){super();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function Pc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Fc(e){return typeof e!="object"||!e?!1:Object.values(e).every(qm)}function qm(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Oc(e){return e===429}var Be=class e{static call(t){return _asyncToGenerator(function*(){let r=jm(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield A(i,a);if(Oc(f.status))throw f;return f});return function m(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Tc.backOff)(m,{retry:p=>{let y=p&&Oc(p.status);return y&&n.info("Platform retrying request"),y}});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new er;case 404:throw new jt(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new jt(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,p=Kr(f);try{let y=yield o(t,n,a);return{...t,...y}}catch(y){i.error(y,"Platform request preprocessing failed. Returning default request options.")}return p})()}};function ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function pt(e,t="prod"){return`${ke(e,t)}/rest/search/v2`}function Vn(e,t="prod"){return`${ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function jm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=Mm(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(m&&{body:f}),signal:a}}function Mm(e,t){return t==="application/x-www-form-urlencoded"?Fc(e)?Pc(e):"":JSON.stringify(e)}d();c();l();u();d();c();l();u();var Ln=e=>e;d();c();l();u();d();c();l();u();function Un(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ge(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Un(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Un(),extendedResults:{},searchAction:void 0}}d();c();l();u();function ft(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var mt=e=>{let{response:t}=e;return t.body?Nm(e):_m(t)},Nm=e=>Lm(e)?Um(e):Vm(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},_m=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Vm(e){return e.body.statusCode!==void 0}function Lm(e){return e.body.exception!==void 0}var Um=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var gt=class{constructor(){de(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();var Xr=class{constructor(t){de(this,"_basePath");de(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}};d();c();l();u();function Dc(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var rt=(e,t,r,n)=>{let o=new Xr(`${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 qc=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield Be.call({...rt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ft(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Dc(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Qm(a)?{success:a}:{error:mt({response:r,body:a})}});return function qc(_x2,_x3){return _ref2.apply(this,arguments)}}();function Qm(e){return typeof e=="string"}d();c();l();u();function Bm(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function $m(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Qn(e,t){if(t&&e.name==="AbortError")return{error:$m(e)};if(e instanceof jt)return{error:Bm(e)};throw e}var Bn=class{constructor(t){this.options=t;de(this,"apiCallsQueues",{unknown:new gt,mainSearch:new gt,facetValues:new gt,foldingCollection:new gt,instantResults:new gt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/plan"),requestParams:ft(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Qn(r);let n=yield r.json();return zm(n)?{success:n}:{error:mt({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ft(t),..._this3.options});if(r instanceof Error)return Qn(r);let n=yield r.json(),o={response:r,body:n};return Hm(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mt(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(m=>Be.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:m??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Qn(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return jc(i)?(a.body=Mc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:mt(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/facet"),requestParams:ft(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(jc(n)){let o={response:r,body:n};return o.body=Mc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mt({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return qc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return Gm(n)?{success:n}:{error:mt({response:r,body:n})}})()}},$n=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function jc(e){return e.results!==void 0}function Mc(e){let t=Un();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Hm(e){return e.completions!==void 0}function zm(e){return e.preprocessingOutput!==void 0}function Gm(e){return e.fields!==void 0}d();c();l();u();var Nc=e=>e,_c=e=>e,Vc=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function be(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 Wm=typeof Symbol=="function"&&Symbol.observable||"@@observable",Lc=Wm,Yi=()=>Math.random().toString(36).substring(7).split("").join("."),Km={INIT:`@@redux/INIT${Yi()}`,REPLACE:`@@redux/REPLACE${Yi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yi()}`},Hn=Km;function We(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 Ji(e,t,r){if(typeof e!="function")throw new Error(be(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(be(1));return r(Ji)(e,t)}let n=e,o=t,i=new Map,a=i,m=0,f=!1;function p(){a===i&&(a=new Map,i.forEach((k,R)=>{a.set(R,k)}))}function y(){if(f)throw new Error(be(3));return o}function h(k){if(typeof k!="function")throw new Error(be(4));if(f)throw new Error(be(5));let R=!0;p();let P=m++;return a.set(P,k),function(){if(R){if(f)throw new Error(be(6));R=!1,p(),a.delete(P),i=null}}}function S(k){if(!We(k))throw new Error(be(7));if(typeof k.type>"u")throw new Error(be(8));if(typeof k.type!="string")throw new Error(be(17));if(f)throw new Error(be(9));try{f=!0,o=n(o,k)}finally{f=!1}return(i=a).forEach(P=>{P()}),k}function g(k){if(typeof k!="function")throw new Error(be(10));n=k,S({type:Hn.REPLACE})}function v(){let k=h;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(be(11));function P(){let E=R;E.next&&E.next(y())}return P(),{unsubscribe:k(P)}},[Lc](){return this}}}return S({type:Hn.INIT}),{dispatch:S,subscribe:h,getState:y,replaceReducer:g,[Lc]:v}}function Ym(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Hn.INIT})>"u")throw new Error(be(12));if(typeof r(void 0,{type:Hn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function tr(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let m=t[a];typeof e[m]=="function"&&(r[m]=e[m])}let n=Object.keys(r),o,i;try{Ym(r)}catch(a){i=a}return function(m={},f){if(i)throw i;let p=!1,y={};for(let h=0;h<n.length;h++){let S=n[h],g=r[S],v=m[S],x=g(v,f);if(typeof x>"u"){let k=f&&f.type;throw new Error(be(14))}y[S]=x,p=p||x!==v}return p=p||n.length!==Object.keys(m).length,p?y:m}}function rr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Uc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(be(15))},a={getState:o.getState,dispatch:(f,...p)=>i(f,...p)},m=e.map(f=>f(a));return i=rr(...m)(o.dispatch),{...o,dispatch:i}}}function zn(e){return We(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var sa=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function Ae(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Nt=Object.getPrototypeOf;function Me(e){return!!e&&!!e[Te]}function De(e){return e?zc(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||nr(e)||an(e):!1}var Jm=Object.prototype.constructor.toString();function zc(e){if(!e||typeof e!="object")return!1;let t=Nt(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)===Jm}function ca(e){return Me(e)||Ae(15,e),e[Te].base_}function en(e,t){_t(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function _t(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:nr(e)?2:an(e)?3:0}function tn(e,t){return _t(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t){return _t(e)===2?e.get(t):e[t]}function Gc(e,t,r){let n=_t(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Xm(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nr(e){return e instanceof Map}function an(e){return e instanceof Set}function Mt(e){return e.copy_||e.base_}function ta(e,t){if(nr(e))return new Map(e);if(an(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=zc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Te];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],m=n[a];m.writable===!1&&(m.writable=!0,m.configurable=!0),(m.get||m.set)&&(n[a]={configurable:!0,writable:!0,enumerable:m.enumerable,value:e[a]})}return Object.create(Nt(e),n)}else{let n=Nt(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Yn(e,t=!1){return Jn(e)||Me(e)||!De(e)||(_t(e)>1&&Object.defineProperties(e,{set:{value:Gn},add:{value:Gn},clear:{value:Gn},delete:{value:Gn}}),Object.freeze(e),t&&Object.values(e).forEach(r=>Yn(r,!0))),e}function Gn(){Ae(2)}function Jn(e){return Object.isFrozen(e)}var ra={};function Vt(e){let t=ra[e];return t||Ae(0,e),t}function Zm(e,t){ra[e]||(ra[e]=t)}var rn;function Wc(){return rn}function eg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Qc(e,t){t&&(Vt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function na(e){oa(e),e.drafts_.forEach(tg),e.drafts_=null}function oa(e){e===rn&&(rn=e.parent_)}function Bc(e){return rn=eg(rn,e)}function tg(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $c(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(na(t),Ae(4)),De(e)&&(e=Wn(t,e),t.parent_||Kn(t,e)),t.patches_&&Vt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=Wn(t,r,[]),na(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sa?e:void 0}function Wn(e,t,r){if(Jn(t))return t;let n=t[Te];if(!n)return en(t,(o,i)=>Hc(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Kn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),en(i,(m,f)=>Hc(e,n,o,m,f,r,a)),Kn(e,o,!1),r&&e.patches_&&Vt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Hc(e,t,r,n,o,i,a){if(Me(o)){let m=i&&t&&t.type_!==3&&!tn(t.assigned_,n)?i.concat(n):void 0,f=Wn(e,o,m);if(Gc(r,n,f),Me(f))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!Jn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Wn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(nr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Kn(e,o)}}function Kn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Yn(t,r)}function rg(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Wc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=ua;r&&(o=[n],i=nn);let{revoke:a,proxy:m}=Proxy.revocable(o,i);return n.draft_=m,n.revoke_=a,m}var ua={get(e,t){if(t===Te)return e;let r=Mt(e);if(!tn(r,t))return ng(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===Zi(e.base_,t)?(ea(e),e.copy_[t]=aa(n,e)):n},has(e,t){return t in Mt(e)},ownKeys(e){return Reflect.ownKeys(Mt(e))},set(e,t,r){let n=Kc(Mt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zi(Mt(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Xm(r,o)&&(r!==void 0||tn(e.base_,t)))return!0;ea(e),ia(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 Zi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ea(e),ia(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Mt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ae(11)},getPrototypeOf(e){return Nt(e.base_)},setPrototypeOf(){Ae(12)}},nn={};en(ua,(e,t)=>{nn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nn.deleteProperty=function(e,t){return nn.set.call(this,e,t,void 0)};nn.set=function(e,t,r){return ua.set.call(this,e[0],t,r,e[0])};function Zi(e,t){let r=e[Te];return(r?Mt(r):e)[t]}function ng(e,t,r){let n=Kc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Kc(e,t){if(!(t in e))return;let r=Nt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Nt(r)}}function ia(e){e.modified_||(e.modified_=!0,e.parent_&&ia(e.parent_))}function ea(e){e.copy_||(e.copy_=ta(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var og=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 a=this;return function(f=i,...p){return a.produce(f,y=>r.call(this,y,...p))}}typeof r!="function"&&Ae(6),n!==void 0&&typeof n!="function"&&Ae(7);let o;if(De(t)){let i=Bc(this),a=aa(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?na(i):oa(i)}return Qc(i,n),$c(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===sa&&(o=void 0),this.autoFreeze_&&Yn(o,!0),n){let i=[],a=[];Vt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ae(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...m)=>this.produceWithPatches(a,f=>t(f,...m));let n,o;return[this.produce(t,r,(a,m)=>{n=a,o=m}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||Ae(8),Me(e)&&(e=Yc(e));let t=Bc(this),r=aa(e,void 0);return r[Te].isManual_=!0,oa(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&Ae(9);let{scope_:n}=r;return Qc(n,t),$c(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=Vt("Patches").applyPatches_;return Me(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aa(e,t){let r=nr(e)?Vt("MapSet").proxyMap_(e,t):an(e)?Vt("MapSet").proxySet_(e,t):rg(e,t);return(t?t.scope_:Wc()).drafts_.push(r),r}function Yc(e){return Me(e)||Ae(10,e),Jc(e)}function Jc(e){if(!De(e)||Jn(e))return e;let t=e[Te],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ta(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ta(e,!0);return en(r,(n,o)=>{Gc(r,n,Jc(o))}),t&&(t.finalized_=!1),r}function Xc(){let t="replace",r="add",n="remove";function o(S,g,v,x){switch(S.type_){case 0:case 2:return a(S,g,v,x);case 1:return i(S,g,v,x);case 3:return m(S,g,v,x)}}function i(S,g,v,x){let{base_:k,assigned_:R}=S,P=S.copy_;P.length<k.length&&([k,P]=[P,k],[v,x]=[x,v]);for(let w=0;w<k.length;w++)if(R[w]&&P[w]!==k[w]){let E=g.concat([w]);v.push({op:t,path:E,value:h(P[w])}),x.push({op:t,path:E,value:h(k[w])})}for(let w=k.length;w<P.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:h(P[w])})}for(let w=P.length-1;k.length<=w;--w){let E=g.concat([w]);x.push({op:n,path:E})}}function a(S,g,v,x){let{base_:k,copy_:R}=S;en(S.assigned_,(P,w)=>{let E=Xi(k,P),M=Xi(R,P),O=w?tn(k,P)?t:r:n;if(E===M&&O===t)return;let I=g.concat(P);v.push(O===n?{op:O,path:I}:{op:O,path:I,value:M}),x.push(O===r?{op:n,path:I}:O===n?{op:r,path:I,value:h(E)}:{op:t,path:I,value:h(E)})})}function m(S,g,v,x){let{base_:k,copy_:R}=S,P=0;k.forEach(w=>{if(!R.has(w)){let E=g.concat([P]);v.push({op:n,path:E,value:w}),x.unshift({op:r,path:E,value:w})}P++}),P=0,R.forEach(w=>{if(!k.has(w)){let E=g.concat([P]);v.push({op:r,path:E,value:w}),x.unshift({op:n,path:E,value:w})}P++})}function f(S,g,v,x){v.push({op:t,path:[],value:g===sa?void 0:g}),x.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:x,op:k}=v,R=S;for(let M=0;M<x.length-1;M++){let O=_t(R),I=x[M];typeof I!="string"&&typeof I!="number"&&(I=""+I),(O===0||O===1)&&(I==="__proto__"||I==="constructor")&&Ae(19),typeof R=="function"&&I==="prototype"&&Ae(19),R=Xi(R,I),typeof R!="object"&&Ae(18,x.join("/"))}let P=_t(R),w=y(v.value),E=x[x.length-1];switch(k){case t:switch(P){case 2:return R.set(E,w);case 3:Ae(16);default:return R[E]=w}case r:switch(P){case 1:return E==="-"?R.push(w):R.splice(E,0,w);case 2:return R.set(E,w);case 3:return R.add(w);default:return R[E]=w}case n:switch(P){case 1:return R.splice(E,1);case 2:return R.delete(E);case 3:return R.delete(v.value);default:return delete R[E]}default:Ae(17,k)}}),S}function y(S){if(!De(S))return S;if(Array.isArray(S))return S.map(y);if(nr(S))return new Map(Array.from(S.entries()).map(([v,x])=>[v,y(x)]));if(an(S))return new Set(Array.from(S).map(y));let g=Object.create(Nt(S));for(let v in S)g[v]=y(S[v]);return tn(S,Zr)&&(g[Zr]=S[Zr]),g}function h(S){return Me(S)?y(S):S}Zm("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:f})}var on=new og,nt=on.produce,Xn=on.produceWithPatches.bind(on);var la=on.applyPatches.bind(on);d();c();l();u();function ig(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ag(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function sg(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 Zc=e=>Array.isArray(e)?e:[e];function cg(e){let t=Array.isArray(e[0])?e[0]:e;return sg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ug(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var YR=Symbol();var JR=Object.getPrototypeOf({});var lg=class{constructor(e){this.value=e}deref(){return this.value}},dg=typeof WeakRef<"u"?WeakRef:lg,pg=0,eu=1;function Zn(){return{s:pg,v:void 0,o:null,p:null}}function or(e,t={}){let r=Zn(),{resultEqualityCheck:n}=t,o,i=0;function a(){let m=r,{length:f}=arguments;for(let h=0,S=f;h<S;h++){let g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=m.o;v===null&&(m.o=v=new WeakMap);let x=v.get(g);x===void 0?(m=Zn(),v.set(g,m)):m=x}else{let v=m.p;v===null&&(m.p=v=new Map);let x=v.get(g);x===void 0?(m=Zn(),v.set(g,m)):m=x}}let p=m,y;if(m.s===eu)y=m.v;else if(y=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,y)&&(y=h,i!==0&&i--),o=typeof y=="object"&&y!==null||typeof y=="function"?new dg(y):y}return p.s=eu,p.v=y,y}return a.clearCache=()=>{r=Zn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function tu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,m,f={},p=o.pop();typeof p=="object"&&(f=p,p=o.pop()),ig(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let y={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:g=or,argsMemoizeOptions:v=[],devModeChecks:x={}}=y,k=Zc(S),R=Zc(v),P=cg(o),w=h(function(){return i++,p.apply(null,arguments)},...k),E=!0,M=g(function(){a++;let I=ug(P,arguments);return m=w.apply(null,I),m},...R);return Object.assign(M,{resultFunc:p,memoizedResultFunc:w,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var pe=tu(or),fg=Object.assign((e,t=pe)=>{ag(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((a,m,f)=>(a[r[f]]=m,a),{}))},{withTypes:()=>fg});d();c();l();u();function ru(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var nu=ru(),ou=ru;var mg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?rr:rr.apply(null,arguments)},gx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},gg=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error($e(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=>zn(n)&&n.type===e,r}var uu=class sn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sn.prototype)}static get[Symbol.species](){return sn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sn(...t[0].concat(this)):new sn(...t.concat(this))}};function iu(e){return De(e)?nt(e,()=>{}):e}function au(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function yg(e){return typeof e=="boolean"}var hg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new uu;return r&&(yg(r)?a.push(nu):a.push(ou(r.extraArgument))),a},cn="RTK_autoBatch",ar=()=>e=>({payload:e,meta:{[cn]:!0}}),su=e=>t=>{setTimeout(t,e)},Sg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,m=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:su(10):e.type==="callback"?e.queueNotification:su(e.timeout),p=()=>{a=!1,i&&(i=!1,m.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let h=()=>o&&y(),S=n.subscribe(h);return m.add(y),()=>{S(),m.delete(y)}},dispatch(y){try{return o=!y?.meta?.[cn],i=!o,i&&(a||(a=!0,f(p))),n.dispatch(y)}finally{o=!0}}})},vg=e=>function(r){let{autoBatch:n=!0}=r??{},o=new uu(e);return n&&o.push(Sg(typeof n=="object"?n:void 0)),o};function lu(e){let t=hg(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},m;if(typeof r=="function")m=r;else if(We(r))m=tr(r);else throw new Error($e(1));let f;typeof n=="function"?f=n(t):f=t();let p=rr;o&&(p=mg({trace:!1,...(typeof o=="object"&&o)}));let y=Uc(...f),h=vg(y),S=typeof a=="function"?a(h):h(),g=p(...S);return Ji(m,i,g)}function du(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error($e(28));if(m in t)throw new Error($e(29));return t[m]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function bg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=du(t),i;if(bg(e))i=()=>iu(e());else{let m=iu(e);i=()=>m}function a(m=i(),f){let p=[r[f.type],...n.filter(({matcher:y})=>y(f)).map(({reducer:y})=>y)];return p.filter(y=>!!y).length===0&&(p=[o]),p.reduce((y,h)=>{if(h)if(Me(y)){let g=h(y,f);return g===void 0?y:g}else{if(De(y))return nt(y,S=>h(S,f));{let S=h(y,f);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return y},m)}return a.getInitialState=i,a}var pu=(e,t)=>gg(e)?e.match(t):e(t);function Ke(...e){return t=>e.some(r=>pu(r,t))}function ir(...e){return t=>e.every(r=>pu(r,t))}function to(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 un(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ro(...e){return e.length===0?t=>to(t,["pending"]):un(e)?Ke(...e.map(t=>t.pending)):ro()(e[0])}function Lt(...e){return e.length===0?t=>to(t,["rejected"]):un(e)?Ke(...e.map(t=>t.rejected)):Lt()(e[0])}function ln(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ir(Lt(...e),t):un(e)?ir(Lt(...e),t):ln()(e[0])}function ot(...e){return e.length===0?t=>to(t,["fulfilled"]):un(e)?Ke(...e.map(t=>t.fulfilled)):ot()(e[0])}function no(...e){return e.length===0?t=>to(t,["pending","fulfilled","rejected"]):un(e)?Ke(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):no()(e[0])}var Ag="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",oo=(e=21)=>{let t="",r=e;for(;r--;)t+=Ag[Math.random()*64|0];return t},Cg=["name","message","stack","code"],da=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},cu=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},wg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Cg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ue=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,p,y,h)=>({payload:f,meta:{...(h||{}),arg:y,requestId:p,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,p,y)=>({payload:void 0,meta:{...(y||{}),arg:p,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,p,y,h,S)=>({payload:h,error:(n&&n.serializeError||wg)(f||"Rejected"),meta:{...(S||{}),arg:y,requestId:p,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function m(f){return(p,y,h)=>{let S=n?.idGenerator?n.idGenerator(f):oo(),g=new s.AbortController,v,x;function k(P){x=P,g.abort()}let R=_asyncToGenerator(function*(){let P;try{let E=n?.condition?.(f,{getState:y,extra:h});if(xg(E)&&(E=yield E),E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((O,I)=>{v=()=>{I({name:"AbortError",message:x||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:y,extra:h}))),P=yield Promise.race([M,Promise.resolve(r(f,{dispatch:p,getState:y,extra:h,requestId:S,signal:g.signal,abort:k,rejectWithValue:(O,I)=>new da(O,I),fulfillWithValue:(O,I)=>new cu(O,I)})).then(O=>{if(O instanceof da)throw O;return O instanceof cu?o(O.payload,S,f,O.meta):o(O,S,f)})])}catch(E){P=E instanceof da?a(null,S,f,E.payload,E.meta):a(E,S,f)}finally{v&&g.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(P)&&P.meta.condition||p(P),P})();return Object.assign(R,{abort:k,requestId:S,arg:f,unwrap(){return R.then(Rg)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ke(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Rg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function xg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var fu=Symbol.for("rtk-slice-createasyncthunk"),bx={[fu]:ue};function Eg(e,t){return`${e}/${t}`}function Ig({creators:e}={}){let t=e?.asyncThunk?.[fu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error($e(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Pg()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(P,w){let E=typeof P=="string"?P:P.type;if(!E)throw new Error($e(12));if(E in f.sliceCaseReducersByType)throw new Error($e(13));return f.sliceCaseReducersByType[E]=w,p},addMatcher(P,w){return f.sliceMatchers.push({matcher:P,reducer:w}),p},exposeAction(P,w){return f.actionCreators[P]=w,p},exposeCaseReducer(P,w){return f.sliceCaseReducersByName[P]=w,p}};m.forEach(P=>{let w=a[P],E={reducerName:P,type:Eg(o,P),createNotation:typeof n.reducers=="function"};Og(w)?Dg(E,w,p,t):Fg(E,w,p)});function y(){let[P={},w=[],E=void 0]=typeof n.extraReducers=="function"?du(n.extraReducers):[n.extraReducers],M={...P,...f.sliceCaseReducersByType};return ge(n.initialState,O=>{for(let I in M)O.addCase(I,M[I]);for(let I of f.sliceMatchers)O.addMatcher(I.matcher,I.reducer);for(let I of w)O.addMatcher(I.matcher,I.reducer);E&&O.addDefaultCase(E)})}let h=P=>P,S=new Map,g;function v(P,w){return g||(g=y()),g(P,w)}function x(){return g||(g=y()),g.getInitialState()}function k(P,w=!1){function E(O){let I=O[P];return typeof I>"u"&&w&&(I=x()),I}function M(O=h){let I=au(S,w,()=>new WeakMap);return au(I,O,()=>{let F={};for(let[D,N]of Object.entries(n.selectors??{}))F[D]=kg(N,O,x,w);return F})}return{reducerPath:P,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let R={name:o,reducer:v,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:x,...k(i),injectInto(P,{reducerPath:w,...E}={}){let M=w??i;return P.inject({reducerPath:M,reducer:v},E),{...R,...k(M,!0)}}};return R}}function kg(e,t,r,n){function o(i,...a){let m=t(i);return typeof m>"u"&&n&&(m=r()),e(m,...a)}return o.unwrapped=e,o}var Ut=Ig();function Pg(){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 Fg({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Tg(n))throw new Error($e(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function Og(e){return e._reducerDefinitionType==="asyncThunk"}function Tg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Dg({type:e,reducerName:t},r,n,o){if(!o)throw new Error($e(18));let{payloadCreator:i,fulfilled:a,pending:m,rejected:f,settled:p,options:y}=r,h=o(e,i,y);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),m&&n.addCase(h.pending,m),f&&n.addCase(h.rejected,f),p&&n.addMatcher(h.settled,p),n.exposeCaseReducer(t,{fulfilled:a||eo,pending:m||eo,rejected:f||eo,settled:p||eo})}function eo(){}var mu="listener",gu="completed",yu="cancelled",Ax=`task-${yu}`,Cx=`task-${gu}`,wx=`${mu}-${yu}`,Rx=`${mu}-${gu}`;var{assign:hu}=Object;var pa="listenerMiddleware";var qg=hu(T(`${pa}/add`),{withTypes:()=>qg}),xx=T(`${pa}/removeAll`),jg=hu(T(`${pa}/remove`),{withTypes:()=>jg});var Ex=Symbol.for("rtk-state-proxy-original");function $e(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. `}d();c();l();u();var W=new H({required:!0,emptyAllowed:!1}),Ce=new H({required:!1,emptyAllowed:!1}),we=new H({required:!0,emptyAllowed:!0}),Nx=new H({required:!1,emptyAllowed:!0}),io=new ie({each:W,required:!0}),Su=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),vu=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),_x=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),it=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ve=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new Wr(o);return{payload:e}},Q=(e,t)=>{try{return Ve(e,t)}catch(r){return{payload:e,error:it(r)}}},bu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Cu(e,t,r,o,"Controller initialization error")},Au=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Cu(e,t,r,o,"Controller initialization error")},Cu=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var sr="3.30.2-pre.ebbb6c85a7",wu=["@coveo/atomic","@coveo/quantic"];var fa=()=>Ce,Ru=()=>W,yt=T("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:Ce,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ce})),Ye=T("configuration/updateSearchConfiguration",e=>Q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,timezone:Ce,locale:Ce,authenticationProviders:new ie({required:!1,each:W})})),Mg={enabled:new ne({default:!0}),originContext:fa(),originLevel2:fa(),originLevel3:fa(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new fe,anonymous:new ne({default:!1}),deviceId:Ce,userDisplayName:Ce,documentLocation:Ce,trackingId:vu,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:wu.reduce((e,t)=>(e[t]=Su,e),{})})},cr=T("configuration/updateAnalyticsConfiguration",e=>Q(e,Mg)),ur=T("configuration/analytics/disable"),lr=T("configuration/analytics/enable"),ao=T("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:Ru()})),so=T("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:Ru()}));d();c();l();u();d();c();l();u();d();c();l();u();var xu={q:new H,enableQuerySyntax:new ne,aq:new H,cq:new H,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new H,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new ne,sf:new K,tab:new H,af:new K};var ht=T("searchParameters/restore",e=>Q(e,xu)),Eu=T("searchParameters/restoreTab",e=>Q(e,W));d();c();l();u();var co=T("debug/enable"),uo=T("debug/disable");d();c();l();u();var lo=()=>!1;var po=ge(lo(),e=>{e.addCase(co,()=>!0).addCase(uo,()=>!1).addCase(ht,(t,r)=>r.payload.debug??t)});d();c();l();u();var dr=T("pipeline/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var Ng=T("history/undo"),_g=T("history/redo"),Je=T("history/snapshot"),GE=ue("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Ng()),yield t(qe())});return function(_x4,_x5){return _ref4.apply(this,arguments)}}()),WE=ue("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(_g()),yield t(qe())});return function(_x6,_x7){return _ref5.apply(this,arguments)}}()),qe=ue("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x8,_x9){return _ref6.apply(this,arguments)}}());d();c();l();u();var pr=()=>"";var fr=ge(pr(),e=>{e.addCase(dr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ye,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var fo=T("app/setError");d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var mr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let m=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(m)||p.test(m)||m.indexOf(".")===-1?ma(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],ma(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let 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 ma(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function Vg(){return typeof navigator<"u"}function Iu(){try{return typeof localStorage<"u"}catch{return!1}}function ku(){try{return typeof sessionStorage<"u"}catch{return!1}}function Pu(){return!!(Vg()&&navigator.cookieEnabled)}var Fu=null;function Ou(){return Fu||(Iu()?localStorage:Pu()?new ga:ku()?sessionStorage:new ya)}var gr=class gr{getItem(t){return mr.get(`${gr.prefix}${t}`)}removeItem(t){mr.erase(`${gr.prefix}${t}`)}setItem(t,r,n){mr.set(`${gr.prefix}${t}`,r,n)}};de(gr,"prefix","coveo_");var ga=gr;var ya=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var mo="__coveo.analytics.history",Lg=20,Ug=1e3*60,Qg=75,Qt=class Qt{constructor(t){de(this,"store");this.store=t||Ou()}static getInstance(t){return Qt.instance||(Qt.instance=new Qt(t)),Qt.instance}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){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(mo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(mo);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(mo,JSON.stringify(t.slice(0,Lg)))}catch{}}clear(){try{this.store.removeItem(mo)}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,Qg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Ug:!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))}};de(Qt,"instance",null);var ha=Qt,Xe=ha;d();c();l();u();d();c();l();u();var yr=pe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${sr}`));d();c();l();u();d();c();l();u();function at(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 q(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(y){try{p(n.next(y))}catch(h){a(h)}}function f(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(m,f)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function ba(){return typeof window<"u"}function Da(){return typeof navigator<"u"}function hr(){return typeof document<"u"}function Aa(){try{return typeof localStorage<"u"}catch{return!1}}function Bg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Hu(){return Da()&&navigator.cookieEnabled}var $g=[ae.click,ae.custom,ae.search,ae.view],Hg=(e,t)=>$g.indexOf(e)!==-1?Object.assign({language:hr()?document.documentElement.lang:"unknown",userAgent:Da()?navigator.userAgent:"unknown"},t):t,pn=class e{static set(t,r,n){var o,i,a,m;n&&(i=new Date,i.setTime(i.getTime()+n)),m=window.location.hostname,m.indexOf(".")===-1?Tu(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Tu(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 Tu(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function zg(){return Aa()?localStorage:Hu()?new fn:Bg()?sessionStorage:new vr}var fn=class e{getItem(t){return pn.get(`${e.prefix}${t}`)}removeItem(t){pn.erase(`${e.prefix}${t}`)}setItem(t,r,n){pn.set(`${e.prefix}${t}`,r,n)}};fn.prefix="coveo_";var Ca=class{constructor(){this.cookieStorage=new fn}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)}},vr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},go="__coveo.analytics.history",Gg=20,Wg=1e3*60,Kg=75,So=class{constructor(t){this.store=t||zg()}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 q(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 q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(go);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(go);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(go,JSON.stringify(t.slice(0,Gg)))}catch{}}clear(){try{this.store.removeItem(go)}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,Kg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Wg:!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))}};var Yg=(e,t)=>q(void 0,void 0,void 0,function*(){return e===ae.view?(yield Jg(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Jg=e=>q(void 0,void 0,void 0,function*(){let t=new So,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),yo,Xg=new Uint8Array(16);function Zg(){if(!yo&&(yo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yo(Xg)}var ey=/^(?:[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 vo(e){return typeof e=="string"&&ey.test(e)}var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function zu(e,t=0){return(Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]).toLowerCase()}function ty(e){if(!vo(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 ry(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ny="6ba7b810-9dad-11d1-80b4-00c04fd430c8",oy="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function iy(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=ry(o)),typeof i=="string"&&(i=ty(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){m=m||0;for(let y=0;y<16;++y)a[m+y]=p[y];return a}return zu(p)}try{n.name=e}catch{}return n.DNS=ny,n.URL=oy,n}var ay=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Du={randomUUID:ay};function Bt(e,t,r){if(Du.randomUUID&&!t&&!e)return Du.randomUUID();e=e||{};let n=e.random||(e.rng||Zg)();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 zu(n)}function sy(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 Sa(e,t){return e<<t|e>>>32-t}function cy(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let m=0;m<a.length;++m)e.push(a.charCodeAt(m))}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 a=0;a<o;++a){let m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=m}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 a=0;a<o;++a){let m=new Uint32Array(80);for(let g=0;g<16;++g)m[g]=i[a][g];for(let g=16;g<80;++g)m[g]=Sa(m[g-3]^m[g-8]^m[g-14]^m[g-16],1);let f=r[0],p=r[1],y=r[2],h=r[3],S=r[4];for(let g=0;g<80;++g){let v=Math.floor(g/20),x=Sa(f,5)+sy(v,p,y,h)+S+t[v]+m[g]>>>0;S=h,h=y,y=Sa(p,30)>>>0,p=f,f=x}r[0]=r[0]+f>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+h>>>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 uy=iy("v5",80,cy),qu=uy,Gu="2.30.45",ju=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,dn={pageview:"pageview",event:"event"},bo=class{constructor({client:t,uuidGenerator:r=Bt}){this.client=t,this.uuidGenerator=r}},wa=class extends bo{constructor({client:t,uuidGenerator:r=Bt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ju(window.location),this.lastReferrer=hr()?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:hr()?document.title:"",encoding:hr()?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===dn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===dn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===dn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===dn.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 ju(window.location)}},St=class e{constructor(t,r){if(!vo(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 vo(i)?new e(i,Number.parseInt(o)*1e3):null}};St.cvo_cid="cvo_cid";St.expirationTime=120;var Ra=class extends bo{constructor({client:t,uuidGenerator:r=Bt}){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 q(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(St.cvo_cid,new St(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Ra.Id="link";var Ue=Object.keys;function ho(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var va=128,Wu=192,Mu=224,Nu=240;function ly(e){return(e&248)===Nu?4:(e&Nu)===Mu?3:(e&Mu)===Wu?2:1}function dy(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&va)!=va)break;if(r-=3,(n&Wu)!=va){t-r>=ly(n)*3&&(r=t);break}}return e.substring(0,r)}var xa={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"},py=Ue(xa).map(e=>xa[e]),fy=[...py].join("|"),my=new RegExp(`^(${fy}$)`),gy={svcAction:"svc_action",svcActionData:"svc_action_data"},yy=e=>Ue(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=xa[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),hy=e=>my.test(e),Sy=[hy],_u={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Vu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},Ao={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},vy=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ea={id:"quoteId",affiliation:"quoteAffiliation"},Ia={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},by={add:Ee,bookmark_add:Ee,bookmark_remove:Ee,click:Ee,checkout:Ee,checkout_option:Ee,detail:Ee,impression:Ee,remove:Ee,refund:Object.assign(Object.assign({},Ee),Ao),purchase:Object.assign(Object.assign({},Ee),Ao),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Ea),review:Object.assign(Object.assign({},Ee),Ia)},Ay=Ue(_u).map(e=>_u[e]),Cy=Ue(Vu).map(e=>Vu[e]),wy=Ue(Ee).map(e=>Ee[e]),Ry=Ue(Ao).map(e=>Ao[e]),xy=Ue(Ia).map(e=>Ia[e]),Ey=Ue(Ea).map(e=>Ea[e]),Iy=[...Ay,"custom"].join("|"),ky=[...Cy,"custom"].join("|"),Ku="(pr[0-9]+)",Yu="(il[0-9]+pi[0-9]+)",Py=new RegExp(`^${Ku}(${Iy})$`),Fy=new RegExp(`^(${Yu}(${ky}))|(il[0-9]+nm)$`),Oy=new RegExp(`^(${wy.join("|")})$`),Ty=new RegExp(`^(${Ry.join("|")})$`),Dy=new RegExp(`^${Ku}custom$`),qy=new RegExp(`^${Yu}custom$`),jy=new RegExp(`^(${[...vy,...xy,...Ey].join("|")})$`),My=e=>Py.test(e),Ny=e=>Fy.test(e),_y=e=>Oy.test(e),Vy=e=>Ty.test(e),Ly=e=>jy.test(e),Uy=[Ny,My,_y,Vy,Ly],Qy=[Dy,qy],By={anonymizeIp:"aip"},$y={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Hy={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},zy=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Gy=Object.assign(Object.assign(Object.assign(Object.assign({},By),$y),Hy),zy.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),ka=Object.assign(Object.assign({},Gy),gy),Wy=e=>{let t=!!e.action&&by[e.action]||{};return Ue(e).reduce((r,n)=>{let o=t[n]||ka[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Ky=Ue(ka).map(e=>ka[e]),Yy=e=>Ky.indexOf(e)!==-1,Jy=e=>e==="custom",Xy=e=>[...Uy,...Sy,Yy,Jy].some(t=>t(e)),Zy=e=>Ue(e).reduce((t,r)=>{let n=eh(r);return n?Object.assign(Object.assign({},t),th(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),eh=e=>{let t;return[...Qy].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},th=(e,t)=>Ue(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Pa=class{constructor(t){this.opts=t}sendEvent(t,r){return q(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:a,payload:m}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,m),p=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:m,body:f}=a;o=m||t;try{i=JSON.parse(f)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}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 q(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[ae.click,ae.custom,ae.search,ae.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}},Fa=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},Lu=b.fetch,Co=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",m={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},m),i?yield i(m,"analyticsFetch"):{}),{url:p}=f,y=at(f,["url"]),h;try{h=yield Lu(p,y)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{h.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,h,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Lu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return q(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"})}},Oa=class{constructor(t,r){Aa()&&Hu()?this.storage=new Ca:Aa()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new vr),this.client=new Co(t),this.beaconClient=new Pa(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}},Ta=class{constructor(t,r){this.storage=r||new vr,this.client=new Co(t)}getClientDependingOnEventType(t){return this.client}},wo=class{constructor(){this.storage=new vr,this.client=new Fa}getClientDependingOnEventType(t){return this.client}},rh="xx",nh=e=>e?.startsWith(rh)||!1,oh=`
|
|
26
|
+
`;return new Wr(r)}var Wr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=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 tm(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}},fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&X(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 ve(e){return e===void 0}function rm(e){return e===null}function X(e){return ve(e)||rm(e)}var ne=class{constructor(e={}){de(this,"value");this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(nm(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function nm(e){return ve(e)||mc(e)}function mc(e){return typeof e=="boolean"}var J=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(om(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 om(e){return ve(e)||gc(e)}function gc(e){return typeof e=="number"&&!Number.isNaN(e)}var im=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){de(this,"value");de(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ve(e))return null;if(!Mn(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&&!(im.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 Mn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ve(e))return this.config.options.required?"value is required and is currently undefined":null;if(!yc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(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 yc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(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&&X(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 mc(e)||Mn(e)||gc(e)||yc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function hc(e){return Array.isArray(e)}var Vi=class{constructor(e){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ve(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}};d();c();l();u();function Sc(e){return Array.isArray(e)}function Nn(e){return e.trim()===""}var am=new Set(["1",1,"yes",!0]);function vc(){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=>am.has(r))}function bc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Kr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function sm(e){if(Nn(e.openingDelimiter)||Nn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||Nn(e.content))return e.content;if(e.highlights.length===0)return Zt(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,m=a+i.length;if(m>t)break;r+=Zt(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Zt(e.content.slice(a,m)),r+=e.closingDelimiter,n=m}return n!==t&&(r+=Zt(e.content.slice(n))),r}function cm(e,t){return e=Zt(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Li(n,t.notMatchDelimiters):o?Li(o,t.exactMatchDelimiters):i?Li(i,t.correctionDelimiters):r)}function Li(e,t){return t?t.open+e+t.close:e}function Zt(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var Tc=Qe(kc(),1);d();c();l();u();var ze=new Error("Failed to load reducers."),er=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},jt=class extends Error{constructor(r,n){super();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function Pc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Fc(e){return typeof e!="object"||!e?!1:Object.values(e).every(qm)}function qm(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Oc(e){return e===429}var Be=class e{static call(t){return _asyncToGenerator(function*(){let r=jm(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,m=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield A(i,a);if(Oc(f.status))throw f;return f});return function m(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Tc.backOff)(m,{retry:p=>{let y=p&&Oc(p.status);return y&&n.info("Platform retrying request"),y}});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new er;case 404:throw new jt(i,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new jt(i):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:m,...f}=t,p=Kr(f);try{let y=yield o(t,n,a);return{...t,...y}}catch(y){i.error(y,"Platform request preprocessing failed. Returning default request options.")}return p})()}};function ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function pt(e,t="prod"){return`${ke(e,t)}/rest/search/v2`}function Vn(e,t="prod"){return`${ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function jm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,m=e.method==="POST"||e.method==="PUT",f=Mm(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(m&&{body:f}),signal:a}}function Mm(e,t){return t==="application/x-www-form-urlencoded"?Fc(e)?Pc(e):"":JSON.stringify(e)}d();c();l();u();d();c();l();u();var Ln=e=>e;d();c();l();u();d();c();l();u();function Un(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ge(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Un(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Un(),extendedResults:{},searchAction:void 0}}d();c();l();u();function ft(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var mt=e=>{let{response:t}=e;return t.body?Nm(e):_m(t)},Nm=e=>Lm(e)?Um(e):Vm(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},_m=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Vm(e){return e.body.statusCode!==void 0}function Lm(e){return e.body.exception!==void 0}var Um=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var gt=class{constructor(){de(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();var Xr=class{constructor(t){de(this,"_basePath");de(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}};d();c();l();u();function Dc(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var rt=(e,t,r,n)=>{let o=new Xr(`${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 qc=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield Be.call({...rt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ft(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Dc(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Qm(a)?{success:a}:{error:mt({response:r,body:a})}});return function qc(_x2,_x3){return _ref2.apply(this,arguments)}}();function Qm(e){return typeof e=="string"}d();c();l();u();function Bm(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function $m(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Qn(e,t){if(t&&e.name==="AbortError")return{error:$m(e)};if(e instanceof jt)return{error:Bm(e)};throw e}var Bn=class{constructor(t){this.options=t;de(this,"apiCallsQueues",{unknown:new gt,mainSearch:new gt,facetValues:new gt,foldingCollection:new gt,instantResults:new gt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/plan"),requestParams:ft(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Qn(r);let n=yield r.json();return zm(n)?{success:n}:{error:mt({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ft(t),..._this3.options});if(r instanceof Error)return Qn(r);let n=yield r.json(),o={response:r,body:n};return Hm(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:mt(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(m=>Be.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:m??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Qn(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return jc(i)?(a.body=Mc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:mt(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/facet"),requestParams:ft(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json",""),requestParams:ft(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(jc(n)){let o={response:r,body:n};return o.body=Mc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:mt({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return qc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return Gm(n)?{success:n}:{error:mt({response:r,body:n})}})()}},$n=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function jc(e){return e.results!==void 0}function Mc(e){let t=Un();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Hm(e){return e.completions!==void 0}function zm(e){return e.preprocessingOutput!==void 0}function Gm(e){return e.fields!==void 0}d();c();l();u();var Nc=e=>e,_c=e=>e,Vc=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function be(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 Wm=typeof Symbol=="function"&&Symbol.observable||"@@observable",Lc=Wm,Yi=()=>Math.random().toString(36).substring(7).split("").join("."),Km={INIT:`@@redux/INIT${Yi()}`,REPLACE:`@@redux/REPLACE${Yi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yi()}`},Hn=Km;function We(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 Ji(e,t,r){if(typeof e!="function")throw new Error(be(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(be(1));return r(Ji)(e,t)}let n=e,o=t,i=new Map,a=i,m=0,f=!1;function p(){a===i&&(a=new Map,i.forEach((k,R)=>{a.set(R,k)}))}function y(){if(f)throw new Error(be(3));return o}function h(k){if(typeof k!="function")throw new Error(be(4));if(f)throw new Error(be(5));let R=!0;p();let P=m++;return a.set(P,k),function(){if(R){if(f)throw new Error(be(6));R=!1,p(),a.delete(P),i=null}}}function S(k){if(!We(k))throw new Error(be(7));if(typeof k.type>"u")throw new Error(be(8));if(typeof k.type!="string")throw new Error(be(17));if(f)throw new Error(be(9));try{f=!0,o=n(o,k)}finally{f=!1}return(i=a).forEach(P=>{P()}),k}function g(k){if(typeof k!="function")throw new Error(be(10));n=k,S({type:Hn.REPLACE})}function v(){let k=h;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(be(11));function P(){let E=R;E.next&&E.next(y())}return P(),{unsubscribe:k(P)}},[Lc](){return this}}}return S({type:Hn.INIT}),{dispatch:S,subscribe:h,getState:y,replaceReducer:g,[Lc]:v}}function Ym(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Hn.INIT})>"u")throw new Error(be(12));if(typeof r(void 0,{type:Hn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function tr(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let m=t[a];typeof e[m]=="function"&&(r[m]=e[m])}let n=Object.keys(r),o,i;try{Ym(r)}catch(a){i=a}return function(m={},f){if(i)throw i;let p=!1,y={};for(let h=0;h<n.length;h++){let S=n[h],g=r[S],v=m[S],x=g(v,f);if(typeof x>"u"){let k=f&&f.type;throw new Error(be(14))}y[S]=x,p=p||x!==v}return p=p||n.length!==Object.keys(m).length,p?y:m}}function rr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Uc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(be(15))},a={getState:o.getState,dispatch:(f,...p)=>i(f,...p)},m=e.map(f=>f(a));return i=rr(...m)(o.dispatch),{...o,dispatch:i}}}function zn(e){return We(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var sa=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function Ae(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Nt=Object.getPrototypeOf;function Me(e){return!!e&&!!e[Te]}function De(e){return e?zc(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||nr(e)||an(e):!1}var Jm=Object.prototype.constructor.toString();function zc(e){if(!e||typeof e!="object")return!1;let t=Nt(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)===Jm}function ca(e){return Me(e)||Ae(15,e),e[Te].base_}function en(e,t){_t(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function _t(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:nr(e)?2:an(e)?3:0}function tn(e,t){return _t(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t){return _t(e)===2?e.get(t):e[t]}function Gc(e,t,r){let n=_t(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Xm(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nr(e){return e instanceof Map}function an(e){return e instanceof Set}function Mt(e){return e.copy_||e.base_}function ta(e,t){if(nr(e))return new Map(e);if(an(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=zc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Te];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],m=n[a];m.writable===!1&&(m.writable=!0,m.configurable=!0),(m.get||m.set)&&(n[a]={configurable:!0,writable:!0,enumerable:m.enumerable,value:e[a]})}return Object.create(Nt(e),n)}else{let n=Nt(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Yn(e,t=!1){return Jn(e)||Me(e)||!De(e)||(_t(e)>1&&Object.defineProperties(e,{set:{value:Gn},add:{value:Gn},clear:{value:Gn},delete:{value:Gn}}),Object.freeze(e),t&&Object.values(e).forEach(r=>Yn(r,!0))),e}function Gn(){Ae(2)}function Jn(e){return Object.isFrozen(e)}var ra={};function Vt(e){let t=ra[e];return t||Ae(0,e),t}function Zm(e,t){ra[e]||(ra[e]=t)}var rn;function Wc(){return rn}function eg(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Qc(e,t){t&&(Vt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function na(e){oa(e),e.drafts_.forEach(tg),e.drafts_=null}function oa(e){e===rn&&(rn=e.parent_)}function Bc(e){return rn=eg(rn,e)}function tg(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $c(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(na(t),Ae(4)),De(e)&&(e=Wn(t,e),t.parent_||Kn(t,e)),t.patches_&&Vt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=Wn(t,r,[]),na(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sa?e:void 0}function Wn(e,t,r){if(Jn(t))return t;let n=t[Te];if(!n)return en(t,(o,i)=>Hc(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Kn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),en(i,(m,f)=>Hc(e,n,o,m,f,r,a)),Kn(e,o,!1),r&&e.patches_&&Vt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Hc(e,t,r,n,o,i,a){if(Me(o)){let m=i&&t&&t.type_!==3&&!tn(t.assigned_,n)?i.concat(n):void 0,f=Wn(e,o,m);if(Gc(r,n,f),Me(f))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!Jn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Wn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(nr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Kn(e,o)}}function Kn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Yn(t,r)}function rg(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Wc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=ua;r&&(o=[n],i=nn);let{revoke:a,proxy:m}=Proxy.revocable(o,i);return n.draft_=m,n.revoke_=a,m}var ua={get(e,t){if(t===Te)return e;let r=Mt(e);if(!tn(r,t))return ng(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===Zi(e.base_,t)?(ea(e),e.copy_[t]=aa(n,e)):n},has(e,t){return t in Mt(e)},ownKeys(e){return Reflect.ownKeys(Mt(e))},set(e,t,r){let n=Kc(Mt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zi(Mt(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Xm(r,o)&&(r!==void 0||tn(e.base_,t)))return!0;ea(e),ia(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 Zi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ea(e),ia(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Mt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ae(11)},getPrototypeOf(e){return Nt(e.base_)},setPrototypeOf(){Ae(12)}},nn={};en(ua,(e,t)=>{nn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nn.deleteProperty=function(e,t){return nn.set.call(this,e,t,void 0)};nn.set=function(e,t,r){return ua.set.call(this,e[0],t,r,e[0])};function Zi(e,t){let r=e[Te];return(r?Mt(r):e)[t]}function ng(e,t,r){let n=Kc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Kc(e,t){if(!(t in e))return;let r=Nt(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Nt(r)}}function ia(e){e.modified_||(e.modified_=!0,e.parent_&&ia(e.parent_))}function ea(e){e.copy_||(e.copy_=ta(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var og=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 a=this;return function(f=i,...p){return a.produce(f,y=>r.call(this,y,...p))}}typeof r!="function"&&Ae(6),n!==void 0&&typeof n!="function"&&Ae(7);let o;if(De(t)){let i=Bc(this),a=aa(t,void 0),m=!0;try{o=r(a),m=!1}finally{m?na(i):oa(i)}return Qc(i,n),$c(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===sa&&(o=void 0),this.autoFreeze_&&Yn(o,!0),n){let i=[],a=[];Vt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ae(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...m)=>this.produceWithPatches(a,f=>t(f,...m));let n,o;return[this.produce(t,r,(a,m)=>{n=a,o=m}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||Ae(8),Me(e)&&(e=Yc(e));let t=Bc(this),r=aa(e,void 0);return r[Te].isManual_=!0,oa(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&Ae(9);let{scope_:n}=r;return Qc(n,t),$c(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=Vt("Patches").applyPatches_;return Me(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aa(e,t){let r=nr(e)?Vt("MapSet").proxyMap_(e,t):an(e)?Vt("MapSet").proxySet_(e,t):rg(e,t);return(t?t.scope_:Wc()).drafts_.push(r),r}function Yc(e){return Me(e)||Ae(10,e),Jc(e)}function Jc(e){if(!De(e)||Jn(e))return e;let t=e[Te],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ta(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ta(e,!0);return en(r,(n,o)=>{Gc(r,n,Jc(o))}),t&&(t.finalized_=!1),r}function Xc(){let t="replace",r="add",n="remove";function o(S,g,v,x){switch(S.type_){case 0:case 2:return a(S,g,v,x);case 1:return i(S,g,v,x);case 3:return m(S,g,v,x)}}function i(S,g,v,x){let{base_:k,assigned_:R}=S,P=S.copy_;P.length<k.length&&([k,P]=[P,k],[v,x]=[x,v]);for(let w=0;w<k.length;w++)if(R[w]&&P[w]!==k[w]){let E=g.concat([w]);v.push({op:t,path:E,value:h(P[w])}),x.push({op:t,path:E,value:h(k[w])})}for(let w=k.length;w<P.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:h(P[w])})}for(let w=P.length-1;k.length<=w;--w){let E=g.concat([w]);x.push({op:n,path:E})}}function a(S,g,v,x){let{base_:k,copy_:R}=S;en(S.assigned_,(P,w)=>{let E=Xi(k,P),M=Xi(R,P),O=w?tn(k,P)?t:r:n;if(E===M&&O===t)return;let I=g.concat(P);v.push(O===n?{op:O,path:I}:{op:O,path:I,value:M}),x.push(O===r?{op:n,path:I}:O===n?{op:r,path:I,value:h(E)}:{op:t,path:I,value:h(E)})})}function m(S,g,v,x){let{base_:k,copy_:R}=S,P=0;k.forEach(w=>{if(!R.has(w)){let E=g.concat([P]);v.push({op:n,path:E,value:w}),x.unshift({op:r,path:E,value:w})}P++}),P=0,R.forEach(w=>{if(!k.has(w)){let E=g.concat([P]);v.push({op:r,path:E,value:w}),x.unshift({op:n,path:E,value:w})}P++})}function f(S,g,v,x){v.push({op:t,path:[],value:g===sa?void 0:g}),x.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:x,op:k}=v,R=S;for(let M=0;M<x.length-1;M++){let O=_t(R),I=x[M];typeof I!="string"&&typeof I!="number"&&(I=""+I),(O===0||O===1)&&(I==="__proto__"||I==="constructor")&&Ae(19),typeof R=="function"&&I==="prototype"&&Ae(19),R=Xi(R,I),typeof R!="object"&&Ae(18,x.join("/"))}let P=_t(R),w=y(v.value),E=x[x.length-1];switch(k){case t:switch(P){case 2:return R.set(E,w);case 3:Ae(16);default:return R[E]=w}case r:switch(P){case 1:return E==="-"?R.push(w):R.splice(E,0,w);case 2:return R.set(E,w);case 3:return R.add(w);default:return R[E]=w}case n:switch(P){case 1:return R.splice(E,1);case 2:return R.delete(E);case 3:return R.delete(v.value);default:return delete R[E]}default:Ae(17,k)}}),S}function y(S){if(!De(S))return S;if(Array.isArray(S))return S.map(y);if(nr(S))return new Map(Array.from(S.entries()).map(([v,x])=>[v,y(x)]));if(an(S))return new Set(Array.from(S).map(y));let g=Object.create(Nt(S));for(let v in S)g[v]=y(S[v]);return tn(S,Zr)&&(g[Zr]=S[Zr]),g}function h(S){return Me(S)?y(S):S}Zm("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:f})}var on=new og,nt=on.produce,Xn=on.produceWithPatches.bind(on);var la=on.applyPatches.bind(on);d();c();l();u();function ig(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ag(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function sg(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 Zc=e=>Array.isArray(e)?e:[e];function cg(e){let t=Array.isArray(e[0])?e[0]:e;return sg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ug(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var YR=Symbol();var JR=Object.getPrototypeOf({});var lg=class{constructor(e){this.value=e}deref(){return this.value}},dg=typeof WeakRef<"u"?WeakRef:lg,pg=0,eu=1;function Zn(){return{s:pg,v:void 0,o:null,p:null}}function or(e,t={}){let r=Zn(),{resultEqualityCheck:n}=t,o,i=0;function a(){let m=r,{length:f}=arguments;for(let h=0,S=f;h<S;h++){let g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=m.o;v===null&&(m.o=v=new WeakMap);let x=v.get(g);x===void 0?(m=Zn(),v.set(g,m)):m=x}else{let v=m.p;v===null&&(m.p=v=new Map);let x=v.get(g);x===void 0?(m=Zn(),v.set(g,m)):m=x}}let p=m,y;if(m.s===eu)y=m.v;else if(y=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,y)&&(y=h,i!==0&&i--),o=typeof y=="object"&&y!==null||typeof y=="function"?new dg(y):y}return p.s=eu,p.v=y,y}return a.clearCache=()=>{r=Zn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function tu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,m,f={},p=o.pop();typeof p=="object"&&(f=p,p=o.pop()),ig(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let y={...r,...f},{memoize:h,memoizeOptions:S=[],argsMemoize:g=or,argsMemoizeOptions:v=[],devModeChecks:x={}}=y,k=Zc(S),R=Zc(v),P=cg(o),w=h(function(){return i++,p.apply(null,arguments)},...k),E=!0,M=g(function(){a++;let I=ug(P,arguments);return m=w.apply(null,I),m},...R);return Object.assign(M,{resultFunc:p,memoizedResultFunc:w,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>m,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var pe=tu(or),fg=Object.assign((e,t=pe)=>{ag(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((a,m,f)=>(a[r[f]]=m,a),{}))},{withTypes:()=>fg});d();c();l();u();function ru(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var nu=ru(),ou=ru;var mg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?rr:rr.apply(null,arguments)},gx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},gg=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error($e(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=>zn(n)&&n.type===e,r}var uu=class sn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sn.prototype)}static get[Symbol.species](){return sn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sn(...t[0].concat(this)):new sn(...t.concat(this))}};function iu(e){return De(e)?nt(e,()=>{}):e}function au(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function yg(e){return typeof e=="boolean"}var hg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new uu;return r&&(yg(r)?a.push(nu):a.push(ou(r.extraArgument))),a},cn="RTK_autoBatch",ar=()=>e=>({payload:e,meta:{[cn]:!0}}),su=e=>t=>{setTimeout(t,e)},Sg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,m=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:su(10):e.type==="callback"?e.queueNotification:su(e.timeout),p=()=>{a=!1,i&&(i=!1,m.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let h=()=>o&&y(),S=n.subscribe(h);return m.add(y),()=>{S(),m.delete(y)}},dispatch(y){try{return o=!y?.meta?.[cn],i=!o,i&&(a||(a=!0,f(p))),n.dispatch(y)}finally{o=!0}}})},vg=e=>function(r){let{autoBatch:n=!0}=r??{},o=new uu(e);return n&&o.push(Sg(typeof n=="object"?n:void 0)),o};function lu(e){let t=hg(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},m;if(typeof r=="function")m=r;else if(We(r))m=tr(r);else throw new Error($e(1));let f;typeof n=="function"?f=n(t):f=t();let p=rr;o&&(p=mg({trace:!1,...(typeof o=="object"&&o)}));let y=Uc(...f),h=vg(y),S=typeof a=="function"?a(h):h(),g=p(...S);return Ji(m,i,g)}function du(e){let t={},r=[],n,o={addCase(i,a){let m=typeof i=="string"?i:i.type;if(!m)throw new Error($e(28));if(m in t)throw new Error($e(29));return t[m]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function bg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=du(t),i;if(bg(e))i=()=>iu(e());else{let m=iu(e);i=()=>m}function a(m=i(),f){let p=[r[f.type],...n.filter(({matcher:y})=>y(f)).map(({reducer:y})=>y)];return p.filter(y=>!!y).length===0&&(p=[o]),p.reduce((y,h)=>{if(h)if(Me(y)){let g=h(y,f);return g===void 0?y:g}else{if(De(y))return nt(y,S=>h(S,f));{let S=h(y,f);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return y},m)}return a.getInitialState=i,a}var pu=(e,t)=>gg(e)?e.match(t):e(t);function Ke(...e){return t=>e.some(r=>pu(r,t))}function ir(...e){return t=>e.every(r=>pu(r,t))}function to(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 un(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ro(...e){return e.length===0?t=>to(t,["pending"]):un(e)?Ke(...e.map(t=>t.pending)):ro()(e[0])}function Lt(...e){return e.length===0?t=>to(t,["rejected"]):un(e)?Ke(...e.map(t=>t.rejected)):Lt()(e[0])}function ln(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ir(Lt(...e),t):un(e)?ir(Lt(...e),t):ln()(e[0])}function ot(...e){return e.length===0?t=>to(t,["fulfilled"]):un(e)?Ke(...e.map(t=>t.fulfilled)):ot()(e[0])}function no(...e){return e.length===0?t=>to(t,["pending","fulfilled","rejected"]):un(e)?Ke(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):no()(e[0])}var Ag="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",oo=(e=21)=>{let t="",r=e;for(;r--;)t+=Ag[Math.random()*64|0];return t},Cg=["name","message","stack","code"],da=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},cu=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},wg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Cg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ue=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,p,y,h)=>({payload:f,meta:{...(h||{}),arg:y,requestId:p,requestStatus:"fulfilled"}})),i=T(t+"/pending",(f,p,y)=>({payload:void 0,meta:{...(y||{}),arg:p,requestId:f,requestStatus:"pending"}})),a=T(t+"/rejected",(f,p,y,h,S)=>({payload:h,error:(n&&n.serializeError||wg)(f||"Rejected"),meta:{...(S||{}),arg:y,requestId:p,rejectedWithValue:!!h,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function m(f){return(p,y,h)=>{let S=n?.idGenerator?n.idGenerator(f):oo(),g=new s.AbortController,v,x;function k(P){x=P,g.abort()}let R=_asyncToGenerator(function*(){let P;try{let E=n?.condition?.(f,{getState:y,extra:h});if(xg(E)&&(E=yield E),E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((O,I)=>{v=()=>{I({name:"AbortError",message:x||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,f,n?.getPendingMeta?.({requestId:S,arg:f},{getState:y,extra:h}))),P=yield Promise.race([M,Promise.resolve(r(f,{dispatch:p,getState:y,extra:h,requestId:S,signal:g.signal,abort:k,rejectWithValue:(O,I)=>new da(O,I),fulfillWithValue:(O,I)=>new cu(O,I)})).then(O=>{if(O instanceof da)throw O;return O instanceof cu?o(O.payload,S,f,O.meta):o(O,S,f)})])}catch(E){P=E instanceof da?a(null,S,f,E.payload,E.meta):a(E,S,f)}finally{v&&g.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(P)&&P.meta.condition||p(P),P})();return Object.assign(R,{abort:k,requestId:S,arg:f,unwrap(){return R.then(Rg)}})}}return Object.assign(m,{pending:i,rejected:a,fulfilled:o,settled:Ke(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Rg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function xg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var fu=Symbol.for("rtk-slice-createasyncthunk"),bx={[fu]:ue};function Eg(e,t){return`${e}/${t}`}function Ig({creators:e}={}){let t=e?.asyncThunk?.[fu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error($e(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Pg()):n.reducers)||{},m=Object.keys(a),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(P,w){let E=typeof P=="string"?P:P.type;if(!E)throw new Error($e(12));if(E in f.sliceCaseReducersByType)throw new Error($e(13));return f.sliceCaseReducersByType[E]=w,p},addMatcher(P,w){return f.sliceMatchers.push({matcher:P,reducer:w}),p},exposeAction(P,w){return f.actionCreators[P]=w,p},exposeCaseReducer(P,w){return f.sliceCaseReducersByName[P]=w,p}};m.forEach(P=>{let w=a[P],E={reducerName:P,type:Eg(o,P),createNotation:typeof n.reducers=="function"};Og(w)?Dg(E,w,p,t):Fg(E,w,p)});function y(){let[P={},w=[],E=void 0]=typeof n.extraReducers=="function"?du(n.extraReducers):[n.extraReducers],M={...P,...f.sliceCaseReducersByType};return ge(n.initialState,O=>{for(let I in M)O.addCase(I,M[I]);for(let I of f.sliceMatchers)O.addMatcher(I.matcher,I.reducer);for(let I of w)O.addMatcher(I.matcher,I.reducer);E&&O.addDefaultCase(E)})}let h=P=>P,S=new Map,g;function v(P,w){return g||(g=y()),g(P,w)}function x(){return g||(g=y()),g.getInitialState()}function k(P,w=!1){function E(O){let I=O[P];return typeof I>"u"&&w&&(I=x()),I}function M(O=h){let I=au(S,w,()=>new WeakMap);return au(I,O,()=>{let F={};for(let[D,N]of Object.entries(n.selectors??{}))F[D]=kg(N,O,x,w);return F})}return{reducerPath:P,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let R={name:o,reducer:v,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:x,...k(i),injectInto(P,{reducerPath:w,...E}={}){let M=w??i;return P.inject({reducerPath:M,reducer:v},E),{...R,...k(M,!0)}}};return R}}function kg(e,t,r,n){function o(i,...a){let m=t(i);return typeof m>"u"&&n&&(m=r()),e(m,...a)}return o.unwrapped=e,o}var Ut=Ig();function Pg(){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 Fg({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Tg(n))throw new Error($e(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?T(e,a):T(e))}function Og(e){return e._reducerDefinitionType==="asyncThunk"}function Tg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Dg({type:e,reducerName:t},r,n,o){if(!o)throw new Error($e(18));let{payloadCreator:i,fulfilled:a,pending:m,rejected:f,settled:p,options:y}=r,h=o(e,i,y);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),m&&n.addCase(h.pending,m),f&&n.addCase(h.rejected,f),p&&n.addMatcher(h.settled,p),n.exposeCaseReducer(t,{fulfilled:a||eo,pending:m||eo,rejected:f||eo,settled:p||eo})}function eo(){}var mu="listener",gu="completed",yu="cancelled",Ax=`task-${yu}`,Cx=`task-${gu}`,wx=`${mu}-${yu}`,Rx=`${mu}-${gu}`;var{assign:hu}=Object;var pa="listenerMiddleware";var qg=hu(T(`${pa}/add`),{withTypes:()=>qg}),xx=T(`${pa}/removeAll`),jg=hu(T(`${pa}/remove`),{withTypes:()=>jg});var Ex=Symbol.for("rtk-state-proxy-original");function $e(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. `}d();c();l();u();var W=new H({required:!0,emptyAllowed:!1}),Ce=new H({required:!1,emptyAllowed:!1}),we=new H({required:!0,emptyAllowed:!0}),Nx=new H({required:!1,emptyAllowed:!0}),io=new ie({each:W,required:!0}),Su=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),vu=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),_x=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),it=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ve=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new Wr(o);return{payload:e}},Q=(e,t)=>{try{return Ve(e,t)}catch(r){return{payload:e,error:it(r)}}},bu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Cu(e,t,r,o,"Controller initialization error")},Au=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Cu(e,t,r,o,"Controller initialization error")},Cu=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var sr="3.30.2",wu=["@coveo/atomic","@coveo/quantic"];var fa=()=>Ce,Ru=()=>W,yt=T("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:Ce,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ce})),Ye=T("configuration/updateSearchConfiguration",e=>Q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,timezone:Ce,locale:Ce,authenticationProviders:new ie({required:!1,each:W})})),Mg={enabled:new ne({default:!0}),originContext:fa(),originLevel2:fa(),originLevel3:fa(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new fe,anonymous:new ne({default:!1}),deviceId:Ce,userDisplayName:Ce,documentLocation:Ce,trackingId:vu,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:wu.reduce((e,t)=>(e[t]=Su,e),{})})},cr=T("configuration/updateAnalyticsConfiguration",e=>Q(e,Mg)),ur=T("configuration/analytics/disable"),lr=T("configuration/analytics/enable"),ao=T("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:Ru()})),so=T("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:Ru()}));d();c();l();u();d();c();l();u();d();c();l();u();var xu={q:new H,enableQuerySyntax:new ne,aq:new H,cq:new H,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new H,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new ne,sf:new K,tab:new H,af:new K};var ht=T("searchParameters/restore",e=>Q(e,xu)),Eu=T("searchParameters/restoreTab",e=>Q(e,W));d();c();l();u();var co=T("debug/enable"),uo=T("debug/disable");d();c();l();u();var lo=()=>!1;var po=ge(lo(),e=>{e.addCase(co,()=>!0).addCase(uo,()=>!1).addCase(ht,(t,r)=>r.payload.debug??t)});d();c();l();u();var dr=T("pipeline/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var Ng=T("history/undo"),_g=T("history/redo"),Je=T("history/snapshot"),GE=ue("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Ng()),yield t(qe())});return function(_x4,_x5){return _ref4.apply(this,arguments)}}()),WE=ue("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(_g()),yield t(qe())});return function(_x6,_x7){return _ref5.apply(this,arguments)}}()),qe=ue("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x8,_x9){return _ref6.apply(this,arguments)}}());d();c();l();u();var pr=()=>"";var fr=ge(pr(),e=>{e.addCase(dr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ye,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var fo=T("app/setError");d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var mr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let m=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(m)||p.test(m)||m.indexOf(".")===-1?ma(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],ma(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let 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 ma(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function Vg(){return typeof navigator<"u"}function Iu(){try{return typeof localStorage<"u"}catch{return!1}}function ku(){try{return typeof sessionStorage<"u"}catch{return!1}}function Pu(){return!!(Vg()&&navigator.cookieEnabled)}var Fu=null;function Ou(){return Fu||(Iu()?localStorage:Pu()?new ga:ku()?sessionStorage:new ya)}var gr=class gr{getItem(t){return mr.get(`${gr.prefix}${t}`)}removeItem(t){mr.erase(`${gr.prefix}${t}`)}setItem(t,r,n){mr.set(`${gr.prefix}${t}`,r,n)}};de(gr,"prefix","coveo_");var ga=gr;var ya=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var mo="__coveo.analytics.history",Lg=20,Ug=1e3*60,Qg=75,Qt=class Qt{constructor(t){de(this,"store");this.store=t||Ou()}static getInstance(t){return Qt.instance||(Qt.instance=new Qt(t)),Qt.instance}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){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(mo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(mo);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(mo,JSON.stringify(t.slice(0,Lg)))}catch{}}clear(){try{this.store.removeItem(mo)}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,Qg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Ug:!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))}};de(Qt,"instance",null);var ha=Qt,Xe=ha;d();c();l();u();d();c();l();u();var yr=pe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${sr}`));d();c();l();u();d();c();l();u();function at(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 q(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function m(y){try{p(n.next(y))}catch(h){a(h)}}function f(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(m,f)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function ba(){return typeof window<"u"}function Da(){return typeof navigator<"u"}function hr(){return typeof document<"u"}function Aa(){try{return typeof localStorage<"u"}catch{return!1}}function Bg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Hu(){return Da()&&navigator.cookieEnabled}var $g=[ae.click,ae.custom,ae.search,ae.view],Hg=(e,t)=>$g.indexOf(e)!==-1?Object.assign({language:hr()?document.documentElement.lang:"unknown",userAgent:Da()?navigator.userAgent:"unknown"},t):t,pn=class e{static set(t,r,n){var o,i,a,m;n&&(i=new Date,i.setTime(i.getTime()+n)),m=window.location.hostname,m.indexOf(".")===-1?Tu(t,r,i):(a=m.split("."),o=a[a.length-2]+"."+a[a.length-1],Tu(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 Tu(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function zg(){return Aa()?localStorage:Hu()?new fn:Bg()?sessionStorage:new vr}var fn=class e{getItem(t){return pn.get(`${e.prefix}${t}`)}removeItem(t){pn.erase(`${e.prefix}${t}`)}setItem(t,r,n){pn.set(`${e.prefix}${t}`,r,n)}};fn.prefix="coveo_";var Ca=class{constructor(){this.cookieStorage=new fn}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)}},vr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},go="__coveo.analytics.history",Gg=20,Wg=1e3*60,Kg=75,So=class{constructor(t){this.store=t||zg()}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 q(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 q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(go);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(go);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(go,JSON.stringify(t.slice(0,Gg)))}catch{}}clear(){try{this.store.removeItem(go)}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,Kg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Wg:!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))}};var Yg=(e,t)=>q(void 0,void 0,void 0,function*(){return e===ae.view?(yield Jg(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Jg=e=>q(void 0,void 0,void 0,function*(){let t=new So,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),yo,Xg=new Uint8Array(16);function Zg(){if(!yo&&(yo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yo(Xg)}var ey=/^(?:[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 vo(e){return typeof e=="string"&&ey.test(e)}var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function zu(e,t=0){return(Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]).toLowerCase()}function ty(e){if(!vo(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 ry(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ny="6ba7b810-9dad-11d1-80b4-00c04fd430c8",oy="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function iy(e,t,r){function n(o,i,a,m){var f;if(typeof o=="string"&&(o=ry(o)),typeof i=="string"&&(i=ty(i)),((f=i)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){m=m||0;for(let y=0;y<16;++y)a[m+y]=p[y];return a}return zu(p)}try{n.name=e}catch{}return n.DNS=ny,n.URL=oy,n}var ay=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Du={randomUUID:ay};function Bt(e,t,r){if(Du.randomUUID&&!t&&!e)return Du.randomUUID();e=e||{};let n=e.random||(e.rng||Zg)();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 zu(n)}function sy(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 Sa(e,t){return e<<t|e>>>32-t}function cy(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let m=0;m<a.length;++m)e.push(a.charCodeAt(m))}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 a=0;a<o;++a){let m=new Uint32Array(16);for(let f=0;f<16;++f)m[f]=e[a*64+f*4]<<24|e[a*64+f*4+1]<<16|e[a*64+f*4+2]<<8|e[a*64+f*4+3];i[a]=m}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 a=0;a<o;++a){let m=new Uint32Array(80);for(let g=0;g<16;++g)m[g]=i[a][g];for(let g=16;g<80;++g)m[g]=Sa(m[g-3]^m[g-8]^m[g-14]^m[g-16],1);let f=r[0],p=r[1],y=r[2],h=r[3],S=r[4];for(let g=0;g<80;++g){let v=Math.floor(g/20),x=Sa(f,5)+sy(v,p,y,h)+S+t[v]+m[g]>>>0;S=h,h=y,y=Sa(p,30)>>>0,p=f,f=x}r[0]=r[0]+f>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+h>>>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 uy=iy("v5",80,cy),qu=uy,Gu="2.30.45",ju=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,dn={pageview:"pageview",event:"event"},bo=class{constructor({client:t,uuidGenerator:r=Bt}){this.client=t,this.uuidGenerator=r}},wa=class extends bo{constructor({client:t,uuidGenerator:r=Bt}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ju(window.location),this.lastReferrer=hr()?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:hr()?document.title:"",encoding:hr()?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===dn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===dn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===dn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===dn.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 ju(window.location)}},St=class e{constructor(t,r){if(!vo(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 vo(i)?new e(i,Number.parseInt(o)*1e3):null}};St.cvo_cid="cvo_cid";St.expirationTime=120;var Ra=class extends bo{constructor({client:t,uuidGenerator:r=Bt}){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 q(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(St.cvo_cid,new St(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Ra.Id="link";var Ue=Object.keys;function ho(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var va=128,Wu=192,Mu=224,Nu=240;function ly(e){return(e&248)===Nu?4:(e&Nu)===Mu?3:(e&Mu)===Wu?2:1}function dy(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&va)!=va)break;if(r-=3,(n&Wu)!=va){t-r>=ly(n)*3&&(r=t);break}}return e.substring(0,r)}var xa={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"},py=Ue(xa).map(e=>xa[e]),fy=[...py].join("|"),my=new RegExp(`^(${fy}$)`),gy={svcAction:"svc_action",svcActionData:"svc_action_data"},yy=e=>Ue(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=xa[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),hy=e=>my.test(e),Sy=[hy],_u={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Vu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},Ao={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},vy=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ea={id:"quoteId",affiliation:"quoteAffiliation"},Ia={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},by={add:Ee,bookmark_add:Ee,bookmark_remove:Ee,click:Ee,checkout:Ee,checkout_option:Ee,detail:Ee,impression:Ee,remove:Ee,refund:Object.assign(Object.assign({},Ee),Ao),purchase:Object.assign(Object.assign({},Ee),Ao),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Ea),review:Object.assign(Object.assign({},Ee),Ia)},Ay=Ue(_u).map(e=>_u[e]),Cy=Ue(Vu).map(e=>Vu[e]),wy=Ue(Ee).map(e=>Ee[e]),Ry=Ue(Ao).map(e=>Ao[e]),xy=Ue(Ia).map(e=>Ia[e]),Ey=Ue(Ea).map(e=>Ea[e]),Iy=[...Ay,"custom"].join("|"),ky=[...Cy,"custom"].join("|"),Ku="(pr[0-9]+)",Yu="(il[0-9]+pi[0-9]+)",Py=new RegExp(`^${Ku}(${Iy})$`),Fy=new RegExp(`^(${Yu}(${ky}))|(il[0-9]+nm)$`),Oy=new RegExp(`^(${wy.join("|")})$`),Ty=new RegExp(`^(${Ry.join("|")})$`),Dy=new RegExp(`^${Ku}custom$`),qy=new RegExp(`^${Yu}custom$`),jy=new RegExp(`^(${[...vy,...xy,...Ey].join("|")})$`),My=e=>Py.test(e),Ny=e=>Fy.test(e),_y=e=>Oy.test(e),Vy=e=>Ty.test(e),Ly=e=>jy.test(e),Uy=[Ny,My,_y,Vy,Ly],Qy=[Dy,qy],By={anonymizeIp:"aip"},$y={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Hy={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},zy=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Gy=Object.assign(Object.assign(Object.assign(Object.assign({},By),$y),Hy),zy.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),ka=Object.assign(Object.assign({},Gy),gy),Wy=e=>{let t=!!e.action&&by[e.action]||{};return Ue(e).reduce((r,n)=>{let o=t[n]||ka[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Ky=Ue(ka).map(e=>ka[e]),Yy=e=>Ky.indexOf(e)!==-1,Jy=e=>e==="custom",Xy=e=>[...Uy,...Sy,Yy,Jy].some(t=>t(e)),Zy=e=>Ue(e).reduce((t,r)=>{let n=eh(r);return n?Object.assign(Object.assign({},t),th(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),eh=e=>{let t;return[...Qy].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},th=(e,t)=>Ue(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Pa=class{constructor(t){this.opts=t}sendEvent(t,r){return q(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:a,payload:m}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),f=this.encodeForEventType(t,m),p=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:m,body:f}=a;o=m||t;try{i=JSON.parse(f)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}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 q(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[ae.click,ae.custom,ae.search,ae.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}},Fa=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},Lu=b.fetch,Co=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",m={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},m),i?yield i(m,"analyticsFetch"):{}),{url:p}=f,y=at(f,["url"]),h;try{h=yield Lu(p,y)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{h.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,h,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Lu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return q(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"})}},Oa=class{constructor(t,r){Aa()&&Hu()?this.storage=new Ca:Aa()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new vr),this.client=new Co(t),this.beaconClient=new Pa(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}},Ta=class{constructor(t,r){this.storage=r||new vr,this.client=new Co(t)}getClientDependingOnEventType(t){return this.client}},wo=class{constructor(){this.storage=new vr,this.client=new Fa}getClientDependingOnEventType(t){return this.client}},rh="xx",nh=e=>e?.startsWith(rh)||!1,oh=`
|
|
27
27
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
28
28
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
29
29
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
30
|
-
`;function ih(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var ah=["1",1,"yes",!0];function Ro(){let e=[];return ba()&&e.push(window.doNotTrack),Da()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>ah.indexOf(t)!==-1)}var Ju="v15",Xu={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function sh(e=Xu.default,t=Ju,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var ch="38824e1f-37f5-42d3-8372-a4b8fa9df946",Ze=class{get defaultOptions(){return{endpoint:Xu.default,isCustomEndpoint:!1,token:"",version:Ju,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Gu}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[Yg,Hg].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Ro()?this.runtime=new wo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ae.view,{newEventType:ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(ae.click,{newEventType:ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(ae.custom,{newEventType:ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ae.search,{newEventType:ae.search,addClientIdParameter:!0})}initRuntime(t){return ba()&&hr()?new Oa(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(ih()&&console.warn(oh),new Ta(t))}get storage(){return this.runtime.storage}determineVisitorId(){return q(this,void 0,void 0,function*(){try{return ba()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Bt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Bt()}})}getCurrentVisitorId(){return q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return q(this,void 0,void 0,function*(){if(vo(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(qu(t,qu(r,ch)))}})}getParameters(t,...r){return q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Bt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Ro())return null;try{let r=new URL(t).searchParams.get(St.cvo_cid);if(r==null)return null;let n=St.fromString(r);return!n||!hr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>q(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((v,x)=>q(this,void 0,void 0,function*(){let k=yield v;return yield x(t,k)}),g)].reduce((g,v)=>q(this,void 0,void 0,function*(){let x=yield g;return yield v(x)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?Wy(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>q(this,void 0,void 0,function*(){let g=yield h;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(m=>m(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new So().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.search,t)})}sendSearchEvent(t){var{searchQueryUid:r}=t,n=at(t,["searchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.click,t)})}sendClickEvent(t){var{searchQueryUid:r}=t,n=at(t,["searchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.custom,t)})}sendCustomEvent(t){var{lastSearchQueryUid:r}=t,n=at(t,["lastSearchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.view,t)})}sendViewEvent(t){return q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return q(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return q(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Xy(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=at(t,["custom"]),o={};r&&ho(r)&&(o=this.lowercaseKeys(r));let i=Zy(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=at(t,["custom"]);if(r&&ho(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=at(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ae.view||r==ae.click||r==ae.search||r==ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=at(t,["userId"]);return nh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=at(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&ho(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&ho(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?dy(t,r):t}get baseUrl(){return sh(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},st;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(st||(st={}));var j;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(j||(j={}));var Uu={[j.triggerNotify]:"queryPipelineTriggers",[j.triggerExecute]:"queryPipelineTriggers",[j.triggerQuery]:"queryPipelineTriggers",[j.triggerRedirect]:"queryPipelineTriggers",[j.queryError]:"errors",[j.queryErrorBack]:"errors",[j.queryErrorClear]:"errors",[j.queryErrorRetry]:"errors",[j.pagerNext]:"getMoreResults",[j.pagerPrevious]:"getMoreResults",[j.pagerNumber]:"getMoreResults",[j.pagerResize]:"getMoreResults",[j.pagerScrolling]:"getMoreResults",[j.facetSearch]:"facet",[j.facetShowLess]:"facet",[j.facetShowMore]:"facet",[j.recommendation]:"recommendation",[j.likeSmartSnippet]:"smartSnippet",[j.dislikeSmartSnippet]:"smartSnippet",[j.expandSmartSnippet]:"smartSnippet",[j.collapseSmartSnippet]:"smartSnippet",[j.openSmartSnippetFeedbackModal]:"smartSnippet",[j.closeSmartSnippetFeedbackModal]:"smartSnippet",[j.sendSmartSnippetReason]:"smartSnippet",[j.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.clearRecentQueries]:"recentQueries",[j.recentResultClick]:"recentlyClickedDocuments",[j.clearRecentResults]:"recentlyClickedDocuments",[j.showLessFoldedResults]:"folding",[j.caseDetach]:"case",[j.likeGeneratedAnswer]:"generatedAnswer",[j.dislikeGeneratedAnswer]:"generatedAnswer",[j.openGeneratedAnswerSource]:"generatedAnswer",[j.generatedAnswerStreamEnd]:"generatedAnswer",[j.generatedAnswerSourceHover]:"generatedAnswer",[j.generatedAnswerCopyToClipboard]:"generatedAnswer",[j.generatedAnswerHideAnswers]:"generatedAnswer",[j.generatedAnswerShowAnswers]:"generatedAnswer",[j.generatedAnswerExpand]:"generatedAnswer",[j.generatedAnswerCollapse]:"generatedAnswer",[j.generatedAnswerFeedbackSubmit]:"generatedAnswer",[j.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[st.expandToFullUI]:"interface",[st.openUserActions]:"User Actions",[st.showPrecedingSessions]:"User Actions",[st.showFollowingSessions]:"User Actions",[st.clickViewedDocument]:"User Actions",[st.clickPageView]:"User Actions",[st.createArticle]:"createArticle"},br=class{constructor(){this.runtime=new wo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Gu}};function uh(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function lh(e){return e.map(t=>t.replace(/;/g,""))}function Zu(e){let r=e.join(";");return r.length<=256?r:Zu(e.slice(1))}var Qu=e=>{let t=lh(e),r=uh(t);return Zu(r)};function Bu(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Qu(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Qu(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var xo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Ro();this.coveoAnalyticsClient=n?new br:new Ze(t)}disable(){this.coveoAnalyticsClient=new br}enable(){this.coveoAnalyticsClient=new Ze(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(j.interfaceLoad)}logInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(j.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(j.recommendation)}logRecommendation(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(j.recommendationOpen,t,r)}logRecommendationOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(j.staticFilterClearAll,t)}logStaticFilterClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(j.staticFilterSelect,t)}logStaticFilterSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(j.staticFilterDeselect,t)}logStaticFilterDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(j.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(j.interfaceChange,t)}logInterfaceChange(t){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(j.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(j.didyoumeanClick)}logDidYouMeanClick(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(j.resultsSort,t)}logResultsSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(j.searchboxSubmit)}logSearchboxSubmit(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(j.searchboxClear)}logSearchboxClear(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(j.searchboxAsYouType)}logSearchboxAsYouType(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(j.breadcrumbFacet,t)}logBreadcrumbFacet(t){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(j.breadcrumbResetAll)}logBreadcrumbResetAll(){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(j.documentQuickview,t,r)}logDocumentQuickview(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(j.documentOpen,t,r)}logDocumentOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(j.omniboxAnalytics,Bu(t))}logOmniboxAnalytics(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(j.omniboxFromLink,Bu(t))}logOmniboxFromLink(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(j.searchFromLink)}logSearchFromLink(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(j.triggerNotify,t)}logTriggerNotify(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(j.triggerExecute,t)}logTriggerExecute(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(j.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(j.undoTriggerQuery,t)}logUndoTriggerQuery(t){return q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(j.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(j.pagerResize,t)}logPagerResize(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(j.pagerNumber,t)}logPagerNumber(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(j.pagerNext,t)}logPagerNext(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(j.pagerPrevious,t)}logPagerPrevious(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(j.pagerScrolling)}logPagerScrolling(){return q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(j.facetClearAll,t)}logFacetClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(j.facetSearch,t)}logFacetSearch(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(j.facetSelect,t)}logFacetSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(j.facetDeselect,t)}logFacetDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(j.facetExclude,t)}logFacetExclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(j.facetUnexclude,t)}logFacetUnexclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(j.facetSelectAll,t)}logFacetSelectAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(j.facetUpdateSort,t)}logFacetUpdateSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(j.facetShowMore,t)}logFacetShowMore(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(j.facetShowLess,t)}logFacetShowLess(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(j.queryError,t)}logQueryError(t){return q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorBack);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorBack)})}})}logQueryErrorBack(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorRetry);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorRetry)})}})}logQueryErrorRetry(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorClear);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorClear)})}})}logQueryErrorClear(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(j.likeSmartSnippet)}logLikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(j.dislikeSmartSnippet)}logDislikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(j.expandSmartSnippet)}logExpandSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(j.collapseSmartSnippet)}logCollapseSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(j.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(j.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(j.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(j.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(j.copyToClipboard,t,r)}logCopyToClipboard(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(j.recentQueryClick)}logRecentQueryClick(){return q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(j.clearRecentQueries)}logClearRecentQueries(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(j.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(j.clearRecentResults)}logClearRecentResults(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(j.noResultsBack)}logNoResultsBack(){return q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(j.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(j.showLessFoldedResults)}logShowLessFoldedResults(){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r,n=Uu[t]){return q(this,void 0,void 0,function*(){this.coveoAnalyticsClient.getParameters;let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:n,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r,n=Uu[t]){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({searchQueryUid:m})}})}logClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){var n,o;return q(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(j.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(j.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(j.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(j.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(j.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(j.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(j.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(j.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(j.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(j.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(j.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(j.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(j.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Eo=Object.assign({},dn),$u=Object.keys(Eo).map(e=>Eo[e]),Sr=class extends wa{constructor({client:t,uuidGenerator:r=Bt}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>$u.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>($u.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Eo.pageview,{newEventType:ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Eo.event,{newEventType:ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return yy(this.ticket)}};Sr.Id="svc";var Io;(function(e){e.click="click",e.flowStart="flowStart"})(Io||(Io={}));var Le;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(Le||(Le={}));var ko;(function(e){e.quit="Quit",e.solved="Solved"})(ko||(ko={}));var Po=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Ro();this.coveoAnalyticsClient=o?new Ze(t):new br,this.svc=new Sr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new br,this.svc=new Sr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Ze(this.options),this.svc=new Sr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Le.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Le.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Le.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Le.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Le.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Le.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Le.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Le.caseCancelled,{reason:ko.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Le.caseSolved,{reason:ko.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Le.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Io.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Io.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){var r,n;return q(this,void 0,void 0,function*(){let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){var i,a;return q(this,void 0,void 0,function*(){let m=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(m)})}};var el=e=>new Ze(e).getCurrentVisitorId(),mn=(e,t)=>typeof t=="function"?(...r)=>{let n=Kr(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,gn=(e,t)=>(...r)=>{let n=Kr(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Fo(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();d();c();l();u();function tl(e){let{activeValue:t,ancestryMap:r}=dh(e);return t?ph(t,r):[]}function dh(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function ph(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var fh=(e,t)=>e.categoryFacetSet[t]?.request;var Ma=(e,t)=>{let r=fh(e,t);return tl(r?.currentValues??[])};d();c();l();u();function Oo(){return{}}d();c();l();u();function To(){return{}}d();c();l();u();function Do(){return{}}d();c();l();u();function qo(){return{}}function Na(e){return{facetSet:e.facetSet??qo(),categoryFacetSet:e.categoryFacetSet??Oo(),dateFacetSet:e.dateFacetSet??To(),numericFacetSet:e.numericFacetSet??Do(),automaticFacetSet:e.automaticFacetSet??Fo()}}var _a=e=>{let t=[];return yh(e).forEach((r,n)=>{let o=Rh(e,r.facetId),i=Ch(r,n+1);if(gh(r)){if(!!!Ma(e,r.facetId).length)return;t.push({...i,...bh(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,m)=>{if(a.state==="idle")return;let f=rl(a,m+1,o),p=mh(r)?nl(a):Sh(a);t.push({...i,...f,...p})})}),hh(e).forEach((r,n)=>{let o=Ah(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let m=rl(i,a+1,"specific"),f=nl(i);t.push({...o,...m,...f})})}),t},mh=e=>e.type==="specific",gh=e=>e.type==="hierarchical",yh=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),hh=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),rl=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),Sh=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),nl=e=>({displayValue:e.value,value:e.value}),vh=(e,t)=>Ma(e,t).map(n=>n.value).join(";"),bh=(e,t)=>{let n=vh(e,t);return{value:n,valuePosition:1,displayValue:n}},Ah=(e,t)=>({title:ol(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),Ch=(e,t)=>({title:ol(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),ol=(e,t)=>`${e}_${t}`,wh=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Rh=(e,t)=>{let r=wh(e,t);return r?r.type:"specific"};d();c();l();u();var Ar=e=>{if(xh(e)){let t=Object.values(e.answer.queries).pop()?.data;return typeof t=="object"&&t!==null&&"answerId"in t?t.answerId:void 0}if(Eh(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},xh=e=>"answer"in e&&"generatedAnswer"in e&&!X(e.generatedAnswer?.answerConfigurationId),Eh=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",il=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Ih=pe(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var Ne=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();var al=(r=>(r.Ascending="ascending",r.Descending="descending",r))(al||{}),sl=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(sl||{}),Va=e=>{if(hc(e))return e.map(t=>Va(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},cl=()=>({by:"relevancy"});var FP=new K({values:{by:new Vi({enum:sl,required:!0}),order:new Vi({enum:al}),field:new H}});function jo(){return Va(cl())}d();c();l();u();d();c();l();u();var Cr=()=>"default";var kh=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},ct=class{constructor(t){this.getState=t;de(this,"state");this.state=t()}getLanguage(){return kh(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let m=`context_${i}`;o[m]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=sr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Cr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var yn=class yn extends ct{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return _a(Na(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||yn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||Ge().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||yn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ar(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??jo()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(p=>p.expression),a=o.partialQueries.length-1,m=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:m,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||Ne().q}get responseTime(){return this.state.search?.duration||Ge().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Ge().response.totalCountFiltered}};de(yn,"fallbackPipelineName","default");var vt=yn,ul=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new xo({token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return p||y.disable(),y},La=()=>{let t=Xe.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Mo=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield el(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(La()&&{pageId:La()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:yr(e)})}}});return function Mo(_x0,_x1){return _ref7.apply(this,arguments)}}();d();c();l();u();d();c();l();u();d();c();l();u();var wr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var hn=class extends ct{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ne().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||wr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||wr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||wr().recommendations.length}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ll=/^(?:[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 Ph(e){return typeof e=="string"&&ll.test(e)}var Ua=Ph;d();c();l();u();var xe=[];for(let e=0;e<256;++e)xe.push((e+256).toString(16).slice(1));function dl(e,t=0){return(xe[e[t+0]]+xe[e[t+1]]+xe[e[t+2]]+xe[e[t+3]]+"-"+xe[e[t+4]]+xe[e[t+5]]+"-"+xe[e[t+6]]+xe[e[t+7]]+"-"+xe[e[t+8]]+xe[e[t+9]]+"-"+xe[e[t+10]]+xe[e[t+11]]+xe[e[t+12]]+xe[e[t+13]]+xe[e[t+14]]+xe[e[t+15]]).toLowerCase()}d();c();l();u();var Qa,Fh=new Uint8Array(16);function Ba(){if(!Qa){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Qa=crypto.getRandomValues.bind(crypto)}return Qa(Fh)}d();c();l();u();d();c();l();u();var Oh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$a={randomUUID:Oh};function Th(e,t,r){if($a.randomUUID&&!t&&!e)return $a.randomUUID();e=e||{};let n=e.random??e.rng?.()??Ba();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 dl(n)}var Ha=Th;d();c();l();u();function pl(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Dh({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var fl="visitorId";function qh(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(fl),o=n&&Ua(n)?n:t.generateUUID();return r.setItem(fl,o),o}}}var Sl="1.2.7",za=128,vl=192,ml=224,gl=240,jh=248;function Mh(e){return(e&jh)===gl?4:(e&gl)===ml?3:(e&ml)===vl?2:1}function Nh(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&za)!=za)break;if(r-=3,(n&vl)!=za){t-r>=Mh(n)*3&&(r=t);break}}return e.substring(0,r)}function _h(e){let{trackingId:t}=e;return{trackingId:t}}function Vh(e){return(e.source||[]).concat([`relay@${Sl}`])}function bl(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,m=_h(t),f=n.getClientId();return Object.freeze({type:e,config:m,ts:Date.now(),source:Vh(t),clientId:f,userAgent:a(),referrer:yl(o()),location:yl(i())})}function yl(e){return e!==null?Nh(e,1024):null}function Lh(e,t,r,n,o){return{...t,meta:bl(e,r,n,o)}}var Uh="*";function Qh(){let e=[];function t({type:f,callback:p}){return e.findIndex(y=>y.type===f&&y.callback===p)}function r(f,p){return f.type==="*"||p===f.type}function n(f){return t(f)<0&&e.push(f),()=>m(f.type,f.callback)}function o(f){e.forEach(p=>{if(r(p,f.meta.type))try{p.callback(f)}catch(y){console.error(y)}})}function i(f){if(f===Uh)e.length=0;else for(let p=e.length-1;p>=0;p--)e[p].type===f&&e.splice(p,1)}function a(f){let p=t(f);p>=0&&e.splice(p,1)}function m(f,p){p?a({type:f,callback:p}):i(f)}return{add:n,call:o,remove:m}}function hl({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 Bh(e){let t=hl(e);return{get:()=>t,update:r=>{t=hl({...t,...r})}}}var Ga=$h();function $h(){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 a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,m=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${m};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Hh(){return{getItem(e){return Ga.getItem(e)||localStorage.getItem(e)},removeItem(e){Ga.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ga.setItem(e,t,31556952e3)}}}function zh(){let e=document.referrer;return e===""?null:e}function Wa(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(pl().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:()=>zh(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Ha(),storage:Hh()}}function Gh(){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 Wh(){return{getItem(){return null},removeItem(){},setItem(){}}}function Kh(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Wh()}}function Yh(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=Kh();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&Jh()&&Gh()?Wa():n}function Jh(){try{return typeof window=="object"}catch{return!1}}function Xh(e){return{get:()=>Object.freeze(Yh(e))}}function Al(e){let t=Bh(e),r=Qh(),n=Xh(t),o=qh(n);return{emit:(i,a)=>{let m=t.get(),f=n.get(),p=Lh(i,a,m,f,o);return Dh({config:m,environment:f,event:p,listenerManager:r})},getMeta:i=>bl(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:Sl}}d();c();l();u();function Cl(){return typeof window<"u"&&typeof document<"u"}var Sn=pe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>yr(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,m)=>{let f=eS(m);return Al({mode:i?"emit":"disabled",url:o??Vn(e,t),token:r,trackingId:n??null,source:a,environment:f})}),Zh={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},eS=e=>{if(!e)return;let t=e();return{...(Cl()?Wa():Zh),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();var vn=class extends ct{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},wl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new vn(t)})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new Po({enableAnalytics:p,token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return p||y.disable(),y};d();c();l();u();d();c();l();u();function Rl(e,t){return{...new vt(t).getBaseMetadata(),actionCause:e,type:e}}function tS(e){return Object.assign(e,{instantlyCallable:!0})}function rS(e,t){let r=i=>tS(ue(e,i)),n=r(/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(i,{getState:a,extra:m}){let{analyticsClientMiddleware:f,preprocessRequest:p,logger:y}=m;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:p,logger:y})).log({state:a(),extra:m})});return function(_x10,_x11){return _ref8.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref9=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f}){let{description:p,log:y}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f});return{description:p,action:r(/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(h,{getState:S,extra:g}){return yield y({state:S(),extra:g})});return function(_x13,_x14){return _ref0.apply(this,arguments)}}())}});return function prepare(_x12){return _ref9.apply(this,arguments)}}()}),n}var xl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return iS(i)}return n},nS=e=>e.configuration.analytics.analyticsMode==="legacy",oS=e=>e.configuration.analytics.analyticsMode==="next",iS=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=m=>new a(m)),rS(e,/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*({getState:m,analyticsClientMiddleware:f,preprocessRequest:p,logger:y}){let h=[],S={log:function(){var _ref10=_asyncToGenerator(function*({state:R}){for(let P of h)yield P(R)});return function log(_x16){return _ref10.apply(this,arguments)}}()},g=m(),v=i({getState:m,logger:y,analyticsClientMiddleware:f,preprocessRequest:p,provider:r(m)}),x=yield t(v,m());S.description=x?.description,h.push(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(R){nS(R)&&(yield aS(x,r,R,y,v.coveoAnalyticsClient))});return function(_x17){return _ref11.apply(this,arguments)}}());let{emit:k}=Sn(g);return h.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(R){if(oS(R)&&o&&n){let P=n(R);yield fS(k,o,P)}});return function(_x18){return _ref12.apply(this,arguments)}}()),S});return function(_x15){return _ref1.apply(this,arguments)}}()));function aS(_x19,_x20,_x21,_x22,_x23){return _aS.apply(this,arguments)}function _aS(){_aS=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _aS.apply(this,arguments)}var sS=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref13=_asyncToGenerator(function*(i){r(n,o)});return function log(_x24){return _ref13.apply(this,arguments)}}()}),je=xl(e=>ul({...e,provider:e.provider||new vt(e.getState)}),e=>e,vt),LT=xl(wl,sS("caseAssist"),vn);var Ka=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return cS(e,r,t)};function cS(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:dS(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:pS(e),queryPipeline:r.pipeline||pr()}}var No=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),El={urihash:new H,sourcetype:new H,permanentid:new H},Il={uniqueId:W,raw:new K({values:El}),title:W,uri:W,clickUri:W,rankingModifier:new H({required:!1,emptyAllowed:!0})};function uS(e){return Object.assign({},...Object.keys(El).map(t=>({[t]:e[t]})))}function lS(e){return Object.assign({},...Object.keys(Il).map(t=>({[t]:e[t]})),{raw:uS(e.raw)})}function dS(e){let t=e.raw.author;return X(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function pS(e){let t=e.raw.source;return X(t)?"unknown":t}var Ya=e=>new Fe(Il).validate(lS(e));function fS(_x25,_x26,_x27){return _fS.apply(this,arguments)}function _fS(){_fS=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _fS.apply(this,arguments)}d();c();l();u();var kl=()=>je("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new hn(e)),Pl=()=>({actionCause:"recommendationInterfaceLoad"}),Vo=e=>je({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Ya(e),t.makeRecommendationOpen(Ka(e,r),No(e))),__legacy__provider:t=>new hn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Ka(e,t),n=No(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var Rr=T("recommendation/set",e=>Q(e,{id:W})),bt=ue("recommendation/get",/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield mS(o),m=yield n.recommendations(a),f=Date.now()-i;return Oe(m)?r(m.error):{recommendations:m.success.results,analyticsAction:kl(),duration:f,searchUid:m.success.searchUid,splitTestRun:m.success.splitTestRun,pipeline:m.success.pipeline}});return function(_x28,_x29){return _ref14.apply(this,arguments)}}()),mS=/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Xe.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield gS(e,Pl()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function mS(_x30){return _ref15.apply(this,arguments)}}(),gS=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Mo(e.configuration.analytics,r)});return function gS(_x31,_x32){return _ref16.apply(this,arguments)}}();var xr=ge(wr(),e=>{e.addCase(Rr,(t,r)=>{t.id=r.payload.id}).addCase(bt.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(bt.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(bt.pending,t=>{t.isLoading=!0}).addCase(fo,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Er=T("searchHub/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();var Ir=ge(Cr(),e=>{e.addCase(Er,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ye,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Fl(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Ol=We;function Bl(e,t){if(e===t||!(Ol(e)&&Ol(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Bl(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function kr(e){let t=0;for(let r in e)t++;return t}var Tl=e=>[].concat(...e);function yS(e){return new RegExp("(^|:)//").test(e)}function hS(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Qo(e){return e!=null}function SS(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var vS=e=>e.replace(/\/$/,""),bS=e=>e.replace(/^\//,"");function AS(e,t){if(!e)return t;if(!t)return e;if(yS(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=vS(e),t=bS(t),`${e}${r}${t}`}function CS(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Dl=(...e)=>A(...e),wS=e=>e.status>=200&&e.status<=299,RS=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ql(e){if(!We(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function $l({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=Dl,paramsSerializer:n,isJsonContentType:o=RS,jsonContentType:i="application/json",jsonReplacer:a,timeout:m,responseHandler:f,validateStatus:p,...y}={}){return typeof A>"u"&&r===Dl&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(S,g,v){let{getState:x,extra:k,endpoint:R,forced:P,type:w}=g,E,{url:M,headers:O=new C(y.headers),params:I=void 0,responseHandler:F=f??"json",validateStatus:D=p??wS,timeout:N=m,...$}=typeof S=="string"?{url:S}:S,U,V=g.signal;N&&(U=new s.AbortController,g.signal.addEventListener("abort",U.abort),V=U.signal);let _={...y,signal:V,...$};O=new C(ql(O)),_.headers=(yield t(O,{getState:x,arg:S,extra:k,endpoint:R,forced:P,type:w,extraOptions:v}))||O;let B=Z=>typeof Z=="object"&&(We(Z)||Array.isArray(Z)||typeof Z.toJSON=="function");if(!_.headers.has("content-type")&&B(_.body)&&_.headers.set("content-type",i),B(_.body)&&o(_.headers)&&(_.body=JSON.stringify(_.body,a)),I){let Z=~M.indexOf("?")?"&":"?",oe=n?n(I):new URLSearchParams(ql(I));M+=Z+oe}M=AS(e,M);let L=new Request(M,_);E={request:new Request(M,_)};let G,Y=!1,te=U&&setTimeout(()=>{Y=!0,U.abort()},N);try{G=yield r(L)}catch(Z){return{error:{status:Y?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Z)},meta:E}}finally{te&&clearTimeout(te),U?.signal.removeEventListener("abort",U.abort)}let se=G.clone();E.response=se;let ee,re="";try{let Z;if(yield Promise.all([h(G,F).then(oe=>ee=oe,oe=>Z=oe),se.text().then(oe=>re=oe,()=>{})]),Z)throw Z}catch(Z){return{error:{status:"PARSING_ERROR",originalStatus:G.status,data:re,error:String(Z)},meta:E}}return D(G,ee)?{data:ee,meta:E}:{error:{status:G.status,data:ee},meta:E}});return function(_x33,_x34,_x35){return _ref17.apply(this,arguments)}}());function h(_x36,_x37){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _h2.apply(this,arguments)}}var Pr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function xS(){return _xS.apply(this,arguments)}function _xS(){_xS=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _xS.apply(this,arguments)}function ES(e,t){throw Object.assign(new Pr({error:e,meta:t}),{throwImmediately:!0})}var jl={},IS=(e,t)=>(/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(r,n,o){let i=[5,(t||jl).maxRetries,(o||jl).maxRetries].filter(y=>y!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:xS,retryCondition:(y,h,{attempt:S})=>S<=a,...t,...o},p=0;for(;;)try{let y=yield e(r,n,o);if(y.error)throw new Pr(y);return y}catch(y){if(p++,y.throwImmediately){if(y instanceof Pr)return y.value;throw y}if(y instanceof Pr&&!f.retryCondition(y.value.error,r,{attempt:p,baseQueryApi:n,extraOptions:o}))return y.value;yield f.backoff(p,f.maxRetries)}});return function(_x38,_x39,_x40){return _ref18.apply(this,arguments)}}()),Hl=Object.assign(IS,{fail:ES}),es=T("__rtkq/focused"),zl=T("__rtkq/unfocused"),ts=T("__rtkq/online"),Gl=T("__rtkq/offline");function rs(e){return e.type==="query"}function kS(e){return e.type==="mutation"}function ns(e){return e.type==="infinitequery"}function os(e,t,r,n,o,i){return PS(e)?e(t,r,n,o).filter(Qo).map(Ja).map(i):Array.isArray(e)?e.map(Ja).map(i):[]}function PS(e){return typeof e=="function"}function Ja(e){return typeof e=="string"?{type:e}:e}function FS(e,t){return e.catch(t)}var Cn=Symbol("forceQueryFn"),Xa=e=>typeof e[Cn]=="function";function OS({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,m=new Map,{unsubscribeQueryResult:f,removeMutationResult:p,updateSubscriptionOptions:y}=o.internalActions;return{buildInitiateQuery:R,buildInitiateInfiniteQuery:P,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:v};function h(E,M){return O=>{let I=i.endpointDefinitions[E],F=e({queryArgs:M,endpointDefinition:I,endpointName:E});return a.get(O)?.[F]}}function S(E,M){return O=>m.get(O)?.[M]}function g(){return E=>Object.values(a.get(E)||{}).filter(Qo)}function v(){return E=>Object.values(m.get(E)||{}).filter(Qo)}function x(E){}function k(E,M){let O=(I,{subscribe:F=!0,forceRefetch:D,subscriptionOptions:N,[Cn]:$,...U}={})=>(V,_)=>{let B=e({queryArgs:I,endpointDefinition:M,endpointName:E}),L,z={...U,type:"query",subscribe:F,forceRefetch:D,subscriptionOptions:N,endpointName:E,originalArgs:I,queryCacheKey:B,[Cn]:$};if(rs(M))L=t(z);else{let{direction:ce,initialPageParam:me}=U;L=r({...z,direction:ce,initialPageParam:me})}let G=o.endpoints[E].select(I),Y=V(L),te=G(_());let{requestId:se,abort:ee}=Y,re=te.requestId!==se,Z=a.get(V)?.[B],oe=()=>G(_()),ye=Object.assign($?Y.then(oe):re&&!Z?Promise.resolve(te):Promise.all([Z,Y]).then(oe),{arg:I,requestId:se,subscriptionOptions:N,queryCacheKey:B,abort:ee,unwrap(){return _asyncToGenerator(function*(){let ce=yield ye;if(ce.isError)throw ce.error;return ce.data})()},refetch:()=>V(O(I,{subscribe:!1,forceRefetch:!0})),unsubscribe(){F&&V(f({queryCacheKey:B,requestId:se}))},updateSubscriptionOptions(ce){ye.subscriptionOptions=ce,V(y({endpointName:E,requestId:se,queryCacheKey:B,options:ce}))}});if(!Z&&!re&&!$){let ce=CS(a,V,{});ce[B]=ye,ye.then(()=>{delete ce[B],kr(ce)||a.delete(V)})}return ye};return O}function R(E,M){return k(E,M)}function P(E,M){return k(E,M)}function w(E){return(M,{track:O=!0,fixedCacheKey:I}={})=>(F,D)=>{let N=n({type:"mutation",endpointName:E,originalArgs:M,track:O,fixedCacheKey:I}),$=F(N);let{requestId:U,abort:V,unwrap:_}=$,B=FS($.unwrap().then(Y=>({data:Y})),Y=>({error:Y})),L=()=>{F(p({requestId:U,fixedCacheKey:I}))},z=Object.assign(B,{arg:$.arg,requestId:U,abort:V,unwrap:_,reset:L}),G=m.get(F)||{};return m.set(F,G),G[U]=z,z.then(()=>{delete G[U],kr(G)||m.delete(F)}),I&&(G[I]=z,z.then(()=>{G[I]===z&&(delete G[I],kr(G)||m.delete(F))})),z}}}function TS(e){return e}var Lo=(e={})=>({...e,[cn]:!0});function DS({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let m=(F,D,N,$)=>(U,V)=>{let _=r[F],B=n({queryArgs:D,endpointDefinition:_,endpointName:F});if(U(o.internalActions.queryResultPatched({queryCacheKey:B,patches:N})),!$)return;let L=o.endpoints[F].select(D)(V()),z=os(_.providesTags,L.data,void 0,D,{},i);U(o.internalActions.updateProvidedBy({queryCacheKey:B,providedTags:z}))};function f(F,D,N=0){let $=[D,...F];return N&&$.length>N?$.slice(0,-1):$}function p(F,D,N=0){let $=[...F,D];return N&&$.length>N?$.slice(1):$}let y=(F,D,N,$=!0)=>(U,V)=>{let B=o.endpoints[F].select(D)(V()),L={patches:[],inversePatches:[],undo:()=>U(o.util.patchQueryData(F,D,L.inversePatches,$))};if(B.status==="uninitialized")return L;let z;if("data"in B)if(De(B.data)){let[G,Y,te]=Xn(B.data,N);L.patches.push(...Y),L.inversePatches.push(...te),z=G}else z=N(B.data),L.patches.push({op:"replace",path:[],value:z}),L.inversePatches.push({op:"replace",path:[],value:B.data});return L.patches.length===0||U(o.util.patchQueryData(F,D,L.patches,$)),L},h=(F,D,N)=>$=>$(o.endpoints[F].initiate(D,{subscribe:!1,forceRefetch:!0,[Cn]:()=>({data:N})})),S=(F,D)=>F.query&&F[D]?F[D]:TS,g=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(F,{signal:D,abort:N,rejectWithValue:$,fulfillWithValue:U,dispatch:V,getState:_,extra:B}){let L=r[F.endpointName];try{let z=S(L,"transformResponse"),G={signal:D,abort:N,dispatch:V,getState:_,extra:B,endpoint:F.endpointName,type:F.type,forced:F.type==="query"?v(F,_()):void 0,queryCacheKey:F.type==="query"?F.queryCacheKey:void 0},Y=F.type==="query"?F[Cn]:void 0,te,se=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(re,Z,oe,ye){if(Z==null&&re.pages.length)return Promise.resolve({data:re});let ce={queryArg:F.originalArgs,pageParam:Z},me=yield ee(ce),he=ye?f:p;return{data:{pages:he(re.pages,me.data,oe),pageParams:he(re.pageParams,Z,oe)}}});return function se(_x43,_x44,_x45,_x46){return _ref20.apply(this,arguments)}}();function ee(_x47){return _ee.apply(this,arguments)}function _ee(){_ee=_asyncToGenerator(function*(re){let Z,{extraOptions:oe}=L;if(Y?Z=Y():L.query?Z=yield t(L.query(re),G,oe):Z=yield L.queryFn(re,G,oe,ce=>t(ce,G,oe)),typeof process<"u",Z.error)throw new Pr(Z.error,Z.meta);let ye=yield z(Z.data,Z.meta,re);return{...Z,data:ye}});return _ee.apply(this,arguments)}if(F.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:re}=L,{maxPages:Z=1/0}=re,oe,ye={pages:[],pageParams:[]},ce=a.selectQueryEntry(_(),F.queryCacheKey)?.data,he=v(F,_())&&!F.direction||!ce?ye:ce;if("direction"in F&&F.direction&&he.pages.length){let Pe=F.direction==="backward",dt=(Pe?Wl:Za)(re,he);oe=yield se(he,dt,Z,Pe)}else{let{initialPageParam:Pe=re.initialPageParam}=F,_e=ce?.pageParams??[],dt=_e[0]??Pe,Kt=_e.length;oe=yield se(he,dt,Z),Y&&(oe={data:oe.data.pages[0]});for(let Yt=1;Yt<Kt;Yt++){let Qr=Za(re,oe.data);oe=yield se(oe.data,Qr,Z)}}te=oe}else te=yield ee(F.originalArgs);return U(te.data,Lo({fulfilledTimeStamp:Date.now(),baseQueryMeta:te.meta}))}catch(z){let G=z;if(G instanceof Pr){let Y=S(L,"transformErrorResponse");try{return $(yield Y(G.value,G.meta,F.originalArgs),Lo({baseQueryMeta:G.meta}))}catch(te){G=te}}throw typeof process<"u",console.error(G),G}});return function g(_x41,_x42){return _ref19.apply(this,arguments)}}();function v(F,D){let N=a.selectQueryEntry(D,F.queryCacheKey),$=a.selectConfig(D).refetchOnMountOrArgChange,U=N?.fulfilledTimeStamp,V=F.forceRefetch??(F.subscribe&&$);return V?V===!0||(Number(new Date)-Number(U))/1e3>=V:!1}let x=()=>ue(`${e}/executeQuery`,g,{getPendingMeta({arg:D}){let N=r[D.endpointName];return Lo({startedTimeStamp:Date.now(),...(ns(N)?{direction:D.direction}:{})})},condition(D,{getState:N}){let $=N(),U=a.selectQueryEntry($,D.queryCacheKey),V=U?.fulfilledTimeStamp,_=D.originalArgs,B=U?.originalArgs,L=r[D.endpointName],z=D.direction;return Xa(D)?!0:U?.status==="pending"?!1:v(D,$)||rs(L)&&L?.forceRefetch?.({currentArg:_,previousArg:B,endpointState:U,state:$})?!0:!(V&&!z)},dispatchConditionRejection:!0}),k=x(),R=x(),P=ue(`${e}/executeMutation`,g,{getPendingMeta(){return Lo({startedTimeStamp:Date.now()})}}),w=F=>"force"in F,E=F=>"ifOlderThan"in F,M=(F,D,N)=>($,U)=>{let V=w(N)&&N.force,_=E(N)&&N.ifOlderThan,B=(z=!0)=>{let G={forceRefetch:z,isPrefetch:!0};return o.endpoints[F].initiate(D,G)},L=o.endpoints[F].select(D)(U());if(V)$(B());else if(_){let z=L?.fulfilledTimeStamp;if(!z){$(B());return}(Number(new Date)-Number(new Date(z)))/1e3>=_&&$(B())}else $(B(!1))};function O(F){return D=>D?.meta?.arg?.endpointName===F}function I(F,D){return{matchPending:ir(ro(F),O(D)),matchFulfilled:ir(ot(F),O(D)),matchRejected:ir(Lt(F),O(D))}}return{queryThunk:k,mutationThunk:P,infiniteQueryThunk:R,prefetch:M,updateQueryData:y,upsertQueryData:h,patchQueryData:m,buildMatchThunkActions:I}}function Za(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Wl(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Kl(e,t,r,n){return os(r[e.meta.arg.endpointName][t],ot(e)?e.payload:void 0,ln(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Uo(e,t,r){let n=e[t];n&&r(n)}function wn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Ml(e,t,r){let n=e[wn(t)];n&&r(n)}var bn={};function qS({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:m},assertTagType:f,config:p}){let y=T(`${e}/resetApiState`);function h(O,I,F,D){var N;O[N=I.queryCacheKey]??(O[N]={status:"uninitialized",endpointName:I.endpointName}),Uo(O,I.queryCacheKey,$=>{$.status="pending",$.requestId=F&&$.requestId?$.requestId:D.requestId,I.originalArgs!==void 0&&($.originalArgs=I.originalArgs),$.startedTimeStamp=D.startedTimeStamp;let U=o[D.arg.endpointName];ns(U)&&"direction"in I&&($.direction=I.direction)})}function S(O,I,F,D){Uo(O,I.arg.queryCacheKey,N=>{if(N.requestId!==I.requestId&&!D)return;let{merge:$}=o[I.arg.endpointName];if(N.status="fulfilled",$){if(N.data!==void 0){let{fulfilledTimeStamp:U,arg:V,baseQueryMeta:_,requestId:B}=I,L=nt(N.data,z=>$(z,F,{arg:V.originalArgs,baseQueryMeta:_,fulfilledTimeStamp:U,requestId:B}));N.data=L}else N.data=F;}else N.data=o[I.arg.endpointName].structuralSharing??!0?Bl(Me(N.data)?ca(N.data):N.data,F):F;delete N.error,N.fulfilledTimeStamp=I.fulfilledTimeStamp})}let g=Ut({name:`${e}/queries`,initialState:bn,reducers:{removeQueryResult:{reducer(O,{payload:{queryCacheKey:I}}){delete O[I]},prepare:ar()},cacheEntriesUpserted:{reducer(O,I){for(let F of I.payload){let{queryDescription:D,value:N}=F;h(O,D,!0,{arg:D,requestId:I.meta.requestId,startedTimeStamp:I.meta.timestamp}),S(O,{arg:D,requestId:I.meta.requestId,fulfilledTimeStamp:I.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:O=>({payload:O.map(D=>{let{endpointName:N,arg:$,value:U}=D,V=o[N];return{queryDescription:{type:"query",endpointName:N,originalArgs:D.arg,queryCacheKey:n({queryArgs:$,endpointDefinition:V,endpointName:N})},value:U}}),meta:{[cn]:!0,requestId:oo(),timestamp:Date.now()}})},queryResultPatched:{reducer(O,{payload:{queryCacheKey:I,patches:F}}){Uo(O,I,D=>{D.data=la(D.data,F.concat())})},prepare:ar()}},extraReducers(O){O.addCase(t.pending,(I,{meta:F,meta:{arg:D}})=>{let N=Xa(D);h(I,D,N,F)}).addCase(t.fulfilled,(I,{meta:F,payload:D})=>{let N=Xa(F.arg);S(I,F,D,N)}).addCase(t.rejected,(I,{meta:{condition:F,arg:D,requestId:N},error:$,payload:U})=>{Uo(I,D.queryCacheKey,V=>{if(!F){if(V.requestId!==N)return;V.status="rejected",V.error=U??$}})}).addMatcher(m,(I,F)=>{let{queries:D}=a(F);for(let[N,$]of Object.entries(D))($?.status==="fulfilled"||$?.status==="rejected")&&(I[N]=$)})}}),v=Ut({name:`${e}/mutations`,initialState:bn,reducers:{removeMutationResult:{reducer(O,{payload:I}){let F=wn(I);F in O&&delete O[F]},prepare:ar()}},extraReducers(O){O.addCase(r.pending,(I,{meta:F,meta:{requestId:D,arg:N,startedTimeStamp:$}})=>{N.track&&(I[wn(F)]={requestId:D,status:"pending",endpointName:N.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,(I,{payload:F,meta:D})=>{D.arg.track&&Ml(I,D,N=>{N.requestId===D.requestId&&(N.status="fulfilled",N.data=F,N.fulfilledTimeStamp=D.fulfilledTimeStamp)})}).addCase(r.rejected,(I,{payload:F,error:D,meta:N})=>{N.arg.track&&Ml(I,N,$=>{$.requestId===N.requestId&&($.status="rejected",$.error=F??D)})}).addMatcher(m,(I,F)=>{let{mutations:D}=a(F);for(let[N,$]of Object.entries(D))($?.status==="fulfilled"||$?.status==="rejected")&&N!==$?.requestId&&(I[N]=$)})}}),x=Ut({name:`${e}/invalidation`,initialState:bn,reducers:{updateProvidedBy:{reducer(O,I){var N,$;let{queryCacheKey:F,providedTags:D}=I.payload;for(let U of Object.values(O))for(let V of Object.values(U)){let _=V.indexOf(F);_!==-1&&V.splice(_,1)}for(let{type:U,id:V}of D){let _=(N=O[U]??(O[U]={}))[$=V||"__internal_without_id"]??(N[$]=[]);_.includes(F)||_.push(F)}},prepare:ar()}},extraReducers(O){O.addCase(g.actions.removeQueryResult,(I,{payload:{queryCacheKey:F}})=>{for(let D of Object.values(I))for(let N of Object.values(D)){let $=N.indexOf(F);$!==-1&&N.splice($,1)}}).addMatcher(m,(I,F)=>{var N,$;let{provided:D}=a(F);for(let[U,V]of Object.entries(D))for(let[_,B]of Object.entries(V)){let L=(N=I[U]??(I[U]={}))[$=_||"__internal_without_id"]??(N[$]=[]);for(let z of B)L.includes(z)||L.push(z)}}).addMatcher(Ke(ot(t),ln(t)),(I,F)=>{let D=Kl(F,"providesTags",o,f),{queryCacheKey:N}=F.meta.arg;x.caseReducers.updateProvidedBy(I,x.actions.updateProvidedBy({queryCacheKey:N,providedTags:D}))})}}),k=Ut({name:`${e}/subscriptions`,initialState:bn,reducers:{updateSubscriptionOptions(O,I){},unsubscribeQueryResult(O,I){},internal_getRTKQSubscriptions(){}}}),R=Ut({name:`${e}/internalSubscriptions`,initialState:bn,reducers:{subscriptionsUpdated:{reducer(O,I){return la(O,I.payload)},prepare:ar()}}}),P=Ut({name:`${e}/config`,initialState:{online:SS(),focused:hS(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(O,{payload:I}){O.middlewareRegistered=O.middlewareRegistered==="conflict"||i!==I?"conflict":!0}},extraReducers:O=>{O.addCase(ts,I=>{I.online=!0}).addCase(Gl,I=>{I.online=!1}).addCase(es,I=>{I.focused=!0}).addCase(zl,I=>{I.focused=!1}).addMatcher(m,I=>({...I}))}}),w=tr({queries:g.reducer,mutations:v.reducer,provided:x.reducer,subscriptions:R.reducer,config:P.reducer}),E=(O,I)=>w(y.match(I)?void 0:O,I),M={...P.actions,...g.actions,...k.actions,...R.actions,...v.actions,...x.actions,resetApiState:y};return{reducer:E,actions:M}}var An=Symbol.for("RTKQ/skipToken"),Yl={status:"uninitialized"},Nl=nt(Yl,()=>{}),_l=nt(Yl,()=>{});function jS({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>Nl,o=w=>_l;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:v,selectInvalidatedBy:x,selectCachedArgsForQuery:k,selectApiState:a,selectQueries:m,selectMutations:p,selectQueryEntry:f,selectConfig:y};function i(w){return{...w,...Fl(w.status)}}function a(w){return w[t]}function m(w){return a(w)?.queries}function f(w,E){return m(w)?.[E]}function p(w){return a(w)?.mutations}function y(w){return a(w)?.config}function h(w,E,M){return O=>{if(O===An)return r(n,M);let I=e({queryArgs:O,endpointDefinition:E,endpointName:w});return r(D=>f(D,I)??Nl,M)}}function S(w,E){return h(w,E,i)}function g(w,E){let{infiniteQueryOptions:M}=E;function O(I){let F={...I,...Fl(I.status)},{isLoading:D,isError:N,direction:$}=F,U=$==="forward",V=$==="backward";return{...F,hasNextPage:R(M,F.data),hasPreviousPage:P(M,F.data),isFetchingNextPage:D&&U,isFetchingPreviousPage:D&&V,isFetchNextPageError:N&&U,isFetchPreviousPageError:N&&V}}return h(w,E,O)}function v(){return w=>{let E;return typeof w=="object"?E=wn(w)??An:E=w,r(E===An?o:I=>a(I)?.mutations?.[E]??_l,i)}}function x(w,E){let M=w[t],O=new Set;for(let I of E.filter(Qo).map(Ja)){let F=M.provided[I.type];if(!F)continue;let D=(I.id!==void 0?F[I.id]:Tl(Object.values(F)))??[];for(let N of D)O.add(N)}return Tl(Array.from(O.values()).map(I=>{let F=M.queries[I];return F?[{queryCacheKey:I,endpointName:F.endpointName,originalArgs:F.originalArgs}]:[]}))}function k(w,E){return Object.values(m(w)).filter(M=>M?.endpointName===E&&M.status!=="uninitialized").map(M=>M.originalArgs)}function R(w,E){return E?Za(w,E)!=null:!1}function P(w,E){return!E||!w.getPreviousPageParam?!1:Wl(w,E)!=null}}var Vl=WeakMap?new WeakMap:void 0,Ll=({endpointName:e,queryArgs:t})=>{let r="",n=Vl?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=We(a)?Object.keys(a).sort().reduce((m,f)=>(m[f]=a[f],m),{}):a,a));We(t)&&Vl?.set(t,o),r=o}return`${e}(${r})`};function MS(...e){return function(r){let n=or(p=>r.extractRehydrationInfo?.(p,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(p){let y=Ll;if("serializeQueryArgs"in p.endpointDefinition){let h=p.endpointDefinition.serializeQueryArgs;y=S=>{let g=h(S);return typeof g=="string"?g:Ll({...S,queryArgs:g})}}else r.serializeQueryArgs&&(y=r.serializeQueryArgs);return y(p)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(p){p()},apiUid:oo(),extractRehydrationInfo:n,hasRehydrationInfo:or(p=>n(p)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:p,endpoints:y}){if(p)for(let h of p)o.tagTypes.includes(h)||o.tagTypes.push(h);if(y)for(let[h,S]of Object.entries(y))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},m=e.map(p=>p.init(a,o,i));function f(p){let y=p.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(y)){if(p.overrideExisting!==!0&&h in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error($e(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let g of m)g.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function ut(e,...t){return Object.assign(e,...t)}var NS=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:m}=e.internalActions,f=(g,v)=>{var k,R;if(a.match(v)){let{queryCacheKey:P,requestId:w,options:E}=v.payload;return g?.[P]?.[w]&&(g[P][w]=E),!0}if(m.match(v)){let{queryCacheKey:P,requestId:w}=v.payload;return g[P]&&delete g[P][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete g[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:P,requestId:w}}=v,E=g[k=P.queryCacheKey]??(g[k]={});return E[`${w}_running`]={},P.subscribe&&(E[w]=P.subscriptionOptions??E[w]??{}),!0}let x=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let P=g[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;x||(x=!!P[w]),delete P[w]}if(t.rejected.match(v)){let{meta:{condition:P,arg:w,requestId:E}}=v;if(P&&w.subscribe){let M=g[R=w.queryCacheKey]??(g[R]={});M[E]=w.subscriptionOptions??M[E]??{},x=!0}}return x},p=()=>r.currentSubscriptions,S={getSubscriptions:p,getSubscriptionCount:g=>{let x=p()[g]??{};return kr(x)},isRequestSubscribed:(g,v)=>!!p()?.[g]?.[v]};return(g,v)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let x=f(r.currentSubscriptions,g),k=!0;if(x){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=Xn(o,()=>w);v.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let R=typeof g.type=="string"&&!!g.type.startsWith(n),P=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;k=!R&&!P}return[k,!1]}};function _S(e){for(let t in e)return!1;return!0}var VS=2147483647/1e3-1,LS=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:m,unsubscribeQueryResult:f,cacheEntriesUpserted:p}=t.internalActions,y=Ke(f.match,r.fulfilled,r.rejected,p.match);function h(k){let R=o.currentSubscriptions[k];return!!R&&!_S(R)}let S={},g=(k,R,P)=>{let w=R.getState(),E=a(w);if(y(k)){let M;if(p.match(k))M=k.payload.map(O=>O.queryDescription.queryCacheKey);else{let{queryCacheKey:O}=f.match(k)?k.payload:k.meta.arg;M=[O]}v(M,R,E)}if(t.util.resetApiState.match(k))for(let[M,O]of Object.entries(S))O&&clearTimeout(O),delete S[M];if(n.hasRehydrationInfo(k)){let{queries:M}=n.extractRehydrationInfo(k);v(Object.keys(M),R,E)}};function v(k,R,P){let w=R.getState();for(let E of k){let M=i(w,E);x(E,M?.endpointName,R,P)}}function x(k,R,P,w){let M=n.endpointDefinitions[R]?.keepUnusedDataFor??w.keepUnusedDataFor;if(M===1/0)return;let O=Math.max(0,Math.min(M,VS));if(!h(k)){let I=S[k];I&&clearTimeout(I),S[k]=setTimeout(()=>{h(k)||P.dispatch(m({queryCacheKey:k})),delete S[k]},O*1e3)}}return g},Ul=new Error("Promise never resolved before cacheEntryRemoved."),US=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:m}})=>{let f=no(n),p=no(o),y=ot(n,o),h={};function S(R,P,w){let E=h[R];E?.valueResolved&&(E.valueResolved({data:P,meta:w}),delete E.valueResolved)}function g(R){let P=h[R];P&&(delete h[R],P.cacheEntryRemoved())}let v=(R,P,w)=>{let E=x(R);function M(O,I,F,D){let N=a(w,I),$=a(P.getState(),I);!N&&$&&k(O,D,I,P,F)}if(n.pending.match(R))M(R.meta.arg.endpointName,E,R.meta.requestId,R.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(R))for(let{queryDescription:O,value:I}of R.payload){let{endpointName:F,originalArgs:D,queryCacheKey:N}=O;M(F,N,R.meta.requestId,D),S(N,I,{})}else if(o.pending.match(R))P.getState()[t].mutations[E]&&k(R.meta.arg.endpointName,R.meta.arg.originalArgs,E,P,R.meta.requestId);else if(y(R))S(E,R.payload,R.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(R)||e.internalActions.removeMutationResult.match(R))g(E);else if(e.util.resetApiState.match(R))for(let O of Object.keys(h))g(O)};function x(R){return f(R)?R.meta.arg.queryCacheKey:p(R)?R.meta.arg.fixedCacheKey??R.meta.requestId:e.internalActions.removeQueryResult.match(R)?R.payload.queryCacheKey:e.internalActions.removeMutationResult.match(R)?wn(R.payload):""}function k(R,P,w,E,M){let O=r.endpointDefinitions[R],I=O?.onCacheEntryAdded;if(!I)return;let F={},D=new Promise(B=>{F.cacheEntryRemoved=B}),N=Promise.race([new Promise(B=>{F.valueResolved=B}),D.then(()=>{throw Ul})]);N.catch(()=>{}),h[w]=F;let $=e.endpoints[R].select(O.type==="query"?P:w),U=E.dispatch((B,L,z)=>z),V={...E,getCacheEntry:()=>$(E.getState()),requestId:M,extra:U,updateCachedData:O.type==="query"?B=>E.dispatch(e.util.updateQueryData(R,P,B)):void 0,cacheDataLoaded:N,cacheEntryRemoved:D},_=I(P,V);Promise.resolve(_).catch(B=>{if(B!==Ul)throw B})}return v},QS=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},BS=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:m,internalState:f})=>{let{removeQueryResult:p}=i.internalActions,y=Ke(ot(n),ln(n)),h=Ke(ot(n,o),Lt(n,o)),S=[],g=(k,R)=>{y(k)?x(Kl(k,"invalidatesTags",r,a),R):h(k)?x([],R):i.util.invalidateTags.match(k)&&x(os(k.payload,void 0,void 0,void 0,void 0,a),R)};function v(k){let{queries:R,mutations:P}=k;for(let w of[R,P])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function x(k,R){let P=R.getState(),w=P[e];if(S.push(...k),w.config.invalidationBehavior==="delayed"&&v(w))return;let E=S;if(S=[],E.length===0)return;let M=i.util.selectInvalidatedBy(P,E);t.batch(()=>{let O=Array.from(M.values());for(let{queryCacheKey:I}of O){let F=w.queries[I],D=f.currentSubscriptions[I]??{};F&&(kr(D)===0?R.dispatch(p({queryCacheKey:I})):F.status!=="uninitialized"&&R.dispatch(m(F)))}})}return g},$S=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,v)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&p(g.payload,v),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&p(g.meta.arg,v),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&f(g.meta.arg,v),r.util.resetApiState.match(g)&&h()};function m(g,v){let k=v.getState()[e].queries[g],R=o.currentSubscriptions[g];if(!(!k||k.status==="uninitialized"))return R}function f({queryCacheKey:g},v){let x=v.getState()[e],k=x.queries[g],R=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:P,skipPollingIfUnfocused:w}=S(R);if(!Number.isFinite(P))return;let E=i[g];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let M=Date.now()+P;i[g]={nextPollTimestamp:M,pollingInterval:P,timeout:setTimeout(()=>{(x.config.focused||!w)&&v.dispatch(n(k)),f({queryCacheKey:g},v)},P)}}function p({queryCacheKey:g},v){let k=v.getState()[e].queries[g],R=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:P}=S(R);if(!Number.isFinite(P)){y(g);return}let w=i[g],E=Date.now()+P;(!w||E<w.nextPollTimestamp)&&f({queryCacheKey:g},v)}function y(g){let v=i[g];v?.timeout&&clearTimeout(v.timeout),delete i[g]}function h(){for(let g of Object.keys(i))y(g)}function S(g={}){let v=!1,x=Number.POSITIVE_INFINITY;for(let k in g)g[k].pollingInterval&&(x=Math.min(g[k].pollingInterval,x),v=g[k].skipPollingIfUnfocused||v);return{lowestPollingInterval:x,skipPollingIfUnfocused:v}}return a},HS=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=ro(r,n),i=Lt(r,n),a=ot(r,n),m={};return(p,y)=>{if(o(p)){let{requestId:h,arg:{endpointName:S,originalArgs:g}}=p.meta,v=t.endpointDefinitions[S],x=v?.onQueryStarted;if(x){let k={},R=new Promise((M,O)=>{k.resolve=M,k.reject=O});R.catch(()=>{}),m[h]=k;let P=e.endpoints[S].select(v.type==="query"?g:h),w=y.dispatch((M,O,I)=>I),E={...y,getCacheEntry:()=>P(y.getState()),requestId:h,extra:w,updateCachedData:v.type==="query"?M=>y.dispatch(e.util.updateQueryData(S,g,M)):void 0,queryFulfilled:R};x(g,E)}}else if(a(p)){let{requestId:h,baseQueryMeta:S}=p.meta;m[h]?.resolve({data:p.payload,meta:S}),delete m[h]}else if(i(p)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:g}=p.meta;m[h]?.reject({error:p.payload??p.error,isUnhandledError:!S,meta:g}),delete m[h]}}},zS=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,p)=>{es.match(f)&&m(p,"refetchOnFocus"),ts.match(f)&&m(p,"refetchOnReconnect")};function m(f,p){let y=f.getState()[e],h=y.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let v=h[g],x=S[g];if(!x||!v)continue;(Object.values(x).some(R=>R[p]===!0)||Object.values(x).every(R=>R[p]===void 0)&&y.config[p])&&(kr(x)===0?f.dispatch(i({queryCacheKey:g})):v.status!=="uninitialized"&&f.dispatch(n(v)))}})}return a};function GS(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:T(`${t}/invalidateTags`)},m=h=>h.type.startsWith(`${t}/`),f=[QS,LS,BS,$S,US,HS];return{middleware:h=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:y,isThisApiSliceAction:m},x=f.map(P=>P(v)),k=NS(v),R=zS(v);return P=>w=>{if(!zn(w))return P(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:P},M=h.getState(),[O,I]=k(w,E,M),F;if(O?F=P(w):F=I,h.getState()[t]&&(R(w,E,M),m(w)||o.hasRehydrationInfo(w)))for(let D of x)D(w,E,M);return F}},actions:a};function y(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Ql=Symbol(),WS=({createSelector:e=pe}={})=>({name:Ql,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:m,refetchOnFocus:f,refetchOnReconnect:p,invalidationBehavior:y},h){Xc();let S=ee=>(typeof process<"u",ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:ts,onOffline:Gl,onFocus:es,onFocusLost:zl},util:{}});let g=jS({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:x,buildQuerySelector:k,buildInfiniteQuerySelector:R,buildMutationSelector:P}=g;ut(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:x});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,patchQueryData:O,updateQueryData:I,upsertQueryData:F,prefetch:D,buildMatchThunkActions:N}=DS({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:$,actions:U}=qS({context:h,queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:f,refetchOnReconnect:p,refetchOnMountOrArgChange:m,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:y}});ut(t.util,{patchQueryData:O,updateQueryData:I,upsertQueryData:F,prefetch:D,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),ut(t.internalActions,U);let{middleware:V,actions:_}=GS({reducerPath:o,context:h,queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:g});ut(t.util,_),ut(t,{reducer:$,middleware:V});let{buildInitiateQuery:B,buildInitiateInfiniteQuery:L,buildInitiateMutation:z,getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueriesThunk:te,getRunningQueryThunk:se}=OS({queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return ut(t.util,{getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueryThunk:se,getRunningQueriesThunk:te}),{name:Ql,injectEndpoint(ee,re){var ye;let oe=(ye=t.endpoints)[ee]??(ye[ee]={});rs(re)&&ut(oe,{name:ee,select:k(ee,re),initiate:B(ee,re)},N(w,ee)),kS(re)&&ut(oe,{name:ee,select:P(),initiate:z(ee)},N(M,ee)),ns(re)&&ut(oe,{name:ee,select:R(ee,re),initiate:L(ee,re)},N(w,ee))}}}}),Jl=MS(WS());d();c();l();u();var Bo=pe(e=>e.query,e=>e);var g0=pe(e=>Bo(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),KS=pe(e=>e.generatedAnswer?.answerApiQueryParams,e=>e??An);d();c();l();u();d();c();l();u();d();c();l();u();var $o=T("breadcrumb/deselectAll"),Xl=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var Zl=T("facet/updateFacetAutoSelection",e=>Q(e,{allow:new ne({required:!0})}));d();c();l();u();d();c();l();u();var Ho=class extends vt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Ne().q}get responseTime(){return this.activeInstantResultCache?.duration??Ge().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Ge().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var ed=()=>je("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Ho(e)),td=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var is={id:W},YS={...is,q:we},eq=T("instantResults/register",e=>Q(e,is)),zo=T("instantResults/updateQuery",e=>Q(e,YS)),tq=T("instantResults/clearExpired",e=>Q(e,is));d();c();l();u();var Go=new J({required:!0,min:0}),Wo=T("pagination/registerNumberOfResults",e=>Q(e,Go)),Ko=T("pagination/updateNumberOfResults",e=>Q(e,Go)),Yo=T("pagination/registerPage",e=>Q(e,Go)),Fr=T("pagination/updatePage",e=>Q(e,Go)),Jo=T("pagination/nextPage"),Xo=T("pagination/previousPage");d();c();l();u();var Or=T("query/updateQuery",e=>Q(e,{q:new H,enableQuerySyntax:new ne}));d();c();l();u();d();c();l();u();var Zo=(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:yr(e)}});var Tr=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Zo(e.configuration.analytics,t,r)),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();var At=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Xe.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Mo(e.configuration.analytics,t))),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function At(_x48,_x49){return _ref21.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Ct=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var as=()=>je("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),wt=e=>je("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ne().q,aq:r.advancedSearchQueries?.aq||Ct().aq,cq:r.advancedSearchQueries?.cq||Ct().cq,dq:r.advancedSearchQueries?.dq||Ct().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var Rn=Qe(ei(),1),sd=Qe(rd(),1);d();c();l();u();var ti=Qe(ei(),1),od=Qe(nd(),1);ti.default.extend(od.default);var id="YYYY/MM/DD@HH:mm:ss",JS="1401-01-01";function Dr(e,t){let r=(0,ti.default)(e,t);return!r.isValid()&&!t?(0,ti.default)(e,id):r}function ri(e){return e.format(id)}function ad(e,t){let r=Dr(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}fs(r)}function fs(e){if(e.isBefore(JS))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Rn.default.extend(sd.default);var cd=["past","now","next"],ud=["minute","hour","day","week","month","quarter","year"],XS=e=>{let t=e==="now";return{amount:new J({required:!t,min:1}),unit:new H({required:!t,constrainTo:ud}),period:new H({required:!0,constrainTo:cd})}};function ms(e){if(typeof e=="string"&&!Rt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?md(e):e;new Fe(XS(t.period)).validate(t);let r=dd(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);fs(r)}function ld(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function dd(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Rn.default)().subtract(r,n);case"next":return(0,Rn.default)().add(r,n);case"now":return(0,Rn.default)()}}function xn(e){return ri(dd(md(e)))}function pd(e){return e.toLocaleLowerCase().split("-")}function Rt(e){let[t,r,n]=pd(e);if(t==="now")return!0;if(!cd.includes(t)||!ud.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function fd(e){return!!e&&typeof e=="object"&&"period"in e}function md(e){let[t,r,n]=pd(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}d();c();l();u();function gd(e){return e.type==="dateRange"}function yd(e){return`start${e}`}function hd(e){return`end${e}`}var gs=()=>({dateFacetValueMap:{}});function ZS(e,t,r){let n=e.start,o=e.end;return Rt(n)&&(n=xn(n),r.dateFacetValueMap[t][yd(n)]=e.start),Rt(o)&&(o=xn(o),r.dateFacetValueMap[t][hd(o)]=e.end),{...e,start:n,end:o}}function ys(e,t){if(gd(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>ZS(o,r,t))}}return e}function xt(e){let t=gs();return{request:{...e,facets:e.facets?.map(n=>ys(n,t))},mappings:t}}function ev(e,t,r){return{...e,start:r.dateFacetValueMap[t][yd(e.start)]||e.start,end:r.dateFacetValueMap[t][hd(e.end)]||e.end}}function tv(e,t){return e.facetId in t.dateFacetValueMap}function rv(e,t){return tv(e,t)?{...e,values:e.values.map(r=>ev(r,e.facetId,t))}:e}function ni(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>rv(n,t))}}:e}d();c();l();u();d();c();l();u();var $j=T("didYouMean/enable"),Hj=T("didYouMean/disable"),zj=T("didYouMean/automaticCorrections/disable"),Gj=T("didYouMean/automaticCorrections/enable"),oi=T("didYouMean/correction",e=>Q(e,W)),Wj=T("didYouMean/automaticCorrections/mode",e=>Q(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var hs=()=>je("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Sd=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function ii(){return{contextValues:{}}}d();c();l();u();function ai(){return{contextValues:{}}}d();c();l();u();function vd(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function bd(){return[]}d();c();l();u();function En(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Ad(){return{}}d();c();l();u();function Cd(){return{}}d();c();l();u();function wd(){return{}}function et(e){return{context:e.context||ii(),dictionaryFieldContext:e.dictionaryFieldContext||ai(),facetSet:e.facetSet||qo(),numericFacetSet:e.numericFacetSet||Do(),dateFacetSet:e.dateFacetSet||To(),categoryFacetSet:e.categoryFacetSet||Oo(),automaticFacetSet:e.automaticFacetSet??Fo(),pagination:e.pagination||En(),query:e.query||Ne(),tabSet:e.tabSet||wd(),advancedSearchQueries:e.advancedSearchQueries||Ct(),staticFilterSet:e.staticFilterSet||Cd(),querySet:e.querySet||Ad(),sortCriteria:e.sortCriteria||jo(),pipeline:e.pipeline||pr(),searchHub:e.searchHub||Cr(),facetOptions:e.facetOptions||vd(),facetOrder:e.facetOrder??bd(),debug:e.debug??lo()}}d();c();l();u();var bN=new K({values:{undoneQuery:we},options:{required:!0}}),Rd=()=>je("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var si=T("trigger/query/ignore",e=>Q(e,new H({emptyAllowed:!0,required:!0}))),ci=T("trigger/query/modification",e=>Q(e,new K({values:{originalQuery:Ce,modification:Ce}})));d();c();l();u();d();c();l();u();d();c();l();u();function Et(e){return Object.values(e).map(t=>t.request)}function Ss(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function xd(e){return Et(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var vs={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function nv(e){return Et(e).map(t=>{let r=vs[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ov(e){return[...nv(e.facetSet??{}),...xd(e.numericFacetSet??{}),...xd(e.dateFacetSet??{}),...Et(e.categoryFacetSet??{})]}function iv(e){return ov(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function ui(e){return Ss(iv(e),e.facetOrder??[])}d();c();l();u();var It=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){let r=cv(e),n=ui(e),o=av(e),i=yield At(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return xt({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function It(_x50,_x51){return _ref22.apply(this,arguments)}}();function av(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(sv).filter(r=>r.currentValues.length>0):void 0}function sv(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function cv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=uv(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function uv(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var kt=class{constructor(t,r=n=>{this.dispatch(Or({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x52,_x53){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=ni(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(wt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let p=a.length===0&&m&&m.length!==0,y=!X(f)&&!X(f.correctedQuery);if(!p&&!y)return null;let S=p?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(Je(et(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this13.dispatch(wt(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(Je(et(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:hs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:hs()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(si("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this14.dispatch(wt(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(Je(et(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Rd()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ne().enableQuerySyntax},search:{...Ge(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Je(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield It(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(oi(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(ci({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield It(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var M_=ue("search/executeSearch",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=t.getState();return yield li(r,t,e)});return function(_x54,_x55){return _ref23.apply(this,arguments)}}()),N_=ue("search/fetchPage",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield As(r,t,e)});return function(_x56,_x57){return _ref24.apply(this,arguments)}}()),__=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Cs(t,r)});return function(_x58,_x59){return _ref25.apply(this,arguments)}}()),V_=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield fv(t,e,r)});return function(_x60,_x61){return _ref26.apply(this,arguments)}}()),L_=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){return bs(e,t)});return function(_x62,_x63){return _ref27.apply(this,arguments)}}()),lv=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=yield It(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function lv(_x64,_x65){return _ref28.apply(this,arguments)}}(),dv=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t,r){let n=yield At(e);return xt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function dv(_x66,_x67,_x68){return _ref29.apply(this,arguments)}}(),pv=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=yield It(e,t);return r.request.numberOfResults=0,r});return function pv(_x69,_x70){return _ref30.apply(this,arguments)}}(),Ed=e=>{e.configuration.analytics.enabled&&Xe.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function bs(_x71,_x72){return _bs.apply(this,arguments)}function _bs(){_bs=_asyncToGenerator(function*(e,t){Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new kt({...t,analyticsAction:ed()},p=>{t.dispatch(zo({q:p,id:e.id}))}),a=yield dv(o,r,n),m=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(m);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _bs.apply(this,arguments)}function As(_x73,_x74,_x75){return _As.apply(this,arguments)}function _As(){_As=_asyncToGenerator(function*(e,t,r){Ed(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new kt({...t,analyticsAction:r}),f=yield It(e,a),p=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(p)});return _As.apply(this,arguments)}function Cs(_x76,_x77){return _Cs.apply(this,arguments)}function _Cs(){_Cs=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield as().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new kt({...e,analyticsAction:as()}),m=yield lv(t,i),f=yield a.fetchFromAPI(m,{origin:"mainSearch"});return yield a.process(f)});return _Cs.apply(this,arguments)}function fv(_x78,_x79,_x80){return _fv.apply(this,arguments)}function _fv(){_fv=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new kt({...e,analyticsAction:t}),f=yield pv(r,a),p=yield m.fetchFromAPI(f,{origin:"facetValues"});return yield m.process(p)});return _fv.apply(this,arguments)}function li(_x81,_x82,_x83){return _li.apply(this,arguments)}function _li(){_li=_asyncToGenerator(function*(e,t,r){Ed(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i});a?.actionCause&&t.dispatch(In({actionCause:a.actionCause}));let m=yield It(e,a),f=new kt({...t,analyticsAction:r}),p=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(p)});return _li.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var Id=pe(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Pt=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t,r){let n=Rs(e),o=mv(e),i=gv(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield At(e,r):Tr(e,t,r);return xt({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:ws(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Pt(_x84,_x85,_x86){return _ref31.apply(this,arguments)}}();function ws(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function mv(e){return Ss(hv(e),e.facetOrder??[])}function gv(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(yv).filter(r=>r.currentValues.length>0):void 0}function yv(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function hv(e){return Sv(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Sv(e){return[...vv(e.facetSet??{}),...kd(e.numericFacetSet??{}),...kd(e.dateFacetSet??{}),...Et(e.categoryFacetSet??{})]}function vv(e){return Et(e).map(t=>{let r=vs[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function kd(e){return Et(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Rs(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Id(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}var Ft=class{constructor(t,r=n=>{this.dispatch(Or({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x87,_x88){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=ni(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(wt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let p=a.length===0&&m&&m.length!==0,y=!X(f)&&!X(f.correctedQuery);if(!p&&!y)return null;let S=p?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(Je(et(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this20.dispatch(wt(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(Je(et(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(si("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this21.dispatch(wt(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(Je(et(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Je(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Sd(),o=yield _this22.fetchFromAPI(yield Pt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(oi(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(ci({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Pt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var BV=ue("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;Q(e,{q:new H,enableQuerySyntax:new ne,clearFilters:new ne}),e.clearFilters&&(r($o()),r(Xl())),r(Zl({allow:!0})),r(Or({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Fr(1))}),In=T("search/updateSearchAction"),Pd=ue("search/executeSearch",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return li(r,t,e.legacy);Fd(r);let n=e.next?Od(e.next):void 0;t.dispatch(In(e.next));let o=yield Pt(r,t.extra.navigatorContext,n),i=new Ft({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x89,_x90){return _ref32.apply(this,arguments)}}()),$V=ue("search/fetchPage",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(Fd(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return As(r,t,e.legacy);let n=new Ft({...t,analyticsAction:e.next}),o=yield Pt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x91,_x92){return _ref33.apply(this,arguments)}}()),HV=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Cs(t,r);let n=Rl("browseResults",t.getState),o=new Ft({...t,analyticsAction:n}),i=yield bv(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x93,_x94){return _ref34.apply(this,arguments)}}()),zV=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return li(r,t,e.legacy);let n=new Ft({...t,analyticsAction:{}}),o=yield Cv(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x95,_x96){return _ref35.apply(this,arguments)}}()),GV=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return bs(e,t);Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:n,maxResultsPerQuery:o}=e,i=Od(td()),a=yield Av(r,t.extra.navigatorContext,n,o,i),m=new Ft({...t,analyticsAction:i},y=>{t.dispatch(zo({q:y,id:e.id}))}),f=yield m.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),p=yield m.process(f);return"response"in p?{results:p.response.results,searchUid:p.response.searchUid,totalCountFiltered:p.response.totalCountFiltered,duration:p.duration}:p});return function(_x97,_x98){return _ref36.apply(this,arguments)}}()),bv=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t,r){let n=yield Pt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function bv(_x99,_x100,_x101){return _ref37.apply(this,arguments)}}(),Av=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r,n,o){let i=Tr(e,t,o);return xt({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function Av(_x102,_x103,_x104,_x105,_x106){return _ref38.apply(this,arguments)}}(),Cv=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r){let n=yield Pt(e,t,r);return n.request.numberOfResults=0,n});return function Cv(_x107,_x108,_x109){return _ref39.apply(this,arguments)}}(),Fd=e=>{e.configuration.analytics.enabled&&Xe.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Od=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();var di=e=>je({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ar(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ar(t)??"",answerGenerated:e??!1})});d();c();l();u();d();c();l();u();var Td=pe(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})}});d();c();l();u();var Dd=pe(e=>e.context,e=>e);d();c();l();u();var qd=pe(e=>e.pipeline,e=>e);d();c();l();u();d();c();l();u();var kn=(e,t)=>{let r=e;return X(r[t])?X(e.raw[t])?null:e.raw[t]:r[t]},wv=e=>t=>e.every(r=>!X(kn(t,r))),Rv=e=>t=>e.every(r=>X(kn(t,r))),xv=(e,t)=>r=>{let n=jd(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},Ev=(e,t)=>r=>{let n=jd(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},jd=(e,t)=>{let r=kn(t,e);return Sc(r)?r:[r]},Md={getResultProperty:kn,fieldsMustBeDefined:wv,fieldsMustNotBeDefined:Rv,fieldMustMatch:xv,fieldMustNotMatch:Ev};var Nd=pe(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();var _d=pe(e=>e.searchHub,e=>e);d();c();l();u();var xs=pe(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),WL=pe(e=>e,e=>{let t=xs(e);return t&&e?e[t].expression:""});var Vd=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ke(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Vd(_x110){return _ref40.apply(this,arguments)}}(),Ld=(e,t)=>{let r=Bo(e)?.q,{aq:n,cq:o,dq:i,lq:a}=kv(e),m=Dd(e),f=Zo(e.configuration.analytics,t,{actionCause:Nd(e)}),p=_d(e),y=qd(e),h=il(e)??[],S=Iv(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:h}},...(p?.length&&{searchHub:p}),...(y?.length&&{pipeline:y}),...(Object.keys(S).length&&{facets:S}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:ws(e),firstResult:e.pagination.firstResult}),tab:xs(e.tabSet),...f}},Iv=e=>({...ui(e)?.map(t=>ys(t,gs())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0)}),kv=e=>{let t=Td(e),r=Rs(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Ud=["text/plain","text/markdown"];var qr=new H({required:!0}),Bd=new H,jr=new ne({required:!0}),Pv={id:qr,title:qr,uri:qr,permanentid:qr,clickUri:Bd},$d=new H({required:!0,constrainTo:Ud}),OU=T("generatedAnswer/setIsVisible",e=>Q(e,jr)),TU=T("generatedAnswer/setIsEnabled",e=>Q(e,jr)),Is=T("generatedAnswer/updateMessage",e=>Q(e,{textDelta:qr})),ks=T("generatedAnswer/updateCitations",e=>Q(e,{citations:new ie({required:!0,each:new K({values:Pv})})})),Fv=T("generatedAnswer/updateError",e=>Q(e,{message:Bd,code:new J({min:0})})),Hd=T("generatedAnswer/resetAnswer"),DU=T("generatedAnswer/like"),qU=T("generatedAnswer/dislike"),jU=T("generatedAnswer/feedbackModal/open"),MU=T("generatedAnswer/expand"),NU=T("generatedAnswer/collapse"),_U=T("generatedAnswer/setId",e=>Q(e,{id:new H({required:!0})})),VU=T("generatedAnswer/feedbackModal/close"),LU=T("generatedAnswer/sendFeedback"),Es=T("generatedAnswer/setIsLoading",e=>Q(e,jr)),Qd=T("generatedAnswer/setIsStreaming",e=>Q(e,jr)),Ps=T("generatedAnswer/setAnswerContentFormat",e=>Q(e,$d)),UU=T("generatedAnswer/updateResponseFormat",e=>Q(e,{contentFormat:new ie({each:$d,default:["text/plain"]})})),QU=T("knowledge/updateAnswerConfigurationId",e=>Q(e,qr)),BU=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>Q(e,io)),Ov=T("generatedAnswer/setIsAnswerGenerated",e=>Q(e,jr)),Fs=T("generatedAnswer/setCannotAnswer",e=>Q(e,jr)),Tv=T("generatedAnswer/setAnswerApiQueryParams",e=>Q(e,new K({}))),$U=ue("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:m}=a,{setAbortControllerRef:f}=e,p=yield Vd(r),y=(g,v)=>{switch(g){case"genqa.headerMessageType":{let x=JSON.parse(v);n(Ps(x.contentFormat));break}case"genqa.messageType":n(Is(JSON.parse(v)));break;case"genqa.citationsType":n(ks(JSON.parse(v)));break;case"genqa.endOfStreamType":{let x=JSON.parse(v).answerGenerated,k=m.length!==0&&!x;n(Fs(k)),n(Qd(!1)),n(Ov(x)),n(di(x));break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Es(!0));let h=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(p,{write:g=>{h(p)&&(n(Es(!1)),g.payload&&g.payloadType&&y(g.payloadType,g.payload))},abort:g=>{h(p)&&n(Fv(g))},close:()=>{h(p)&&n(Qd(!1))},resetAnswer:()=>{h(p)&&n(Hd())}});S?f(S):n(Es(!1))});return function(_x111,_x112){return _ref41.apply(this,arguments)}}()),HU=ue("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){let i=t();if(i.generatedAnswer.answerConfigurationId){let a=Ld(i,n);r(Hd()),r(Tv(a)),yield r(zd(a)),r(In(void 0))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x113,_x114){return _ref42.apply(this,arguments)}}());d();c();l();u();d();c();l();u();function Wd(_x115,_x116){return _Wd.apply(this,arguments)}function _Wd(){_Wd=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Wd.apply(this,arguments)}function Kd(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=qv(t,a);let m=t.length,f=0;for(;r<m;){o&&(t[r]===10&&(f=++r),o=!1);let p=-1;for(;r<m&&p===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,p=r;break;case 10:p=r;break}if(p===-1)break;e(t.subarray(f,p),n),f=r,n=-1}f===m?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function Yd(e,t,r){let n=Gd(),o=new TextDecoder;return function(a,m){if(a.length===0)r?.(n),n=Gd();else if(m>0){let f=o.decode(a.subarray(0,m)),p=m+(a[m+1]===32?2:1),y=o.decode(a.subarray(p));switch(f){case"data":n.data=n.data?`${n.data}
|
|
30
|
+
`;function ih(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var ah=["1",1,"yes",!0];function Ro(){let e=[];return ba()&&e.push(window.doNotTrack),Da()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>ah.indexOf(t)!==-1)}var Ju="v15",Xu={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function sh(e=Xu.default,t=Ju,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var ch="38824e1f-37f5-42d3-8372-a4b8fa9df946",Ze=class{get defaultOptions(){return{endpoint:Xu.default,isCustomEndpoint:!1,token:"",version:Ju,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Gu}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[Yg,Hg].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Ro()?this.runtime=new wo:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ae.view,{newEventType:ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(ae.click,{newEventType:ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(ae.custom,{newEventType:ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ae.search,{newEventType:ae.search,addClientIdParameter:!0})}initRuntime(t){return ba()&&hr()?new Oa(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(ih()&&console.warn(oh),new Ta(t))}get storage(){return this.runtime.storage}determineVisitorId(){return q(this,void 0,void 0,function*(){try{return ba()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Bt()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Bt()}})}getCurrentVisitorId(){return q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return q(this,void 0,void 0,function*(){if(vo(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(qu(t,qu(r,ch)))}})}getParameters(t,...r){return q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Bt()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Ro())return null;try{let r=new URL(t).searchParams.get(St.cvo_cid);if(r==null)return null;let n=St.fromString(r);return!n||!hr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>q(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((v,x)=>q(this,void 0,void 0,function*(){let k=yield v;return yield x(t,k)}),g)].reduce((g,v)=>q(this,void 0,void 0,function*(){let x=yield g;return yield v(x)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?Wy(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>q(this,void 0,void 0,function*(){let g=yield h;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(m=>m(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new So().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.search,t)})}sendSearchEvent(t){var{searchQueryUid:r}=t,n=at(t,["searchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.click,t)})}sendClickEvent(t){var{searchQueryUid:r}=t,n=at(t,["searchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.custom,t)})}sendCustomEvent(t){var{lastSearchQueryUid:r}=t,n=at(t,["lastSearchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.view,t)})}sendViewEvent(t){return q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return q(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return q(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Xy(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=at(t,["custom"]),o={};r&&ho(r)&&(o=this.lowercaseKeys(r));let i=Zy(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=at(t,["custom"]);if(r&&ho(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=at(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ae.view||r==ae.click||r==ae.search||r==ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=at(t,["userId"]);return nh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=at(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&ho(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&ho(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?dy(t,r):t}get baseUrl(){return sh(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},st;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(st||(st={}));var j;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(j||(j={}));var Uu={[j.triggerNotify]:"queryPipelineTriggers",[j.triggerExecute]:"queryPipelineTriggers",[j.triggerQuery]:"queryPipelineTriggers",[j.triggerRedirect]:"queryPipelineTriggers",[j.queryError]:"errors",[j.queryErrorBack]:"errors",[j.queryErrorClear]:"errors",[j.queryErrorRetry]:"errors",[j.pagerNext]:"getMoreResults",[j.pagerPrevious]:"getMoreResults",[j.pagerNumber]:"getMoreResults",[j.pagerResize]:"getMoreResults",[j.pagerScrolling]:"getMoreResults",[j.facetSearch]:"facet",[j.facetShowLess]:"facet",[j.facetShowMore]:"facet",[j.recommendation]:"recommendation",[j.likeSmartSnippet]:"smartSnippet",[j.dislikeSmartSnippet]:"smartSnippet",[j.expandSmartSnippet]:"smartSnippet",[j.collapseSmartSnippet]:"smartSnippet",[j.openSmartSnippetFeedbackModal]:"smartSnippet",[j.closeSmartSnippetFeedbackModal]:"smartSnippet",[j.sendSmartSnippetReason]:"smartSnippet",[j.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.clearRecentQueries]:"recentQueries",[j.recentResultClick]:"recentlyClickedDocuments",[j.clearRecentResults]:"recentlyClickedDocuments",[j.showLessFoldedResults]:"folding",[j.caseDetach]:"case",[j.likeGeneratedAnswer]:"generatedAnswer",[j.dislikeGeneratedAnswer]:"generatedAnswer",[j.openGeneratedAnswerSource]:"generatedAnswer",[j.generatedAnswerStreamEnd]:"generatedAnswer",[j.generatedAnswerSourceHover]:"generatedAnswer",[j.generatedAnswerCopyToClipboard]:"generatedAnswer",[j.generatedAnswerHideAnswers]:"generatedAnswer",[j.generatedAnswerShowAnswers]:"generatedAnswer",[j.generatedAnswerExpand]:"generatedAnswer",[j.generatedAnswerCollapse]:"generatedAnswer",[j.generatedAnswerFeedbackSubmit]:"generatedAnswer",[j.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[st.expandToFullUI]:"interface",[st.openUserActions]:"User Actions",[st.showPrecedingSessions]:"User Actions",[st.showFollowingSessions]:"User Actions",[st.clickViewedDocument]:"User Actions",[st.clickPageView]:"User Actions",[st.createArticle]:"createArticle"},br=class{constructor(){this.runtime=new wo,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Gu}};function uh(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function lh(e){return e.map(t=>t.replace(/;/g,""))}function Zu(e){let r=e.join(";");return r.length<=256?r:Zu(e.slice(1))}var Qu=e=>{let t=lh(e),r=uh(t);return Zu(r)};function Bu(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Qu(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Qu(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var xo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Ro();this.coveoAnalyticsClient=n?new br:new Ze(t)}disable(){this.coveoAnalyticsClient=new br}enable(){this.coveoAnalyticsClient=new Ze(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(j.interfaceLoad)}logInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(j.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(j.recommendation)}logRecommendation(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(j.recommendationOpen,t,r)}logRecommendationOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(j.staticFilterClearAll,t)}logStaticFilterClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(j.staticFilterSelect,t)}logStaticFilterSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(j.staticFilterDeselect,t)}logStaticFilterDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(j.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(j.interfaceChange,t)}logInterfaceChange(t){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(j.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(j.didyoumeanClick)}logDidYouMeanClick(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(j.resultsSort,t)}logResultsSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(j.searchboxSubmit)}logSearchboxSubmit(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(j.searchboxClear)}logSearchboxClear(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(j.searchboxAsYouType)}logSearchboxAsYouType(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(j.breadcrumbFacet,t)}logBreadcrumbFacet(t){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(j.breadcrumbResetAll)}logBreadcrumbResetAll(){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(j.documentQuickview,t,r)}logDocumentQuickview(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(j.documentOpen,t,r)}logDocumentOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(j.omniboxAnalytics,Bu(t))}logOmniboxAnalytics(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(j.omniboxFromLink,Bu(t))}logOmniboxFromLink(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(j.searchFromLink)}logSearchFromLink(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(j.triggerNotify,t)}logTriggerNotify(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(j.triggerExecute,t)}logTriggerExecute(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(j.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(j.undoTriggerQuery,t)}logUndoTriggerQuery(t){return q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(j.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(j.pagerResize,t)}logPagerResize(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(j.pagerNumber,t)}logPagerNumber(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(j.pagerNext,t)}logPagerNext(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(j.pagerPrevious,t)}logPagerPrevious(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(j.pagerScrolling)}logPagerScrolling(){return q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(j.facetClearAll,t)}logFacetClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(j.facetSearch,t)}logFacetSearch(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(j.facetSelect,t)}logFacetSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(j.facetDeselect,t)}logFacetDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(j.facetExclude,t)}logFacetExclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(j.facetUnexclude,t)}logFacetUnexclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(j.facetSelectAll,t)}logFacetSelectAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(j.facetUpdateSort,t)}logFacetUpdateSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(j.facetShowMore,t)}logFacetShowMore(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(j.facetShowLess,t)}logFacetShowLess(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(j.queryError,t)}logQueryError(t){return q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorBack);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorBack)})}})}logQueryErrorBack(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorRetry);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorRetry)})}})}logQueryErrorRetry(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorClear);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorClear)})}})}logQueryErrorClear(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(j.likeSmartSnippet)}logLikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(j.dislikeSmartSnippet)}logDislikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(j.expandSmartSnippet)}logExpandSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(j.collapseSmartSnippet)}logCollapseSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(j.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(j.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(j.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(j.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(j.copyToClipboard,t,r)}logCopyToClipboard(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(j.recentQueryClick)}logRecentQueryClick(){return q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(j.clearRecentQueries)}logClearRecentQueries(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(j.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(j.clearRecentResults)}logClearRecentResults(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(j.noResultsBack)}logNoResultsBack(){return q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(j.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(j.showLessFoldedResults)}logShowLessFoldedResults(){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r,n=Uu[t]){return q(this,void 0,void 0,function*(){this.coveoAnalyticsClient.getParameters;let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:n,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r,n=Uu[t]){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({lastSearchQueryUid:m})}})}logCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:m})=>a.log({searchQueryUid:m})}})}logClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){var n,o;return q(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(j.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(j.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(j.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(j.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(j.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(j.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(j.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(j.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(j.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(j.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(j.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(j.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(j.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Eo=Object.assign({},dn),$u=Object.keys(Eo).map(e=>Eo[e]),Sr=class extends wa{constructor({client:t,uuidGenerator:r=Bt}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>$u.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>($u.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Eo.pageview,{newEventType:ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Eo.event,{newEventType:ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return yy(this.ticket)}};Sr.Id="svc";var Io;(function(e){e.click="click",e.flowStart="flowStart"})(Io||(Io={}));var Le;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(Le||(Le={}));var ko;(function(e){e.quit="Quit",e.solved="Solved"})(ko||(ko={}));var Po=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Ro();this.coveoAnalyticsClient=o?new Ze(t):new br,this.svc=new Sr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new br,this.svc=new Sr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Ze(this.options),this.svc=new Sr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Le.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Le.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Le.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Le.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Le.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Le.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Le.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Le.caseCancelled,{reason:ko.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Le.caseSolved,{reason:ko.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Le.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Io.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Io.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){var r,n;return q(this,void 0,void 0,function*(){let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){var i,a;return q(this,void 0,void 0,function*(){let m=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(m)})}};var el=e=>new Ze(e).getCurrentVisitorId(),mn=(e,t)=>typeof t=="function"?(...r)=>{let n=Kr(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,gn=(e,t)=>(...r)=>{let n=Kr(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Fo(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();d();c();l();u();function tl(e){let{activeValue:t,ancestryMap:r}=dh(e);return t?ph(t,r):[]}function dh(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function ph(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var fh=(e,t)=>e.categoryFacetSet[t]?.request;var Ma=(e,t)=>{let r=fh(e,t);return tl(r?.currentValues??[])};d();c();l();u();function Oo(){return{}}d();c();l();u();function To(){return{}}d();c();l();u();function Do(){return{}}d();c();l();u();function qo(){return{}}function Na(e){return{facetSet:e.facetSet??qo(),categoryFacetSet:e.categoryFacetSet??Oo(),dateFacetSet:e.dateFacetSet??To(),numericFacetSet:e.numericFacetSet??Do(),automaticFacetSet:e.automaticFacetSet??Fo()}}var _a=e=>{let t=[];return yh(e).forEach((r,n)=>{let o=Rh(e,r.facetId),i=Ch(r,n+1);if(gh(r)){if(!!!Ma(e,r.facetId).length)return;t.push({...i,...bh(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,m)=>{if(a.state==="idle")return;let f=rl(a,m+1,o),p=mh(r)?nl(a):Sh(a);t.push({...i,...f,...p})})}),hh(e).forEach((r,n)=>{let o=Ah(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let m=rl(i,a+1,"specific"),f=nl(i);t.push({...o,...m,...f})})}),t},mh=e=>e.type==="specific",gh=e=>e.type==="hierarchical",yh=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),hh=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),rl=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),Sh=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),nl=e=>({displayValue:e.value,value:e.value}),vh=(e,t)=>Ma(e,t).map(n=>n.value).join(";"),bh=(e,t)=>{let n=vh(e,t);return{value:n,valuePosition:1,displayValue:n}},Ah=(e,t)=>({title:ol(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),Ch=(e,t)=>({title:ol(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),ol=(e,t)=>`${e}_${t}`,wh=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Rh=(e,t)=>{let r=wh(e,t);return r?r.type:"specific"};d();c();l();u();var Ar=e=>{if(xh(e)){let t=Object.values(e.answer.queries).pop()?.data;return typeof t=="object"&&t!==null&&"answerId"in t?t.answerId:void 0}if(Eh(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},xh=e=>"answer"in e&&"generatedAnswer"in e&&!X(e.generatedAnswer?.answerConfigurationId),Eh=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",il=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Ih=pe(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var Ne=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();var al=(r=>(r.Ascending="ascending",r.Descending="descending",r))(al||{}),sl=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(sl||{}),Va=e=>{if(hc(e))return e.map(t=>Va(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},cl=()=>({by:"relevancy"});var FP=new K({values:{by:new Vi({enum:sl,required:!0}),order:new Vi({enum:al}),field:new H}});function jo(){return Va(cl())}d();c();l();u();d();c();l();u();var Cr=()=>"default";var kh=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},ct=class{constructor(t){this.getState=t;de(this,"state");this.state=t()}getLanguage(){return kh(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let m=`context_${i}`;o[m]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=sr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Cr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var yn=class yn extends ct{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return _a(Na(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||yn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||Ge().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||yn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ar(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??jo()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(p=>p.expression),a=o.partialQueries.length-1,m=o.partialQueries[a]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:m,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||Ne().q}get responseTime(){return this.state.search?.duration||Ge().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Ge().response.totalCountFiltered}};de(yn,"fallbackPipelineName","default");var vt=yn,ul=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new xo({token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return p||y.disable(),y},La=()=>{let t=Xe.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Mo=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield el(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(La()&&{pageId:La()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:yr(e)})}}});return function Mo(_x0,_x1){return _ref7.apply(this,arguments)}}();d();c();l();u();d();c();l();u();d();c();l();u();var wr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var hn=class extends ct{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ne().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||wr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||wr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||wr().recommendations.length}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ll=/^(?:[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 Ph(e){return typeof e=="string"&&ll.test(e)}var Ua=Ph;d();c();l();u();var xe=[];for(let e=0;e<256;++e)xe.push((e+256).toString(16).slice(1));function dl(e,t=0){return(xe[e[t+0]]+xe[e[t+1]]+xe[e[t+2]]+xe[e[t+3]]+"-"+xe[e[t+4]]+xe[e[t+5]]+"-"+xe[e[t+6]]+xe[e[t+7]]+"-"+xe[e[t+8]]+xe[e[t+9]]+"-"+xe[e[t+10]]+xe[e[t+11]]+xe[e[t+12]]+xe[e[t+13]]+xe[e[t+14]]+xe[e[t+15]]).toLowerCase()}d();c();l();u();var Qa,Fh=new Uint8Array(16);function Ba(){if(!Qa){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Qa=crypto.getRandomValues.bind(crypto)}return Qa(Fh)}d();c();l();u();d();c();l();u();var Oh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$a={randomUUID:Oh};function Th(e,t,r){if($a.randomUUID&&!t&&!e)return $a.randomUUID();e=e||{};let n=e.random??e.rng?.()??Ba();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 dl(n)}var Ha=Th;d();c();l();u();function pl(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Dh({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var fl="visitorId";function qh(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(fl),o=n&&Ua(n)?n:t.generateUUID();return r.setItem(fl,o),o}}}var Sl="1.2.7",za=128,vl=192,ml=224,gl=240,jh=248;function Mh(e){return(e&jh)===gl?4:(e&gl)===ml?3:(e&ml)===vl?2:1}function Nh(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&za)!=za)break;if(r-=3,(n&vl)!=za){t-r>=Mh(n)*3&&(r=t);break}}return e.substring(0,r)}function _h(e){let{trackingId:t}=e;return{trackingId:t}}function Vh(e){return(e.source||[]).concat([`relay@${Sl}`])}function bl(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,m=_h(t),f=n.getClientId();return Object.freeze({type:e,config:m,ts:Date.now(),source:Vh(t),clientId:f,userAgent:a(),referrer:yl(o()),location:yl(i())})}function yl(e){return e!==null?Nh(e,1024):null}function Lh(e,t,r,n,o){return{...t,meta:bl(e,r,n,o)}}var Uh="*";function Qh(){let e=[];function t({type:f,callback:p}){return e.findIndex(y=>y.type===f&&y.callback===p)}function r(f,p){return f.type==="*"||p===f.type}function n(f){return t(f)<0&&e.push(f),()=>m(f.type,f.callback)}function o(f){e.forEach(p=>{if(r(p,f.meta.type))try{p.callback(f)}catch(y){console.error(y)}})}function i(f){if(f===Uh)e.length=0;else for(let p=e.length-1;p>=0;p--)e[p].type===f&&e.splice(p,1)}function a(f){let p=t(f);p>=0&&e.splice(p,1)}function m(f,p){p?a({type:f,callback:p}):i(f)}return{add:n,call:o,remove:m}}function hl({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 Bh(e){let t=hl(e);return{get:()=>t,update:r=>{t=hl({...t,...r})}}}var Ga=$h();function $h(){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 a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,m=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${m};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Hh(){return{getItem(e){return Ga.getItem(e)||localStorage.getItem(e)},removeItem(e){Ga.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ga.setItem(e,t,31556952e3)}}}function zh(){let e=document.referrer;return e===""?null:e}function Wa(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(pl().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:()=>zh(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Ha(),storage:Hh()}}function Gh(){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 Wh(){return{getItem(){return null},removeItem(){},setItem(){}}}function Kh(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Wh()}}function Yh(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=Kh();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&Jh()&&Gh()?Wa():n}function Jh(){try{return typeof window=="object"}catch{return!1}}function Xh(e){return{get:()=>Object.freeze(Yh(e))}}function Al(e){let t=Bh(e),r=Qh(),n=Xh(t),o=qh(n);return{emit:(i,a)=>{let m=t.get(),f=n.get(),p=Lh(i,a,m,f,o);return Dh({config:m,environment:f,event:p,listenerManager:r})},getMeta:i=>bl(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:Sl}}d();c();l();u();function Cl(){return typeof window<"u"&&typeof document<"u"}var Sn=pe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>yr(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,m)=>{let f=eS(m);return Al({mode:i?"emit":"disabled",url:o??Vn(e,t),token:r,trackingId:n??null,source:a,environment:f})}),Zh={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},eS=e=>{if(!e)return;let t=e();return{...(Cl()?Wa():Zh),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();var vn=class extends ct{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},wl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new vn(t)})=>{let i=t(),a=i.configuration.accessToken,m=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),f=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new Po({enableAnalytics:p,token:a,endpoint:m,runtimeEnvironment:f,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:m,token:a},"Analytics request"),S)]},o);return p||y.disable(),y};d();c();l();u();d();c();l();u();function Rl(e,t){return{...new vt(t).getBaseMetadata(),actionCause:e,type:e}}function tS(e){return Object.assign(e,{instantlyCallable:!0})}function rS(e,t){let r=i=>tS(ue(e,i)),n=r(/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(i,{getState:a,extra:m}){let{analyticsClientMiddleware:f,preprocessRequest:p,logger:y}=m;return yield(yield t({getState:a,analyticsClientMiddleware:f,preprocessRequest:p,logger:y})).log({state:a(),extra:m})});return function(_x10,_x11){return _ref8.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref9=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f}){let{description:p,log:y}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:m,logger:f});return{description:p,action:r(/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(h,{getState:S,extra:g}){return yield y({state:S(),extra:g})});return function(_x13,_x14){return _ref0.apply(this,arguments)}}())}});return function prepare(_x12){return _ref9.apply(this,arguments)}}()}),n}var xl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return iS(i)}return n},nS=e=>e.configuration.analytics.analyticsMode==="legacy",oS=e=>e.configuration.analytics.analyticsMode==="next",iS=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=m=>new a(m)),rS(e,/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*({getState:m,analyticsClientMiddleware:f,preprocessRequest:p,logger:y}){let h=[],S={log:function(){var _ref10=_asyncToGenerator(function*({state:R}){for(let P of h)yield P(R)});return function log(_x16){return _ref10.apply(this,arguments)}}()},g=m(),v=i({getState:m,logger:y,analyticsClientMiddleware:f,preprocessRequest:p,provider:r(m)}),x=yield t(v,m());S.description=x?.description,h.push(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(R){nS(R)&&(yield aS(x,r,R,y,v.coveoAnalyticsClient))});return function(_x17){return _ref11.apply(this,arguments)}}());let{emit:k}=Sn(g);return h.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(R){if(oS(R)&&o&&n){let P=n(R);yield fS(k,o,P)}});return function(_x18){return _ref12.apply(this,arguments)}}()),S});return function(_x15){return _ref1.apply(this,arguments)}}()));function aS(_x19,_x20,_x21,_x22,_x23){return _aS.apply(this,arguments)}function _aS(){_aS=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _aS.apply(this,arguments)}var sS=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref13=_asyncToGenerator(function*(i){r(n,o)});return function log(_x24){return _ref13.apply(this,arguments)}}()}),je=xl(e=>ul({...e,provider:e.provider||new vt(e.getState)}),e=>e,vt),LT=xl(wl,sS("caseAssist"),vn);var Ka=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return cS(e,r,t)};function cS(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:dS(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:pS(e),queryPipeline:r.pipeline||pr()}}var No=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),El={urihash:new H,sourcetype:new H,permanentid:new H},Il={uniqueId:W,raw:new K({values:El}),title:W,uri:W,clickUri:W,rankingModifier:new H({required:!1,emptyAllowed:!0})};function uS(e){return Object.assign({},...Object.keys(El).map(t=>({[t]:e[t]})))}function lS(e){return Object.assign({},...Object.keys(Il).map(t=>({[t]:e[t]})),{raw:uS(e.raw)})}function dS(e){let t=e.raw.author;return X(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function pS(e){let t=e.raw.source;return X(t)?"unknown":t}var Ya=e=>new Fe(Il).validate(lS(e));function fS(_x25,_x26,_x27){return _fS.apply(this,arguments)}function _fS(){_fS=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _fS.apply(this,arguments)}d();c();l();u();var kl=()=>je("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new hn(e)),Pl=()=>({actionCause:"recommendationInterfaceLoad"}),Vo=e=>je({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Ya(e),t.makeRecommendationOpen(Ka(e,r),No(e))),__legacy__provider:t=>new hn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Ka(e,t),n=No(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var Rr=T("recommendation/set",e=>Q(e,{id:W})),bt=ue("recommendation/get",/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield mS(o),m=yield n.recommendations(a),f=Date.now()-i;return Oe(m)?r(m.error):{recommendations:m.success.results,analyticsAction:kl(),duration:f,searchUid:m.success.searchUid,splitTestRun:m.success.splitTestRun,pipeline:m.success.pipeline}});return function(_x28,_x29){return _ref14.apply(this,arguments)}}()),mS=/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Xe.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield gS(e,Pl()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function mS(_x30){return _ref15.apply(this,arguments)}}(),gS=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Mo(e.configuration.analytics,r)});return function gS(_x31,_x32){return _ref16.apply(this,arguments)}}();var xr=ge(wr(),e=>{e.addCase(Rr,(t,r)=>{t.id=r.payload.id}).addCase(bt.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(bt.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(bt.pending,t=>{t.isLoading=!0}).addCase(fo,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Er=T("searchHub/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();var Ir=ge(Cr(),e=>{e.addCase(Er,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ye,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Fl(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Ol=We;function Bl(e,t){if(e===t||!(Ol(e)&&Ol(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Bl(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function kr(e){let t=0;for(let r in e)t++;return t}var Tl=e=>[].concat(...e);function yS(e){return new RegExp("(^|:)//").test(e)}function hS(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Qo(e){return e!=null}function SS(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var vS=e=>e.replace(/\/$/,""),bS=e=>e.replace(/^\//,"");function AS(e,t){if(!e)return t;if(!t)return e;if(yS(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=vS(e),t=bS(t),`${e}${r}${t}`}function CS(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Dl=(...e)=>A(...e),wS=e=>e.status>=200&&e.status<=299,RS=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ql(e){if(!We(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function $l({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=Dl,paramsSerializer:n,isJsonContentType:o=RS,jsonContentType:i="application/json",jsonReplacer:a,timeout:m,responseHandler:f,validateStatus:p,...y}={}){return typeof A>"u"&&r===Dl&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(S,g,v){let{getState:x,extra:k,endpoint:R,forced:P,type:w}=g,E,{url:M,headers:O=new C(y.headers),params:I=void 0,responseHandler:F=f??"json",validateStatus:D=p??wS,timeout:N=m,...$}=typeof S=="string"?{url:S}:S,U,V=g.signal;N&&(U=new s.AbortController,g.signal.addEventListener("abort",U.abort),V=U.signal);let _={...y,signal:V,...$};O=new C(ql(O)),_.headers=(yield t(O,{getState:x,arg:S,extra:k,endpoint:R,forced:P,type:w,extraOptions:v}))||O;let B=Z=>typeof Z=="object"&&(We(Z)||Array.isArray(Z)||typeof Z.toJSON=="function");if(!_.headers.has("content-type")&&B(_.body)&&_.headers.set("content-type",i),B(_.body)&&o(_.headers)&&(_.body=JSON.stringify(_.body,a)),I){let Z=~M.indexOf("?")?"&":"?",oe=n?n(I):new URLSearchParams(ql(I));M+=Z+oe}M=AS(e,M);let L=new Request(M,_);E={request:new Request(M,_)};let G,Y=!1,te=U&&setTimeout(()=>{Y=!0,U.abort()},N);try{G=yield r(L)}catch(Z){return{error:{status:Y?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Z)},meta:E}}finally{te&&clearTimeout(te),U?.signal.removeEventListener("abort",U.abort)}let se=G.clone();E.response=se;let ee,re="";try{let Z;if(yield Promise.all([h(G,F).then(oe=>ee=oe,oe=>Z=oe),se.text().then(oe=>re=oe,()=>{})]),Z)throw Z}catch(Z){return{error:{status:"PARSING_ERROR",originalStatus:G.status,data:re,error:String(Z)},meta:E}}return D(G,ee)?{data:ee,meta:E}:{error:{status:G.status,data:ee},meta:E}});return function(_x33,_x34,_x35){return _ref17.apply(this,arguments)}}());function h(_x36,_x37){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _h2.apply(this,arguments)}}var Pr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function xS(){return _xS.apply(this,arguments)}function _xS(){_xS=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _xS.apply(this,arguments)}function ES(e,t){throw Object.assign(new Pr({error:e,meta:t}),{throwImmediately:!0})}var jl={},IS=(e,t)=>(/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(r,n,o){let i=[5,(t||jl).maxRetries,(o||jl).maxRetries].filter(y=>y!==void 0),[a]=i.slice(-1),f={maxRetries:a,backoff:xS,retryCondition:(y,h,{attempt:S})=>S<=a,...t,...o},p=0;for(;;)try{let y=yield e(r,n,o);if(y.error)throw new Pr(y);return y}catch(y){if(p++,y.throwImmediately){if(y instanceof Pr)return y.value;throw y}if(y instanceof Pr&&!f.retryCondition(y.value.error,r,{attempt:p,baseQueryApi:n,extraOptions:o}))return y.value;yield f.backoff(p,f.maxRetries)}});return function(_x38,_x39,_x40){return _ref18.apply(this,arguments)}}()),Hl=Object.assign(IS,{fail:ES}),es=T("__rtkq/focused"),zl=T("__rtkq/unfocused"),ts=T("__rtkq/online"),Gl=T("__rtkq/offline");function rs(e){return e.type==="query"}function kS(e){return e.type==="mutation"}function ns(e){return e.type==="infinitequery"}function os(e,t,r,n,o,i){return PS(e)?e(t,r,n,o).filter(Qo).map(Ja).map(i):Array.isArray(e)?e.map(Ja).map(i):[]}function PS(e){return typeof e=="function"}function Ja(e){return typeof e=="string"?{type:e}:e}function FS(e,t){return e.catch(t)}var Cn=Symbol("forceQueryFn"),Xa=e=>typeof e[Cn]=="function";function OS({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,m=new Map,{unsubscribeQueryResult:f,removeMutationResult:p,updateSubscriptionOptions:y}=o.internalActions;return{buildInitiateQuery:R,buildInitiateInfiniteQuery:P,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:v};function h(E,M){return O=>{let I=i.endpointDefinitions[E],F=e({queryArgs:M,endpointDefinition:I,endpointName:E});return a.get(O)?.[F]}}function S(E,M){return O=>m.get(O)?.[M]}function g(){return E=>Object.values(a.get(E)||{}).filter(Qo)}function v(){return E=>Object.values(m.get(E)||{}).filter(Qo)}function x(E){}function k(E,M){let O=(I,{subscribe:F=!0,forceRefetch:D,subscriptionOptions:N,[Cn]:$,...U}={})=>(V,_)=>{let B=e({queryArgs:I,endpointDefinition:M,endpointName:E}),L,z={...U,type:"query",subscribe:F,forceRefetch:D,subscriptionOptions:N,endpointName:E,originalArgs:I,queryCacheKey:B,[Cn]:$};if(rs(M))L=t(z);else{let{direction:ce,initialPageParam:me}=U;L=r({...z,direction:ce,initialPageParam:me})}let G=o.endpoints[E].select(I),Y=V(L),te=G(_());let{requestId:se,abort:ee}=Y,re=te.requestId!==se,Z=a.get(V)?.[B],oe=()=>G(_()),ye=Object.assign($?Y.then(oe):re&&!Z?Promise.resolve(te):Promise.all([Z,Y]).then(oe),{arg:I,requestId:se,subscriptionOptions:N,queryCacheKey:B,abort:ee,unwrap(){return _asyncToGenerator(function*(){let ce=yield ye;if(ce.isError)throw ce.error;return ce.data})()},refetch:()=>V(O(I,{subscribe:!1,forceRefetch:!0})),unsubscribe(){F&&V(f({queryCacheKey:B,requestId:se}))},updateSubscriptionOptions(ce){ye.subscriptionOptions=ce,V(y({endpointName:E,requestId:se,queryCacheKey:B,options:ce}))}});if(!Z&&!re&&!$){let ce=CS(a,V,{});ce[B]=ye,ye.then(()=>{delete ce[B],kr(ce)||a.delete(V)})}return ye};return O}function R(E,M){return k(E,M)}function P(E,M){return k(E,M)}function w(E){return(M,{track:O=!0,fixedCacheKey:I}={})=>(F,D)=>{let N=n({type:"mutation",endpointName:E,originalArgs:M,track:O,fixedCacheKey:I}),$=F(N);let{requestId:U,abort:V,unwrap:_}=$,B=FS($.unwrap().then(Y=>({data:Y})),Y=>({error:Y})),L=()=>{F(p({requestId:U,fixedCacheKey:I}))},z=Object.assign(B,{arg:$.arg,requestId:U,abort:V,unwrap:_,reset:L}),G=m.get(F)||{};return m.set(F,G),G[U]=z,z.then(()=>{delete G[U],kr(G)||m.delete(F)}),I&&(G[I]=z,z.then(()=>{G[I]===z&&(delete G[I],kr(G)||m.delete(F))})),z}}}function TS(e){return e}var Lo=(e={})=>({...e,[cn]:!0});function DS({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let m=(F,D,N,$)=>(U,V)=>{let _=r[F],B=n({queryArgs:D,endpointDefinition:_,endpointName:F});if(U(o.internalActions.queryResultPatched({queryCacheKey:B,patches:N})),!$)return;let L=o.endpoints[F].select(D)(V()),z=os(_.providesTags,L.data,void 0,D,{},i);U(o.internalActions.updateProvidedBy({queryCacheKey:B,providedTags:z}))};function f(F,D,N=0){let $=[D,...F];return N&&$.length>N?$.slice(0,-1):$}function p(F,D,N=0){let $=[...F,D];return N&&$.length>N?$.slice(1):$}let y=(F,D,N,$=!0)=>(U,V)=>{let B=o.endpoints[F].select(D)(V()),L={patches:[],inversePatches:[],undo:()=>U(o.util.patchQueryData(F,D,L.inversePatches,$))};if(B.status==="uninitialized")return L;let z;if("data"in B)if(De(B.data)){let[G,Y,te]=Xn(B.data,N);L.patches.push(...Y),L.inversePatches.push(...te),z=G}else z=N(B.data),L.patches.push({op:"replace",path:[],value:z}),L.inversePatches.push({op:"replace",path:[],value:B.data});return L.patches.length===0||U(o.util.patchQueryData(F,D,L.patches,$)),L},h=(F,D,N)=>$=>$(o.endpoints[F].initiate(D,{subscribe:!1,forceRefetch:!0,[Cn]:()=>({data:N})})),S=(F,D)=>F.query&&F[D]?F[D]:TS,g=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(F,{signal:D,abort:N,rejectWithValue:$,fulfillWithValue:U,dispatch:V,getState:_,extra:B}){let L=r[F.endpointName];try{let z=S(L,"transformResponse"),G={signal:D,abort:N,dispatch:V,getState:_,extra:B,endpoint:F.endpointName,type:F.type,forced:F.type==="query"?v(F,_()):void 0,queryCacheKey:F.type==="query"?F.queryCacheKey:void 0},Y=F.type==="query"?F[Cn]:void 0,te,se=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(re,Z,oe,ye){if(Z==null&&re.pages.length)return Promise.resolve({data:re});let ce={queryArg:F.originalArgs,pageParam:Z},me=yield ee(ce),he=ye?f:p;return{data:{pages:he(re.pages,me.data,oe),pageParams:he(re.pageParams,Z,oe)}}});return function se(_x43,_x44,_x45,_x46){return _ref20.apply(this,arguments)}}();function ee(_x47){return _ee.apply(this,arguments)}function _ee(){_ee=_asyncToGenerator(function*(re){let Z,{extraOptions:oe}=L;if(Y?Z=Y():L.query?Z=yield t(L.query(re),G,oe):Z=yield L.queryFn(re,G,oe,ce=>t(ce,G,oe)),typeof process<"u",Z.error)throw new Pr(Z.error,Z.meta);let ye=yield z(Z.data,Z.meta,re);return{...Z,data:ye}});return _ee.apply(this,arguments)}if(F.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:re}=L,{maxPages:Z=1/0}=re,oe,ye={pages:[],pageParams:[]},ce=a.selectQueryEntry(_(),F.queryCacheKey)?.data,he=v(F,_())&&!F.direction||!ce?ye:ce;if("direction"in F&&F.direction&&he.pages.length){let Pe=F.direction==="backward",dt=(Pe?Wl:Za)(re,he);oe=yield se(he,dt,Z,Pe)}else{let{initialPageParam:Pe=re.initialPageParam}=F,_e=ce?.pageParams??[],dt=_e[0]??Pe,Kt=_e.length;oe=yield se(he,dt,Z),Y&&(oe={data:oe.data.pages[0]});for(let Yt=1;Yt<Kt;Yt++){let Qr=Za(re,oe.data);oe=yield se(oe.data,Qr,Z)}}te=oe}else te=yield ee(F.originalArgs);return U(te.data,Lo({fulfilledTimeStamp:Date.now(),baseQueryMeta:te.meta}))}catch(z){let G=z;if(G instanceof Pr){let Y=S(L,"transformErrorResponse");try{return $(yield Y(G.value,G.meta,F.originalArgs),Lo({baseQueryMeta:G.meta}))}catch(te){G=te}}throw typeof process<"u",console.error(G),G}});return function g(_x41,_x42){return _ref19.apply(this,arguments)}}();function v(F,D){let N=a.selectQueryEntry(D,F.queryCacheKey),$=a.selectConfig(D).refetchOnMountOrArgChange,U=N?.fulfilledTimeStamp,V=F.forceRefetch??(F.subscribe&&$);return V?V===!0||(Number(new Date)-Number(U))/1e3>=V:!1}let x=()=>ue(`${e}/executeQuery`,g,{getPendingMeta({arg:D}){let N=r[D.endpointName];return Lo({startedTimeStamp:Date.now(),...(ns(N)?{direction:D.direction}:{})})},condition(D,{getState:N}){let $=N(),U=a.selectQueryEntry($,D.queryCacheKey),V=U?.fulfilledTimeStamp,_=D.originalArgs,B=U?.originalArgs,L=r[D.endpointName],z=D.direction;return Xa(D)?!0:U?.status==="pending"?!1:v(D,$)||rs(L)&&L?.forceRefetch?.({currentArg:_,previousArg:B,endpointState:U,state:$})?!0:!(V&&!z)},dispatchConditionRejection:!0}),k=x(),R=x(),P=ue(`${e}/executeMutation`,g,{getPendingMeta(){return Lo({startedTimeStamp:Date.now()})}}),w=F=>"force"in F,E=F=>"ifOlderThan"in F,M=(F,D,N)=>($,U)=>{let V=w(N)&&N.force,_=E(N)&&N.ifOlderThan,B=(z=!0)=>{let G={forceRefetch:z,isPrefetch:!0};return o.endpoints[F].initiate(D,G)},L=o.endpoints[F].select(D)(U());if(V)$(B());else if(_){let z=L?.fulfilledTimeStamp;if(!z){$(B());return}(Number(new Date)-Number(new Date(z)))/1e3>=_&&$(B())}else $(B(!1))};function O(F){return D=>D?.meta?.arg?.endpointName===F}function I(F,D){return{matchPending:ir(ro(F),O(D)),matchFulfilled:ir(ot(F),O(D)),matchRejected:ir(Lt(F),O(D))}}return{queryThunk:k,mutationThunk:P,infiniteQueryThunk:R,prefetch:M,updateQueryData:y,upsertQueryData:h,patchQueryData:m,buildMatchThunkActions:I}}function Za(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Wl(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Kl(e,t,r,n){return os(r[e.meta.arg.endpointName][t],ot(e)?e.payload:void 0,ln(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Uo(e,t,r){let n=e[t];n&&r(n)}function wn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Ml(e,t,r){let n=e[wn(t)];n&&r(n)}var bn={};function qS({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:m},assertTagType:f,config:p}){let y=T(`${e}/resetApiState`);function h(O,I,F,D){var N;O[N=I.queryCacheKey]??(O[N]={status:"uninitialized",endpointName:I.endpointName}),Uo(O,I.queryCacheKey,$=>{$.status="pending",$.requestId=F&&$.requestId?$.requestId:D.requestId,I.originalArgs!==void 0&&($.originalArgs=I.originalArgs),$.startedTimeStamp=D.startedTimeStamp;let U=o[D.arg.endpointName];ns(U)&&"direction"in I&&($.direction=I.direction)})}function S(O,I,F,D){Uo(O,I.arg.queryCacheKey,N=>{if(N.requestId!==I.requestId&&!D)return;let{merge:$}=o[I.arg.endpointName];if(N.status="fulfilled",$){if(N.data!==void 0){let{fulfilledTimeStamp:U,arg:V,baseQueryMeta:_,requestId:B}=I,L=nt(N.data,z=>$(z,F,{arg:V.originalArgs,baseQueryMeta:_,fulfilledTimeStamp:U,requestId:B}));N.data=L}else N.data=F;}else N.data=o[I.arg.endpointName].structuralSharing??!0?Bl(Me(N.data)?ca(N.data):N.data,F):F;delete N.error,N.fulfilledTimeStamp=I.fulfilledTimeStamp})}let g=Ut({name:`${e}/queries`,initialState:bn,reducers:{removeQueryResult:{reducer(O,{payload:{queryCacheKey:I}}){delete O[I]},prepare:ar()},cacheEntriesUpserted:{reducer(O,I){for(let F of I.payload){let{queryDescription:D,value:N}=F;h(O,D,!0,{arg:D,requestId:I.meta.requestId,startedTimeStamp:I.meta.timestamp}),S(O,{arg:D,requestId:I.meta.requestId,fulfilledTimeStamp:I.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:O=>({payload:O.map(D=>{let{endpointName:N,arg:$,value:U}=D,V=o[N];return{queryDescription:{type:"query",endpointName:N,originalArgs:D.arg,queryCacheKey:n({queryArgs:$,endpointDefinition:V,endpointName:N})},value:U}}),meta:{[cn]:!0,requestId:oo(),timestamp:Date.now()}})},queryResultPatched:{reducer(O,{payload:{queryCacheKey:I,patches:F}}){Uo(O,I,D=>{D.data=la(D.data,F.concat())})},prepare:ar()}},extraReducers(O){O.addCase(t.pending,(I,{meta:F,meta:{arg:D}})=>{let N=Xa(D);h(I,D,N,F)}).addCase(t.fulfilled,(I,{meta:F,payload:D})=>{let N=Xa(F.arg);S(I,F,D,N)}).addCase(t.rejected,(I,{meta:{condition:F,arg:D,requestId:N},error:$,payload:U})=>{Uo(I,D.queryCacheKey,V=>{if(!F){if(V.requestId!==N)return;V.status="rejected",V.error=U??$}})}).addMatcher(m,(I,F)=>{let{queries:D}=a(F);for(let[N,$]of Object.entries(D))($?.status==="fulfilled"||$?.status==="rejected")&&(I[N]=$)})}}),v=Ut({name:`${e}/mutations`,initialState:bn,reducers:{removeMutationResult:{reducer(O,{payload:I}){let F=wn(I);F in O&&delete O[F]},prepare:ar()}},extraReducers(O){O.addCase(r.pending,(I,{meta:F,meta:{requestId:D,arg:N,startedTimeStamp:$}})=>{N.track&&(I[wn(F)]={requestId:D,status:"pending",endpointName:N.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,(I,{payload:F,meta:D})=>{D.arg.track&&Ml(I,D,N=>{N.requestId===D.requestId&&(N.status="fulfilled",N.data=F,N.fulfilledTimeStamp=D.fulfilledTimeStamp)})}).addCase(r.rejected,(I,{payload:F,error:D,meta:N})=>{N.arg.track&&Ml(I,N,$=>{$.requestId===N.requestId&&($.status="rejected",$.error=F??D)})}).addMatcher(m,(I,F)=>{let{mutations:D}=a(F);for(let[N,$]of Object.entries(D))($?.status==="fulfilled"||$?.status==="rejected")&&N!==$?.requestId&&(I[N]=$)})}}),x=Ut({name:`${e}/invalidation`,initialState:bn,reducers:{updateProvidedBy:{reducer(O,I){var N,$;let{queryCacheKey:F,providedTags:D}=I.payload;for(let U of Object.values(O))for(let V of Object.values(U)){let _=V.indexOf(F);_!==-1&&V.splice(_,1)}for(let{type:U,id:V}of D){let _=(N=O[U]??(O[U]={}))[$=V||"__internal_without_id"]??(N[$]=[]);_.includes(F)||_.push(F)}},prepare:ar()}},extraReducers(O){O.addCase(g.actions.removeQueryResult,(I,{payload:{queryCacheKey:F}})=>{for(let D of Object.values(I))for(let N of Object.values(D)){let $=N.indexOf(F);$!==-1&&N.splice($,1)}}).addMatcher(m,(I,F)=>{var N,$;let{provided:D}=a(F);for(let[U,V]of Object.entries(D))for(let[_,B]of Object.entries(V)){let L=(N=I[U]??(I[U]={}))[$=_||"__internal_without_id"]??(N[$]=[]);for(let z of B)L.includes(z)||L.push(z)}}).addMatcher(Ke(ot(t),ln(t)),(I,F)=>{let D=Kl(F,"providesTags",o,f),{queryCacheKey:N}=F.meta.arg;x.caseReducers.updateProvidedBy(I,x.actions.updateProvidedBy({queryCacheKey:N,providedTags:D}))})}}),k=Ut({name:`${e}/subscriptions`,initialState:bn,reducers:{updateSubscriptionOptions(O,I){},unsubscribeQueryResult(O,I){},internal_getRTKQSubscriptions(){}}}),R=Ut({name:`${e}/internalSubscriptions`,initialState:bn,reducers:{subscriptionsUpdated:{reducer(O,I){return la(O,I.payload)},prepare:ar()}}}),P=Ut({name:`${e}/config`,initialState:{online:SS(),focused:hS(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(O,{payload:I}){O.middlewareRegistered=O.middlewareRegistered==="conflict"||i!==I?"conflict":!0}},extraReducers:O=>{O.addCase(ts,I=>{I.online=!0}).addCase(Gl,I=>{I.online=!1}).addCase(es,I=>{I.focused=!0}).addCase(zl,I=>{I.focused=!1}).addMatcher(m,I=>({...I}))}}),w=tr({queries:g.reducer,mutations:v.reducer,provided:x.reducer,subscriptions:R.reducer,config:P.reducer}),E=(O,I)=>w(y.match(I)?void 0:O,I),M={...P.actions,...g.actions,...k.actions,...R.actions,...v.actions,...x.actions,resetApiState:y};return{reducer:E,actions:M}}var An=Symbol.for("RTKQ/skipToken"),Yl={status:"uninitialized"},Nl=nt(Yl,()=>{}),_l=nt(Yl,()=>{});function jS({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>Nl,o=w=>_l;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:v,selectInvalidatedBy:x,selectCachedArgsForQuery:k,selectApiState:a,selectQueries:m,selectMutations:p,selectQueryEntry:f,selectConfig:y};function i(w){return{...w,...Fl(w.status)}}function a(w){return w[t]}function m(w){return a(w)?.queries}function f(w,E){return m(w)?.[E]}function p(w){return a(w)?.mutations}function y(w){return a(w)?.config}function h(w,E,M){return O=>{if(O===An)return r(n,M);let I=e({queryArgs:O,endpointDefinition:E,endpointName:w});return r(D=>f(D,I)??Nl,M)}}function S(w,E){return h(w,E,i)}function g(w,E){let{infiniteQueryOptions:M}=E;function O(I){let F={...I,...Fl(I.status)},{isLoading:D,isError:N,direction:$}=F,U=$==="forward",V=$==="backward";return{...F,hasNextPage:R(M,F.data),hasPreviousPage:P(M,F.data),isFetchingNextPage:D&&U,isFetchingPreviousPage:D&&V,isFetchNextPageError:N&&U,isFetchPreviousPageError:N&&V}}return h(w,E,O)}function v(){return w=>{let E;return typeof w=="object"?E=wn(w)??An:E=w,r(E===An?o:I=>a(I)?.mutations?.[E]??_l,i)}}function x(w,E){let M=w[t],O=new Set;for(let I of E.filter(Qo).map(Ja)){let F=M.provided[I.type];if(!F)continue;let D=(I.id!==void 0?F[I.id]:Tl(Object.values(F)))??[];for(let N of D)O.add(N)}return Tl(Array.from(O.values()).map(I=>{let F=M.queries[I];return F?[{queryCacheKey:I,endpointName:F.endpointName,originalArgs:F.originalArgs}]:[]}))}function k(w,E){return Object.values(m(w)).filter(M=>M?.endpointName===E&&M.status!=="uninitialized").map(M=>M.originalArgs)}function R(w,E){return E?Za(w,E)!=null:!1}function P(w,E){return!E||!w.getPreviousPageParam?!1:Wl(w,E)!=null}}var Vl=WeakMap?new WeakMap:void 0,Ll=({endpointName:e,queryArgs:t})=>{let r="",n=Vl?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=We(a)?Object.keys(a).sort().reduce((m,f)=>(m[f]=a[f],m),{}):a,a));We(t)&&Vl?.set(t,o),r=o}return`${e}(${r})`};function MS(...e){return function(r){let n=or(p=>r.extractRehydrationInfo?.(p,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(p){let y=Ll;if("serializeQueryArgs"in p.endpointDefinition){let h=p.endpointDefinition.serializeQueryArgs;y=S=>{let g=h(S);return typeof g=="string"?g:Ll({...S,queryArgs:g})}}else r.serializeQueryArgs&&(y=r.serializeQueryArgs);return y(p)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(p){p()},apiUid:oo(),extractRehydrationInfo:n,hasRehydrationInfo:or(p=>n(p)!=null)},a={injectEndpoints:f,enhanceEndpoints({addTagTypes:p,endpoints:y}){if(p)for(let h of p)o.tagTypes.includes(h)||o.tagTypes.push(h);if(y)for(let[h,S]of Object.entries(y))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},m=e.map(p=>p.init(a,o,i));function f(p){let y=p.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(y)){if(p.overrideExisting!==!0&&h in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error($e(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let g of m)g.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function ut(e,...t){return Object.assign(e,...t)}var NS=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:m}=e.internalActions,f=(g,v)=>{var k,R;if(a.match(v)){let{queryCacheKey:P,requestId:w,options:E}=v.payload;return g?.[P]?.[w]&&(g[P][w]=E),!0}if(m.match(v)){let{queryCacheKey:P,requestId:w}=v.payload;return g[P]&&delete g[P][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete g[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:P,requestId:w}}=v,E=g[k=P.queryCacheKey]??(g[k]={});return E[`${w}_running`]={},P.subscribe&&(E[w]=P.subscriptionOptions??E[w]??{}),!0}let x=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let P=g[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;x||(x=!!P[w]),delete P[w]}if(t.rejected.match(v)){let{meta:{condition:P,arg:w,requestId:E}}=v;if(P&&w.subscribe){let M=g[R=w.queryCacheKey]??(g[R]={});M[E]=w.subscriptionOptions??M[E]??{},x=!0}}return x},p=()=>r.currentSubscriptions,S={getSubscriptions:p,getSubscriptionCount:g=>{let x=p()[g]??{};return kr(x)},isRequestSubscribed:(g,v)=>!!p()?.[g]?.[v]};return(g,v)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let x=f(r.currentSubscriptions,g),k=!0;if(x){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=Xn(o,()=>w);v.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let R=typeof g.type=="string"&&!!g.type.startsWith(n),P=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;k=!R&&!P}return[k,!1]}};function _S(e){for(let t in e)return!1;return!0}var VS=2147483647/1e3-1,LS=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:m,unsubscribeQueryResult:f,cacheEntriesUpserted:p}=t.internalActions,y=Ke(f.match,r.fulfilled,r.rejected,p.match);function h(k){let R=o.currentSubscriptions[k];return!!R&&!_S(R)}let S={},g=(k,R,P)=>{let w=R.getState(),E=a(w);if(y(k)){let M;if(p.match(k))M=k.payload.map(O=>O.queryDescription.queryCacheKey);else{let{queryCacheKey:O}=f.match(k)?k.payload:k.meta.arg;M=[O]}v(M,R,E)}if(t.util.resetApiState.match(k))for(let[M,O]of Object.entries(S))O&&clearTimeout(O),delete S[M];if(n.hasRehydrationInfo(k)){let{queries:M}=n.extractRehydrationInfo(k);v(Object.keys(M),R,E)}};function v(k,R,P){let w=R.getState();for(let E of k){let M=i(w,E);x(E,M?.endpointName,R,P)}}function x(k,R,P,w){let M=n.endpointDefinitions[R]?.keepUnusedDataFor??w.keepUnusedDataFor;if(M===1/0)return;let O=Math.max(0,Math.min(M,VS));if(!h(k)){let I=S[k];I&&clearTimeout(I),S[k]=setTimeout(()=>{h(k)||P.dispatch(m({queryCacheKey:k})),delete S[k]},O*1e3)}}return g},Ul=new Error("Promise never resolved before cacheEntryRemoved."),US=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:m}})=>{let f=no(n),p=no(o),y=ot(n,o),h={};function S(R,P,w){let E=h[R];E?.valueResolved&&(E.valueResolved({data:P,meta:w}),delete E.valueResolved)}function g(R){let P=h[R];P&&(delete h[R],P.cacheEntryRemoved())}let v=(R,P,w)=>{let E=x(R);function M(O,I,F,D){let N=a(w,I),$=a(P.getState(),I);!N&&$&&k(O,D,I,P,F)}if(n.pending.match(R))M(R.meta.arg.endpointName,E,R.meta.requestId,R.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(R))for(let{queryDescription:O,value:I}of R.payload){let{endpointName:F,originalArgs:D,queryCacheKey:N}=O;M(F,N,R.meta.requestId,D),S(N,I,{})}else if(o.pending.match(R))P.getState()[t].mutations[E]&&k(R.meta.arg.endpointName,R.meta.arg.originalArgs,E,P,R.meta.requestId);else if(y(R))S(E,R.payload,R.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(R)||e.internalActions.removeMutationResult.match(R))g(E);else if(e.util.resetApiState.match(R))for(let O of Object.keys(h))g(O)};function x(R){return f(R)?R.meta.arg.queryCacheKey:p(R)?R.meta.arg.fixedCacheKey??R.meta.requestId:e.internalActions.removeQueryResult.match(R)?R.payload.queryCacheKey:e.internalActions.removeMutationResult.match(R)?wn(R.payload):""}function k(R,P,w,E,M){let O=r.endpointDefinitions[R],I=O?.onCacheEntryAdded;if(!I)return;let F={},D=new Promise(B=>{F.cacheEntryRemoved=B}),N=Promise.race([new Promise(B=>{F.valueResolved=B}),D.then(()=>{throw Ul})]);N.catch(()=>{}),h[w]=F;let $=e.endpoints[R].select(O.type==="query"?P:w),U=E.dispatch((B,L,z)=>z),V={...E,getCacheEntry:()=>$(E.getState()),requestId:M,extra:U,updateCachedData:O.type==="query"?B=>E.dispatch(e.util.updateQueryData(R,P,B)):void 0,cacheDataLoaded:N,cacheEntryRemoved:D},_=I(P,V);Promise.resolve(_).catch(B=>{if(B!==Ul)throw B})}return v},QS=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},BS=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:m,internalState:f})=>{let{removeQueryResult:p}=i.internalActions,y=Ke(ot(n),ln(n)),h=Ke(ot(n,o),Lt(n,o)),S=[],g=(k,R)=>{y(k)?x(Kl(k,"invalidatesTags",r,a),R):h(k)?x([],R):i.util.invalidateTags.match(k)&&x(os(k.payload,void 0,void 0,void 0,void 0,a),R)};function v(k){let{queries:R,mutations:P}=k;for(let w of[R,P])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function x(k,R){let P=R.getState(),w=P[e];if(S.push(...k),w.config.invalidationBehavior==="delayed"&&v(w))return;let E=S;if(S=[],E.length===0)return;let M=i.util.selectInvalidatedBy(P,E);t.batch(()=>{let O=Array.from(M.values());for(let{queryCacheKey:I}of O){let F=w.queries[I],D=f.currentSubscriptions[I]??{};F&&(kr(D)===0?R.dispatch(p({queryCacheKey:I})):F.status!=="uninitialized"&&R.dispatch(m(F)))}})}return g},$S=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,v)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&p(g.payload,v),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&p(g.meta.arg,v),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&f(g.meta.arg,v),r.util.resetApiState.match(g)&&h()};function m(g,v){let k=v.getState()[e].queries[g],R=o.currentSubscriptions[g];if(!(!k||k.status==="uninitialized"))return R}function f({queryCacheKey:g},v){let x=v.getState()[e],k=x.queries[g],R=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:P,skipPollingIfUnfocused:w}=S(R);if(!Number.isFinite(P))return;let E=i[g];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let M=Date.now()+P;i[g]={nextPollTimestamp:M,pollingInterval:P,timeout:setTimeout(()=>{(x.config.focused||!w)&&v.dispatch(n(k)),f({queryCacheKey:g},v)},P)}}function p({queryCacheKey:g},v){let k=v.getState()[e].queries[g],R=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:P}=S(R);if(!Number.isFinite(P)){y(g);return}let w=i[g],E=Date.now()+P;(!w||E<w.nextPollTimestamp)&&f({queryCacheKey:g},v)}function y(g){let v=i[g];v?.timeout&&clearTimeout(v.timeout),delete i[g]}function h(){for(let g of Object.keys(i))y(g)}function S(g={}){let v=!1,x=Number.POSITIVE_INFINITY;for(let k in g)g[k].pollingInterval&&(x=Math.min(g[k].pollingInterval,x),v=g[k].skipPollingIfUnfocused||v);return{lowestPollingInterval:x,skipPollingIfUnfocused:v}}return a},HS=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=ro(r,n),i=Lt(r,n),a=ot(r,n),m={};return(p,y)=>{if(o(p)){let{requestId:h,arg:{endpointName:S,originalArgs:g}}=p.meta,v=t.endpointDefinitions[S],x=v?.onQueryStarted;if(x){let k={},R=new Promise((M,O)=>{k.resolve=M,k.reject=O});R.catch(()=>{}),m[h]=k;let P=e.endpoints[S].select(v.type==="query"?g:h),w=y.dispatch((M,O,I)=>I),E={...y,getCacheEntry:()=>P(y.getState()),requestId:h,extra:w,updateCachedData:v.type==="query"?M=>y.dispatch(e.util.updateQueryData(S,g,M)):void 0,queryFulfilled:R};x(g,E)}}else if(a(p)){let{requestId:h,baseQueryMeta:S}=p.meta;m[h]?.resolve({data:p.payload,meta:S}),delete m[h]}else if(i(p)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:g}=p.meta;m[h]?.reject({error:p.payload??p.error,isUnhandledError:!S,meta:g}),delete m[h]}}},zS=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(f,p)=>{es.match(f)&&m(p,"refetchOnFocus"),ts.match(f)&&m(p,"refetchOnReconnect")};function m(f,p){let y=f.getState()[e],h=y.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let v=h[g],x=S[g];if(!x||!v)continue;(Object.values(x).some(R=>R[p]===!0)||Object.values(x).every(R=>R[p]===void 0)&&y.config[p])&&(kr(x)===0?f.dispatch(i({queryCacheKey:g})):v.status!=="uninitialized"&&f.dispatch(n(v)))}})}return a};function GS(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:T(`${t}/invalidateTags`)},m=h=>h.type.startsWith(`${t}/`),f=[QS,LS,BS,$S,US,HS];return{middleware:h=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:y,isThisApiSliceAction:m},x=f.map(P=>P(v)),k=NS(v),R=zS(v);return P=>w=>{if(!zn(w))return P(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:P},M=h.getState(),[O,I]=k(w,E,M),F;if(O?F=P(w):F=I,h.getState()[t]&&(R(w,E,M),m(w)||o.hasRehydrationInfo(w)))for(let D of x)D(w,E,M);return F}},actions:a};function y(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Ql=Symbol(),WS=({createSelector:e=pe}={})=>({name:Ql,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:m,refetchOnFocus:f,refetchOnReconnect:p,invalidationBehavior:y},h){Xc();let S=ee=>(typeof process<"u",ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:ts,onOffline:Gl,onFocus:es,onFocusLost:zl},util:{}});let g=jS({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:x,buildQuerySelector:k,buildInfiniteQuerySelector:R,buildMutationSelector:P}=g;ut(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:x});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,patchQueryData:O,updateQueryData:I,upsertQueryData:F,prefetch:D,buildMatchThunkActions:N}=DS({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:$,actions:U}=qS({context:h,queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:f,refetchOnReconnect:p,refetchOnMountOrArgChange:m,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:y}});ut(t.util,{patchQueryData:O,updateQueryData:I,upsertQueryData:F,prefetch:D,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),ut(t.internalActions,U);let{middleware:V,actions:_}=GS({reducerPath:o,context:h,queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:g});ut(t.util,_),ut(t,{reducer:$,middleware:V});let{buildInitiateQuery:B,buildInitiateInfiniteQuery:L,buildInitiateMutation:z,getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueriesThunk:te,getRunningQueryThunk:se}=OS({queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return ut(t.util,{getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueryThunk:se,getRunningQueriesThunk:te}),{name:Ql,injectEndpoint(ee,re){var ye;let oe=(ye=t.endpoints)[ee]??(ye[ee]={});rs(re)&&ut(oe,{name:ee,select:k(ee,re),initiate:B(ee,re)},N(w,ee)),kS(re)&&ut(oe,{name:ee,select:P(),initiate:z(ee)},N(M,ee)),ns(re)&&ut(oe,{name:ee,select:R(ee,re),initiate:L(ee,re)},N(w,ee))}}}}),Jl=MS(WS());d();c();l();u();var Bo=pe(e=>e.query,e=>e);var g0=pe(e=>Bo(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),KS=pe(e=>e.generatedAnswer?.answerApiQueryParams,e=>e??An);d();c();l();u();d();c();l();u();d();c();l();u();var $o=T("breadcrumb/deselectAll"),Xl=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var Zl=T("facet/updateFacetAutoSelection",e=>Q(e,{allow:new ne({required:!0})}));d();c();l();u();d();c();l();u();var Ho=class extends vt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Ne().q}get responseTime(){return this.activeInstantResultCache?.duration??Ge().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Ge().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var ed=()=>je("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Ho(e)),td=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var is={id:W},YS={...is,q:we},eq=T("instantResults/register",e=>Q(e,is)),zo=T("instantResults/updateQuery",e=>Q(e,YS)),tq=T("instantResults/clearExpired",e=>Q(e,is));d();c();l();u();var Go=new J({required:!0,min:0}),Wo=T("pagination/registerNumberOfResults",e=>Q(e,Go)),Ko=T("pagination/updateNumberOfResults",e=>Q(e,Go)),Yo=T("pagination/registerPage",e=>Q(e,Go)),Fr=T("pagination/updatePage",e=>Q(e,Go)),Jo=T("pagination/nextPage"),Xo=T("pagination/previousPage");d();c();l();u();var Or=T("query/updateQuery",e=>Q(e,{q:new H,enableQuerySyntax:new ne}));d();c();l();u();d();c();l();u();var Zo=(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:yr(e)}});var Tr=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Zo(e.configuration.analytics,t,r)),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();var At=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??pt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Xe.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Mo(e.configuration.analytics,t))),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function At(_x48,_x49){return _ref21.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Ct=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var as=()=>je("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),wt=e=>je("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ne().q,aq:r.advancedSearchQueries?.aq||Ct().aq,cq:r.advancedSearchQueries?.cq||Ct().cq,dq:r.advancedSearchQueries?.dq||Ct().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var Rn=Qe(ei(),1),sd=Qe(rd(),1);d();c();l();u();var ti=Qe(ei(),1),od=Qe(nd(),1);ti.default.extend(od.default);var id="YYYY/MM/DD@HH:mm:ss",JS="1401-01-01";function Dr(e,t){let r=(0,ti.default)(e,t);return!r.isValid()&&!t?(0,ti.default)(e,id):r}function ri(e){return e.format(id)}function ad(e,t){let r=Dr(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}fs(r)}function fs(e){if(e.isBefore(JS))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Rn.default.extend(sd.default);var cd=["past","now","next"],ud=["minute","hour","day","week","month","quarter","year"],XS=e=>{let t=e==="now";return{amount:new J({required:!t,min:1}),unit:new H({required:!t,constrainTo:ud}),period:new H({required:!0,constrainTo:cd})}};function ms(e){if(typeof e=="string"&&!Rt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?md(e):e;new Fe(XS(t.period)).validate(t);let r=dd(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);fs(r)}function ld(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function dd(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Rn.default)().subtract(r,n);case"next":return(0,Rn.default)().add(r,n);case"now":return(0,Rn.default)()}}function xn(e){return ri(dd(md(e)))}function pd(e){return e.toLocaleLowerCase().split("-")}function Rt(e){let[t,r,n]=pd(e);if(t==="now")return!0;if(!cd.includes(t)||!ud.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function fd(e){return!!e&&typeof e=="object"&&"period"in e}function md(e){let[t,r,n]=pd(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}d();c();l();u();function gd(e){return e.type==="dateRange"}function yd(e){return`start${e}`}function hd(e){return`end${e}`}var gs=()=>({dateFacetValueMap:{}});function ZS(e,t,r){let n=e.start,o=e.end;return Rt(n)&&(n=xn(n),r.dateFacetValueMap[t][yd(n)]=e.start),Rt(o)&&(o=xn(o),r.dateFacetValueMap[t][hd(o)]=e.end),{...e,start:n,end:o}}function ys(e,t){if(gd(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>ZS(o,r,t))}}return e}function xt(e){let t=gs();return{request:{...e,facets:e.facets?.map(n=>ys(n,t))},mappings:t}}function ev(e,t,r){return{...e,start:r.dateFacetValueMap[t][yd(e.start)]||e.start,end:r.dateFacetValueMap[t][hd(e.end)]||e.end}}function tv(e,t){return e.facetId in t.dateFacetValueMap}function rv(e,t){return tv(e,t)?{...e,values:e.values.map(r=>ev(r,e.facetId,t))}:e}function ni(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>rv(n,t))}}:e}d();c();l();u();d();c();l();u();var $j=T("didYouMean/enable"),Hj=T("didYouMean/disable"),zj=T("didYouMean/automaticCorrections/disable"),Gj=T("didYouMean/automaticCorrections/enable"),oi=T("didYouMean/correction",e=>Q(e,W)),Wj=T("didYouMean/automaticCorrections/mode",e=>Q(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var hs=()=>je("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Sd=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function ii(){return{contextValues:{}}}d();c();l();u();function ai(){return{contextValues:{}}}d();c();l();u();function vd(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function bd(){return[]}d();c();l();u();function En(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Ad(){return{}}d();c();l();u();function Cd(){return{}}d();c();l();u();function wd(){return{}}function et(e){return{context:e.context||ii(),dictionaryFieldContext:e.dictionaryFieldContext||ai(),facetSet:e.facetSet||qo(),numericFacetSet:e.numericFacetSet||Do(),dateFacetSet:e.dateFacetSet||To(),categoryFacetSet:e.categoryFacetSet||Oo(),automaticFacetSet:e.automaticFacetSet??Fo(),pagination:e.pagination||En(),query:e.query||Ne(),tabSet:e.tabSet||wd(),advancedSearchQueries:e.advancedSearchQueries||Ct(),staticFilterSet:e.staticFilterSet||Cd(),querySet:e.querySet||Ad(),sortCriteria:e.sortCriteria||jo(),pipeline:e.pipeline||pr(),searchHub:e.searchHub||Cr(),facetOptions:e.facetOptions||vd(),facetOrder:e.facetOrder??bd(),debug:e.debug??lo()}}d();c();l();u();var bN=new K({values:{undoneQuery:we},options:{required:!0}}),Rd=()=>je("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var si=T("trigger/query/ignore",e=>Q(e,new H({emptyAllowed:!0,required:!0}))),ci=T("trigger/query/modification",e=>Q(e,new K({values:{originalQuery:Ce,modification:Ce}})));d();c();l();u();d();c();l();u();d();c();l();u();function Et(e){return Object.values(e).map(t=>t.request)}function Ss(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function xd(e){return Et(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var vs={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function nv(e){return Et(e).map(t=>{let r=vs[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ov(e){return[...nv(e.facetSet??{}),...xd(e.numericFacetSet??{}),...xd(e.dateFacetSet??{}),...Et(e.categoryFacetSet??{})]}function iv(e){return ov(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function ui(e){return Ss(iv(e),e.facetOrder??[])}d();c();l();u();var It=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){let r=cv(e),n=ui(e),o=av(e),i=yield At(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return xt({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function It(_x50,_x51){return _ref22.apply(this,arguments)}}();function av(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(sv).filter(r=>r.currentValues.length>0):void 0}function sv(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function cv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=uv(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function uv(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var kt=class{constructor(t,r=n=>{this.dispatch(Or({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x52,_x53){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=ni(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(wt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let p=a.length===0&&m&&m.length!==0,y=!X(f)&&!X(f.correctedQuery);if(!p&&!y)return null;let S=p?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(Je(et(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this13.dispatch(wt(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(Je(et(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:hs()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:hs()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(si("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this14.dispatch(wt(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(Je(et(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Rd()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ne().enableQuerySyntax},search:{...Ge(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Je(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield It(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(oi(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(ci({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield It(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var M_=ue("search/executeSearch",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=t.getState();return yield li(r,t,e)});return function(_x54,_x55){return _ref23.apply(this,arguments)}}()),N_=ue("search/fetchPage",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield As(r,t,e)});return function(_x56,_x57){return _ref24.apply(this,arguments)}}()),__=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Cs(t,r)});return function(_x58,_x59){return _ref25.apply(this,arguments)}}()),V_=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield fv(t,e,r)});return function(_x60,_x61){return _ref26.apply(this,arguments)}}()),L_=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){return bs(e,t)});return function(_x62,_x63){return _ref27.apply(this,arguments)}}()),lv=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=yield It(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function lv(_x64,_x65){return _ref28.apply(this,arguments)}}(),dv=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t,r){let n=yield At(e);return xt({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function dv(_x66,_x67,_x68){return _ref29.apply(this,arguments)}}(),pv=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=yield It(e,t);return r.request.numberOfResults=0,r});return function pv(_x69,_x70){return _ref30.apply(this,arguments)}}(),Ed=e=>{e.configuration.analytics.enabled&&Xe.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function bs(_x71,_x72){return _bs.apply(this,arguments)}function _bs(){_bs=_asyncToGenerator(function*(e,t){Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new kt({...t,analyticsAction:ed()},p=>{t.dispatch(zo({q:p,id:e.id}))}),a=yield dv(o,r,n),m=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),f=yield i.process(m);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _bs.apply(this,arguments)}function As(_x73,_x74,_x75){return _As.apply(this,arguments)}function _As(){_As=_asyncToGenerator(function*(e,t,r){Ed(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new kt({...t,analyticsAction:r}),f=yield It(e,a),p=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(p)});return _As.apply(this,arguments)}function Cs(_x76,_x77){return _Cs.apply(this,arguments)}function _Cs(){_Cs=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield as().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new kt({...e,analyticsAction:as()}),m=yield lv(t,i),f=yield a.fetchFromAPI(m,{origin:"mainSearch"});return yield a.process(f)});return _Cs.apply(this,arguments)}function fv(_x78,_x79,_x80){return _fv.apply(this,arguments)}function _fv(){_fv=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),m=new kt({...e,analyticsAction:t}),f=yield pv(r,a),p=yield m.fetchFromAPI(f,{origin:"facetValues"});return yield m.process(p)});return _fv.apply(this,arguments)}function li(_x81,_x82,_x83){return _li.apply(this,arguments)}function _li(){_li=_asyncToGenerator(function*(e,t,r){Ed(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i});a?.actionCause&&t.dispatch(In({actionCause:a.actionCause}));let m=yield It(e,a),f=new kt({...t,analyticsAction:r}),p=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(p)});return _li.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var Id=pe(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Pt=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t,r){let n=Rs(e),o=mv(e),i=gv(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield At(e,r):Tr(e,t,r);return xt({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:ws(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Pt(_x84,_x85,_x86){return _ref31.apply(this,arguments)}}();function ws(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function mv(e){return Ss(hv(e),e.facetOrder??[])}function gv(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(yv).filter(r=>r.currentValues.length>0):void 0}function yv(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function hv(e){return Sv(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Sv(e){return[...vv(e.facetSet??{}),...kd(e.numericFacetSet??{}),...kd(e.dateFacetSet??{}),...Et(e.categoryFacetSet??{})]}function vv(e){return Et(e).map(t=>{let r=vs[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function kd(e){return Et(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Rs(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Id(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}var Ft=class{constructor(t,r=n=>{this.dispatch(Or({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x87,_x88){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=ni(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,m=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:m,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(wt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:m,queryCorrection:f}=n;if(!o||!i)return null;let p=a.length===0&&m&&m.length!==0,y=!X(f)&&!X(f.correctedQuery);if(!p&&!y)return null;let S=p?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(Je(et(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this20.dispatch(wt(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(Je(et(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(m=>m.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(si("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this21.dispatch(wt(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(Je(et(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Je(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Sd(),o=yield _this22.fetchFromAPI(yield Pt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(oi(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(ci({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Pt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var BV=ue("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;Q(e,{q:new H,enableQuerySyntax:new ne,clearFilters:new ne}),e.clearFilters&&(r($o()),r(Xl())),r(Zl({allow:!0})),r(Or({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Fr(1))}),In=T("search/updateSearchAction"),Pd=ue("search/executeSearch",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return li(r,t,e.legacy);Fd(r);let n=e.next?Od(e.next):void 0;t.dispatch(In(e.next));let o=yield Pt(r,t.extra.navigatorContext,n),i=new Ft({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x89,_x90){return _ref32.apply(this,arguments)}}()),$V=ue("search/fetchPage",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(Fd(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return As(r,t,e.legacy);let n=new Ft({...t,analyticsAction:e.next}),o=yield Pt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x91,_x92){return _ref33.apply(this,arguments)}}()),HV=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Cs(t,r);let n=Rl("browseResults",t.getState),o=new Ft({...t,analyticsAction:n}),i=yield bv(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x93,_x94){return _ref34.apply(this,arguments)}}()),zV=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return li(r,t,e.legacy);let n=new Ft({...t,analyticsAction:{}}),o=yield Cv(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x95,_x96){return _ref35.apply(this,arguments)}}()),GV=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return bs(e,t);Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:n,maxResultsPerQuery:o}=e,i=Od(td()),a=yield Av(r,t.extra.navigatorContext,n,o,i),m=new Ft({...t,analyticsAction:i},y=>{t.dispatch(zo({q:y,id:e.id}))}),f=yield m.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),p=yield m.process(f);return"response"in p?{results:p.response.results,searchUid:p.response.searchUid,totalCountFiltered:p.response.totalCountFiltered,duration:p.duration}:p});return function(_x97,_x98){return _ref36.apply(this,arguments)}}()),bv=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t,r){let n=yield Pt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function bv(_x99,_x100,_x101){return _ref37.apply(this,arguments)}}(),Av=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r,n,o){let i=Tr(e,t,o);return xt({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function Av(_x102,_x103,_x104,_x105,_x106){return _ref38.apply(this,arguments)}}(),Cv=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r){let n=yield Pt(e,t,r);return n.request.numberOfResults=0,n});return function Cv(_x107,_x108,_x109){return _ref39.apply(this,arguments)}}(),Fd=e=>{e.configuration.analytics.enabled&&Xe.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Od=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();var di=e=>je({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ar(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ar(t)??"",answerGenerated:e??!1})});d();c();l();u();d();c();l();u();var Td=pe(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})}});d();c();l();u();var Dd=pe(e=>e.context,e=>e);d();c();l();u();var qd=pe(e=>e.pipeline,e=>e);d();c();l();u();d();c();l();u();var kn=(e,t)=>{let r=e;return X(r[t])?X(e.raw[t])?null:e.raw[t]:r[t]},wv=e=>t=>e.every(r=>!X(kn(t,r))),Rv=e=>t=>e.every(r=>X(kn(t,r))),xv=(e,t)=>r=>{let n=jd(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},Ev=(e,t)=>r=>{let n=jd(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},jd=(e,t)=>{let r=kn(t,e);return Sc(r)?r:[r]},Md={getResultProperty:kn,fieldsMustBeDefined:wv,fieldsMustNotBeDefined:Rv,fieldMustMatch:xv,fieldMustNotMatch:Ev};var Nd=pe(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();var _d=pe(e=>e.searchHub,e=>e);d();c();l();u();var xs=pe(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),WL=pe(e=>e,e=>{let t=xs(e);return t&&e?e[t].expression:""});var Vd=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ke(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Vd(_x110){return _ref40.apply(this,arguments)}}(),Ld=(e,t)=>{let r=Bo(e)?.q,{aq:n,cq:o,dq:i,lq:a}=kv(e),m=Dd(e),f=Zo(e.configuration.analytics,t,{actionCause:Nd(e)}),p=_d(e),y=qd(e),h=il(e)??[],S=Iv(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:h}},...(p?.length&&{searchHub:p}),...(y?.length&&{pipeline:y}),...(Object.keys(S).length&&{facets:S}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:ws(e),firstResult:e.pagination.firstResult}),tab:xs(e.tabSet),...f}},Iv=e=>ui(e)?.map(t=>ys(t,gs())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),kv=e=>{let t=Td(e),r=Rs(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Ud=["text/plain","text/markdown"];var qr=new H({required:!0}),Bd=new H,jr=new ne({required:!0}),Pv={id:qr,title:qr,uri:qr,permanentid:qr,clickUri:Bd},$d=new H({required:!0,constrainTo:Ud}),OU=T("generatedAnswer/setIsVisible",e=>Q(e,jr)),TU=T("generatedAnswer/setIsEnabled",e=>Q(e,jr)),Is=T("generatedAnswer/updateMessage",e=>Q(e,{textDelta:qr})),ks=T("generatedAnswer/updateCitations",e=>Q(e,{citations:new ie({required:!0,each:new K({values:Pv})})})),Fv=T("generatedAnswer/updateError",e=>Q(e,{message:Bd,code:new J({min:0})})),Hd=T("generatedAnswer/resetAnswer"),DU=T("generatedAnswer/like"),qU=T("generatedAnswer/dislike"),jU=T("generatedAnswer/feedbackModal/open"),MU=T("generatedAnswer/expand"),NU=T("generatedAnswer/collapse"),_U=T("generatedAnswer/setId",e=>Q(e,{id:new H({required:!0})})),VU=T("generatedAnswer/feedbackModal/close"),LU=T("generatedAnswer/sendFeedback"),Es=T("generatedAnswer/setIsLoading",e=>Q(e,jr)),Qd=T("generatedAnswer/setIsStreaming",e=>Q(e,jr)),Ps=T("generatedAnswer/setAnswerContentFormat",e=>Q(e,$d)),UU=T("generatedAnswer/updateResponseFormat",e=>Q(e,{contentFormat:new ie({each:$d,default:["text/plain"]})})),QU=T("knowledge/updateAnswerConfigurationId",e=>Q(e,qr)),BU=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>Q(e,io)),Ov=T("generatedAnswer/setIsAnswerGenerated",e=>Q(e,jr)),Fs=T("generatedAnswer/setCannotAnswer",e=>Q(e,jr)),Tv=T("generatedAnswer/setAnswerApiQueryParams",e=>Q(e,new K({}))),$U=ue("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:m}=a,{setAbortControllerRef:f}=e,p=yield Vd(r),y=(g,v)=>{switch(g){case"genqa.headerMessageType":{let x=JSON.parse(v);n(Ps(x.contentFormat));break}case"genqa.messageType":n(Is(JSON.parse(v)));break;case"genqa.citationsType":n(ks(JSON.parse(v)));break;case"genqa.endOfStreamType":{let x=JSON.parse(v).answerGenerated,k=m.length!==0&&!x;n(Fs(k)),n(Qd(!1)),n(Ov(x)),n(di(x));break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Es(!0));let h=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(p,{write:g=>{h(p)&&(n(Es(!1)),g.payload&&g.payloadType&&y(g.payloadType,g.payload))},abort:g=>{h(p)&&n(Fv(g))},close:()=>{h(p)&&n(Qd(!1))},resetAnswer:()=>{h(p)&&n(Hd())}});S?f(S):n(Es(!1))});return function(_x111,_x112){return _ref41.apply(this,arguments)}}()),HU=ue("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){let i=t();if(i.generatedAnswer.answerConfigurationId){let a=Ld(i,n);r(Hd()),r(Tv(a)),yield r(zd(a)),r(In(void 0))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x113,_x114){return _ref42.apply(this,arguments)}}());d();c();l();u();d();c();l();u();function Wd(_x115,_x116){return _Wd.apply(this,arguments)}function _Wd(){_Wd=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Wd.apply(this,arguments)}function Kd(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=qv(t,a);let m=t.length,f=0;for(;r<m;){o&&(t[r]===10&&(f=++r),o=!1);let p=-1;for(;r<m&&p===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,p=r;break;case 10:p=r;break}if(p===-1)break;e(t.subarray(f,p),n),f=r,n=-1}f===m?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function Yd(e,t,r){let n=Gd(),o=new TextDecoder;return function(a,m){if(a.length===0)r?.(n),n=Gd();else if(m>0){let f=o.decode(a.subarray(0,m)),p=m+(a[m+1]===32?2:1),y=o.decode(a.subarray(p));switch(f){case"data":n.data=n.data?`${n.data}
|
|
31
31
|
${y}`:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":Dv(y,n,t);break}}}}function Dv(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function qv(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Gd(){return{data:"",event:"",id:"",retry:void 0}}var Os="text/event-stream",jv=1e3,Jd="last-event-id";function Xd(){return typeof window<"u"}function Zd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:m,fetch:f,...p}){return new Promise((y,h)=>{let S={...r};S.accept||(S.accept=Os);let g;function v(){g?.abort(),document.hidden||E()}!m&&Xd()&&document.addEventListener("visibilitychange",v);let x=jv,k;function R(){Xd()&&document.removeEventListener("visibilitychange",v),clearTimeout(k),g?.abort()}t?.addEventListener("abort",()=>{R(),y()});let P=f??A,w=n??Mv;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let M=yield P(e,{...p,headers:S,signal:g?.signal});yield w(M),yield Wd(M.body,Kd(Yd(O=>{O?S[Jd]=O:delete S[Jd]},O=>{x=O},o))),i?.(),R(),y()}catch(M){if(!g?.signal?.aborted)try{let O=a?.(M)??x;clearTimeout(k),k=setTimeout(E,O)}catch(O){R(),h(O)}}});return _E.apply(this,arguments)}E()})}function Mv(e){let t=e.headers.get("content-type");if(!t?.startsWith(Os))throw new Error(`Expected content-type to be ${Os}, Actual: ${t}`)}d();c();l();u();var Nv=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,m=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let p=ke(a,i);return{data:$l({baseUrl:`${p}/rest/organizations/${a}/answer/v1/configs/${m}`,fetchFn:function(){var _ref44=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{g[v]=h[v]}),g.duplex="half",g.body=yield h.text(),A(S,g)});return function fetchFn(_x120){return _ref44.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(p){return{error:p}}});return function Nv(_x117,_x118,_x119){return _ref43.apply(this,arguments)}}(),ep=Jl({reducerPath:"answer",baseQuery:Hl(Nv,{maxRetries:3}),endpoints:()=>({})});var _v=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},Vv=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},Lv=(e,t)=>{e.citations=t.citations},Uv=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},Qv=(e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)},Bv=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&Qv(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(_v(t,o),r(Ps(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(Vv(t,o),r(Is({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(Lv(t,o),r(ks({citations:o.citations})));break;case"genqa.endOfStreamType":Uv(t,o),r(di(o.answerGenerated??!1));break}},Ts=ep.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x121,_x122){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:m,insightConfiguration:f}=r(),{organizationId:p,environment:y,accessToken:h}=a,S=ke(p,y),g=`${S}/rest/organizations/${p}/insight/v1/configs/${f?.insightId}/answer/${m.answerConfigurationId}/generate`,v=`${S}/rest/organizations/${p}/answer/v1/configs/${m.answerConfigurationId}/generate`;yield Zd(f?g:v,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref45=_asyncToGenerator(function*(x){let k=x.headers.get("x-answer-id");k&&o(R=>{R.answerId=k})});return function onopen(_x123){return _ref45.apply(this,arguments)}}(),onmessage:x=>{o(k=>{Bv(x,k,i)})},onerror:x=>{throw x},onclose:()=>{o(x=>{i(Fs(!x.generated))})}})}).apply(this,arguments)}})})}),zd=e=>Ts.endpoints.getAnswer.initiate(e);d();c();l();u();var tp=ge(sr,e=>e);d();c();l();u();function $v(e){let t=e.payload?.analyticsAction;return rp(e)&&!X(t)}function rp(e){return"type"in e}var np=e=>t=>r=>{let n;$v(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return rp(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var QQ=T("tab/register",e=>{let t=new K({values:{id:W,expression:we}});return Q(e,t)}),pi=T("tab/updateActiveTab",e=>Q(e,W));d();c();l();u();var fi=Qe(ei(),1),ap=Qe(op(),1),sp=Qe(ip(),1);fi.default.extend(sp.default);fi.default.extend(ap.default);var cp=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:fi.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});d();c();l();u();var Hv=/(^|; )Coveo-Pendragon=([^;]*)/;function Ns(){return typeof window>"u"?!1:Hv.exec(document.cookie)?.pop()||null}var up=ge(cp(),e=>e.addCase(yt,(t,r)=>{zv(t,r.payload)}).addCase(Ye,(t,r)=>{Gv(t,r.payload)}).addCase(cr,(t,r)=>{Wv(t,r.payload)}).addCase(ur,t=>{t.analytics.enabled=!1}).addCase(lr,t=>{t.analytics.enabled=!0}).addCase(ao,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(so,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(pi,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Eu,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ht,(t,r)=>{X(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function zv(e,t){X(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",X(t.organizationId)||(e.organizationId=t.organizationId)}function Gv(e,t){X(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),X(t.locale)||(e.search.locale=t.locale),X(t.timezone)||(e.search.timezone=t.timezone),X(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function Wv(e,t){X(t.enabled)||(e.analytics.enabled=t.enabled),X(t.originContext)||(e.analytics.originContext=t.originContext),X(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),X(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),X(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),X(t.trackingId)||(e.analytics.trackingId=t.trackingId),X(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),X(t.source)||(e.analytics.source=t.source);try{let r=Ns();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}X(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),X(t.anonymous)||(e.analytics.anonymous=t.anonymous),X(t.deviceId)||(e.analytics.deviceId=t.deviceId),X(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),X(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var He=up;d();c();l();u();function Kv(e){return e.instantlyCallable}var lp=()=>e=>t=>e(Kv(t)?t():t);d();c();l();u();var dp=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error,i=[n.payload?.errorCode,n.payload?.message].filter(Boolean).join(" - ");if(n.payload?.ignored||e.error(i||o.stack||o.message||o.name||"Error",`Action dispatch error ${n.type}`,r),n.error.name!=="SchemaValidationError")return t(r)},pp=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var _s=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};d();c();l();u();function fp(e,t){let r={...e},n,o=i=>(a,m)=>{let f=i(a,m);return n?n(f,m):f};return{get combinedReducer(){let i=bc(Object.entries(t).filter(([a])=>!(a in r)).map(([a,m])=>[a,()=>m]));return o(tr({...i,...r}))},containsAll(i){return Object.keys(i).every(m=>m in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function mi(e,t,r){var n,o,i;t===void 0&&(t=50),r===void 0&&(r={});var a=(n=r.isImmediate)!=null&&n,m=(o=r.callback)!=null&&o,f=r.maxWait,p=Date.now(),y=[];function h(){if(f!==void 0){var g=Date.now()-p;if(g+t>=f)return f-g}return t}var S=function(){var g=[].slice.call(arguments),v=this;return new Promise(function(x,k){var R=a&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,p=Date.now(),!a){var w=e.apply(v,g);m&&m(w),y.forEach(function(E){return(0,E.resolve)(w)}),y=[]}},h()),R){var P=e.apply(v,g);return m&&m(P),x(P)}y.push({resolve:x,reject:k})})};return S.cancel=function(g){i!==void 0&&clearTimeout(i),y.forEach(function(v){return(0,v.reject)(g)}),y=[]},S}d();c();l();u();function Yv(e){if(!e||!Jv(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function mp(e,t=60){if(!e)return!1;let r=Yv(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function Jv(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function yp(e,t){let r=0,n=null,o=mi(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(f,p=!1){let y=!n;y&&t&&(n=_asyncToGenerator(function*(){return p&&Zv(t),yield t()})().finally(()=>{n=null}));let h=yield n;return y&&h&&f.dispatch(yt({accessToken:h})),h});return function i(_x124){return _ref46.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(f){let p=f.getState(),y=eb(p);if(!(!y||!mp(y))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(h){e.warn(h,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x125){return _ref48.apply(this,arguments)}}(),m=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(f,p,y){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),gp(f,p.error),p;r++,o(),yield i(f,!0),f.dispatch(y)});return function m(_x126,_x127,_x128){return _ref49.apply(this,arguments)}}();return f=>p=>(/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(y){let h=typeof y=="function",S=typeof t=="function";if(!h)return p(y);S&&(yield a(f));let g=yield p(y);return Xv(g)?S?yield m(f,g,y):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),gp(f,g.error),g):g});return function(_x129){return _ref50.apply(this,arguments)}}())}function Xv(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new er().name}function gp(e,t){e.dispatch(fo({status:401,statusCode:401,message:t.message,type:t.name}))}function Zv(_x130){return _Zv.apply(this,arguments)}function _Zv(){_Zv=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _Zv.apply(this,arguments)}function eb(e){return e.configuration.accessToken}d();c();l();u();function hp({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return lu({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(pp(n.logger))})}function tb(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&vc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function Sp(e,t){let r={...e.reducers,configuration:He,version:tp},n=rb({...e,reducers:r},t,He),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(yt({accessToken:o,environment:i,organizationId:a}));let m=tb(e.configuration,n.logger);return m&&n.dispatch(cr(m)),n}function rb(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=fp({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,m={...t,get relay(){return Sn(p.state,o)},get navigatorContext(){return _s(this.relay,o)}},f=nb(e,m,i),p={addReducers(y){i.containsAll(y)||(i.add(y),f.replaceReducer(i.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(lr())},disableAnalytics(){f.dispatch(ur())},get state(){return f.getState()},get relay(){return Sn(this.state,o)},get navigatorContext(){return _s(this.relay,o)},logger:a,store:f};return p}function nb(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=ob(e,t.logger);return hp({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function ob(e,t){let{renewAccessToken:r}=e.configuration,n=yp(t,r);return[lp,n,dp(t),np].concat(Ts.middleware,e.middlewares||[])}d();c();l();u();var Ip=Qe(Ep(),1);function kp(e){return(0,Ip.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function Pp(e,t){let r=Cb(e),n=Ve,o=wb(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function Cb(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function wb(e){return e.preprocessRequest||Ln}d();c();l();u();d();c();l();u();var Fp={organizationId:W,accessToken:W,name:new H({required:!1,emptyAllowed:!1}),analytics:new K({options:{required:!1},values:{enabled:new ne({required:!1}),originContext:new H({required:!1}),originLevel2:new H({required:!1}),originLevel3:new H({required:!1}),analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new H({required:!1,url:!0}),trackingId:new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new H({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function Op(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Tp=new Fe({...Fp,pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,locale:Ce,timezone:Ce});function $s(){return{...Op(),searchHub:"default"}}var Rb={debug:po,pipeline:fr,searchHub:Ir,recommendation:xr};function Dp(e){let t=kp(e.loggerOptions);xb(e.configuration,t);let r=Eb(e.configuration,t),n={...Pp(e.configuration,t),apiClient:r},o={...e,reducers:Rb},i=Sp(o,n),{pipeline:a,searchHub:m,timezone:f,locale:p,proxyBaseUrl:y}=e.configuration;return i.dispatch(Ye({timezone:f,locale:p,proxyBaseUrl:y})),X(a)||i.dispatch(dr(a)),X(m)||i.dispatch(Er(m)),{...i,get state(){return i.state}}}function xb(e,t){try{Tp.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function Eb(e,t){return new Bn({logger:t,preprocessRequest:e.preprocessRequest||Ln,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Nc,postprocessFacetSearchResponseMiddleware:_c,postprocessQuerySuggestResponseMiddleware:Vc})}d();c();l();u();d();c();l();u();d();c();l();u();var Ib=new ie({each:W,required:!0}),qp=(e,t)=>(Q(e,W),Mn(t)?Q(t,W):Q(t,Ib),{payload:{contextKey:e,contextValue:t}}),zt=T("context/set",e=>{for(let[t,r]of Object.entries(e))qp(t,r);return{payload:e}}),Gt=T("context/add",e=>qp(e.contextKey,e.contextValue)),Wt=T("context/remove",e=>Q(e,W));d();c();l();u();var hi=ge(ii(),e=>{e.addCase(zt,(t,r)=>{t.contextValues=r.payload}).addCase(Gt,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Wt,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();function Tt(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),m=t!==a;return t=a,m}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),m;return n()&&(t=JSON.stringify(this.state),m=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(a,i),()=>{r.delete(a),n()&&m?.()}},get state(){return{}}}}d();c();l();u();var kb=["caseId","caseNumber"],Pb={caseId:"caseContext",caseNumber:"caseContext"},Fn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${Pb[t]} to set this value.}`)}};function Hs(e){return kb.includes(e)}var Fb=new Fe({values:new K({options:{required:!1}})});function jp(e,t={}){if(!Db(e))throw ze;let r=Tt(e),{dispatch:n}=e,o=()=>e.state,i=bu(e,Fb,t.initialState,"buildContext");return i.values&&n(zt(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(zt(a))},...(o().configuration.analytics.analyticsMode==="legacy"?Ob(n):Tb(n))}}var Ob=e=>({add(t,r){e(Gt({contextKey:t,contextValue:r}))},remove(t){e(Wt(t))}}),Tb=e=>({add(t,r){if(Hs(t))throw new Fn(t);e(Gt({contextKey:t,contextValue:r}))},remove(t){if(Hs(t))throw new Fn(t);e(Wt(t))}});function Db(e){return e.addReducers({context:hi}),!0}function Mp(e,t){return jp(e,t)}d();c();l();u();d();c();l();u();var Nr=T("dictionaryFieldContext/set",e=>{let t=new K({options:{required:!0}}),r=Q(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:we}),i=Q(n,o).error;return i?{payload:e,error:i}:{payload:e}}),_r=T("dictionaryFieldContext/add",e=>{let t=new K({options:{required:!0},values:{field:we,key:we}});return Q(e,t)}),Vr=T("dictionaryFieldContext/remove",e=>Q(e,we));d();c();l();u();var Si=ge(ai(),e=>{e.addCase(Nr,(t,r)=>{t.contextValues=r.payload}).addCase(_r,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Vr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function Np(e){if(!qb(e))throw ze;let t=Tt(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Nr(o))},add(o,i){r(_r({field:o,key:i}))},remove(o){r(Vr(o))}}}function qb(e){return e.addReducers({dictionaryFieldContext:Si}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var On={value:W,numberOfResults:new J({min:0}),state:W};d();c();l();u();var le=W;var _b=new J({min:1,default:8,required:!1}),Vb=new J({min:1,max:20,default:5,required:!1}),Lb={desiredCount:Vb,numberOfValues:_b},kz=T("automaticFacet/setOptions",e=>Q(e,Lb)),Pz=T("automaticFacet/deselectAll",e=>Q(e,le)),Ub=W,_p=T("automaticFacet/toggleSelectValue",e=>Q(e,{field:Ub,selection:new K({values:On})}));d();c();l();u();d();c();l();u();var Qb={state:new fe({required:!0}),numberOfResults:new J({required:!0,min:0}),value:new H({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:W}),moreValuesAvailable:new ne({required:!1})};function zs(e){e.children.forEach(t=>{zs(t)}),Ve({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},Qb)}var Lr={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),delimitingCharacter:new H({required:!1,emptyAllowed:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),basePath:new ie({required:!1,each:W}),filterByBasePath:new ne({required:!1})};var Gz=T("categoryFacet/register",e=>Q(e,Lr)),Vp=T("categoryFacet/toggleSelectValue",e=>{try{return Ve(e.facetId,W),zs(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),Lp=T("categoryFacet/deselectAll",e=>Q(e,Lr.facetId)),Wz=T("categoryFacet/updateNumberOfValues",e=>Q(e,{facetId:Lr.facetId,numberOfValues:Lr.numberOfValues})),Kz=T("categoryFacet/updateSortCriterion",e=>Q(e,{facetId:Lr.facetId,criterion:new fe})),Yz=T("categoryFacet/updateBasePath",e=>Q(e,{facetId:Lr.facetId,basePath:new ie({each:W})}));d();c();l();u();d();c();l();u();var Tn={facetId:le,captions:new K({options:{required:!1}}),numberOfValues:new J({required:!1,min:1}),query:new H({required:!1,emptyAllowed:!0})};var Bb={path:new ie({required:!0,each:W}),displayValue:we,rawValue:we,count:new J({required:!0,min:0})},Up=T("categoryFacet/selectSearchResult",e=>Q(e,{facetId:le,value:new K({values:Bb})})),m2=T("categoryFacetSearch/register",e=>Q(e,Tn));d();c();l();u();var Qp={facetId:le,value:new K({values:{displayValue:we,rawValue:we,count:new J({required:!0,min:0})}})},x2=T("facetSearch/register",e=>Q(e,Tn)),E2=T("facetSearch/update",e=>Q(e,Tn)),Bp=T("facetSearch/toggleSelectValue",e=>Q(e,Qp)),$p=T("facetSearch/toggleExcludeValue",e=>Q(e,Qp));d();c();l();u();d();c();l();u();var D2=new H({regex:/^[a-zA-Z0-9-_]+$/}),q2=new H({required:!0}),j2=new ie({each:new H}),M2=new H,N2=new ne,_2=new ne,V2=new J({min:0}),$b=new J({min:1}),L2=new ne({required:!0}),Hb=new K,zb=new H,Gb={captions:Hb,numberOfValues:$b,query:zb},U2=new K({values:Gb}),Hp=new K({options:{required:!1},values:{type:new H({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new H({emptyAllowed:!1,required:!0})})}}),Q2=new ne,zp=new ie({min:1,max:25,required:!1,each:new H({emptyAllowed:!1,required:!0})});var Wb={facetId:le,field:new H({required:!0,emptyAllowed:!0}),tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),resultsMustMatch:new fe({required:!1}),allowedValues:Hp,customSort:zp},eG=T("facet/register",e=>Q(e,Wb)),Gp=T("facet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:On})})),Wp=T("facet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:On})})),vi=T("facet/deselectAll",e=>Q(e,le)),tG=T("facet/updateSortCriterion",e=>Q(e,{facetId:le,criterion:new fe({required:!0})})),rG=T("facet/updateNumberOfValues",e=>Q(e,{facetId:le,numberOfValues:new J({required:!0,min:1})})),nG=T("facet/updateIsFieldExpanded",e=>Q(e,{facetId:le,isFieldExpanded:new ne({required:!0})})),oG=T("facet/updateFreezeCurrentValues",e=>Q(e,{facetId:le,freezeCurrentValues:new ne({required:!0})}));d();c();l();u();d();c();l();u();function Yp(e){let t=Kp(e.start,e),r=Kp(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function Kp(e,t){let{dateFormat:r}=t;return fd(e)?(ms(e),ld(e)):typeof e=="string"&&Rt(e)?(ms(e),e):(ad(e,r),ri(Dr(e,r)))}d();c();l();u();var Jp=T("rangeFacet/updateSortCriterion",e=>Q(e,{facetId:le,criterion:new fe({required:!0})}));d();c();l();u();var bi={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ne({required:!0}),numberOfResults:new J({required:!0,min:0})},Ai={start:W,end:W,endInclusive:new ne({required:!0}),state:W,numberOfResults:new J({required:!0,min:0})};var Kb={start:W,end:W,endInclusive:new ne({required:!0}),state:W},Yb={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:Kb})}),generateAutomaticRanges:new ne({required:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function Xp(e){return Rt(e)?xn(e):e}function Zp(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Yp(t);if(Dr(Xp(r)).isAfter(Dr(Xp(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var $G=T("dateFacet/register",e=>{try{return Ve(e,Yb),Zp(e),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),ef=T("dateFacet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:Ai})})),tf=T("dateFacet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:Ai})})),rf=T("dateFacet/updateFacetValues",e=>{try{return Ve(e,{facetId:le,values:new ie({each:new K({values:Ai})})}),Zp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}});d();c();l();u();var Jb={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ne({required:!0})},Xb={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:Jb})}),generateAutomaticRanges:new ne({required:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function nf(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var nW=T("numericFacet/register",e=>{try{return Q(e,Xb),nf(e),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),of=T("numericFacet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:bi})})),af=T("numericFacet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:bi})})),sf=T("numericFacet/updateFacetValues",e=>{try{return Ve(e,{facetId:le,values:new ie({each:new K({values:bi})})}),nf({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}});var cf=ge(En(),e=>{e.addCase(Wo,(t,r)=>{let n=Gs(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Dn(n,o)}).addCase(Ko,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(pi,t=>{t.firstResult=0}).addCase(Yo,(t,r)=>{let n=r.payload;t.firstResult=Dn(n,t.numberOfResults)}).addCase(Fr,(t,r)=>{let n=r.payload;t.firstResult=Dn(n,t.numberOfResults)}).addCase(Xo,t=>{let r=Gs(t),n=Math.max(r-1,1);t.firstResult=Dn(n,t.numberOfResults)}).addCase(Jo,t=>{let r=Gs(t),n=eA(t),o=Math.min(r+1,n);t.firstResult=Dn(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(ht,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Pd.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(vi,t=>{Ie(t)}).addCase(tf,t=>{Ie(t)}).addCase(Wp,t=>{Ie(t)}).addCase(af,t=>{Ie(t)}).addCase($p,t=>{Ie(t)}).addCase(Gp,t=>{Ie(t)}).addCase(Lp,t=>{Ie(t)}).addCase(Vp,t=>{Ie(t)}).addCase(Up,t=>{Ie(t)}).addCase(ef,t=>{Ie(t)}).addCase(of,t=>{Ie(t)}).addCase($o,t=>{Ie(t)}).addCase(rf,t=>{Ie(t)}).addCase(sf,t=>{Ie(t)}).addCase(Bp,t=>{Ie(t)}).addCase(_p,t=>{Ie(t)})});function Ie(e){e.firstResult=En().firstResult}function Gs(e){let{firstResult:t,numberOfResults:r}=e;return tA(t,r)}function eA(e){let{totalCountFiltered:t,numberOfResults:r}=e;return rA(t,r)}function Dn(e,t){return(e-1)*t}function tA(e,t){return Math.round(e/t)+1}function rA(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Ws(e){return e.addReducers({pagination:cf}),{nextPage:Jo,previousPage:Xo,registerNumberOfResults:Wo,registerPage:Yo,updateNumberOfResults:Ko,updatePage:Fr}}var nA=new Fe({id:new H({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new J({min:0})});function uf(e,t={}){if(!oA(e))throw ze;let r=Tt(e),{dispatch:n}=e,o=()=>e.state,i=Au(e,nA,t.options,"buildRecommendationList");return i.id!==""&&n(Rr({id:i.id})),i.numberOfRecommendations&&n(Ws(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(bt())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function oA(e){return e.addReducers({recommendation:xr,configuration:He}),!0}d();c();l();u();d();c();l();u();function lf(e,t,r){if(!iA(e))throw ze;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:mi(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function iA(e){return e.addReducers({configuration:He}),!0}function df(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Vo(t.options.result)))};return lf(e,t,()=>{n()})}d();c();l();u();d();c();l();u();d();c();l();u();var Dt=()=>new H({required:!1,emptyAllowed:!0}),Ci=T("advancedSearchQueries/update",e=>Q(e,{aq:Dt(),cq:Dt(),lq:Dt(),dq:Dt()})),wi=T("advancedSearchQueries/register",e=>Q(e,{aq:Dt(),cq:Dt(),lq:Dt(),dq:Dt()}));var pf=ge(Ct(),e=>{e.addCase(Ci,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0),ve(i)||(t.lq=i,t.lqWasSet=!0),ve(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(wi,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ve(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ve(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ve(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(ht,(t,r)=>{let{aq:n,cq:o}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0)})});function aA(e){return e.addReducers({advancedSearchQueries:pf}),{updateAdvancedSearchQueries:Ci,registerAdvancedSearchQueries:wi}}d();c();l();u();function sA(e){return e.addReducers({configuration:He}),{disableAnalytics:ur,enableAnalytics:lr,setOriginLevel2:ao,setOriginLevel3:so,updateAnalyticsConfiguration:cr,updateBasicConfiguration:yt}}d();c();l();u();function cA(e){return e.addReducers({configuration:He,pipeline:fr,searchHub:Ir}),{updateSearchConfiguration:Ye}}d();c();l();u();function uA(e){return e.addReducers({context:hi}),{addContext:Gt,removeContext:Wt,setContext:zt}}d();c();l();u();function lA(e){return e.addReducers({debug:po}),{disableDebug:uo,enableDebug:co}}d();c();l();u();function dA(e){return e.addReducers({dictionaryFieldContext:Si}),{addContext:_r,removeContext:Vr,setContext:Nr}}d();c();l();u();d();c();l();u();d();c();l();u();var pA={collectionField:new H({emptyAllowed:!1,required:!1}),parentField:new H({emptyAllowed:!1,required:!1}),childField:new H({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new J({min:0,required:!1})},ff=T("folding/register",e=>Q(e,pA)),EK=ue("folding/loadCollection",/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield At(i):Tr(i,o),m=yield n.search({...a,q:fA(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Oe(m)?r(m.error):{collectionId:e,results:m.success.results,searchUid:m.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x131,_x132){return _ref51.apply(this,arguments)}}());function fA(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var mf=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});d();c();l();u();var Ur=T("fields/registerFieldsToInclude",e=>Q(e,io)),Ri=T("fields/fetchall/enable"),xi=T("fields/fetchall/disable"),Ei=ue("fields/fetchDescription",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:m}=o.configuration,{apiBaseUrl:f}=o.configuration.search,p=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:m,url:f??pt(m,a)});return Oe(p)?n(p.error):p.success.fields});return function(_x133,_x134){return _ref52.apply(this,arguments)}}());d();c();l();u();var Ii=["author","language","urihash","objecttype","collection","source","permanentid"],Ks=[...Ii,"date","filetype","parents"],gf=[...Ks,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],yf=()=>({fieldsToInclude:Ii,fetchAllFields:!1,fieldsDescription:[]});var ki=ge(yf(),e=>e.addCase(Ur,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Ri,t=>{t.fetchAllFields=!0}).addCase(xi,t=>{t.fetchAllFields=!1}).addCase(Ei.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(ff,(t,{payload:r})=>{let n=mf().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function mA(e){return e.addReducers({fields:ki}),{registerFieldsToInclude:Ur,enableFetchAllFields:Ri,disableFetchAllFields:xi,fetchFieldsDescription:Ei}}d();c();l();u();function gA(e){return e.addReducers({pipeline:fr}),{setPipeline:dr}}d();c();l();u();function yA(e){return e.addReducers({recommendation:xr}),{getRecommendations:bt,setRecommendationId:Rr}}d();c();l();u();function hA(e){return e.addReducers({}),{logRecommendationOpen:Vo}}d();c();l();u();d();c();l();u();var SA=new Fe({content:new fe({required:!0}),conditions:new fe({required:!0}),priority:new J({required:!1,default:0,min:0}),fields:new ie({required:!1,each:W})});function hf(){let e=[],t=r=>{let n=SA.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new Wr("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function Sf(e){if(!vA(e))throw ze;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=hf();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Ur(i))},selectTemplate:r,selectLinkTemplate:n}}function vA(e){return e.addReducers({fields:ki}),!0}d();c();l();u();function bA(e){return e.addReducers({searchHub:Ir}),{setSearchHub:Er}}/**
|
|
32
32
|
* @license
|
|
33
33
|
*
|
|
@@ -44,6 +44,4 @@ ${y}`:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":D
|
|
|
44
44
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
45
45
|
* See the License for the specific language governing permissions and
|
|
46
46
|
* limitations under the License.
|
|
47
|
-
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
48
|
-
|
|
49
|
-
window.coveoQuanticVersion = '3.30.2-pre.ebbb6c85a7';
|
|
47
|
+
*/if(__exports!=exports)module.exports=exports;return module.exports});
|