@coveo/headless 3.27.2-pre.f8c6add22d → 3.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/cjs/case-assist/headless.cjs +1 -1
  2. package/dist/cjs/case-assist/node.cjs.stats.json +1 -1
  3. package/dist/cjs/commerce/headless.cjs +1 -1
  4. package/dist/cjs/commerce/node.cjs.stats.json +1 -1
  5. package/dist/cjs/headless.cjs +1 -1
  6. package/dist/cjs/insight/headless.cjs +1 -1
  7. package/dist/cjs/insight/node.cjs.stats.json +1 -1
  8. package/dist/cjs/node.cjs.stats.json +1 -1
  9. package/dist/cjs/recommendation/headless.cjs +1 -1
  10. package/dist/cjs/recommendation/node.cjs.stats.json +1 -1
  11. package/dist/cjs/ssr/headless.cjs +1 -1
  12. package/dist/cjs/ssr/node.cjs.stats.json +1 -1
  13. package/dist/cjs/ssr-commerce/headless.cjs +1 -1
  14. package/dist/cjs/ssr-commerce/node.cjs.stats.json +1 -1
  15. package/dist/esm/utils/version.js +1 -1
  16. package/dist/quantic/browser.cjs.stats.json +1 -1
  17. package/dist/quantic/case-assist/browser.cjs.stats.json +1 -1
  18. package/dist/quantic/case-assist/headless.js +1 -1
  19. package/dist/quantic/case-assist/headless.js.map +1 -1
  20. package/dist/quantic/commerce/browser.cjs.stats.json +1 -1
  21. package/dist/quantic/commerce/headless.js +1 -1
  22. package/dist/quantic/commerce/headless.js.map +1 -1
  23. package/dist/quantic/headless.js +1 -1
  24. package/dist/quantic/headless.js.map +1 -1
  25. package/dist/quantic/insight/browser.cjs.stats.json +1 -1
  26. package/dist/quantic/insight/headless.js +1 -1
  27. package/dist/quantic/insight/headless.js.map +1 -1
  28. package/dist/quantic/recommendation/browser.cjs.stats.json +1 -1
  29. package/dist/quantic/recommendation/headless.js +1 -1
  30. package/dist/quantic/recommendation/headless.js.map +1 -1
  31. package/package.json +2 -2
@@ -25,7 +25,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25
25
 
26
26
  ${t}
27
27
  `;return new vn(r)}var vn=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Se=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw IF(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}},Ie=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&K(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function eo(e){return e===void 0}function wF(e){return e===null}function K(e){return eo(e)||wF(e)}var Z=class{constructor(e={}){ve(this,"value");this.config=e,this.value=new Ie(e)}validate(e){let t=this.value.validate(e);return t||(PF(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 PF(e){return eo(e)||Yf(e)}function Yf(e){return typeof e=="number"&&!isNaN(e)}var oe=class{constructor(e={}){ve(this,"value");this.value=new Ie(e)}validate(e){let t=this.value.validate(e);return t||(EF(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function EF(e){return eo(e)||Kf(e)}function Kf(e){return typeof e=="boolean"}var TF=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,M=class{constructor(e={}){ve(this,"value");ve(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Ie(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,d=this.value.validate(e);if(d)return d;if(eo(e))return null;if(!to(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(TF.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 to(e){return Object.prototype.toString.call(e)==="[object String]"}var _=class{constructor(e={}){ve(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(eo(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Jf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&K(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=" "+i)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Jf(e){return e!==void 0&&typeof e=="object"}var te=class{constructor(e={}){ve(this,"value");this.config=e,this.value=new Ie(this.config)}validate(e){if(!K(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(K(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&K(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=" "+o)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Kf(e)||to(e)||Yf(e)||Jf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function ro(e){return Array.isArray(e)}var Vt=class{constructor(e){ve(this,"value");this.config=e,this.value=new Ie(e)}validate(e){let t=this.value.validate(e);return t!==null?t:eo(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 rs=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function ns(e){return Array.isArray(e)}function os(e){return e.trim()===""}function Xf(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function kF(e){return btoa(encodeURI(e))}function is(e,t){let{[e]:r,...n}=t;return n}function no(e){return kF(JSON.stringify(e))}var qF=new Set(["1",1,"yes",!0]);function Zf(){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=>qF.has(r))}function eg(e){let t={};for(let[r,n]of e)t[r]=n;return t}function tg(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Mi(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function OF(e){if(os(e.openingDelimiter)||os(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(K(e.content)||os(e.content))return e.content;if(e.highlights.length===0)return oo(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],d=i.offset,p=d+i.length;if(p>t)break;r+=oo(e.content.slice(n,d)),r+=e.openingDelimiter,r+=oo(e.content.slice(d,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=oo(e.content.slice(n))),r}function bd(e,t){return e=oo(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Fd(n,t.notMatchDelimiters):o?Fd(o,t.exactMatchDelimiters):i?Fd(i,t.correctionDelimiters):r)}function Fd(e,t){return t?t.open+e+t.close:e}function oo(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},r="(?:"+Object.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();async function ng(e,t){let r=e.getReader(),n;for(;!(n=await r.read()).done;)t(n.value)}function og(e){let t,r,n,o=!1;return function(d){t===void 0?(t=d,r=0,n=-1):t=VF(t,d);let p=t.length,m=0;for(;r<p;){o&&(t[r]===10&&(m=++r),o=!1);let f=-1;for(;r<p&&f===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:o=!0,f=r;break;case 10:f=r;break}if(f===-1)break;e(t.subarray(m,f),n),m=r,n=-1}m===p?t=void 0:m!==0&&(t=t.subarray(m),r-=m)}}function ig(e,t,r){let n=rg(),o=new TextDecoder;return function(d,p){if(d.length===0)r?.(n),n=rg();else if(p>0){let m=o.decode(d.subarray(0,p)),f=p+(d[p+1]===32?2:1),g=o.decode(d.subarray(f));switch(m){case"data":n.data=n.data?n.data+`
28
- `+g:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":DF(g,n,t);break}}}}function DF(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function VF(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function rg(){return{data:"",event:"",id:"",retry:void 0}}var wd="text/event-stream",NF=1e3,ag="last-event-id";function sg(){return typeof window<"u"}function as(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:d,openWhenHidden:p,fetch:m,...f}){return new Promise((g,A)=>{let x={...r};x.accept||(x.accept=wd);let C;function R(){C?.abort(),document.hidden||T()}!p&&sg()&&document.addEventListener("visibilitychange",R);let F=NF,v;function b(){sg()&&document.removeEventListener("visibilitychange",R),clearTimeout(v),C?.abort()}t?.addEventListener("abort",()=>{b(),g()});let P=m??y,I=n??MF;async function T(){C=a.AbortController?new a.AbortController:null;try{let Q=await P(e,{...f,headers:x,signal:C?.signal});await I(Q),await ng(Q.body,og(ig(D=>{D?x[ag]=D:delete x[ag]},D=>{F=D},o))),i?.(),b(),g()}catch(Q){if(!C?.signal?.aborted)try{let D=d?.(Q)??F;clearTimeout(v),v=setTimeout(T,D)}catch(D){b(),A(D)}}}T()})}function MF(e){let t=e.headers.get("content-type");if(!t?.startsWith(wd))throw new Error(`Expected content-type to be ${wd}, Actual: ${t}`)}l();s();u();c();var Nr=class{constructor(t){ve(this,"_basePath");ve(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 QF=(e,t,r)=>new Nr(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,cg=3,LF=5e3,_F="text/event-stream",Td=1,Pd=class extends Error{},Qi=class extends Error{constructor(r){super(r.message);this.payload=r}},Ed=class{constructor(){ve(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)}},ss=class{constructor(t){ve(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:i,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:g}=r,A=new Ed;if(!i){this.logger.error("No stream ID found");return}let x=0,C,R=()=>{C&&!A.isActive(C)&&(v?.abort(),g(),b())},F=()=>{A.remove(C),C=tg(R,C,LF),A.add(C)},v=new a.AbortController,b=()=>as(QF(n,o,i),{method:"GET",fetch:y,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:v?.signal,async onopen(P){if(P.ok&&P.headers.get("content-type")===_F)return;throw P.status>=400&&P.status<500&&P.status!==429?new Qi({message:"Error opening stream",code:P.status}):new Pd},onmessage:P=>{if(v?.signal.aborted)return;let I=JSON.parse(P.data);if(I.finishReason==="ERROR"){A.remove(C),v?.abort(),m({message:I.errorMessage,code:I.statusCode});return}p(I),x=0,I.finishReason==="COMPLETED"?(A.remove(C),f()):F()},onerror:P=>{if(!v?.signal.aborted){if(A.remove(C),P instanceof Qi)throw v?.abort(),m(P),P;if(++x>cg){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Td};throw v?.abort(),m(I),new Qi(I)}this.logger.info(`Retrying...(${x}/${cg})`),g()}}});return b(),v}};l();s();u();c();var cs=e=>e;l();s();u();c();l();s();u();c();var Ag=Dt(hg(),1);l();s();u();c();l();s();u();c();var pb="recommendation-internal-options",yM=Symbol.for(pb);var re=new Error("Failed to load reducers."),io=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var bn=class extends Error{constructor(r,n){super();ve(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 yg(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Sg(e){return typeof e!="object"||!e?!1:Object.values(e).every(mb)}function mb(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Cg(e){return e===429}var Nt=class e{static async call(t){let r=fb(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...d}=o,p=async()=>{let m=await y(i,d);if(Cg(m.status))throw m;return m};try{let m=await(0,Ag.backOff)(p,{retry:f=>{let g=f&&Cg(f.status);return g&&n.info("Platform retrying request"),g}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new io;case 404:throw new bn(i,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new bn(i):m}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:d}=r,{signal:p,...m}=t,f=Mi(m);try{let g=await o(t,n,d);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return f}};function ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function lt(e,t="prod"){return`${ke(e,t)}/rest/search/v2`}function ls(e,t="prod"){return`${ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function fb(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=gb(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...p&&{body:m},signal:d}}function gb(e,t){return t==="application/x-www-form-urlencoded"?Sg(e)?yg(e):"":JSON.stringify(e)}l();s();u();c();l();s();u();c();function Ui(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Ld=e=>{let{response:t}=e;return t.body?hb(e):yb(t)},hb=e=>Cb(e)?Ab(e):Sb(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},yb=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Sb(e){return e.body.statusCode!==void 0}function Cb(e){return e.body.exception!==void 0}var Ab=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});l();s();u();c();function xg(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}l();s();u();c();var _d=(e,t,r,n)=>{let o=new Nr(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Rg=(e,t)=>{let r=new Nr(`${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},Ud=async(e,t)=>{let r=await Nt.call({..._d(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Ui(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=xg(r),o=await r.arrayBuffer(),d=new TextDecoder(n).decode(o);return xb(d)?{success:d}:{error:Ld({response:r,body:d})}};function xb(e){return typeof e=="string"}l();s();u();c();l();s();u();c();function ao(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function je(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:ao(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:ao(),extendedResults:{},searchAction:void 0}}l();s();u();c();l();s();u();c();function Rb(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function vb(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function In(e,t){if(t&&e.name==="AbortError")return{error:vb(e)};if(e instanceof bn)return{error:Rb(e)};throw e}var Mr=e=>e.success!==void 0,we=e=>e.error!==void 0;function vg(e){return e.results!==void 0}function Fg(e){let t=ao();return K(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}l();s();u();c();l();s();u();c();var Bd=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,Fb=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,Bi=(e,t,r,n)=>{bb(e);let o=Bd(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},bg=(e,t,r)=>{Ib(e);let n=Fb(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},jd=e=>{let{insightId:t,...r}=Ui(e);return r},Ig=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},bb=e=>{if(Ig(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},Ib=e=>{if(Ig(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var wg=e=>({...Bi(e,"GET","application/json","/interface"),requestParams:{}});l();s();u();c();var Pg=e=>({...Bi(e,"POST","application/json","/search"),requestParams:jd(e)}),Eg=e=>({...Bi(e,"POST","application/json","/querysuggest"),requestParams:jd(e)});l();s();u();c();var Tg=e=>({...bg(e,"POST","application/json"),requestParams:{objectId:e.userId}});var ds=class{constructor(t){this.options=t}async getInterface(t){let r=await Nt.call({...wg(t),...this.options});if(r instanceof Error)return In(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async query(t,r){let n=await Nt.call({...Pg(t),requestMetadata:{method:"search",origin:r?.origin},...this.options});if(n instanceof Error)return In(n);let o=await n.json();return vg(o)&&(o=Fg(o)),n.ok?{success:o}:{error:o}}async querySuggest(t){let r=await Nt.call({...Eg(t),...this.options});if(r instanceof Error)return In(r);let n=await r.json();return n.completions?{success:n}:{error:n}}async userActions(t){let r=await Nt.call({...Tg(t),...this.options});if(r instanceof Error)return In(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async html(t){return Ud(t,{...this.options})}};l();s();u();c();l();s();u();c();var j=new M({required:!0,emptyAllowed:!1}),Fe=new M({required:!1,emptyAllowed:!1}),Pe=new M({required:!0,emptyAllowed:!0}),kg=new M({required:!1,emptyAllowed:!0}),ps=new te({each:j,required:!0}),qg=new M({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Og=new M({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),BQ=new M({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Mt=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),It=(e,t)=>{if("required"in t)return{payload:new Se({value:t}).validate({value:e}).value};let o=new _({options:{required:!0},values:t}).validate(e);if(o)throw new vn(o);return{payload:e}},E=(e,t)=>{try{return It(e,t)}catch(r){return{payload:e,error:Mt(r)}}},Gt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Dg(e,t,r,o,"Controller initialization error")},$e=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Dg(e,t,r,o,"Controller initialization error")},Dg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};l();s();u();c();l();s();u();c();l();s();u();c();function We(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 wb=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vg=wb,$d=()=>Math.random().toString(36).substring(7).split("").join("."),Pb={INIT:`@@redux/INIT${$d()}`,REPLACE:`@@redux/REPLACE${$d()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$d()}`},ms=Pb;function zt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Hd(e,t,r){if(typeof e!="function")throw new Error(We(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(We(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(We(1));return r(Hd)(e,t)}let n=e,o=t,i=new Map,d=i,p=0,m=!1;function f(){d===i&&(d=new Map,i.forEach((v,b)=>{d.set(b,v)}))}function g(){if(m)throw new Error(We(3));return o}function A(v){if(typeof v!="function")throw new Error(We(4));if(m)throw new Error(We(5));let b=!0;f();let P=p++;return d.set(P,v),function(){if(b){if(m)throw new Error(We(6));b=!1,f(),d.delete(P),i=null}}}function x(v){if(!zt(v))throw new Error(We(7));if(typeof v.type>"u")throw new Error(We(8));if(typeof v.type!="string")throw new Error(We(17));if(m)throw new Error(We(9));try{m=!0,o=n(o,v)}finally{m=!1}return(i=d).forEach(P=>{P()}),v}function C(v){if(typeof v!="function")throw new Error(We(10));n=v,x({type:ms.REPLACE})}function R(){let v=A;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(We(11));function P(){let T=b;T.next&&T.next(g())}return P(),{unsubscribe:v(P)}},[Vg](){return this}}}return x({type:ms.INIT}),{dispatch:x,subscribe:A,getState:g,replaceReducer:C,[Vg]:R}}function Eb(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:ms.INIT})>"u")throw new Error(We(12));if(typeof r(void 0,{type:ms.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(We(13))})}function so(e){let t=Object.keys(e),r={};for(let d=0;d<t.length;d++){let p=t[d];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,i;try{Eb(r)}catch(d){i=d}return function(p={},m){if(i)throw i;let f=!1,g={};for(let A=0;A<n.length;A++){let x=n[A],C=r[x],R=p[x],F=C(R,m);if(typeof F>"u"){let v=m&&m.type;throw new Error(We(14))}g[x]=F,f=f||F!==R}return f=f||n.length!==Object.keys(p).length,f?g:p}}function co(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Ng(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(We(15))},d={getState:o.getState,dispatch:(m,...f)=>i(m,...f)},p=e.map(m=>m(d));return i=co(...p)(o.dispatch),{...o,dispatch:i}}}function fs(e){return zt(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var tp=Symbol.for("immer-nothing"),ji=Symbol.for("immer-draftable"),dt=Symbol.for("immer-state");function Ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pn=Object.getPrototypeOf;function Ct(e){return!!e&&!!e[dt]}function pt(e){return e?Ug(e)||Array.isArray(e)||!!e[ji]||!!e.constructor?.[ji]||Wi(e)||Yi(e):!1}var Tb=Object.prototype.constructor.toString();function Ug(e){if(!e||typeof e!="object")return!1;let t=Pn(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)===Tb}function rp(e){return Ct(e)||Ye(15,e),e[dt].base_}function $i(e,t){En(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function En(e){let t=e[dt];return t?t.type_:Array.isArray(e)?1:Wi(e)?2:Yi(e)?3:0}function Hi(e,t){return En(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Gd(e,t){return En(e)===2?e.get(t):e[t]}function Bg(e,t,r){let n=En(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function kb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Wi(e){return e instanceof Map}function Yi(e){return e instanceof Set}function wn(e){return e.copy_||e.base_}function Yd(e,t){if(Wi(e))return new Map(e);if(Yi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Ug(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[dt];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let d=o[i],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(Pn(e),n)}else{let n=Pn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function ys(e,t=!1){return Ss(e)||Ct(e)||!pt(e)||(En(e)>1&&(e.set=e.add=e.clear=e.delete=qb),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>ys(n,!0))),e}function qb(){Ye(2)}function Ss(e){return Object.isFrozen(e)}var Kd={};function Tn(e){let t=Kd[e];return t||Ye(0,e),t}function Ob(e,t){Kd[e]||(Kd[e]=t)}var Gi;function jg(){return Gi}function Db(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Mg(e,t){t&&(Tn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Jd(e){Xd(e),e.drafts_.forEach(Vb),e.drafts_=null}function Xd(e){e===Gi&&(Gi=e.parent_)}function Qg(e){return Gi=Db(Gi,e)}function Vb(e){let t=e[dt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Lg(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[dt].modified_&&(Jd(t),Ye(4)),pt(e)&&(e=gs(t,e),t.parent_||hs(t,e)),t.patches_&&Tn("Patches").generateReplacementPatches_(r[dt].base_,e,t.patches_,t.inversePatches_)):e=gs(t,r,[]),Jd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==tp?e:void 0}function gs(e,t,r){if(Ss(t))return t;let n=t[dt];if(!n)return $i(t,(o,i)=>_g(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return hs(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,d=!1;n.type_===3&&(i=new Set(o),o.clear(),d=!0),$i(i,(p,m)=>_g(e,n,o,p,m,r,d)),hs(e,o,!1),r&&e.patches_&&Tn("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function _g(e,t,r,n,o,i,d){if(Ct(o)){let p=i&&t&&t.type_!==3&&!Hi(t.assigned_,n)?i.concat(n):void 0,m=gs(e,o,p);if(Bg(r,n,m),Ct(m))e.canAutoFreeze_=!1;else return}else d&&r.add(o);if(pt(o)&&!Ss(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;gs(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&hs(e,o)}}function hs(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ys(t,r)}function Nb(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:jg(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=np;r&&(o=[n],i=zi);let{revoke:d,proxy:p}=Proxy.revocable(o,i);return n.draft_=p,n.revoke_=d,p}var np={get(e,t){if(t===dt)return e;let r=wn(e);if(!Hi(r,t))return Mb(e,r,t);let n=r[t];return e.finalized_||!pt(n)?n:n===zd(e.base_,t)?(Wd(e),e.copy_[t]=ep(n,e)):n},has(e,t){return t in wn(e)},ownKeys(e){return Reflect.ownKeys(wn(e))},set(e,t,r){let n=$g(wn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=zd(wn(e),t),i=o?.[dt];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(kb(r,o)&&(r!==void 0||Hi(e.base_,t)))return!0;Wd(e),Zd(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 zd(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Wd(e),Zd(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=wn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ye(11)},getPrototypeOf(e){return Pn(e.base_)},setPrototypeOf(){Ye(12)}},zi={};$i(np,(e,t)=>{zi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});zi.deleteProperty=function(e,t){return zi.set.call(this,e,t,void 0)};zi.set=function(e,t,r){return np.set.call(this,e[0],t,r,e[0])};function zd(e,t){let r=e[dt];return(r?wn(r):e)[t]}function Mb(e,t,r){let n=$g(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function $g(e,t){if(!(t in e))return;let r=Pn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Pn(r)}}function Zd(e){e.modified_||(e.modified_=!0,e.parent_&&Zd(e.parent_))}function Wd(e){e.copy_||(e.copy_=Yd(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Qb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let d=this;return function(m=i,...f){return d.produce(m,g=>r.call(this,g,...f))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let o;if(pt(t)){let i=Qg(this),d=ep(t,void 0),p=!0;try{o=r(d),p=!1}finally{p?Jd(i):Xd(i)}return Mg(i,n),Lg(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===tp&&(o=void 0),this.autoFreeze_&&ys(o,!0),n){let i=[],d=[];Tn("Patches").generateReplacementPatches_(t,o,i,d),n(i,d)}return o}else Ye(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(d,...p)=>this.produceWithPatches(d,m=>t(m,...p));let n,o;return[this.produce(t,r,(d,p)=>{n=d,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){pt(e)||Ye(8),Ct(e)&&(e=Hg(e));let t=Qg(this),r=ep(e,void 0);return r[dt].isManual_=!0,Xd(t),r}finishDraft(e,t){let r=e&&e[dt];(!r||!r.isManual_)&&Ye(9);let{scope_:n}=r;return Mg(n,t),Lg(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Tn("Patches").applyPatches_;return Ct(e)?n(e,t):this.produce(e,o=>n(o,t))}};function ep(e,t){let r=Wi(e)?Tn("MapSet").proxyMap_(e,t):Yi(e)?Tn("MapSet").proxySet_(e,t):Nb(e,t);return(t?t.scope_:jg()).drafts_.push(r),r}function Hg(e){return Ct(e)||Ye(10,e),Gg(e)}function Gg(e){if(!pt(e)||Ss(e))return e;let t=e[dt],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yd(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Yd(e,!0);return $i(r,(n,o)=>{Bg(r,n,Gg(o))}),t&&(t.finalized_=!1),r}function zg(){let t="replace",r="add",n="remove";function o(x,C,R,F){switch(x.type_){case 0:case 2:return d(x,C,R,F);case 1:return i(x,C,R,F);case 3:return p(x,C,R,F)}}function i(x,C,R,F){let{base_:v,assigned_:b}=x,P=x.copy_;P.length<v.length&&([v,P]=[P,v],[R,F]=[F,R]);for(let I=0;I<v.length;I++)if(b[I]&&P[I]!==v[I]){let T=C.concat([I]);R.push({op:t,path:T,value:A(P[I])}),F.push({op:t,path:T,value:A(v[I])})}for(let I=v.length;I<P.length;I++){let T=C.concat([I]);R.push({op:r,path:T,value:A(P[I])})}for(let I=P.length-1;v.length<=I;--I){let T=C.concat([I]);F.push({op:n,path:T})}}function d(x,C,R,F){let{base_:v,copy_:b}=x;$i(x.assigned_,(P,I)=>{let T=Gd(v,P),Q=Gd(b,P),D=I?Hi(v,P)?t:r:n;if(T===Q&&D===t)return;let k=C.concat(P);R.push(D===n?{op:D,path:k}:{op:D,path:k,value:Q}),F.push(D===r?{op:n,path:k}:D===n?{op:r,path:k,value:A(T)}:{op:t,path:k,value:A(T)})})}function p(x,C,R,F){let{base_:v,copy_:b}=x,P=0;v.forEach(I=>{if(!b.has(I)){let T=C.concat([P]);R.push({op:n,path:T,value:I}),F.unshift({op:r,path:T,value:I})}P++}),P=0,b.forEach(I=>{if(!v.has(I)){let T=C.concat([P]);R.push({op:r,path:T,value:I}),F.unshift({op:n,path:T,value:I})}P++})}function m(x,C,R,F){R.push({op:t,path:[],value:C===tp?void 0:C}),F.push({op:t,path:[],value:x})}function f(x,C){return C.forEach(R=>{let{path:F,op:v}=R,b=x;for(let Q=0;Q<F.length-1;Q++){let D=En(b),k=F[Q];typeof k!="string"&&typeof k!="number"&&(k=""+k),(D===0||D===1)&&(k==="__proto__"||k==="constructor")&&Ye(19),typeof b=="function"&&k==="prototype"&&Ye(19),b=Gd(b,k),typeof b!="object"&&Ye(18,F.join("/"))}let P=En(b),I=g(R.value),T=F[F.length-1];switch(v){case t:switch(P){case 2:return b.set(T,I);case 3:Ye(16);default:return b[T]=I}case r:switch(P){case 1:return T==="-"?b.push(I):b.splice(T,0,I);case 2:return b.set(T,I);case 3:return b.add(I);default:return b[T]=I}case n:switch(P){case 1:return b.splice(T,1);case 2:return b.delete(T);case 3:return b.delete(R.value);default:return delete b[T]}default:Ye(17,v)}}),x}function g(x){if(!pt(x))return x;if(Array.isArray(x))return x.map(g);if(Wi(x))return new Map(Array.from(x.entries()).map(([R,F])=>[R,g(F)]));if(Yi(x))return new Set(Array.from(x).map(g));let C=Object.create(Pn(x));for(let R in x)C[R]=g(x[R]);return Hi(x,ji)&&(C[ji]=x[ji]),C}function A(x){return Ct(x)?g(x):x}Ob("Patches",{applyPatches_:f,generatePatches_:o,generateReplacementPatches_:m})}var At=new Qb,Rr=At.produce,Cs=At.produceWithPatches.bind(At),ZQ=At.setAutoFreeze.bind(At),eL=At.setUseStrictShallowCopy.bind(At),op=At.applyPatches.bind(At),tL=At.createDraft.bind(At),rL=At.finishDraft.bind(At);l();s();u();c();function Lb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _b(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ub(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 Wg=e=>Array.isArray(e)?e:[e];function Bb(e){let t=Array.isArray(e[0])?e[0]:e;return Ub(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function jb(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var uL=Symbol();var lL=Object.getPrototypeOf({});var $b=class{constructor(e){this.value=e}deref(){return this.value}},Hb=typeof WeakRef<"u"?WeakRef:$b,Gb=0,Yg=1;function As(){return{s:Gb,v:void 0,o:null,p:null}}function uo(e,t={}){let r=As(),{resultEqualityCheck:n}=t,o,i=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 R=p.o;R===null&&(p.o=R=new WeakMap);let F=R.get(C);F===void 0?(p=As(),R.set(C,p)):p=F}else{let R=p.p;R===null&&(p.p=R=new Map);let F=R.get(C);F===void 0?(p=As(),R.set(C,p)):p=F}}let f=p,g;if(p.s===Yg)g=p.v;else if(g=e.apply(null,arguments),i++,n){let A=o?.deref?.()??o;A!=null&&n(A,g)&&(g=A,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new Hb(g):g}return f.s=Yg,f.v=g,g}return d.clearCache=()=>{r=As(),d.resetResultsCount()},d.resultsCount=()=>i,d.resetResultsCount=()=>{i=0},d}function Kg(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,d=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),Lb(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let g={...r,...m},{memoize:A,memoizeOptions:x=[],argsMemoize:C=uo,argsMemoizeOptions:R=[],devModeChecks:F={}}=g,v=Wg(x),b=Wg(R),P=Bb(o),I=A(function(){return i++,f.apply(null,arguments)},...v),T=!0,Q=C(function(){d++;let k=jb(P,arguments);return p=I.apply(null,k),p},...b);return Object.assign(Q,{resultFunc:f,memoizedResultFunc:I,dependencies:P,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:A,argsMemoize:C})};return Object.assign(n,{withTypes:()=>n}),n}var se=Kg(uo),zb=Object.assign((e,t=se)=>{_b(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>zb});l();s();u();c();function Jg(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Xg=Jg(),Zg=Jg;var Wb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?co:co.apply(null,arguments)},PL=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Yb=e=>e&&typeof e.match=="function";function w(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Qt(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>fs(n)&&n.type===e,r}var oh=class Ki extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ki.prototype)}static get[Symbol.species](){return Ki}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ki(...t[0].concat(this)):new Ki(...t.concat(this))}};function eh(e){return pt(e)?Rr(e,()=>{}):e}function th(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Kb(e){return typeof e=="boolean"}var Jb=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},d=new oh;return r&&(Kb(r)?d.push(Xg):d.push(Zg(r.extraArgument))),d},Ji="RTK_autoBatch",po=()=>e=>({payload:e,meta:{[Ji]:!0}}),rh=e=>t=>{setTimeout(t,e)},Xb=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:rh(10):e.type==="callback"?e.queueNotification:rh(e.timeout),f=()=>{d=!1,i&&(i=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let A=()=>o&&g(),x=n.subscribe(A);return p.add(g),()=>{x(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ji],i=!o,i&&(d||(d=!0,m(f))),n.dispatch(g)}finally{o=!0}}})},Zb=e=>function(r){let{autoBatch:n=!0}=r??{},o=new oh(e);return n&&o.push(Xb(typeof n=="object"?n:void 0)),o};function ih(e){let t=Jb(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(zt(r))p=so(r);else throw new Error(Qt(1));let m;typeof n=="function"?m=n(t):m=t();let f=co;o&&(f=Wb({trace:!1,...typeof o=="object"&&o}));let g=Ng(...m),A=Zb(g),x=typeof d=="function"?d(A):A(),C=f(...x);return Hd(p,i,C)}function ah(e){let t={},r=[],n,o={addCase(i,d){let p=typeof i=="string"?i:i.type;if(!p)throw new Error(Qt(28));if(p in t)throw new Error(Qt(29));return t[p]=d,o},addMatcher(i,d){return r.push({matcher:i,reducer:d}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function eI(e){return typeof e=="function"}function ie(e,t){let[r,n,o]=ah(t),i;if(eI(e))i=()=>eh(e());else{let p=eh(e);i=()=>p}function d(p=i(),m){let f=[r[m.type],...n.filter(({matcher:g})=>g(m)).map(({reducer:g})=>g)];return f.filter(g=>!!g).length===0&&(f=[o]),f.reduce((g,A)=>{if(A)if(Ct(g)){let C=A(g,m);return C===void 0?g:C}else{if(pt(g))return Rr(g,x=>A(x,m));{let x=A(g,m);if(x===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return g},p)}return d.getInitialState=i,d}var sh=(e,t)=>Yb(e)?e.match(t):e(t);function Wt(...e){return t=>e.some(r=>sh(r,t))}function lo(...e){return t=>e.every(r=>sh(r,t))}function Rs(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 Xi(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function vs(...e){return e.length===0?t=>Rs(t,["pending"]):Xi(e)?Wt(...e.map(t=>t.pending)):vs()(e[0])}function kn(...e){return e.length===0?t=>Rs(t,["rejected"]):Xi(e)?Wt(...e.map(t=>t.rejected)):kn()(e[0])}function Zi(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?lo(kn(...e),t):Xi(e)?lo(kn(...e),t):Zi()(e[0])}function vr(...e){return e.length===0?t=>Rs(t,["fulfilled"]):Xi(e)?Wt(...e.map(t=>t.fulfilled)):vr()(e[0])}function Fs(...e){return e.length===0?t=>Rs(t,["pending","fulfilled","rejected"]):Xi(e)?Wt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Fs()(e[0])}var tI="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",bs=(e=21)=>{let t="",r=e;for(;r--;)t+=tI[Math.random()*64|0];return t},rI=["name","message","stack","code"],ip=class{constructor(e,t){ve(this,"_type");this.payload=e,this.meta=t}},nh=class{constructor(e,t){ve(this,"_type");this.payload=e,this.meta=t}},nI=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of rI)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ee=(()=>{function e(t,r,n){let o=w(t+"/fulfilled",(m,f,g,A)=>({payload:m,meta:{...A||{},arg:g,requestId:f,requestStatus:"fulfilled"}})),i=w(t+"/pending",(m,f,g)=>({payload:void 0,meta:{...g||{},arg:f,requestId:m,requestStatus:"pending"}})),d=w(t+"/rejected",(m,f,g,A,x)=>({payload:A,error:(n&&n.serializeError||nI)(m||"Rejected"),meta:{...x||{},arg:g,requestId:f,rejectedWithValue:!!A,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,g,A)=>{let x=n?.idGenerator?n.idGenerator(m):bs(),C=new a.AbortController,R,F;function v(P){F=P,C.abort()}let b=async function(){let P;try{let T=n?.condition?.(m,{getState:g,extra:A});if(iI(T)&&(T=await T),T===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let Q=new Promise((D,k)=>{R=()=>{k({name:"AbortError",message:F||"Aborted"})},C.signal.addEventListener("abort",R)});f(i(x,m,n?.getPendingMeta?.({requestId:x,arg:m},{getState:g,extra:A}))),P=await Promise.race([Q,Promise.resolve(r(m,{dispatch:f,getState:g,extra:A,requestId:x,signal:C.signal,abort:v,rejectWithValue:(D,k)=>new ip(D,k),fulfillWithValue:(D,k)=>new nh(D,k)})).then(D=>{if(D instanceof ip)throw D;return D instanceof nh?o(D.payload,x,m,D.meta):o(D,x,m)})])}catch(T){P=T instanceof ip?d(null,x,m,T.payload,T.meta):d(T,x,m)}finally{R&&C.signal.removeEventListener("abort",R)}return n&&!n.dispatchConditionRejection&&d.match(P)&&P.meta.condition||f(P),P}();return Object.assign(b,{abort:v,requestId:x,arg:m,unwrap(){return b.then(oI)}})}}return Object.assign(p,{pending:i,rejected:d,fulfilled:o,settled:Wt(d,o),typePrefix:t})}return e.withTypes=()=>e,e})();function oI(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function iI(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var ch=Symbol.for("rtk-slice-createasyncthunk"),OL={[ch]:ee};function aI(e,t){return`${e}/${t}`}function sI({creators:e}={}){let t=e?.asyncThunk?.[ch];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Qt(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(uI()):n.reducers)||{},p=Object.keys(d),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(P,I){let T=typeof P=="string"?P:P.type;if(!T)throw new Error(Qt(12));if(T in m.sliceCaseReducersByType)throw new Error(Qt(13));return m.sliceCaseReducersByType[T]=I,f},addMatcher(P,I){return m.sliceMatchers.push({matcher:P,reducer:I}),f},exposeAction(P,I){return m.actionCreators[P]=I,f},exposeCaseReducer(P,I){return m.sliceCaseReducersByName[P]=I,f}};p.forEach(P=>{let I=d[P],T={reducerName:P,type:aI(o,P),createNotation:typeof n.reducers=="function"};dI(I)?mI(T,I,f,t):lI(T,I,f)});function g(){let[P={},I=[],T=void 0]=typeof n.extraReducers=="function"?ah(n.extraReducers):[n.extraReducers],Q={...P,...m.sliceCaseReducersByType};return ie(n.initialState,D=>{for(let k in Q)D.addCase(k,Q[k]);for(let k of m.sliceMatchers)D.addMatcher(k.matcher,k.reducer);for(let k of I)D.addMatcher(k.matcher,k.reducer);T&&D.addDefaultCase(T)})}let A=P=>P,x=new Map,C;function R(P,I){return C||(C=g()),C(P,I)}function F(){return C||(C=g()),C.getInitialState()}function v(P,I=!1){function T(D){let k=D[P];return typeof k>"u"&&I&&(k=F()),k}function Q(D=A){let k=th(x,I,()=>new WeakMap);return th(k,D,()=>{let O={};for(let[V,L]of Object.entries(n.selectors??{}))O[V]=cI(L,D,F,I);return O})}return{reducerPath:P,getSelectors:Q,get selectors(){return Q(T)},selectSlice:T}}let b={name:o,reducer:R,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:F,...v(i),injectInto(P,{reducerPath:I,...T}={}){let Q=I??i;return P.inject({reducerPath:Q,reducer:R},T),{...b,...v(Q,!0)}}};return b}}function cI(e,t,r,n){function o(i,...d){let p=t(i);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return o.unwrapped=e,o}var qn=sI();function uI(){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 lI({type:e,reducerName:t,createNotation:r},n,o){let i,d;if("reducer"in n){if(r&&!pI(n))throw new Error(Qt(17));i=n.reducer,d=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,d?w(e,d):w(e))}function dI(e){return e._reducerDefinitionType==="asyncThunk"}function pI(e){return e._reducerDefinitionType==="reducerWithPrepare"}function mI({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Qt(18));let{payloadCreator:i,fulfilled:d,pending:p,rejected:m,settled:f,options:g}=r,A=o(e,i,g);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||xs,pending:p||xs,rejected:m||xs,settled:f||xs})}function xs(){}var uh="listener",lh="completed",dh="cancelled",DL=`task-${dh}`,VL=`task-${lh}`,NL=`${uh}-${dh}`,ML=`${uh}-${lh}`;var{assign:ph}=Object;var ap="listenerMiddleware";var fI=ph(w(`${ap}/add`),{withTypes:()=>fI}),QL=w(`${ap}/removeAll`),gI=ph(w(`${ap}/remove`),{withTypes:()=>gI});var LL=Symbol.for("rtk-state-proxy-original");function Qt(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 mh=/^(?:[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 hI(e){return typeof e=="string"&&mh.test(e)}var sp=hI;l();s();u();c();var Ke=[];for(let e=0;e<256;++e)Ke.push((e+256).toString(16).slice(1));function fh(e,t=0){return(Ke[e[t+0]]+Ke[e[t+1]]+Ke[e[t+2]]+Ke[e[t+3]]+"-"+Ke[e[t+4]]+Ke[e[t+5]]+"-"+Ke[e[t+6]]+Ke[e[t+7]]+"-"+Ke[e[t+8]]+Ke[e[t+9]]+"-"+Ke[e[t+10]]+Ke[e[t+11]]+Ke[e[t+12]]+Ke[e[t+13]]+Ke[e[t+14]]+Ke[e[t+15]]).toLowerCase()}l();s();u();c();var cp,yI=new Uint8Array(16);function up(){if(!cp){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");cp=crypto.getRandomValues.bind(crypto)}return cp(yI)}l();s();u();c();l();s();u();c();var SI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lp={randomUUID:SI};function CI(e,t,r){if(lp.randomUUID&&!t&&!e)return lp.randomUUID();e=e||{};let n=e.random??e.rng?.()??up();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return fh(n)}var dp=CI;l();s();u();c();function gh(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function AI({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(o,i,r))}var hh="visitorId";function xI(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(hh),o=n&&sp(n)?n:t.generateUUID();return r.setItem(hh,o),o}}}var Sh="1.2.1";function RI(e){let{trackingId:t}=e;return{trackingId:t}}function vI(e){return(e.source||[]).concat([`relay@${Sh}`])}function Ch(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:d}=r,p=RI(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:vI(t),clientId:m,userAgent:d(),referrer:o(),location:i()})}function FI(e,t,r,n,o){return{...t,meta:Ch(e,r,n,o)}}var bI="*";function II(){let e=[];function t({type:m,callback:f}){return e.findIndex(g=>g.type===m&&g.callback===f)}function r(m,f){return m.type==="*"||f===m.type}function n(m){return t(m)<0&&e.push(m),()=>p(m.type,m.callback)}function o(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(g){console.error(g)}})}function i(m){if(m===bI)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}):i(m)}return{add:n,call:o,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 wI(e){let t=yh(e);return{get:()=>t,update:r=>{t=yh({...t,...r})}}}var pp=PI();function PI(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let d=i.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function EI(){return{getItem(e){return pp.getItem(e)||localStorage.getItem(e)},removeItem(e){pp.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),pp.setItem(e,t,31556952e3)}}}function TI(){let e=document.referrer;return e===""?null:e}function kI(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(gh().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:()=>TI(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>dp(),storage:EI()}}function qI(){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 OI(){return{getItem(){return null},removeItem(){},setItem(){}}}function DI(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:OI()}}function VI(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=DI();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&NI()&&qI()?kI():n}function NI(){try{return typeof window=="object"}catch{return!1}}function MI(e){return{get:()=>Object.freeze(VI(e))}}function Ah(e){let t=wI(e),r=II(),n=MI(t),o=xI(n);return{emit:(i,d)=>{let p=t.get(),m=n.get(),f=FI(i,d,p,m,o);return AI({config:p,environment:m,event:f,listenerManager:r})},getMeta:i=>Ch(i,t.get(),n.get(),o),on:(i,d)=>r.add({type:i,callback:d}),off:(i,d)=>r.remove(i,d),updateConfig:i=>t.update(i),version:Sh}}l();s();u();c();l();s();u();c();var mo="3.27.2-pre.f8c6add22d",xh=["@coveo/atomic","@coveo/quantic"];var Qr=se(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${mo}`));var fo=se(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Qr(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},d)=>Ah({mode:i?"emit":"disabled",url:o??ls(e,t),token:r,trackingId:n??null,source:d}));l();s();u();c();l();s();u();c();function Yt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function N(e,t,r,n){function o(i){return i instanceof r?i:new r(function(d){d(i)})}return new(r||(r=Promise))(function(i,d){function p(g){try{f(n.next(g))}catch(A){d(A)}}function m(g){try{f(n.throw(g))}catch(A){d(A)}}function f(g){g.done?i(g.value):o(g.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var Ce;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ce||(Ce={}));function gp(){return typeof window<"u"}function Ep(){return typeof navigator<"u"}function go(){return typeof document<"u"}function hp(){try{return typeof localStorage<"u"}catch{return!1}}function QI(){try{return typeof sessionStorage<"u"}catch{return!1}}function Dh(){return Ep()&&navigator.cookieEnabled}var LI=[Ce.click,Ce.custom,Ce.search,Ce.view],_I=(e,t)=>LI.indexOf(e)!==-1?Object.assign({language:go()?document.documentElement.lang:"unknown",userAgent:Ep()?navigator.userAgent:"unknown"},t):t,ta=class e{static set(t,r,n){var o,i,d,p;n&&(i=new Date,i.setTime(i.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Rh(t,r,i):(d=p.split("."),o=d[d.length-2]+"."+d[d.length-1],Rh(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Rh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function UI(){return hp()?localStorage:Dh()?new ra:QI()?sessionStorage:new yo}var ra=class e{getItem(t){return ta.get(`${e.prefix}${t}`)}removeItem(t){ta.erase(`${e.prefix}${t}`)}setItem(t,r,n){ta.set(`${e.prefix}${t}`,r,n)}};ra.prefix="coveo_";var yp=class{constructor(){this.cookieStorage=new ra}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)}},yo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Is="__coveo.analytics.history",BI=20,jI=1e3*60,$I=75,Es=class{constructor(t){this.store=t||UI()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return N(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return N(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Is);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return N(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Is);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Is,JSON.stringify(t.slice(0,BI)))}catch{}}clear(){try{this.store.removeItem(Is)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,$I)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>jI:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var HI=(e,t)=>N(void 0,void 0,void 0,function*(){return e===Ce.view?(yield GI(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),GI=e=>N(void 0,void 0,void 0,function*(){let t=new Es,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),ws,zI=new Uint8Array(16);function WI(){if(!ws&&(ws=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ws))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ws(zI)}var YI=/^(?:[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 Ts(e){return typeof e=="string"&&YI.test(e)}var Je=[];for(let e=0;e<256;++e)Je.push((e+256).toString(16).slice(1));function Vh(e,t=0){return(Je[e[t+0]]+Je[e[t+1]]+Je[e[t+2]]+Je[e[t+3]]+"-"+Je[e[t+4]]+Je[e[t+5]]+"-"+Je[e[t+6]]+Je[e[t+7]]+"-"+Je[e[t+8]]+Je[e[t+9]]+"-"+Je[e[t+10]]+Je[e[t+11]]+Je[e[t+12]]+Je[e[t+13]]+Je[e[t+14]]+Je[e[t+15]]).toLowerCase()}function KI(e){if(!Ts(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 JI(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var XI="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ZI="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function ew(e,t,r){function n(o,i,d,p){var m;if(typeof o=="string"&&(o=JI(o)),typeof i=="string"&&(i=KI(i)),((m=i)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(i),f.set(o,i.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let g=0;g<16;++g)d[p+g]=f[g];return d}return Vh(f)}try{n.name=e}catch{}return n.DNS=XI,n.URL=ZI,n}var tw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vh={randomUUID:tw};function On(e,t,r){if(vh.randomUUID&&!t&&!e)return vh.randomUUID();e=e||{};let n=e.random||(e.rng||WI)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Vh(n)}function rw(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 mp(e,t){return e<<t|e>>>32-t}function nw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let d=unescape(encodeURIComponent(e));e=[];for(let p=0;p<d.length;++p)e.push(d.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let d=0;d<o;++d){let p=new Uint32Array(16);for(let m=0;m<16;++m)p[m]=e[d*64+m*4]<<24|e[d*64+m*4+1]<<16|e[d*64+m*4+2]<<8|e[d*64+m*4+3];i[d]=p}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<o;++d){let p=new Uint32Array(80);for(let C=0;C<16;++C)p[C]=i[d][C];for(let C=16;C<80;++C)p[C]=mp(p[C-3]^p[C-8]^p[C-14]^p[C-16],1);let m=r[0],f=r[1],g=r[2],A=r[3],x=r[4];for(let C=0;C<80;++C){let R=Math.floor(C/20),F=mp(m,5)+rw(R,f,g,A)+x+t[R]+p[C]>>>0;x=A,A=g,g=mp(f,30)>>>0,f=m,m=F}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+g>>>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 ow=ew("v5",80,nw),Fh=ow,Nh="2.30.45",bh=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,ea={pageview:"pageview",event:"event"},ks=class{constructor({client:t,uuidGenerator:r=On}){this.client=t,this.uuidGenerator=r}},Sp=class extends ks{constructor({client:t,uuidGenerator:r=On}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=bh(window.location),this.lastReferrer=go()?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:go()?document.title:"",encoding:go()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===ea.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===ea.pageview?this.nextPageViewId:this.pageViewId,referrer:t===ea.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===ea.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return bh(window.location)}},Lr=class e{constructor(t,r){if(!Ts(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Ts(i)?new e(i,Number.parseInt(o)*1e3):null}};Lr.cvo_cid="cvo_cid";Lr.expirationTime=120;var Cp=class extends ks{constructor({client:t,uuidGenerator:r=On}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return N(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Lr.cvo_cid,new Lr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Cp.Id="link";var Pt=Object.keys;function Ps(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var fp=128,Mh=192,Ih=224,wh=240;function iw(e){return(e&248)===wh?4:(e&wh)===Ih?3:(e&Ih)===Mh?2:1}function aw(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&fp)!=fp)break;if(r-=3,(n&Mh)!=fp){t-r>=iw(n)*3&&(r=t);break}}return e.substring(0,r)}var Ap={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"},sw=Pt(Ap).map(e=>Ap[e]),cw=[...sw].join("|"),uw=new RegExp(`^(${cw}$)`),lw={svcAction:"svc_action",svcActionData:"svc_action_data"},dw=e=>Pt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ap[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),pw=e=>uw.test(e),mw=[pw],Ph={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Eh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},et={action:"pa",list:"pal",listSource:"pls"},qs={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},fw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],xp={id:"quoteId",affiliation:"quoteAffiliation"},Rp={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},gw={add:et,bookmark_add:et,bookmark_remove:et,click:et,checkout:et,checkout_option:et,detail:et,impression:et,remove:et,refund:Object.assign(Object.assign({},et),qs),purchase:Object.assign(Object.assign({},et),qs),quickview:et,quote:Object.assign(Object.assign({},et),xp),review:Object.assign(Object.assign({},et),Rp)},hw=Pt(Ph).map(e=>Ph[e]),yw=Pt(Eh).map(e=>Eh[e]),Sw=Pt(et).map(e=>et[e]),Cw=Pt(qs).map(e=>qs[e]),Aw=Pt(Rp).map(e=>Rp[e]),xw=Pt(xp).map(e=>xp[e]),Rw=[...hw,"custom"].join("|"),vw=[...yw,"custom"].join("|"),Qh="(pr[0-9]+)",Lh="(il[0-9]+pi[0-9]+)",Fw=new RegExp(`^${Qh}(${Rw})$`),bw=new RegExp(`^(${Lh}(${vw}))|(il[0-9]+nm)$`),Iw=new RegExp(`^(${Sw.join("|")})$`),ww=new RegExp(`^(${Cw.join("|")})$`),Pw=new RegExp(`^${Qh}custom$`),Ew=new RegExp(`^${Lh}custom$`),Tw=new RegExp(`^(${[...fw,...Aw,...xw].join("|")})$`),kw=e=>Fw.test(e),qw=e=>bw.test(e),Ow=e=>Iw.test(e),Dw=e=>ww.test(e),Vw=e=>Tw.test(e),Nw=[qw,kw,Ow,Dw,Vw],Mw=[Pw,Ew],Qw={anonymizeIp:"aip"},Lw={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},_w={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Uw=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Bw=Object.assign(Object.assign(Object.assign(Object.assign({},Qw),Lw),_w),Uw.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),vp=Object.assign(Object.assign({},Bw),lw),jw=e=>{let t=!!e.action&&gw[e.action]||{};return Pt(e).reduce((r,n)=>{let o=t[n]||vp[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},$w=Pt(vp).map(e=>vp[e]),Hw=e=>$w.indexOf(e)!==-1,Gw=e=>e==="custom",zw=e=>[...Nw,...mw,Hw,Gw].some(t=>t(e)),Ww=e=>Pt(e).reduce((t,r)=>{let n=Yw(r);return n?Object.assign(Object.assign({},t),Kw(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Yw=e=>{let t;return[...Mw].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Kw=(e,t)=>Pt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Fp=class{constructor(t){this.opts=t}sendEvent(t,r){return N(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(d,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return N(this,void 0,void 0,function*(){let o=t,i=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;o=p||t;try{i=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return N(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[Ce.click,Ce.custom,Ce.search,Ce.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},bp=class{sendEvent(t,r){return N(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return N(this,void 0,void 0,function*(){return Promise.resolve()})}},Th=h.fetch,Os=class{constructor(t){this.opts=t}sendEvent(t,r){return N(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=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),i?yield i(p,"analyticsFetch"):{}),{url:f}=m,g=Yt(m,["url"]),A;try{A=yield Th(f,g)}catch(x){console.error("An error has occured when sending the event.",x);return}if(A.ok){let x=yield A.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}else{try{A.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,A,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return N(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Th(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ce.click,Ce.custom,Ce.search,Ce.view].indexOf(t)!==-1}getVisitorIdParam(){return N(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Ip=class{constructor(t,r){hp()&&Dh()?this.storage=new yp:hp()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new yo),this.client=new Os(t),this.beaconClient=new Fp(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},wp=class{constructor(t,r){this.storage=r||new yo,this.client=new Os(t)}getClientDependingOnEventType(t){return this.client}},Ds=class{constructor(){this.storage=new yo,this.client=new bp}getClientDependingOnEventType(t){return this.client}},Jw="xx",Xw=e=>e?.startsWith(Jw)||!1,Zw=`
28
+ `+g:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":DF(g,n,t);break}}}}function DF(e,t,r){let n=parseInt(e,10);isNaN(n)||r(t.retry=n)}function VF(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function rg(){return{data:"",event:"",id:"",retry:void 0}}var wd="text/event-stream",NF=1e3,ag="last-event-id";function sg(){return typeof window<"u"}function as(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:d,openWhenHidden:p,fetch:m,...f}){return new Promise((g,A)=>{let x={...r};x.accept||(x.accept=wd);let C;function R(){C?.abort(),document.hidden||T()}!p&&sg()&&document.addEventListener("visibilitychange",R);let F=NF,v;function b(){sg()&&document.removeEventListener("visibilitychange",R),clearTimeout(v),C?.abort()}t?.addEventListener("abort",()=>{b(),g()});let P=m??y,I=n??MF;async function T(){C=a.AbortController?new a.AbortController:null;try{let Q=await P(e,{...f,headers:x,signal:C?.signal});await I(Q),await ng(Q.body,og(ig(D=>{D?x[ag]=D:delete x[ag]},D=>{F=D},o))),i?.(),b(),g()}catch(Q){if(!C?.signal?.aborted)try{let D=d?.(Q)??F;clearTimeout(v),v=setTimeout(T,D)}catch(D){b(),A(D)}}}T()})}function MF(e){let t=e.headers.get("content-type");if(!t?.startsWith(wd))throw new Error(`Expected content-type to be ${wd}, Actual: ${t}`)}l();s();u();c();var Nr=class{constructor(t){ve(this,"_basePath");ve(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 QF=(e,t,r)=>new Nr(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,cg=3,LF=5e3,_F="text/event-stream",Td=1,Pd=class extends Error{},Qi=class extends Error{constructor(r){super(r.message);this.payload=r}},Ed=class{constructor(){ve(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)}},ss=class{constructor(t){ve(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:i,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:g}=r,A=new Ed;if(!i){this.logger.error("No stream ID found");return}let x=0,C,R=()=>{C&&!A.isActive(C)&&(v?.abort(),g(),b())},F=()=>{A.remove(C),C=tg(R,C,LF),A.add(C)},v=new a.AbortController,b=()=>as(QF(n,o,i),{method:"GET",fetch:y,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:v?.signal,async onopen(P){if(P.ok&&P.headers.get("content-type")===_F)return;throw P.status>=400&&P.status<500&&P.status!==429?new Qi({message:"Error opening stream",code:P.status}):new Pd},onmessage:P=>{if(v?.signal.aborted)return;let I=JSON.parse(P.data);if(I.finishReason==="ERROR"){A.remove(C),v?.abort(),m({message:I.errorMessage,code:I.statusCode});return}p(I),x=0,I.finishReason==="COMPLETED"?(A.remove(C),f()):F()},onerror:P=>{if(!v?.signal.aborted){if(A.remove(C),P instanceof Qi)throw v?.abort(),m(P),P;if(++x>cg){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Td};throw v?.abort(),m(I),new Qi(I)}this.logger.info(`Retrying...(${x}/${cg})`),g()}}});return b(),v}};l();s();u();c();var cs=e=>e;l();s();u();c();l();s();u();c();var Ag=Dt(hg(),1);l();s();u();c();l();s();u();c();var pb="recommendation-internal-options",yM=Symbol.for(pb);var re=new Error("Failed to load reducers."),io=class extends Error{constructor(){super(),this.name="ExpiredToken",this.message="The token being used to perform the request is expired."}};var bn=class extends Error{constructor(r,n){super();ve(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 yg(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Sg(e){return typeof e!="object"||!e?!1:Object.values(e).every(mb)}function mb(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Cg(e){return e===429}var Nt=class e{static async call(t){let r=fb(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...d}=o,p=async()=>{let m=await y(i,d);if(Cg(m.status))throw m;return m};try{let m=await(0,Ag.backOff)(p,{retry:f=>{let g=f&&Cg(f.status);return g&&n.info("Platform retrying request"),g}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new io;case 404:throw new bn(i,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new bn(i):m}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:d}=r,{signal:p,...m}=t,f=Mi(m);try{let g=await o(t,n,d);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return f}};function ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function lt(e,t="prod"){return`${ke(e,t)}/rest/search/v2`}function ls(e,t="prod"){return`${ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function fb(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=gb(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...p&&{body:m},signal:d}}function gb(e,t){return t==="application/x-www-form-urlencoded"?Sg(e)?yg(e):"":JSON.stringify(e)}l();s();u();c();l();s();u();c();function Ui(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Ld=e=>{let{response:t}=e;return t.body?hb(e):yb(t)},hb=e=>Cb(e)?Ab(e):Sb(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},yb=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Sb(e){return e.body.statusCode!==void 0}function Cb(e){return e.body.exception!==void 0}var Ab=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});l();s();u();c();function xg(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}l();s();u();c();var _d=(e,t,r,n)=>{let o=new Nr(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Rg=(e,t)=>{let r=new Nr(`${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},Ud=async(e,t)=>{let r=await Nt.call({..._d(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Ui(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=xg(r),o=await r.arrayBuffer(),d=new TextDecoder(n).decode(o);return xb(d)?{success:d}:{error:Ld({response:r,body:d})}};function xb(e){return typeof e=="string"}l();s();u();c();l();s();u();c();function ao(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function je(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:ao(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:ao(),extendedResults:{},searchAction:void 0}}l();s();u();c();l();s();u();c();function Rb(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function vb(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function In(e,t){if(t&&e.name==="AbortError")return{error:vb(e)};if(e instanceof bn)return{error:Rb(e)};throw e}var Mr=e=>e.success!==void 0,we=e=>e.error!==void 0;function vg(e){return e.results!==void 0}function Fg(e){let t=ao();return K(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}l();s();u();c();l();s();u();c();var Bd=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,Fb=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,Bi=(e,t,r,n)=>{bb(e);let o=Bd(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},bg=(e,t,r)=>{Ib(e);let n=Fb(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},jd=e=>{let{insightId:t,...r}=Ui(e);return r},Ig=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},bb=e=>{if(Ig(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},Ib=e=>{if(Ig(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var wg=e=>({...Bi(e,"GET","application/json","/interface"),requestParams:{}});l();s();u();c();var Pg=e=>({...Bi(e,"POST","application/json","/search"),requestParams:jd(e)}),Eg=e=>({...Bi(e,"POST","application/json","/querysuggest"),requestParams:jd(e)});l();s();u();c();var Tg=e=>({...bg(e,"POST","application/json"),requestParams:{objectId:e.userId}});var ds=class{constructor(t){this.options=t}async getInterface(t){let r=await Nt.call({...wg(t),...this.options});if(r instanceof Error)return In(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async query(t,r){let n=await Nt.call({...Pg(t),requestMetadata:{method:"search",origin:r?.origin},...this.options});if(n instanceof Error)return In(n);let o=await n.json();return vg(o)&&(o=Fg(o)),n.ok?{success:o}:{error:o}}async querySuggest(t){let r=await Nt.call({...Eg(t),...this.options});if(r instanceof Error)return In(r);let n=await r.json();return n.completions?{success:n}:{error:n}}async userActions(t){let r=await Nt.call({...Tg(t),...this.options});if(r instanceof Error)return In(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async html(t){return Ud(t,{...this.options})}};l();s();u();c();l();s();u();c();var j=new M({required:!0,emptyAllowed:!1}),Fe=new M({required:!1,emptyAllowed:!1}),Pe=new M({required:!0,emptyAllowed:!0}),kg=new M({required:!1,emptyAllowed:!0}),ps=new te({each:j,required:!0}),qg=new M({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Og=new M({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),BQ=new M({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Mt=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),It=(e,t)=>{if("required"in t)return{payload:new Se({value:t}).validate({value:e}).value};let o=new _({options:{required:!0},values:t}).validate(e);if(o)throw new vn(o);return{payload:e}},E=(e,t)=>{try{return It(e,t)}catch(r){return{payload:e,error:Mt(r)}}},Gt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Dg(e,t,r,o,"Controller initialization error")},$e=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Dg(e,t,r,o,"Controller initialization error")},Dg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};l();s();u();c();l();s();u();c();l();s();u();c();function We(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 wb=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vg=wb,$d=()=>Math.random().toString(36).substring(7).split("").join("."),Pb={INIT:`@@redux/INIT${$d()}`,REPLACE:`@@redux/REPLACE${$d()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$d()}`},ms=Pb;function zt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Hd(e,t,r){if(typeof e!="function")throw new Error(We(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(We(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(We(1));return r(Hd)(e,t)}let n=e,o=t,i=new Map,d=i,p=0,m=!1;function f(){d===i&&(d=new Map,i.forEach((v,b)=>{d.set(b,v)}))}function g(){if(m)throw new Error(We(3));return o}function A(v){if(typeof v!="function")throw new Error(We(4));if(m)throw new Error(We(5));let b=!0;f();let P=p++;return d.set(P,v),function(){if(b){if(m)throw new Error(We(6));b=!1,f(),d.delete(P),i=null}}}function x(v){if(!zt(v))throw new Error(We(7));if(typeof v.type>"u")throw new Error(We(8));if(typeof v.type!="string")throw new Error(We(17));if(m)throw new Error(We(9));try{m=!0,o=n(o,v)}finally{m=!1}return(i=d).forEach(P=>{P()}),v}function C(v){if(typeof v!="function")throw new Error(We(10));n=v,x({type:ms.REPLACE})}function R(){let v=A;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(We(11));function P(){let T=b;T.next&&T.next(g())}return P(),{unsubscribe:v(P)}},[Vg](){return this}}}return x({type:ms.INIT}),{dispatch:x,subscribe:A,getState:g,replaceReducer:C,[Vg]:R}}function Eb(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:ms.INIT})>"u")throw new Error(We(12));if(typeof r(void 0,{type:ms.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(We(13))})}function so(e){let t=Object.keys(e),r={};for(let d=0;d<t.length;d++){let p=t[d];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,i;try{Eb(r)}catch(d){i=d}return function(p={},m){if(i)throw i;let f=!1,g={};for(let A=0;A<n.length;A++){let x=n[A],C=r[x],R=p[x],F=C(R,m);if(typeof F>"u"){let v=m&&m.type;throw new Error(We(14))}g[x]=F,f=f||F!==R}return f=f||n.length!==Object.keys(p).length,f?g:p}}function co(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Ng(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(We(15))},d={getState:o.getState,dispatch:(m,...f)=>i(m,...f)},p=e.map(m=>m(d));return i=co(...p)(o.dispatch),{...o,dispatch:i}}}function fs(e){return zt(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var tp=Symbol.for("immer-nothing"),ji=Symbol.for("immer-draftable"),dt=Symbol.for("immer-state");function Ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pn=Object.getPrototypeOf;function Ct(e){return!!e&&!!e[dt]}function pt(e){return e?Ug(e)||Array.isArray(e)||!!e[ji]||!!e.constructor?.[ji]||Wi(e)||Yi(e):!1}var Tb=Object.prototype.constructor.toString();function Ug(e){if(!e||typeof e!="object")return!1;let t=Pn(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)===Tb}function rp(e){return Ct(e)||Ye(15,e),e[dt].base_}function $i(e,t){En(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function En(e){let t=e[dt];return t?t.type_:Array.isArray(e)?1:Wi(e)?2:Yi(e)?3:0}function Hi(e,t){return En(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Gd(e,t){return En(e)===2?e.get(t):e[t]}function Bg(e,t,r){let n=En(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function kb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Wi(e){return e instanceof Map}function Yi(e){return e instanceof Set}function wn(e){return e.copy_||e.base_}function Yd(e,t){if(Wi(e))return new Map(e);if(Yi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Ug(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[dt];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let d=o[i],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(Pn(e),n)}else{let n=Pn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function ys(e,t=!1){return Ss(e)||Ct(e)||!pt(e)||(En(e)>1&&(e.set=e.add=e.clear=e.delete=qb),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>ys(n,!0))),e}function qb(){Ye(2)}function Ss(e){return Object.isFrozen(e)}var Kd={};function Tn(e){let t=Kd[e];return t||Ye(0,e),t}function Ob(e,t){Kd[e]||(Kd[e]=t)}var Gi;function jg(){return Gi}function Db(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Mg(e,t){t&&(Tn("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Jd(e){Xd(e),e.drafts_.forEach(Vb),e.drafts_=null}function Xd(e){e===Gi&&(Gi=e.parent_)}function Qg(e){return Gi=Db(Gi,e)}function Vb(e){let t=e[dt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Lg(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[dt].modified_&&(Jd(t),Ye(4)),pt(e)&&(e=gs(t,e),t.parent_||hs(t,e)),t.patches_&&Tn("Patches").generateReplacementPatches_(r[dt].base_,e,t.patches_,t.inversePatches_)):e=gs(t,r,[]),Jd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==tp?e:void 0}function gs(e,t,r){if(Ss(t))return t;let n=t[dt];if(!n)return $i(t,(o,i)=>_g(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return hs(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,d=!1;n.type_===3&&(i=new Set(o),o.clear(),d=!0),$i(i,(p,m)=>_g(e,n,o,p,m,r,d)),hs(e,o,!1),r&&e.patches_&&Tn("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function _g(e,t,r,n,o,i,d){if(Ct(o)){let p=i&&t&&t.type_!==3&&!Hi(t.assigned_,n)?i.concat(n):void 0,m=gs(e,o,p);if(Bg(r,n,m),Ct(m))e.canAutoFreeze_=!1;else return}else d&&r.add(o);if(pt(o)&&!Ss(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;gs(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&hs(e,o)}}function hs(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ys(t,r)}function Nb(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:jg(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=np;r&&(o=[n],i=zi);let{revoke:d,proxy:p}=Proxy.revocable(o,i);return n.draft_=p,n.revoke_=d,p}var np={get(e,t){if(t===dt)return e;let r=wn(e);if(!Hi(r,t))return Mb(e,r,t);let n=r[t];return e.finalized_||!pt(n)?n:n===zd(e.base_,t)?(Wd(e),e.copy_[t]=ep(n,e)):n},has(e,t){return t in wn(e)},ownKeys(e){return Reflect.ownKeys(wn(e))},set(e,t,r){let n=$g(wn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=zd(wn(e),t),i=o?.[dt];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(kb(r,o)&&(r!==void 0||Hi(e.base_,t)))return!0;Wd(e),Zd(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 zd(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Wd(e),Zd(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=wn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ye(11)},getPrototypeOf(e){return Pn(e.base_)},setPrototypeOf(){Ye(12)}},zi={};$i(np,(e,t)=>{zi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});zi.deleteProperty=function(e,t){return zi.set.call(this,e,t,void 0)};zi.set=function(e,t,r){return np.set.call(this,e[0],t,r,e[0])};function zd(e,t){let r=e[dt];return(r?wn(r):e)[t]}function Mb(e,t,r){let n=$g(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function $g(e,t){if(!(t in e))return;let r=Pn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Pn(r)}}function Zd(e){e.modified_||(e.modified_=!0,e.parent_&&Zd(e.parent_))}function Wd(e){e.copy_||(e.copy_=Yd(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Qb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let d=this;return function(m=i,...f){return d.produce(m,g=>r.call(this,g,...f))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let o;if(pt(t)){let i=Qg(this),d=ep(t,void 0),p=!0;try{o=r(d),p=!1}finally{p?Jd(i):Xd(i)}return Mg(i,n),Lg(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===tp&&(o=void 0),this.autoFreeze_&&ys(o,!0),n){let i=[],d=[];Tn("Patches").generateReplacementPatches_(t,o,i,d),n(i,d)}return o}else Ye(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(d,...p)=>this.produceWithPatches(d,m=>t(m,...p));let n,o;return[this.produce(t,r,(d,p)=>{n=d,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){pt(e)||Ye(8),Ct(e)&&(e=Hg(e));let t=Qg(this),r=ep(e,void 0);return r[dt].isManual_=!0,Xd(t),r}finishDraft(e,t){let r=e&&e[dt];(!r||!r.isManual_)&&Ye(9);let{scope_:n}=r;return Mg(n,t),Lg(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Tn("Patches").applyPatches_;return Ct(e)?n(e,t):this.produce(e,o=>n(o,t))}};function ep(e,t){let r=Wi(e)?Tn("MapSet").proxyMap_(e,t):Yi(e)?Tn("MapSet").proxySet_(e,t):Nb(e,t);return(t?t.scope_:jg()).drafts_.push(r),r}function Hg(e){return Ct(e)||Ye(10,e),Gg(e)}function Gg(e){if(!pt(e)||Ss(e))return e;let t=e[dt],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yd(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Yd(e,!0);return $i(r,(n,o)=>{Bg(r,n,Gg(o))}),t&&(t.finalized_=!1),r}function zg(){let t="replace",r="add",n="remove";function o(x,C,R,F){switch(x.type_){case 0:case 2:return d(x,C,R,F);case 1:return i(x,C,R,F);case 3:return p(x,C,R,F)}}function i(x,C,R,F){let{base_:v,assigned_:b}=x,P=x.copy_;P.length<v.length&&([v,P]=[P,v],[R,F]=[F,R]);for(let I=0;I<v.length;I++)if(b[I]&&P[I]!==v[I]){let T=C.concat([I]);R.push({op:t,path:T,value:A(P[I])}),F.push({op:t,path:T,value:A(v[I])})}for(let I=v.length;I<P.length;I++){let T=C.concat([I]);R.push({op:r,path:T,value:A(P[I])})}for(let I=P.length-1;v.length<=I;--I){let T=C.concat([I]);F.push({op:n,path:T})}}function d(x,C,R,F){let{base_:v,copy_:b}=x;$i(x.assigned_,(P,I)=>{let T=Gd(v,P),Q=Gd(b,P),D=I?Hi(v,P)?t:r:n;if(T===Q&&D===t)return;let k=C.concat(P);R.push(D===n?{op:D,path:k}:{op:D,path:k,value:Q}),F.push(D===r?{op:n,path:k}:D===n?{op:r,path:k,value:A(T)}:{op:t,path:k,value:A(T)})})}function p(x,C,R,F){let{base_:v,copy_:b}=x,P=0;v.forEach(I=>{if(!b.has(I)){let T=C.concat([P]);R.push({op:n,path:T,value:I}),F.unshift({op:r,path:T,value:I})}P++}),P=0,b.forEach(I=>{if(!v.has(I)){let T=C.concat([P]);R.push({op:r,path:T,value:I}),F.unshift({op:n,path:T,value:I})}P++})}function m(x,C,R,F){R.push({op:t,path:[],value:C===tp?void 0:C}),F.push({op:t,path:[],value:x})}function f(x,C){return C.forEach(R=>{let{path:F,op:v}=R,b=x;for(let Q=0;Q<F.length-1;Q++){let D=En(b),k=F[Q];typeof k!="string"&&typeof k!="number"&&(k=""+k),(D===0||D===1)&&(k==="__proto__"||k==="constructor")&&Ye(19),typeof b=="function"&&k==="prototype"&&Ye(19),b=Gd(b,k),typeof b!="object"&&Ye(18,F.join("/"))}let P=En(b),I=g(R.value),T=F[F.length-1];switch(v){case t:switch(P){case 2:return b.set(T,I);case 3:Ye(16);default:return b[T]=I}case r:switch(P){case 1:return T==="-"?b.push(I):b.splice(T,0,I);case 2:return b.set(T,I);case 3:return b.add(I);default:return b[T]=I}case n:switch(P){case 1:return b.splice(T,1);case 2:return b.delete(T);case 3:return b.delete(R.value);default:return delete b[T]}default:Ye(17,v)}}),x}function g(x){if(!pt(x))return x;if(Array.isArray(x))return x.map(g);if(Wi(x))return new Map(Array.from(x.entries()).map(([R,F])=>[R,g(F)]));if(Yi(x))return new Set(Array.from(x).map(g));let C=Object.create(Pn(x));for(let R in x)C[R]=g(x[R]);return Hi(x,ji)&&(C[ji]=x[ji]),C}function A(x){return Ct(x)?g(x):x}Ob("Patches",{applyPatches_:f,generatePatches_:o,generateReplacementPatches_:m})}var At=new Qb,Rr=At.produce,Cs=At.produceWithPatches.bind(At),ZQ=At.setAutoFreeze.bind(At),eL=At.setUseStrictShallowCopy.bind(At),op=At.applyPatches.bind(At),tL=At.createDraft.bind(At),rL=At.finishDraft.bind(At);l();s();u();c();function Lb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _b(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ub(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 Wg=e=>Array.isArray(e)?e:[e];function Bb(e){let t=Array.isArray(e[0])?e[0]:e;return Ub(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function jb(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var uL=Symbol();var lL=Object.getPrototypeOf({});var $b=class{constructor(e){this.value=e}deref(){return this.value}},Hb=typeof WeakRef<"u"?WeakRef:$b,Gb=0,Yg=1;function As(){return{s:Gb,v:void 0,o:null,p:null}}function uo(e,t={}){let r=As(),{resultEqualityCheck:n}=t,o,i=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 R=p.o;R===null&&(p.o=R=new WeakMap);let F=R.get(C);F===void 0?(p=As(),R.set(C,p)):p=F}else{let R=p.p;R===null&&(p.p=R=new Map);let F=R.get(C);F===void 0?(p=As(),R.set(C,p)):p=F}}let f=p,g;if(p.s===Yg)g=p.v;else if(g=e.apply(null,arguments),i++,n){let A=o?.deref?.()??o;A!=null&&n(A,g)&&(g=A,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new Hb(g):g}return f.s=Yg,f.v=g,g}return d.clearCache=()=>{r=As(),d.resetResultsCount()},d.resultsCount=()=>i,d.resetResultsCount=()=>{i=0},d}function Kg(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,d=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),Lb(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let g={...r,...m},{memoize:A,memoizeOptions:x=[],argsMemoize:C=uo,argsMemoizeOptions:R=[],devModeChecks:F={}}=g,v=Wg(x),b=Wg(R),P=Bb(o),I=A(function(){return i++,f.apply(null,arguments)},...v),T=!0,Q=C(function(){d++;let k=jb(P,arguments);return p=I.apply(null,k),p},...b);return Object.assign(Q,{resultFunc:f,memoizedResultFunc:I,dependencies:P,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:A,argsMemoize:C})};return Object.assign(n,{withTypes:()=>n}),n}var se=Kg(uo),zb=Object.assign((e,t=se)=>{_b(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>zb});l();s();u();c();function Jg(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Xg=Jg(),Zg=Jg;var Wb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?co:co.apply(null,arguments)},PL=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Yb=e=>e&&typeof e.match=="function";function w(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Qt(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>fs(n)&&n.type===e,r}var oh=class Ki extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ki.prototype)}static get[Symbol.species](){return Ki}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ki(...t[0].concat(this)):new Ki(...t.concat(this))}};function eh(e){return pt(e)?Rr(e,()=>{}):e}function th(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Kb(e){return typeof e=="boolean"}var Jb=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},d=new oh;return r&&(Kb(r)?d.push(Xg):d.push(Zg(r.extraArgument))),d},Ji="RTK_autoBatch",po=()=>e=>({payload:e,meta:{[Ji]:!0}}),rh=e=>t=>{setTimeout(t,e)},Xb=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:rh(10):e.type==="callback"?e.queueNotification:rh(e.timeout),f=()=>{d=!1,i&&(i=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let A=()=>o&&g(),x=n.subscribe(A);return p.add(g),()=>{x(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ji],i=!o,i&&(d||(d=!0,m(f))),n.dispatch(g)}finally{o=!0}}})},Zb=e=>function(r){let{autoBatch:n=!0}=r??{},o=new oh(e);return n&&o.push(Xb(typeof n=="object"?n:void 0)),o};function ih(e){let t=Jb(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(zt(r))p=so(r);else throw new Error(Qt(1));let m;typeof n=="function"?m=n(t):m=t();let f=co;o&&(f=Wb({trace:!1,...typeof o=="object"&&o}));let g=Ng(...m),A=Zb(g),x=typeof d=="function"?d(A):A(),C=f(...x);return Hd(p,i,C)}function ah(e){let t={},r=[],n,o={addCase(i,d){let p=typeof i=="string"?i:i.type;if(!p)throw new Error(Qt(28));if(p in t)throw new Error(Qt(29));return t[p]=d,o},addMatcher(i,d){return r.push({matcher:i,reducer:d}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function eI(e){return typeof e=="function"}function ie(e,t){let[r,n,o]=ah(t),i;if(eI(e))i=()=>eh(e());else{let p=eh(e);i=()=>p}function d(p=i(),m){let f=[r[m.type],...n.filter(({matcher:g})=>g(m)).map(({reducer:g})=>g)];return f.filter(g=>!!g).length===0&&(f=[o]),f.reduce((g,A)=>{if(A)if(Ct(g)){let C=A(g,m);return C===void 0?g:C}else{if(pt(g))return Rr(g,x=>A(x,m));{let x=A(g,m);if(x===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return g},p)}return d.getInitialState=i,d}var sh=(e,t)=>Yb(e)?e.match(t):e(t);function Wt(...e){return t=>e.some(r=>sh(r,t))}function lo(...e){return t=>e.every(r=>sh(r,t))}function Rs(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 Xi(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function vs(...e){return e.length===0?t=>Rs(t,["pending"]):Xi(e)?Wt(...e.map(t=>t.pending)):vs()(e[0])}function kn(...e){return e.length===0?t=>Rs(t,["rejected"]):Xi(e)?Wt(...e.map(t=>t.rejected)):kn()(e[0])}function Zi(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?lo(kn(...e),t):Xi(e)?lo(kn(...e),t):Zi()(e[0])}function vr(...e){return e.length===0?t=>Rs(t,["fulfilled"]):Xi(e)?Wt(...e.map(t=>t.fulfilled)):vr()(e[0])}function Fs(...e){return e.length===0?t=>Rs(t,["pending","fulfilled","rejected"]):Xi(e)?Wt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Fs()(e[0])}var tI="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",bs=(e=21)=>{let t="",r=e;for(;r--;)t+=tI[Math.random()*64|0];return t},rI=["name","message","stack","code"],ip=class{constructor(e,t){ve(this,"_type");this.payload=e,this.meta=t}},nh=class{constructor(e,t){ve(this,"_type");this.payload=e,this.meta=t}},nI=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of rI)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ee=(()=>{function e(t,r,n){let o=w(t+"/fulfilled",(m,f,g,A)=>({payload:m,meta:{...A||{},arg:g,requestId:f,requestStatus:"fulfilled"}})),i=w(t+"/pending",(m,f,g)=>({payload:void 0,meta:{...g||{},arg:f,requestId:m,requestStatus:"pending"}})),d=w(t+"/rejected",(m,f,g,A,x)=>({payload:A,error:(n&&n.serializeError||nI)(m||"Rejected"),meta:{...x||{},arg:g,requestId:f,rejectedWithValue:!!A,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,g,A)=>{let x=n?.idGenerator?n.idGenerator(m):bs(),C=new a.AbortController,R,F;function v(P){F=P,C.abort()}let b=async function(){let P;try{let T=n?.condition?.(m,{getState:g,extra:A});if(iI(T)&&(T=await T),T===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let Q=new Promise((D,k)=>{R=()=>{k({name:"AbortError",message:F||"Aborted"})},C.signal.addEventListener("abort",R)});f(i(x,m,n?.getPendingMeta?.({requestId:x,arg:m},{getState:g,extra:A}))),P=await Promise.race([Q,Promise.resolve(r(m,{dispatch:f,getState:g,extra:A,requestId:x,signal:C.signal,abort:v,rejectWithValue:(D,k)=>new ip(D,k),fulfillWithValue:(D,k)=>new nh(D,k)})).then(D=>{if(D instanceof ip)throw D;return D instanceof nh?o(D.payload,x,m,D.meta):o(D,x,m)})])}catch(T){P=T instanceof ip?d(null,x,m,T.payload,T.meta):d(T,x,m)}finally{R&&C.signal.removeEventListener("abort",R)}return n&&!n.dispatchConditionRejection&&d.match(P)&&P.meta.condition||f(P),P}();return Object.assign(b,{abort:v,requestId:x,arg:m,unwrap(){return b.then(oI)}})}}return Object.assign(p,{pending:i,rejected:d,fulfilled:o,settled:Wt(d,o),typePrefix:t})}return e.withTypes=()=>e,e})();function oI(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function iI(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var ch=Symbol.for("rtk-slice-createasyncthunk"),OL={[ch]:ee};function aI(e,t){return`${e}/${t}`}function sI({creators:e}={}){let t=e?.asyncThunk?.[ch];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(Qt(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(uI()):n.reducers)||{},p=Object.keys(d),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(P,I){let T=typeof P=="string"?P:P.type;if(!T)throw new Error(Qt(12));if(T in m.sliceCaseReducersByType)throw new Error(Qt(13));return m.sliceCaseReducersByType[T]=I,f},addMatcher(P,I){return m.sliceMatchers.push({matcher:P,reducer:I}),f},exposeAction(P,I){return m.actionCreators[P]=I,f},exposeCaseReducer(P,I){return m.sliceCaseReducersByName[P]=I,f}};p.forEach(P=>{let I=d[P],T={reducerName:P,type:aI(o,P),createNotation:typeof n.reducers=="function"};dI(I)?mI(T,I,f,t):lI(T,I,f)});function g(){let[P={},I=[],T=void 0]=typeof n.extraReducers=="function"?ah(n.extraReducers):[n.extraReducers],Q={...P,...m.sliceCaseReducersByType};return ie(n.initialState,D=>{for(let k in Q)D.addCase(k,Q[k]);for(let k of m.sliceMatchers)D.addMatcher(k.matcher,k.reducer);for(let k of I)D.addMatcher(k.matcher,k.reducer);T&&D.addDefaultCase(T)})}let A=P=>P,x=new Map,C;function R(P,I){return C||(C=g()),C(P,I)}function F(){return C||(C=g()),C.getInitialState()}function v(P,I=!1){function T(D){let k=D[P];return typeof k>"u"&&I&&(k=F()),k}function Q(D=A){let k=th(x,I,()=>new WeakMap);return th(k,D,()=>{let O={};for(let[V,L]of Object.entries(n.selectors??{}))O[V]=cI(L,D,F,I);return O})}return{reducerPath:P,getSelectors:Q,get selectors(){return Q(T)},selectSlice:T}}let b={name:o,reducer:R,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:F,...v(i),injectInto(P,{reducerPath:I,...T}={}){let Q=I??i;return P.inject({reducerPath:Q,reducer:R},T),{...b,...v(Q,!0)}}};return b}}function cI(e,t,r,n){function o(i,...d){let p=t(i);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return o.unwrapped=e,o}var qn=sI();function uI(){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 lI({type:e,reducerName:t,createNotation:r},n,o){let i,d;if("reducer"in n){if(r&&!pI(n))throw new Error(Qt(17));i=n.reducer,d=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,d?w(e,d):w(e))}function dI(e){return e._reducerDefinitionType==="asyncThunk"}function pI(e){return e._reducerDefinitionType==="reducerWithPrepare"}function mI({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Qt(18));let{payloadCreator:i,fulfilled:d,pending:p,rejected:m,settled:f,options:g}=r,A=o(e,i,g);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||xs,pending:p||xs,rejected:m||xs,settled:f||xs})}function xs(){}var uh="listener",lh="completed",dh="cancelled",DL=`task-${dh}`,VL=`task-${lh}`,NL=`${uh}-${dh}`,ML=`${uh}-${lh}`;var{assign:ph}=Object;var ap="listenerMiddleware";var fI=ph(w(`${ap}/add`),{withTypes:()=>fI}),QL=w(`${ap}/removeAll`),gI=ph(w(`${ap}/remove`),{withTypes:()=>gI});var LL=Symbol.for("rtk-state-proxy-original");function Qt(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 mh=/^(?:[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 hI(e){return typeof e=="string"&&mh.test(e)}var sp=hI;l();s();u();c();var Ke=[];for(let e=0;e<256;++e)Ke.push((e+256).toString(16).slice(1));function fh(e,t=0){return(Ke[e[t+0]]+Ke[e[t+1]]+Ke[e[t+2]]+Ke[e[t+3]]+"-"+Ke[e[t+4]]+Ke[e[t+5]]+"-"+Ke[e[t+6]]+Ke[e[t+7]]+"-"+Ke[e[t+8]]+Ke[e[t+9]]+"-"+Ke[e[t+10]]+Ke[e[t+11]]+Ke[e[t+12]]+Ke[e[t+13]]+Ke[e[t+14]]+Ke[e[t+15]]).toLowerCase()}l();s();u();c();var cp,yI=new Uint8Array(16);function up(){if(!cp){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");cp=crypto.getRandomValues.bind(crypto)}return cp(yI)}l();s();u();c();l();s();u();c();var SI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lp={randomUUID:SI};function CI(e,t,r){if(lp.randomUUID&&!t&&!e)return lp.randomUUID();e=e||{};let n=e.random??e.rng?.()??up();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return fh(n)}var dp=CI;l();s();u();c();function gh(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function AI({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(o,i,r))}var hh="visitorId";function xI(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(hh),o=n&&sp(n)?n:t.generateUUID();return r.setItem(hh,o),o}}}var Sh="1.2.1";function RI(e){let{trackingId:t}=e;return{trackingId:t}}function vI(e){return(e.source||[]).concat([`relay@${Sh}`])}function Ch(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:d}=r,p=RI(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:vI(t),clientId:m,userAgent:d(),referrer:o(),location:i()})}function FI(e,t,r,n,o){return{...t,meta:Ch(e,r,n,o)}}var bI="*";function II(){let e=[];function t({type:m,callback:f}){return e.findIndex(g=>g.type===m&&g.callback===f)}function r(m,f){return m.type==="*"||f===m.type}function n(m){return t(m)<0&&e.push(m),()=>p(m.type,m.callback)}function o(m){e.forEach(f=>{if(r(f,m.meta.type))try{f.callback(m)}catch(g){console.error(g)}})}function i(m){if(m===bI)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}):i(m)}return{add:n,call:o,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 wI(e){let t=yh(e);return{get:()=>t,update:r=>{t=yh({...t,...r})}}}var pp=PI();function PI(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let d=i.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function EI(){return{getItem(e){return pp.getItem(e)||localStorage.getItem(e)},removeItem(e){pp.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),pp.setItem(e,t,31556952e3)}}}function TI(){let e=document.referrer;return e===""?null:e}function kI(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(gh().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:()=>TI(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>dp(),storage:EI()}}function qI(){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 OI(){return{getItem(){return null},removeItem(){},setItem(){}}}function DI(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:OI()}}function VI(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=DI();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&NI()&&qI()?kI():n}function NI(){try{return typeof window=="object"}catch{return!1}}function MI(e){return{get:()=>Object.freeze(VI(e))}}function Ah(e){let t=wI(e),r=II(),n=MI(t),o=xI(n);return{emit:(i,d)=>{let p=t.get(),m=n.get(),f=FI(i,d,p,m,o);return AI({config:p,environment:m,event:f,listenerManager:r})},getMeta:i=>Ch(i,t.get(),n.get(),o),on:(i,d)=>r.add({type:i,callback:d}),off:(i,d)=>r.remove(i,d),updateConfig:i=>t.update(i),version:Sh}}l();s();u();c();l();s();u();c();var mo="3.27.2",xh=["@coveo/atomic","@coveo/quantic"];var Qr=se(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${mo}`));var fo=se(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Qr(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},d)=>Ah({mode:i?"emit":"disabled",url:o??ls(e,t),token:r,trackingId:n??null,source:d}));l();s();u();c();l();s();u();c();function Yt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function N(e,t,r,n){function o(i){return i instanceof r?i:new r(function(d){d(i)})}return new(r||(r=Promise))(function(i,d){function p(g){try{f(n.next(g))}catch(A){d(A)}}function m(g){try{f(n.throw(g))}catch(A){d(A)}}function f(g){g.done?i(g.value):o(g.value).then(p,m)}f((n=n.apply(e,t||[])).next())})}var Ce;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ce||(Ce={}));function gp(){return typeof window<"u"}function Ep(){return typeof navigator<"u"}function go(){return typeof document<"u"}function hp(){try{return typeof localStorage<"u"}catch{return!1}}function QI(){try{return typeof sessionStorage<"u"}catch{return!1}}function Dh(){return Ep()&&navigator.cookieEnabled}var LI=[Ce.click,Ce.custom,Ce.search,Ce.view],_I=(e,t)=>LI.indexOf(e)!==-1?Object.assign({language:go()?document.documentElement.lang:"unknown",userAgent:Ep()?navigator.userAgent:"unknown"},t):t,ta=class e{static set(t,r,n){var o,i,d,p;n&&(i=new Date,i.setTime(i.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Rh(t,r,i):(d=p.split("."),o=d[d.length-2]+"."+d[d.length-1],Rh(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Rh(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function UI(){return hp()?localStorage:Dh()?new ra:QI()?sessionStorage:new yo}var ra=class e{getItem(t){return ta.get(`${e.prefix}${t}`)}removeItem(t){ta.erase(`${e.prefix}${t}`)}setItem(t,r,n){ta.set(`${e.prefix}${t}`,r,n)}};ra.prefix="coveo_";var yp=class{constructor(){this.cookieStorage=new ra}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)}},yo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Is="__coveo.analytics.history",BI=20,jI=1e3*60,$I=75,Es=class{constructor(t){this.store=t||UI()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return N(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return N(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Is);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return N(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Is);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Is,JSON.stringify(t.slice(0,BI)))}catch{}}clear(){try{this.store.removeItem(Is)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,$I)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>jI:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var HI=(e,t)=>N(void 0,void 0,void 0,function*(){return e===Ce.view?(yield GI(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),GI=e=>N(void 0,void 0,void 0,function*(){let t=new Es,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),ws,zI=new Uint8Array(16);function WI(){if(!ws&&(ws=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ws))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ws(zI)}var YI=/^(?:[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 Ts(e){return typeof e=="string"&&YI.test(e)}var Je=[];for(let e=0;e<256;++e)Je.push((e+256).toString(16).slice(1));function Vh(e,t=0){return(Je[e[t+0]]+Je[e[t+1]]+Je[e[t+2]]+Je[e[t+3]]+"-"+Je[e[t+4]]+Je[e[t+5]]+"-"+Je[e[t+6]]+Je[e[t+7]]+"-"+Je[e[t+8]]+Je[e[t+9]]+"-"+Je[e[t+10]]+Je[e[t+11]]+Je[e[t+12]]+Je[e[t+13]]+Je[e[t+14]]+Je[e[t+15]]).toLowerCase()}function KI(e){if(!Ts(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 JI(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var XI="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ZI="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function ew(e,t,r){function n(o,i,d,p){var m;if(typeof o=="string"&&(o=JI(o)),typeof i=="string"&&(i=KI(i)),((m=i)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(i),f.set(o,i.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let g=0;g<16;++g)d[p+g]=f[g];return d}return Vh(f)}try{n.name=e}catch{}return n.DNS=XI,n.URL=ZI,n}var tw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vh={randomUUID:tw};function On(e,t,r){if(vh.randomUUID&&!t&&!e)return vh.randomUUID();e=e||{};let n=e.random||(e.rng||WI)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Vh(n)}function rw(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 mp(e,t){return e<<t|e>>>32-t}function nw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let d=unescape(encodeURIComponent(e));e=[];for(let p=0;p<d.length;++p)e.push(d.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let d=0;d<o;++d){let p=new Uint32Array(16);for(let m=0;m<16;++m)p[m]=e[d*64+m*4]<<24|e[d*64+m*4+1]<<16|e[d*64+m*4+2]<<8|e[d*64+m*4+3];i[d]=p}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<o;++d){let p=new Uint32Array(80);for(let C=0;C<16;++C)p[C]=i[d][C];for(let C=16;C<80;++C)p[C]=mp(p[C-3]^p[C-8]^p[C-14]^p[C-16],1);let m=r[0],f=r[1],g=r[2],A=r[3],x=r[4];for(let C=0;C<80;++C){let R=Math.floor(C/20),F=mp(m,5)+rw(R,f,g,A)+x+t[R]+p[C]>>>0;x=A,A=g,g=mp(f,30)>>>0,f=m,m=F}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+g>>>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 ow=ew("v5",80,nw),Fh=ow,Nh="2.30.45",bh=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,ea={pageview:"pageview",event:"event"},ks=class{constructor({client:t,uuidGenerator:r=On}){this.client=t,this.uuidGenerator=r}},Sp=class extends ks{constructor({client:t,uuidGenerator:r=On}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=bh(window.location),this.lastReferrer=go()?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:go()?document.title:"",encoding:go()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===ea.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===ea.pageview?this.nextPageViewId:this.pageViewId,referrer:t===ea.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===ea.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return bh(window.location)}},Lr=class e{constructor(t,r){if(!Ts(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Ts(i)?new e(i,Number.parseInt(o)*1e3):null}};Lr.cvo_cid="cvo_cid";Lr.expirationTime=120;var Cp=class extends ks{constructor({client:t,uuidGenerator:r=On}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return N(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Lr.cvo_cid,new Lr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Cp.Id="link";var Pt=Object.keys;function Ps(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var fp=128,Mh=192,Ih=224,wh=240;function iw(e){return(e&248)===wh?4:(e&wh)===Ih?3:(e&Ih)===Mh?2:1}function aw(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&fp)!=fp)break;if(r-=3,(n&Mh)!=fp){t-r>=iw(n)*3&&(r=t);break}}return e.substring(0,r)}var Ap={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"},sw=Pt(Ap).map(e=>Ap[e]),cw=[...sw].join("|"),uw=new RegExp(`^(${cw}$)`),lw={svcAction:"svc_action",svcActionData:"svc_action_data"},dw=e=>Pt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ap[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),pw=e=>uw.test(e),mw=[pw],Ph={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Eh={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},et={action:"pa",list:"pal",listSource:"pls"},qs={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},fw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],xp={id:"quoteId",affiliation:"quoteAffiliation"},Rp={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},gw={add:et,bookmark_add:et,bookmark_remove:et,click:et,checkout:et,checkout_option:et,detail:et,impression:et,remove:et,refund:Object.assign(Object.assign({},et),qs),purchase:Object.assign(Object.assign({},et),qs),quickview:et,quote:Object.assign(Object.assign({},et),xp),review:Object.assign(Object.assign({},et),Rp)},hw=Pt(Ph).map(e=>Ph[e]),yw=Pt(Eh).map(e=>Eh[e]),Sw=Pt(et).map(e=>et[e]),Cw=Pt(qs).map(e=>qs[e]),Aw=Pt(Rp).map(e=>Rp[e]),xw=Pt(xp).map(e=>xp[e]),Rw=[...hw,"custom"].join("|"),vw=[...yw,"custom"].join("|"),Qh="(pr[0-9]+)",Lh="(il[0-9]+pi[0-9]+)",Fw=new RegExp(`^${Qh}(${Rw})$`),bw=new RegExp(`^(${Lh}(${vw}))|(il[0-9]+nm)$`),Iw=new RegExp(`^(${Sw.join("|")})$`),ww=new RegExp(`^(${Cw.join("|")})$`),Pw=new RegExp(`^${Qh}custom$`),Ew=new RegExp(`^${Lh}custom$`),Tw=new RegExp(`^(${[...fw,...Aw,...xw].join("|")})$`),kw=e=>Fw.test(e),qw=e=>bw.test(e),Ow=e=>Iw.test(e),Dw=e=>ww.test(e),Vw=e=>Tw.test(e),Nw=[qw,kw,Ow,Dw,Vw],Mw=[Pw,Ew],Qw={anonymizeIp:"aip"},Lw={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},_w={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Uw=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Bw=Object.assign(Object.assign(Object.assign(Object.assign({},Qw),Lw),_w),Uw.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),vp=Object.assign(Object.assign({},Bw),lw),jw=e=>{let t=!!e.action&&gw[e.action]||{};return Pt(e).reduce((r,n)=>{let o=t[n]||vp[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},$w=Pt(vp).map(e=>vp[e]),Hw=e=>$w.indexOf(e)!==-1,Gw=e=>e==="custom",zw=e=>[...Nw,...mw,Hw,Gw].some(t=>t(e)),Ww=e=>Pt(e).reduce((t,r)=>{let n=Yw(r);return n?Object.assign(Object.assign({},t),Kw(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Yw=e=>{let t;return[...Mw].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Kw=(e,t)=>Pt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Fp=class{constructor(t){this.opts=t}sendEvent(t,r){return N(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(d,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return N(this,void 0,void 0,function*(){let o=t,i=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;o=p||t;try{i=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return N(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[Ce.click,Ce.custom,Ce.search,Ce.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},bp=class{sendEvent(t,r){return N(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return N(this,void 0,void 0,function*(){return Promise.resolve()})}},Th=h.fetch,Os=class{constructor(t){this.opts=t}sendEvent(t,r){return N(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=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),i?yield i(p,"analyticsFetch"):{}),{url:f}=m,g=Yt(m,["url"]),A;try{A=yield Th(f,g)}catch(x){console.error("An error has occured when sending the event.",x);return}if(A.ok){let x=yield A.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}else{try{A.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,A,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return N(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Th(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ce.click,Ce.custom,Ce.search,Ce.view].indexOf(t)!==-1}getVisitorIdParam(){return N(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Ip=class{constructor(t,r){hp()&&Dh()?this.storage=new yp:hp()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new yo),this.client=new Os(t),this.beaconClient=new Fp(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},wp=class{constructor(t,r){this.storage=r||new yo,this.client=new Os(t)}getClientDependingOnEventType(t){return this.client}},Ds=class{constructor(){this.storage=new yo,this.client=new bp}getClientDependingOnEventType(t){return this.client}},Jw="xx",Xw=e=>e?.startsWith(Jw)||!1,Zw=`
29
29
  We've detected you're using React Native but have not provided the corresponding runtime,
30
30
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
31
31
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native