@coveo/quantic 3.20.1-pre.e76cf03e5b → 3.20.1

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.
@@ -24,7 +24,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24
24
 
25
25
  ${t}
26
26
  `;return new Ss(r)}var Ss=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ue=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw Gv(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}},ve=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&oe(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 ze(e){return e===void 0}function Hv(e){return e===null}function oe(e){return ze(e)||Hv(e)}var J=class{constructor(e={}){be(this,"value");this.config=e,this.value=new ve(e)}validate(e){let t=this.value.validate(e);return t||(Wv(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 Wv(e){return ze(e)||SS(e)}function SS(e){return typeof e=="number"&&!isNaN(e)}var ne=class{constructor(e={}){be(this,"value");this.value=new ve(e)}validate(e){let t=this.value.validate(e);return t||(zv(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function zv(e){return ze(e)||Uc(e)}function Uc(e){return typeof e=="boolean"}var Kv=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,D=class{constructor(e={}){be(this,"value");be(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new ve(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,d=this.value.validate(e);if(d)return d;if(ze(e))return null;if(!Go(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(", ")}.`:a&&!(Kv.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 Go(e){return Object.prototype.toString.call(e)==="[object String]"}var B=class{constructor(e={}){be(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ze(e))return this.config.options.required?"value is required and is currently undefined":null;if(!hS(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&oe(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=" "+a)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function hS(e){return e!==void 0&&typeof e=="object"}var te=class{constructor(e={}){be(this,"value");this.config=e,this.value=new ve(this.config)}validate(e){if(!oe(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(oe(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&&oe(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 Uc(e)||Go(e)||SS(e)||hS(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ho(e){return Array.isArray(e)}var jt=class{constructor(e){be(this,"value");this.config=e,this.value=new ve(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ze(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}};l();s();u();c();var on=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function _c(e){return Array.isArray(e)}function jc(e){return e.trim()===""}function yS(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function Yv(e){return btoa(encodeURI(e))}function $c(e,t){let{[e]:r,...n}=t;return n}function Wo(e){return Yv(JSON.stringify(e))}var Jv=new Set(["1",1,"yes",!0]);function CS(){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=>Jv.has(r))}function xS(e){let t={};for(let[r,n]of e)t[r]=n;return t}function AS(e,t,r){return clearTimeout(t),setTimeout(e,r)}function hs(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Xv(e){if(jc(e.openingDelimiter)||jc(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(oe(e.content)||jc(e.content))return e.content;if(e.highlights.length===0)return zo(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],d=a.offset,p=d+a.length;if(p>t)break;r+=zo(e.content.slice(n,d)),r+=e.openingDelimiter,r+=zo(e.content.slice(d,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=zo(e.content.slice(n))),r}function Kp(e,t){return e=zo(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?zp(n,t.notMatchDelimiters):o?zp(o,t.exactMatchDelimiters):a?zp(a,t.correctionDelimiters):r)}function zp(e,t){return t?t.open+e+t.close:e}function zo(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();function RS(_x2,_x3){return _RS.apply(this,arguments)}function _RS(){_RS=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _RS.apply(this,arguments)}function bS(e){let t,r,n,o=!1;return function(d){t===void 0?(t=d,r=0,n=-1):t=eP(t,d);let p=t.length,m=0;for(;r<p;){o&&(t[r]===10&&(m=++r),o=!1);let f=-1;for(;r<p&&f===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:o=!0,f=r;break;case 10:f=r;break}if(f===-1)break;e(t.subarray(m,f),n),m=r,n=-1}m===p?t=void 0:m!==0&&(t=t.subarray(m),r-=m)}}function vS(e,t,r){let n=FS(),o=new TextDecoder;return function(d,p){if(d.length===0)r?.(n),n=FS();else if(p>0){let m=o.decode(d.subarray(0,p)),f=p+(d[p+1]===32?2:1),h=o.decode(d.subarray(f));switch(m){case"data":n.data=n.data?n.data+`
27
- `+h:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":Zv(h,n,t);break}}}}function Zv(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function eP(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function FS(){return{data:"",event:"",id:"",retry:void 0}}var Jp="text/event-stream",tP=1e3,PS="last-event-id";function wS(){return typeof window<"u"}function Gc(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:d,openWhenHidden:p,fetch:m,...f}){return new Promise((h,A)=>{let x={...r};x.accept||(x.accept=Jp);let C;function F(){C?.abort(),document.hidden||T()}!p&&wS()&&document.addEventListener("visibilitychange",F);let w=tP,b;function R(){wS()&&document.removeEventListener("visibilitychange",F),clearTimeout(b),C?.abort()}t?.addEventListener("abort",()=>{R(),h()});let E=m??S,v=n??rP;function T(){return _T2.apply(this,arguments)}function _T2(){_T2=_asyncToGenerator(function*(){C=i.AbortController?new i.AbortController:null;try{let M=yield E(e,{...f,headers:x,signal:C?.signal});yield v(M),yield RS(M.body,bS(vS(q=>{q?x[PS]=q:delete x[PS]},q=>{w=q},o))),a?.(),R(),h()}catch(M){if(!C?.signal?.aborted)try{let q=d?.(M)??w;clearTimeout(b),b=setTimeout(T,q)}catch(q){R(),A(q)}}});return _T2.apply(this,arguments)}T()})}function rP(e){let t=e.headers.get("content-type");if(!t?.startsWith(Jp))throw new Error(`Expected content-type to be ${Jp}, Actual: ${t}`)}l();s();u();c();var an=class{constructor(t){be(this,"_basePath");be(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}};var nP=(e,t,r)=>new an(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,ES=3,oP=5e3,aP="text/event-stream",em=1,Xp=class extends Error{},ys=class extends Error{constructor(r){super(r.message);this.payload=r}},Zp=class{constructor(){be(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Hc=class{constructor(t){be(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:h}=r,A=new Zp;if(!a){this.logger.error("No stream ID found");return}let x=0,C,F=()=>{C&&!A.isActive(C)&&(b?.abort(),h(),R())},w=()=>{A.remove(C),C=AS(F,C,oP),A.add(C)},b=new i.AbortController,R=()=>Gc(nP(n,o,a),{method:"GET",fetch:S,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:b?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===aP)return;throw E.status>=400&&E.status<500&&E.status!==429?new ys({message:"Error opening stream",code:E.status}):new Xp})()},onmessage:E=>{if(b?.signal.aborted)return;let v=JSON.parse(E.data);if(v.finishReason==="ERROR"){A.remove(C),b?.abort(),m({message:v.errorMessage,code:v.statusCode});return}p(v),x=0,v.finishReason==="COMPLETED"?(A.remove(C),f()):w()},onerror:E=>{if(!b?.signal.aborted){if(A.remove(C),E instanceof ys)throw b?.abort(),m(E),E;if(++x>ES){this.logger.info("Maximum retry exceeded.");let v={message:"Failed to complete stream.",code:em};throw b?.abort(),m(v),new ys(v)}this.logger.info(`Retrying...(${x}/${ES})`),h()}}});return R(),b}};l();s();u();c();var BS=Rt(NS(),1);l();s();u();c();l();s();u();c();var OP="recommendation-internal-options",s0=Symbol.for(OP);var W=new Error("Failed to load reducers."),Ko=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var ao=class extends Error{constructor(r,n){super();be(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};l();s();u();c();function MS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function LS(e){return typeof e!="object"||!e?!1:Object.values(e).every(kP)}function kP(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function QS(e){return e===429}var bt=class e{static call(t){return _asyncToGenerator(function*(){let r=qP(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...d}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield S(a,d);if(QS(m.status))throw m;return m});return function p(){return _ref.apply(this,arguments)}}();try{let m=yield(0,BS.backOff)(p,{retry:f=>{let h=f&&QS(f.status);return h&&n.info("Platform retrying request"),h}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new Ko;case 404:throw new ao(a,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new ao(a):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:d}=r,{signal:p,...m}=t,f=hs(m);try{let h=yield o(t,n,d);return{...t,...h}}catch(h){a.error(h,"Platform request preprocessing failed. Returning default request options.")}return f})()}};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 Me(e,t="prod"){return`${Ke(e,t)}/rest/search/v2`}function zc(e,t="prod"){return`${Ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function qP(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=DP(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:m}),signal:d}}function DP(e,t){return t==="application/x-www-form-urlencoded"?LS(e)?MS(e):"":JSON.stringify(e)}l();s();u();c();var Kc=e=>e;l();s();u();c();var US=e=>e,_S=e=>e,jS=e=>e;l();s();u();c();l();s();u();c();function Yo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function gt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Yo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Yo(),extendedResults:{}}}l();s();u();c();function sn(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var cn=e=>{let{response:t}=e;return t.body?VP(e):NP(t)},VP=e=>LP(e)?QP(e):MP(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},NP=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function MP(e){return e.body.statusCode!==void 0}function LP(e){return e.body.exception!==void 0}var QP=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});l();s();u();c();var un=class{constructor(){be(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new i.AbortController;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)}})()}};l();s();u();c();l();s();u();c();function $S(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}l();s();u();c();var Qr=(e,t,r,n)=>{let o=new an(`${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 GS=(e,t)=>{let r=new an(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},HS=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield bt.call({...Qr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:sn(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=$S(r),o=yield r.arrayBuffer(),d=new TextDecoder(n).decode(o);return BP(d)?{success:d}:{error:cn({response:r,body:d})}});return function HS(_x4,_x5){return _ref2.apply(this,arguments)}}();function BP(e){return typeof e=="string"}l();s();u();c();function UP(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function _P(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function As(e,t){if(t&&e.name==="AbortError")return{error:_P(e)};if(e instanceof ao)return{error:UP(e)};throw e}var Yc=class{constructor(t){this.options=t;be(this,"apiCallsQueues",{unknown:new un,mainSearch:new un,facetValues:new un,foldingCollection:new un,instantResults:new un})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield bt.call({...Qr(t,"POST","application/json","/plan"),requestParams:sn(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return As(r);let n=yield r.json();return $P(n)?{success:n}:{error:cn({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield bt.call({...Qr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:sn(t),..._this3.options});if(r instanceof Error)return As(r);let n=yield r.json(),o={response:r,body:n};return jP(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:cn(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>bt.call({...Qr(t,"POST","application/json",""),requestParams:sn(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return As(o,r?.disableAbortWarning);let a=yield o.json(),d={response:o,body:a};return WS(a)?(d.body=zS(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(d)).body}):{error:cn(d)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield bt.call({...Qr(t,"POST","application/json","/facet"),requestParams:sn(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 bt.call({...Qr(t,"POST","application/json",""),requestParams:sn(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(WS(n)){let o={response:r,body:n};return o.body=zS(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:cn({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return HS(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield bt.call({...Qr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return GP(n)?{success:n}:{error:cn({response:r,body:n})}})()}},Jc=e=>e.success!==void 0,je=e=>e.error!==void 0;function WS(e){return e.results!==void 0}function zS(e){let t=Yo();return oe(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function jP(e){return e.completions!==void 0}function $P(e){return e.preprocessingOutput!==void 0}function GP(e){return e.fields!==void 0}l();s();u();c();l();s();u();c();var G=new D({required:!0,emptyAllowed:!1}),Ee=new D({required:!1,emptyAllowed:!1}),Fe=new D({required:!0,emptyAllowed:!0}),KS=new D({required:!1,emptyAllowed:!0}),Xc=new te({each:G,required:!0}),YS=new D({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Br=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),vt=(e,t)=>{if("required"in t)return{payload:new ue({value:t}).validate({value:e}).value};let o=new B({options:{required:!0},values:t}).validate(e);if(o)throw new Ss(o);return{payload:e}},I=(e,t)=>{try{return vt(e,t)}catch(r){return{payload:e,error:Br(r)}}},Le=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return JS(e,t,r,o,"Controller initialization error")},Pe=(e,t,r,n)=>{let o=`Check the options of ${n}`;return JS(e,t,r,o,"Controller initialization error")},JS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};l();s();u();c();l();s();u();c();l();s();u();c();function Ye(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var HP=typeof Symbol=="function"&&Symbol.observable||"@@observable",XS=HP,um=()=>Math.random().toString(36).substring(7).split("").join("."),WP={INIT:`@@redux/INIT${um()}`,REPLACE:`@@redux/REPLACE${um()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${um()}`},Zc=WP;function Zt(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 lm(e,t,r){if(typeof e!="function")throw new Error(Ye(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ye(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ye(1));return r(lm)(e,t)}let n=e,o=t,a=new Map,d=a,p=0,m=!1;function f(){d===a&&(d=new Map,a.forEach((b,R)=>{d.set(R,b)}))}function h(){if(m)throw new Error(Ye(3));return o}function A(b){if(typeof b!="function")throw new Error(Ye(4));if(m)throw new Error(Ye(5));let R=!0;f();let E=p++;return d.set(E,b),function(){if(R){if(m)throw new Error(Ye(6));R=!1,f(),d.delete(E),a=null}}}function x(b){if(!Zt(b))throw new Error(Ye(7));if(typeof b.type>"u")throw new Error(Ye(8));if(typeof b.type!="string")throw new Error(Ye(17));if(m)throw new Error(Ye(9));try{m=!0,o=n(o,b)}finally{m=!1}return(a=d).forEach(E=>{E()}),b}function C(b){if(typeof b!="function")throw new Error(Ye(10));n=b,x({type:Zc.REPLACE})}function F(){let b=A;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ye(11));function E(){let T=R;T.next&&T.next(h())}return E(),{unsubscribe:b(E)}},[XS](){return this}}}return x({type:Zc.INIT}),{dispatch:x,subscribe:A,getState:h,replaceReducer:C,[XS]:F}}function zP(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Zc.INIT})>"u")throw new Error(Ye(12));if(typeof r(void 0,{type:Zc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ye(13))})}function Jo(e){let t=Object.keys(e),r={};for(let d=0;d<t.length;d++){let p=t[d];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{zP(r)}catch(d){a=d}return function(p={},m){if(a)throw a;let f=!1,h={};for(let A=0;A<n.length;A++){let x=n[A],C=r[x],F=p[x],w=C(F,m);if(typeof w>"u"){let b=m&&m.type;throw new Error(Ye(14))}h[x]=w,f=f||w!==F}return f=f||n.length!==Object.keys(p).length,f?h:p}}function Xo(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function ZS(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Ye(15))},d={getState:o.getState,dispatch:(m,...f)=>a(m,...f)},p=e.map(m=>m(d));return a=Xo(...p)(o.dispatch),{...o,dispatch:a}}}function eu(e){return Zt(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var xm=Symbol.for("immer-nothing"),Fs=Symbol.for("immer-draftable"),ct=Symbol.for("immer-state");function Je(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var so=Object.getPrototypeOf;function St(e){return!!e&&!!e[ct]}function ut(e){return e?oh(e)||Array.isArray(e)||!!e[Fs]||!!e.constructor?.[Fs]||ws(e)||Es(e):!1}var KP=Object.prototype.constructor.toString();function oh(e){if(!e||typeof e!="object")return!1;let t=so(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)===KP}function Am(e){return St(e)||Je(15,e),e[ct].base_}function Rs(e,t){co(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function co(e){let t=e[ct];return t?t.type_:Array.isArray(e)?1:ws(e)?2:Es(e)?3:0}function bs(e,t){return co(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function dm(e,t){return co(e)===2?e.get(t):e[t]}function ah(e,t,r){let n=co(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function YP(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ws(e){return e instanceof Map}function Es(e){return e instanceof Set}function io(e){return e.copy_||e.base_}function fm(e,t){if(ws(e))return new Map(e);if(Es(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=oh(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ct];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let d=o[a],p=n[d];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[d]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[d]})}return Object.create(so(e),n)}else{let n=so(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function nu(e,t=!1){return ou(e)||St(e)||!ut(e)||(co(e)>1&&(e.set=e.add=e.clear=e.delete=JP),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>nu(n,!0))),e}function JP(){Je(2)}function ou(e){return Object.isFrozen(e)}var gm={};function uo(e){let t=gm[e];return t||Je(0,e),t}function XP(e,t){gm[e]||(gm[e]=t)}var vs;function ih(){return vs}function ZP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function eh(e,t){t&&(uo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sm(e){hm(e),e.drafts_.forEach(ew),e.drafts_=null}function hm(e){e===vs&&(vs=e.parent_)}function th(e){return vs=ZP(vs,e)}function ew(e){let t=e[ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function rh(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ct].modified_&&(Sm(t),Je(4)),ut(e)&&(e=tu(t,e),t.parent_||ru(t,e)),t.patches_&&uo("Patches").generateReplacementPatches_(r[ct].base_,e,t.patches_,t.inversePatches_)):e=tu(t,r,[]),Sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==xm?e:void 0}function tu(e,t,r){if(ou(t))return t;let n=t[ct];if(!n)return Rs(t,(o,a)=>nh(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return ru(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,d=!1;n.type_===3&&(a=new Set(o),o.clear(),d=!0),Rs(a,(p,m)=>nh(e,n,o,p,m,r,d)),ru(e,o,!1),r&&e.patches_&&uo("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function nh(e,t,r,n,o,a,d){if(St(o)){let p=a&&t&&t.type_!==3&&!bs(t.assigned_,n)?a.concat(n):void 0,m=tu(e,o,p);if(ah(r,n,m),St(m))e.canAutoFreeze_=!1;else return}else d&&r.add(o);if(ut(o)&&!ou(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;tu(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&ru(e,o)}}function ru(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&nu(t,r)}function tw(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ih(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=Fm;r&&(o=[n],a=Ps);let{revoke:d,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=d,p}var Fm={get(e,t){if(t===ct)return e;let r=io(e);if(!bs(r,t))return rw(e,r,t);let n=r[t];return e.finalized_||!ut(n)?n:n===pm(e.base_,t)?(mm(e),e.copy_[t]=Cm(n,e)):n},has(e,t){return t in io(e)},ownKeys(e){return Reflect.ownKeys(io(e))},set(e,t,r){let n=sh(io(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=pm(io(e),t),a=o?.[ct];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(YP(r,o)&&(r!==void 0||bs(e.base_,t)))return!0;mm(e),ym(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 pm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,mm(e),ym(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=io(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Je(11)},getPrototypeOf(e){return so(e.base_)},setPrototypeOf(){Je(12)}},Ps={};Rs(Fm,(e,t)=>{Ps[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ps.deleteProperty=function(e,t){return Ps.set.call(this,e,t,void 0)};Ps.set=function(e,t,r){return Fm.set.call(this,e[0],t,r,e[0])};function pm(e,t){let r=e[ct];return(r?io(r):e)[t]}function rw(e,t,r){let n=sh(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function sh(e,t){if(!(t in e))return;let r=so(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=so(r)}}function ym(e){e.modified_||(e.modified_=!0,e.parent_&&ym(e.parent_))}function mm(e){e.copy_||(e.copy_=fm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var nw=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let d=this;return function(m=a,...f){return d.produce(m,h=>r.call(this,h,...f))}}typeof r!="function"&&Je(6),n!==void 0&&typeof n!="function"&&Je(7);let o;if(ut(t)){let a=th(this),d=Cm(t,void 0),p=!0;try{o=r(d),p=!1}finally{p?Sm(a):hm(a)}return eh(a,n),rh(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===xm&&(o=void 0),this.autoFreeze_&&nu(o,!0),n){let a=[],d=[];uo("Patches").generateReplacementPatches_(t,o,a,d),n(a,d)}return o}else Je(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(d,...p)=>this.produceWithPatches(d,m=>t(m,...p));let n,o;return[this.produce(t,r,(d,p)=>{n=d,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ut(e)||Je(8),St(e)&&(e=ch(e));let t=th(this),r=Cm(e,void 0);return r[ct].isManual_=!0,hm(t),r}finishDraft(e,t){let r=e&&e[ct];(!r||!r.isManual_)&&Je(9);let{scope_:n}=r;return eh(n,t),rh(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=uo("Patches").applyPatches_;return St(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Cm(e,t){let r=ws(e)?uo("MapSet").proxyMap_(e,t):Es(e)?uo("MapSet").proxySet_(e,t):tw(e,t);return(t?t.scope_:ih()).drafts_.push(r),r}function ch(e){return St(e)||Je(10,e),uh(e)}function uh(e){if(!ut(e)||ou(e))return e;let t=e[ct],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=fm(e,t.scope_.immer_.useStrictShallowCopy_)}else r=fm(e,!0);return Rs(r,(n,o)=>{ah(r,n,uh(o))}),t&&(t.finalized_=!1),r}function lh(){let t="replace",r="add",n="remove";function o(x,C,F,w){switch(x.type_){case 0:case 2:return d(x,C,F,w);case 1:return a(x,C,F,w);case 3:return p(x,C,F,w)}}function a(x,C,F,w){let{base_:b,assigned_:R}=x,E=x.copy_;E.length<b.length&&([b,E]=[E,b],[F,w]=[w,F]);for(let v=0;v<b.length;v++)if(R[v]&&E[v]!==b[v]){let T=C.concat([v]);F.push({op:t,path:T,value:A(E[v])}),w.push({op:t,path:T,value:A(b[v])})}for(let v=b.length;v<E.length;v++){let T=C.concat([v]);F.push({op:r,path:T,value:A(E[v])})}for(let v=E.length-1;b.length<=v;--v){let T=C.concat([v]);w.push({op:n,path:T})}}function d(x,C,F,w){let{base_:b,copy_:R}=x;Rs(x.assigned_,(E,v)=>{let T=dm(b,E),M=dm(R,E),q=v?bs(b,E)?t:r:n;if(T===M&&q===t)return;let O=C.concat(E);F.push(q===n?{op:q,path:O}:{op:q,path:O,value:M}),w.push(q===r?{op:n,path:O}:q===n?{op:r,path:O,value:A(T)}:{op:t,path:O,value:A(T)})})}function p(x,C,F,w){let{base_:b,copy_:R}=x,E=0;b.forEach(v=>{if(!R.has(v)){let T=C.concat([E]);F.push({op:n,path:T,value:v}),w.unshift({op:r,path:T,value:v})}E++}),E=0,R.forEach(v=>{if(!b.has(v)){let T=C.concat([E]);F.push({op:r,path:T,value:v}),w.unshift({op:n,path:T,value:v})}E++})}function m(x,C,F,w){F.push({op:t,path:[],value:C===xm?void 0:C}),w.push({op:t,path:[],value:x})}function f(x,C){return C.forEach(F=>{let{path:w,op:b}=F,R=x;for(let M=0;M<w.length-1;M++){let q=co(R),O=w[M];typeof O!="string"&&typeof O!="number"&&(O=""+O),(q===0||q===1)&&(O==="__proto__"||O==="constructor")&&Je(19),typeof R=="function"&&O==="prototype"&&Je(19),R=dm(R,O),typeof R!="object"&&Je(18,w.join("/"))}let E=co(R),v=h(F.value),T=w[w.length-1];switch(b){case t:switch(E){case 2:return R.set(T,v);case 3:Je(16);default:return R[T]=v}case r:switch(E){case 1:return T==="-"?R.push(v):R.splice(T,0,v);case 2:return R.set(T,v);case 3:return R.add(v);default:return R[T]=v}case n:switch(E){case 1:return R.splice(T,1);case 2:return R.delete(T);case 3:return R.delete(F.value);default:return delete R[T]}default:Je(17,b)}}),x}function h(x){if(!ut(x))return x;if(Array.isArray(x))return x.map(h);if(ws(x))return new Map(Array.from(x.entries()).map(([F,w])=>[F,h(w)]));if(Es(x))return new Set(Array.from(x).map(h));let C=Object.create(so(x));for(let F in x)C[F]=h(x[F]);return bs(x,Fs)&&(C[Fs]=x[Fs]),C}function A(x){return St(x)?h(x):x}XP("Patches",{applyPatches_:f,generatePatches_:o,generateReplacementPatches_:m})}var ht=new nw,Ur=ht.produce,au=ht.produceWithPatches.bind(ht),cU=ht.setAutoFreeze.bind(ht),uU=ht.setUseStrictShallowCopy.bind(ht),Rm=ht.applyPatches.bind(ht),lU=ht.createDraft.bind(ht),dU=ht.finishDraft.bind(ht);l();s();u();c();function ow(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function aw(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function iw(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 dh=e=>Array.isArray(e)?e:[e];function sw(e){let t=Array.isArray(e[0])?e[0]:e;return iw(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function cw(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var yU=Symbol();var CU=Object.getPrototypeOf({});var uw=class{constructor(e){this.value=e}deref(){return this.value}},lw=typeof WeakRef<"u"?WeakRef:uw,dw=0,ph=1;function iu(){return{s:dw,v:void 0,o:null,p:null}}function Zo(e,t={}){let r=iu(),{resultEqualityCheck:n}=t,o,a=0;function d(){let p=r,{length:m}=arguments;for(let A=0,x=m;A<x;A++){let C=arguments[A];if(typeof C=="function"||typeof C=="object"&&C!==null){let F=p.o;F===null&&(p.o=F=new WeakMap);let w=F.get(C);w===void 0?(p=iu(),F.set(C,p)):p=w}else{let F=p.p;F===null&&(p.p=F=new Map);let w=F.get(C);w===void 0?(p=iu(),F.set(C,p)):p=w}}let f=p,h;if(p.s===ph)h=p.v;else if(h=e.apply(null,arguments),a++,n){let A=o?.deref?.()??o;A!=null&&n(A,h)&&(h=A,a!==0&&a--),o=typeof h=="object"&&h!==null||typeof h=="function"?new lw(h):h}return f.s=ph,f.v=h,h}return d.clearCache=()=>{r=iu(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}function mh(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,d=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),ow(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let h={...r,...m},{memoize:A,memoizeOptions:x=[],argsMemoize:C=Zo,argsMemoizeOptions:F=[],devModeChecks:w={}}=h,b=dh(x),R=dh(F),E=sw(o),v=A(function(){return a++,f.apply(null,arguments)},...b),T=!0,M=C(function(){d++;let O=cw(E,arguments);return p=v.apply(null,O),p},...R);return Object.assign(M,{resultFunc:f,memoizedResultFunc:v,dependencies:E,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:A,argsMemoize:C})};return Object.assign(n,{withTypes:()=>n}),n}var de=mh(Zo),pw=Object.assign((e,t=de)=>{aw(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(a=>e[a]);return t(n,(...a)=>a.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>pw});l();s();u();c();function fh(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var gh=fh(),Sh=fh;var mw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Xo:Xo.apply(null,arguments)},MU=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},fw=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error($t(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=>eu(n)&&n.type===e,r}var Ah=class Is extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Is.prototype)}static get[Symbol.species](){return Is}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Is(...t[0].concat(this)):new Is(...t.concat(this))}};function hh(e){return ut(e)?Ur(e,()=>{}):e}function yh(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function gw(e){return typeof e=="boolean"}var Sw=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},d=new Ah;return r&&(gw(r)?d.push(gh):d.push(Sh(r.extraArgument))),d},Ts="RTK_autoBatch",ta=()=>e=>({payload:e,meta:{[Ts]:!0}}),Ch=e=>t=>{setTimeout(t,e)},hw=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ch(10):e.type==="callback"?e.queueNotification:Ch(e.timeout),f=()=>{d=!1,a&&(a=!1,p.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let A=()=>o&&h(),x=n.subscribe(A);return p.add(h),()=>{x(),p.delete(h)}},dispatch(h){try{return o=!h?.meta?.[Ts],a=!o,a&&(d||(d=!0,m(f))),n.dispatch(h)}finally{o=!0}}})},yw=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Ah(e);return n&&o.push(hw(typeof n=="object"?n:void 0)),o};function Fh(e){let t=Sw(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Zt(r))p=Jo(r);else throw new Error($t(1));let m;typeof n=="function"?m=n(t):m=t();let f=Xo;o&&(f=mw({trace:!1,...(typeof o=="object"&&o)}));let h=ZS(...m),A=yw(h),x=typeof d=="function"?d(A):A(),C=f(...x);return lm(p,a,C)}function Rh(e){let t={},r=[],n,o={addCase(a,d){let p=typeof a=="string"?a:a.type;if(!p)throw new Error($t(28));if(p in t)throw new Error($t(29));return t[p]=d,o},addMatcher(a,d){return r.push({matcher:a,reducer:d}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function Cw(e){return typeof e=="function"}function re(e,t){let[r,n,o]=Rh(t),a;if(Cw(e))a=()=>hh(e());else{let p=hh(e);a=()=>p}function d(p=a(),m){let f=[r[m.type],...n.filter(({matcher:h})=>h(m)).map(({reducer:h})=>h)];return f.filter(h=>!!h).length===0&&(f=[o]),f.reduce((h,A)=>{if(A)if(St(h)){let C=A(h,m);return C===void 0?h:C}else{if(ut(h))return Ur(h,x=>A(x,m));{let x=A(h,m);if(x===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return h},p)}return d.getInitialState=a,d}var bh=(e,t)=>fw(e)?e.match(t):e(t);function er(...e){return t=>e.some(r=>bh(r,t))}function ea(...e){return t=>e.every(r=>bh(r,t))}function cu(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 Os(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function uu(...e){return e.length===0?t=>cu(t,["pending"]):Os(e)?er(...e.map(t=>t.pending)):uu()(e[0])}function lo(...e){return e.length===0?t=>cu(t,["rejected"]):Os(e)?er(...e.map(t=>t.rejected)):lo()(e[0])}function ks(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ea(lo(...e),t):Os(e)?ea(lo(...e),t):ks()(e[0])}function _r(...e){return e.length===0?t=>cu(t,["fulfilled"]):Os(e)?er(...e.map(t=>t.fulfilled)):_r()(e[0])}function lu(...e){return e.length===0?t=>cu(t,["pending","fulfilled","rejected"]):Os(e)?er(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):lu()(e[0])}var xw="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",du=(e=21)=>{let t="",r=e;for(;r--;)t+=xw[Math.random()*64|0];return t},Aw=["name","message","stack","code"],bm=class{constructor(e,t){be(this,"_type");this.payload=e,this.meta=t}},xh=class{constructor(e,t){be(this,"_type");this.payload=e,this.meta=t}},Fw=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Aw)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ie=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(m,f,h,A)=>({payload:m,meta:{...(A||{}),arg:h,requestId:f,requestStatus:"fulfilled"}})),a=P(t+"/pending",(m,f,h)=>({payload:void 0,meta:{...(h||{}),arg:f,requestId:m,requestStatus:"pending"}})),d=P(t+"/rejected",(m,f,h,A,x)=>({payload:A,error:(n&&n.serializeError||Fw)(m||"Rejected"),meta:{...(x||{}),arg:h,requestId:f,rejectedWithValue:!!A,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,h,A)=>{let x=n?.idGenerator?n.idGenerator(m):du(),C=new i.AbortController,F,w;function b(E){w=E,C.abort()}let R=_asyncToGenerator(function*(){let E;try{let T=n?.condition?.(m,{getState:h,extra:A});if(bw(T)&&(T=yield T),T===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((q,O)=>{F=()=>{O({name:"AbortError",message:w||"Aborted"})},C.signal.addEventListener("abort",F)});f(a(x,m,n?.getPendingMeta?.({requestId:x,arg:m},{getState:h,extra:A}))),E=yield Promise.race([M,Promise.resolve(r(m,{dispatch:f,getState:h,extra:A,requestId:x,signal:C.signal,abort:b,rejectWithValue:(q,O)=>new bm(q,O),fulfillWithValue:(q,O)=>new xh(q,O)})).then(q=>{if(q instanceof bm)throw q;return q instanceof xh?o(q.payload,x,m,q.meta):o(q,x,m)})])}catch(T){E=T instanceof bm?d(null,x,m,T.payload,T.meta):d(T,x,m)}finally{F&&C.signal.removeEventListener("abort",F)}return n&&!n.dispatchConditionRejection&&d.match(E)&&E.meta.condition||f(E),E})();return Object.assign(R,{abort:b,requestId:x,arg:m,unwrap(){return R.then(Rw)}})}}return Object.assign(p,{pending:a,rejected:d,fulfilled:o,settled:er(d,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Rw(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function bw(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var vh=Symbol.for("rtk-slice-createasyncthunk"),_U={[vh]:ie};function vw(e,t){return`${e}/${t}`}function Pw({creators:e}={}){let t=e?.asyncThunk?.[vh];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error($t(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(Ew()):n.reducers)||{},p=Object.keys(d),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(E,v){let T=typeof E=="string"?E:E.type;if(!T)throw new Error($t(12));if(T in m.sliceCaseReducersByType)throw new Error($t(13));return m.sliceCaseReducersByType[T]=v,f},addMatcher(E,v){return m.sliceMatchers.push({matcher:E,reducer:v}),f},exposeAction(E,v){return m.actionCreators[E]=v,f},exposeCaseReducer(E,v){return m.sliceCaseReducersByName[E]=v,f}};p.forEach(E=>{let v=d[E],T={reducerName:E,type:vw(o,E),createNotation:typeof n.reducers=="function"};Tw(v)?kw(T,v,f,t):Iw(T,v,f)});function h(){let[E={},v=[],T=void 0]=typeof n.extraReducers=="function"?Rh(n.extraReducers):[n.extraReducers],M={...E,...m.sliceCaseReducersByType};return re(n.initialState,q=>{for(let O in M)q.addCase(O,M[O]);for(let O of m.sliceMatchers)q.addMatcher(O.matcher,O.reducer);for(let O of v)q.addMatcher(O.matcher,O.reducer);T&&q.addDefaultCase(T)})}let A=E=>E,x=new Map,C;function F(E,v){return C||(C=h()),C(E,v)}function w(){return C||(C=h()),C.getInitialState()}function b(E,v=!1){function T(q){let O=q[E];return typeof O>"u"&&v&&(O=w()),O}function M(q=A){let O=yh(x,v,()=>new WeakMap);return yh(O,q,()=>{let k={};for(let[V,Q]of Object.entries(n.selectors??{}))k[V]=ww(Q,q,w,v);return k})}return{reducerPath:E,getSelectors:M,get selectors(){return M(T)},selectSlice:T}}let R={name:o,reducer:F,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:w,...b(a),injectInto(E,{reducerPath:v,...T}={}){let M=v??a;return E.inject({reducerPath:M,reducer:F},T),{...R,...b(M,!0)}}};return R}}function ww(e,t,r,n){function o(a,...d){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return o.unwrapped=e,o}var po=Pw();function Ew(){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 Iw({type:e,reducerName:t,createNotation:r},n,o){let a,d;if("reducer"in n){if(r&&!Ow(n))throw new Error($t(17));a=n.reducer,d=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,d?P(e,d):P(e))}function Tw(e){return e._reducerDefinitionType==="asyncThunk"}function Ow(e){return e._reducerDefinitionType==="reducerWithPrepare"}function kw({type:e,reducerName:t},r,n,o){if(!o)throw new Error($t(18));let{payloadCreator:a,fulfilled:d,pending:p,rejected:m,settled:f,options:h}=r,A=o(e,a,h);n.exposeAction(t,A),d&&n.addCase(A.fulfilled,d),p&&n.addCase(A.pending,p),m&&n.addCase(A.rejected,m),f&&n.addMatcher(A.settled,f),n.exposeCaseReducer(t,{fulfilled:d||su,pending:p||su,rejected:m||su,settled:f||su})}function su(){}var Ph="listener",wh="completed",Eh="cancelled",jU=`task-${Eh}`,$U=`task-${wh}`,GU=`${Ph}-${Eh}`,HU=`${Ph}-${wh}`;var{assign:Ih}=Object;var vm="listenerMiddleware";var qw=Ih(P(`${vm}/add`),{withTypes:()=>qw}),WU=P(`${vm}/removeAll`),Dw=Ih(P(`${vm}/remove`),{withTypes:()=>Dw});var zU=Symbol.for("rtk-state-proxy-original");function $t(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. `}l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();var Th=/^(?:[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 Vw(e){return typeof e=="string"&&Th.test(e)}var Pm=Vw;l();s();u();c();var Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function Oh(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()}l();s();u();c();var wm,Nw=new Uint8Array(16);function Em(){if(!wm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");wm=crypto.getRandomValues.bind(crypto)}return wm(Nw)}l();s();u();c();l();s();u();c();var Mw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Im={randomUUID:Mw};function Lw(e,t,r){if(Im.randomUUID&&!t&&!e)return Im.randomUUID();e=e||{};let n=e.random??e.rng?.()??Em();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 Oh(n)}var Tm=Lw;l();s();u();c();function kh(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Qw({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(o,a,r))}function Bw(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&Pm(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var Dh="1.1.1";function Uw(e){let{trackingId:t}=e;return{trackingId:t}}function _w(e){return(e.source||[]).concat([`relay@${Dh}`])}function Vh(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:d}=r,p=Uw(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:_w(t),clientId:m,userAgent:d(),referrer:o(),location:a()})}function jw(e,t,r,n,o){return{...t,meta:Vh(e,r,n,o)}}var $w="*";function Gw(){let e=[];function t({type:m,callback:f}){return e.findIndex(h=>h.type===m&&h.callback===f)}function r(m,f){return m.type==="*"||f===m.type}function n(m){return t(m)<0&&e.push(m),()=>p(m.type,m.callback)}function o(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(h){console.error(h)}})}function a(m){if(m===$w)e.length=0;else for(let f=e.length-1;f>=0;f--)e[f].type===m&&e.splice(f,1)}function d(m){let f=t(m);f>=0&&e.splice(f,1)}function p(m,f){f?d({type:m,callback:f}):a(m)}return{add:n,call:o,remove:p}}function qh({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 Hw(e){let t=qh(e);return{get:()=>t,update:r=>{t=qh({...t,...r})}}}var Om=Ww();function Ww(){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 a of o){let d=a.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function zw(){return{getItem(e){return Om.getItem(e)||localStorage.getItem(e)},removeItem(e){Om.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Om.setItem(e,t,31556952e3)}}}function Kw(){let e=document.referrer;return e===""?null:e}function Yw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(kh().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:()=>Kw(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Tm(),storage:zw()}}function Jw(){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 Xw(){return{getItem(){return null},removeItem(){},setItem(){}}}function Zw(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Xw()}}function eE(e){let t=e.get().mode!=="disabled",r=e.get().environment;return t&&r?{...r,runtime:"custom"}:t&&tE()&&Jw()?Yw():Zw()}function tE(){try{return typeof window=="object"}catch{return!1}}function rE(e){return{get:()=>Object.freeze(eE(e))}}function Nh(e){let t=Hw(e),r=Gw(),n=rE(t),o=Bw(n);return{emit:(a,d)=>{let p=t.get(),m=n.get(),f=jw(a,d,p,m,o);return Qw({config:p,environment:m,event:f,listenerManager:r})},getMeta:a=>Vh(a,t.get(),n.get(),o),on:(a,d)=>r.add({type:a,callback:d}),off:(a,d)=>r.remove(a,d),updateConfig:a=>t.update(a),version:Dh}}l();s();u();c();l();s();u();c();var ln="3.23.1-pre.e76cf03e5b",Mh=["@coveo/atomic","@coveo/quantic"];var dn=de(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ln}`));var ra=de(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>dn(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},d)=>Nh({mode:a?"emit":"disabled",url:o??zc(e,t),token:r,trackingId:n,source:d}));l();s();u();c();l();s();u();c();function jr(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 N(e,t,r,n){function o(a){return a instanceof r?a:new r(function(d){d(a)})}return new(r||(r=Promise))(function(a,d){function p(h){try{f(n.next(h))}catch(A){d(A)}}function m(h){try{f(n.throw(h))}catch(A){d(A)}}function f(h){h.done?a(h.value):o(h.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var ye;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ye||(ye={}));function Dm(){return typeof window<"u"}function Wm(){return typeof navigator<"u"}function na(){return typeof document<"u"}function Vm(){try{return typeof localStorage<"u"}catch{return!1}}function nE(){try{return typeof sessionStorage<"u"}catch{return!1}}function Jh(){return Wm()&&navigator.cookieEnabled}var oE=[ye.click,ye.custom,ye.search,ye.view],aE=(e,t)=>oE.indexOf(e)!==-1?Object.assign({language:na()?document.documentElement.lang:"unknown",userAgent:Wm()?navigator.userAgent:"unknown"},t):t,Vs=class e{static set(t,r,n){var o,a,d,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Lh(t,r,a):(d=p.split("."),o=d[d.length-2]+"."+d[d.length-1],Lh(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Lh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function iE(){return Vm()?localStorage:Jh()?new Ns:nE()?sessionStorage:new aa}var Ns=class e{getItem(t){return Vs.get(`${e.prefix}${t}`)}removeItem(t){Vs.erase(`${e.prefix}${t}`)}setItem(t,r,n){Vs.set(`${e.prefix}${t}`,r,n)}};Ns.prefix="coveo_";var Nm=class{constructor(){this.cookieStorage=new Ns}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)}},aa=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},qs="__coveo.analytics.history",Xh=20,Zh=1e3*60,ey=75,ia=class{constructor(t){this.store=t||iE()}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 N(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 N(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(qs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return N(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(qs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(qs,JSON.stringify(t.slice(0,Xh)))}catch{}}clear(){try{this.store.removeItem(qs)}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,ey)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Zh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}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))}},ty=Object.freeze({__proto__:null,HistoryStore:ia,MAX_NUMBER_OF_HISTORY_ELEMENTS:Xh,MAX_VALUE_SIZE:ey,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:Zh,STORE_KEY:qs,default:ia}),sE=(e,t)=>N(void 0,void 0,void 0,function*(){return e===ye.view?(yield cE(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),cE=e=>N(void 0,void 0,void 0,function*(){let t=new ia,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),pu,uE=new Uint8Array(16);function lE(){if(!pu&&(pu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pu(uE)}var dE=/^(?:[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 fu(e){return typeof e=="string"&&dE.test(e)}var Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).slice(1));function ry(e,t=0){return(Ze[e[t+0]]+Ze[e[t+1]]+Ze[e[t+2]]+Ze[e[t+3]]+"-"+Ze[e[t+4]]+Ze[e[t+5]]+"-"+Ze[e[t+6]]+Ze[e[t+7]]+"-"+Ze[e[t+8]]+Ze[e[t+9]]+"-"+Ze[e[t+10]]+Ze[e[t+11]]+Ze[e[t+12]]+Ze[e[t+13]]+Ze[e[t+14]]+Ze[e[t+15]]).toLowerCase()}function pE(e){if(!fu(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 mE(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var fE="6ba7b810-9dad-11d1-80b4-00c04fd430c8",gE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function SE(e,t,r){function n(o,a,d,p){var m;if(typeof o=="string"&&(o=mE(o)),typeof a=="string"&&(a=pE(a)),((m=a)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(a),f.set(o,a.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let h=0;h<16;++h)d[p+h]=f[h];return d}return ry(f)}try{n.name=e}catch{}return n.DNS=fE,n.URL=gE,n}var hE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Qh={randomUUID:hE};function mo(e,t,r){if(Qh.randomUUID&&!t&&!e)return Qh.randomUUID();e=e||{};let n=e.random||(e.rng||lE)();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 ry(n)}function yE(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 km(e,t){return e<<t|e>>>32-t}function CE(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let d=unescape(encodeURIComponent(e));e=[];for(let p=0;p<d.length;++p)e.push(d.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let d=0;d<o;++d){let p=new Uint32Array(16);for(let m=0;m<16;++m)p[m]=e[d*64+m*4]<<24|e[d*64+m*4+1]<<16|e[d*64+m*4+2]<<8|e[d*64+m*4+3];a[d]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<o;++d){let p=new Uint32Array(80);for(let C=0;C<16;++C)p[C]=a[d][C];for(let C=16;C<80;++C)p[C]=km(p[C-3]^p[C-8]^p[C-14]^p[C-16],1);let m=r[0],f=r[1],h=r[2],A=r[3],x=r[4];for(let C=0;C<80;++C){let F=Math.floor(C/20),w=km(m,5)+yE(F,f,h,A)+x+t[F]+p[C]>>>0;x=A,A=h,h=km(f,30)>>>0,f=m,m=w}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+A>>>0,r[4]=r[4]+x>>>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 xE=SE("v5",80,CE),Bh=xE,ny="2.30.45",Uh=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ds={pageview:"pageview",event:"event"},gu=class{constructor({client:t,uuidGenerator:r=mo}){this.client=t,this.uuidGenerator=r}},Mm=class extends gu{constructor({client:t,uuidGenerator:r=mo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Uh(window.location),this.lastReferrer=na()?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:na()?document.title:"",encoding:na()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Ds.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ds.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ds.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ds.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 Uh(window.location)}},pn=class e{constructor(t,r){if(!fu(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 a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return fu(a)?new e(a,Number.parseInt(o)*1e3):null}};pn.cvo_cid="cvo_cid";pn.expirationTime=120;var Lm=class extends gu{constructor({client:t,uuidGenerator:r=mo}){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 N(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(pn.cvo_cid,new pn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Lm.Id="link";var wt=Object.keys;function mu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var qm=128,oy=192,_h=224,jh=240;function AE(e){return(e&248)===jh?4:(e&jh)===_h?3:(e&_h)===oy?2:1}function FE(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&qm)!=qm)break;if(r-=3,(n&oy)!=qm){t-r>=AE(n)*3&&(r=t);break}}return e.substring(0,r)}var Qm={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"},RE=wt(Qm).map(e=>Qm[e]),bE=[...RE].join("|"),vE=new RegExp(`^(${bE}$)`),PE={svcAction:"svc_action",svcActionData:"svc_action_data"},wE=e=>wt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Qm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),EE=e=>vE.test(e),IE=[EE],$h={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Gh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},et={action:"pa",list:"pal",listSource:"pls"},Su={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},TE=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Bm={id:"quoteId",affiliation:"quoteAffiliation"},Um={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},OE={add:et,bookmark_add:et,bookmark_remove:et,click:et,checkout:et,checkout_option:et,detail:et,impression:et,remove:et,refund:Object.assign(Object.assign({},et),Su),purchase:Object.assign(Object.assign({},et),Su),quickview:et,quote:Object.assign(Object.assign({},et),Bm),review:Object.assign(Object.assign({},et),Um)},kE=wt($h).map(e=>$h[e]),qE=wt(Gh).map(e=>Gh[e]),DE=wt(et).map(e=>et[e]),VE=wt(Su).map(e=>Su[e]),NE=wt(Um).map(e=>Um[e]),ME=wt(Bm).map(e=>Bm[e]),LE=[...kE,"custom"].join("|"),QE=[...qE,"custom"].join("|"),ay="(pr[0-9]+)",iy="(il[0-9]+pi[0-9]+)",BE=new RegExp(`^${ay}(${LE})$`),UE=new RegExp(`^(${iy}(${QE}))|(il[0-9]+nm)$`),_E=new RegExp(`^(${DE.join("|")})$`),jE=new RegExp(`^(${VE.join("|")})$`),$E=new RegExp(`^${ay}custom$`),GE=new RegExp(`^${iy}custom$`),HE=new RegExp(`^(${[...TE,...NE,...ME].join("|")})$`),WE=e=>BE.test(e),zE=e=>UE.test(e),KE=e=>_E.test(e),YE=e=>jE.test(e),JE=e=>HE.test(e),XE=[zE,WE,KE,YE,JE],ZE=[$E,GE],eI={anonymizeIp:"aip"},tI={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},rI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},nI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],oI=Object.assign(Object.assign(Object.assign(Object.assign({},eI),tI),rI),nI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),_m=Object.assign(Object.assign({},oI),PE),aI=e=>{let t=!!e.action&&OE[e.action]||{};return wt(e).reduce((r,n)=>{let o=t[n]||_m[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},iI=wt(_m).map(e=>_m[e]),sI=e=>iI.indexOf(e)!==-1,cI=e=>e==="custom",uI=e=>[...XE,...IE,sI,cI].some(t=>t(e)),lI=e=>wt(e).reduce((t,r)=>{let n=dI(r);return n?Object.assign(Object.assign({},t),pI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),dI=e=>{let t;return[...ZE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},pI=(e,t)=>wt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),jm=class{constructor(t){this.opts=t}sendEvent(t,r){return N(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,a=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(d,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return N(this,void 0,void 0,function*(){let o=t,a=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;o=p||t;try{a=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return N(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(a=>!!a).join("&")})}isEventTypeLegacy(t){return[ye.click,ye.custom,ye.search,ye.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}},$m=class{sendEvent(t,r){return N(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return N(this,void 0,void 0,function*(){return Promise.resolve()})}},Hh=g.fetch,hu=class{constructor(t){this.opts=t}sendEvent(t,r){return N(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,d=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${d}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:f}=m,h=jr(m,["url"]),A;try{A=yield Hh(f,h)}catch(x){console.error("An error has occured when sending the event.",x);return}if(A.ok){let x=yield A.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}else{try{A.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,A,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return N(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Hh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ye.click,ye.custom,ye.search,ye.view].indexOf(t)!==-1}getVisitorIdParam(){return N(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"})}},Gm=class{constructor(t,r){Vm()&&Jh()?this.storage=new Nm:Vm()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new aa),this.client=new hu(t),this.beaconClient=new jm(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Hm=class{constructor(t,r){this.storage=r||new aa,this.client=new hu(t)}getClientDependingOnEventType(t){return this.client}},yu=class{constructor(){this.storage=new aa,this.client=new $m}getClientDependingOnEventType(t){return this.client}},mI="xx",fI=e=>e?.startsWith(mI)||!1,gI=`
27
+ `+h:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":Zv(h,n,t);break}}}}function Zv(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function eP(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function FS(){return{data:"",event:"",id:"",retry:void 0}}var Jp="text/event-stream",tP=1e3,PS="last-event-id";function wS(){return typeof window<"u"}function Gc(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:d,openWhenHidden:p,fetch:m,...f}){return new Promise((h,A)=>{let x={...r};x.accept||(x.accept=Jp);let C;function F(){C?.abort(),document.hidden||T()}!p&&wS()&&document.addEventListener("visibilitychange",F);let w=tP,b;function R(){wS()&&document.removeEventListener("visibilitychange",F),clearTimeout(b),C?.abort()}t?.addEventListener("abort",()=>{R(),h()});let E=m??S,v=n??rP;function T(){return _T2.apply(this,arguments)}function _T2(){_T2=_asyncToGenerator(function*(){C=i.AbortController?new i.AbortController:null;try{let M=yield E(e,{...f,headers:x,signal:C?.signal});yield v(M),yield RS(M.body,bS(vS(q=>{q?x[PS]=q:delete x[PS]},q=>{w=q},o))),a?.(),R(),h()}catch(M){if(!C?.signal?.aborted)try{let q=d?.(M)??w;clearTimeout(b),b=setTimeout(T,q)}catch(q){R(),A(q)}}});return _T2.apply(this,arguments)}T()})}function rP(e){let t=e.headers.get("content-type");if(!t?.startsWith(Jp))throw new Error(`Expected content-type to be ${Jp}, Actual: ${t}`)}l();s();u();c();var an=class{constructor(t){be(this,"_basePath");be(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}};var nP=(e,t,r)=>new an(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,ES=3,oP=5e3,aP="text/event-stream",em=1,Xp=class extends Error{},ys=class extends Error{constructor(r){super(r.message);this.payload=r}},Zp=class{constructor(){be(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Hc=class{constructor(t){be(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:h}=r,A=new Zp;if(!a){this.logger.error("No stream ID found");return}let x=0,C,F=()=>{C&&!A.isActive(C)&&(b?.abort(),h(),R())},w=()=>{A.remove(C),C=AS(F,C,oP),A.add(C)},b=new i.AbortController,R=()=>Gc(nP(n,o,a),{method:"GET",fetch:S,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:b?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===aP)return;throw E.status>=400&&E.status<500&&E.status!==429?new ys({message:"Error opening stream",code:E.status}):new Xp})()},onmessage:E=>{if(b?.signal.aborted)return;let v=JSON.parse(E.data);if(v.finishReason==="ERROR"){A.remove(C),b?.abort(),m({message:v.errorMessage,code:v.statusCode});return}p(v),x=0,v.finishReason==="COMPLETED"?(A.remove(C),f()):w()},onerror:E=>{if(!b?.signal.aborted){if(A.remove(C),E instanceof ys)throw b?.abort(),m(E),E;if(++x>ES){this.logger.info("Maximum retry exceeded.");let v={message:"Failed to complete stream.",code:em};throw b?.abort(),m(v),new ys(v)}this.logger.info(`Retrying...(${x}/${ES})`),h()}}});return R(),b}};l();s();u();c();var BS=Rt(NS(),1);l();s();u();c();l();s();u();c();var OP="recommendation-internal-options",s0=Symbol.for(OP);var W=new Error("Failed to load reducers."),Ko=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var ao=class extends Error{constructor(r,n){super();be(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};l();s();u();c();function MS(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function LS(e){return typeof e!="object"||!e?!1:Object.values(e).every(kP)}function kP(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function QS(e){return e===429}var bt=class e{static call(t){return _asyncToGenerator(function*(){let r=qP(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...d}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield S(a,d);if(QS(m.status))throw m;return m});return function p(){return _ref.apply(this,arguments)}}();try{let m=yield(0,BS.backOff)(p,{retry:f=>{let h=f&&QS(f.status);return h&&n.info("Platform retrying request"),h}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new Ko;case 404:throw new ao(a,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new ao(a):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:d}=r,{signal:p,...m}=t,f=hs(m);try{let h=yield o(t,n,d);return{...t,...h}}catch(h){a.error(h,"Platform request preprocessing failed. Returning default request options.")}return f})()}};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 Me(e,t="prod"){return`${Ke(e,t)}/rest/search/v2`}function zc(e,t="prod"){return`${Ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function qP(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=DP(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:m}),signal:d}}function DP(e,t){return t==="application/x-www-form-urlencoded"?LS(e)?MS(e):"":JSON.stringify(e)}l();s();u();c();var Kc=e=>e;l();s();u();c();var US=e=>e,_S=e=>e,jS=e=>e;l();s();u();c();l();s();u();c();function Yo(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function gt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Yo(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Yo(),extendedResults:{}}}l();s();u();c();function sn(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var cn=e=>{let{response:t}=e;return t.body?VP(e):NP(t)},VP=e=>LP(e)?QP(e):MP(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},NP=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function MP(e){return e.body.statusCode!==void 0}function LP(e){return e.body.exception!==void 0}var QP=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});l();s();u();c();var un=class{constructor(){be(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController,o=_this.currentAbortController=new i.AbortController;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)}})()}};l();s();u();c();l();s();u();c();function $S(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}l();s();u();c();var Qr=(e,t,r,n)=>{let o=new an(`${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 GS=(e,t)=>{let r=new an(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},HS=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield bt.call({...Qr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:sn(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=$S(r),o=yield r.arrayBuffer(),d=new TextDecoder(n).decode(o);return BP(d)?{success:d}:{error:cn({response:r,body:d})}});return function HS(_x4,_x5){return _ref2.apply(this,arguments)}}();function BP(e){return typeof e=="string"}l();s();u();c();function UP(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function _P(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function As(e,t){if(t&&e.name==="AbortError")return{error:_P(e)};if(e instanceof ao)return{error:UP(e)};throw e}var Yc=class{constructor(t){this.options=t;be(this,"apiCallsQueues",{unknown:new un,mainSearch:new un,facetValues:new un,foldingCollection:new un,instantResults:new un})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield bt.call({...Qr(t,"POST","application/json","/plan"),requestParams:sn(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return As(r);let n=yield r.json();return $P(n)?{success:n}:{error:cn({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield bt.call({...Qr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:sn(t),..._this3.options});if(r instanceof Error)return As(r);let n=yield r.json(),o={response:r,body:n};return jP(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:cn(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>bt.call({...Qr(t,"POST","application/json",""),requestParams:sn(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return As(o,r?.disableAbortWarning);let a=yield o.json(),d={response:o,body:a};return WS(a)?(d.body=zS(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(d)).body}):{error:cn(d)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield bt.call({...Qr(t,"POST","application/json","/facet"),requestParams:sn(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 bt.call({...Qr(t,"POST","application/json",""),requestParams:sn(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(WS(n)){let o={response:r,body:n};return o.body=zS(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:cn({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return HS(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield bt.call({...Qr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return GP(n)?{success:n}:{error:cn({response:r,body:n})}})()}},Jc=e=>e.success!==void 0,je=e=>e.error!==void 0;function WS(e){return e.results!==void 0}function zS(e){let t=Yo();return oe(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function jP(e){return e.completions!==void 0}function $P(e){return e.preprocessingOutput!==void 0}function GP(e){return e.fields!==void 0}l();s();u();c();l();s();u();c();var G=new D({required:!0,emptyAllowed:!1}),Ee=new D({required:!1,emptyAllowed:!1}),Fe=new D({required:!0,emptyAllowed:!0}),KS=new D({required:!1,emptyAllowed:!0}),Xc=new te({each:G,required:!0}),YS=new D({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Br=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),vt=(e,t)=>{if("required"in t)return{payload:new ue({value:t}).validate({value:e}).value};let o=new B({options:{required:!0},values:t}).validate(e);if(o)throw new Ss(o);return{payload:e}},I=(e,t)=>{try{return vt(e,t)}catch(r){return{payload:e,error:Br(r)}}},Le=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return JS(e,t,r,o,"Controller initialization error")},Pe=(e,t,r,n)=>{let o=`Check the options of ${n}`;return JS(e,t,r,o,"Controller initialization error")},JS=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};l();s();u();c();l();s();u();c();l();s();u();c();function Ye(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var HP=typeof Symbol=="function"&&Symbol.observable||"@@observable",XS=HP,um=()=>Math.random().toString(36).substring(7).split("").join("."),WP={INIT:`@@redux/INIT${um()}`,REPLACE:`@@redux/REPLACE${um()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${um()}`},Zc=WP;function Zt(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 lm(e,t,r){if(typeof e!="function")throw new Error(Ye(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ye(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ye(1));return r(lm)(e,t)}let n=e,o=t,a=new Map,d=a,p=0,m=!1;function f(){d===a&&(d=new Map,a.forEach((b,R)=>{d.set(R,b)}))}function h(){if(m)throw new Error(Ye(3));return o}function A(b){if(typeof b!="function")throw new Error(Ye(4));if(m)throw new Error(Ye(5));let R=!0;f();let E=p++;return d.set(E,b),function(){if(R){if(m)throw new Error(Ye(6));R=!1,f(),d.delete(E),a=null}}}function x(b){if(!Zt(b))throw new Error(Ye(7));if(typeof b.type>"u")throw new Error(Ye(8));if(typeof b.type!="string")throw new Error(Ye(17));if(m)throw new Error(Ye(9));try{m=!0,o=n(o,b)}finally{m=!1}return(a=d).forEach(E=>{E()}),b}function C(b){if(typeof b!="function")throw new Error(Ye(10));n=b,x({type:Zc.REPLACE})}function F(){let b=A;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ye(11));function E(){let T=R;T.next&&T.next(h())}return E(),{unsubscribe:b(E)}},[XS](){return this}}}return x({type:Zc.INIT}),{dispatch:x,subscribe:A,getState:h,replaceReducer:C,[XS]:F}}function zP(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Zc.INIT})>"u")throw new Error(Ye(12));if(typeof r(void 0,{type:Zc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ye(13))})}function Jo(e){let t=Object.keys(e),r={};for(let d=0;d<t.length;d++){let p=t[d];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{zP(r)}catch(d){a=d}return function(p={},m){if(a)throw a;let f=!1,h={};for(let A=0;A<n.length;A++){let x=n[A],C=r[x],F=p[x],w=C(F,m);if(typeof w>"u"){let b=m&&m.type;throw new Error(Ye(14))}h[x]=w,f=f||w!==F}return f=f||n.length!==Object.keys(p).length,f?h:p}}function Xo(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function ZS(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Ye(15))},d={getState:o.getState,dispatch:(m,...f)=>a(m,...f)},p=e.map(m=>m(d));return a=Xo(...p)(o.dispatch),{...o,dispatch:a}}}function eu(e){return Zt(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var xm=Symbol.for("immer-nothing"),Fs=Symbol.for("immer-draftable"),ct=Symbol.for("immer-state");function Je(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var so=Object.getPrototypeOf;function St(e){return!!e&&!!e[ct]}function ut(e){return e?oh(e)||Array.isArray(e)||!!e[Fs]||!!e.constructor?.[Fs]||ws(e)||Es(e):!1}var KP=Object.prototype.constructor.toString();function oh(e){if(!e||typeof e!="object")return!1;let t=so(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)===KP}function Am(e){return St(e)||Je(15,e),e[ct].base_}function Rs(e,t){co(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function co(e){let t=e[ct];return t?t.type_:Array.isArray(e)?1:ws(e)?2:Es(e)?3:0}function bs(e,t){return co(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function dm(e,t){return co(e)===2?e.get(t):e[t]}function ah(e,t,r){let n=co(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function YP(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ws(e){return e instanceof Map}function Es(e){return e instanceof Set}function io(e){return e.copy_||e.base_}function fm(e,t){if(ws(e))return new Map(e);if(Es(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=oh(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ct];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let d=o[a],p=n[d];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[d]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[d]})}return Object.create(so(e),n)}else{let n=so(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function nu(e,t=!1){return ou(e)||St(e)||!ut(e)||(co(e)>1&&(e.set=e.add=e.clear=e.delete=JP),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>nu(n,!0))),e}function JP(){Je(2)}function ou(e){return Object.isFrozen(e)}var gm={};function uo(e){let t=gm[e];return t||Je(0,e),t}function XP(e,t){gm[e]||(gm[e]=t)}var vs;function ih(){return vs}function ZP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function eh(e,t){t&&(uo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sm(e){hm(e),e.drafts_.forEach(ew),e.drafts_=null}function hm(e){e===vs&&(vs=e.parent_)}function th(e){return vs=ZP(vs,e)}function ew(e){let t=e[ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function rh(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ct].modified_&&(Sm(t),Je(4)),ut(e)&&(e=tu(t,e),t.parent_||ru(t,e)),t.patches_&&uo("Patches").generateReplacementPatches_(r[ct].base_,e,t.patches_,t.inversePatches_)):e=tu(t,r,[]),Sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==xm?e:void 0}function tu(e,t,r){if(ou(t))return t;let n=t[ct];if(!n)return Rs(t,(o,a)=>nh(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return ru(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,d=!1;n.type_===3&&(a=new Set(o),o.clear(),d=!0),Rs(a,(p,m)=>nh(e,n,o,p,m,r,d)),ru(e,o,!1),r&&e.patches_&&uo("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function nh(e,t,r,n,o,a,d){if(St(o)){let p=a&&t&&t.type_!==3&&!bs(t.assigned_,n)?a.concat(n):void 0,m=tu(e,o,p);if(ah(r,n,m),St(m))e.canAutoFreeze_=!1;else return}else d&&r.add(o);if(ut(o)&&!ou(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;tu(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&ru(e,o)}}function ru(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&nu(t,r)}function tw(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:ih(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=Fm;r&&(o=[n],a=Ps);let{revoke:d,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=d,p}var Fm={get(e,t){if(t===ct)return e;let r=io(e);if(!bs(r,t))return rw(e,r,t);let n=r[t];return e.finalized_||!ut(n)?n:n===pm(e.base_,t)?(mm(e),e.copy_[t]=Cm(n,e)):n},has(e,t){return t in io(e)},ownKeys(e){return Reflect.ownKeys(io(e))},set(e,t,r){let n=sh(io(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=pm(io(e),t),a=o?.[ct];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(YP(r,o)&&(r!==void 0||bs(e.base_,t)))return!0;mm(e),ym(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 pm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,mm(e),ym(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=io(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Je(11)},getPrototypeOf(e){return so(e.base_)},setPrototypeOf(){Je(12)}},Ps={};Rs(Fm,(e,t)=>{Ps[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ps.deleteProperty=function(e,t){return Ps.set.call(this,e,t,void 0)};Ps.set=function(e,t,r){return Fm.set.call(this,e[0],t,r,e[0])};function pm(e,t){let r=e[ct];return(r?io(r):e)[t]}function rw(e,t,r){let n=sh(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function sh(e,t){if(!(t in e))return;let r=so(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=so(r)}}function ym(e){e.modified_||(e.modified_=!0,e.parent_&&ym(e.parent_))}function mm(e){e.copy_||(e.copy_=fm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var nw=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let d=this;return function(m=a,...f){return d.produce(m,h=>r.call(this,h,...f))}}typeof r!="function"&&Je(6),n!==void 0&&typeof n!="function"&&Je(7);let o;if(ut(t)){let a=th(this),d=Cm(t,void 0),p=!0;try{o=r(d),p=!1}finally{p?Sm(a):hm(a)}return eh(a,n),rh(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===xm&&(o=void 0),this.autoFreeze_&&nu(o,!0),n){let a=[],d=[];uo("Patches").generateReplacementPatches_(t,o,a,d),n(a,d)}return o}else Je(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(d,...p)=>this.produceWithPatches(d,m=>t(m,...p));let n,o;return[this.produce(t,r,(d,p)=>{n=d,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ut(e)||Je(8),St(e)&&(e=ch(e));let t=th(this),r=Cm(e,void 0);return r[ct].isManual_=!0,hm(t),r}finishDraft(e,t){let r=e&&e[ct];(!r||!r.isManual_)&&Je(9);let{scope_:n}=r;return eh(n,t),rh(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=uo("Patches").applyPatches_;return St(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Cm(e,t){let r=ws(e)?uo("MapSet").proxyMap_(e,t):Es(e)?uo("MapSet").proxySet_(e,t):tw(e,t);return(t?t.scope_:ih()).drafts_.push(r),r}function ch(e){return St(e)||Je(10,e),uh(e)}function uh(e){if(!ut(e)||ou(e))return e;let t=e[ct],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=fm(e,t.scope_.immer_.useStrictShallowCopy_)}else r=fm(e,!0);return Rs(r,(n,o)=>{ah(r,n,uh(o))}),t&&(t.finalized_=!1),r}function lh(){let t="replace",r="add",n="remove";function o(x,C,F,w){switch(x.type_){case 0:case 2:return d(x,C,F,w);case 1:return a(x,C,F,w);case 3:return p(x,C,F,w)}}function a(x,C,F,w){let{base_:b,assigned_:R}=x,E=x.copy_;E.length<b.length&&([b,E]=[E,b],[F,w]=[w,F]);for(let v=0;v<b.length;v++)if(R[v]&&E[v]!==b[v]){let T=C.concat([v]);F.push({op:t,path:T,value:A(E[v])}),w.push({op:t,path:T,value:A(b[v])})}for(let v=b.length;v<E.length;v++){let T=C.concat([v]);F.push({op:r,path:T,value:A(E[v])})}for(let v=E.length-1;b.length<=v;--v){let T=C.concat([v]);w.push({op:n,path:T})}}function d(x,C,F,w){let{base_:b,copy_:R}=x;Rs(x.assigned_,(E,v)=>{let T=dm(b,E),M=dm(R,E),q=v?bs(b,E)?t:r:n;if(T===M&&q===t)return;let O=C.concat(E);F.push(q===n?{op:q,path:O}:{op:q,path:O,value:M}),w.push(q===r?{op:n,path:O}:q===n?{op:r,path:O,value:A(T)}:{op:t,path:O,value:A(T)})})}function p(x,C,F,w){let{base_:b,copy_:R}=x,E=0;b.forEach(v=>{if(!R.has(v)){let T=C.concat([E]);F.push({op:n,path:T,value:v}),w.unshift({op:r,path:T,value:v})}E++}),E=0,R.forEach(v=>{if(!b.has(v)){let T=C.concat([E]);F.push({op:r,path:T,value:v}),w.unshift({op:n,path:T,value:v})}E++})}function m(x,C,F,w){F.push({op:t,path:[],value:C===xm?void 0:C}),w.push({op:t,path:[],value:x})}function f(x,C){return C.forEach(F=>{let{path:w,op:b}=F,R=x;for(let M=0;M<w.length-1;M++){let q=co(R),O=w[M];typeof O!="string"&&typeof O!="number"&&(O=""+O),(q===0||q===1)&&(O==="__proto__"||O==="constructor")&&Je(19),typeof R=="function"&&O==="prototype"&&Je(19),R=dm(R,O),typeof R!="object"&&Je(18,w.join("/"))}let E=co(R),v=h(F.value),T=w[w.length-1];switch(b){case t:switch(E){case 2:return R.set(T,v);case 3:Je(16);default:return R[T]=v}case r:switch(E){case 1:return T==="-"?R.push(v):R.splice(T,0,v);case 2:return R.set(T,v);case 3:return R.add(v);default:return R[T]=v}case n:switch(E){case 1:return R.splice(T,1);case 2:return R.delete(T);case 3:return R.delete(F.value);default:return delete R[T]}default:Je(17,b)}}),x}function h(x){if(!ut(x))return x;if(Array.isArray(x))return x.map(h);if(ws(x))return new Map(Array.from(x.entries()).map(([F,w])=>[F,h(w)]));if(Es(x))return new Set(Array.from(x).map(h));let C=Object.create(so(x));for(let F in x)C[F]=h(x[F]);return bs(x,Fs)&&(C[Fs]=x[Fs]),C}function A(x){return St(x)?h(x):x}XP("Patches",{applyPatches_:f,generatePatches_:o,generateReplacementPatches_:m})}var ht=new nw,Ur=ht.produce,au=ht.produceWithPatches.bind(ht),cU=ht.setAutoFreeze.bind(ht),uU=ht.setUseStrictShallowCopy.bind(ht),Rm=ht.applyPatches.bind(ht),lU=ht.createDraft.bind(ht),dU=ht.finishDraft.bind(ht);l();s();u();c();function ow(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function aw(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function iw(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 dh=e=>Array.isArray(e)?e:[e];function sw(e){let t=Array.isArray(e[0])?e[0]:e;return iw(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function cw(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var yU=Symbol();var CU=Object.getPrototypeOf({});var uw=class{constructor(e){this.value=e}deref(){return this.value}},lw=typeof WeakRef<"u"?WeakRef:uw,dw=0,ph=1;function iu(){return{s:dw,v:void 0,o:null,p:null}}function Zo(e,t={}){let r=iu(),{resultEqualityCheck:n}=t,o,a=0;function d(){let p=r,{length:m}=arguments;for(let A=0,x=m;A<x;A++){let C=arguments[A];if(typeof C=="function"||typeof C=="object"&&C!==null){let F=p.o;F===null&&(p.o=F=new WeakMap);let w=F.get(C);w===void 0?(p=iu(),F.set(C,p)):p=w}else{let F=p.p;F===null&&(p.p=F=new Map);let w=F.get(C);w===void 0?(p=iu(),F.set(C,p)):p=w}}let f=p,h;if(p.s===ph)h=p.v;else if(h=e.apply(null,arguments),a++,n){let A=o?.deref?.()??o;A!=null&&n(A,h)&&(h=A,a!==0&&a--),o=typeof h=="object"&&h!==null||typeof h=="function"?new lw(h):h}return f.s=ph,f.v=h,h}return d.clearCache=()=>{r=iu(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}function mh(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,d=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),ow(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let h={...r,...m},{memoize:A,memoizeOptions:x=[],argsMemoize:C=Zo,argsMemoizeOptions:F=[],devModeChecks:w={}}=h,b=dh(x),R=dh(F),E=sw(o),v=A(function(){return a++,f.apply(null,arguments)},...b),T=!0,M=C(function(){d++;let O=cw(E,arguments);return p=v.apply(null,O),p},...R);return Object.assign(M,{resultFunc:f,memoizedResultFunc:v,dependencies:E,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:A,argsMemoize:C})};return Object.assign(n,{withTypes:()=>n}),n}var de=mh(Zo),pw=Object.assign((e,t=de)=>{aw(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(a=>e[a]);return t(n,(...a)=>a.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>pw});l();s();u();c();function fh(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var gh=fh(),Sh=fh;var mw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Xo:Xo.apply(null,arguments)},MU=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},fw=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error($t(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=>eu(n)&&n.type===e,r}var Ah=class Is extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Is.prototype)}static get[Symbol.species](){return Is}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Is(...t[0].concat(this)):new Is(...t.concat(this))}};function hh(e){return ut(e)?Ur(e,()=>{}):e}function yh(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function gw(e){return typeof e=="boolean"}var Sw=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},d=new Ah;return r&&(gw(r)?d.push(gh):d.push(Sh(r.extraArgument))),d},Ts="RTK_autoBatch",ta=()=>e=>({payload:e,meta:{[Ts]:!0}}),Ch=e=>t=>{setTimeout(t,e)},hw=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ch(10):e.type==="callback"?e.queueNotification:Ch(e.timeout),f=()=>{d=!1,a&&(a=!1,p.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let A=()=>o&&h(),x=n.subscribe(A);return p.add(h),()=>{x(),p.delete(h)}},dispatch(h){try{return o=!h?.meta?.[Ts],a=!o,a&&(d||(d=!0,m(f))),n.dispatch(h)}finally{o=!0}}})},yw=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Ah(e);return n&&o.push(hw(typeof n=="object"?n:void 0)),o};function Fh(e){let t=Sw(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Zt(r))p=Jo(r);else throw new Error($t(1));let m;typeof n=="function"?m=n(t):m=t();let f=Xo;o&&(f=mw({trace:!1,...(typeof o=="object"&&o)}));let h=ZS(...m),A=yw(h),x=typeof d=="function"?d(A):A(),C=f(...x);return lm(p,a,C)}function Rh(e){let t={},r=[],n,o={addCase(a,d){let p=typeof a=="string"?a:a.type;if(!p)throw new Error($t(28));if(p in t)throw new Error($t(29));return t[p]=d,o},addMatcher(a,d){return r.push({matcher:a,reducer:d}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function Cw(e){return typeof e=="function"}function re(e,t){let[r,n,o]=Rh(t),a;if(Cw(e))a=()=>hh(e());else{let p=hh(e);a=()=>p}function d(p=a(),m){let f=[r[m.type],...n.filter(({matcher:h})=>h(m)).map(({reducer:h})=>h)];return f.filter(h=>!!h).length===0&&(f=[o]),f.reduce((h,A)=>{if(A)if(St(h)){let C=A(h,m);return C===void 0?h:C}else{if(ut(h))return Ur(h,x=>A(x,m));{let x=A(h,m);if(x===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return h},p)}return d.getInitialState=a,d}var bh=(e,t)=>fw(e)?e.match(t):e(t);function er(...e){return t=>e.some(r=>bh(r,t))}function ea(...e){return t=>e.every(r=>bh(r,t))}function cu(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 Os(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function uu(...e){return e.length===0?t=>cu(t,["pending"]):Os(e)?er(...e.map(t=>t.pending)):uu()(e[0])}function lo(...e){return e.length===0?t=>cu(t,["rejected"]):Os(e)?er(...e.map(t=>t.rejected)):lo()(e[0])}function ks(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ea(lo(...e),t):Os(e)?ea(lo(...e),t):ks()(e[0])}function _r(...e){return e.length===0?t=>cu(t,["fulfilled"]):Os(e)?er(...e.map(t=>t.fulfilled)):_r()(e[0])}function lu(...e){return e.length===0?t=>cu(t,["pending","fulfilled","rejected"]):Os(e)?er(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):lu()(e[0])}var xw="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",du=(e=21)=>{let t="",r=e;for(;r--;)t+=xw[Math.random()*64|0];return t},Aw=["name","message","stack","code"],bm=class{constructor(e,t){be(this,"_type");this.payload=e,this.meta=t}},xh=class{constructor(e,t){be(this,"_type");this.payload=e,this.meta=t}},Fw=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Aw)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ie=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(m,f,h,A)=>({payload:m,meta:{...(A||{}),arg:h,requestId:f,requestStatus:"fulfilled"}})),a=P(t+"/pending",(m,f,h)=>({payload:void 0,meta:{...(h||{}),arg:f,requestId:m,requestStatus:"pending"}})),d=P(t+"/rejected",(m,f,h,A,x)=>({payload:A,error:(n&&n.serializeError||Fw)(m||"Rejected"),meta:{...(x||{}),arg:h,requestId:f,rejectedWithValue:!!A,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,h,A)=>{let x=n?.idGenerator?n.idGenerator(m):du(),C=new i.AbortController,F,w;function b(E){w=E,C.abort()}let R=_asyncToGenerator(function*(){let E;try{let T=n?.condition?.(m,{getState:h,extra:A});if(bw(T)&&(T=yield T),T===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((q,O)=>{F=()=>{O({name:"AbortError",message:w||"Aborted"})},C.signal.addEventListener("abort",F)});f(a(x,m,n?.getPendingMeta?.({requestId:x,arg:m},{getState:h,extra:A}))),E=yield Promise.race([M,Promise.resolve(r(m,{dispatch:f,getState:h,extra:A,requestId:x,signal:C.signal,abort:b,rejectWithValue:(q,O)=>new bm(q,O),fulfillWithValue:(q,O)=>new xh(q,O)})).then(q=>{if(q instanceof bm)throw q;return q instanceof xh?o(q.payload,x,m,q.meta):o(q,x,m)})])}catch(T){E=T instanceof bm?d(null,x,m,T.payload,T.meta):d(T,x,m)}finally{F&&C.signal.removeEventListener("abort",F)}return n&&!n.dispatchConditionRejection&&d.match(E)&&E.meta.condition||f(E),E})();return Object.assign(R,{abort:b,requestId:x,arg:m,unwrap(){return R.then(Rw)}})}}return Object.assign(p,{pending:a,rejected:d,fulfilled:o,settled:er(d,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Rw(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function bw(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var vh=Symbol.for("rtk-slice-createasyncthunk"),_U={[vh]:ie};function vw(e,t){return`${e}/${t}`}function Pw({creators:e}={}){let t=e?.asyncThunk?.[vh];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error($t(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(Ew()):n.reducers)||{},p=Object.keys(d),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(E,v){let T=typeof E=="string"?E:E.type;if(!T)throw new Error($t(12));if(T in m.sliceCaseReducersByType)throw new Error($t(13));return m.sliceCaseReducersByType[T]=v,f},addMatcher(E,v){return m.sliceMatchers.push({matcher:E,reducer:v}),f},exposeAction(E,v){return m.actionCreators[E]=v,f},exposeCaseReducer(E,v){return m.sliceCaseReducersByName[E]=v,f}};p.forEach(E=>{let v=d[E],T={reducerName:E,type:vw(o,E),createNotation:typeof n.reducers=="function"};Tw(v)?kw(T,v,f,t):Iw(T,v,f)});function h(){let[E={},v=[],T=void 0]=typeof n.extraReducers=="function"?Rh(n.extraReducers):[n.extraReducers],M={...E,...m.sliceCaseReducersByType};return re(n.initialState,q=>{for(let O in M)q.addCase(O,M[O]);for(let O of m.sliceMatchers)q.addMatcher(O.matcher,O.reducer);for(let O of v)q.addMatcher(O.matcher,O.reducer);T&&q.addDefaultCase(T)})}let A=E=>E,x=new Map,C;function F(E,v){return C||(C=h()),C(E,v)}function w(){return C||(C=h()),C.getInitialState()}function b(E,v=!1){function T(q){let O=q[E];return typeof O>"u"&&v&&(O=w()),O}function M(q=A){let O=yh(x,v,()=>new WeakMap);return yh(O,q,()=>{let k={};for(let[V,Q]of Object.entries(n.selectors??{}))k[V]=ww(Q,q,w,v);return k})}return{reducerPath:E,getSelectors:M,get selectors(){return M(T)},selectSlice:T}}let R={name:o,reducer:F,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:w,...b(a),injectInto(E,{reducerPath:v,...T}={}){let M=v??a;return E.inject({reducerPath:M,reducer:F},T),{...R,...b(M,!0)}}};return R}}function ww(e,t,r,n){function o(a,...d){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return o.unwrapped=e,o}var po=Pw();function Ew(){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 Iw({type:e,reducerName:t,createNotation:r},n,o){let a,d;if("reducer"in n){if(r&&!Ow(n))throw new Error($t(17));a=n.reducer,d=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,d?P(e,d):P(e))}function Tw(e){return e._reducerDefinitionType==="asyncThunk"}function Ow(e){return e._reducerDefinitionType==="reducerWithPrepare"}function kw({type:e,reducerName:t},r,n,o){if(!o)throw new Error($t(18));let{payloadCreator:a,fulfilled:d,pending:p,rejected:m,settled:f,options:h}=r,A=o(e,a,h);n.exposeAction(t,A),d&&n.addCase(A.fulfilled,d),p&&n.addCase(A.pending,p),m&&n.addCase(A.rejected,m),f&&n.addMatcher(A.settled,f),n.exposeCaseReducer(t,{fulfilled:d||su,pending:p||su,rejected:m||su,settled:f||su})}function su(){}var Ph="listener",wh="completed",Eh="cancelled",jU=`task-${Eh}`,$U=`task-${wh}`,GU=`${Ph}-${Eh}`,HU=`${Ph}-${wh}`;var{assign:Ih}=Object;var vm="listenerMiddleware";var qw=Ih(P(`${vm}/add`),{withTypes:()=>qw}),WU=P(`${vm}/removeAll`),Dw=Ih(P(`${vm}/remove`),{withTypes:()=>Dw});var zU=Symbol.for("rtk-state-proxy-original");function $t(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. `}l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();var Th=/^(?:[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 Vw(e){return typeof e=="string"&&Th.test(e)}var Pm=Vw;l();s();u();c();var Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function Oh(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()}l();s();u();c();var wm,Nw=new Uint8Array(16);function Em(){if(!wm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");wm=crypto.getRandomValues.bind(crypto)}return wm(Nw)}l();s();u();c();l();s();u();c();var Mw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Im={randomUUID:Mw};function Lw(e,t,r){if(Im.randomUUID&&!t&&!e)return Im.randomUUID();e=e||{};let n=e.random??e.rng?.()??Em();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 Oh(n)}var Tm=Lw;l();s();u();c();function kh(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Qw({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(o,a,r))}function Bw(e){return{getClientId:()=>{let t="visitorId",r=e.get(),n=r.storage,o=n.getItem(t),a=o&&Pm(o)?o:r.generateUUID();return n.setItem(t,a),a}}}var Dh="1.1.1";function Uw(e){let{trackingId:t}=e;return{trackingId:t}}function _w(e){return(e.source||[]).concat([`relay@${Dh}`])}function Vh(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:d}=r,p=Uw(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:_w(t),clientId:m,userAgent:d(),referrer:o(),location:a()})}function jw(e,t,r,n,o){return{...t,meta:Vh(e,r,n,o)}}var $w="*";function Gw(){let e=[];function t({type:m,callback:f}){return e.findIndex(h=>h.type===m&&h.callback===f)}function r(m,f){return m.type==="*"||f===m.type}function n(m){return t(m)<0&&e.push(m),()=>p(m.type,m.callback)}function o(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(h){console.error(h)}})}function a(m){if(m===$w)e.length=0;else for(let f=e.length-1;f>=0;f--)e[f].type===m&&e.splice(f,1)}function d(m){let f=t(m);f>=0&&e.splice(f,1)}function p(m,f){f?d({type:m,callback:f}):a(m)}return{add:n,call:o,remove:p}}function qh({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 Hw(e){let t=qh(e);return{get:()=>t,update:r=>{t=qh({...t,...r})}}}var Om=Ww();function Ww(){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 a of o){let d=a.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function zw(){return{getItem(e){return Om.getItem(e)||localStorage.getItem(e)},removeItem(e){Om.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Om.setItem(e,t,31556952e3)}}}function Kw(){let e=document.referrer;return e===""?null:e}function Yw(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(kh().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:()=>Kw(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Tm(),storage:zw()}}function Jw(){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 Xw(){return{getItem(){return null},removeItem(){},setItem(){}}}function Zw(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Xw()}}function eE(e){let t=e.get().mode!=="disabled",r=e.get().environment;return t&&r?{...r,runtime:"custom"}:t&&tE()&&Jw()?Yw():Zw()}function tE(){try{return typeof window=="object"}catch{return!1}}function rE(e){return{get:()=>Object.freeze(eE(e))}}function Nh(e){let t=Hw(e),r=Gw(),n=rE(t),o=Bw(n);return{emit:(a,d)=>{let p=t.get(),m=n.get(),f=jw(a,d,p,m,o);return Qw({config:p,environment:m,event:f,listenerManager:r})},getMeta:a=>Vh(a,t.get(),n.get(),o),on:(a,d)=>r.add({type:a,callback:d}),off:(a,d)=>r.remove(a,d),updateConfig:a=>t.update(a),version:Dh}}l();s();u();c();l();s();u();c();var ln="3.23.1",Mh=["@coveo/atomic","@coveo/quantic"];var dn=de(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ln}`));var ra=de(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>dn(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},d)=>Nh({mode:a?"emit":"disabled",url:o??zc(e,t),token:r,trackingId:n,source:d}));l();s();u();c();l();s();u();c();function jr(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 N(e,t,r,n){function o(a){return a instanceof r?a:new r(function(d){d(a)})}return new(r||(r=Promise))(function(a,d){function p(h){try{f(n.next(h))}catch(A){d(A)}}function m(h){try{f(n.throw(h))}catch(A){d(A)}}function f(h){h.done?a(h.value):o(h.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var ye;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ye||(ye={}));function Dm(){return typeof window<"u"}function Wm(){return typeof navigator<"u"}function na(){return typeof document<"u"}function Vm(){try{return typeof localStorage<"u"}catch{return!1}}function nE(){try{return typeof sessionStorage<"u"}catch{return!1}}function Jh(){return Wm()&&navigator.cookieEnabled}var oE=[ye.click,ye.custom,ye.search,ye.view],aE=(e,t)=>oE.indexOf(e)!==-1?Object.assign({language:na()?document.documentElement.lang:"unknown",userAgent:Wm()?navigator.userAgent:"unknown"},t):t,Vs=class e{static set(t,r,n){var o,a,d,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Lh(t,r,a):(d=p.split("."),o=d[d.length-2]+"."+d[d.length-1],Lh(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Lh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function iE(){return Vm()?localStorage:Jh()?new Ns:nE()?sessionStorage:new aa}var Ns=class e{getItem(t){return Vs.get(`${e.prefix}${t}`)}removeItem(t){Vs.erase(`${e.prefix}${t}`)}setItem(t,r,n){Vs.set(`${e.prefix}${t}`,r,n)}};Ns.prefix="coveo_";var Nm=class{constructor(){this.cookieStorage=new Ns}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)}},aa=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},qs="__coveo.analytics.history",Xh=20,Zh=1e3*60,ey=75,ia=class{constructor(t){this.store=t||iE()}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 N(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 N(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(qs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return N(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(qs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(qs,JSON.stringify(t.slice(0,Xh)))}catch{}}clear(){try{this.store.removeItem(qs)}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,ey)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Zh:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}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))}},ty=Object.freeze({__proto__:null,HistoryStore:ia,MAX_NUMBER_OF_HISTORY_ELEMENTS:Xh,MAX_VALUE_SIZE:ey,MIN_THRESHOLD_FOR_DUPLICATE_VALUE:Zh,STORE_KEY:qs,default:ia}),sE=(e,t)=>N(void 0,void 0,void 0,function*(){return e===ye.view?(yield cE(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),cE=e=>N(void 0,void 0,void 0,function*(){let t=new ia,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),pu,uE=new Uint8Array(16);function lE(){if(!pu&&(pu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pu(uE)}var dE=/^(?:[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 fu(e){return typeof e=="string"&&dE.test(e)}var Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).slice(1));function ry(e,t=0){return(Ze[e[t+0]]+Ze[e[t+1]]+Ze[e[t+2]]+Ze[e[t+3]]+"-"+Ze[e[t+4]]+Ze[e[t+5]]+"-"+Ze[e[t+6]]+Ze[e[t+7]]+"-"+Ze[e[t+8]]+Ze[e[t+9]]+"-"+Ze[e[t+10]]+Ze[e[t+11]]+Ze[e[t+12]]+Ze[e[t+13]]+Ze[e[t+14]]+Ze[e[t+15]]).toLowerCase()}function pE(e){if(!fu(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 mE(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var fE="6ba7b810-9dad-11d1-80b4-00c04fd430c8",gE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function SE(e,t,r){function n(o,a,d,p){var m;if(typeof o=="string"&&(o=mE(o)),typeof a=="string"&&(a=pE(a)),((m=a)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(a),f.set(o,a.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let h=0;h<16;++h)d[p+h]=f[h];return d}return ry(f)}try{n.name=e}catch{}return n.DNS=fE,n.URL=gE,n}var hE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Qh={randomUUID:hE};function mo(e,t,r){if(Qh.randomUUID&&!t&&!e)return Qh.randomUUID();e=e||{};let n=e.random||(e.rng||lE)();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 ry(n)}function yE(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 km(e,t){return e<<t|e>>>32-t}function CE(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let d=unescape(encodeURIComponent(e));e=[];for(let p=0;p<d.length;++p)e.push(d.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let d=0;d<o;++d){let p=new Uint32Array(16);for(let m=0;m<16;++m)p[m]=e[d*64+m*4]<<24|e[d*64+m*4+1]<<16|e[d*64+m*4+2]<<8|e[d*64+m*4+3];a[d]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<o;++d){let p=new Uint32Array(80);for(let C=0;C<16;++C)p[C]=a[d][C];for(let C=16;C<80;++C)p[C]=km(p[C-3]^p[C-8]^p[C-14]^p[C-16],1);let m=r[0],f=r[1],h=r[2],A=r[3],x=r[4];for(let C=0;C<80;++C){let F=Math.floor(C/20),w=km(m,5)+yE(F,f,h,A)+x+t[F]+p[C]>>>0;x=A,A=h,h=km(f,30)>>>0,f=m,m=w}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+A>>>0,r[4]=r[4]+x>>>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 xE=SE("v5",80,CE),Bh=xE,ny="2.30.45",Uh=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ds={pageview:"pageview",event:"event"},gu=class{constructor({client:t,uuidGenerator:r=mo}){this.client=t,this.uuidGenerator=r}},Mm=class extends gu{constructor({client:t,uuidGenerator:r=mo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Uh(window.location),this.lastReferrer=na()?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:na()?document.title:"",encoding:na()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Ds.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ds.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ds.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ds.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 Uh(window.location)}},pn=class e{constructor(t,r){if(!fu(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 a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return fu(a)?new e(a,Number.parseInt(o)*1e3):null}};pn.cvo_cid="cvo_cid";pn.expirationTime=120;var Lm=class extends gu{constructor({client:t,uuidGenerator:r=mo}){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 N(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(pn.cvo_cid,new pn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Lm.Id="link";var wt=Object.keys;function mu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var qm=128,oy=192,_h=224,jh=240;function AE(e){return(e&248)===jh?4:(e&jh)===_h?3:(e&_h)===oy?2:1}function FE(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&qm)!=qm)break;if(r-=3,(n&oy)!=qm){t-r>=AE(n)*3&&(r=t);break}}return e.substring(0,r)}var Qm={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"},RE=wt(Qm).map(e=>Qm[e]),bE=[...RE].join("|"),vE=new RegExp(`^(${bE}$)`),PE={svcAction:"svc_action",svcActionData:"svc_action_data"},wE=e=>wt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Qm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),EE=e=>vE.test(e),IE=[EE],$h={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Gh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},et={action:"pa",list:"pal",listSource:"pls"},Su={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},TE=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Bm={id:"quoteId",affiliation:"quoteAffiliation"},Um={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},OE={add:et,bookmark_add:et,bookmark_remove:et,click:et,checkout:et,checkout_option:et,detail:et,impression:et,remove:et,refund:Object.assign(Object.assign({},et),Su),purchase:Object.assign(Object.assign({},et),Su),quickview:et,quote:Object.assign(Object.assign({},et),Bm),review:Object.assign(Object.assign({},et),Um)},kE=wt($h).map(e=>$h[e]),qE=wt(Gh).map(e=>Gh[e]),DE=wt(et).map(e=>et[e]),VE=wt(Su).map(e=>Su[e]),NE=wt(Um).map(e=>Um[e]),ME=wt(Bm).map(e=>Bm[e]),LE=[...kE,"custom"].join("|"),QE=[...qE,"custom"].join("|"),ay="(pr[0-9]+)",iy="(il[0-9]+pi[0-9]+)",BE=new RegExp(`^${ay}(${LE})$`),UE=new RegExp(`^(${iy}(${QE}))|(il[0-9]+nm)$`),_E=new RegExp(`^(${DE.join("|")})$`),jE=new RegExp(`^(${VE.join("|")})$`),$E=new RegExp(`^${ay}custom$`),GE=new RegExp(`^${iy}custom$`),HE=new RegExp(`^(${[...TE,...NE,...ME].join("|")})$`),WE=e=>BE.test(e),zE=e=>UE.test(e),KE=e=>_E.test(e),YE=e=>jE.test(e),JE=e=>HE.test(e),XE=[zE,WE,KE,YE,JE],ZE=[$E,GE],eI={anonymizeIp:"aip"},tI={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},rI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},nI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],oI=Object.assign(Object.assign(Object.assign(Object.assign({},eI),tI),rI),nI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),_m=Object.assign(Object.assign({},oI),PE),aI=e=>{let t=!!e.action&&OE[e.action]||{};return wt(e).reduce((r,n)=>{let o=t[n]||_m[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},iI=wt(_m).map(e=>_m[e]),sI=e=>iI.indexOf(e)!==-1,cI=e=>e==="custom",uI=e=>[...XE,...IE,sI,cI].some(t=>t(e)),lI=e=>wt(e).reduce((t,r)=>{let n=dI(r);return n?Object.assign(Object.assign({},t),pI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),dI=e=>{let t;return[...ZE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},pI=(e,t)=>wt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),jm=class{constructor(t){this.opts=t}sendEvent(t,r){return N(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,a=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(d,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return N(this,void 0,void 0,function*(){let o=t,a=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;o=p||t;try{a=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return N(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(a=>!!a).join("&")})}isEventTypeLegacy(t){return[ye.click,ye.custom,ye.search,ye.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}},$m=class{sendEvent(t,r){return N(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return N(this,void 0,void 0,function*(){return Promise.resolve()})}},Hh=g.fetch,hu=class{constructor(t){this.opts=t}sendEvent(t,r){return N(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,d=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${d}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:f}=m,h=jr(m,["url"]),A;try{A=yield Hh(f,h)}catch(x){console.error("An error has occured when sending the event.",x);return}if(A.ok){let x=yield A.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}else{try{A.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,A,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return N(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Hh(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ye.click,ye.custom,ye.search,ye.view].indexOf(t)!==-1}getVisitorIdParam(){return N(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"})}},Gm=class{constructor(t,r){Vm()&&Jh()?this.storage=new Nm:Vm()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new aa),this.client=new hu(t),this.beaconClient=new jm(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Hm=class{constructor(t,r){this.storage=r||new aa,this.client=new hu(t)}getClientDependingOnEventType(t){return this.client}},yu=class{constructor(){this.storage=new aa,this.client=new $m}getClientDependingOnEventType(t){return this.client}},mI="xx",fI=e=>e?.startsWith(mI)||!1,gI=`
28
28
  We've detected you're using React Native but have not provided the corresponding runtime,
29
29
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
30
30
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
@@ -51,6 +51,4 @@ For more information, refer to the documentation: https://docs.coveo.com/en/o3r9
51
51
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
52
52
  * See the License for the specific language governing permissions and
53
53
  * limitations under the License.
54
- */if(__exports!=exports)module.exports=exports;return module.exports});
55
-
56
- window.coveoQuanticVersion = '3.20.1-pre.e76cf03e5b';
54
+ */if(__exports!=exports)module.exports=exports;return module.exports});