@coveo/quantic 3.30.4 → 3.30.5-pre.0c1931ccff
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +2 -2
- package/force-app/main/default/staticresources/coveoheadless/headless.js +2 -2
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +2 -2
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +2 -2
- package/package.json +2 -2
|
@@ -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"}},le=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let a in this.definition){let o=this.definition[a].validate(r[a]);o&&n.push(`${a}: ${o}`)}if(n.length)throw ww(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&&ne(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 Ye(e){return e===void 0}function Pw(e){return e===null}function ne(e){return Ye(e)||Pw(e)}var ae=class{constructor(e={}){Fe(this,"value");this.value=new ve(e)}validate(e){let t=this.value.validate(e);return t||(Ew(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Ew(e){return Ye(e)||_c(e)}function _c(e){return typeof e=="boolean"}var J=class{constructor(e={}){Fe(this,"value");this.config=e,this.value=new ve(e)}validate(e){let t=this.value.validate(e);return t||(Iw(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 Iw(e){return Ye(e)||Py(e)}function Py(e){return typeof e=="number"&&!Number.isNaN(e)}var kw=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,D=class{constructor(e={}){Fe(this,"value");Fe(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:a,ISODate:o}=this.config,d=this.value.validate(e);if(d)return d;if(Ye(e))return null;if(!Ha(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}`:a&&!a.includes(e)?`value should be one of: ${a.join(", ")}.`:o&&!(kw.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 Ha(e){return Object.prototype.toString.call(e)==="[object String]"}var _=class{constructor(e={}){Fe(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Ye(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Ey(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ne(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let a=e[r],o=n.validate(a);o!==null&&(t+=` ${o}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Ey(e){return e!==void 0&&typeof e=="object"}var te=class{constructor(e={}){Fe(this,"value");this.config=e,this.value=new ve(this.config)}validate(e){if(!ne(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ne(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&&ne(n)&&(r=`value is null or undefined: ${e.join(",")}`);let a=this.validatePrimitiveValue(n,this.config.each);a!==null&&(r+=` ${a}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return _c(e)||Ha(e)||Py(e)||Ey(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ga(e){return Array.isArray(e)}var rn=class{constructor(e){Fe(this,"value");this.config=e,this.value=new ve(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Ye(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 nn=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function Uc(e){return Array.isArray(e)}function Bc(e){return e.trim()===""}function Iy(e,t){return[...e.reduce((r,n)=>{let a=t(n);return r.has(a)||r.set(a,n),r},new Map).values()]}function Tw(e){return btoa(encodeURI(e))}function $c(e,t){let{[e]:r,...n}=t;return n}function za(e){return Tw(JSON.stringify(e))}var Ow=new Set(["1",1,"yes",!0]);function ky(){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=>Ow.has(r))}function Ty(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Oy(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Cs(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Hc(e,t,r={}){let n;return(...a)=>{let o=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,a)},t),o)return e.apply(void 0,a)}}function qw(e){if(Bc(e.openingDelimiter)||Bc(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ne(e.content)||Bc(e.content))return e.content;if(e.highlights.length===0)return Wa(e.content);let t=e.content.length,r="",n=0;for(let a=0;a<e.highlights.length;a++){let o=e.highlights[a],d=o.offset,p=d+o.length;if(p>t)break;r+=Wa(e.content.slice(n,d)),r+=e.openingDelimiter,r+=Wa(e.content.slice(d,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Wa(e.content.slice(n))),r}function Zp(e,t){return e=Wa(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,a,o)=>n?Xp(n,t.notMatchDelimiters):a?Xp(a,t.exactMatchDelimiters):o?Xp(o,t.correctionDelimiters):r)}function Xp(e,t){return t?t.open+e+t.close:e}function Wa(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),a=RegExp(r,"g");return n.test(e)?e.replace(a,o=>t[o]):e}l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();function jy(_x2,_x3){return _jy.apply(this,arguments)}function _jy(){_jy=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _jy.apply(this,arguments)}function Dy(e){let t,r,n,a=!1;return function(d){t===void 0?(t=d,r=0,n=-1):t=Dw(t,d);let p=t.length,m=0;for(;r<p;){a&&(t[r]===10&&(m=++r),a=!1);let f=-1;for(;r<p&&f===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:a=!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 Vy(e,t,r){let n=qy(),a=new TextDecoder;return function(d,p){if(d.length===0)r?.(n),n=qy();else if(p>0){let m=a.decode(d.subarray(0,p)),f=p+(d[p+1]===32?2:1),S=a.decode(d.subarray(f));switch(m){case"data":n.data=n.data?`${n.data}
|
|
27
|
-
${S}`:S;break;case"event":n.event=S;break;case"id":e(n.id=S);break;case"retry":jw(S,n,t);break}}}}function jw(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function Dw(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function qy(){return{data:"",event:"",id:"",retry:void 0}}var tm="text/event-stream",Vw=1e3,Ny="last-event-id";function My(){return typeof window<"u"}function Gc(e,{signal:t,headers:r,onopen:n,onmessage:a,onclose:o,onerror:d,openWhenHidden:p,fetch:m,...f}){return new Promise((S,A)=>{let x={...r};x.accept||(x.accept=tm);let C;function F(){C?.abort(),document.hidden||I()}!p&&My()&&document.addEventListener("visibilitychange",F);let v=Vw,R;function b(){My()&&document.removeEventListener("visibilitychange",F),clearTimeout(R),C?.abort()}t?.addEventListener("abort",()=>{b(),S()});let E=m??y,w=n??Nw;function I(){return _I2.apply(this,arguments)}function _I2(){_I2=_asyncToGenerator(function*(){C=i.AbortController?new i.AbortController:null;try{let N=yield E(e,{...f,headers:x,signal:C?.signal});yield w(N),yield jy(N.body,Dy(Vy(q=>{q?x[Ny]=q:delete x[Ny]},q=>{v=q},a))),o?.(),b(),S()}catch(N){if(!C?.signal?.aborted)try{let q=d?.(N)??v;clearTimeout(R),R=setTimeout(I,q)}catch(q){b(),A(q)}}});return _I2.apply(this,arguments)}I()})}function Nw(e){let t=e.headers.get("content-type");if(!t?.startsWith(tm))throw new Error(`Expected content-type to be ${tm}, Actual: ${t}`)}l();s();u();c();var an=class{constructor(t){Fe(this,"_basePath");Fe(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 Mw=(e,t,r)=>new an(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Qy=3,Qw=5e3,Lw="text/event-stream",am=1,rm=class extends Error{},As=class extends Error{constructor(r){super(r.message);this.payload=r}},nm=class{constructor(){Fe(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)}},zc=class{constructor(t){Fe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:a,streamId:o,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:S}=r,A=new nm;if(!o){this.logger.error("No stream ID found");return}let x=0,C,F=()=>{C&&!A.isActive(C)&&(R?.abort(),S(),b())},v=()=>{A.remove(C),C=Oy(F,C,Qw),A.add(C)},R=new i.AbortController,b=()=>Gc(Mw(n,a,o),{method:"GET",fetch:y,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:R?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===Lw)return;throw E.status>=400&&E.status<500&&E.status!==429?new As({message:"Error opening stream",code:E.status}):new rm})()},onmessage:E=>{if(R?.signal.aborted)return;let w=JSON.parse(E.data);if(w.finishReason==="ERROR"){A.remove(C),R?.abort(),m({message:w.errorMessage,code:w.statusCode});return}p(w),x=0,w.finishReason==="COMPLETED"?(A.remove(C),f()):v()},onerror:E=>{if(!R?.signal.aborted){if(A.remove(C),E instanceof As)throw R?.abort(),m(E),E;if(++x>Qy){this.logger.info("Maximum retry exceeded.");let w={message:"Failed to complete stream.",code:am};throw R?.abort(),m(w),new As(w)}this.logger.info(`Retrying...(${x}/${Qy})`),S()}}});return b(),R}};l();s();u();c();var Jy=$t(zy(),1);l();s();u();c();var z=new Error("Failed to load reducers."),Ya=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},aa=class extends Error{constructor(r,n){super();Fe(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 Wy(e){let t=[];for(let r in e){let n=encodeURIComponent(r),a=encodeURIComponent(e[r]);t.push(`${n}=${a}`)}return t.join("&")}function Yy(e){return typeof e!="object"||!e?!1:Object.values(e).every(pP)}function pP(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Ky(e){return e===429}var vt=class e{static call(t){return _asyncToGenerator(function*(){let r=mP(t),{logger:n}=t,a=yield e.preprocessRequest(r,t);n.info(a,"Platform request");let{url:o,...d}=a,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield y(o,d);if(Ky(m.status))throw m;return m});return function p(){return _ref.apply(this,arguments)}}();try{let m=yield(0,Jy.backOff)(p,{retry:f=>{let S=f&&Ky(f.status);return S&&n.info("Platform retrying request"),S}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new Ya;case 404:throw new aa(o,m.status);default:return n.info({response:m,requestInfo:a},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new aa(o):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:a,logger:o,requestMetadata:d}=r,{signal:p,...m}=t,f=Cs(m);try{let S=yield a(t,n,d);return{...t,...S}}catch(S){o.error(S,"Platform request preprocessing failed. Returning default request options.")}return f})()}};function Ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,a=r==="platform"?"":`.${r}`;return`https://${e}${a}.org${n}.coveo.com`}function Ne(e,t="prod"){return`${Ke(e,t)}/rest/search/v2`}function Yc(e,t="prod"){return`${Ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function mP(e){let{url:t,method:r,requestParams:n,contentType:a,accessToken:o,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=fP(n,a);return{url:t,method:r,headers:{"Content-Type":a,Authorization:`Bearer ${o}`,...e.headers},...(p&&{body:m}),signal:d}}function fP(e,t){return t==="application/x-www-form-urlencoded"?Yy(e)?Wy(e):"":JSON.stringify(e)}l();s();u();c();var Kc=e=>e;l();s();u();c();l();s();u();c();function Ka(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ct(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Ka(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Ka(),extendedResults:{},searchAction:void 0}}l();s();u();c();function on(e){let{url:t,accessToken:r,organizationId:n,authentication:a,...o}=e;return o}var sn=e=>{let{response:t}=e;return t.body?gP(e):yP(t)},gP=e=>SP(e)?CP(e):hP(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},yP=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function hP(e){return e.body.statusCode!==void 0}function SP(e){return e.body.exception!==void 0}var CP=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});l();s();u();c();var cn=class{constructor(){Fe(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new i.AbortController;let a=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(a?.signal??null)}finally{_this.currentAbortController===a&&(_this.currentAbortController=null)}})()}};l();s();u();c();l();s();u();c();function Xy(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}l();s();u();c();var Vr=(e,t,r,n)=>{let a=new an(`${e.url}${n}`);return a.addParam("organizationId",e.organizationId),e.authentication&&a.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:a.href,origin:"searchApiFetch"}};var Zy=(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},eh=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield vt.call({...Vr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:on(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Xy(r),a=yield r.arrayBuffer(),d=new TextDecoder(n).decode(a);return AP(d)?{success:d}:{error:sn({response:r,body:d})}});return function eh(_x4,_x5){return _ref2.apply(this,arguments)}}();function AP(e){return typeof e=="string"}l();s();u();c();function xP(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function FP(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Rs(e,t){if(t&&e.name==="AbortError")return{error:FP(e)};if(e instanceof aa)return{error:xP(e)};throw e}var Jc=class{constructor(t){this.options=t;Fe(this,"apiCallsQueues",{unknown:new cn,mainSearch:new cn,facetValues:new cn,foldingCollection:new cn,instantResults:new cn})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"POST","application/json","/plan"),requestParams:on(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Rs(r);let n=yield r.json();return bP(n)?{success:n}:{error:sn({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:on(t),..._this3.options});if(r instanceof Error)return Rs(r);let n=yield r.json(),a={response:r,body:n};return RP(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(a)).body}:{error:sn(a)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",a=yield _this4.apiCallsQueues[n].enqueue(p=>vt.call({...Vr(t,"POST","application/json",""),requestParams:on(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(a instanceof Error)return Rs(a,r?.disableAbortWarning);let o=yield a.json(),d={response:a,body:o};return th(o)?(d.body=rh(o),{success:(yield _this4.options.postprocessSearchResponseMiddleware(d)).body}):{error:sn(d)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"POST","application/json","/facet"),requestParams:on(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),a={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(a)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"POST","application/json",""),requestParams:on(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(th(n)){let a={response:r,body:n};return a.body=rh(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(a)).body}}return{error:sn({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return eh(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return vP(n)?{success:n}:{error:sn({response:r,body:n})}})()}},Xc=e=>e.success!==void 0,Be=e=>e.error!==void 0;function th(e){return e.results!==void 0}function rh(e){let t=Ka();return ne(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function RP(e){return e.completions!==void 0}function bP(e){return e.preprocessingOutput!==void 0}function vP(e){return e.fields!==void 0}l();s();u();c();var nh=e=>e,ah=e=>e,oh=e=>e;l();s();u();c();l();s();u();c();var G=new D({required:!0,emptyAllowed:!1}),Ie=new D({required:!1,emptyAllowed:!1}),be=new D({required:!0,emptyAllowed:!0}),ih=new D({required:!1,emptyAllowed:!0}),Zc=new te({each:G,required:!0}),sh=new D({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),ch=new D({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),B_=new D({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Nr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),wt=(e,t)=>{if("required"in t)return{payload:new le({value:t}).validate({value:e}).value};let a=new _({options:{required:!0},values:t}).validate(e);if(a)throw new Ss(a);return{payload:e}},k=(e,t)=>{try{return wt(e,t)}catch(r){return{payload:e,error:Nr(r)}}},Me=(e,t,r,n)=>{let a=`Check the initialState of ${n}`;return uh(e,t,r,a,"Controller initialization error")},we=(e,t,r,n)=>{let a=`Check the options of ${n}`;return uh(e,t,r,a,"Controller initialization error")},uh=(e,t,r,n,a)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,a),o}};l();s();u();c();l();s();u();c();l();s();u();c();function Je(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 wP=typeof Symbol=="function"&&Symbol.observable||"@@observable",lh=wP,mm=()=>Math.random().toString(36).substring(7).split("").join("."),PP={INIT:`@@redux/INIT${mm()}`,REPLACE:`@@redux/REPLACE${mm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${mm()}`},eu=PP;function er(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 fm(e,t,r){if(typeof e!="function")throw new Error(Je(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Je(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Je(1));return r(fm)(e,t)}let n=e,a=t,o=new Map,d=o,p=0,m=!1;function f(){d===o&&(d=new Map,o.forEach((R,b)=>{d.set(b,R)}))}function S(){if(m)throw new Error(Je(3));return a}function A(R){if(typeof R!="function")throw new Error(Je(4));if(m)throw new Error(Je(5));let b=!0;f();let E=p++;return d.set(E,R),function(){if(b){if(m)throw new Error(Je(6));b=!1,f(),d.delete(E),o=null}}}function x(R){if(!er(R))throw new Error(Je(7));if(typeof R.type>"u")throw new Error(Je(8));if(typeof R.type!="string")throw new Error(Je(17));if(m)throw new Error(Je(9));try{m=!0,a=n(a,R)}finally{m=!1}return(o=d).forEach(E=>{E()}),R}function C(R){if(typeof R!="function")throw new Error(Je(10));n=R,x({type:eu.REPLACE})}function F(){let R=A;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(Je(11));function E(){let I=b;I.next&&I.next(S())}return E(),{unsubscribe:R(E)}},[lh](){return this}}}return x({type:eu.INIT}),{dispatch:x,subscribe:A,getState:S,replaceReducer:C,[lh]:F}}function EP(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:eu.INIT})>"u")throw new Error(Je(12));if(typeof r(void 0,{type:eu.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Je(13))})}function Ja(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),a,o;try{EP(r)}catch(d){o=d}return function(p={},m){if(o)throw o;let f=!1,S={};for(let A=0;A<n.length;A++){let x=n[A],C=r[x],F=p[x],v=C(F,m);if(typeof v>"u"){let R=m&&m.type;throw new Error(Je(14))}S[x]=v,f=f||v!==F}return f=f||n.length!==Object.keys(p).length,f?S:p}}function Xa(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function dh(...e){return t=>(r,n)=>{let a=t(r,n),o=()=>{throw new Error(Je(15))},d={getState:a.getState,dispatch:(m,...f)=>o(m,...f)},p=e.map(m=>m(d));return o=Xa(...p)(a.dispatch),{...a,dispatch:o}}}function tu(e){return er(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var bm=Symbol.for("immer-nothing"),bs=Symbol.for("immer-draftable"),lt=Symbol.for("immer-state");function Xe(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ia=Object.getPrototypeOf;function At(e){return!!e&&!!e[lt]}function dt(e){return e?yh(e)||Array.isArray(e)||!!e[bs]||!!e.constructor?.[bs]||Za(e)||ks(e):!1}var IP=Object.prototype.constructor.toString();function yh(e){if(!e||typeof e!="object")return!1;let t=ia(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)===IP}function vm(e){return At(e)||Xe(15,e),e[lt].base_}function vs(e,t){sa(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function sa(e){let t=e[lt];return t?t.type_:Array.isArray(e)?1:Za(e)?2:ks(e)?3:0}function ws(e,t){return sa(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gm(e,t){return sa(e)===2?e.get(t):e[t]}function hh(e,t,r){let n=sa(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function kP(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Za(e){return e instanceof Map}function ks(e){return e instanceof Set}function oa(e){return e.copy_||e.base_}function Sm(e,t){if(Za(e))return new Map(e);if(ks(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=yh(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[lt];let a=Reflect.ownKeys(n);for(let o=0;o<a.length;o++){let d=a[o],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(ia(e),n)}else{let n=ia(e);if(n!==null&&r)return{...e};let a=Object.create(n);return Object.assign(a,e)}}function ou(e,t=!1){return iu(e)||At(e)||!dt(e)||(sa(e)>1&&Object.defineProperties(e,{set:{value:ru},add:{value:ru},clear:{value:ru},delete:{value:ru}}),Object.freeze(e),t&&Object.values(e).forEach(r=>ou(r,!0))),e}function ru(){Xe(2)}function iu(e){return Object.isFrozen(e)}var Cm={};function ca(e){let t=Cm[e];return t||Xe(0,e),t}function TP(e,t){Cm[e]||(Cm[e]=t)}var Ps;function Sh(){return Ps}function OP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ph(e,t){t&&(ca("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Am(e){xm(e),e.drafts_.forEach(qP),e.drafts_=null}function xm(e){e===Ps&&(Ps=e.parent_)}function mh(e){return Ps=OP(Ps,e)}function qP(e){let t=e[lt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fh(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[lt].modified_&&(Am(t),Xe(4)),dt(e)&&(e=nu(t,e),t.parent_||au(t,e)),t.patches_&&ca("Patches").generateReplacementPatches_(r[lt].base_,e,t.patches_,t.inversePatches_)):e=nu(t,r,[]),Am(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==bm?e:void 0}function nu(e,t,r){if(iu(t))return t;let n=t[lt];if(!n)return vs(t,(a,o)=>gh(e,n,t,a,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return au(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let a=n.copy_,o=a,d=!1;n.type_===3&&(o=new Set(a),a.clear(),d=!0),vs(o,(p,m)=>gh(e,n,a,p,m,r,d)),au(e,a,!1),r&&e.patches_&&ca("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function gh(e,t,r,n,a,o,d){if(At(a)){let p=o&&t&&t.type_!==3&&!ws(t.assigned_,n)?o.concat(n):void 0,m=nu(e,a,p);if(hh(r,n,m),At(m))e.canAutoFreeze_=!1;else return}else d&&r.add(a);if(dt(a)&&!iu(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;nu(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Za(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&au(e,a)}}function au(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ou(t,r)}function jP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Sh(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},a=n,o=wm;r&&(a=[n],o=Es);let{revoke:d,proxy:p}=Proxy.revocable(a,o);return n.draft_=p,n.revoke_=d,p}var wm={get(e,t){if(t===lt)return e;let r=oa(e);if(!ws(r,t))return DP(e,r,t);let n=r[t];return e.finalized_||!dt(n)?n:n===ym(e.base_,t)?(hm(e),e.copy_[t]=Rm(n,e)):n},has(e,t){return t in oa(e)},ownKeys(e){return Reflect.ownKeys(oa(e))},set(e,t,r){let n=Ch(oa(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let a=ym(oa(e),t),o=a?.[lt];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(kP(r,a)&&(r!==void 0||ws(e.base_,t)))return!0;hm(e),Fm(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 ym(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,hm(e),Fm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=oa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Xe(11)},getPrototypeOf(e){return ia(e.base_)},setPrototypeOf(){Xe(12)}},Es={};vs(wm,(e,t)=>{Es[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Es.deleteProperty=function(e,t){return Es.set.call(this,e,t,void 0)};Es.set=function(e,t,r){return wm.set.call(this,e[0],t,r,e[0])};function ym(e,t){let r=e[lt];return(r?oa(r):e)[t]}function DP(e,t,r){let n=Ch(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Ch(e,t){if(!(t in e))return;let r=ia(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=ia(r)}}function Fm(e){e.modified_||(e.modified_=!0,e.parent_&&Fm(e.parent_))}function hm(e){e.copy_||(e.copy_=Sm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let d=this;return function(m=o,...f){return d.produce(m,S=>r.call(this,S,...f))}}typeof r!="function"&&Xe(6),n!==void 0&&typeof n!="function"&&Xe(7);let a;if(dt(t)){let o=mh(this),d=Rm(t,void 0),p=!0;try{a=r(d),p=!1}finally{p?Am(o):xm(o)}return ph(o,n),fh(a,o)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===bm&&(a=void 0),this.autoFreeze_&&ou(a,!0),n){let o=[],d=[];ca("Patches").generateReplacementPatches_(t,a,o,d),n(o,d)}return a}else Xe(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(d,...p)=>this.produceWithPatches(d,m=>t(m,...p));let n,a;return[this.produce(t,r,(d,p)=>{n=d,a=p}),n,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){dt(e)||Xe(8),At(e)&&(e=Ah(e));let t=mh(this),r=Rm(e,void 0);return r[lt].isManual_=!0,xm(t),r}finishDraft(e,t){let r=e&&e[lt];(!r||!r.isManual_)&&Xe(9);let{scope_:n}=r;return ph(n,t),fh(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 a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));let n=ca("Patches").applyPatches_;return At(e)?n(e,t):this.produce(e,a=>n(a,t))}};function Rm(e,t){let r=Za(e)?ca("MapSet").proxyMap_(e,t):ks(e)?ca("MapSet").proxySet_(e,t):jP(e,t);return(t?t.scope_:Sh()).drafts_.push(r),r}function Ah(e){return At(e)||Xe(10,e),xh(e)}function xh(e){if(!dt(e)||iu(e))return e;let t=e[lt],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Sm(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Sm(e,!0);return vs(r,(n,a)=>{hh(r,n,xh(a))}),t&&(t.finalized_=!1),r}function Fh(){let t="replace",r="add",n="remove";function a(x,C,F,v){switch(x.type_){case 0:case 2:return d(x,C,F,v);case 1:return o(x,C,F,v);case 3:return p(x,C,F,v)}}function o(x,C,F,v){let{base_:R,assigned_:b}=x,E=x.copy_;E.length<R.length&&([R,E]=[E,R],[F,v]=[v,F]);for(let w=0;w<R.length;w++)if(b[w]&&E[w]!==R[w]){let I=C.concat([w]);F.push({op:t,path:I,value:A(E[w])}),v.push({op:t,path:I,value:A(R[w])})}for(let w=R.length;w<E.length;w++){let I=C.concat([w]);F.push({op:r,path:I,value:A(E[w])})}for(let w=E.length-1;R.length<=w;--w){let I=C.concat([w]);v.push({op:n,path:I})}}function d(x,C,F,v){let{base_:R,copy_:b}=x;vs(x.assigned_,(E,w)=>{let I=gm(R,E),N=gm(b,E),q=w?ws(R,E)?t:r:n;if(I===N&&q===t)return;let T=C.concat(E);F.push(q===n?{op:q,path:T}:{op:q,path:T,value:N}),v.push(q===r?{op:n,path:T}:q===n?{op:r,path:T,value:A(I)}:{op:t,path:T,value:A(I)})})}function p(x,C,F,v){let{base_:R,copy_:b}=x,E=0;R.forEach(w=>{if(!b.has(w)){let I=C.concat([E]);F.push({op:n,path:I,value:w}),v.unshift({op:r,path:I,value:w})}E++}),E=0,b.forEach(w=>{if(!R.has(w)){let I=C.concat([E]);F.push({op:r,path:I,value:w}),v.unshift({op:n,path:I,value:w})}E++})}function m(x,C,F,v){F.push({op:t,path:[],value:C===bm?void 0:C}),v.push({op:t,path:[],value:x})}function f(x,C){return C.forEach(F=>{let{path:v,op:R}=F,b=x;for(let N=0;N<v.length-1;N++){let q=sa(b),T=v[N];typeof T!="string"&&typeof T!="number"&&(T=""+T),(q===0||q===1)&&(T==="__proto__"||T==="constructor")&&Xe(19),typeof b=="function"&&T==="prototype"&&Xe(19),b=gm(b,T),typeof b!="object"&&Xe(18,v.join("/"))}let E=sa(b),w=S(F.value),I=v[v.length-1];switch(R){case t:switch(E){case 2:return b.set(I,w);case 3:Xe(16);default:return b[I]=w}case r:switch(E){case 1:return I==="-"?b.push(w):b.splice(I,0,w);case 2:return b.set(I,w);case 3:return b.add(w);default:return b[I]=w}case n:switch(E){case 1:return b.splice(I,1);case 2:return b.delete(I);case 3:return b.delete(F.value);default:return delete b[I]}default:Xe(17,R)}}),x}function S(x){if(!dt(x))return x;if(Array.isArray(x))return x.map(S);if(Za(x))return new Map(Array.from(x.entries()).map(([F,v])=>[F,S(v)]));if(ks(x))return new Set(Array.from(x).map(S));let C=Object.create(ia(x));for(let F in x)C[F]=S(x[F]);return ws(x,bs)&&(C[bs]=x[bs]),C}function A(x){return At(x)?S(x):x}TP("Patches",{applyPatches_:f,generatePatches_:a,generateReplacementPatches_:m})}var Is=new VP,Mr=Is.produce,su=Is.produceWithPatches.bind(Is);var Pm=Is.applyPatches.bind(Is);l();s();u();c();function NP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function MP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function QP(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 Rh=e=>Array.isArray(e)?e:[e];function LP(e){let t=Array.isArray(e[0])?e[0]:e;return QP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function _P(e,t){let r=[],{length:n}=e;for(let a=0;a<n;a++)r.push(e[a].apply(null,t));return r}var iU=Symbol();var sU=Object.getPrototypeOf({});var UP=class{constructor(e){this.value=e}deref(){return this.value}},BP=typeof WeakRef<"u"?WeakRef:UP,$P=0,bh=1;function cu(){return{s:$P,v:void 0,o:null,p:null}}function eo(e,t={}){let r=cu(),{resultEqualityCheck:n}=t,a,o=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 v=F.get(C);v===void 0?(p=cu(),F.set(C,p)):p=v}else{let F=p.p;F===null&&(p.p=F=new Map);let v=F.get(C);v===void 0?(p=cu(),F.set(C,p)):p=v}}let f=p,S;if(p.s===bh)S=p.v;else if(S=e.apply(null,arguments),o++,n){let A=a?.deref?.()??a;A!=null&&n(A,S)&&(S=A,o!==0&&o--),a=typeof S=="object"&&S!==null||typeof S=="function"?new BP(S):S}return f.s=bh,f.v=S,S}return d.clearCache=()=>{r=cu(),d.resetResultsCount()},d.resultsCount=()=>o,d.resetResultsCount=()=>{o=0},d}function vh(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...a)=>{let o=0,d=0,p,m={},f=a.pop();typeof f=="object"&&(m=f,f=a.pop()),NP(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let S={...r,...m},{memoize:A,memoizeOptions:x=[],argsMemoize:C=eo,argsMemoizeOptions:F=[],devModeChecks:v={}}=S,R=Rh(x),b=Rh(F),E=LP(a),w=A(function(){return o++,f.apply(null,arguments)},...R),I=!0,N=C(function(){d++;let T=_P(E,arguments);return p=w.apply(null,T),p},...b);return Object.assign(N,{resultFunc:f,memoizedResultFunc:w,dependencies:E,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:A,argsMemoize:C})};return Object.assign(n,{withTypes:()=>n}),n}var oe=vh(eo),HP=Object.assign((e,t=oe)=>{MP(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(o=>e[o]);return t(n,(...o)=>o.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>HP});l();s();u();c();function wh(e){return({dispatch:r,getState:n})=>a=>o=>typeof o=="function"?o(r,n,e):a(o)}var Ph=wh(),Eh=wh;var GP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Xa:Xa.apply(null,arguments)},vU=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},zP=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let a=t(...n);if(!a)throw new Error(Ht(0));return{type:e,payload:a.payload,...("meta"in a&&{meta:a.meta}),...("error"in a&&{error:a.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>tu(n)&&n.type===e,r}var qh=class Ts extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ts.prototype)}static get[Symbol.species](){return Ts}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ts(...t[0].concat(this)):new Ts(...t.concat(this))}};function Ih(e){return dt(e)?Mr(e,()=>{}):e}function kh(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function WP(e){return typeof e=="boolean"}var YP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:o=!0}=t??{},d=new qh;return r&&(WP(r)?d.push(Ph):d.push(Eh(r.extraArgument))),d},Os="RTK_autoBatch",ro=()=>e=>({payload:e,meta:{[Os]:!0}}),Th=e=>t=>{setTimeout(t,e)},KP=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),a=!0,o=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Th(10):e.type==="callback"?e.queueNotification:Th(e.timeout),f=()=>{d=!1,o&&(o=!1,p.forEach(S=>S()))};return Object.assign({},n,{subscribe(S){let A=()=>a&&S(),x=n.subscribe(A);return p.add(S),()=>{x(),p.delete(S)}},dispatch(S){try{return a=!S?.meta?.[Os],o=!a,o&&(d||(d=!0,m(f))),n.dispatch(S)}finally{a=!0}}})},JP=e=>function(r){let{autoBatch:n=!0}=r??{},a=new qh(e);return n&&a.push(KP(typeof n=="object"?n:void 0)),a};function jh(e){let t=YP(),{reducer:r=void 0,middleware:n,devTools:a=!0,preloadedState:o=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(er(r))p=Ja(r);else throw new Error(Ht(1));let m;typeof n=="function"?m=n(t):m=t();let f=Xa;a&&(f=GP({trace:!1,...(typeof a=="object"&&a)}));let S=dh(...m),A=JP(S),x=typeof d=="function"?d(A):A(),C=f(...x);return fm(p,o,C)}function Dh(e){let t={},r=[],n,a={addCase(o,d){let p=typeof o=="string"?o:o.type;if(!p)throw new Error(Ht(28));if(p in t)throw new Error(Ht(29));return t[p]=d,a},addMatcher(o,d){return r.push({matcher:o,reducer:d}),a},addDefaultCase(o){return n=o,a}};return e(a),[t,r,n]}function XP(e){return typeof e=="function"}function re(e,t){let[r,n,a]=Dh(t),o;if(XP(e))o=()=>Ih(e());else{let p=Ih(e);o=()=>p}function d(p=o(),m){let f=[r[m.type],...n.filter(({matcher:S})=>S(m)).map(({reducer:S})=>S)];return f.filter(S=>!!S).length===0&&(f=[a]),f.reduce((S,A)=>{if(A)if(At(S)){let C=A(S,m);return C===void 0?S:C}else{if(dt(S))return Mr(S,x=>A(x,m));{let x=A(S,m);if(x===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return S},p)}return d.getInitialState=o,d}var Vh=(e,t)=>zP(e)?e.match(t):e(t);function tr(...e){return t=>e.some(r=>Vh(r,t))}function to(...e){return t=>e.every(r=>Vh(r,t))}function lu(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 qs(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function du(...e){return e.length===0?t=>lu(t,["pending"]):qs(e)?tr(...e.map(t=>t.pending)):du()(e[0])}function ua(...e){return e.length===0?t=>lu(t,["rejected"]):qs(e)?tr(...e.map(t=>t.rejected)):ua()(e[0])}function js(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?to(ua(...e),t):qs(e)?to(ua(...e),t):js()(e[0])}function Qr(...e){return e.length===0?t=>lu(t,["fulfilled"]):qs(e)?tr(...e.map(t=>t.fulfilled)):Qr()(e[0])}function pu(...e){return e.length===0?t=>lu(t,["pending","fulfilled","rejected"]):qs(e)?tr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):pu()(e[0])}var ZP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",mu=(e=21)=>{let t="",r=e;for(;r--;)t+=ZP[Math.random()*64|0];return t},eE=["name","message","stack","code"],Em=class{constructor(e,t){Fe(this,"_type");this.payload=e,this.meta=t}},Oh=class{constructor(e,t){Fe(this,"_type");this.payload=e,this.meta=t}},tE=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of eE)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},se=(()=>{function e(t,r,n){let a=P(t+"/fulfilled",(m,f,S,A)=>({payload:m,meta:{...(A||{}),arg:S,requestId:f,requestStatus:"fulfilled"}})),o=P(t+"/pending",(m,f,S)=>({payload:void 0,meta:{...(S||{}),arg:f,requestId:m,requestStatus:"pending"}})),d=P(t+"/rejected",(m,f,S,A,x)=>({payload:A,error:(n&&n.serializeError||tE)(m||"Rejected"),meta:{...(x||{}),arg:S,requestId:f,rejectedWithValue:!!A,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,S,A)=>{let x=n?.idGenerator?n.idGenerator(m):mu(),C=new i.AbortController,F,v;function R(E){v=E,C.abort()}let b=_asyncToGenerator(function*(){let E;try{let I=n?.condition?.(m,{getState:S,extra:A});if(nE(I)&&(I=yield I),I===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((q,T)=>{F=()=>{T({name:"AbortError",message:v||"Aborted"})},C.signal.addEventListener("abort",F)});f(o(x,m,n?.getPendingMeta?.({requestId:x,arg:m},{getState:S,extra:A}))),E=yield Promise.race([N,Promise.resolve(r(m,{dispatch:f,getState:S,extra:A,requestId:x,signal:C.signal,abort:R,rejectWithValue:(q,T)=>new Em(q,T),fulfillWithValue:(q,T)=>new Oh(q,T)})).then(q=>{if(q instanceof Em)throw q;return q instanceof Oh?a(q.payload,x,m,q.meta):a(q,x,m)})])}catch(I){E=I instanceof Em?d(null,x,m,I.payload,I.meta):d(I,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(b,{abort:R,requestId:x,arg:m,unwrap(){return b.then(rE)}})}}return Object.assign(p,{pending:o,rejected:d,fulfilled:a,settled:tr(d,a),typePrefix:t})}return e.withTypes=()=>e,e})();function rE(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function nE(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Nh=Symbol.for("rtk-slice-createasyncthunk"),kU={[Nh]:se};function aE(e,t){return`${e}/${t}`}function oE({creators:e}={}){let t=e?.asyncThunk?.[Nh];return function(n){let{name:a,reducerPath:o=a}=n;if(!a)throw new Error(Ht(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(sE()):n.reducers)||{},p=Object.keys(d),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(E,w){let I=typeof E=="string"?E:E.type;if(!I)throw new Error(Ht(12));if(I in m.sliceCaseReducersByType)throw new Error(Ht(13));return m.sliceCaseReducersByType[I]=w,f},addMatcher(E,w){return m.sliceMatchers.push({matcher:E,reducer:w}),f},exposeAction(E,w){return m.actionCreators[E]=w,f},exposeCaseReducer(E,w){return m.sliceCaseReducersByName[E]=w,f}};p.forEach(E=>{let w=d[E],I={reducerName:E,type:aE(a,E),createNotation:typeof n.reducers=="function"};uE(w)?dE(I,w,f,t):cE(I,w,f)});function S(){let[E={},w=[],I=void 0]=typeof n.extraReducers=="function"?Dh(n.extraReducers):[n.extraReducers],N={...E,...m.sliceCaseReducersByType};return re(n.initialState,q=>{for(let T in N)q.addCase(T,N[T]);for(let T of m.sliceMatchers)q.addMatcher(T.matcher,T.reducer);for(let T of w)q.addMatcher(T.matcher,T.reducer);I&&q.addDefaultCase(I)})}let A=E=>E,x=new Map,C;function F(E,w){return C||(C=S()),C(E,w)}function v(){return C||(C=S()),C.getInitialState()}function R(E,w=!1){function I(q){let T=q[E];return typeof T>"u"&&w&&(T=v()),T}function N(q=A){let T=kh(x,w,()=>new WeakMap);return kh(T,q,()=>{let O={};for(let[j,Q]of Object.entries(n.selectors??{}))O[j]=iE(Q,q,v,w);return O})}return{reducerPath:E,getSelectors:N,get selectors(){return N(I)},selectSlice:I}}let b={name:a,reducer:F,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:v,...R(o),injectInto(E,{reducerPath:w,...I}={}){let N=w??o;return E.inject({reducerPath:N,reducer:F},I),{...b,...R(N,!0)}}};return b}}function iE(e,t,r,n){function a(o,...d){let p=t(o);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return a.unwrapped=e,a}var la=oE();function sE(){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 cE({type:e,reducerName:t,createNotation:r},n,a){let o,d;if("reducer"in n){if(r&&!lE(n))throw new Error(Ht(17));o=n.reducer,d=n.prepare}else o=n;a.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,d?P(e,d):P(e))}function uE(e){return e._reducerDefinitionType==="asyncThunk"}function lE(e){return e._reducerDefinitionType==="reducerWithPrepare"}function dE({type:e,reducerName:t},r,n,a){if(!a)throw new Error(Ht(18));let{payloadCreator:o,fulfilled:d,pending:p,rejected:m,settled:f,options:S}=r,A=a(e,o,S);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||uu,pending:p||uu,rejected:m||uu,settled:f||uu})}function uu(){}var Mh="listener",Qh="completed",Lh="cancelled",TU=`task-${Lh}`,OU=`task-${Qh}`,qU=`${Mh}-${Lh}`,jU=`${Mh}-${Qh}`;var{assign:_h}=Object;var Im="listenerMiddleware";var pE=_h(P(`${Im}/add`),{withTypes:()=>pE}),DU=P(`${Im}/removeAll`),mE=_h(P(`${Im}/remove`),{withTypes:()=>mE});var VU=Symbol.for("rtk-state-proxy-original");function Ht(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 Uh=/^(?:[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 fE(e){return typeof e=="string"&&Uh.test(e)}var km=fE;l();s();u();c();var Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).slice(1));function Bh(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()}l();s();u();c();var Tm,gE=new Uint8Array(16);function Om(){if(!Tm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Tm=crypto.getRandomValues.bind(crypto)}return Tm(gE)}l();s();u();c();l();s();u();c();var yE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qm={randomUUID:yE};function hE(e,t,r){if(qm.randomUUID&&!t&&!e)return qm.randomUUID();e=e||{};let n=e.random??e.rng?.()??Om();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 a=0;a<16;++a)t[r+a]=n[a];return t}return Bh(n)}var jm=hE;l();s();u();c();function $h(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function SE({config:e,environment:t,event:r,listenerManager:n}){let{url:a,token:o,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(a,o,r))}var Hh="visitorId";function CE(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(Hh),a=n&&km(n)?n:t.generateUUID();return r.setItem(Hh,a),a}}}var Kh="1.2.7",Dm=128,Jh=192,Gh=224,zh=240,AE=248;function xE(e){return(e&AE)===zh?4:(e&zh)===Gh?3:(e&Gh)===Jh?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&Dm)!=Dm)break;if(r-=3,(n&Jh)!=Dm){t-r>=xE(n)*3&&(r=t);break}}return e.substring(0,r)}function RE(e){let{trackingId:t}=e;return{trackingId:t}}function bE(e){return(e.source||[]).concat([`relay@${Kh}`])}function Xh(e,t,r,n){let{getReferrer:a,getLocation:o,getUserAgent:d}=r,p=RE(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:bE(t),clientId:m,userAgent:d(),referrer:Wh(a()),location:Wh(o())})}function Wh(e){return e!==null?FE(e,1024):null}function vE(e,t,r,n,a){return{...t,meta:Xh(e,r,n,a)}}var wE="*";function PE(){let e=[];function t({type:m,callback:f}){return e.findIndex(S=>S.type===m&&S.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 a(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(S){console.error(S)}})}function o(m){if(m===wE)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}):o(m)}return{add:n,call:a,remove:p}}function Yh({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 EE(e){let t=Yh(e);return{get:()=>t,update:r=>{t=Yh({...t,...r})}}}var Vm=IE();function IE(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,a=document.cookie.split(";");for(let o of a){let d=o.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,a){let o=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+a).toUTCString()}`,p=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function kE(){return{getItem(e){return Vm.getItem(e)||localStorage.getItem(e)},removeItem(e){Vm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Vm.setItem(e,t,31556952e3)}}}function TE(){let e=document.referrer;return e===""?null:e}function Nm(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if($h().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:()=>TE(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>jm(),storage:kE()}}function OE(){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 qE(){return{getItem(){return null},removeItem(){},setItem(){}}}function jE(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:qE()}}function DE(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=jE();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&VE()&&OE()?Nm():n}function VE(){try{return typeof window=="object"}catch{return!1}}function NE(e){return{get:()=>Object.freeze(DE(e))}}function Zh(e){let t=EE(e),r=PE(),n=NE(t),a=CE(n);return{emit:(o,d)=>{let p=t.get(),m=n.get(),f=vE(o,d,p,m,a);return SE({config:p,environment:m,event:f,listenerManager:r})},getMeta:o=>Xh(o,t.get(),n.get(),a),on:(o,d)=>r.add({type:o,callback:d}),off:(o,d)=>r.remove(o,d),updateConfig:o=>t.update(o),version:Kh}}l();s();u();c();function eS(){return typeof window<"u"&&typeof document<"u"}l();s();u();c();l();s();u();c();var un="3.31.1",tS=["@coveo/atomic","@coveo/quantic"];var ln=oe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${un}`));var Ds=oe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ln(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:a,enabled:o},d,p)=>{let m=QE(p);return Zh({mode:o?"emit":"disabled",url:a??Yc(e,t),token:r,trackingId:n??null,source:d,environment:m})}),ME={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},QE=e=>{if(!e)return;let t=e();return{...(eS()?Nm():ME),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};l();s();u();c();l();s();u();c();function Lr(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 a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function V(e,t,r,n){function a(o){return o instanceof r?o:new r(function(d){d(o)})}return new(r||(r=Promise))(function(o,d){function p(S){try{f(n.next(S))}catch(A){d(A)}}function m(S){try{f(n.throw(S))}catch(A){d(A)}}function f(S){S.done?o(S.value):a(S.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var Se;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Se||(Se={}));function Lm(){return typeof window<"u"}function Zm(){return typeof navigator<"u"}function no(){return typeof document<"u"}function _m(){try{return typeof localStorage<"u"}catch{return!1}}function LE(){try{return typeof sessionStorage<"u"}catch{return!1}}function gS(){return Zm()&&navigator.cookieEnabled}var _E=[Se.click,Se.custom,Se.search,Se.view],UE=(e,t)=>_E.indexOf(e)!==-1?Object.assign({language:no()?document.documentElement.lang:"unknown",userAgent:Zm()?navigator.userAgent:"unknown"},t):t,Ns=class e{static set(t,r,n){var a,o,d,p;n&&(o=new Date,o.setTime(o.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?rS(t,r,o):(d=p.split("."),a=d[d.length-2]+"."+d[d.length-1],rS(t,r,o,a))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),a=0;a<n.length;a++){var o=n[a];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function rS(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function BE(){return _m()?localStorage:gS()?new Ms:LE()?sessionStorage:new oo}var Ms=class e{getItem(t){return Ns.get(`${e.prefix}${t}`)}removeItem(t){Ns.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ns.set(`${e.prefix}${t}`,r,n)}};Ms.prefix="coveo_";var Um=class{constructor(){this.cookieStorage=new Ms}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)}},oo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},fu="__coveo.analytics.history",$E=20,HE=1e3*60,GE=75,hu=class{constructor(t){this.store=t||BE()}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 V(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 V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(fu);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(fu);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(fu,JSON.stringify(t.slice(0,$E)))}catch{}}clear(){try{this.store.removeItem(fu)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,a)=>(a.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,GE)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>HE:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:a,value:o}=r;return{name:n,time:a,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:a}=t;return r&&typeof a=="string"&&r.toLowerCase()==="query"&&a.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var zE=(e,t)=>V(void 0,void 0,void 0,function*(){return e===Se.view?(yield WE(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),WE=e=>V(void 0,void 0,void 0,function*(){let t=new hu,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),gu,YE=new Uint8Array(16);function KE(){if(!gu&&(gu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gu(YE)}var JE=/^(?:[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 Su(e){return typeof e=="string"&&JE.test(e)}var et=[];for(let e=0;e<256;++e)et.push((e+256).toString(16).slice(1));function yS(e,t=0){return(et[e[t+0]]+et[e[t+1]]+et[e[t+2]]+et[e[t+3]]+"-"+et[e[t+4]]+et[e[t+5]]+"-"+et[e[t+6]]+et[e[t+7]]+"-"+et[e[t+8]]+et[e[t+9]]+"-"+et[e[t+10]]+et[e[t+11]]+et[e[t+12]]+et[e[t+13]]+et[e[t+14]]+et[e[t+15]]).toLowerCase()}function XE(e){if(!Su(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 ZE(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var eI="6ba7b810-9dad-11d1-80b4-00c04fd430c8",tI="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function rI(e,t,r){function n(a,o,d,p){var m;if(typeof a=="string"&&(a=ZE(a)),typeof o=="string"&&(o=XE(o)),((m=o)===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+a.length);if(f.set(o),f.set(a,o.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let S=0;S<16;++S)d[p+S]=f[S];return d}return yS(f)}try{n.name=e}catch{}return n.DNS=eI,n.URL=tI,n}var nI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nS={randomUUID:nI};function da(e,t,r){if(nS.randomUUID&&!t&&!e)return nS.randomUUID();e=e||{};let n=e.random||(e.rng||KE)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let a=0;a<16;++a)t[r+a]=n[a];return t}return yS(n)}function aI(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 Mm(e,t){return e<<t|e>>>32-t}function oI(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,a=Math.ceil(n/16),o=new Array(a);for(let d=0;d<a;++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];o[d]=p}o[a-1][14]=(e.length-1)*8/Math.pow(2,32),o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<a;++d){let p=new Uint32Array(80);for(let C=0;C<16;++C)p[C]=o[d][C];for(let C=16;C<80;++C)p[C]=Mm(p[C-3]^p[C-8]^p[C-14]^p[C-16],1);let m=r[0],f=r[1],S=r[2],A=r[3],x=r[4];for(let C=0;C<80;++C){let F=Math.floor(C/20),v=Mm(m,5)+aI(F,f,S,A)+x+t[F]+p[C]>>>0;x=A,A=S,S=Mm(f,30)>>>0,f=m,m=v}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+S>>>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 iI=rI("v5",80,oI),aS=iI,hS="2.30.45",oS=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Vs={pageview:"pageview",event:"event"},Cu=class{constructor({client:t,uuidGenerator:r=da}){this.client=t,this.uuidGenerator=r}},Bm=class extends Cu{constructor({client:t,uuidGenerator:r=da}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=oS(window.location),this.lastReferrer=no()?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:no()?document.title:"",encoding:no()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},a={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},o),n),a),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:a,location:o}=this.getNextValues(t,r);this.lastReferrer=a,this.pageViewId=n,this.currentLocation=o,t===Vs.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Vs.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Vs.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Vs.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=a=>a.replace(/^\/?(.*)$/,"/$1");return`${(a=>a.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return oS(window.location)}},dn=class e{constructor(t,r){if(!Su(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(a=>new RegExp(a.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,a]=r;if(n.length!==32||isNaN(parseInt(a)))return null;let o=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Su(o)?new e(o,Number.parseInt(a)*1e3):null}};dn.cvo_cid="cvo_cid";dn.expirationTime=120;var $m=class extends Cu{constructor({client:t,uuidGenerator:r=da}){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 V(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(dn.cvo_cid,new dn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};$m.Id="link";var Et=Object.keys;function yu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Qm=128,SS=192,iS=224,sS=240;function sI(e){return(e&248)===sS?4:(e&sS)===iS?3:(e&iS)===SS?2:1}function cI(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&SS)!=Qm){t-r>=sI(n)*3&&(r=t);break}}return e.substring(0,r)}var Hm={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"},uI=Et(Hm).map(e=>Hm[e]),lI=[...uI].join("|"),dI=new RegExp(`^(${lI}$)`),pI={svcAction:"svc_action",svcActionData:"svc_action_data"},mI=e=>Et(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Hm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),fI=e=>dI.test(e),gI=[fI],cS={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},uS={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},tt={action:"pa",list:"pal",listSource:"pls"},Au={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},yI=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Gm={id:"quoteId",affiliation:"quoteAffiliation"},zm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},hI={add:tt,bookmark_add:tt,bookmark_remove:tt,click:tt,checkout:tt,checkout_option:tt,detail:tt,impression:tt,remove:tt,refund:Object.assign(Object.assign({},tt),Au),purchase:Object.assign(Object.assign({},tt),Au),quickview:tt,quote:Object.assign(Object.assign({},tt),Gm),review:Object.assign(Object.assign({},tt),zm)},SI=Et(cS).map(e=>cS[e]),CI=Et(uS).map(e=>uS[e]),AI=Et(tt).map(e=>tt[e]),xI=Et(Au).map(e=>Au[e]),FI=Et(zm).map(e=>zm[e]),RI=Et(Gm).map(e=>Gm[e]),bI=[...SI,"custom"].join("|"),vI=[...CI,"custom"].join("|"),CS="(pr[0-9]+)",AS="(il[0-9]+pi[0-9]+)",wI=new RegExp(`^${CS}(${bI})$`),PI=new RegExp(`^(${AS}(${vI}))|(il[0-9]+nm)$`),EI=new RegExp(`^(${AI.join("|")})$`),II=new RegExp(`^(${xI.join("|")})$`),kI=new RegExp(`^${CS}custom$`),TI=new RegExp(`^${AS}custom$`),OI=new RegExp(`^(${[...yI,...FI,...RI].join("|")})$`),qI=e=>wI.test(e),jI=e=>PI.test(e),DI=e=>EI.test(e),VI=e=>II.test(e),NI=e=>OI.test(e),MI=[jI,qI,DI,VI,NI],QI=[kI,TI],LI={anonymizeIp:"aip"},_I={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},UI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},BI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],$I=Object.assign(Object.assign(Object.assign(Object.assign({},LI),_I),UI),BI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Wm=Object.assign(Object.assign({},$I),pI),HI=e=>{let t=!!e.action&&hI[e.action]||{};return Et(e).reduce((r,n)=>{let a=t[n]||Wm[n]||n;return Object.assign(Object.assign({},r),{[a]:e[n]})},{})},GI=Et(Wm).map(e=>Wm[e]),zI=e=>GI.indexOf(e)!==-1,WI=e=>e==="custom",YI=e=>[...MI,...gI,zI,WI].some(t=>t(e)),KI=e=>Et(e).reduce((t,r)=>{let n=JI(r);return n?Object.assign(Object.assign({},t),XI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),JI=e=>{let t;return[...QI].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},XI=(e,t)=>Et(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Ym=class{constructor(t){this.opts=t}sendEvent(t,r){return V(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:a}=this.opts,o=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${o}`,r,a),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 V(this,void 0,void 0,function*(){let a=t,o=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;a=p||t;try{o=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:o,url:a}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,a=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",a?`visitorId=${a}`:"","discardVisitInfo=true"].filter(o=>!!o).join("&")})}isEventTypeLegacy(t){return[Se.click,Se.custom,Se.search,Se.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let a=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(a=`access_token=${encodeURIComponent(n)}&${a}`),a}},Km=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},lS=g.fetch,xu=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:a,preprocessRequest:o}=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),o?yield o(p,"analyticsFetch"):{}),{url:f}=m,S=Lr(m,["url"]),A;try{A=yield lS(f,S)}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&&a.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 V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield lS(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Se.click,Se.custom,Se.search,Se.view].indexOf(t)!==-1}getVisitorIdParam(){return V(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"})}},Jm=class{constructor(t,r){_m()&&gS()?this.storage=new Um:_m()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new oo),this.client=new xu(t),this.beaconClient=new Ym(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:a,payload:o}of n)this.beaconClient.sendEvent(a,o)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Xm=class{constructor(t,r){this.storage=r||new oo,this.client=new xu(t)}getClientDependingOnEventType(t){return this.client}},Fu=class{constructor(){this.storage=new oo,this.client=new Km}getClientDependingOnEventType(t){return this.client}},ZI="xx",ek=e=>e?.startsWith(ZI)||!1,tk=`
|
|
27
|
+
${S}`:S;break;case"event":n.event=S;break;case"id":e(n.id=S);break;case"retry":jw(S,n,t);break}}}}function jw(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function Dw(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function qy(){return{data:"",event:"",id:"",retry:void 0}}var tm="text/event-stream",Vw=1e3,Ny="last-event-id";function My(){return typeof window<"u"}function Gc(e,{signal:t,headers:r,onopen:n,onmessage:a,onclose:o,onerror:d,openWhenHidden:p,fetch:m,...f}){return new Promise((S,A)=>{let x={...r};x.accept||(x.accept=tm);let C;function F(){C?.abort(),document.hidden||I()}!p&&My()&&document.addEventListener("visibilitychange",F);let v=Vw,R;function b(){My()&&document.removeEventListener("visibilitychange",F),clearTimeout(R),C?.abort()}t?.addEventListener("abort",()=>{b(),S()});let E=m??y,w=n??Nw;function I(){return _I2.apply(this,arguments)}function _I2(){_I2=_asyncToGenerator(function*(){C=i.AbortController?new i.AbortController:null;try{let N=yield E(e,{...f,headers:x,signal:C?.signal});yield w(N),yield jy(N.body,Dy(Vy(q=>{q?x[Ny]=q:delete x[Ny]},q=>{v=q},a))),o?.(),b(),S()}catch(N){if(!C?.signal?.aborted)try{let q=d?.(N)??v;clearTimeout(R),R=setTimeout(I,q)}catch(q){b(),A(q)}}});return _I2.apply(this,arguments)}I()})}function Nw(e){let t=e.headers.get("content-type");if(!t?.startsWith(tm))throw new Error(`Expected content-type to be ${tm}, Actual: ${t}`)}l();s();u();c();var an=class{constructor(t){Fe(this,"_basePath");Fe(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 Mw=(e,t,r)=>new an(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Qy=3,Qw=5e3,Lw="text/event-stream",am=1,rm=class extends Error{},As=class extends Error{constructor(r){super(r.message);this.payload=r}},nm=class{constructor(){Fe(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)}},zc=class{constructor(t){Fe(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:a,streamId:o,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:S}=r,A=new nm;if(!o){this.logger.error("No stream ID found");return}let x=0,C,F=()=>{C&&!A.isActive(C)&&(R?.abort(),S(),b())},v=()=>{A.remove(C),C=Oy(F,C,Qw),A.add(C)},R=new i.AbortController,b=()=>Gc(Mw(n,a,o),{method:"GET",fetch:y,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:R?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===Lw)return;throw E.status>=400&&E.status<500&&E.status!==429?new As({message:"Error opening stream",code:E.status}):new rm})()},onmessage:E=>{if(R?.signal.aborted)return;let w=JSON.parse(E.data);if(w.finishReason==="ERROR"){A.remove(C),R?.abort(),m({message:w.errorMessage,code:w.statusCode});return}p(w),x=0,w.finishReason==="COMPLETED"?(A.remove(C),f()):v()},onerror:E=>{if(!R?.signal.aborted){if(A.remove(C),E instanceof As)throw R?.abort(),m(E),E;if(++x>Qy){this.logger.info("Maximum retry exceeded.");let w={message:"Failed to complete stream.",code:am};throw R?.abort(),m(w),new As(w)}this.logger.info(`Retrying...(${x}/${Qy})`),S()}}});return b(),R}};l();s();u();c();var Jy=$t(zy(),1);l();s();u();c();var z=new Error("Failed to load reducers."),Ya=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},aa=class extends Error{constructor(r,n){super();Fe(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 Wy(e){let t=[];for(let r in e){let n=encodeURIComponent(r),a=encodeURIComponent(e[r]);t.push(`${n}=${a}`)}return t.join("&")}function Yy(e){return typeof e!="object"||!e?!1:Object.values(e).every(pP)}function pP(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Ky(e){return e===429}var vt=class e{static call(t){return _asyncToGenerator(function*(){let r=mP(t),{logger:n}=t,a=yield e.preprocessRequest(r,t);n.info(a,"Platform request");let{url:o,...d}=a,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield y(o,d);if(Ky(m.status))throw m;return m});return function p(){return _ref.apply(this,arguments)}}();try{let m=yield(0,Jy.backOff)(p,{retry:f=>{let S=f&&Ky(f.status);return S&&n.info("Platform retrying request"),S}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new Ya;case 404:throw new aa(o,m.status);default:return n.info({response:m,requestInfo:a},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new aa(o):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:a,logger:o,requestMetadata:d}=r,{signal:p,...m}=t,f=Cs(m);try{let S=yield a(t,n,d);return{...t,...S}}catch(S){o.error(S,"Platform request preprocessing failed. Returning default request options.")}return f})()}};function Ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,a=r==="platform"?"":`.${r}`;return`https://${e}${a}.org${n}.coveo.com`}function Ne(e,t="prod"){return`${Ke(e,t)}/rest/search/v2`}function Yc(e,t="prod"){return`${Ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function mP(e){let{url:t,method:r,requestParams:n,contentType:a,accessToken:o,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=fP(n,a);return{url:t,method:r,headers:{"Content-Type":a,Authorization:`Bearer ${o}`,...e.headers},...(p&&{body:m}),signal:d}}function fP(e,t){return t==="application/x-www-form-urlencoded"?Yy(e)?Wy(e):"":JSON.stringify(e)}l();s();u();c();var Kc=e=>e;l();s();u();c();l();s();u();c();function Ka(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ct(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Ka(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Ka(),extendedResults:{},searchAction:void 0}}l();s();u();c();function on(e){let{url:t,accessToken:r,organizationId:n,authentication:a,...o}=e;return o}var sn=e=>{let{response:t}=e;return t.body?gP(e):yP(t)},gP=e=>SP(e)?CP(e):hP(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},yP=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function hP(e){return e.body.statusCode!==void 0}function SP(e){return e.body.exception!==void 0}var CP=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});l();s();u();c();var cn=class{constructor(){Fe(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new i.AbortController;let a=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(a?.signal??null)}finally{_this.currentAbortController===a&&(_this.currentAbortController=null)}})()}};l();s();u();c();l();s();u();c();function Xy(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}l();s();u();c();var Vr=(e,t,r,n)=>{let a=new an(`${e.url}${n}`);return a.addParam("organizationId",e.organizationId),e.authentication&&a.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:a.href,origin:"searchApiFetch"}};var Zy=(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},eh=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield vt.call({...Vr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:on(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Xy(r),a=yield r.arrayBuffer(),d=new TextDecoder(n).decode(a);return AP(d)?{success:d}:{error:sn({response:r,body:d})}});return function eh(_x4,_x5){return _ref2.apply(this,arguments)}}();function AP(e){return typeof e=="string"}l();s();u();c();function xP(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function FP(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Rs(e,t){if(t&&e.name==="AbortError")return{error:FP(e)};if(e instanceof aa)return{error:xP(e)};throw e}var Jc=class{constructor(t){this.options=t;Fe(this,"apiCallsQueues",{unknown:new cn,mainSearch:new cn,facetValues:new cn,foldingCollection:new cn,instantResults:new cn})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"POST","application/json","/plan"),requestParams:on(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Rs(r);let n=yield r.json();return bP(n)?{success:n}:{error:sn({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:on(t),..._this3.options});if(r instanceof Error)return Rs(r);let n=yield r.json(),a={response:r,body:n};return RP(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(a)).body}:{error:sn(a)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",a=yield _this4.apiCallsQueues[n].enqueue(p=>vt.call({...Vr(t,"POST","application/json",""),requestParams:on(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(a instanceof Error)return Rs(a,r?.disableAbortWarning);let o=yield a.json(),d={response:a,body:o};return th(o)?(d.body=rh(o),{success:(yield _this4.options.postprocessSearchResponseMiddleware(d)).body}):{error:sn(d)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"POST","application/json","/facet"),requestParams:on(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),a={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(a)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"POST","application/json",""),requestParams:on(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(th(n)){let a={response:r,body:n};return a.body=rh(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(a)).body}}return{error:sn({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return eh(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield vt.call({...Vr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return vP(n)?{success:n}:{error:sn({response:r,body:n})}})()}},Xc=e=>e.success!==void 0,Be=e=>e.error!==void 0;function th(e){return e.results!==void 0}function rh(e){let t=Ka();return ne(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function RP(e){return e.completions!==void 0}function bP(e){return e.preprocessingOutput!==void 0}function vP(e){return e.fields!==void 0}l();s();u();c();var nh=e=>e,ah=e=>e,oh=e=>e;l();s();u();c();l();s();u();c();var G=new D({required:!0,emptyAllowed:!1}),Ie=new D({required:!1,emptyAllowed:!1}),be=new D({required:!0,emptyAllowed:!0}),ih=new D({required:!1,emptyAllowed:!0}),Zc=new te({each:G,required:!0}),sh=new D({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),ch=new D({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),B_=new D({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Nr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),wt=(e,t)=>{if("required"in t)return{payload:new le({value:t}).validate({value:e}).value};let a=new _({options:{required:!0},values:t}).validate(e);if(a)throw new Ss(a);return{payload:e}},k=(e,t)=>{try{return wt(e,t)}catch(r){return{payload:e,error:Nr(r)}}},Me=(e,t,r,n)=>{let a=`Check the initialState of ${n}`;return uh(e,t,r,a,"Controller initialization error")},we=(e,t,r,n)=>{let a=`Check the options of ${n}`;return uh(e,t,r,a,"Controller initialization error")},uh=(e,t,r,n,a)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,a),o}};l();s();u();c();l();s();u();c();l();s();u();c();function Je(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 wP=typeof Symbol=="function"&&Symbol.observable||"@@observable",lh=wP,mm=()=>Math.random().toString(36).substring(7).split("").join("."),PP={INIT:`@@redux/INIT${mm()}`,REPLACE:`@@redux/REPLACE${mm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${mm()}`},eu=PP;function er(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 fm(e,t,r){if(typeof e!="function")throw new Error(Je(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Je(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Je(1));return r(fm)(e,t)}let n=e,a=t,o=new Map,d=o,p=0,m=!1;function f(){d===o&&(d=new Map,o.forEach((R,b)=>{d.set(b,R)}))}function S(){if(m)throw new Error(Je(3));return a}function A(R){if(typeof R!="function")throw new Error(Je(4));if(m)throw new Error(Je(5));let b=!0;f();let E=p++;return d.set(E,R),function(){if(b){if(m)throw new Error(Je(6));b=!1,f(),d.delete(E),o=null}}}function x(R){if(!er(R))throw new Error(Je(7));if(typeof R.type>"u")throw new Error(Je(8));if(typeof R.type!="string")throw new Error(Je(17));if(m)throw new Error(Je(9));try{m=!0,a=n(a,R)}finally{m=!1}return(o=d).forEach(E=>{E()}),R}function C(R){if(typeof R!="function")throw new Error(Je(10));n=R,x({type:eu.REPLACE})}function F(){let R=A;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(Je(11));function E(){let I=b;I.next&&I.next(S())}return E(),{unsubscribe:R(E)}},[lh](){return this}}}return x({type:eu.INIT}),{dispatch:x,subscribe:A,getState:S,replaceReducer:C,[lh]:F}}function EP(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:eu.INIT})>"u")throw new Error(Je(12));if(typeof r(void 0,{type:eu.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Je(13))})}function Ja(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),a,o;try{EP(r)}catch(d){o=d}return function(p={},m){if(o)throw o;let f=!1,S={};for(let A=0;A<n.length;A++){let x=n[A],C=r[x],F=p[x],v=C(F,m);if(typeof v>"u"){let R=m&&m.type;throw new Error(Je(14))}S[x]=v,f=f||v!==F}return f=f||n.length!==Object.keys(p).length,f?S:p}}function Xa(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function dh(...e){return t=>(r,n)=>{let a=t(r,n),o=()=>{throw new Error(Je(15))},d={getState:a.getState,dispatch:(m,...f)=>o(m,...f)},p=e.map(m=>m(d));return o=Xa(...p)(a.dispatch),{...a,dispatch:o}}}function tu(e){return er(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var bm=Symbol.for("immer-nothing"),bs=Symbol.for("immer-draftable"),lt=Symbol.for("immer-state");function Xe(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ia=Object.getPrototypeOf;function At(e){return!!e&&!!e[lt]}function dt(e){return e?yh(e)||Array.isArray(e)||!!e[bs]||!!e.constructor?.[bs]||Za(e)||ks(e):!1}var IP=Object.prototype.constructor.toString();function yh(e){if(!e||typeof e!="object")return!1;let t=ia(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)===IP}function vm(e){return At(e)||Xe(15,e),e[lt].base_}function vs(e,t){sa(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function sa(e){let t=e[lt];return t?t.type_:Array.isArray(e)?1:Za(e)?2:ks(e)?3:0}function ws(e,t){return sa(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gm(e,t){return sa(e)===2?e.get(t):e[t]}function hh(e,t,r){let n=sa(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function kP(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Za(e){return e instanceof Map}function ks(e){return e instanceof Set}function oa(e){return e.copy_||e.base_}function Sm(e,t){if(Za(e))return new Map(e);if(ks(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=yh(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[lt];let a=Reflect.ownKeys(n);for(let o=0;o<a.length;o++){let d=a[o],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(ia(e),n)}else{let n=ia(e);if(n!==null&&r)return{...e};let a=Object.create(n);return Object.assign(a,e)}}function ou(e,t=!1){return iu(e)||At(e)||!dt(e)||(sa(e)>1&&Object.defineProperties(e,{set:{value:ru},add:{value:ru},clear:{value:ru},delete:{value:ru}}),Object.freeze(e),t&&Object.values(e).forEach(r=>ou(r,!0))),e}function ru(){Xe(2)}function iu(e){return Object.isFrozen(e)}var Cm={};function ca(e){let t=Cm[e];return t||Xe(0,e),t}function TP(e,t){Cm[e]||(Cm[e]=t)}var Ps;function Sh(){return Ps}function OP(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ph(e,t){t&&(ca("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Am(e){xm(e),e.drafts_.forEach(qP),e.drafts_=null}function xm(e){e===Ps&&(Ps=e.parent_)}function mh(e){return Ps=OP(Ps,e)}function qP(e){let t=e[lt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fh(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[lt].modified_&&(Am(t),Xe(4)),dt(e)&&(e=nu(t,e),t.parent_||au(t,e)),t.patches_&&ca("Patches").generateReplacementPatches_(r[lt].base_,e,t.patches_,t.inversePatches_)):e=nu(t,r,[]),Am(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==bm?e:void 0}function nu(e,t,r){if(iu(t))return t;let n=t[lt];if(!n)return vs(t,(a,o)=>gh(e,n,t,a,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return au(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let a=n.copy_,o=a,d=!1;n.type_===3&&(o=new Set(a),a.clear(),d=!0),vs(o,(p,m)=>gh(e,n,a,p,m,r,d)),au(e,a,!1),r&&e.patches_&&ca("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function gh(e,t,r,n,a,o,d){if(At(a)){let p=o&&t&&t.type_!==3&&!ws(t.assigned_,n)?o.concat(n):void 0,m=nu(e,a,p);if(hh(r,n,m),At(m))e.canAutoFreeze_=!1;else return}else d&&r.add(a);if(dt(a)&&!iu(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;nu(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Za(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&au(e,a)}}function au(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ou(t,r)}function jP(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Sh(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},a=n,o=wm;r&&(a=[n],o=Es);let{revoke:d,proxy:p}=Proxy.revocable(a,o);return n.draft_=p,n.revoke_=d,p}var wm={get(e,t){if(t===lt)return e;let r=oa(e);if(!ws(r,t))return DP(e,r,t);let n=r[t];return e.finalized_||!dt(n)?n:n===ym(e.base_,t)?(hm(e),e.copy_[t]=Rm(n,e)):n},has(e,t){return t in oa(e)},ownKeys(e){return Reflect.ownKeys(oa(e))},set(e,t,r){let n=Ch(oa(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let a=ym(oa(e),t),o=a?.[lt];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(kP(r,a)&&(r!==void 0||ws(e.base_,t)))return!0;hm(e),Fm(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 ym(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,hm(e),Fm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=oa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Xe(11)},getPrototypeOf(e){return ia(e.base_)},setPrototypeOf(){Xe(12)}},Es={};vs(wm,(e,t)=>{Es[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Es.deleteProperty=function(e,t){return Es.set.call(this,e,t,void 0)};Es.set=function(e,t,r){return wm.set.call(this,e[0],t,r,e[0])};function ym(e,t){let r=e[lt];return(r?oa(r):e)[t]}function DP(e,t,r){let n=Ch(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Ch(e,t){if(!(t in e))return;let r=ia(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=ia(r)}}function Fm(e){e.modified_||(e.modified_=!0,e.parent_&&Fm(e.parent_))}function hm(e){e.copy_||(e.copy_=Sm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VP=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let d=this;return function(m=o,...f){return d.produce(m,S=>r.call(this,S,...f))}}typeof r!="function"&&Xe(6),n!==void 0&&typeof n!="function"&&Xe(7);let a;if(dt(t)){let o=mh(this),d=Rm(t,void 0),p=!0;try{a=r(d),p=!1}finally{p?Am(o):xm(o)}return ph(o,n),fh(a,o)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===bm&&(a=void 0),this.autoFreeze_&&ou(a,!0),n){let o=[],d=[];ca("Patches").generateReplacementPatches_(t,a,o,d),n(o,d)}return a}else Xe(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(d,...p)=>this.produceWithPatches(d,m=>t(m,...p));let n,a;return[this.produce(t,r,(d,p)=>{n=d,a=p}),n,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){dt(e)||Xe(8),At(e)&&(e=Ah(e));let t=mh(this),r=Rm(e,void 0);return r[lt].isManual_=!0,xm(t),r}finishDraft(e,t){let r=e&&e[lt];(!r||!r.isManual_)&&Xe(9);let{scope_:n}=r;return ph(n,t),fh(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 a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));let n=ca("Patches").applyPatches_;return At(e)?n(e,t):this.produce(e,a=>n(a,t))}};function Rm(e,t){let r=Za(e)?ca("MapSet").proxyMap_(e,t):ks(e)?ca("MapSet").proxySet_(e,t):jP(e,t);return(t?t.scope_:Sh()).drafts_.push(r),r}function Ah(e){return At(e)||Xe(10,e),xh(e)}function xh(e){if(!dt(e)||iu(e))return e;let t=e[lt],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Sm(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Sm(e,!0);return vs(r,(n,a)=>{hh(r,n,xh(a))}),t&&(t.finalized_=!1),r}function Fh(){let t="replace",r="add",n="remove";function a(x,C,F,v){switch(x.type_){case 0:case 2:return d(x,C,F,v);case 1:return o(x,C,F,v);case 3:return p(x,C,F,v)}}function o(x,C,F,v){let{base_:R,assigned_:b}=x,E=x.copy_;E.length<R.length&&([R,E]=[E,R],[F,v]=[v,F]);for(let w=0;w<R.length;w++)if(b[w]&&E[w]!==R[w]){let I=C.concat([w]);F.push({op:t,path:I,value:A(E[w])}),v.push({op:t,path:I,value:A(R[w])})}for(let w=R.length;w<E.length;w++){let I=C.concat([w]);F.push({op:r,path:I,value:A(E[w])})}for(let w=E.length-1;R.length<=w;--w){let I=C.concat([w]);v.push({op:n,path:I})}}function d(x,C,F,v){let{base_:R,copy_:b}=x;vs(x.assigned_,(E,w)=>{let I=gm(R,E),N=gm(b,E),q=w?ws(R,E)?t:r:n;if(I===N&&q===t)return;let T=C.concat(E);F.push(q===n?{op:q,path:T}:{op:q,path:T,value:N}),v.push(q===r?{op:n,path:T}:q===n?{op:r,path:T,value:A(I)}:{op:t,path:T,value:A(I)})})}function p(x,C,F,v){let{base_:R,copy_:b}=x,E=0;R.forEach(w=>{if(!b.has(w)){let I=C.concat([E]);F.push({op:n,path:I,value:w}),v.unshift({op:r,path:I,value:w})}E++}),E=0,b.forEach(w=>{if(!R.has(w)){let I=C.concat([E]);F.push({op:r,path:I,value:w}),v.unshift({op:n,path:I,value:w})}E++})}function m(x,C,F,v){F.push({op:t,path:[],value:C===bm?void 0:C}),v.push({op:t,path:[],value:x})}function f(x,C){return C.forEach(F=>{let{path:v,op:R}=F,b=x;for(let N=0;N<v.length-1;N++){let q=sa(b),T=v[N];typeof T!="string"&&typeof T!="number"&&(T=""+T),(q===0||q===1)&&(T==="__proto__"||T==="constructor")&&Xe(19),typeof b=="function"&&T==="prototype"&&Xe(19),b=gm(b,T),typeof b!="object"&&Xe(18,v.join("/"))}let E=sa(b),w=S(F.value),I=v[v.length-1];switch(R){case t:switch(E){case 2:return b.set(I,w);case 3:Xe(16);default:return b[I]=w}case r:switch(E){case 1:return I==="-"?b.push(w):b.splice(I,0,w);case 2:return b.set(I,w);case 3:return b.add(w);default:return b[I]=w}case n:switch(E){case 1:return b.splice(I,1);case 2:return b.delete(I);case 3:return b.delete(F.value);default:return delete b[I]}default:Xe(17,R)}}),x}function S(x){if(!dt(x))return x;if(Array.isArray(x))return x.map(S);if(Za(x))return new Map(Array.from(x.entries()).map(([F,v])=>[F,S(v)]));if(ks(x))return new Set(Array.from(x).map(S));let C=Object.create(ia(x));for(let F in x)C[F]=S(x[F]);return ws(x,bs)&&(C[bs]=x[bs]),C}function A(x){return At(x)?S(x):x}TP("Patches",{applyPatches_:f,generatePatches_:a,generateReplacementPatches_:m})}var Is=new VP,Mr=Is.produce,su=Is.produceWithPatches.bind(Is);var Pm=Is.applyPatches.bind(Is);l();s();u();c();function NP(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function MP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function QP(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 Rh=e=>Array.isArray(e)?e:[e];function LP(e){let t=Array.isArray(e[0])?e[0]:e;return QP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function _P(e,t){let r=[],{length:n}=e;for(let a=0;a<n;a++)r.push(e[a].apply(null,t));return r}var iU=Symbol();var sU=Object.getPrototypeOf({});var UP=class{constructor(e){this.value=e}deref(){return this.value}},BP=typeof WeakRef<"u"?WeakRef:UP,$P=0,bh=1;function cu(){return{s:$P,v:void 0,o:null,p:null}}function eo(e,t={}){let r=cu(),{resultEqualityCheck:n}=t,a,o=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 v=F.get(C);v===void 0?(p=cu(),F.set(C,p)):p=v}else{let F=p.p;F===null&&(p.p=F=new Map);let v=F.get(C);v===void 0?(p=cu(),F.set(C,p)):p=v}}let f=p,S;if(p.s===bh)S=p.v;else if(S=e.apply(null,arguments),o++,n){let A=a?.deref?.()??a;A!=null&&n(A,S)&&(S=A,o!==0&&o--),a=typeof S=="object"&&S!==null||typeof S=="function"?new BP(S):S}return f.s=bh,f.v=S,S}return d.clearCache=()=>{r=cu(),d.resetResultsCount()},d.resultsCount=()=>o,d.resetResultsCount=()=>{o=0},d}function vh(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...a)=>{let o=0,d=0,p,m={},f=a.pop();typeof f=="object"&&(m=f,f=a.pop()),NP(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let S={...r,...m},{memoize:A,memoizeOptions:x=[],argsMemoize:C=eo,argsMemoizeOptions:F=[],devModeChecks:v={}}=S,R=Rh(x),b=Rh(F),E=LP(a),w=A(function(){return o++,f.apply(null,arguments)},...R),I=!0,N=C(function(){d++;let T=_P(E,arguments);return p=w.apply(null,T),p},...b);return Object.assign(N,{resultFunc:f,memoizedResultFunc:w,dependencies:E,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:A,argsMemoize:C})};return Object.assign(n,{withTypes:()=>n}),n}var oe=vh(eo),HP=Object.assign((e,t=oe)=>{MP(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(o=>e[o]);return t(n,(...o)=>o.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>HP});l();s();u();c();function wh(e){return({dispatch:r,getState:n})=>a=>o=>typeof o=="function"?o(r,n,e):a(o)}var Ph=wh(),Eh=wh;var GP=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Xa:Xa.apply(null,arguments)},vU=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},zP=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let a=t(...n);if(!a)throw new Error(Ht(0));return{type:e,payload:a.payload,...("meta"in a&&{meta:a.meta}),...("error"in a&&{error:a.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>tu(n)&&n.type===e,r}var qh=class Ts extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ts.prototype)}static get[Symbol.species](){return Ts}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ts(...t[0].concat(this)):new Ts(...t.concat(this))}};function Ih(e){return dt(e)?Mr(e,()=>{}):e}function kh(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function WP(e){return typeof e=="boolean"}var YP=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:o=!0}=t??{},d=new qh;return r&&(WP(r)?d.push(Ph):d.push(Eh(r.extraArgument))),d},Os="RTK_autoBatch",ro=()=>e=>({payload:e,meta:{[Os]:!0}}),Th=e=>t=>{setTimeout(t,e)},KP=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),a=!0,o=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Th(10):e.type==="callback"?e.queueNotification:Th(e.timeout),f=()=>{d=!1,o&&(o=!1,p.forEach(S=>S()))};return Object.assign({},n,{subscribe(S){let A=()=>a&&S(),x=n.subscribe(A);return p.add(S),()=>{x(),p.delete(S)}},dispatch(S){try{return a=!S?.meta?.[Os],o=!a,o&&(d||(d=!0,m(f))),n.dispatch(S)}finally{a=!0}}})},JP=e=>function(r){let{autoBatch:n=!0}=r??{},a=new qh(e);return n&&a.push(KP(typeof n=="object"?n:void 0)),a};function jh(e){let t=YP(),{reducer:r=void 0,middleware:n,devTools:a=!0,preloadedState:o=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(er(r))p=Ja(r);else throw new Error(Ht(1));let m;typeof n=="function"?m=n(t):m=t();let f=Xa;a&&(f=GP({trace:!1,...(typeof a=="object"&&a)}));let S=dh(...m),A=JP(S),x=typeof d=="function"?d(A):A(),C=f(...x);return fm(p,o,C)}function Dh(e){let t={},r=[],n,a={addCase(o,d){let p=typeof o=="string"?o:o.type;if(!p)throw new Error(Ht(28));if(p in t)throw new Error(Ht(29));return t[p]=d,a},addMatcher(o,d){return r.push({matcher:o,reducer:d}),a},addDefaultCase(o){return n=o,a}};return e(a),[t,r,n]}function XP(e){return typeof e=="function"}function re(e,t){let[r,n,a]=Dh(t),o;if(XP(e))o=()=>Ih(e());else{let p=Ih(e);o=()=>p}function d(p=o(),m){let f=[r[m.type],...n.filter(({matcher:S})=>S(m)).map(({reducer:S})=>S)];return f.filter(S=>!!S).length===0&&(f=[a]),f.reduce((S,A)=>{if(A)if(At(S)){let C=A(S,m);return C===void 0?S:C}else{if(dt(S))return Mr(S,x=>A(x,m));{let x=A(S,m);if(x===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return S},p)}return d.getInitialState=o,d}var Vh=(e,t)=>zP(e)?e.match(t):e(t);function tr(...e){return t=>e.some(r=>Vh(r,t))}function to(...e){return t=>e.every(r=>Vh(r,t))}function lu(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 qs(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function du(...e){return e.length===0?t=>lu(t,["pending"]):qs(e)?tr(...e.map(t=>t.pending)):du()(e[0])}function ua(...e){return e.length===0?t=>lu(t,["rejected"]):qs(e)?tr(...e.map(t=>t.rejected)):ua()(e[0])}function js(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?to(ua(...e),t):qs(e)?to(ua(...e),t):js()(e[0])}function Qr(...e){return e.length===0?t=>lu(t,["fulfilled"]):qs(e)?tr(...e.map(t=>t.fulfilled)):Qr()(e[0])}function pu(...e){return e.length===0?t=>lu(t,["pending","fulfilled","rejected"]):qs(e)?tr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):pu()(e[0])}var ZP="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",mu=(e=21)=>{let t="",r=e;for(;r--;)t+=ZP[Math.random()*64|0];return t},eE=["name","message","stack","code"],Em=class{constructor(e,t){Fe(this,"_type");this.payload=e,this.meta=t}},Oh=class{constructor(e,t){Fe(this,"_type");this.payload=e,this.meta=t}},tE=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of eE)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},se=(()=>{function e(t,r,n){let a=P(t+"/fulfilled",(m,f,S,A)=>({payload:m,meta:{...(A||{}),arg:S,requestId:f,requestStatus:"fulfilled"}})),o=P(t+"/pending",(m,f,S)=>({payload:void 0,meta:{...(S||{}),arg:f,requestId:m,requestStatus:"pending"}})),d=P(t+"/rejected",(m,f,S,A,x)=>({payload:A,error:(n&&n.serializeError||tE)(m||"Rejected"),meta:{...(x||{}),arg:S,requestId:f,rejectedWithValue:!!A,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,S,A)=>{let x=n?.idGenerator?n.idGenerator(m):mu(),C=new i.AbortController,F,v;function R(E){v=E,C.abort()}let b=_asyncToGenerator(function*(){let E;try{let I=n?.condition?.(m,{getState:S,extra:A});if(nE(I)&&(I=yield I),I===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let N=new Promise((q,T)=>{F=()=>{T({name:"AbortError",message:v||"Aborted"})},C.signal.addEventListener("abort",F)});f(o(x,m,n?.getPendingMeta?.({requestId:x,arg:m},{getState:S,extra:A}))),E=yield Promise.race([N,Promise.resolve(r(m,{dispatch:f,getState:S,extra:A,requestId:x,signal:C.signal,abort:R,rejectWithValue:(q,T)=>new Em(q,T),fulfillWithValue:(q,T)=>new Oh(q,T)})).then(q=>{if(q instanceof Em)throw q;return q instanceof Oh?a(q.payload,x,m,q.meta):a(q,x,m)})])}catch(I){E=I instanceof Em?d(null,x,m,I.payload,I.meta):d(I,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(b,{abort:R,requestId:x,arg:m,unwrap(){return b.then(rE)}})}}return Object.assign(p,{pending:o,rejected:d,fulfilled:a,settled:tr(d,a),typePrefix:t})}return e.withTypes=()=>e,e})();function rE(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function nE(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Nh=Symbol.for("rtk-slice-createasyncthunk"),kU={[Nh]:se};function aE(e,t){return`${e}/${t}`}function oE({creators:e}={}){let t=e?.asyncThunk?.[Nh];return function(n){let{name:a,reducerPath:o=a}=n;if(!a)throw new Error(Ht(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(sE()):n.reducers)||{},p=Object.keys(d),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(E,w){let I=typeof E=="string"?E:E.type;if(!I)throw new Error(Ht(12));if(I in m.sliceCaseReducersByType)throw new Error(Ht(13));return m.sliceCaseReducersByType[I]=w,f},addMatcher(E,w){return m.sliceMatchers.push({matcher:E,reducer:w}),f},exposeAction(E,w){return m.actionCreators[E]=w,f},exposeCaseReducer(E,w){return m.sliceCaseReducersByName[E]=w,f}};p.forEach(E=>{let w=d[E],I={reducerName:E,type:aE(a,E),createNotation:typeof n.reducers=="function"};uE(w)?dE(I,w,f,t):cE(I,w,f)});function S(){let[E={},w=[],I=void 0]=typeof n.extraReducers=="function"?Dh(n.extraReducers):[n.extraReducers],N={...E,...m.sliceCaseReducersByType};return re(n.initialState,q=>{for(let T in N)q.addCase(T,N[T]);for(let T of m.sliceMatchers)q.addMatcher(T.matcher,T.reducer);for(let T of w)q.addMatcher(T.matcher,T.reducer);I&&q.addDefaultCase(I)})}let A=E=>E,x=new Map,C;function F(E,w){return C||(C=S()),C(E,w)}function v(){return C||(C=S()),C.getInitialState()}function R(E,w=!1){function I(q){let T=q[E];return typeof T>"u"&&w&&(T=v()),T}function N(q=A){let T=kh(x,w,()=>new WeakMap);return kh(T,q,()=>{let O={};for(let[j,Q]of Object.entries(n.selectors??{}))O[j]=iE(Q,q,v,w);return O})}return{reducerPath:E,getSelectors:N,get selectors(){return N(I)},selectSlice:I}}let b={name:a,reducer:F,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:v,...R(o),injectInto(E,{reducerPath:w,...I}={}){let N=w??o;return E.inject({reducerPath:N,reducer:F},I),{...b,...R(N,!0)}}};return b}}function iE(e,t,r,n){function a(o,...d){let p=t(o);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return a.unwrapped=e,a}var la=oE();function sE(){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 cE({type:e,reducerName:t,createNotation:r},n,a){let o,d;if("reducer"in n){if(r&&!lE(n))throw new Error(Ht(17));o=n.reducer,d=n.prepare}else o=n;a.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,d?P(e,d):P(e))}function uE(e){return e._reducerDefinitionType==="asyncThunk"}function lE(e){return e._reducerDefinitionType==="reducerWithPrepare"}function dE({type:e,reducerName:t},r,n,a){if(!a)throw new Error(Ht(18));let{payloadCreator:o,fulfilled:d,pending:p,rejected:m,settled:f,options:S}=r,A=a(e,o,S);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||uu,pending:p||uu,rejected:m||uu,settled:f||uu})}function uu(){}var Mh="listener",Qh="completed",Lh="cancelled",TU=`task-${Lh}`,OU=`task-${Qh}`,qU=`${Mh}-${Lh}`,jU=`${Mh}-${Qh}`;var{assign:_h}=Object;var Im="listenerMiddleware";var pE=_h(P(`${Im}/add`),{withTypes:()=>pE}),DU=P(`${Im}/removeAll`),mE=_h(P(`${Im}/remove`),{withTypes:()=>mE});var VU=Symbol.for("rtk-state-proxy-original");function Ht(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 Uh=/^(?:[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 fE(e){return typeof e=="string"&&Uh.test(e)}var km=fE;l();s();u();c();var Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).slice(1));function Bh(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()}l();s();u();c();var Tm,gE=new Uint8Array(16);function Om(){if(!Tm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Tm=crypto.getRandomValues.bind(crypto)}return Tm(gE)}l();s();u();c();l();s();u();c();var yE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qm={randomUUID:yE};function hE(e,t,r){if(qm.randomUUID&&!t&&!e)return qm.randomUUID();e=e||{};let n=e.random??e.rng?.()??Om();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 a=0;a<16;++a)t[r+a]=n[a];return t}return Bh(n)}var jm=hE;l();s();u();c();function $h(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function SE({config:e,environment:t,event:r,listenerManager:n}){let{url:a,token:o,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(a,o,r))}var Hh="visitorId";function CE(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(Hh),a=n&&km(n)?n:t.generateUUID();return r.setItem(Hh,a),a}}}var Kh="1.2.7",Dm=128,Jh=192,Gh=224,zh=240,AE=248;function xE(e){return(e&AE)===zh?4:(e&zh)===Gh?3:(e&Gh)===Jh?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&Dm)!=Dm)break;if(r-=3,(n&Jh)!=Dm){t-r>=xE(n)*3&&(r=t);break}}return e.substring(0,r)}function RE(e){let{trackingId:t}=e;return{trackingId:t}}function bE(e){return(e.source||[]).concat([`relay@${Kh}`])}function Xh(e,t,r,n){let{getReferrer:a,getLocation:o,getUserAgent:d}=r,p=RE(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:bE(t),clientId:m,userAgent:d(),referrer:Wh(a()),location:Wh(o())})}function Wh(e){return e!==null?FE(e,1024):null}function vE(e,t,r,n,a){return{...t,meta:Xh(e,r,n,a)}}var wE="*";function PE(){let e=[];function t({type:m,callback:f}){return e.findIndex(S=>S.type===m&&S.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 a(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(S){console.error(S)}})}function o(m){if(m===wE)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}):o(m)}return{add:n,call:a,remove:p}}function Yh({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 EE(e){let t=Yh(e);return{get:()=>t,update:r=>{t=Yh({...t,...r})}}}var Vm=IE();function IE(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,a=document.cookie.split(";");for(let o of a){let d=o.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,a){let o=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+a).toUTCString()}`,p=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function kE(){return{getItem(e){return Vm.getItem(e)||localStorage.getItem(e)},removeItem(e){Vm.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Vm.setItem(e,t,31556952e3)}}}function TE(){let e=document.referrer;return e===""?null:e}function Nm(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if($h().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:()=>TE(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>jm(),storage:kE()}}function OE(){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 qE(){return{getItem(){return null},removeItem(){},setItem(){}}}function jE(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:qE()}}function DE(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=jE();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&VE()&&OE()?Nm():n}function VE(){try{return typeof window=="object"}catch{return!1}}function NE(e){return{get:()=>Object.freeze(DE(e))}}function Zh(e){let t=EE(e),r=PE(),n=NE(t),a=CE(n);return{emit:(o,d)=>{let p=t.get(),m=n.get(),f=vE(o,d,p,m,a);return SE({config:p,environment:m,event:f,listenerManager:r})},getMeta:o=>Xh(o,t.get(),n.get(),a),on:(o,d)=>r.add({type:o,callback:d}),off:(o,d)=>r.remove(o,d),updateConfig:o=>t.update(o),version:Kh}}l();s();u();c();function eS(){return typeof window<"u"&&typeof document<"u"}l();s();u();c();l();s();u();c();var un="3.31.2-pre.0c1931ccff",tS=["@coveo/atomic","@coveo/quantic"];var ln=oe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${un}`));var Ds=oe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ln(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:a,enabled:o},d,p)=>{let m=QE(p);return Zh({mode:o?"emit":"disabled",url:a??Yc(e,t),token:r,trackingId:n??null,source:d,environment:m})}),ME={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},QE=e=>{if(!e)return;let t=e();return{...(eS()?Nm():ME),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};l();s();u();c();l();s();u();c();function Lr(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 a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function V(e,t,r,n){function a(o){return o instanceof r?o:new r(function(d){d(o)})}return new(r||(r=Promise))(function(o,d){function p(S){try{f(n.next(S))}catch(A){d(A)}}function m(S){try{f(n.throw(S))}catch(A){d(A)}}function f(S){S.done?o(S.value):a(S.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var Se;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Se||(Se={}));function Lm(){return typeof window<"u"}function Zm(){return typeof navigator<"u"}function no(){return typeof document<"u"}function _m(){try{return typeof localStorage<"u"}catch{return!1}}function LE(){try{return typeof sessionStorage<"u"}catch{return!1}}function gS(){return Zm()&&navigator.cookieEnabled}var _E=[Se.click,Se.custom,Se.search,Se.view],UE=(e,t)=>_E.indexOf(e)!==-1?Object.assign({language:no()?document.documentElement.lang:"unknown",userAgent:Zm()?navigator.userAgent:"unknown"},t):t,Ns=class e{static set(t,r,n){var a,o,d,p;n&&(o=new Date,o.setTime(o.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?rS(t,r,o):(d=p.split("."),a=d[d.length-2]+"."+d[d.length-1],rS(t,r,o,a))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),a=0;a<n.length;a++){var o=n[a];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function rS(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function BE(){return _m()?localStorage:gS()?new Ms:LE()?sessionStorage:new oo}var Ms=class e{getItem(t){return Ns.get(`${e.prefix}${t}`)}removeItem(t){Ns.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ns.set(`${e.prefix}${t}`,r,n)}};Ms.prefix="coveo_";var Um=class{constructor(){this.cookieStorage=new Ms}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)}},oo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},fu="__coveo.analytics.history",$E=20,HE=1e3*60,GE=75,hu=class{constructor(t){this.store=t||BE()}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 V(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 V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(fu);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(fu);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(fu,JSON.stringify(t.slice(0,$E)))}catch{}}clear(){try{this.store.removeItem(fu)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,a)=>(a.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,GE)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>HE:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:a,value:o}=r;return{name:n,time:a,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:a}=t;return r&&typeof a=="string"&&r.toLowerCase()==="query"&&a.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var zE=(e,t)=>V(void 0,void 0,void 0,function*(){return e===Se.view?(yield WE(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),WE=e=>V(void 0,void 0,void 0,function*(){let t=new hu,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),gu,YE=new Uint8Array(16);function KE(){if(!gu&&(gu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gu(YE)}var JE=/^(?:[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 Su(e){return typeof e=="string"&&JE.test(e)}var et=[];for(let e=0;e<256;++e)et.push((e+256).toString(16).slice(1));function yS(e,t=0){return(et[e[t+0]]+et[e[t+1]]+et[e[t+2]]+et[e[t+3]]+"-"+et[e[t+4]]+et[e[t+5]]+"-"+et[e[t+6]]+et[e[t+7]]+"-"+et[e[t+8]]+et[e[t+9]]+"-"+et[e[t+10]]+et[e[t+11]]+et[e[t+12]]+et[e[t+13]]+et[e[t+14]]+et[e[t+15]]).toLowerCase()}function XE(e){if(!Su(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 ZE(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var eI="6ba7b810-9dad-11d1-80b4-00c04fd430c8",tI="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function rI(e,t,r){function n(a,o,d,p){var m;if(typeof a=="string"&&(a=ZE(a)),typeof o=="string"&&(o=XE(o)),((m=o)===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+a.length);if(f.set(o),f.set(a,o.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let S=0;S<16;++S)d[p+S]=f[S];return d}return yS(f)}try{n.name=e}catch{}return n.DNS=eI,n.URL=tI,n}var nI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nS={randomUUID:nI};function da(e,t,r){if(nS.randomUUID&&!t&&!e)return nS.randomUUID();e=e||{};let n=e.random||(e.rng||KE)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let a=0;a<16;++a)t[r+a]=n[a];return t}return yS(n)}function aI(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 Mm(e,t){return e<<t|e>>>32-t}function oI(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,a=Math.ceil(n/16),o=new Array(a);for(let d=0;d<a;++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];o[d]=p}o[a-1][14]=(e.length-1)*8/Math.pow(2,32),o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<a;++d){let p=new Uint32Array(80);for(let C=0;C<16;++C)p[C]=o[d][C];for(let C=16;C<80;++C)p[C]=Mm(p[C-3]^p[C-8]^p[C-14]^p[C-16],1);let m=r[0],f=r[1],S=r[2],A=r[3],x=r[4];for(let C=0;C<80;++C){let F=Math.floor(C/20),v=Mm(m,5)+aI(F,f,S,A)+x+t[F]+p[C]>>>0;x=A,A=S,S=Mm(f,30)>>>0,f=m,m=v}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+S>>>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 iI=rI("v5",80,oI),aS=iI,hS="2.30.45",oS=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Vs={pageview:"pageview",event:"event"},Cu=class{constructor({client:t,uuidGenerator:r=da}){this.client=t,this.uuidGenerator=r}},Bm=class extends Cu{constructor({client:t,uuidGenerator:r=da}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=oS(window.location),this.lastReferrer=no()?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:no()?document.title:"",encoding:no()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},a={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},o),n),a),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:a,location:o}=this.getNextValues(t,r);this.lastReferrer=a,this.pageViewId=n,this.currentLocation=o,t===Vs.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Vs.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Vs.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Vs.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=a=>a.replace(/^\/?(.*)$/,"/$1");return`${(a=>a.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return oS(window.location)}},dn=class e{constructor(t,r){if(!Su(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(a=>new RegExp(a.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,a]=r;if(n.length!==32||isNaN(parseInt(a)))return null;let o=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Su(o)?new e(o,Number.parseInt(a)*1e3):null}};dn.cvo_cid="cvo_cid";dn.expirationTime=120;var $m=class extends Cu{constructor({client:t,uuidGenerator:r=da}){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 V(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(dn.cvo_cid,new dn(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};$m.Id="link";var Et=Object.keys;function yu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Qm=128,SS=192,iS=224,sS=240;function sI(e){return(e&248)===sS?4:(e&sS)===iS?3:(e&iS)===SS?2:1}function cI(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&SS)!=Qm){t-r>=sI(n)*3&&(r=t);break}}return e.substring(0,r)}var Hm={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"},uI=Et(Hm).map(e=>Hm[e]),lI=[...uI].join("|"),dI=new RegExp(`^(${lI}$)`),pI={svcAction:"svc_action",svcActionData:"svc_action_data"},mI=e=>Et(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Hm[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),fI=e=>dI.test(e),gI=[fI],cS={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},uS={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},tt={action:"pa",list:"pal",listSource:"pls"},Au={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},yI=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Gm={id:"quoteId",affiliation:"quoteAffiliation"},zm={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},hI={add:tt,bookmark_add:tt,bookmark_remove:tt,click:tt,checkout:tt,checkout_option:tt,detail:tt,impression:tt,remove:tt,refund:Object.assign(Object.assign({},tt),Au),purchase:Object.assign(Object.assign({},tt),Au),quickview:tt,quote:Object.assign(Object.assign({},tt),Gm),review:Object.assign(Object.assign({},tt),zm)},SI=Et(cS).map(e=>cS[e]),CI=Et(uS).map(e=>uS[e]),AI=Et(tt).map(e=>tt[e]),xI=Et(Au).map(e=>Au[e]),FI=Et(zm).map(e=>zm[e]),RI=Et(Gm).map(e=>Gm[e]),bI=[...SI,"custom"].join("|"),vI=[...CI,"custom"].join("|"),CS="(pr[0-9]+)",AS="(il[0-9]+pi[0-9]+)",wI=new RegExp(`^${CS}(${bI})$`),PI=new RegExp(`^(${AS}(${vI}))|(il[0-9]+nm)$`),EI=new RegExp(`^(${AI.join("|")})$`),II=new RegExp(`^(${xI.join("|")})$`),kI=new RegExp(`^${CS}custom$`),TI=new RegExp(`^${AS}custom$`),OI=new RegExp(`^(${[...yI,...FI,...RI].join("|")})$`),qI=e=>wI.test(e),jI=e=>PI.test(e),DI=e=>EI.test(e),VI=e=>II.test(e),NI=e=>OI.test(e),MI=[jI,qI,DI,VI,NI],QI=[kI,TI],LI={anonymizeIp:"aip"},_I={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},UI={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},BI=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],$I=Object.assign(Object.assign(Object.assign(Object.assign({},LI),_I),UI),BI.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Wm=Object.assign(Object.assign({},$I),pI),HI=e=>{let t=!!e.action&&hI[e.action]||{};return Et(e).reduce((r,n)=>{let a=t[n]||Wm[n]||n;return Object.assign(Object.assign({},r),{[a]:e[n]})},{})},GI=Et(Wm).map(e=>Wm[e]),zI=e=>GI.indexOf(e)!==-1,WI=e=>e==="custom",YI=e=>[...MI,...gI,zI,WI].some(t=>t(e)),KI=e=>Et(e).reduce((t,r)=>{let n=JI(r);return n?Object.assign(Object.assign({},t),XI(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),JI=e=>{let t;return[...QI].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},XI=(e,t)=>Et(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Ym=class{constructor(t){this.opts=t}sendEvent(t,r){return V(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:a}=this.opts,o=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${o}`,r,a),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 V(this,void 0,void 0,function*(){let a=t,o=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;a=p||t;try{o=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:o,url:a}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,a=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",a?`visitorId=${a}`:"","discardVisitInfo=true"].filter(o=>!!o).join("&")})}isEventTypeLegacy(t){return[Se.click,Se.custom,Se.search,Se.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let a=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(a=`access_token=${encodeURIComponent(n)}&${a}`),a}},Km=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},lS=g.fetch,xu=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:a,preprocessRequest:o}=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),o?yield o(p,"analyticsFetch"):{}),{url:f}=m,S=Lr(m,["url"]),A;try{A=yield lS(f,S)}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&&a.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 V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield lS(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Se.click,Se.custom,Se.search,Se.view].indexOf(t)!==-1}getVisitorIdParam(){return V(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"})}},Jm=class{constructor(t,r){_m()&&gS()?this.storage=new Um:_m()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new oo),this.client=new xu(t),this.beaconClient=new Ym(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:a,payload:o}of n)this.beaconClient.sendEvent(a,o)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Xm=class{constructor(t,r){this.storage=r||new oo,this.client=new xu(t)}getClientDependingOnEventType(t){return this.client}},Fu=class{constructor(){this.storage=new oo,this.client=new Km}getClientDependingOnEventType(t){return this.client}},ZI="xx",ek=e=>e?.startsWith(ZI)||!1,tk=`
|
|
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
|
|
@@ -53,4 +53,4 @@ For more information, refer to the documentation: https://docs.coveo.com/en/o3r9
|
|
|
53
53
|
* limitations under the License.
|
|
54
54
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
55
55
|
|
|
56
|
-
window.coveoQuanticVersion = '3.30.
|
|
56
|
+
window.coveoQuanticVersion = '3.30.5-pre.0c1931ccff';
|