@coveo/headless 3.27.6-pre.a09bdf627b → 3.27.6-pre.a6711533d8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/case-assist/headless.cjs +1 -1
- package/dist/cjs/commerce/headless.cjs +1 -1
- package/dist/cjs/headless.cjs +1 -1
- package/dist/cjs/insight/headless.cjs +1 -1
- package/dist/cjs/recommendation/headless.cjs +1 -1
- package/dist/cjs/ssr/headless.cjs +1 -1
- package/dist/cjs/ssr-commerce/headless.cjs +1 -1
- package/dist/esm/utils/version.js +1 -1
- package/dist/quantic/case-assist/headless.js +1 -1
- package/dist/quantic/commerce/headless.js +1 -1
- package/dist/quantic/headless.js +1 -1
- package/dist/quantic/insight/headless.js +1 -1
- package/dist/quantic/recommendation/headless.js +1 -1
- 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 xn(r)}var xn=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 a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw wb(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 Zn(e){return e===void 0}function Pb(e){return e===null}function K(e){return Zn(e)||Pb(e)}var ae=class{constructor(e={}){Re(this,"value");this.value=new Ie(e)}validate(e){let t=this.value.validate(e);return t||(Eb(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Eb(e){return Zn(e)||Kf(e)}function Kf(e){return typeof e=="boolean"}var Z=class{constructor(e={}){Re(this,"value");this.config=e,this.value=new Ie(e)}validate(e){let t=this.value.validate(e);return t||(Tb(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 Tb(e){return Zn(e)||Jf(e)}function Jf(e){return typeof e=="number"&&!Number.isNaN(e)}var qb=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,N=class{constructor(e={}){Re(this,"value");Re(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:a}=this.config,d=this.value.validate(e);if(d)return d;if(Zn(e))return null;if(!eo(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(qb.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 eo(e){return Object.prototype.toString.call(e)==="[object String]"}var U=class{constructor(e={}){Re(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Zn(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Xf(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],a=n.validate(o);a!==null&&(t+=` ${a}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Xf(e){return e!==void 0&&typeof e=="object"}var te=class{constructor(e={}){Re(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)||eo(e)||Jf(e)||Xf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function to(e){return Array.isArray(e)}var jr=class{constructor(e){Re(this,"value");this.config=e,this.value=new Ie(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Zn(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 Ji=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function Xi(e){return Array.isArray(e)}function Zi(e){return e.trim()===""}function Zf(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function kb(e){return btoa(encodeURI(e))}function es(e,t){let{[e]:r,...n}=t;return n}function ro(e){return kb(JSON.stringify(e))}var Ob=new Set(["1",1,"yes",!0]);function eg(){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=>Ob.has(r))}function tg(e){let t={};for(let[r,n]of e)t[r]=n;return t}function rg(e,t,r){return clearTimeout(t),setTimeout(e,r)}function ja(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Db(e){if(Zi(e.openingDelimiter)||Zi(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(K(e.content)||Zi(e.content))return e.content;if(e.highlights.length===0)return no(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],d=a.offset,p=d+a.length;if(p>t)break;r+=no(e.content.slice(n,d)),r+=e.openingDelimiter,r+=no(e.content.slice(d,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=no(e.content.slice(n))),r}function bd(e,t){return e=no(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?Rd(n,t.notMatchDelimiters):o?Rd(o,t.exactMatchDelimiters):a?Rd(a,t.correctionDelimiters):r)}function Rd(e,t){return t?t.open+e+t.close:e}function no(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}l();s();u();c();l();s();u();c();l();s();u();c();l();s();u();c();async function og(e,t){let r=e.getReader(),n;for(;!(n=await r.read()).done;)t(n.value)}function ag(e){let t,r,n,o=!1;return function(d){t===void 0?(t=d,r=0,n=-1):t=Vb(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=ng(),o=new TextDecoder;return function(d,p){if(d.length===0)r?.(n),n=ng();else if(p>0){let m=o.decode(d.subarray(0,p)),f=p+(d[p+1]===32?2:1),y=o.decode(d.subarray(f));switch(m){case"data":n.data=n.data?`${n.data}
|
|
28
|
-
${y}`:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":jb(y,n,t);break}}}}function jb(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function Vb(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function ng(){return{data:"",event:"",id:"",retry:void 0}}var Id="text/event-stream",Nb=1e3,sg="last-event-id";function cg(){return typeof window<"u"}function ts(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:d,openWhenHidden:p,fetch:m,...f}){return new Promise((y,A)=>{let v={...r};v.accept||(v.accept=Id);let C;function x(){C?.abort(),document.hidden||T()}!p&&cg()&&document.addEventListener("visibilitychange",x);let b=Nb,R;function F(){cg()&&document.removeEventListener("visibilitychange",x),clearTimeout(R),C?.abort()}t?.addEventListener("abort",()=>{F(),y()});let P=m??h,I=n??Mb;async function T(){C=i.AbortController?new i.AbortController:null;try{let M=await P(e,{...f,headers:v,signal:C?.signal});await I(M),await og(M.body,ag(ig(D=>{D?v[sg]=D:delete v[sg]},D=>{b=D},o))),a?.(),F(),y()}catch(M){if(!C?.signal?.aborted)try{let D=d?.(M)??b;clearTimeout(R),R=setTimeout(T,D)}catch(D){F(),A(D)}}}T()})}function Mb(e){let t=e.headers.get("content-type");if(!t?.startsWith(Id))throw new Error(`Expected content-type to be ${Id}, Actual: ${t}`)}l();s();u();c();var Vr=class{constructor(t){Re(this,"_basePath");Re(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 Lb=(e,t,r)=>new Vr(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,ug=3,Qb=5e3,_b="text/event-stream",Ed=1,wd=class extends Error{},Va=class extends Error{constructor(r){super(r.message);this.payload=r}},Pd=class{constructor(){Re(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)}},rs=class{constructor(t){Re(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:y}=r,A=new Pd;if(!a){this.logger.error("No stream ID found");return}let v=0,C,x=()=>{C&&!A.isActive(C)&&(R?.abort(),y(),F())},b=()=>{A.remove(C),C=rg(x,C,Qb),A.add(C)},R=new i.AbortController,F=()=>ts(Lb(n,o,a),{method:"GET",fetch:h,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:R?.signal,async onopen(P){if(P.ok&&P.headers.get("content-type")===_b)return;throw P.status>=400&&P.status<500&&P.status!==429?new Va({message:"Error opening stream",code:P.status}):new wd},onmessage:P=>{if(R?.signal.aborted)return;let I=JSON.parse(P.data);if(I.finishReason==="ERROR"){A.remove(C),R?.abort(),m({message:I.errorMessage,code:I.statusCode});return}p(I),v=0,I.finishReason==="COMPLETED"?(A.remove(C),f()):b()},onerror:P=>{if(!R?.signal.aborted){if(A.remove(C),P instanceof Va)throw R?.abort(),m(P),P;if(++v>ug){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Ed};throw R?.abort(),m(I),new Va(I)}this.logger.info(`Retrying...(${v}/${ug})`),y()}}});return F(),R}};l();s();u();c();var ns=e=>e;l();s();u();c();l();s();u();c();var vg=Dt(hg(),1);l();s();u();c();l();s();u();c();var mF="recommendation-internal-options",IN=Symbol.for(mF);var re=new Error("Failed to load reducers."),oo=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();Re(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 Sg(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Cg(e){return typeof e!="object"||!e?!1:Object.values(e).every(fF)}function fF(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Ag(e){return e===429}var jt=class e{static async call(t){let r=gF(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...d}=o,p=async()=>{let m=await h(a,d);if(Ag(m.status))throw m;return m};try{let m=await(0,vg.backOff)(p,{retry:f=>{let y=f&&Ag(f.status);return y&&n.info("Platform retrying request"),y}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new oo;case 404:throw new bn(a,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new bn(a):m}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:d}=r,{signal:p,...m}=t,f=ja(m);try{let y=await o(t,n,d);return{...t,...y}}catch(y){a.error(y,"Platform request preprocessing failed. Returning default request options.")}return f}};function qe(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ct(e,t="prod"){return`${qe(e,t)}/rest/search/v2`}function as(e,t="prod"){return`${qe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function gF(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=yF(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...p&&{body:m},signal:d}}function yF(e,t){return t==="application/x-www-form-urlencoded"?Cg(e)?Sg(e):"":JSON.stringify(e)}l();s();u();c();l();s();u();c();function La(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var Md=e=>{let{response:t}=e;return t.body?hF(e):SF(t)},hF=e=>AF(e)?vF(e):CF(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},SF=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function CF(e){return e.body.statusCode!==void 0}function AF(e){return e.body.exception!==void 0}var vF=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 Ld=(e,t,r,n)=>{let o=new Vr(`${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 Vr(`${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},Qd=async(e,t)=>{let r=await jt.call({...Ld(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:La(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 xF(d)?{success:d}:{error:Md({response:r,body:d})}};function xF(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 Be(){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 RF(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function bF(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Fn(e,t){if(t&&e.name==="AbortError")return{error:bF(e)};if(e instanceof bn)return{error:RF(e)};throw e}var Nr=e=>e.success!==void 0,we=e=>e.error!==void 0;function bg(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 _d=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,FF=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,Qa=(e,t,r,n)=>{IF(e);let o=_d(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},Ig=(e,t,r)=>{wF(e);let n=FF(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},Ud=e=>{let{insightId:t,...r}=La(e);return r},wg=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},IF=e=>{if(wg(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},wF=e=>{if(wg(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var Pg=e=>({...Qa(e,"GET","application/json","/interface"),requestParams:{}});l();s();u();c();var Eg=e=>({...Qa(e,"POST","application/json","/search"),requestParams:Ud(e)}),Tg=e=>({...Qa(e,"POST","application/json","/querysuggest"),requestParams:Ud(e)});l();s();u();c();var qg=e=>({...Ig(e,"POST","application/json"),requestParams:{objectId:e.userId}});var is=class{constructor(t){this.options=t}async getInterface(t){let r=await jt.call({...Pg(t),...this.options});if(r instanceof Error)return Fn(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async query(t,r){let n=await jt.call({...Eg(t),requestMetadata:{method:"search",origin:r?.origin},...this.options});if(n instanceof Error)return Fn(n);let o=await n.json();return bg(o)&&(o=Fg(o)),n.ok?{success:o}:{error:o}}async querySuggest(t){let r=await jt.call({...Tg(t),...this.options});if(r instanceof Error)return Fn(r);let n=await r.json();return n.completions?{success:n}:{error:n}}async userActions(t){let r=await jt.call({...qg(t),...this.options});if(r instanceof Error)return Fn(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async html(t){return Qd(t,{...this.options})}};l();s();u();c();l();s();u();c();var B=new N({required:!0,emptyAllowed:!1}),be=new N({required:!1,emptyAllowed:!1}),Pe=new N({required:!0,emptyAllowed:!0}),kg=new N({required:!1,emptyAllowed:!0}),ss=new te({each:B,required:!0}),Og=new N({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Dg=new N({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Q0=new N({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Vt=({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 U({options:{required:!0},values:t}).validate(e);if(o)throw new xn(o);return{payload:e}},E=(e,t)=>{try{return It(e,t)}catch(r){return{payload:e,error:Vt(r)}}},Ht=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return jg(e,t,r,o,"Controller initialization error")},$e=(e,t,r,n)=>{let o=`Check the options of ${n}`;return jg(e,t,r,o,"Controller initialization error")},jg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};l();s();u();c();l();s();u();c();l();s();u();c();function 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 PF=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vg=PF,Bd=()=>Math.random().toString(36).substring(7).split("").join("."),EF={INIT:`@@redux/INIT${Bd()}`,REPLACE:`@@redux/REPLACE${Bd()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bd()}`},cs=EF;function Gt(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 $d(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($d)(e,t)}let n=e,o=t,a=new Map,d=a,p=0,m=!1;function f(){d===a&&(d=new Map,a.forEach((R,F)=>{d.set(F,R)}))}function y(){if(m)throw new Error(We(3));return o}function A(R){if(typeof R!="function")throw new Error(We(4));if(m)throw new Error(We(5));let F=!0;f();let P=p++;return d.set(P,R),function(){if(F){if(m)throw new Error(We(6));F=!1,f(),d.delete(P),a=null}}}function v(R){if(!Gt(R))throw new Error(We(7));if(typeof R.type>"u")throw new Error(We(8));if(typeof R.type!="string")throw new Error(We(17));if(m)throw new Error(We(9));try{m=!0,o=n(o,R)}finally{m=!1}return(a=d).forEach(P=>{P()}),R}function C(R){if(typeof R!="function")throw new Error(We(10));n=R,v({type:cs.REPLACE})}function x(){let R=A;return{subscribe(F){if(typeof F!="object"||F===null)throw new Error(We(11));function P(){let T=F;T.next&&T.next(y())}return P(),{unsubscribe:R(P)}},[Vg](){return this}}}return v({type:cs.INIT}),{dispatch:v,subscribe:A,getState:y,replaceReducer:C,[Vg]:x}}function TF(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:cs.INIT})>"u")throw new Error(We(12));if(typeof r(void 0,{type:cs.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(We(13))})}function io(e){let t=Object.keys(e),r={};for(let d=0;d<t.length;d++){let p=t[d];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{TF(r)}catch(d){a=d}return function(p={},m){if(a)throw a;let f=!1,y={};for(let A=0;A<n.length;A++){let v=n[A],C=r[v],x=p[v],b=C(x,m);if(typeof b>"u"){let R=m&&m.type;throw new Error(We(14))}y[v]=b,f=f||b!==x}return f=f||n.length!==Object.keys(p).length,f?y:p}}function so(...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),a=()=>{throw new Error(We(15))},d={getState:o.getState,dispatch:(m,...f)=>a(m,...f)},p=e.map(m=>m(d));return a=so(...p)(o.dispatch),{...o,dispatch:a}}}function us(e){return Gt(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var ep=Symbol.for("immer-nothing"),_a=Symbol.for("immer-draftable"),ut=Symbol.for("immer-state");function Ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wn=Object.getPrototypeOf;function St(e){return!!e&&!!e[ut]}function lt(e){return e?Ug(e)||Array.isArray(e)||!!e[_a]||!!e.constructor?.[_a]||Ga(e)||za(e):!1}var qF=Object.prototype.constructor.toString();function Ug(e){if(!e||typeof e!="object")return!1;let t=wn(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)===qF}function tp(e){return St(e)||Ye(15,e),e[ut].base_}function Ua(e,t){Pn(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Pn(e){let t=e[ut];return t?t.type_:Array.isArray(e)?1:Ga(e)?2:za(e)?3:0}function Ba(e,t){return Pn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Hd(e,t){return Pn(e)===2?e.get(t):e[t]}function Bg(e,t,r){let n=Pn(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function kF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ga(e){return e instanceof Map}function za(e){return e instanceof Set}function In(e){return e.copy_||e.base_}function Wd(e,t){if(Ga(e))return new Map(e);if(za(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[ut];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let d=o[a],p=n[d];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[d]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[d]})}return Object.create(wn(e),n)}else{let n=wn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function ps(e,t=!1){return ms(e)||St(e)||!lt(e)||(Pn(e)>1&&(e.set=e.add=e.clear=e.delete=OF),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>ps(n,!0))),e}function OF(){Ye(2)}function ms(e){return Object.isFrozen(e)}var Yd={};function En(e){let t=Yd[e];return t||Ye(0,e),t}function DF(e,t){Yd[e]||(Yd[e]=t)}var $a;function $g(){return $a}function jF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Mg(e,t){t&&(En("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Kd(e){Jd(e),e.drafts_.forEach(VF),e.drafts_=null}function Jd(e){e===$a&&($a=e.parent_)}function Lg(e){return $a=jF($a,e)}function VF(e){let t=e[ut];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Qg(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ut].modified_&&(Kd(t),Ye(4)),lt(e)&&(e=ls(t,e),t.parent_||ds(t,e)),t.patches_&&En("Patches").generateReplacementPatches_(r[ut].base_,e,t.patches_,t.inversePatches_)):e=ls(t,r,[]),Kd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ep?e:void 0}function ls(e,t,r){if(ms(t))return t;let n=t[ut];if(!n)return Ua(t,(o,a)=>_g(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return ds(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,d=!1;n.type_===3&&(a=new Set(o),o.clear(),d=!0),Ua(a,(p,m)=>_g(e,n,o,p,m,r,d)),ds(e,o,!1),r&&e.patches_&&En("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function _g(e,t,r,n,o,a,d){if(St(o)){let p=a&&t&&t.type_!==3&&!Ba(t.assigned_,n)?a.concat(n):void 0,m=ls(e,o,p);if(Bg(r,n,m),St(m))e.canAutoFreeze_=!1;else return}else d&&r.add(o);if(lt(o)&&!ms(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ls(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&ds(e,o)}}function ds(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ps(t,r)}function NF(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:$g(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=rp;r&&(o=[n],a=Ha);let{revoke:d,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=d,p}var rp={get(e,t){if(t===ut)return e;let r=In(e);if(!Ba(r,t))return MF(e,r,t);let n=r[t];return e.finalized_||!lt(n)?n:n===Gd(e.base_,t)?(zd(e),e.copy_[t]=Zd(n,e)):n},has(e,t){return t in In(e)},ownKeys(e){return Reflect.ownKeys(In(e))},set(e,t,r){let n=Hg(In(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Gd(In(e),t),a=o?.[ut];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(kF(r,o)&&(r!==void 0||Ba(e.base_,t)))return!0;zd(e),Xd(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 Gd(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,zd(e),Xd(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=In(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 wn(e.base_)},setPrototypeOf(){Ye(12)}},Ha={};Ua(rp,(e,t)=>{Ha[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ha.deleteProperty=function(e,t){return Ha.set.call(this,e,t,void 0)};Ha.set=function(e,t,r){return rp.set.call(this,e[0],t,r,e[0])};function Gd(e,t){let r=e[ut];return(r?In(r):e)[t]}function MF(e,t,r){let n=Hg(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Hg(e,t){if(!(t in e))return;let r=wn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=wn(r)}}function Xd(e){e.modified_||(e.modified_=!0,e.parent_&&Xd(e.parent_))}function zd(e){e.copy_||(e.copy_=Wd(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var LF=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let d=this;return function(m=a,...f){return d.produce(m,y=>r.call(this,y,...f))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let o;if(lt(t)){let a=Lg(this),d=Zd(t,void 0),p=!0;try{o=r(d),p=!1}finally{p?Kd(a):Jd(a)}return Mg(a,n),Qg(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===ep&&(o=void 0),this.autoFreeze_&&ps(o,!0),n){let a=[],d=[];En("Patches").generateReplacementPatches_(t,o,a,d),n(a,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){lt(e)||Ye(8),St(e)&&(e=Gg(e));let t=Lg(this),r=Zd(e,void 0);return r[ut].isManual_=!0,Jd(t),r}finishDraft(e,t){let r=e&&e[ut];(!r||!r.isManual_)&&Ye(9);let{scope_:n}=r;return Mg(n,t),Qg(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=En("Patches").applyPatches_;return St(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Zd(e,t){let r=Ga(e)?En("MapSet").proxyMap_(e,t):za(e)?En("MapSet").proxySet_(e,t):NF(e,t);return(t?t.scope_:$g()).drafts_.push(r),r}function Gg(e){return St(e)||Ye(10,e),zg(e)}function zg(e){if(!lt(e)||ms(e))return e;let t=e[ut],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Wd(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Wd(e,!0);return Ua(r,(n,o)=>{Bg(r,n,zg(o))}),t&&(t.finalized_=!1),r}function Wg(){let t="replace",r="add",n="remove";function o(v,C,x,b){switch(v.type_){case 0:case 2:return d(v,C,x,b);case 1:return a(v,C,x,b);case 3:return p(v,C,x,b)}}function a(v,C,x,b){let{base_:R,assigned_:F}=v,P=v.copy_;P.length<R.length&&([R,P]=[P,R],[x,b]=[b,x]);for(let I=0;I<R.length;I++)if(F[I]&&P[I]!==R[I]){let T=C.concat([I]);x.push({op:t,path:T,value:A(P[I])}),b.push({op:t,path:T,value:A(R[I])})}for(let I=R.length;I<P.length;I++){let T=C.concat([I]);x.push({op:r,path:T,value:A(P[I])})}for(let I=P.length-1;R.length<=I;--I){let T=C.concat([I]);b.push({op:n,path:T})}}function d(v,C,x,b){let{base_:R,copy_:F}=v;Ua(v.assigned_,(P,I)=>{let T=Hd(R,P),M=Hd(F,P),D=I?Ba(R,P)?t:r:n;if(T===M&&D===t)return;let q=C.concat(P);x.push(D===n?{op:D,path:q}:{op:D,path:q,value:M}),b.push(D===r?{op:n,path:q}:D===n?{op:r,path:q,value:A(T)}:{op:t,path:q,value:A(T)})})}function p(v,C,x,b){let{base_:R,copy_:F}=v,P=0;R.forEach(I=>{if(!F.has(I)){let T=C.concat([P]);x.push({op:n,path:T,value:I}),b.unshift({op:r,path:T,value:I})}P++}),P=0,F.forEach(I=>{if(!R.has(I)){let T=C.concat([P]);x.push({op:r,path:T,value:I}),b.unshift({op:n,path:T,value:I})}P++})}function m(v,C,x,b){x.push({op:t,path:[],value:C===ep?void 0:C}),b.push({op:t,path:[],value:v})}function f(v,C){return C.forEach(x=>{let{path:b,op:R}=x,F=v;for(let M=0;M<b.length-1;M++){let D=Pn(F),q=b[M];typeof q!="string"&&typeof q!="number"&&(q=""+q),(D===0||D===1)&&(q==="__proto__"||q==="constructor")&&Ye(19),typeof F=="function"&&q==="prototype"&&Ye(19),F=Hd(F,q),typeof F!="object"&&Ye(18,b.join("/"))}let P=Pn(F),I=y(x.value),T=b[b.length-1];switch(R){case t:switch(P){case 2:return F.set(T,I);case 3:Ye(16);default:return F[T]=I}case r:switch(P){case 1:return T==="-"?F.push(I):F.splice(T,0,I);case 2:return F.set(T,I);case 3:return F.add(I);default:return F[T]=I}case n:switch(P){case 1:return F.splice(T,1);case 2:return F.delete(T);case 3:return F.delete(x.value);default:return delete F[T]}default:Ye(17,R)}}),v}function y(v){if(!lt(v))return v;if(Array.isArray(v))return v.map(y);if(Ga(v))return new Map(Array.from(v.entries()).map(([x,b])=>[x,y(b)]));if(za(v))return new Set(Array.from(v).map(y));let C=Object.create(wn(v));for(let x in v)C[x]=y(v[x]);return Ba(v,_a)&&(C[_a]=v[_a]),C}function A(v){return St(v)?y(v):v}DF("Patches",{applyPatches_:f,generatePatches_:o,generateReplacementPatches_:m})}var Ct=new LF,Ar=Ct.produce,fs=Ct.produceWithPatches.bind(Ct),J0=Ct.setAutoFreeze.bind(Ct),X0=Ct.setUseStrictShallowCopy.bind(Ct),np=Ct.applyPatches.bind(Ct),Z0=Ct.createDraft.bind(Ct),eL=Ct.finishDraft.bind(Ct);l();s();u();c();function QF(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _F(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function UF(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 Yg=e=>Array.isArray(e)?e:[e];function BF(e){let t=Array.isArray(e[0])?e[0]:e;return UF(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function $F(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var sL=Symbol();var cL=Object.getPrototypeOf({});var HF=class{constructor(e){this.value=e}deref(){return this.value}},GF=typeof WeakRef<"u"?WeakRef:HF,zF=0,Kg=1;function gs(){return{s:zF,v:void 0,o:null,p:null}}function co(e,t={}){let r=gs(),{resultEqualityCheck:n}=t,o,a=0;function d(){let p=r,{length:m}=arguments;for(let A=0,v=m;A<v;A++){let C=arguments[A];if(typeof C=="function"||typeof C=="object"&&C!==null){let x=p.o;x===null&&(p.o=x=new WeakMap);let b=x.get(C);b===void 0?(p=gs(),x.set(C,p)):p=b}else{let x=p.p;x===null&&(p.p=x=new Map);let b=x.get(C);b===void 0?(p=gs(),x.set(C,p)):p=b}}let f=p,y;if(p.s===Kg)y=p.v;else if(y=e.apply(null,arguments),a++,n){let A=o?.deref?.()??o;A!=null&&n(A,y)&&(y=A,a!==0&&a--),o=typeof y=="object"&&y!==null||typeof y=="function"?new GF(y):y}return f.s=Kg,f.v=y,y}return d.clearCache=()=>{r=gs(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}function Jg(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,d=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),QF(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let y={...r,...m},{memoize:A,memoizeOptions:v=[],argsMemoize:C=co,argsMemoizeOptions:x=[],devModeChecks:b={}}=y,R=Yg(v),F=Yg(x),P=BF(o),I=A(function(){return a++,f.apply(null,arguments)},...R),T=!0,M=C(function(){d++;let q=$F(P,arguments);return p=I.apply(null,q),p},...F);return Object.assign(M,{resultFunc:f,memoizedResultFunc:I,dependencies:P,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:A,argsMemoize:C})};return Object.assign(n,{withTypes:()=>n}),n}var se=Jg(co),WF=Object.assign((e,t=se)=>{_F(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>WF});l();s();u();c();function Xg(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var Zg=Xg(),ey=Xg;var YF=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?so:so.apply(null,arguments)},IL=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},KF=e=>e&&typeof e.match=="function";function w(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Nt(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=>us(n)&&n.type===e,r}var ay=class Wa extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Wa.prototype)}static get[Symbol.species](){return Wa}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Wa(...t[0].concat(this)):new Wa(...t.concat(this))}};function ty(e){return lt(e)?Ar(e,()=>{}):e}function ry(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function JF(e){return typeof e=="boolean"}var XF=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},d=new ay;return r&&(JF(r)?d.push(Zg):d.push(ey(r.extraArgument))),d},Ya="RTK_autoBatch",lo=()=>e=>({payload:e,meta:{[Ya]:!0}}),ny=e=>t=>{setTimeout(t,e)},ZF=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ny(10):e.type==="callback"?e.queueNotification:ny(e.timeout),f=()=>{d=!1,a&&(a=!1,p.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let A=()=>o&&y(),v=n.subscribe(A);return p.add(y),()=>{v(),p.delete(y)}},dispatch(y){try{return o=!y?.meta?.[Ya],a=!o,a&&(d||(d=!0,m(f))),n.dispatch(y)}finally{o=!0}}})},eI=e=>function(r){let{autoBatch:n=!0}=r??{},o=new ay(e);return n&&o.push(ZF(typeof n=="object"?n:void 0)),o};function iy(e){let t=XF(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Gt(r))p=io(r);else throw new Error(Nt(1));let m;typeof n=="function"?m=n(t):m=t();let f=so;o&&(f=YF({trace:!1,...typeof o=="object"&&o}));let y=Ng(...m),A=eI(y),v=typeof d=="function"?d(A):A(),C=f(...v);return $d(p,a,C)}function sy(e){let t={},r=[],n,o={addCase(a,d){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Nt(28));if(p in t)throw new Error(Nt(29));return t[p]=d,o},addMatcher(a,d){return r.push({matcher:a,reducer:d}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function tI(e){return typeof e=="function"}function oe(e,t){let[r,n,o]=sy(t),a;if(tI(e))a=()=>ty(e());else{let p=ty(e);a=()=>p}function d(p=a(),m){let f=[r[m.type],...n.filter(({matcher:y})=>y(m)).map(({reducer:y})=>y)];return f.filter(y=>!!y).length===0&&(f=[o]),f.reduce((y,A)=>{if(A)if(St(y)){let C=A(y,m);return C===void 0?y:C}else{if(lt(y))return Ar(y,v=>A(v,m));{let v=A(y,m);if(v===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return y},p)}return d.getInitialState=a,d}var cy=(e,t)=>KF(e)?e.match(t):e(t);function zt(...e){return t=>e.some(r=>cy(r,t))}function uo(...e){return t=>e.every(r=>cy(r,t))}function hs(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 Ka(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Ss(...e){return e.length===0?t=>hs(t,["pending"]):Ka(e)?zt(...e.map(t=>t.pending)):Ss()(e[0])}function Tn(...e){return e.length===0?t=>hs(t,["rejected"]):Ka(e)?zt(...e.map(t=>t.rejected)):Tn()(e[0])}function Ja(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?uo(Tn(...e),t):Ka(e)?uo(Tn(...e),t):Ja()(e[0])}function vr(...e){return e.length===0?t=>hs(t,["fulfilled"]):Ka(e)?zt(...e.map(t=>t.fulfilled)):vr()(e[0])}function Cs(...e){return e.length===0?t=>hs(t,["pending","fulfilled","rejected"]):Ka(e)?zt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Cs()(e[0])}var rI="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",As=(e=21)=>{let t="",r=e;for(;r--;)t+=rI[Math.random()*64|0];return t},nI=["name","message","stack","code"],op=class{constructor(e,t){Re(this,"_type");this.payload=e,this.meta=t}},oy=class{constructor(e,t){Re(this,"_type");this.payload=e,this.meta=t}},oI=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of nI)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,y,A)=>({payload:m,meta:{...A||{},arg:y,requestId:f,requestStatus:"fulfilled"}})),a=w(t+"/pending",(m,f,y)=>({payload:void 0,meta:{...y||{},arg:f,requestId:m,requestStatus:"pending"}})),d=w(t+"/rejected",(m,f,y,A,v)=>({payload:A,error:(n&&n.serializeError||oI)(m||"Rejected"),meta:{...v||{},arg:y,requestId:f,rejectedWithValue:!!A,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,y,A)=>{let v=n?.idGenerator?n.idGenerator(m):As(),C=new i.AbortController,x,b;function R(P){b=P,C.abort()}let F=async function(){let P;try{let T=n?.condition?.(m,{getState:y,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 M=new Promise((D,q)=>{x=()=>{q({name:"AbortError",message:b||"Aborted"})},C.signal.addEventListener("abort",x)});f(a(v,m,n?.getPendingMeta?.({requestId:v,arg:m},{getState:y,extra:A}))),P=await Promise.race([M,Promise.resolve(r(m,{dispatch:f,getState:y,extra:A,requestId:v,signal:C.signal,abort:R,rejectWithValue:(D,q)=>new op(D,q),fulfillWithValue:(D,q)=>new oy(D,q)})).then(D=>{if(D instanceof op)throw D;return D instanceof oy?o(D.payload,v,m,D.meta):o(D,v,m)})])}catch(T){P=T instanceof op?d(null,v,m,T.payload,T.meta):d(T,v,m)}finally{x&&C.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&d.match(P)&&P.meta.condition||f(P),P}();return Object.assign(F,{abort:R,requestId:v,arg:m,unwrap(){return F.then(aI)}})}}return Object.assign(p,{pending:a,rejected:d,fulfilled:o,settled:zt(d,o),typePrefix:t})}return e.withTypes=()=>e,e})();function aI(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 uy=Symbol.for("rtk-slice-createasyncthunk"),qL={[uy]:ee};function sI(e,t){return`${e}/${t}`}function cI({creators:e}={}){let t=e?.asyncThunk?.[uy];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Nt(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(lI()):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(Nt(12));if(T in m.sliceCaseReducersByType)throw new Error(Nt(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:sI(o,P),createNotation:typeof n.reducers=="function"};pI(I)?fI(T,I,f,t):dI(T,I,f)});function y(){let[P={},I=[],T=void 0]=typeof n.extraReducers=="function"?sy(n.extraReducers):[n.extraReducers],M={...P,...m.sliceCaseReducersByType};return oe(n.initialState,D=>{for(let q in M)D.addCase(q,M[q]);for(let q of m.sliceMatchers)D.addMatcher(q.matcher,q.reducer);for(let q of I)D.addMatcher(q.matcher,q.reducer);T&&D.addDefaultCase(T)})}let A=P=>P,v=new Map,C;function x(P,I){return C||(C=y()),C(P,I)}function b(){return C||(C=y()),C.getInitialState()}function R(P,I=!1){function T(D){let q=D[P];return typeof q>"u"&&I&&(q=b()),q}function M(D=A){let q=ry(v,I,()=>new WeakMap);return ry(q,D,()=>{let O={};for(let[j,L]of Object.entries(n.selectors??{}))O[j]=uI(L,D,b,I);return O})}return{reducerPath:P,getSelectors:M,get selectors(){return M(T)},selectSlice:T}}let F={name:o,reducer:x,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:b,...R(a),injectInto(P,{reducerPath:I,...T}={}){let M=I??a;return P.inject({reducerPath:M,reducer:x},T),{...F,...R(M,!0)}}};return F}}function uI(e,t,r,n){function o(a,...d){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return o.unwrapped=e,o}var qn=cI();function lI(){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 dI({type:e,reducerName:t,createNotation:r},n,o){let a,d;if("reducer"in n){if(r&&!mI(n))throw new Error(Nt(17));a=n.reducer,d=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,d?w(e,d):w(e))}function pI(e){return e._reducerDefinitionType==="asyncThunk"}function mI(e){return e._reducerDefinitionType==="reducerWithPrepare"}function fI({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Nt(18));let{payloadCreator:a,fulfilled:d,pending:p,rejected:m,settled:f,options:y}=r,A=o(e,a,y);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||ys,pending:p||ys,rejected:m||ys,settled:f||ys})}function ys(){}var ly="listener",dy="completed",py="cancelled",kL=`task-${py}`,OL=`task-${dy}`,DL=`${ly}-${py}`,jL=`${ly}-${dy}`;var{assign:my}=Object;var ap="listenerMiddleware";var gI=my(w(`${ap}/add`),{withTypes:()=>gI}),VL=w(`${ap}/removeAll`),yI=my(w(`${ap}/remove`),{withTypes:()=>yI});var NL=Symbol.for("rtk-state-proxy-original");function Nt(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 fy=/^(?:[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"&&fy.test(e)}var ip=hI;l();s();u();c();var Ke=[];for(let e=0;e<256;++e)Ke.push((e+256).toString(16).slice(1));function gy(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 sp,SI=new Uint8Array(16);function cp(){if(!sp){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");sp=crypto.getRandomValues.bind(crypto)}return sp(SI)}l();s();u();c();l();s();u();c();var CI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),up={randomUUID:CI};function AI(e,t,r){if(up.randomUUID&&!t&&!e)return up.randomUUID();e=e||{};let n=e.random??e.rng?.()??cp();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 gy(n)}var lp=AI;l();s();u();c();function yy(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function vI({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(o,a,r))}var hy="visitorId";function xI(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(hy),o=n&&ip(n)?n:t.generateUUID();return r.setItem(hy,o),o}}}var Cy="1.2.5";function RI(e){let{trackingId:t}=e;return{trackingId:t}}function bI(e){return(e.source||[]).concat([`relay@${Cy}`])}function Ay(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:d}=r,p=RI(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:bI(t),clientId:m,userAgent:d(),referrer:o(),location:a()})}function FI(e,t,r,n,o){return{...t,meta:Ay(e,r,n,o)}}var II="*";function wI(){let e=[];function t({type:m,callback:f}){return e.findIndex(y=>y.type===m&&y.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(y){console.error(y)}})}function a(m){if(m===II)e.length=0;else for(let f=e.length-1;f>=0;f--)e[f].type===m&&e.splice(f,1)}function d(m){let f=t(m);f>=0&&e.splice(f,1)}function p(m,f){f?d({type:m,callback:f}):a(m)}return{add:n,call:o,remove:p}}function Sy({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 PI(e){let t=Sy(e);return{get:()=>t,update:r=>{t=Sy({...t,...r})}}}var dp=EI();function EI(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let d=a.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function TI(){return{getItem(e){return dp.getItem(e)||localStorage.getItem(e)},removeItem(e){dp.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),dp.setItem(e,t,31556952e3)}}}function qI(){let e=document.referrer;return e===""?null:vy(e)}function vy(e){return e.slice(0,1024)}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(yy().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:()=>qI(),getLocation:()=>vy(window.location.href),getUserAgent:()=>navigator.userAgent,generateUUID:()=>lp(),storage:TI()}}function OI(){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 DI(){return{getItem(){return null},removeItem(){},setItem(){}}}function jI(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:DI()}}function VI(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=jI();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&NI()&&OI()?kI():n}function NI(){try{return typeof window=="object"}catch{return!1}}function MI(e){return{get:()=>Object.freeze(VI(e))}}function xy(e){let t=PI(e),r=wI(),n=MI(t),o=xI(n);return{emit:(a,d)=>{let p=t.get(),m=n.get(),f=FI(a,d,p,m,o);return vI({config:p,environment:m,event:f,listenerManager:r})},getMeta:a=>Ay(a,t.get(),n.get(),o),on:(a,d)=>r.add({type:a,callback:d}),off:(a,d)=>r.remove(a,d),updateConfig:a=>t.update(a),version:Cy}}l();s();u();c();l();s();u();c();var po="3.27.6-pre.a09bdf627b",Ry=["@coveo/atomic","@coveo/quantic"];var Mr=se(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${po}`));var mo=se(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Mr(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},d)=>xy({mode:a?"emit":"disabled",url:o??as(e,t),token:r,trackingId:n??null,source:d}));l();s();u();c();l();s();u();c();function Wt(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 V(e,t,r,n){function o(a){return a instanceof r?a:new r(function(d){d(a)})}return new(r||(r=Promise))(function(a,d){function p(y){try{f(n.next(y))}catch(A){d(A)}}function m(y){try{f(n.throw(y))}catch(A){d(A)}}function f(y){y.done?a(y.value):o(y.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 fp(){return typeof window<"u"}function Pp(){return typeof navigator<"u"}function fo(){return typeof document<"u"}function gp(){try{return typeof localStorage<"u"}catch{return!1}}function LI(){try{return typeof sessionStorage<"u"}catch{return!1}}function Vy(){return Pp()&&navigator.cookieEnabled}var QI=[Ce.click,Ce.custom,Ce.search,Ce.view],_I=(e,t)=>QI.indexOf(e)!==-1?Object.assign({language:fo()?document.documentElement.lang:"unknown",userAgent:Pp()?navigator.userAgent:"unknown"},t):t,Za=class e{static set(t,r,n){var o,a,d,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?by(t,r,a):(d=p.split("."),o=d[d.length-2]+"."+d[d.length-1],by(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function by(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function UI(){return gp()?localStorage:Vy()?new ei:LI()?sessionStorage:new yo}var ei=class e{getItem(t){return Za.get(`${e.prefix}${t}`)}removeItem(t){Za.erase(`${e.prefix}${t}`)}setItem(t,r,n){Za.set(`${e.prefix}${t}`,r,n)}};ei.prefix="coveo_";var yp=class{constructor(){this.cookieStorage=new ei}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){}},vs="__coveo.analytics.history",BI=20,$I=1e3*60,HI=75,bs=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 V(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(vs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(vs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(vs,JSON.stringify(t.slice(0,BI)))}catch{}}clear(){try{this.store.removeItem(vs)}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,HI)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>$I:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var GI=(e,t)=>V(void 0,void 0,void 0,function*(){return e===Ce.view?(yield zI(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),zI=e=>V(void 0,void 0,void 0,function*(){let t=new bs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),xs,WI=new Uint8Array(16);function YI(){if(!xs&&(xs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xs(WI)}var KI=/^(?:[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 Fs(e){return typeof e=="string"&&KI.test(e)}var Je=[];for(let e=0;e<256;++e)Je.push((e+256).toString(16).slice(1));function Ny(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 JI(e){if(!Fs(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 XI(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ZI="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ew="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function tw(e,t,r){function n(o,a,d,p){var m;if(typeof o=="string"&&(o=XI(o)),typeof a=="string"&&(a=JI(a)),((m=a)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(a),f.set(o,a.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let y=0;y<16;++y)d[p+y]=f[y];return d}return Ny(f)}try{n.name=e}catch{}return n.DNS=ZI,n.URL=ew,n}var rw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fy={randomUUID:rw};function kn(e,t,r){if(Fy.randomUUID&&!t&&!e)return Fy.randomUUID();e=e||{};let n=e.random||(e.rng||YI)();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 Ny(n)}function nw(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 pp(e,t){return e<<t|e>>>32-t}function ow(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let d=unescape(encodeURIComponent(e));e=[];for(let p=0;p<d.length;++p)e.push(d.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let d=0;d<o;++d){let p=new Uint32Array(16);for(let m=0;m<16;++m)p[m]=e[d*64+m*4]<<24|e[d*64+m*4+1]<<16|e[d*64+m*4+2]<<8|e[d*64+m*4+3];a[d]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<o;++d){let p=new Uint32Array(80);for(let C=0;C<16;++C)p[C]=a[d][C];for(let C=16;C<80;++C)p[C]=pp(p[C-3]^p[C-8]^p[C-14]^p[C-16],1);let m=r[0],f=r[1],y=r[2],A=r[3],v=r[4];for(let C=0;C<80;++C){let x=Math.floor(C/20),b=pp(m,5)+nw(x,f,y,A)+v+t[x]+p[C]>>>0;v=A,A=y,y=pp(f,30)>>>0,f=m,m=b}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+A>>>0,r[4]=r[4]+v>>>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 aw=tw("v5",80,ow),Iy=aw,My="2.30.45",wy=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Xa={pageview:"pageview",event:"event"},Is=class{constructor({client:t,uuidGenerator:r=kn}){this.client=t,this.uuidGenerator=r}},hp=class extends Is{constructor({client:t,uuidGenerator:r=kn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=wy(window.location),this.lastReferrer=fo()?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:fo()?document.title:"",encoding:fo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Xa.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Xa.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Xa.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Xa.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 wy(window.location)}},Lr=class e{constructor(t,r){if(!Fs(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Fs(a)?new e(a,Number.parseInt(o)*1e3):null}};Lr.cvo_cid="cvo_cid";Lr.expirationTime=120;var Sp=class extends Is{constructor({client:t,uuidGenerator:r=kn}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return V(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Lr.cvo_cid,new Lr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Sp.Id="link";var Pt=Object.keys;function Rs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var mp=128,Ly=192,Py=224,Ey=240;function iw(e){return(e&248)===Ey?4:(e&Ey)===Py?3:(e&Py)===Ly?2:1}function sw(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&mp)!=mp)break;if(r-=3,(n&Ly)!=mp){t-r>=iw(n)*3&&(r=t);break}}return e.substring(0,r)}var Cp={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"},cw=Pt(Cp).map(e=>Cp[e]),uw=[...cw].join("|"),lw=new RegExp(`^(${uw}$)`),dw={svcAction:"svc_action",svcActionData:"svc_action_data"},pw=e=>Pt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Cp[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),mw=e=>lw.test(e),fw=[mw],Ty={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},qy={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},et={action:"pa",list:"pal",listSource:"pls"},ws={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},gw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ap={id:"quoteId",affiliation:"quoteAffiliation"},vp={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},yw={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),ws),purchase:Object.assign(Object.assign({},et),ws),quickview:et,quote:Object.assign(Object.assign({},et),Ap),review:Object.assign(Object.assign({},et),vp)},hw=Pt(Ty).map(e=>Ty[e]),Sw=Pt(qy).map(e=>qy[e]),Cw=Pt(et).map(e=>et[e]),Aw=Pt(ws).map(e=>ws[e]),vw=Pt(vp).map(e=>vp[e]),xw=Pt(Ap).map(e=>Ap[e]),Rw=[...hw,"custom"].join("|"),bw=[...Sw,"custom"].join("|"),Qy="(pr[0-9]+)",_y="(il[0-9]+pi[0-9]+)",Fw=new RegExp(`^${Qy}(${Rw})$`),Iw=new RegExp(`^(${_y}(${bw}))|(il[0-9]+nm)$`),ww=new RegExp(`^(${Cw.join("|")})$`),Pw=new RegExp(`^(${Aw.join("|")})$`),Ew=new RegExp(`^${Qy}custom$`),Tw=new RegExp(`^${_y}custom$`),qw=new RegExp(`^(${[...gw,...vw,...xw].join("|")})$`),kw=e=>Fw.test(e),Ow=e=>Iw.test(e),Dw=e=>ww.test(e),jw=e=>Pw.test(e),Vw=e=>qw.test(e),Nw=[Ow,kw,Dw,jw,Vw],Mw=[Ew,Tw],Lw={anonymizeIp:"aip"},Qw={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({},Lw),Qw),_w),Uw.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),xp=Object.assign(Object.assign({},Bw),dw),$w=e=>{let t=!!e.action&&yw[e.action]||{};return Pt(e).reduce((r,n)=>{let o=t[n]||xp[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Hw=Pt(xp).map(e=>xp[e]),Gw=e=>Hw.indexOf(e)!==-1,zw=e=>e==="custom",Ww=e=>[...Nw,...fw,Gw,zw].some(t=>t(e)),Yw=e=>Pt(e).reduce((t,r)=>{let n=Kw(r);return n?Object.assign(Object.assign({},t),Jw(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Kw=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},Jw=(e,t)=>Pt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Rp=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(d,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(this,void 0,void 0,function*(){let o=t,a=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;o=p||t;try{a=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[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 V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},ky=g.fetch,Ps=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,d=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${d}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:f}=m,y=Wt(m,["url"]),A;try{A=yield ky(f,y)}catch(v){console.error("An error has occured when sending the event.",v);return}if(A.ok){let v=yield A.json();return v.visitorId&&o.setCurrentVisitorId(v.visitorId),v}else{try{A.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,A,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield ky(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ce.click,Ce.custom,Ce.search,Ce.view].indexOf(t)!==-1}getVisitorIdParam(){return V(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Fp=class{constructor(t,r){gp()&&Vy()?this.storage=new yp:gp()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new yo),this.client=new Ps(t),this.beaconClient=new Rp(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Ip=class{constructor(t,r){this.storage=r||new yo,this.client=new Ps(t)}getClientDependingOnEventType(t){return this.client}},Es=class{constructor(){this.storage=new yo,this.client=new bp}getClientDependingOnEventType(t){return this.client}},Xw="xx",Zw=e=>e?.startsWith(Xw)||!1,eP=`
|
|
28
|
+
${y}`:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":jb(y,n,t);break}}}}function jb(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function Vb(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function ng(){return{data:"",event:"",id:"",retry:void 0}}var Id="text/event-stream",Nb=1e3,sg="last-event-id";function cg(){return typeof window<"u"}function ts(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:d,openWhenHidden:p,fetch:m,...f}){return new Promise((y,A)=>{let v={...r};v.accept||(v.accept=Id);let C;function x(){C?.abort(),document.hidden||T()}!p&&cg()&&document.addEventListener("visibilitychange",x);let b=Nb,R;function F(){cg()&&document.removeEventListener("visibilitychange",x),clearTimeout(R),C?.abort()}t?.addEventListener("abort",()=>{F(),y()});let P=m??h,I=n??Mb;async function T(){C=i.AbortController?new i.AbortController:null;try{let M=await P(e,{...f,headers:v,signal:C?.signal});await I(M),await og(M.body,ag(ig(D=>{D?v[sg]=D:delete v[sg]},D=>{b=D},o))),a?.(),F(),y()}catch(M){if(!C?.signal?.aborted)try{let D=d?.(M)??b;clearTimeout(R),R=setTimeout(T,D)}catch(D){F(),A(D)}}}T()})}function Mb(e){let t=e.headers.get("content-type");if(!t?.startsWith(Id))throw new Error(`Expected content-type to be ${Id}, Actual: ${t}`)}l();s();u();c();var Vr=class{constructor(t){Re(this,"_basePath");Re(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 Lb=(e,t,r)=>new Vr(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,ug=3,Qb=5e3,_b="text/event-stream",Ed=1,wd=class extends Error{},Va=class extends Error{constructor(r){super(r.message);this.payload=r}},Pd=class{constructor(){Re(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)}},rs=class{constructor(t){Re(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:d}=t,{write:p,abort:m,close:f,resetAnswer:y}=r,A=new Pd;if(!a){this.logger.error("No stream ID found");return}let v=0,C,x=()=>{C&&!A.isActive(C)&&(R?.abort(),y(),F())},b=()=>{A.remove(C),C=rg(x,C,Qb),A.add(C)},R=new i.AbortController,F=()=>ts(Lb(n,o,a),{method:"GET",fetch:h,headers:{Authorization:`Bearer ${d}`,accept:"*/*"},openWhenHidden:!0,signal:R?.signal,async onopen(P){if(P.ok&&P.headers.get("content-type")===_b)return;throw P.status>=400&&P.status<500&&P.status!==429?new Va({message:"Error opening stream",code:P.status}):new wd},onmessage:P=>{if(R?.signal.aborted)return;let I=JSON.parse(P.data);if(I.finishReason==="ERROR"){A.remove(C),R?.abort(),m({message:I.errorMessage,code:I.statusCode});return}p(I),v=0,I.finishReason==="COMPLETED"?(A.remove(C),f()):b()},onerror:P=>{if(!R?.signal.aborted){if(A.remove(C),P instanceof Va)throw R?.abort(),m(P),P;if(++v>ug){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Ed};throw R?.abort(),m(I),new Va(I)}this.logger.info(`Retrying...(${v}/${ug})`),y()}}});return F(),R}};l();s();u();c();var ns=e=>e;l();s();u();c();l();s();u();c();var vg=Dt(hg(),1);l();s();u();c();l();s();u();c();var mF="recommendation-internal-options",IN=Symbol.for(mF);var re=new Error("Failed to load reducers."),oo=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();Re(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 Sg(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Cg(e){return typeof e!="object"||!e?!1:Object.values(e).every(fF)}function fF(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Ag(e){return e===429}var jt=class e{static async call(t){let r=gF(t),{logger:n}=t,o=await e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...d}=o,p=async()=>{let m=await h(a,d);if(Ag(m.status))throw m;return m};try{let m=await(0,vg.backOff)(p,{retry:f=>{let y=f&&Ag(f.status);return y&&n.info("Platform retrying request"),y}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new oo;case 404:throw new bn(a,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new bn(a):m}}static async preprocessRequest(t,r){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:d}=r,{signal:p,...m}=t,f=ja(m);try{let y=await o(t,n,d);return{...t,...y}}catch(y){a.error(y,"Platform request preprocessing failed. Returning default request options.")}return f}};function qe(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ct(e,t="prod"){return`${qe(e,t)}/rest/search/v2`}function as(e,t="prod"){return`${qe(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function gF(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:d}=e,p=e.method==="POST"||e.method==="PUT",m=yF(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...p&&{body:m},signal:d}}function yF(e,t){return t==="application/x-www-form-urlencoded"?Cg(e)?Sg(e):"":JSON.stringify(e)}l();s();u();c();l();s();u();c();function La(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var Md=e=>{let{response:t}=e;return t.body?hF(e):SF(t)},hF=e=>AF(e)?vF(e):CF(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},SF=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function CF(e){return e.body.statusCode!==void 0}function AF(e){return e.body.exception!==void 0}var vF=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 Ld=(e,t,r,n)=>{let o=new Vr(`${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 Vr(`${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},Qd=async(e,t)=>{let r=await jt.call({...Ld(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:La(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 xF(d)?{success:d}:{error:Md({response:r,body:d})}};function xF(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 Be(){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 RF(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function bF(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Fn(e,t){if(t&&e.name==="AbortError")return{error:bF(e)};if(e instanceof bn)return{error:RF(e)};throw e}var Nr=e=>e.success!==void 0,we=e=>e.error!==void 0;function bg(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 _d=(e,t)=>`${e.url}/rest/organizations/${e.organizationId}/insight/v1/configs/${e.insightId}${t??""}`,FF=e=>`${e.url}/rest/organizations/${e.organizationId}/machinelearning/user/actions`,Qa=(e,t,r,n)=>{IF(e);let o=_d(e,n);return{accessToken:e.accessToken,method:t,contentType:r,url:o,origin:"insightApiFetch"}},Ig=(e,t,r)=>{wF(e);let n=FF(e);return{accessToken:e.accessToken,method:t,contentType:r,url:n,origin:"insightApiFetch"}},Ud=e=>{let{insightId:t,...r}=La(e);return r},wg=e=>{if(!e.url)throw new Error("The 'url' attribute must contain a valid platform URL.");if(!e.organizationId)throw new Error("The 'organizationId' attribute must contain a valid organization ID.");if(!e.accessToken)throw new Error("The 'accessToken' attribute must contain a valid platform access token.")},IF=e=>{if(wg(e),!e.insightId)throw new Error("The 'insightId' attribute must contain a valid Insight Panel configuration ID.")},wF=e=>{if(wg(e),!e.userId)throw new Error("The 'userId' attribute must contain a valid user ID.")};var Pg=e=>({...Qa(e,"GET","application/json","/interface"),requestParams:{}});l();s();u();c();var Eg=e=>({...Qa(e,"POST","application/json","/search"),requestParams:Ud(e)}),Tg=e=>({...Qa(e,"POST","application/json","/querysuggest"),requestParams:Ud(e)});l();s();u();c();var qg=e=>({...Ig(e,"POST","application/json"),requestParams:{objectId:e.userId}});var is=class{constructor(t){this.options=t}async getInterface(t){let r=await jt.call({...Pg(t),...this.options});if(r instanceof Error)return Fn(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async query(t,r){let n=await jt.call({...Eg(t),requestMetadata:{method:"search",origin:r?.origin},...this.options});if(n instanceof Error)return Fn(n);let o=await n.json();return bg(o)&&(o=Fg(o)),n.ok?{success:o}:{error:o}}async querySuggest(t){let r=await jt.call({...Tg(t),...this.options});if(r instanceof Error)return Fn(r);let n=await r.json();return n.completions?{success:n}:{error:n}}async userActions(t){let r=await jt.call({...qg(t),...this.options});if(r instanceof Error)return Fn(r);let n=await r.json();return r.ok?{success:n}:{error:n}}async html(t){return Qd(t,{...this.options})}};l();s();u();c();l();s();u();c();var B=new N({required:!0,emptyAllowed:!1}),be=new N({required:!1,emptyAllowed:!1}),Pe=new N({required:!0,emptyAllowed:!0}),kg=new N({required:!1,emptyAllowed:!0}),ss=new te({each:B,required:!0}),Og=new N({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Dg=new N({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Q0=new N({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Vt=({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 U({options:{required:!0},values:t}).validate(e);if(o)throw new xn(o);return{payload:e}},E=(e,t)=>{try{return It(e,t)}catch(r){return{payload:e,error:Vt(r)}}},Ht=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return jg(e,t,r,o,"Controller initialization error")},$e=(e,t,r,n)=>{let o=`Check the options of ${n}`;return jg(e,t,r,o,"Controller initialization error")},jg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};l();s();u();c();l();s();u();c();l();s();u();c();function 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 PF=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vg=PF,Bd=()=>Math.random().toString(36).substring(7).split("").join("."),EF={INIT:`@@redux/INIT${Bd()}`,REPLACE:`@@redux/REPLACE${Bd()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Bd()}`},cs=EF;function Gt(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 $d(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($d)(e,t)}let n=e,o=t,a=new Map,d=a,p=0,m=!1;function f(){d===a&&(d=new Map,a.forEach((R,F)=>{d.set(F,R)}))}function y(){if(m)throw new Error(We(3));return o}function A(R){if(typeof R!="function")throw new Error(We(4));if(m)throw new Error(We(5));let F=!0;f();let P=p++;return d.set(P,R),function(){if(F){if(m)throw new Error(We(6));F=!1,f(),d.delete(P),a=null}}}function v(R){if(!Gt(R))throw new Error(We(7));if(typeof R.type>"u")throw new Error(We(8));if(typeof R.type!="string")throw new Error(We(17));if(m)throw new Error(We(9));try{m=!0,o=n(o,R)}finally{m=!1}return(a=d).forEach(P=>{P()}),R}function C(R){if(typeof R!="function")throw new Error(We(10));n=R,v({type:cs.REPLACE})}function x(){let R=A;return{subscribe(F){if(typeof F!="object"||F===null)throw new Error(We(11));function P(){let T=F;T.next&&T.next(y())}return P(),{unsubscribe:R(P)}},[Vg](){return this}}}return v({type:cs.INIT}),{dispatch:v,subscribe:A,getState:y,replaceReducer:C,[Vg]:x}}function TF(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:cs.INIT})>"u")throw new Error(We(12));if(typeof r(void 0,{type:cs.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(We(13))})}function io(e){let t=Object.keys(e),r={};for(let d=0;d<t.length;d++){let p=t[d];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{TF(r)}catch(d){a=d}return function(p={},m){if(a)throw a;let f=!1,y={};for(let A=0;A<n.length;A++){let v=n[A],C=r[v],x=p[v],b=C(x,m);if(typeof b>"u"){let R=m&&m.type;throw new Error(We(14))}y[v]=b,f=f||b!==x}return f=f||n.length!==Object.keys(p).length,f?y:p}}function so(...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),a=()=>{throw new Error(We(15))},d={getState:o.getState,dispatch:(m,...f)=>a(m,...f)},p=e.map(m=>m(d));return a=so(...p)(o.dispatch),{...o,dispatch:a}}}function us(e){return Gt(e)&&"type"in e&&typeof e.type=="string"}l();s();u();c();var ep=Symbol.for("immer-nothing"),_a=Symbol.for("immer-draftable"),ut=Symbol.for("immer-state");function Ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wn=Object.getPrototypeOf;function St(e){return!!e&&!!e[ut]}function lt(e){return e?Ug(e)||Array.isArray(e)||!!e[_a]||!!e.constructor?.[_a]||Ga(e)||za(e):!1}var qF=Object.prototype.constructor.toString();function Ug(e){if(!e||typeof e!="object")return!1;let t=wn(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)===qF}function tp(e){return St(e)||Ye(15,e),e[ut].base_}function Ua(e,t){Pn(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Pn(e){let t=e[ut];return t?t.type_:Array.isArray(e)?1:Ga(e)?2:za(e)?3:0}function Ba(e,t){return Pn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Hd(e,t){return Pn(e)===2?e.get(t):e[t]}function Bg(e,t,r){let n=Pn(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function kF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ga(e){return e instanceof Map}function za(e){return e instanceof Set}function In(e){return e.copy_||e.base_}function Wd(e,t){if(Ga(e))return new Map(e);if(za(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[ut];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let d=o[a],p=n[d];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[d]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[d]})}return Object.create(wn(e),n)}else{let n=wn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function ps(e,t=!1){return ms(e)||St(e)||!lt(e)||(Pn(e)>1&&(e.set=e.add=e.clear=e.delete=OF),Object.freeze(e),t&&Object.entries(e).forEach(([r,n])=>ps(n,!0))),e}function OF(){Ye(2)}function ms(e){return Object.isFrozen(e)}var Yd={};function En(e){let t=Yd[e];return t||Ye(0,e),t}function DF(e,t){Yd[e]||(Yd[e]=t)}var $a;function $g(){return $a}function jF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Mg(e,t){t&&(En("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Kd(e){Jd(e),e.drafts_.forEach(VF),e.drafts_=null}function Jd(e){e===$a&&($a=e.parent_)}function Lg(e){return $a=jF($a,e)}function VF(e){let t=e[ut];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Qg(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ut].modified_&&(Kd(t),Ye(4)),lt(e)&&(e=ls(t,e),t.parent_||ds(t,e)),t.patches_&&En("Patches").generateReplacementPatches_(r[ut].base_,e,t.patches_,t.inversePatches_)):e=ls(t,r,[]),Kd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ep?e:void 0}function ls(e,t,r){if(ms(t))return t;let n=t[ut];if(!n)return Ua(t,(o,a)=>_g(e,n,t,o,a,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return ds(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,a=o,d=!1;n.type_===3&&(a=new Set(o),o.clear(),d=!0),Ua(a,(p,m)=>_g(e,n,o,p,m,r,d)),ds(e,o,!1),r&&e.patches_&&En("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function _g(e,t,r,n,o,a,d){if(St(o)){let p=a&&t&&t.type_!==3&&!Ba(t.assigned_,n)?a.concat(n):void 0,m=ls(e,o,p);if(Bg(r,n,m),St(m))e.canAutoFreeze_=!1;else return}else d&&r.add(o);if(lt(o)&&!ms(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ls(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,n)&&ds(e,o)}}function ds(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ps(t,r)}function NF(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:$g(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=rp;r&&(o=[n],a=Ha);let{revoke:d,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=d,p}var rp={get(e,t){if(t===ut)return e;let r=In(e);if(!Ba(r,t))return MF(e,r,t);let n=r[t];return e.finalized_||!lt(n)?n:n===Gd(e.base_,t)?(zd(e),e.copy_[t]=Zd(n,e)):n},has(e,t){return t in In(e)},ownKeys(e){return Reflect.ownKeys(In(e))},set(e,t,r){let n=Hg(In(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Gd(In(e),t),a=o?.[ut];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(kF(r,o)&&(r!==void 0||Ba(e.base_,t)))return!0;zd(e),Xd(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 Gd(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,zd(e),Xd(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=In(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 wn(e.base_)},setPrototypeOf(){Ye(12)}},Ha={};Ua(rp,(e,t)=>{Ha[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ha.deleteProperty=function(e,t){return Ha.set.call(this,e,t,void 0)};Ha.set=function(e,t,r){return rp.set.call(this,e[0],t,r,e[0])};function Gd(e,t){let r=e[ut];return(r?In(r):e)[t]}function MF(e,t,r){let n=Hg(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Hg(e,t){if(!(t in e))return;let r=wn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=wn(r)}}function Xd(e){e.modified_||(e.modified_=!0,e.parent_&&Xd(e.parent_))}function zd(e){e.copy_||(e.copy_=Wd(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var LF=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let d=this;return function(m=a,...f){return d.produce(m,y=>r.call(this,y,...f))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let o;if(lt(t)){let a=Lg(this),d=Zd(t,void 0),p=!0;try{o=r(d),p=!1}finally{p?Kd(a):Jd(a)}return Mg(a,n),Qg(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===ep&&(o=void 0),this.autoFreeze_&&ps(o,!0),n){let a=[],d=[];En("Patches").generateReplacementPatches_(t,o,a,d),n(a,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){lt(e)||Ye(8),St(e)&&(e=Gg(e));let t=Lg(this),r=Zd(e,void 0);return r[ut].isManual_=!0,Jd(t),r}finishDraft(e,t){let r=e&&e[ut];(!r||!r.isManual_)&&Ye(9);let{scope_:n}=r;return Mg(n,t),Qg(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=En("Patches").applyPatches_;return St(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Zd(e,t){let r=Ga(e)?En("MapSet").proxyMap_(e,t):za(e)?En("MapSet").proxySet_(e,t):NF(e,t);return(t?t.scope_:$g()).drafts_.push(r),r}function Gg(e){return St(e)||Ye(10,e),zg(e)}function zg(e){if(!lt(e)||ms(e))return e;let t=e[ut],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Wd(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Wd(e,!0);return Ua(r,(n,o)=>{Bg(r,n,zg(o))}),t&&(t.finalized_=!1),r}function Wg(){let t="replace",r="add",n="remove";function o(v,C,x,b){switch(v.type_){case 0:case 2:return d(v,C,x,b);case 1:return a(v,C,x,b);case 3:return p(v,C,x,b)}}function a(v,C,x,b){let{base_:R,assigned_:F}=v,P=v.copy_;P.length<R.length&&([R,P]=[P,R],[x,b]=[b,x]);for(let I=0;I<R.length;I++)if(F[I]&&P[I]!==R[I]){let T=C.concat([I]);x.push({op:t,path:T,value:A(P[I])}),b.push({op:t,path:T,value:A(R[I])})}for(let I=R.length;I<P.length;I++){let T=C.concat([I]);x.push({op:r,path:T,value:A(P[I])})}for(let I=P.length-1;R.length<=I;--I){let T=C.concat([I]);b.push({op:n,path:T})}}function d(v,C,x,b){let{base_:R,copy_:F}=v;Ua(v.assigned_,(P,I)=>{let T=Hd(R,P),M=Hd(F,P),D=I?Ba(R,P)?t:r:n;if(T===M&&D===t)return;let q=C.concat(P);x.push(D===n?{op:D,path:q}:{op:D,path:q,value:M}),b.push(D===r?{op:n,path:q}:D===n?{op:r,path:q,value:A(T)}:{op:t,path:q,value:A(T)})})}function p(v,C,x,b){let{base_:R,copy_:F}=v,P=0;R.forEach(I=>{if(!F.has(I)){let T=C.concat([P]);x.push({op:n,path:T,value:I}),b.unshift({op:r,path:T,value:I})}P++}),P=0,F.forEach(I=>{if(!R.has(I)){let T=C.concat([P]);x.push({op:r,path:T,value:I}),b.unshift({op:n,path:T,value:I})}P++})}function m(v,C,x,b){x.push({op:t,path:[],value:C===ep?void 0:C}),b.push({op:t,path:[],value:v})}function f(v,C){return C.forEach(x=>{let{path:b,op:R}=x,F=v;for(let M=0;M<b.length-1;M++){let D=Pn(F),q=b[M];typeof q!="string"&&typeof q!="number"&&(q=""+q),(D===0||D===1)&&(q==="__proto__"||q==="constructor")&&Ye(19),typeof F=="function"&&q==="prototype"&&Ye(19),F=Hd(F,q),typeof F!="object"&&Ye(18,b.join("/"))}let P=Pn(F),I=y(x.value),T=b[b.length-1];switch(R){case t:switch(P){case 2:return F.set(T,I);case 3:Ye(16);default:return F[T]=I}case r:switch(P){case 1:return T==="-"?F.push(I):F.splice(T,0,I);case 2:return F.set(T,I);case 3:return F.add(I);default:return F[T]=I}case n:switch(P){case 1:return F.splice(T,1);case 2:return F.delete(T);case 3:return F.delete(x.value);default:return delete F[T]}default:Ye(17,R)}}),v}function y(v){if(!lt(v))return v;if(Array.isArray(v))return v.map(y);if(Ga(v))return new Map(Array.from(v.entries()).map(([x,b])=>[x,y(b)]));if(za(v))return new Set(Array.from(v).map(y));let C=Object.create(wn(v));for(let x in v)C[x]=y(v[x]);return Ba(v,_a)&&(C[_a]=v[_a]),C}function A(v){return St(v)?y(v):v}DF("Patches",{applyPatches_:f,generatePatches_:o,generateReplacementPatches_:m})}var Ct=new LF,Ar=Ct.produce,fs=Ct.produceWithPatches.bind(Ct),J0=Ct.setAutoFreeze.bind(Ct),X0=Ct.setUseStrictShallowCopy.bind(Ct),np=Ct.applyPatches.bind(Ct),Z0=Ct.createDraft.bind(Ct),eL=Ct.finishDraft.bind(Ct);l();s();u();c();function QF(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _F(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function UF(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 Yg=e=>Array.isArray(e)?e:[e];function BF(e){let t=Array.isArray(e[0])?e[0]:e;return UF(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function $F(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var sL=Symbol();var cL=Object.getPrototypeOf({});var HF=class{constructor(e){this.value=e}deref(){return this.value}},GF=typeof WeakRef<"u"?WeakRef:HF,zF=0,Kg=1;function gs(){return{s:zF,v:void 0,o:null,p:null}}function co(e,t={}){let r=gs(),{resultEqualityCheck:n}=t,o,a=0;function d(){let p=r,{length:m}=arguments;for(let A=0,v=m;A<v;A++){let C=arguments[A];if(typeof C=="function"||typeof C=="object"&&C!==null){let x=p.o;x===null&&(p.o=x=new WeakMap);let b=x.get(C);b===void 0?(p=gs(),x.set(C,p)):p=b}else{let x=p.p;x===null&&(p.p=x=new Map);let b=x.get(C);b===void 0?(p=gs(),x.set(C,p)):p=b}}let f=p,y;if(p.s===Kg)y=p.v;else if(y=e.apply(null,arguments),a++,n){let A=o?.deref?.()??o;A!=null&&n(A,y)&&(y=A,a!==0&&a--),o=typeof y=="object"&&y!==null||typeof y=="function"?new GF(y):y}return f.s=Kg,f.v=y,y}return d.clearCache=()=>{r=gs(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}function Jg(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,d=0,p,m={},f=o.pop();typeof f=="object"&&(m=f,f=o.pop()),QF(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);let y={...r,...m},{memoize:A,memoizeOptions:v=[],argsMemoize:C=co,argsMemoizeOptions:x=[],devModeChecks:b={}}=y,R=Yg(v),F=Yg(x),P=BF(o),I=A(function(){return a++,f.apply(null,arguments)},...R),T=!0,M=C(function(){d++;let q=$F(P,arguments);return p=I.apply(null,q),p},...F);return Object.assign(M,{resultFunc:f,memoizedResultFunc:I,dependencies:P,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:A,argsMemoize:C})};return Object.assign(n,{withTypes:()=>n}),n}var se=Jg(co),WF=Object.assign((e,t=se)=>{_F(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((d,p,m)=>(d[r[m]]=p,d),{}))},{withTypes:()=>WF});l();s();u();c();function Xg(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var Zg=Xg(),ey=Xg;var YF=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?so:so.apply(null,arguments)},IL=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},KF=e=>e&&typeof e.match=="function";function w(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Nt(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=>us(n)&&n.type===e,r}var ay=class Wa extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Wa.prototype)}static get[Symbol.species](){return Wa}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Wa(...t[0].concat(this)):new Wa(...t.concat(this))}};function ty(e){return lt(e)?Ar(e,()=>{}):e}function ry(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function JF(e){return typeof e=="boolean"}var XF=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},d=new ay;return r&&(JF(r)?d.push(Zg):d.push(ey(r.extraArgument))),d},Ya="RTK_autoBatch",lo=()=>e=>({payload:e,meta:{[Ya]:!0}}),ny=e=>t=>{setTimeout(t,e)},ZF=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,d=!1,p=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ny(10):e.type==="callback"?e.queueNotification:ny(e.timeout),f=()=>{d=!1,a&&(a=!1,p.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let A=()=>o&&y(),v=n.subscribe(A);return p.add(y),()=>{v(),p.delete(y)}},dispatch(y){try{return o=!y?.meta?.[Ya],a=!o,a&&(d||(d=!0,m(f))),n.dispatch(y)}finally{o=!0}}})},eI=e=>function(r){let{autoBatch:n=!0}=r??{},o=new ay(e);return n&&o.push(ZF(typeof n=="object"?n:void 0)),o};function iy(e){let t=XF(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:d=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Gt(r))p=io(r);else throw new Error(Nt(1));let m;typeof n=="function"?m=n(t):m=t();let f=so;o&&(f=YF({trace:!1,...typeof o=="object"&&o}));let y=Ng(...m),A=eI(y),v=typeof d=="function"?d(A):A(),C=f(...v);return $d(p,a,C)}function sy(e){let t={},r=[],n,o={addCase(a,d){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Nt(28));if(p in t)throw new Error(Nt(29));return t[p]=d,o},addMatcher(a,d){return r.push({matcher:a,reducer:d}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function tI(e){return typeof e=="function"}function oe(e,t){let[r,n,o]=sy(t),a;if(tI(e))a=()=>ty(e());else{let p=ty(e);a=()=>p}function d(p=a(),m){let f=[r[m.type],...n.filter(({matcher:y})=>y(m)).map(({reducer:y})=>y)];return f.filter(y=>!!y).length===0&&(f=[o]),f.reduce((y,A)=>{if(A)if(St(y)){let C=A(y,m);return C===void 0?y:C}else{if(lt(y))return Ar(y,v=>A(v,m));{let v=A(y,m);if(v===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return y},p)}return d.getInitialState=a,d}var cy=(e,t)=>KF(e)?e.match(t):e(t);function zt(...e){return t=>e.some(r=>cy(r,t))}function uo(...e){return t=>e.every(r=>cy(r,t))}function hs(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 Ka(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Ss(...e){return e.length===0?t=>hs(t,["pending"]):Ka(e)?zt(...e.map(t=>t.pending)):Ss()(e[0])}function Tn(...e){return e.length===0?t=>hs(t,["rejected"]):Ka(e)?zt(...e.map(t=>t.rejected)):Tn()(e[0])}function Ja(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?uo(Tn(...e),t):Ka(e)?uo(Tn(...e),t):Ja()(e[0])}function vr(...e){return e.length===0?t=>hs(t,["fulfilled"]):Ka(e)?zt(...e.map(t=>t.fulfilled)):vr()(e[0])}function Cs(...e){return e.length===0?t=>hs(t,["pending","fulfilled","rejected"]):Ka(e)?zt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Cs()(e[0])}var rI="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",As=(e=21)=>{let t="",r=e;for(;r--;)t+=rI[Math.random()*64|0];return t},nI=["name","message","stack","code"],op=class{constructor(e,t){Re(this,"_type");this.payload=e,this.meta=t}},oy=class{constructor(e,t){Re(this,"_type");this.payload=e,this.meta=t}},oI=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of nI)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,y,A)=>({payload:m,meta:{...A||{},arg:y,requestId:f,requestStatus:"fulfilled"}})),a=w(t+"/pending",(m,f,y)=>({payload:void 0,meta:{...y||{},arg:f,requestId:m,requestStatus:"pending"}})),d=w(t+"/rejected",(m,f,y,A,v)=>({payload:A,error:(n&&n.serializeError||oI)(m||"Rejected"),meta:{...v||{},arg:y,requestId:f,rejectedWithValue:!!A,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function p(m){return(f,y,A)=>{let v=n?.idGenerator?n.idGenerator(m):As(),C=new i.AbortController,x,b;function R(P){b=P,C.abort()}let F=async function(){let P;try{let T=n?.condition?.(m,{getState:y,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 M=new Promise((D,q)=>{x=()=>{q({name:"AbortError",message:b||"Aborted"})},C.signal.addEventListener("abort",x)});f(a(v,m,n?.getPendingMeta?.({requestId:v,arg:m},{getState:y,extra:A}))),P=await Promise.race([M,Promise.resolve(r(m,{dispatch:f,getState:y,extra:A,requestId:v,signal:C.signal,abort:R,rejectWithValue:(D,q)=>new op(D,q),fulfillWithValue:(D,q)=>new oy(D,q)})).then(D=>{if(D instanceof op)throw D;return D instanceof oy?o(D.payload,v,m,D.meta):o(D,v,m)})])}catch(T){P=T instanceof op?d(null,v,m,T.payload,T.meta):d(T,v,m)}finally{x&&C.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&d.match(P)&&P.meta.condition||f(P),P}();return Object.assign(F,{abort:R,requestId:v,arg:m,unwrap(){return F.then(aI)}})}}return Object.assign(p,{pending:a,rejected:d,fulfilled:o,settled:zt(d,o),typePrefix:t})}return e.withTypes=()=>e,e})();function aI(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 uy=Symbol.for("rtk-slice-createasyncthunk"),qL={[uy]:ee};function sI(e,t){return`${e}/${t}`}function cI({creators:e}={}){let t=e?.asyncThunk?.[uy];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Nt(11));typeof process<"u";let d=(typeof n.reducers=="function"?n.reducers(lI()):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(Nt(12));if(T in m.sliceCaseReducersByType)throw new Error(Nt(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:sI(o,P),createNotation:typeof n.reducers=="function"};pI(I)?fI(T,I,f,t):dI(T,I,f)});function y(){let[P={},I=[],T=void 0]=typeof n.extraReducers=="function"?sy(n.extraReducers):[n.extraReducers],M={...P,...m.sliceCaseReducersByType};return oe(n.initialState,D=>{for(let q in M)D.addCase(q,M[q]);for(let q of m.sliceMatchers)D.addMatcher(q.matcher,q.reducer);for(let q of I)D.addMatcher(q.matcher,q.reducer);T&&D.addDefaultCase(T)})}let A=P=>P,v=new Map,C;function x(P,I){return C||(C=y()),C(P,I)}function b(){return C||(C=y()),C.getInitialState()}function R(P,I=!1){function T(D){let q=D[P];return typeof q>"u"&&I&&(q=b()),q}function M(D=A){let q=ry(v,I,()=>new WeakMap);return ry(q,D,()=>{let O={};for(let[j,L]of Object.entries(n.selectors??{}))O[j]=uI(L,D,b,I);return O})}return{reducerPath:P,getSelectors:M,get selectors(){return M(T)},selectSlice:T}}let F={name:o,reducer:x,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:b,...R(a),injectInto(P,{reducerPath:I,...T}={}){let M=I??a;return P.inject({reducerPath:M,reducer:x},T),{...F,...R(M,!0)}}};return F}}function uI(e,t,r,n){function o(a,...d){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...d)}return o.unwrapped=e,o}var qn=cI();function lI(){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 dI({type:e,reducerName:t,createNotation:r},n,o){let a,d;if("reducer"in n){if(r&&!mI(n))throw new Error(Nt(17));a=n.reducer,d=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,d?w(e,d):w(e))}function pI(e){return e._reducerDefinitionType==="asyncThunk"}function mI(e){return e._reducerDefinitionType==="reducerWithPrepare"}function fI({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Nt(18));let{payloadCreator:a,fulfilled:d,pending:p,rejected:m,settled:f,options:y}=r,A=o(e,a,y);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||ys,pending:p||ys,rejected:m||ys,settled:f||ys})}function ys(){}var ly="listener",dy="completed",py="cancelled",kL=`task-${py}`,OL=`task-${dy}`,DL=`${ly}-${py}`,jL=`${ly}-${dy}`;var{assign:my}=Object;var ap="listenerMiddleware";var gI=my(w(`${ap}/add`),{withTypes:()=>gI}),VL=w(`${ap}/removeAll`),yI=my(w(`${ap}/remove`),{withTypes:()=>yI});var NL=Symbol.for("rtk-state-proxy-original");function Nt(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 fy=/^(?:[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"&&fy.test(e)}var ip=hI;l();s();u();c();var Ke=[];for(let e=0;e<256;++e)Ke.push((e+256).toString(16).slice(1));function gy(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 sp,SI=new Uint8Array(16);function cp(){if(!sp){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");sp=crypto.getRandomValues.bind(crypto)}return sp(SI)}l();s();u();c();l();s();u();c();var CI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),up={randomUUID:CI};function AI(e,t,r){if(up.randomUUID&&!t&&!e)return up.randomUUID();e=e||{};let n=e.random??e.rng?.()??cp();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 gy(n)}var lp=AI;l();s();u();c();function yy(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function vI({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:d}=e;d!=="disabled"&&(n.call(r),t.send(o,a,r))}var hy="visitorId";function xI(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(hy),o=n&&ip(n)?n:t.generateUUID();return r.setItem(hy,o),o}}}var Cy="1.2.5";function RI(e){let{trackingId:t}=e;return{trackingId:t}}function bI(e){return(e.source||[]).concat([`relay@${Cy}`])}function Ay(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:d}=r,p=RI(t),m=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:bI(t),clientId:m,userAgent:d(),referrer:o(),location:a()})}function FI(e,t,r,n,o){return{...t,meta:Ay(e,r,n,o)}}var II="*";function wI(){let e=[];function t({type:m,callback:f}){return e.findIndex(y=>y.type===m&&y.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(y){console.error(y)}})}function a(m){if(m===II)e.length=0;else for(let f=e.length-1;f>=0;f--)e[f].type===m&&e.splice(f,1)}function d(m){let f=t(m);f>=0&&e.splice(f,1)}function p(m,f){f?d({type:m,callback:f}):a(m)}return{add:n,call:o,remove:p}}function Sy({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 PI(e){let t=Sy(e);return{get:()=>t,update:r=>{t=Sy({...t,...r})}}}var dp=EI();function EI(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let d=a.replace(/^\s+/,"");if(d.lastIndexOf(n,0)===0)return d.substring(n.length,d.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),d=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${d}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function TI(){return{getItem(e){return dp.getItem(e)||localStorage.getItem(e)},removeItem(e){dp.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),dp.setItem(e,t,31556952e3)}}}function qI(){let e=document.referrer;return e===""?null:vy(e)}function vy(e){return e.slice(0,1024)}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(yy().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:()=>qI(),getLocation:()=>vy(window.location.href),getUserAgent:()=>navigator.userAgent,generateUUID:()=>lp(),storage:TI()}}function OI(){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 DI(){return{getItem(){return null},removeItem(){},setItem(){}}}function jI(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:DI()}}function VI(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=jI();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&NI()&&OI()?kI():n}function NI(){try{return typeof window=="object"}catch{return!1}}function MI(e){return{get:()=>Object.freeze(VI(e))}}function xy(e){let t=PI(e),r=wI(),n=MI(t),o=xI(n);return{emit:(a,d)=>{let p=t.get(),m=n.get(),f=FI(a,d,p,m,o);return vI({config:p,environment:m,event:f,listenerManager:r})},getMeta:a=>Ay(a,t.get(),n.get(),o),on:(a,d)=>r.add({type:a,callback:d}),off:(a,d)=>r.remove(a,d),updateConfig:a=>t.update(a),version:Cy}}l();s();u();c();l();s();u();c();var po="3.27.6-pre.a6711533d8",Ry=["@coveo/atomic","@coveo/quantic"];var Mr=se(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${po}`));var mo=se(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Mr(e.configuration.analytics),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},d)=>xy({mode:a?"emit":"disabled",url:o??as(e,t),token:r,trackingId:n??null,source:d}));l();s();u();c();l();s();u();c();function Wt(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 V(e,t,r,n){function o(a){return a instanceof r?a:new r(function(d){d(a)})}return new(r||(r=Promise))(function(a,d){function p(y){try{f(n.next(y))}catch(A){d(A)}}function m(y){try{f(n.throw(y))}catch(A){d(A)}}function f(y){y.done?a(y.value):o(y.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 fp(){return typeof window<"u"}function Pp(){return typeof navigator<"u"}function fo(){return typeof document<"u"}function gp(){try{return typeof localStorage<"u"}catch{return!1}}function LI(){try{return typeof sessionStorage<"u"}catch{return!1}}function Vy(){return Pp()&&navigator.cookieEnabled}var QI=[Ce.click,Ce.custom,Ce.search,Ce.view],_I=(e,t)=>QI.indexOf(e)!==-1?Object.assign({language:fo()?document.documentElement.lang:"unknown",userAgent:Pp()?navigator.userAgent:"unknown"},t):t,Za=class e{static set(t,r,n){var o,a,d,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?by(t,r,a):(d=p.split("."),o=d[d.length-2]+"."+d[d.length-1],by(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function by(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function UI(){return gp()?localStorage:Vy()?new ei:LI()?sessionStorage:new yo}var ei=class e{getItem(t){return Za.get(`${e.prefix}${t}`)}removeItem(t){Za.erase(`${e.prefix}${t}`)}setItem(t,r,n){Za.set(`${e.prefix}${t}`,r,n)}};ei.prefix="coveo_";var yp=class{constructor(){this.cookieStorage=new ei}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){}},vs="__coveo.analytics.history",BI=20,$I=1e3*60,HI=75,bs=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 V(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(vs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(vs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(vs,JSON.stringify(t.slice(0,BI)))}catch{}}clear(){try{this.store.removeItem(vs)}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,HI)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>$I:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var GI=(e,t)=>V(void 0,void 0,void 0,function*(){return e===Ce.view?(yield zI(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),zI=e=>V(void 0,void 0,void 0,function*(){let t=new bs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),xs,WI=new Uint8Array(16);function YI(){if(!xs&&(xs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xs(WI)}var KI=/^(?:[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 Fs(e){return typeof e=="string"&&KI.test(e)}var Je=[];for(let e=0;e<256;++e)Je.push((e+256).toString(16).slice(1));function Ny(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 JI(e){if(!Fs(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 XI(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ZI="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ew="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function tw(e,t,r){function n(o,a,d,p){var m;if(typeof o=="string"&&(o=XI(o)),typeof a=="string"&&(a=JI(a)),((m=a)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+o.length);if(f.set(a),f.set(o,a.length),f=r(f),f[6]=f[6]&15|t,f[8]=f[8]&63|128,d){p=p||0;for(let y=0;y<16;++y)d[p+y]=f[y];return d}return Ny(f)}try{n.name=e}catch{}return n.DNS=ZI,n.URL=ew,n}var rw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fy={randomUUID:rw};function kn(e,t,r){if(Fy.randomUUID&&!t&&!e)return Fy.randomUUID();e=e||{};let n=e.random||(e.rng||YI)();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 Ny(n)}function nw(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 pp(e,t){return e<<t|e>>>32-t}function ow(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let d=unescape(encodeURIComponent(e));e=[];for(let p=0;p<d.length;++p)e.push(d.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let d=0;d<o;++d){let p=new Uint32Array(16);for(let m=0;m<16;++m)p[m]=e[d*64+m*4]<<24|e[d*64+m*4+1]<<16|e[d*64+m*4+2]<<8|e[d*64+m*4+3];a[d]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let d=0;d<o;++d){let p=new Uint32Array(80);for(let C=0;C<16;++C)p[C]=a[d][C];for(let C=16;C<80;++C)p[C]=pp(p[C-3]^p[C-8]^p[C-14]^p[C-16],1);let m=r[0],f=r[1],y=r[2],A=r[3],v=r[4];for(let C=0;C<80;++C){let x=Math.floor(C/20),b=pp(m,5)+nw(x,f,y,A)+v+t[x]+p[C]>>>0;v=A,A=y,y=pp(f,30)>>>0,f=m,m=b}r[0]=r[0]+m>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+A>>>0,r[4]=r[4]+v>>>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 aw=tw("v5",80,ow),Iy=aw,My="2.30.45",wy=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Xa={pageview:"pageview",event:"event"},Is=class{constructor({client:t,uuidGenerator:r=kn}){this.client=t,this.uuidGenerator=r}},hp=class extends Is{constructor({client:t,uuidGenerator:r=kn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=wy(window.location),this.lastReferrer=fo()?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:fo()?document.title:"",encoding:fo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Xa.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Xa.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Xa.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Xa.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 wy(window.location)}},Lr=class e{constructor(t,r){if(!Fs(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Fs(a)?new e(a,Number.parseInt(o)*1e3):null}};Lr.cvo_cid="cvo_cid";Lr.expirationTime=120;var Sp=class extends Is{constructor({client:t,uuidGenerator:r=kn}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return V(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Lr.cvo_cid,new Lr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Sp.Id="link";var Pt=Object.keys;function Rs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var mp=128,Ly=192,Py=224,Ey=240;function iw(e){return(e&248)===Ey?4:(e&Ey)===Py?3:(e&Py)===Ly?2:1}function sw(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&mp)!=mp)break;if(r-=3,(n&Ly)!=mp){t-r>=iw(n)*3&&(r=t);break}}return e.substring(0,r)}var Cp={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"},cw=Pt(Cp).map(e=>Cp[e]),uw=[...cw].join("|"),lw=new RegExp(`^(${uw}$)`),dw={svcAction:"svc_action",svcActionData:"svc_action_data"},pw=e=>Pt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Cp[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),mw=e=>lw.test(e),fw=[mw],Ty={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},qy={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},et={action:"pa",list:"pal",listSource:"pls"},ws={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},gw=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ap={id:"quoteId",affiliation:"quoteAffiliation"},vp={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},yw={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),ws),purchase:Object.assign(Object.assign({},et),ws),quickview:et,quote:Object.assign(Object.assign({},et),Ap),review:Object.assign(Object.assign({},et),vp)},hw=Pt(Ty).map(e=>Ty[e]),Sw=Pt(qy).map(e=>qy[e]),Cw=Pt(et).map(e=>et[e]),Aw=Pt(ws).map(e=>ws[e]),vw=Pt(vp).map(e=>vp[e]),xw=Pt(Ap).map(e=>Ap[e]),Rw=[...hw,"custom"].join("|"),bw=[...Sw,"custom"].join("|"),Qy="(pr[0-9]+)",_y="(il[0-9]+pi[0-9]+)",Fw=new RegExp(`^${Qy}(${Rw})$`),Iw=new RegExp(`^(${_y}(${bw}))|(il[0-9]+nm)$`),ww=new RegExp(`^(${Cw.join("|")})$`),Pw=new RegExp(`^(${Aw.join("|")})$`),Ew=new RegExp(`^${Qy}custom$`),Tw=new RegExp(`^${_y}custom$`),qw=new RegExp(`^(${[...gw,...vw,...xw].join("|")})$`),kw=e=>Fw.test(e),Ow=e=>Iw.test(e),Dw=e=>ww.test(e),jw=e=>Pw.test(e),Vw=e=>qw.test(e),Nw=[Ow,kw,Dw,jw,Vw],Mw=[Ew,Tw],Lw={anonymizeIp:"aip"},Qw={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({},Lw),Qw),_w),Uw.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),xp=Object.assign(Object.assign({},Bw),dw),$w=e=>{let t=!!e.action&&yw[e.action]||{};return Pt(e).reduce((r,n)=>{let o=t[n]||xp[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Hw=Pt(xp).map(e=>xp[e]),Gw=e=>Hw.indexOf(e)!==-1,zw=e=>e==="custom",Ww=e=>[...Nw,...fw,Gw,zw].some(t=>t(e)),Yw=e=>Pt(e).reduce((t,r)=>{let n=Kw(r);return n?Object.assign(Object.assign({},t),Jw(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Kw=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},Jw=(e,t)=>Pt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Rp=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error('navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like "sendbeacon-polyfill".');let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:d,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),m=this.encodeForEventType(t,p),f=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(d,f)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(this,void 0,void 0,function*(){let o=t,a=r;if(n){let d=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:m}=d;o=p||t;try{a=JSON.parse(m)}catch(f){console.error("Unable to process the request body as a JSON string",f)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[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 V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},ky=g.fetch,Ps=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,d=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${d}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:f}=m,y=Wt(m,["url"]),A;try{A=yield ky(f,y)}catch(v){console.error("An error has occured when sending the event.",v);return}if(A.ok){let v=yield A.json();return v.visitorId&&o.setCurrentVisitorId(v.visitorId),v}else{try{A.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,A,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield ky(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ce.click,Ce.custom,Ce.search,Ce.view].indexOf(t)!==-1}getVisitorIdParam(){return V(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Fp=class{constructor(t,r){gp()&&Vy()?this.storage=new yp:gp()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new yo),this.client=new Ps(t),this.beaconClient=new Rp(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Ip=class{constructor(t,r){this.storage=r||new yo,this.client=new Ps(t)}getClientDependingOnEventType(t){return this.client}},Es=class{constructor(){this.storage=new yo,this.client=new bp}getClientDependingOnEventType(t){return this.client}},Xw="xx",Zw=e=>e?.startsWith(Xw)||!1,eP=`
|
|
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
|