@coveo/quantic 3.30.0-pre.e3bf4d7bb2 → 3.30.0-pre.e4dec75021
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +8 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/analytics/analytics-relay-client.d.ts +18 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/api-client-utils.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/recommendations/recommendations-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/query-suggest/query-suggest-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +5 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-case-classifications/get-case-classifications-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-document-suggestions/get-document-suggestions-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/get-interface/get-interface-config-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/query/query-request.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/user-actions/user-actions-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions-loader.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +25 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +10 -10
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +9 -9
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +7 -7
- package/package.json +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-actions.d.ts +0 -15
|
@@ -14,21 +14,21 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var m=r.next();return a=m.done,m},e:function(m){f=!0,i=m},f:function(){try{a||r.return==null||r.return()}finally{if(f)throw i}}}}function Ei(){return Ei=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=wf(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},Ei.apply(null,arguments)}function Jt(e){return Jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jt(e)}function Af(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ii(e,t)}function Ys(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ys=function(){return!!e})()}function Cf(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vf(e)}function Ii(e,t){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ii(e,t)}function wf(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Jt(e))!==null;);return e}function xf(e,t,r,n){var o=Ei(Jt(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function Rf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ef(e){var t=Rf(e,"string");return typeof t=="symbol"?t:t+""}function If(e,t){if(e){if(typeof e=="string")return zs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zs(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function kf(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function Pf(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var Ks=function(){function e(){ki(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Pi(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var y=i[f];try{y.callback.call(n,r)}catch(h){Promise.resolve().then(function(){throw h})}y.options&&y.options.once&&n.removeEventListener(r.type,y.callback)},f=0,m=i.length;f<m;f++)a();return!r.defaultPrevented}}}])}(),Fi=function(e){function t(){var r;return ki(this,t),r=bf(this,t),r.listeners||Ks.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return Af(t,e),Pi(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),xf(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new Dn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new Dn;function i(){o.abort(this.reason),a()}function a(){var y=Ws(n),h;try{for(y.s();!(h=y.n()).done;){var S=h.value;S.removeEventListener("abort",i)}}catch(g){y.e(g)}finally{y.f()}}var f=Ws(n),m;try{for(f.s();!(m=f.n()).done;){var p=m.value;if(p.aborted){o.abort(p.reason);break}else p.addEventListener("abort",i)}}catch(y){f.e(y)}finally{f.f()}return o.signal}}])}(Ks),Dn=function(){function e(){ki(this,e),Object.defineProperty(this,"signal",{value:new Fi,writable:!0,configurable:!0})}return Pi(e,[{key:"abort",value:function(r){var n=Pf(r),o=kf(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Dn.prototype[Symbol.toStringTag]="AbortController",Fi.prototype[Symbol.toStringTag]="AbortSignal");function Ff(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Of(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,f=a===void 0?!1:a;if(!Ff({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:f}))return{fetch:r,Request:m};var m=o;(m&&!m.prototype.hasOwnProperty("signal")||f)&&(m=function(S,g){var v;g&&g.signal&&(v=g.signal,delete g.signal);var R=new o(S,g);return v&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),R},m.prototype=o.prototype);var p=r,y=function(S,g){var v=m&&m.prototype.isPrototypeOf(S)?S.signal:g?g.signal:void 0;if(v){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(v.aborted)return Promise.reject(R);var k=new Promise(function(x,P){v.addEventListener("abort",function(){return P(R)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([k,p(S,g)])}return p(S,g)};return{fetch:y,Request:m}}Hr.AbortController=Dn;Hr.AbortSignal=Fi;Hr.abortableFetch=Of});var Js,s,A,l=$r(()=>{"use strict";Js=Qe(Oi(),1),s=Qe(Oi(),1),{fetch:A}=(0,Js.abortableFetch)({fetch})});function zr(e){if(Uf.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Ti(e){return e.replace(Qf,"")}function Gr(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!Bf(r))return!1}return!0}function Bf(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function Zs(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var Tf,oc,Df,ic,qf,Mf,jf,Nf,_f,Vf,Lf,Uf,Xs,Qf,Xt,Di,ec,tc,rc,nc,C,sc=$r(()=>{"use strict";d();c();l();u();Tf=Object.create,oc=Object.defineProperty,Df=Object.getOwnPropertyDescriptor,ic=Object.getOwnPropertyNames,qf=Object.getPrototypeOf,Mf=Object.prototype.hasOwnProperty,jf=(e,t)=>function(){return t||(0,e[ic(e)[0]])((t={exports:{}}).exports,t),t.exports},Nf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ic(t))!Mf.call(e,o)&&o!==r&&oc(e,o,{get:()=>t[o],enumerable:!(n=Df(t,o))||n.enumerable});return e},_f=(e,t,r)=>(r=e!=null?Tf(qf(e)):{},Nf(t||!e||!e.__esModule?oc(r,"default",{value:e,enumerable:!0}):r,e)),Vf=jf({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(m){return typeof m=="string"&&!!m.trim()}function o(m,p){var y=m.split(";").filter(n),h=y.shift(),S=i(h),g=S.name,v=S.value;p=p?Object.assign({},r,p):r;try{v=p.decodeValues?decodeURIComponent(v):v}catch(k){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+v+"'. Set options.decodeValues to false to disable this feature.",k)}var R={name:g,value:v};return y.forEach(function(k){var x=k.split("="),P=x.shift().trimLeft().toLowerCase(),w=x.join("=");P==="expires"?R.expires=new Date(w):P==="max-age"?R.maxAge=parseInt(w,10):P==="secure"?R.secure=!0:P==="httponly"?R.httpOnly=!0:P==="samesite"?R.sameSite=w:R[P]=w}),R}function i(m){var p="",y="",h=m.split("=");return h.length>1?(p=h.shift(),y=h.join("=")):y=m,{name:p,value:y}}function a(m,p){if(p=p?Object.assign({},r,p):r,!m)return p.map?{}:[];if(m.headers)if(typeof m.headers.getSetCookie=="function")m=m.headers.getSetCookie();else if(m.headers["set-cookie"])m=m.headers["set-cookie"];else{var y=m.headers[Object.keys(m.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!y&&m.headers.cookie&&!p.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),m=y}if(Array.isArray(m)||(m=[m]),p=p?Object.assign({},r,p):r,p.map){var h={};return m.filter(n).reduce(function(S,g){var v=o(g,p);return S[v.name]=v,S},h)}else return m.filter(n).map(function(S){return o(S,p)})}function f(m){if(Array.isArray(m))return m;if(typeof m!="string")return[];var p=[],y=0,h,S,g,v,R;function k(){for(;y<m.length&&/\s/.test(m.charAt(y));)y+=1;return y<m.length}function x(){return S=m.charAt(y),S!=="="&&S!==";"&&S!==","}for(;y<m.length;){for(h=y,R=!1;k();)if(S=m.charAt(y),S===","){for(g=y,y+=1,k(),v=y;y<m.length&&x();)y+=1;y<m.length&&m.charAt(y)==="="?(R=!0,y=v,p.push(m.substring(h,g)),h=y):y=g+1}else y+=1;(!R||y>=m.length)&&p.push(m.substring(h,m.length))}return p}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=f}}),Lf=_f(Vf()),Uf=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Xs=[`
|
|
19
|
-
`,"\r","\t"," "],Qf=new RegExp(`(^[${Xs.join("")}]|$[${Xs.join("")}])`,"g");Xt=Symbol("normalizedHeaders"),Di=Symbol("rawHeaderNames"),ec=", ",C=class ac{constructor(t){this[tc]={},this[rc]=new Map,this[nc]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof ac||typeof b.Headers<"u"&&t instanceof b.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(ec):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(ec):n)})}[(tc=Xt,rc=Di,nc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[Xt]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Gr(t))throw new TypeError(`Invalid header name "${t}"`);return this[Xt].hasOwnProperty(zr(t))}get(t){if(!Gr(t))throw TypeError(`Invalid header name "${t}"`);return this[Xt][zr(t)]??null}set(t,r){if(!Gr(t)||!Zs(r))return;let n=zr(t),o=Ti(r);this[Xt][n]=Ti(o),this[Di].set(n,t)}append(t,r){if(!Gr(t)||!Zs(r))return;let n=zr(t),o=Ti(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!Gr(t)||!this.has(t))return;let r=zr(t);delete this[Xt][r],this[Di].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,Lf.splitCookiesString)(t)}}});var d=$r(()=>{"use strict";sc()});var gc=Se(Yr=>{"use strict";d();c();l();u();var jn=Yr&&Yr.__assign||function(){return jn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},jn.apply(this,arguments)};Object.defineProperty(Yr,"__esModule",{value:!0});var Xf={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Zf(e){var t=jn(jn({},Xf),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Yr.getSanitizedOptions=Zf});var yc=Se(Ni=>{"use strict";d();c();l();u();Object.defineProperty(Ni,"__esModule",{value:!0});function em(e){var t=Math.random()*e;return Math.round(t)}Ni.fullJitter=em});var hc=Se(_i=>{"use strict";d();c();l();u();Object.defineProperty(_i,"__esModule",{value:!0});function tm(e){return e}_i.noJitter=tm});var Sc=Se(Vi=>{"use strict";d();c();l();u();Object.defineProperty(Vi,"__esModule",{value:!0});var rm=yc(),nm=hc();function om(e){switch(e.jitter){case"full":return rm.fullJitter;case"none":default:return nm.noJitter}}Vi.JitterFactory=om});var Ui=Se(Li=>{"use strict";d();c();l();u();Object.defineProperty(Li,"__esModule",{value:!0});var im=Sc(),am=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=im.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Li.Delay=am});var vc=Se(tt=>{"use strict";d();c();l();u();var sm=tt&&tt.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),cm=tt&&tt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(y){try{p(n.next(y))}catch(h){a(h)}}function m(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(f,m)}p((n=n.apply(e,t||[])).next())})},um=tt&&tt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(p){return function(y){return m([p,y])}}function m(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(y){p=[6,y],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(tt,"__esModule",{value:!0});var lm=Ui(),dm=function(e){sm(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return cm(this,void 0,void 0,function(){return um(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(lm.Delay);tt.SkipFirstDelay=dm});var bc=Se(Jr=>{"use strict";d();c();l();u();var pm=Jr&&Jr.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Jr,"__esModule",{value:!0});var fm=Ui(),mm=function(e){pm(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(fm.Delay);Jr.AlwaysDelay=mm});var Ac=Se(Qi=>{"use strict";d();c();l();u();Object.defineProperty(Qi,"__esModule",{value:!0});var gm=vc(),ym=bc();function hm(e,t){var r=Sm(e);return r.setAttemptNumber(t),r}Qi.DelayFactory=hm;function Sm(e){return e.delayFirstAttempt?new ym.AlwaysDelay(e):new gm.SkipFirstDelay(e)}});var Cc=Se(Mt=>{"use strict";d();c();l();u();var Bi=Mt&&Mt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(y){try{p(n.next(y))}catch(h){a(h)}}function m(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(f,m)}p((n=n.apply(e,t||[])).next())})},$i=Mt&&Mt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(p){return function(y){return m([p,y])}}function m(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(y){p=[6,y],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(Mt,"__esModule",{value:!0});var vm=gc(),bm=Ac();function Am(e,t){return t===void 0&&(t={}),Bi(this,void 0,void 0,function(){var r,n;return $i(this,function(o){switch(o.label){case 0:return r=vm.getSanitizedOptions(t),n=new Cm(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Mt.backOff=Am;var Cm=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Bi(this,void 0,void 0,function(){var t,r;return $i(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return Bi(this,void 0,void 0,function(){var t;return $i(this,function(r){switch(r.label){case 0:return t=bm.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Vo=Se((Za,es)=>{"use strict";d();c();l();u();(function(e,t){typeof Za=="object"&&typeof es<"u"?es.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs=t()})(Za,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",f="day",m="week",p="month",y="quarter",h="year",S="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(U){var V=["th","st","nd","rd"],_=U%100;return"["+U+(V[(_-20)%10]||V[_]||V[0])+"]"}},x=function(U,V,_){var B=String(U);return!B||B.length>=V?U:""+Array(V+1-B.length).join(_)+U},P={s:x,z:function(U){var V=-U.utcOffset(),_=Math.abs(V),B=Math.floor(_/60),L=_%60;return(V<=0?"+":"-")+x(B,2,"0")+":"+x(L,2,"0")},m:function U(V,_){if(V.date()<_.date())return-U(_,V);var B=12*(_.year()-V.year())+(_.month()-V.month()),L=V.clone().add(B,p),z=_-L<0,G=V.clone().add(B+(z?-1:1),p);return+(-(B+(_-L)/(z?L-G:G-L))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:p,y:h,w:m,d:f,D:S,h:a,m:i,s:o,ms:n,Q:y}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},w="en",E={};E[w]=k;var j="$isDayjsObject",O=function(U){return U instanceof N||!(!U||!U[j])},I=function U(V,_,B){var L;if(!V)return w;if(typeof V=="string"){var z=V.toLowerCase();E[z]&&(L=z),_&&(E[z]=_,L=z);var G=V.split("-");if(!L&&G.length>1)return U(G[0])}else{var Y=V.name;E[Y]=V,L=Y}return!B&&L&&(w=L),L||!B&&w},F=function(U,V){if(O(U))return U.clone();var _=typeof V=="object"?V:{};return _.date=U,_.args=arguments,new N(_)},T=P;T.l=I,T.i=O,T.w=function(U,V){return F(U,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var N=function(){function U(_){this.$L=I(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[j]=!0}var V=U.prototype;return V.parse=function(_){this.$d=function(B){var L=B.date,z=B.utc;if(L===null)return new Date(NaN);if(T.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var G=L.match(v);if(G){var Y=G[2]-1||0,te=(G[7]||"0").substring(0,3);return z?new Date(Date.UTC(G[1],Y,G[3]||1,G[4]||0,G[5]||0,G[6]||0,te)):new Date(G[1],Y,G[3]||1,G[4]||0,G[5]||0,G[6]||0,te)}}return new Date(L)}(_),this.init()},V.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},V.$utils=function(){return T},V.isValid=function(){return this.$d.toString()!==g},V.isSame=function(_,B){var L=F(_);return this.startOf(B)<=L&&L<=this.endOf(B)},V.isAfter=function(_,B){return F(_)<this.startOf(B)},V.isBefore=function(_,B){return this.endOf(B)<F(_)},V.$g=function(_,B,L){return T.u(_)?this[B]:this.set(L,_)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(_,B){var L=this,z=!!T.u(B)||B,G=T.p(_),Y=function(ce,me){var he=T.w(L.$u?Date.UTC(L.$y,me,ce):new Date(L.$y,me,ce),L);return z?he:he.endOf(f)},te=function(ce,me){return T.w(L.toDate()[ce].apply(L.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(me)),L)},se=this.$W,ee=this.$M,re=this.$D,Z="set"+(this.$u?"UTC":"");switch(G){case h:return z?Y(1,0):Y(31,11);case p:return z?Y(1,ee):Y(0,ee+1);case m:var oe=this.$locale().weekStart||0,ye=(se<oe?se+7:se)-oe;return Y(z?re-ye:re+(6-ye),ee);case f:case S:return te(Z+"Hours",0);case a:return te(Z+"Minutes",1);case i:return te(Z+"Seconds",2);case o:return te(Z+"Milliseconds",3);default:return this.clone()}},V.endOf=function(_){return this.startOf(_,!1)},V.$set=function(_,B){var L,z=T.p(_),G="set"+(this.$u?"UTC":""),Y=(L={},L[f]=G+"Date",L[S]=G+"Date",L[p]=G+"Month",L[h]=G+"FullYear",L[a]=G+"Hours",L[i]=G+"Minutes",L[o]=G+"Seconds",L[n]=G+"Milliseconds",L)[z],te=z===f?this.$D+(B-this.$W):B;if(z===p||z===h){var se=this.clone().set(S,1);se.$d[Y](te),se.init(),this.$d=se.set(S,Math.min(this.$D,se.daysInMonth())).$d}else Y&&this.$d[Y](te);return this.init(),this},V.set=function(_,B){return this.clone().$set(_,B)},V.get=function(_){return this[T.p(_)]()},V.add=function(_,B){var L,z=this;_=Number(_);var G=T.p(B),Y=function(ee){var re=F(z);return T.w(re.date(re.date()+Math.round(ee*_)),z)};if(G===p)return this.set(p,this.$M+_);if(G===h)return this.set(h,this.$y+_);if(G===f)return Y(1);if(G===m)return Y(7);var te=(L={},L[i]=t,L[a]=r,L[o]=e,L)[G]||1,se=this.$d.getTime()+_*te;return T.w(se,this)},V.subtract=function(_,B){return this.add(-1*_,B)},V.format=function(_){var B=this,L=this.$locale();if(!this.isValid())return L.invalidDate||g;var z=_||"YYYY-MM-DDTHH:mm:ssZ",G=T.z(this),Y=this.$H,te=this.$m,se=this.$M,ee=L.weekdays,re=L.months,Z=L.meridiem,oe=function(me,he,Pe,_e){return me&&(me[he]||me(B,z))||Pe[he].slice(0,_e)},ye=function(me){return T.s(Y%12||12,me,"0")},ce=Z||function(me,he,Pe){var _e=me<12?"AM":"PM";return Pe?_e.toLowerCase():_e};return z.replace(R,function(me,he){return he||function(Pe){switch(Pe){case"YY":return String(B.$y).slice(-2);case"YYYY":return T.s(B.$y,4,"0");case"M":return se+1;case"MM":return T.s(se+1,2,"0");case"MMM":return oe(L.monthsShort,se,re,3);case"MMMM":return oe(re,se);case"D":return B.$D;case"DD":return T.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return oe(L.weekdaysMin,B.$W,ee,2);case"ddd":return oe(L.weekdaysShort,B.$W,ee,3);case"dddd":return ee[B.$W];case"H":return String(Y);case"HH":return T.s(Y,2,"0");case"h":return ye(1);case"hh":return ye(2);case"a":return ce(Y,te,!0);case"A":return ce(Y,te,!1);case"m":return String(te);case"mm":return T.s(te,2,"0");case"s":return String(B.$s);case"ss":return T.s(B.$s,2,"0");case"SSS":return T.s(B.$ms,3,"0");case"Z":return G}return null}(me)||G.replace(":","")})},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(_,B,L){var z,G=this,Y=T.p(B),te=F(_),se=(te.utcOffset()-this.utcOffset())*t,ee=this-te,re=function(){return T.m(G,te)};switch(Y){case h:z=re()/12;break;case p:z=re();break;case y:z=re()/3;break;case m:z=(ee-se)/6048e5;break;case f:z=(ee-se)/864e5;break;case a:z=ee/r;break;case i:z=ee/t;break;case o:z=ee/e;break;default:z=ee}return L?z:T.a(z)},V.daysInMonth=function(){return this.endOf(p).$D},V.$locale=function(){return E[this.$L]},V.locale=function(_,B){if(!_)return this.$L;var L=this.clone(),z=I(_,B,!0);return z&&(L.$L=z),L},V.clone=function(){return T.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},U}(),$=N.prototype;return F.prototype=$,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",f],["$M",p],["$y",h],["$D",S]].forEach(function(U){$[U[1]]=function(V){return this.$g(V,U[0],U[1])}}),F.extend=function(U,V){return U.$i||(U(V,N,F),U.$i=!0),F},F.locale=I,F.isDayjs=O,F.unix=function(U){return F(1e3*U)},F.en=E[w],F.Ls=E,F.p={},F})});var Pl=Se((ts,rs)=>{"use strict";d();c();l();u();(function(e,t){typeof ts=="object"&&typeof rs<"u"?rs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_quarterOfYear=t()})(ts,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(f){return this.$utils().u(f)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(f-1))};var i=o.add;o.add=function(f,m){return f=Number(f),this.$utils().p(m)===t?this.add(3*f,e):i.bind(this)(f,m)};var a=o.startOf;o.startOf=function(f,m){var p=this.$utils(),y=!!p.u(m)||m;if(p.p(f)===t){var h=this.quarter()-1;return y?this.month(3*h).startOf(e).startOf("day"):this.month(3*h+2).endOf(e).endOf("day")}return a.bind(this)(f,m)}}})});var Fl=Se((ns,os)=>{"use strict";d();c();l();u();(function(e,t){typeof ns=="object"&&typeof os<"u"?os.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_customParseFormat=t()})(ns,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},f=function(v){return(v=+v)+(v>68?1900:2e3)},m=function(v){return function(R){this[v]=+R}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var k=R.match(/([+-]|\d\d)/g),x=60*k[1]+(+k[2]||0);return x===0?0:k[0]==="+"?-x:x}(v)}],y=function(v){var R=a[v];return R&&(R.indexOf?R:R.s.concat(R.f))},h=function(v,R){var k,x=a.meridiem;if(x){for(var P=1;P<=24;P+=1)if(v.indexOf(x(P,0,R))>-1){k=P>12;break}}else k=v===(R?"pm":"PM");return k},S={A:[i,function(v){this.afternoon=h(v,!1)}],a:[i,function(v){this.afternoon=h(v,!0)}],Q:[r,function(v){this.month=3*(v-1)+1}],S:[r,function(v){this.milliseconds=100*+v}],SS:[n,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[o,m("seconds")],ss:[o,m("seconds")],m:[o,m("minutes")],mm:[o,m("minutes")],H:[o,m("hours")],h:[o,m("hours")],HH:[o,m("hours")],hh:[o,m("hours")],D:[o,m("day")],DD:[n,m("day")],Do:[i,function(v){var R=a.ordinal,k=v.match(/\d+/);if(this.day=k[0],R)for(var x=1;x<=31;x+=1)R(x).replace(/\[|\]/g,"")===v&&(this.day=x)}],w:[o,m("week")],ww:[n,m("week")],M:[o,m("month")],MM:[n,m("month")],MMM:[i,function(v){var R=y("months"),k=(y("monthsShort")||R.map(function(x){return x.slice(0,3)})).indexOf(v)+1;if(k<1)throw new Error;this.month=k%12||k}],MMMM:[i,function(v){var R=y("months").indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,m("year")],YY:[n,function(v){this.year=f(v)}],YYYY:[/\d{4}/,m("year")],Z:p,ZZ:p};function g(v){var R,k;R=v,k=a&&a.formats;for(var x=(v=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(F,T,N){var $=N&&N.toUpperCase();return T||k[N]||e[N]||k[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,V,_){return V||_.slice(1)})})).match(t),P=x.length,w=0;w<P;w+=1){var E=x[w],j=S[E],O=j&&j[0],I=j&&j[1];x[w]=I?{regex:O,parser:I}:E.replace(/^\[|\]$/g,"")}return function(F){for(var T={},N=0,$=0;N<P;N+=1){var U=x[N];if(typeof U=="string")$+=U.length;else{var V=U.regex,_=U.parser,B=F.slice($),L=V.exec(B)[0];_.call(T,L),F=F.replace(L,"")}}return function(z){var G=z.afternoon;if(G!==void 0){var Y=z.hours;G?Y<12&&(z.hours+=12):Y===12&&(z.hours=0),delete z.afternoon}}(T),T}}return function(v,R,k){k.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(f=v.parseTwoDigitYear);var x=R.prototype,P=x.parse;x.parse=function(w){var E=w.date,j=w.utc,O=w.args;this.$u=j;var I=O[1];if(typeof I=="string"){var F=O[2]===!0,T=O[3]===!0,N=F||T,$=O[2];T&&($=O[2]),a=this.$locale(),!F&&$&&(a=k.Ls[$]),this.$d=function(B,L,z,G){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*B);var Y=g(L)(B),te=Y.year,se=Y.month,ee=Y.day,re=Y.hours,Z=Y.minutes,oe=Y.seconds,ye=Y.milliseconds,ce=Y.zone,me=Y.week,he=new Date,Pe=ee||(te||se?1:he.getDate()),_e=te||he.getFullYear(),pt=0;te&&!se||(pt=se>0?se-1:he.getMonth());var Kt,Yt=re||0,Qr=Z||0,xi=oe||0,Ri=ye||0;return ce?new Date(Date.UTC(_e,pt,Pe,Yt,Qr,xi,Ri+60*ce.offset*1e3)):z?new Date(Date.UTC(_e,pt,Pe,Yt,Qr,xi,Ri)):(Kt=new Date(_e,pt,Pe,Yt,Qr,xi,Ri),me&&(Kt=G(Kt).week(me).toDate()),Kt)}catch{return new Date("")}}(E,I,j,k),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),N&&E!=this.format(I)&&(this.$d=new Date("")),a={}}else if(I instanceof Array)for(var U=I.length,V=1;V<=U;V+=1){O[1]=I[V-1];var _=k.apply(this,O);if(_.isValid()){this.$d=_.$d,this.$L=_.$L,this.init();break}V===U&&(this.$d=new Date(""))}else P.call(this,w)}}})});var Od=Se((As,Cs)=>{"use strict";d();c();l();u();(function(e,t){typeof As=="object"&&typeof Cs<"u"?Cs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_timezone=t()})(As,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(y,h,S){S===void 0&&(S={});var g=new Date(y),v=function(R,k){k===void 0&&(k={});var x=k.timeZoneName||"short",P=R+"|"+x,w=t[P];return w||(w=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:R,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),t[P]=w),w}(h,S);return v.formatToParts(g)},f=function(y,h){for(var S=a(y,h),g=[],v=0;v<S.length;v+=1){var R=S[v],k=R.type,x=R.value,P=e[k];P>=0&&(g[P]=parseInt(x,10))}var w=g[3],E=w===24?0:w,j=g[0]+"-"+g[1]+"-"+g[2]+" "+E+":"+g[4]+":"+g[5]+":000",O=+y;return(o.utc(j).valueOf()-(O-=O%1e3))/6e4},m=n.prototype;m.tz=function(y,h){y===void 0&&(y=i);var S,g=this.utcOffset(),v=this.toDate(),R=v.toLocaleString("en-US",{timeZone:y}),k=Math.round((v-new Date(R))/1e3/60),x=15*-Math.round(v.getTimezoneOffset()/15)-k;if(!Number(x))S=this.utcOffset(0,h);else if(S=o(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),h){var P=S.utcOffset();S=S.add(g-P,"minute")}return S.$x.$timezone=y,S},m.offsetName=function(y){var h=this.$x.$timezone||o.tz.guess(),S=a(this.valueOf(),h,{timeZoneName:y}).find(function(g){return g.type.toLowerCase()==="timezonename"});return S&&S.value};var p=m.startOf;m.startOf=function(y,h){if(!this.$x||!this.$x.$timezone)return p.call(this,y,h);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(S,y,h).tz(this.$x.$timezone,!0)},o.tz=function(y,h,S){var g=S&&h,v=S||h||i,R=f(+o(),v);if(typeof y!="string")return o(y).tz(v);var k=function(E,j,O){var I=E-60*j*1e3,F=f(I,O);if(j===F)return[I,j];var T=f(I-=60*(F-j)*1e3,O);return F===T?[I,F]:[E-60*Math.min(F,T)*1e3,Math.max(F,T)]}(o.utc(y,g).valueOf(),R,v),x=k[0],P=k[1],w=o(x).utcOffset(P);return w.$x.$timezone=v,w},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(y){i=y}}})});var Td=Se((ws,xs)=>{"use strict";d();c();l();u();(function(e,t){typeof ws=="object"&&typeof xs<"u"?xs.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_utc=t()})(ws,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var v={date:g,utc:!0,args:arguments};return new o(v)},a.utc=function(g){var v=i(this.toDate(),{locale:this.$L,utc:!0});return g?v.add(this.utcOffset(),e):v},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var f=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),f.call(this,g)};var m=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else m.call(this)};var p=a.utcOffset;a.utcOffset=function(g,v){var R=this.$utils().u;if(R(g))return this.$u?0:R(this.$offset)?p.call(this):this.$offset;if(typeof g=="string"&&(g=function(w){w===void 0&&(w="");var E=w.match(t);if(!E)return null;var j=(""+E[0]).match(r)||["-",0,0],O=j[0],I=60*+j[1]+ +j[2];return I===0?0:O==="+"?I:-I}(g),g===null))return this;var k=Math.abs(g)<=16?60*g:g,x=this;if(v)return x.$offset=k,x.$u=g===0,x;if(g!==0){var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(k+P,e)).$offset=k,x.$x.$localOffset=P}else x=this.utc();return x};var y=a.format;a.format=function(g){var v=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,v)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var S=a.diff;a.diff=function(g,v,R){if(g&&this.$u===g.$u)return S.call(this,g,v,R);var k=this.local(),x=i(g).local();return S.call(k,x,v,R)}}})});var Gd=Se((aV,zd)=>{"use strict";d();c();l();u();function Dv(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}zd.exports=qv;function qv(e,t,r){var n=r&&r.stringify||Dv,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var f=1;f<i;f++)a[f]=n(t[f]);return a.join(" ")}if(typeof e!="string")return e;var m=t.length;if(m===0)return e;for(var p="",y=1-o,h=-1,S=e&&e.length||0,g=0;g<S;){if(e.charCodeAt(g)===37&&g+1<S){switch(h=h>-1?h:0,e.charCodeAt(g+1)){case 100:case 102:if(y>=m||t[y]==null)break;h<g&&(p+=e.slice(h,g)),p+=Number(t[y]),h=g+2,g++;break;case 105:if(y>=m||t[y]==null)break;h<g&&(p+=e.slice(h,g)),p+=Math.floor(Number(t[y])),h=g+2,g++;break;case 79:case 111:case 106:if(y>=m||t[y]===void 0)break;h<g&&(p+=e.slice(h,g));var v=typeof t[y];if(v==="string"){p+="'"+t[y]+"'",h=g+2,g++;break}if(v==="function"){p+=t[y].name||"<anonymous>",h=g+2,g++;break}p+=n(t[y]),h=g+2,g++;break;case 115:if(y>=m)break;h<g&&(p+=e.slice(h,g)),p+=String(t[y]),h=g+2,g++;break;case 37:h<g&&(p+=e.slice(h,g)),p+="%",h=g+2,g++,y--;break}++y}++g}return h===-1?e:(h<S&&(p+=e.slice(h)),p)}});var Zd=Se((dV,Yo)=>{"use strict";d();c();l();u();var Wd=Gd();Yo.exports=dt;var En=Kv().console||{},Mv={mapHttpRequest:Ko,mapHttpResponse:Ko,wrapRequestSerializer:Es,wrapResponseSerializer:Es,wrapErrorSerializer:Es,req:Ko,res:Ko,err:Yd,errWithCause:Yd};function Rt(e,t){return e==="silent"?1/0:t.levels.values[e]}var Ps=Symbol("pino.logFuncs"),Is=Symbol("pino.hierarchy"),jv={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Kd(e,t){let r={logger:t,parent:e[Is]};t[Is]=r}function Nv(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:En[o]||En[jv[o]||"log"]||Dr}),e[Ps]=n}function _v(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function dt(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||En;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=_v(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),f=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&f.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let m=e.level||"info",p=Object.create(r);p.log||(p.log=Dr),Nv(p,f,r),Kd({},p),Object.defineProperty(p,"levelVal",{get:h}),Object.defineProperty(p,"level",{get:S,set:g});let y={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:f,timestamp:zv(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Dr};p.levels=Vv(e),p.level=m,p.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},p.setMaxListeners=p.getMaxListeners=p.emit=p.addListener=p.on=p.prependListener=p.once=p.prependOnceListener=p.removeListener=p.removeAllListeners=p.listeners=p.listenerCount=p.eventNames=p.write=p.flush=Dr,p.serializers=n,p._serialize=o,p._stdErrSerialize=i,p.child=function(...R){return v.call(this,y,...R)},t&&(p._logEvent=ks());function h(){return Rt(this.level,this)}function S(){return this._level}function g(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,Ht(this,y,p,"error"),Ht(this,y,p,"fatal"),Ht(this,y,p,"warn"),Ht(this,y,p,"info"),Ht(this,y,p,"debug"),Ht(this,y,p,"trace"),a.forEach(k=>{Ht(this,y,p,k)})}function v(R,k,x){if(!k)throw new Error("missing bindings for child Pino");x=x||{},o&&k.serializers&&(x.serializers=k.serializers);let P=x.serializers;if(o&&P){var w=Object.assign({},n,P),E=e.browser.serialize===!0?Object.keys(w):o;delete k.serializers,Fs([k],E,w,this._stdErrSerialize)}function j(I){this._childLevel=(I._childLevel|0)+1,this.bindings=k,w&&(this.serializers=w,this._serialize=E),t&&(this._logEvent=ks([].concat(I._logEvent.bindings,k)))}j.prototype=this;let O=new j(this);return Kd(this,O),O.child=function(...I){return v.call(this,R,...I)},O.level=x.level||this.level,R.onChild(O),O}return p}function Vv(e){let t=e.customLevels||{},r=Object.assign({},dt.levels.values,t),n=Object.assign({},dt.levels.labels,Lv(t));return{values:r,labels:n}}function Lv(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}dt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};dt.stdSerializers=Mv;dt.stdTimeFunctions=Object.assign({},{nullTime:Jd,epochTime:Xd,unixTime:Gv,isoTime:Wv});function Uv(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Is];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Ht(e,t,r,n){if(Object.defineProperty(e,n,{value:Rt(e.level,r)>Rt(n,r)?Dr:r[Ps][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Dr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Rt(i,r);if(Rt(n,r)<a)return}e[n]=Bv(e,t,r,n);let o=Uv(e);o.length!==0&&(e[n]=Qv(o,e[n]))}function Qv(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Bv(e,t,r,n){return function(o){return function(){let a=t.timestamp(),f=new Array(arguments.length),m=Object.getPrototypeOf&&Object.getPrototypeOf(this)===En?En:this;for(var p=0;p<f.length;p++)f[p]=arguments[p];var y=!1;if(t.serialize&&(Fs(f,this._serialize,this.serializers,this._stdErrSerialize),y=!0),t.asObject||t.formatters?o.call(m,...$v(this,n,f,a,t)):o.apply(m,f),t.transmit){let h=t.transmit.level||e._level,S=Rt(h,r),g=Rt(n,r);if(g<S)return;Hv(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:h,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Rt(e._level,r)},f,y)}}}(e[Ps][n])}function $v(e,t,r,n,o){let{level:i,log:a=h=>h}=o.formatters||{},f=r.slice(),m=f[0],p={},y=(e._childLevel|0)+1;if(y<1&&(y=1),n&&(p.time=n),i){let h=i(t,e.levels.values[t]);Object.assign(p,h)}else p.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(m!==null&&typeof m=="object")for(;y--&&typeof f[0]=="object";)Object.assign(p,f.shift());return[a(p),...f]}else{if(m!==null&&typeof m=="object"){for(;y--&&typeof f[0]=="object";)Object.assign(p,f.shift());m=f.length?Wd(f.shift(),f):void 0}else typeof m=="string"&&(m=Wd(f.shift(),f));return m!==void 0&&(p[o.messageKey]=m),[a(p)]}}function Fs(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=dt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function Hv(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,f=t.methodValue,m=t.val,p=e._logEvent.bindings;n||Fs(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(y){return p.indexOf(y)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=f,o(a,e._logEvent,m),e._logEvent=ks(p)}function ks(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Yd(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function zv(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Jd:Xd}function Ko(){return{}}function Es(e){return e}function Dr(){}function Jd(){return!1}function Xd(){return Date.now()}function Gv(){return Math.round(Date.now()/1e3)}function Wv(){return new Date(Date.now()).toISOString()}function Kv(){function e(t){return typeof t<"u"&&t}try{return typeof b<"u"?b:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),b)}catch{return e(self)||e(window)||e(this)||{}}}Yo.exports.default=dt;Yo.exports.pino=dt});var mA={};$s(mA,{DefaultFieldsToInclude:()=>Bs,EcommerceDefaultFieldsToInclude:()=>nf,HighlightUtils:()=>ji,MinimumFieldsToInclude:()=>Ci,ResultTemplatesHelpers:()=>Wl,buildContext:()=>up,buildController:()=>Et,buildDictionaryFieldContext:()=>lp,buildInteractiveResult:()=>Zp,buildRecommendationEngine:()=>ap,buildRecommendationList:()=>Jp,buildResultTemplatesManager:()=>sf,getAnalyticsNextApiBaseUrl:()=>Nn,getOrganizationEndpoint:()=>ke,getSampleRecommendationEngineConfiguration:()=>Os,loadAdvancedSearchQueryActions:()=>Zb,loadClickAnalyticsActions:()=>lA,loadConfigurationActions:()=>eA,loadContextActions:()=>rA,loadDebugActions:()=>nA,loadDictionaryFieldContextActions:()=>oA,loadFieldActions:()=>sA,loadPaginationActions:()=>Qs,loadPipelineActions:()=>cA,loadRecommendationActions:()=>uA,loadSearchConfigurationActions:()=>tA,loadSearchHubActions:()=>fA});module.exports=mf(mA);d();c();l();u();var ji={};$s(ji,{escapeHtml:()=>Zt,getHighlightedSuggestion:()=>Jf,highlightString:()=>Yf});d();c();l();u();d();c();l();u();function $f(e,t){let r=`
|
|
17
|
+
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var yf=Object.create;var Br=Object.defineProperty;var hf=Object.getOwnPropertyDescriptor;var Sf=Object.getOwnPropertyNames;var vf=Object.getPrototypeOf,bf=Object.prototype.hasOwnProperty;var Af=(e,t,r)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var $r=(e,t)=>()=>(e&&(t=e(e=0)),t);var Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ys=(e,t)=>{for(var r in t)Br(e,r,{get:t[r],enumerable:!0})},Js=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Sf(t))!bf.call(e,o)&&o!==r&&Br(e,o,{get:()=>t[o],enumerable:!(n=hf(t,o))||n.enumerable});return e};var Qe=(e,t,r)=>(r=e!=null?yf(vf(e)):{},Js(t||!e||!e.__esModule?Br(r,"default",{value:e,enumerable:!0}):r,e)),Cf=e=>Js(Br({},"__esModule",{value:!0}),e);var de=(e,t,r)=>Af(e,typeof t!="symbol"?t+"":t,r);var b,c=$r(()=>{"use strict";b=typeof globalThis<"u"?globalThis:window});function Dn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Dn=function(t){return typeof t}:Dn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(e)}function Rf(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=Ef.bind(this))}function Ef(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),wf(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):xf(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var wf,xf,u=$r(()=>{"use strict";wf=function(t){return typeof t=="string"},xf=function(t){return t instanceof Blob};Rf.call((typeof window>"u"?"undefined":Dn(window))==="object"?window:{})});var Mi=Se(Hr=>{"use strict";d();c();l();u();Object.defineProperty(Hr,"__esModule",{value:!0});function Xs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function If(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kf(e,t,r){return t=Jt(t),Ff(e,rc()?Reflect.construct(t,r||[],Jt(e).constructor):t.apply(e,r))}function Di(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qf(n.key),n)}}function qi(e,t,r){return t&&Zs(e.prototype,t),r&&Zs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ec(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=jf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(m){throw m},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var m=r.next();return a=m.done,m},e:function(m){f=!0,i=m},f:function(){try{a||r.return==null||r.return()}finally{if(f)throw i}}}}function Oi(){return Oi=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Of(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},Oi.apply(null,arguments)}function Jt(e){return Jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jt(e)}function Pf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ti(e,t)}function rc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rc=function(){return!!e})()}function Ff(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return If(e)}function Ti(e,t){return Ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ti(e,t)}function Of(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Jt(e))!==null;);return e}function Tf(e,t,r,n){var o=Oi(Jt(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function Df(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qf(e){var t=Df(e,"string");return typeof t=="symbol"?t:t+""}function jf(e,t){if(e){if(typeof e=="string")return Xs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Xs(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Mf(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function Nf(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var tc=function(){function e(){Di(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return qi(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var y=i[f];try{y.callback.call(n,r)}catch(h){Promise.resolve().then(function(){throw h})}y.options&&y.options.once&&n.removeEventListener(r.type,y.callback)},f=0,m=i.length;f<m;f++)a();return!r.defaultPrevented}}}])}(),ji=function(e){function t(){var r;return Di(this,t),r=kf(this,t),r.listeners||tc.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return Pf(t,e),qi(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),Tf(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new qn;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new qn;function i(){o.abort(this.reason),a()}function a(){var y=ec(n),h;try{for(y.s();!(h=y.n()).done;){var S=h.value;S.removeEventListener("abort",i)}}catch(g){y.e(g)}finally{y.f()}}var f=ec(n),m;try{for(f.s();!(m=f.n()).done;){var p=m.value;if(p.aborted){o.abort(p.reason);break}else p.addEventListener("abort",i)}}catch(y){f.e(y)}finally{f.f()}return o.signal}}])}(tc),qn=function(){function e(){Di(this,e),Object.defineProperty(this,"signal",{value:new ji,writable:!0,configurable:!0})}return qi(e,[{key:"abort",value:function(r){var n=Nf(r),o=Mf(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(qn.prototype[Symbol.toStringTag]="AbortController",ji.prototype[Symbol.toStringTag]="AbortSignal");function _f(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function Vf(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,f=a===void 0?!1:a;if(!_f({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:f}))return{fetch:r,Request:m};var m=o;(m&&!m.prototype.hasOwnProperty("signal")||f)&&(m=function(S,g){var v;g&&g.signal&&(v=g.signal,delete g.signal);var R=new o(S,g);return v&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:v}),R},m.prototype=o.prototype);var p=r,y=function(S,g){var v=m&&m.prototype.isPrototypeOf(S)?S.signal:g?g.signal:void 0;if(v){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(v.aborted)return Promise.reject(R);var k=new Promise(function(x,P){v.addEventListener("abort",function(){return P(R)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([k,p(S,g)])}return p(S,g)};return{fetch:y,Request:m}}Hr.AbortController=qn;Hr.AbortSignal=ji;Hr.abortableFetch=Vf});var nc,s,A,l=$r(()=>{"use strict";nc=Qe(Mi(),1),s=Qe(Mi(),1),{fetch:A}=(0,nc.abortableFetch)({fetch})});function zr(e){if(Kf.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Ni(e){return e.replace(Yf,"")}function Gr(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!Jf(r))return!1}return!0}function Jf(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function ic(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var Lf,lc,Uf,dc,Qf,Bf,$f,Hf,zf,Gf,Wf,Kf,oc,Yf,Xt,_i,ac,sc,cc,uc,C,fc=$r(()=>{"use strict";d();c();l();u();Lf=Object.create,lc=Object.defineProperty,Uf=Object.getOwnPropertyDescriptor,dc=Object.getOwnPropertyNames,Qf=Object.getPrototypeOf,Bf=Object.prototype.hasOwnProperty,$f=(e,t)=>function(){return t||(0,e[dc(e)[0]])((t={exports:{}}).exports,t),t.exports},Hf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of dc(t))!Bf.call(e,o)&&o!==r&&lc(e,o,{get:()=>t[o],enumerable:!(n=Uf(t,o))||n.enumerable});return e},zf=(e,t,r)=>(r=e!=null?Lf(Qf(e)):{},Hf(t||!e||!e.__esModule?lc(r,"default",{value:e,enumerable:!0}):r,e)),Gf=$f({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(m){return typeof m=="string"&&!!m.trim()}function o(m,p){var y=m.split(";").filter(n),h=y.shift(),S=i(h),g=S.name,v=S.value;p=p?Object.assign({},r,p):r;try{v=p.decodeValues?decodeURIComponent(v):v}catch(k){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+v+"'. Set options.decodeValues to false to disable this feature.",k)}var R={name:g,value:v};return y.forEach(function(k){var x=k.split("="),P=x.shift().trimLeft().toLowerCase(),w=x.join("=");P==="expires"?R.expires=new Date(w):P==="max-age"?R.maxAge=parseInt(w,10):P==="secure"?R.secure=!0:P==="httponly"?R.httpOnly=!0:P==="samesite"?R.sameSite=w:R[P]=w}),R}function i(m){var p="",y="",h=m.split("=");return h.length>1?(p=h.shift(),y=h.join("=")):y=m,{name:p,value:y}}function a(m,p){if(p=p?Object.assign({},r,p):r,!m)return p.map?{}:[];if(m.headers)if(typeof m.headers.getSetCookie=="function")m=m.headers.getSetCookie();else if(m.headers["set-cookie"])m=m.headers["set-cookie"];else{var y=m.headers[Object.keys(m.headers).find(function(S){return S.toLowerCase()==="set-cookie"})];!y&&m.headers.cookie&&!p.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),m=y}if(Array.isArray(m)||(m=[m]),p=p?Object.assign({},r,p):r,p.map){var h={};return m.filter(n).reduce(function(S,g){var v=o(g,p);return S[v.name]=v,S},h)}else return m.filter(n).map(function(S){return o(S,p)})}function f(m){if(Array.isArray(m))return m;if(typeof m!="string")return[];var p=[],y=0,h,S,g,v,R;function k(){for(;y<m.length&&/\s/.test(m.charAt(y));)y+=1;return y<m.length}function x(){return S=m.charAt(y),S!=="="&&S!==";"&&S!==","}for(;y<m.length;){for(h=y,R=!1;k();)if(S=m.charAt(y),S===","){for(g=y,y+=1,k(),v=y;y<m.length&&x();)y+=1;y<m.length&&m.charAt(y)==="="?(R=!0,y=v,p.push(m.substring(h,g)),h=y):y=g+1}else y+=1;(!R||y>=m.length)&&p.push(m.substring(h,m.length))}return p}t.exports=a,t.exports.parse=a,t.exports.parseString=o,t.exports.splitCookiesString=f}}),Wf=zf(Gf()),Kf=/[^a-z0-9\-#$%&'*+.^_`|~]/i;oc=[`
|
|
19
|
+
`,"\r","\t"," "],Yf=new RegExp(`(^[${oc.join("")}]|$[${oc.join("")}])`,"g");Xt=Symbol("normalizedHeaders"),_i=Symbol("rawHeaderNames"),ac=", ",C=class pc{constructor(t){this[sc]={},this[cc]=new Map,this[uc]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof pc||typeof b.Headers<"u"&&t instanceof b.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(ac):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(ac):n)})}[(sc=Xt,cc=_i,uc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[Xt]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Gr(t))throw new TypeError(`Invalid header name "${t}"`);return this[Xt].hasOwnProperty(zr(t))}get(t){if(!Gr(t))throw TypeError(`Invalid header name "${t}"`);return this[Xt][zr(t)]??null}set(t,r){if(!Gr(t)||!ic(r))return;let n=zr(t),o=Ni(r);this[Xt][n]=Ni(o),this[_i].set(n,t)}append(t,r){if(!Gr(t)||!ic(r))return;let n=zr(t),o=Ni(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!Gr(t)||!this.has(t))return;let r=zr(t);delete this[Xt][r],this[_i].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,Wf.splitCookiesString)(t)}}});var d=$r(()=>{"use strict";fc()});var Ac=Se(Yr=>{"use strict";d();c();l();u();var Nn=Yr&&Yr.__assign||function(){return Nn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Nn.apply(this,arguments)};Object.defineProperty(Yr,"__esModule",{value:!0});var am={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function sm(e){var t=Nn(Nn({},am),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Yr.getSanitizedOptions=sm});var Cc=Se(Qi=>{"use strict";d();c();l();u();Object.defineProperty(Qi,"__esModule",{value:!0});function cm(e){var t=Math.random()*e;return Math.round(t)}Qi.fullJitter=cm});var wc=Se(Bi=>{"use strict";d();c();l();u();Object.defineProperty(Bi,"__esModule",{value:!0});function um(e){return e}Bi.noJitter=um});var xc=Se($i=>{"use strict";d();c();l();u();Object.defineProperty($i,"__esModule",{value:!0});var lm=Cc(),dm=wc();function pm(e){switch(e.jitter){case"full":return lm.fullJitter;case"none":default:return dm.noJitter}}$i.JitterFactory=pm});var zi=Se(Hi=>{"use strict";d();c();l();u();Object.defineProperty(Hi,"__esModule",{value:!0});var fm=xc(),mm=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=fm.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Hi.Delay=mm});var Rc=Se(rt=>{"use strict";d();c();l();u();var gm=rt&&rt.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ym=rt&&rt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(y){try{p(n.next(y))}catch(h){a(h)}}function m(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(f,m)}p((n=n.apply(e,t||[])).next())})},hm=rt&&rt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(p){return function(y){return m([p,y])}}function m(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(y){p=[6,y],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(rt,"__esModule",{value:!0});var Sm=zi(),vm=function(e){gm(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return ym(this,void 0,void 0,function(){return hm(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(Sm.Delay);rt.SkipFirstDelay=vm});var Ec=Se(Jr=>{"use strict";d();c();l();u();var bm=Jr&&Jr.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Jr,"__esModule",{value:!0});var Am=zi(),Cm=function(e){bm(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Am.Delay);Jr.AlwaysDelay=Cm});var Ic=Se(Gi=>{"use strict";d();c();l();u();Object.defineProperty(Gi,"__esModule",{value:!0});var wm=Rc(),xm=Ec();function Rm(e,t){var r=Em(e);return r.setAttemptNumber(t),r}Gi.DelayFactory=Rm;function Em(e){return e.delayFirstAttempt?new xm.AlwaysDelay(e):new wm.SkipFirstDelay(e)}});var kc=Se(jt=>{"use strict";d();c();l();u();var Wi=jt&&jt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(y){try{p(n.next(y))}catch(h){a(h)}}function m(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(f,m)}p((n=n.apply(e,t||[])).next())})},Ki=jt&&jt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(p){return function(y){return m([p,y])}}function m(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,o=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){r.label=p[1];break}if(p[0]===6&&r.label<i[1]){r.label=i[1],i=p;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(p);break}i[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(y){p=[6,y],o=0}finally{n=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(jt,"__esModule",{value:!0});var Im=Ac(),km=Ic();function Pm(e,t){return t===void 0&&(t={}),Wi(this,void 0,void 0,function(){var r,n;return Ki(this,function(o){switch(o.label){case 0:return r=Im.getSanitizedOptions(t),n=new Fm(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}jt.backOff=Pm;var Fm=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Wi(this,void 0,void 0,function(){var t,r;return Ki(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return Wi(this,void 0,void 0,function(){var t;return Ki(this,function(r){switch(r.label){case 0:return t=km.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Ko=Se((es,ts)=>{"use strict";d();c();l();u();(function(e,t){typeof es=="object"&&typeof ts<"u"?ts.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs=t()})(es,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",f="day",m="week",p="month",y="quarter",h="year",S="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(U){var V=["th","st","nd","rd"],_=U%100;return"["+U+(V[(_-20)%10]||V[_]||V[0])+"]"}},x=function(U,V,_){var B=String(U);return!B||B.length>=V?U:""+Array(V+1-B.length).join(_)+U},P={s:x,z:function(U){var V=-U.utcOffset(),_=Math.abs(V),B=Math.floor(_/60),L=_%60;return(V<=0?"+":"-")+x(B,2,"0")+":"+x(L,2,"0")},m:function U(V,_){if(V.date()<_.date())return-U(_,V);var B=12*(_.year()-V.year())+(_.month()-V.month()),L=V.clone().add(B,p),z=_-L<0,G=V.clone().add(B+(z?-1:1),p);return+(-(B+(_-L)/(z?L-G:G-L))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:p,y:h,w:m,d:f,D:S,h:a,m:i,s:o,ms:n,Q:y}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},w="en",E={};E[w]=k;var M="$isDayjsObject",O=function(U){return U instanceof N||!(!U||!U[M])},I=function U(V,_,B){var L;if(!V)return w;if(typeof V=="string"){var z=V.toLowerCase();E[z]&&(L=z),_&&(E[z]=_,L=z);var G=V.split("-");if(!L&&G.length>1)return U(G[0])}else{var Y=V.name;E[Y]=V,L=Y}return!B&&L&&(w=L),L||!B&&w},F=function(U,V){if(O(U))return U.clone();var _=typeof V=="object"?V:{};return _.date=U,_.args=arguments,new N(_)},T=P;T.l=I,T.i=O,T.w=function(U,V){return F(U,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var N=function(){function U(_){this.$L=I(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[M]=!0}var V=U.prototype;return V.parse=function(_){this.$d=function(B){var L=B.date,z=B.utc;if(L===null)return new Date(NaN);if(T.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var G=L.match(v);if(G){var Y=G[2]-1||0,te=(G[7]||"0").substring(0,3);return z?new Date(Date.UTC(G[1],Y,G[3]||1,G[4]||0,G[5]||0,G[6]||0,te)):new Date(G[1],Y,G[3]||1,G[4]||0,G[5]||0,G[6]||0,te)}}return new Date(L)}(_),this.init()},V.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},V.$utils=function(){return T},V.isValid=function(){return this.$d.toString()!==g},V.isSame=function(_,B){var L=F(_);return this.startOf(B)<=L&&L<=this.endOf(B)},V.isAfter=function(_,B){return F(_)<this.startOf(B)},V.isBefore=function(_,B){return this.endOf(B)<F(_)},V.$g=function(_,B,L){return T.u(_)?this[B]:this.set(L,_)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(_,B){var L=this,z=!!T.u(B)||B,G=T.p(_),Y=function(ce,me){var he=T.w(L.$u?Date.UTC(L.$y,me,ce):new Date(L.$y,me,ce),L);return z?he:he.endOf(f)},te=function(ce,me){return T.w(L.toDate()[ce].apply(L.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(me)),L)},se=this.$W,ee=this.$M,re=this.$D,Z="set"+(this.$u?"UTC":"");switch(G){case h:return z?Y(1,0):Y(31,11);case p:return z?Y(1,ee):Y(0,ee+1);case m:var oe=this.$locale().weekStart||0,ye=(se<oe?se+7:se)-oe;return Y(z?re-ye:re+(6-ye),ee);case f:case S:return te(Z+"Hours",0);case a:return te(Z+"Minutes",1);case i:return te(Z+"Seconds",2);case o:return te(Z+"Milliseconds",3);default:return this.clone()}},V.endOf=function(_){return this.startOf(_,!1)},V.$set=function(_,B){var L,z=T.p(_),G="set"+(this.$u?"UTC":""),Y=(L={},L[f]=G+"Date",L[S]=G+"Date",L[p]=G+"Month",L[h]=G+"FullYear",L[a]=G+"Hours",L[i]=G+"Minutes",L[o]=G+"Seconds",L[n]=G+"Milliseconds",L)[z],te=z===f?this.$D+(B-this.$W):B;if(z===p||z===h){var se=this.clone().set(S,1);se.$d[Y](te),se.init(),this.$d=se.set(S,Math.min(this.$D,se.daysInMonth())).$d}else Y&&this.$d[Y](te);return this.init(),this},V.set=function(_,B){return this.clone().$set(_,B)},V.get=function(_){return this[T.p(_)]()},V.add=function(_,B){var L,z=this;_=Number(_);var G=T.p(B),Y=function(ee){var re=F(z);return T.w(re.date(re.date()+Math.round(ee*_)),z)};if(G===p)return this.set(p,this.$M+_);if(G===h)return this.set(h,this.$y+_);if(G===f)return Y(1);if(G===m)return Y(7);var te=(L={},L[i]=t,L[a]=r,L[o]=e,L)[G]||1,se=this.$d.getTime()+_*te;return T.w(se,this)},V.subtract=function(_,B){return this.add(-1*_,B)},V.format=function(_){var B=this,L=this.$locale();if(!this.isValid())return L.invalidDate||g;var z=_||"YYYY-MM-DDTHH:mm:ssZ",G=T.z(this),Y=this.$H,te=this.$m,se=this.$M,ee=L.weekdays,re=L.months,Z=L.meridiem,oe=function(me,he,Pe,_e){return me&&(me[he]||me(B,z))||Pe[he].slice(0,_e)},ye=function(me){return T.s(Y%12||12,me,"0")},ce=Z||function(me,he,Pe){var _e=me<12?"AM":"PM";return Pe?_e.toLowerCase():_e};return z.replace(R,function(me,he){return he||function(Pe){switch(Pe){case"YY":return String(B.$y).slice(-2);case"YYYY":return T.s(B.$y,4,"0");case"M":return se+1;case"MM":return T.s(se+1,2,"0");case"MMM":return oe(L.monthsShort,se,re,3);case"MMMM":return oe(re,se);case"D":return B.$D;case"DD":return T.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return oe(L.weekdaysMin,B.$W,ee,2);case"ddd":return oe(L.weekdaysShort,B.$W,ee,3);case"dddd":return ee[B.$W];case"H":return String(Y);case"HH":return T.s(Y,2,"0");case"h":return ye(1);case"hh":return ye(2);case"a":return ce(Y,te,!0);case"A":return ce(Y,te,!1);case"m":return String(te);case"mm":return T.s(te,2,"0");case"s":return String(B.$s);case"ss":return T.s(B.$s,2,"0");case"SSS":return T.s(B.$ms,3,"0");case"Z":return G}return null}(me)||G.replace(":","")})},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(_,B,L){var z,G=this,Y=T.p(B),te=F(_),se=(te.utcOffset()-this.utcOffset())*t,ee=this-te,re=function(){return T.m(G,te)};switch(Y){case h:z=re()/12;break;case p:z=re();break;case y:z=re()/3;break;case m:z=(ee-se)/6048e5;break;case f:z=(ee-se)/864e5;break;case a:z=ee/r;break;case i:z=ee/t;break;case o:z=ee/e;break;default:z=ee}return L?z:T.a(z)},V.daysInMonth=function(){return this.endOf(p).$D},V.$locale=function(){return E[this.$L]},V.locale=function(_,B){if(!_)return this.$L;var L=this.clone(),z=I(_,B,!0);return z&&(L.$L=z),L},V.clone=function(){return T.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},U}(),$=N.prototype;return F.prototype=$,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",f],["$M",p],["$y",h],["$D",S]].forEach(function(U){$[U[1]]=function(V){return this.$g(V,U[0],U[1])}}),F.extend=function(U,V){return U.$i||(U(V,N,F),U.$i=!0),F},F.locale=I,F.isDayjs=O,F.unix=function(U){return F(1e3*U)},F.en=E[w],F.Ls=E,F.p={},F})});var ql=Se((rs,ns)=>{"use strict";d();c();l();u();(function(e,t){typeof rs=="object"&&typeof ns<"u"?ns.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_quarterOfYear=t()})(rs,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(f){return this.$utils().u(f)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(f-1))};var i=o.add;o.add=function(f,m){return f=Number(f),this.$utils().p(m)===t?this.add(3*f,e):i.bind(this)(f,m)};var a=o.startOf;o.startOf=function(f,m){var p=this.$utils(),y=!!p.u(m)||m;if(p.p(f)===t){var h=this.quarter()-1;return y?this.month(3*h).startOf(e).startOf("day"):this.month(3*h+2).endOf(e).endOf("day")}return a.bind(this)(f,m)}}})});var jl=Se((os,is)=>{"use strict";d();c();l();u();(function(e,t){typeof os=="object"&&typeof is<"u"?is.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_customParseFormat=t()})(os,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},f=function(v){return(v=+v)+(v>68?1900:2e3)},m=function(v){return function(R){this[v]=+R}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var k=R.match(/([+-]|\d\d)/g),x=60*k[1]+(+k[2]||0);return x===0?0:k[0]==="+"?-x:x}(v)}],y=function(v){var R=a[v];return R&&(R.indexOf?R:R.s.concat(R.f))},h=function(v,R){var k,x=a.meridiem;if(x){for(var P=1;P<=24;P+=1)if(v.indexOf(x(P,0,R))>-1){k=P>12;break}}else k=v===(R?"pm":"PM");return k},S={A:[i,function(v){this.afternoon=h(v,!1)}],a:[i,function(v){this.afternoon=h(v,!0)}],Q:[r,function(v){this.month=3*(v-1)+1}],S:[r,function(v){this.milliseconds=100*+v}],SS:[n,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[o,m("seconds")],ss:[o,m("seconds")],m:[o,m("minutes")],mm:[o,m("minutes")],H:[o,m("hours")],h:[o,m("hours")],HH:[o,m("hours")],hh:[o,m("hours")],D:[o,m("day")],DD:[n,m("day")],Do:[i,function(v){var R=a.ordinal,k=v.match(/\d+/);if(this.day=k[0],R)for(var x=1;x<=31;x+=1)R(x).replace(/\[|\]/g,"")===v&&(this.day=x)}],w:[o,m("week")],ww:[n,m("week")],M:[o,m("month")],MM:[n,m("month")],MMM:[i,function(v){var R=y("months"),k=(y("monthsShort")||R.map(function(x){return x.slice(0,3)})).indexOf(v)+1;if(k<1)throw new Error;this.month=k%12||k}],MMMM:[i,function(v){var R=y("months").indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,m("year")],YY:[n,function(v){this.year=f(v)}],YYYY:[/\d{4}/,m("year")],Z:p,ZZ:p};function g(v){var R,k;R=v,k=a&&a.formats;for(var x=(v=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(F,T,N){var $=N&&N.toUpperCase();return T||k[N]||e[N]||k[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(U,V,_){return V||_.slice(1)})})).match(t),P=x.length,w=0;w<P;w+=1){var E=x[w],M=S[E],O=M&&M[0],I=M&&M[1];x[w]=I?{regex:O,parser:I}:E.replace(/^\[|\]$/g,"")}return function(F){for(var T={},N=0,$=0;N<P;N+=1){var U=x[N];if(typeof U=="string")$+=U.length;else{var V=U.regex,_=U.parser,B=F.slice($),L=V.exec(B)[0];_.call(T,L),F=F.replace(L,"")}}return function(z){var G=z.afternoon;if(G!==void 0){var Y=z.hours;G?Y<12&&(z.hours+=12):Y===12&&(z.hours=0),delete z.afternoon}}(T),T}}return function(v,R,k){k.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(f=v.parseTwoDigitYear);var x=R.prototype,P=x.parse;x.parse=function(w){var E=w.date,M=w.utc,O=w.args;this.$u=M;var I=O[1];if(typeof I=="string"){var F=O[2]===!0,T=O[3]===!0,N=F||T,$=O[2];T&&($=O[2]),a=this.$locale(),!F&&$&&(a=k.Ls[$]),this.$d=function(B,L,z,G){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*B);var Y=g(L)(B),te=Y.year,se=Y.month,ee=Y.day,re=Y.hours,Z=Y.minutes,oe=Y.seconds,ye=Y.milliseconds,ce=Y.zone,me=Y.week,he=new Date,Pe=ee||(te||se?1:he.getDate()),_e=te||he.getFullYear(),ft=0;te&&!se||(ft=se>0?se-1:he.getMonth());var Kt,Yt=re||0,Qr=Z||0,Pi=oe||0,Fi=ye||0;return ce?new Date(Date.UTC(_e,ft,Pe,Yt,Qr,Pi,Fi+60*ce.offset*1e3)):z?new Date(Date.UTC(_e,ft,Pe,Yt,Qr,Pi,Fi)):(Kt=new Date(_e,ft,Pe,Yt,Qr,Pi,Fi),me&&(Kt=G(Kt).week(me).toDate()),Kt)}catch{return new Date("")}}(E,I,M,k),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),N&&E!=this.format(I)&&(this.$d=new Date("")),a={}}else if(I instanceof Array)for(var U=I.length,V=1;V<=U;V+=1){O[1]=I[V-1];var _=k.apply(this,O);if(_.isValid()){this.$d=_.$d,this.$L=_.$L,this.init();break}V===U&&(this.$d=new Date(""))}else P.call(this,w)}}})});var tp=Se((qs,js)=>{"use strict";d();c();l();u();(function(e,t){typeof qs=="object"&&typeof js<"u"?js.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_timezone=t()})(qs,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(y,h,S){S===void 0&&(S={});var g=new Date(y),v=function(R,k){k===void 0&&(k={});var x=k.timeZoneName||"short",P=R+"|"+x,w=t[P];return w||(w=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:R,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),t[P]=w),w}(h,S);return v.formatToParts(g)},f=function(y,h){for(var S=a(y,h),g=[],v=0;v<S.length;v+=1){var R=S[v],k=R.type,x=R.value,P=e[k];P>=0&&(g[P]=parseInt(x,10))}var w=g[3],E=w===24?0:w,M=g[0]+"-"+g[1]+"-"+g[2]+" "+E+":"+g[4]+":"+g[5]+":000",O=+y;return(o.utc(M).valueOf()-(O-=O%1e3))/6e4},m=n.prototype;m.tz=function(y,h){y===void 0&&(y=i);var S,g=this.utcOffset(),v=this.toDate(),R=v.toLocaleString("en-US",{timeZone:y}),k=Math.round((v-new Date(R))/1e3/60),x=15*-Math.round(v.getTimezoneOffset()/15)-k;if(!Number(x))S=this.utcOffset(0,h);else if(S=o(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),h){var P=S.utcOffset();S=S.add(g-P,"minute")}return S.$x.$timezone=y,S},m.offsetName=function(y){var h=this.$x.$timezone||o.tz.guess(),S=a(this.valueOf(),h,{timeZoneName:y}).find(function(g){return g.type.toLowerCase()==="timezonename"});return S&&S.value};var p=m.startOf;m.startOf=function(y,h){if(!this.$x||!this.$x.$timezone)return p.call(this,y,h);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(S,y,h).tz(this.$x.$timezone,!0)},o.tz=function(y,h,S){var g=S&&h,v=S||h||i,R=f(+o(),v);if(typeof y!="string")return o(y).tz(v);var k=function(E,M,O){var I=E-60*M*1e3,F=f(I,O);if(M===F)return[I,M];var T=f(I-=60*(F-M)*1e3,O);return F===T?[I,F]:[E-60*Math.min(F,T)*1e3,Math.max(F,T)]}(o.utc(y,g).valueOf(),R,v),x=k[0],P=k[1],w=o(x).utcOffset(P);return w.$x.$timezone=v,w},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(y){i=y}}})});var rp=Se((Ms,Ns)=>{"use strict";d();c();l();u();(function(e,t){typeof Ms=="object"&&typeof Ns<"u"?Ns.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_utc=t()})(Ms,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var v={date:g,utc:!0,args:arguments};return new o(v)},a.utc=function(g){var v=i(this.toDate(),{locale:this.$L,utc:!0});return g?v.add(this.utcOffset(),e):v},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var f=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),f.call(this,g)};var m=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else m.call(this)};var p=a.utcOffset;a.utcOffset=function(g,v){var R=this.$utils().u;if(R(g))return this.$u?0:R(this.$offset)?p.call(this):this.$offset;if(typeof g=="string"&&(g=function(w){w===void 0&&(w="");var E=w.match(t);if(!E)return null;var M=(""+E[0]).match(r)||["-",0,0],O=M[0],I=60*+M[1]+ +M[2];return I===0?0:O==="+"?I:-I}(g),g===null))return this;var k=Math.abs(g)<=16?60*g:g,x=this;if(v)return x.$offset=k,x.$u=g===0,x;if(g!==0){var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(k+P,e)).$offset=k,x.$x.$localOffset=P}else x=this.utc();return x};var y=a.format;a.format=function(g){var v=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,v)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var S=a.diff;a.diff=function(g,v,R){if(g&&this.$u===g.$u)return S.call(this,g,v,R);var k=this.local(),x=i(g).local();return S.call(k,x,v,R)}}})});var hp=Se((FB,yp)=>{"use strict";d();c();l();u();function ob(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}yp.exports=ib;function ib(e,t,r){var n=r&&r.stringify||ob,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var f=1;f<i;f++)a[f]=n(t[f]);return a.join(" ")}if(typeof e!="string")return e;var m=t.length;if(m===0)return e;for(var p="",y=1-o,h=-1,S=e&&e.length||0,g=0;g<S;){if(e.charCodeAt(g)===37&&g+1<S){switch(h=h>-1?h:0,e.charCodeAt(g+1)){case 100:case 102:if(y>=m||t[y]==null)break;h<g&&(p+=e.slice(h,g)),p+=Number(t[y]),h=g+2,g++;break;case 105:if(y>=m||t[y]==null)break;h<g&&(p+=e.slice(h,g)),p+=Math.floor(Number(t[y])),h=g+2,g++;break;case 79:case 111:case 106:if(y>=m||t[y]===void 0)break;h<g&&(p+=e.slice(h,g));var v=typeof t[y];if(v==="string"){p+="'"+t[y]+"'",h=g+2,g++;break}if(v==="function"){p+=t[y].name||"<anonymous>",h=g+2,g++;break}p+=n(t[y]),h=g+2,g++;break;case 115:if(y>=m)break;h<g&&(p+=e.slice(h,g)),p+=String(t[y]),h=g+2,g++;break;case 37:h<g&&(p+=e.slice(h,g)),p+="%",h=g+2,g++,y--;break}++y}++g}return h===-1?e:(h<S&&(p+=e.slice(h)),p)}});var wp=Se((jB,yi)=>{"use strict";d();c();l();u();var Sp=hp();yi.exports=pt;var kn=bb().console||{},ab={mapHttpRequest:gi,mapHttpResponse:gi,wrapRequestSerializer:Vs,wrapResponseSerializer:Vs,wrapErrorSerializer:Vs,req:gi,res:gi,err:bp,errWithCause:bp};function Tt(e,t){return e==="silent"?1/0:t.levels.values[e]}var Qs=Symbol("pino.logFuncs"),Ls=Symbol("pino.hierarchy"),sb={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function vp(e,t){let r={logger:t,parent:e[Ls]};t[Ls]=r}function cb(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:kn[o]||kn[sb[o]||"log"]||Mr}),e[Qs]=n}function ub(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function pt(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||kn;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=ub(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),f=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&f.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let m=e.level||"info",p=Object.create(r);p.log||(p.log=Mr),cb(p,f,r),vp({},p),Object.defineProperty(p,"levelVal",{get:h}),Object.defineProperty(p,"level",{get:S,set:g});let y={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:f,timestamp:hb(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Mr};p.levels=lb(e),p.level=m,p.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},p.setMaxListeners=p.getMaxListeners=p.emit=p.addListener=p.on=p.prependListener=p.once=p.prependOnceListener=p.removeListener=p.removeAllListeners=p.listeners=p.listenerCount=p.eventNames=p.write=p.flush=Mr,p.serializers=n,p._serialize=o,p._stdErrSerialize=i,p.child=function(...R){return v.call(this,y,...R)},t&&(p._logEvent=Us());function h(){return Tt(this.level,this)}function S(){return this._level}function g(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,Ht(this,y,p,"error"),Ht(this,y,p,"fatal"),Ht(this,y,p,"warn"),Ht(this,y,p,"info"),Ht(this,y,p,"debug"),Ht(this,y,p,"trace"),a.forEach(k=>{Ht(this,y,p,k)})}function v(R,k,x){if(!k)throw new Error("missing bindings for child Pino");x=x||{},o&&k.serializers&&(x.serializers=k.serializers);let P=x.serializers;if(o&&P){var w=Object.assign({},n,P),E=e.browser.serialize===!0?Object.keys(w):o;delete k.serializers,Bs([k],E,w,this._stdErrSerialize)}function M(I){this._childLevel=(I._childLevel|0)+1,this.bindings=k,w&&(this.serializers=w,this._serialize=E),t&&(this._logEvent=Us([].concat(I._logEvent.bindings,k)))}M.prototype=this;let O=new M(this);return vp(this,O),O.child=function(...I){return v.call(this,R,...I)},O.level=x.level||this.level,R.onChild(O),O}return p}function lb(e){let t=e.customLevels||{},r=Object.assign({},pt.levels.values,t),n=Object.assign({},pt.levels.labels,db(t));return{values:r,labels:n}}function db(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}pt.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};pt.stdSerializers=ab;pt.stdTimeFunctions=Object.assign({},{nullTime:Ap,epochTime:Cp,unixTime:Sb,isoTime:vb});function pb(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Ls];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Ht(e,t,r,n){if(Object.defineProperty(e,n,{value:Tt(e.level,r)>Tt(n,r)?Mr:r[Qs][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Mr){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Tt(i,r);if(Tt(n,r)<a)return}e[n]=mb(e,t,r,n);let o=pb(e);o.length!==0&&(e[n]=fb(o,e[n]))}function fb(e,t){return function(){return t.apply(this,[...e,...arguments])}}function mb(e,t,r,n){return function(o){return function(){let a=t.timestamp(),f=new Array(arguments.length),m=Object.getPrototypeOf&&Object.getPrototypeOf(this)===kn?kn:this;for(var p=0;p<f.length;p++)f[p]=arguments[p];var y=!1;if(t.serialize&&(Bs(f,this._serialize,this.serializers,this._stdErrSerialize),y=!0),t.asObject||t.formatters?o.call(m,...gb(this,n,f,a,t)):o.apply(m,f),t.transmit){let h=t.transmit.level||e._level,S=Tt(h,r),g=Tt(n,r);if(g<S)return;yb(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:h,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Tt(e._level,r)},f,y)}}}(e[Qs][n])}function gb(e,t,r,n,o){let{level:i,log:a=h=>h}=o.formatters||{},f=r.slice(),m=f[0],p={},y=(e._childLevel|0)+1;if(y<1&&(y=1),n&&(p.time=n),i){let h=i(t,e.levels.values[t]);Object.assign(p,h)}else p.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(m!==null&&typeof m=="object")for(;y--&&typeof f[0]=="object";)Object.assign(p,f.shift());return[a(p),...f]}else{if(m!==null&&typeof m=="object"){for(;y--&&typeof f[0]=="object";)Object.assign(p,f.shift());m=f.length?Sp(f.shift(),f):void 0}else typeof m=="string"&&(m=Sp(f.shift(),f));return m!==void 0&&(p[o.messageKey]=m),[a(p)]}}function Bs(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=pt.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function yb(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,f=t.methodValue,m=t.val,p=e._logEvent.bindings;n||Bs(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(y){return p.indexOf(y)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=f,o(a,e._logEvent,m),e._logEvent=Us(p)}function Us(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function bp(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function hb(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Ap:Cp}function gi(){return{}}function Vs(e){return e}function Mr(){}function Ap(){return!1}function Cp(){return Date.now()}function Sb(){return Math.round(Date.now()/1e3)}function vb(){return new Date(Date.now()).toISOString()}function bb(){function e(t){return typeof t<"u"&&t}try{return typeof b<"u"?b:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),b)}catch{return e(self)||e(window)||e(this)||{}}}yi.exports.default=pt;yi.exports.pino=pt});var bA={};Ys(bA,{DefaultFieldsToInclude:()=>Ks,EcommerceDefaultFieldsToInclude:()=>pf,HighlightUtils:()=>Ui,MinimumFieldsToInclude:()=>Ii,ResultTemplatesHelpers:()=>Sd,buildContext:()=>Dp,buildController:()=>Dt,buildDictionaryFieldContext:()=>qp,buildInteractiveResult:()=>cf,buildRecommendationEngine:()=>Fp,buildRecommendationList:()=>af,buildResultTemplatesManager:()=>gf,getAnalyticsNextApiBaseUrl:()=>_n,getOrganizationEndpoint:()=>ke,getSampleRecommendationEngineConfiguration:()=>$s,loadAdvancedSearchQueryActions:()=>iA,loadClickAnalyticsActions:()=>yA,loadConfigurationActions:()=>aA,loadContextActions:()=>cA,loadDebugActions:()=>uA,loadDictionaryFieldContextActions:()=>lA,loadFieldActions:()=>fA,loadPaginationActions:()=>Ws,loadPipelineActions:()=>mA,loadRecommendationActions:()=>gA,loadSearchConfigurationActions:()=>sA,loadSearchHubActions:()=>vA});module.exports=Cf(bA);d();c();l();u();var Ui={};Ys(Ui,{escapeHtml:()=>Zt,getHighlightedSuggestion:()=>im,highlightString:()=>om});d();c();l();u();d();c();l();u();function Xf(e,t){let r=`
|
|
20
20
|
The following properties are invalid:
|
|
21
21
|
|
|
22
22
|
${e.join(`
|
|
23
23
|
`)}
|
|
24
24
|
|
|
25
25
|
${t}
|
|
26
|
-
`;return new Wr(r)}var Wr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw $f(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&X(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function ve(e){return e===void 0}function Hf(e){return e===null}function X(e){return ve(e)||Hf(e)}var ne=class{constructor(e={}){le(this,"value");this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(zf(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function zf(e){return ve(e)||cc(e)}function cc(e){return typeof e=="boolean"}var J=class{constructor(e={}){le(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(Gf(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 Gf(e){return ve(e)||uc(e)}function uc(e){return typeof e=="number"&&!Number.isNaN(e)}var Wf=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){le(this,"value");le(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ve(e))return null;if(!qn(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Wf.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 qn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){le(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ve(e))return this.config.options.required?"value is required and is currently undefined":null;if(!lc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function lc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){le(this,"value");this.config=e,this.value=new fe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&X(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return cc(e)||qn(e)||uc(e)||lc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function dc(e){return Array.isArray(e)}var qi=class{constructor(e){le(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ve(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();function pc(e){return Array.isArray(e)}function Mn(e){return e.trim()===""}var Kf=new Set(["1",1,"yes",!0]);function fc(){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=>Kf.has(r))}function mc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Kr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Yf(e){if(Mn(e.openingDelimiter)||Mn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||Mn(e.content))return e.content;if(e.highlights.length===0)return Zt(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,f=a+i.length;if(f>t)break;r+=Zt(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Zt(e.content.slice(a,f)),r+=e.closingDelimiter,n=f}return n!==t&&(r+=Zt(e.content.slice(n))),r}function Jf(e,t){return e=Zt(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Mi(n,t.notMatchDelimiters):o?Mi(o,t.exactMatchDelimiters):i?Mi(i,t.correctionDelimiters):r)}function Mi(e,t){return t?t.open+e+t.close:e}function Zt(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var Ec=Qe(Cc(),1);d();c();l();u();var ze=new Error("Failed to load reducers."),er=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},jt=class extends Error{constructor(r,n){super();le(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function wc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function xc(e){return typeof e!="object"||!e?!1:Object.values(e).every(wm)}function wm(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Rc(e){return e===429}var Be=class e{static call(t){return _asyncToGenerator(function*(){let r=xm(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,f=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield A(i,a);if(Rc(m.status))throw m;return m});return function f(){return _ref.apply(this,arguments)}}();try{let m=yield(0,Ec.backOff)(f,{retry:p=>{let y=p&&Rc(p.status);return y&&n.info("Platform retrying request"),y}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new er;case 404:throw new jt(i,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new jt(i):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:f,...m}=t,p=Kr(m);try{let y=yield o(t,n,a);return{...t,...y}}catch(y){i.error(y,"Platform request preprocessing failed. Returning default request options.")}return p})()}};function ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ft(e,t="prod"){return`${ke(e,t)}/rest/search/v2`}function Nn(e,t="prod"){return`${ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function xm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,f=e.method==="POST"||e.method==="PUT",m=Rm(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(f&&{body:m}),signal:a}}function Rm(e,t){return t==="application/x-www-form-urlencoded"?xc(e)?wc(e):"":JSON.stringify(e)}d();c();l();u();d();c();l();u();var _n=e=>e;d();c();l();u();d();c();l();u();function Vn(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ge(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Vn(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Vn(),extendedResults:{},searchAction:void 0}}d();c();l();u();function mt(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var gt=e=>{let{response:t}=e;return t.body?Em(e):Im(t)},Em=e=>Pm(e)?Fm(e):km(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},Im=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function km(e){return e.body.statusCode!==void 0}function Pm(e){return e.body.exception!==void 0}var Fm=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var yt=class{constructor(){le(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();var Xr=class{constructor(t){le(this,"_basePath");le(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};d();c();l();u();function Ic(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var rt=(e,t,r,n)=>{let o=new Xr(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var kc=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield Be.call({...rt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:mt(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Ic(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Om(a)?{success:a}:{error:gt({response:r,body:a})}});return function kc(_x,_x2){return _ref2.apply(this,arguments)}}();function Om(e){return typeof e=="string"}d();c();l();u();function Tm(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Dm(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Ln(e,t){if(t&&e.name==="AbortError")return{error:Dm(e)};if(e instanceof jt)return{error:Tm(e)};throw e}var Un=class{constructor(t){this.options=t;le(this,"apiCallsQueues",{unknown:new yt,mainSearch:new yt,facetValues:new yt,foldingCollection:new yt,instantResults:new yt})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/plan"),requestParams:mt(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Ln(r);let n=yield r.json();return Mm(n)?{success:n}:{error:gt({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:mt(t),..._this3.options});if(r instanceof Error)return Ln(r);let n=yield r.json(),o={response:r,body:n};return qm(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:gt(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(f=>Be.call({...rt(t,"POST","application/json",""),requestParams:mt(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:f??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Ln(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return Pc(i)?(a.body=Fc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:gt(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json","/facet"),requestParams:mt(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"POST","application/json",""),requestParams:mt(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Pc(n)){let o={response:r,body:n};return o.body=Fc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:gt({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return kc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Be.call({...rt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return jm(n)?{success:n}:{error:gt({response:r,body:n})}})()}},Qn=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function Pc(e){return e.results!==void 0}function Fc(e){let t=Vn();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function qm(e){return e.completions!==void 0}function Mm(e){return e.preprocessingOutput!==void 0}function jm(e){return e.fields!==void 0}d();c();l();u();var Oc=e=>e,Tc=e=>e,Dc=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function be(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Nm=typeof Symbol=="function"&&Symbol.observable||"@@observable",qc=Nm,Hi=()=>Math.random().toString(36).substring(7).split("").join("."),_m={INIT:`@@redux/INIT${Hi()}`,REPLACE:`@@redux/REPLACE${Hi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Hi()}`},Bn=_m;function We(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function zi(e,t,r){if(typeof e!="function")throw new Error(be(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(be(1));return r(zi)(e,t)}let n=e,o=t,i=new Map,a=i,f=0,m=!1;function p(){a===i&&(a=new Map,i.forEach((k,x)=>{a.set(x,k)}))}function y(){if(m)throw new Error(be(3));return o}function h(k){if(typeof k!="function")throw new Error(be(4));if(m)throw new Error(be(5));let x=!0;p();let P=f++;return a.set(P,k),function(){if(x){if(m)throw new Error(be(6));x=!1,p(),a.delete(P),i=null}}}function S(k){if(!We(k))throw new Error(be(7));if(typeof k.type>"u")throw new Error(be(8));if(typeof k.type!="string")throw new Error(be(17));if(m)throw new Error(be(9));try{m=!0,o=n(o,k)}finally{m=!1}return(i=a).forEach(P=>{P()}),k}function g(k){if(typeof k!="function")throw new Error(be(10));n=k,S({type:Bn.REPLACE})}function v(){let k=h;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(be(11));function P(){let E=x;E.next&&E.next(y())}return P(),{unsubscribe:k(P)}},[qc](){return this}}}return S({type:Bn.INIT}),{dispatch:S,subscribe:h,getState:y,replaceReducer:g,[qc]:v}}function Vm(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Bn.INIT})>"u")throw new Error(be(12));if(typeof r(void 0,{type:Bn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function tr(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let f=t[a];typeof e[f]=="function"&&(r[f]=e[f])}let n=Object.keys(r),o,i;try{Vm(r)}catch(a){i=a}return function(f={},m){if(i)throw i;let p=!1,y={};for(let h=0;h<n.length;h++){let S=n[h],g=r[S],v=f[S],R=g(v,m);if(typeof R>"u"){let k=m&&m.type;throw new Error(be(14))}y[S]=R,p=p||R!==v}return p=p||n.length!==Object.keys(f).length,p?y:f}}function rr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Mc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(be(15))},a={getState:o.getState,dispatch:(m,...p)=>i(m,...p)},f=e.map(m=>m(a));return i=rr(...f)(o.dispatch),{...o,dispatch:i}}}function $n(e){return We(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var ra=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function Ae(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var _t=Object.getPrototypeOf;function je(e){return!!e&&!!e[Te]}function De(e){return e?Lc(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||nr(e)||an(e):!1}var Lm=Object.prototype.constructor.toString();function Lc(e){if(!e||typeof e!="object")return!1;let t=_t(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)===Lm}function na(e){return je(e)||Ae(15,e),e[Te].base_}function en(e,t){Vt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Vt(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:nr(e)?2:an(e)?3:0}function tn(e,t){return Vt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Gi(e,t){return Vt(e)===2?e.get(t):e[t]}function Uc(e,t,r){let n=Vt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Um(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nr(e){return e instanceof Map}function an(e){return e instanceof Set}function Nt(e){return e.copy_||e.base_}function Yi(e,t){if(nr(e))return new Map(e);if(an(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Lc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Te];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],f=n[a];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(n[a]={configurable:!0,writable:!0,enumerable:f.enumerable,value:e[a]})}return Object.create(_t(e),n)}else{let n=_t(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Wn(e,t=!1){return Kn(e)||je(e)||!De(e)||(Vt(e)>1&&Object.defineProperties(e,{set:{value:Hn},add:{value:Hn},clear:{value:Hn},delete:{value:Hn}}),Object.freeze(e),t&&Object.values(e).forEach(r=>Wn(r,!0))),e}function Hn(){Ae(2)}function Kn(e){return Object.isFrozen(e)}var Ji={};function Lt(e){let t=Ji[e];return t||Ae(0,e),t}function Qm(e,t){Ji[e]||(Ji[e]=t)}var rn;function Qc(){return rn}function Bm(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function jc(e,t){t&&(Lt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xi(e){Zi(e),e.drafts_.forEach($m),e.drafts_=null}function Zi(e){e===rn&&(rn=e.parent_)}function Nc(e){return rn=Bm(rn,e)}function $m(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _c(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(Xi(t),Ae(4)),De(e)&&(e=zn(t,e),t.parent_||Gn(t,e)),t.patches_&&Lt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=zn(t,r,[]),Xi(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ra?e:void 0}function zn(e,t,r){if(Kn(t))return t;let n=t[Te];if(!n)return en(t,(o,i)=>Vc(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Gn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),en(i,(f,m)=>Vc(e,n,o,f,m,r,a)),Gn(e,o,!1),r&&e.patches_&&Lt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Vc(e,t,r,n,o,i,a){if(je(o)){let f=i&&t&&t.type_!==3&&!tn(t.assigned_,n)?i.concat(n):void 0,m=zn(e,o,f);if(Uc(r,n,m),je(m))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!Kn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;zn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(nr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Gn(e,o)}}function Gn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Wn(t,r)}function Hm(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Qc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=oa;r&&(o=[n],i=nn);let{revoke:a,proxy:f}=Proxy.revocable(o,i);return n.draft_=f,n.revoke_=a,f}var oa={get(e,t){if(t===Te)return e;let r=Nt(e);if(!tn(r,t))return zm(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===Wi(e.base_,t)?(Ki(e),e.copy_[t]=ta(n,e)):n},has(e,t){return t in Nt(e)},ownKeys(e){return Reflect.ownKeys(Nt(e))},set(e,t,r){let n=Bc(Nt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Wi(Nt(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Um(r,o)&&(r!==void 0||tn(e.base_,t)))return!0;Ki(e),ea(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 Wi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ki(e),ea(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Nt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ae(11)},getPrototypeOf(e){return _t(e.base_)},setPrototypeOf(){Ae(12)}},nn={};en(oa,(e,t)=>{nn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nn.deleteProperty=function(e,t){return nn.set.call(this,e,t,void 0)};nn.set=function(e,t,r){return oa.set.call(this,e[0],t,r,e[0])};function Wi(e,t){let r=e[Te];return(r?Nt(r):e)[t]}function zm(e,t,r){let n=Bc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Bc(e,t){if(!(t in e))return;let r=_t(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=_t(r)}}function ea(e){e.modified_||(e.modified_=!0,e.parent_&&ea(e.parent_))}function Ki(e){e.copy_||(e.copy_=Yi(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Gm=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(m=i,...p){return a.produce(m,y=>r.call(this,y,...p))}}typeof r!="function"&&Ae(6),n!==void 0&&typeof n!="function"&&Ae(7);let o;if(De(t)){let i=Nc(this),a=ta(t,void 0),f=!0;try{o=r(a),f=!1}finally{f?Xi(i):Zi(i)}return jc(i,n),_c(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===ra&&(o=void 0),this.autoFreeze_&&Wn(o,!0),n){let i=[],a=[];Lt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ae(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...f)=>this.produceWithPatches(a,m=>t(m,...f));let n,o;return[this.produce(t,r,(a,f)=>{n=a,o=f}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||Ae(8),je(e)&&(e=$c(e));let t=Nc(this),r=ta(e,void 0);return r[Te].isManual_=!0,Zi(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&Ae(9);let{scope_:n}=r;return jc(n,t),_c(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Lt("Patches").applyPatches_;return je(e)?n(e,t):this.produce(e,o=>n(o,t))}};function ta(e,t){let r=nr(e)?Lt("MapSet").proxyMap_(e,t):an(e)?Lt("MapSet").proxySet_(e,t):Hm(e,t);return(t?t.scope_:Qc()).drafts_.push(r),r}function $c(e){return je(e)||Ae(10,e),Hc(e)}function Hc(e){if(!De(e)||Kn(e))return e;let t=e[Te],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yi(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Yi(e,!0);return en(r,(n,o)=>{Uc(r,n,Hc(o))}),t&&(t.finalized_=!1),r}function zc(){let t="replace",r="add",n="remove";function o(S,g,v,R){switch(S.type_){case 0:case 2:return a(S,g,v,R);case 1:return i(S,g,v,R);case 3:return f(S,g,v,R)}}function i(S,g,v,R){let{base_:k,assigned_:x}=S,P=S.copy_;P.length<k.length&&([k,P]=[P,k],[v,R]=[R,v]);for(let w=0;w<k.length;w++)if(x[w]&&P[w]!==k[w]){let E=g.concat([w]);v.push({op:t,path:E,value:h(P[w])}),R.push({op:t,path:E,value:h(k[w])})}for(let w=k.length;w<P.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:h(P[w])})}for(let w=P.length-1;k.length<=w;--w){let E=g.concat([w]);R.push({op:n,path:E})}}function a(S,g,v,R){let{base_:k,copy_:x}=S;en(S.assigned_,(P,w)=>{let E=Gi(k,P),j=Gi(x,P),O=w?tn(k,P)?t:r:n;if(E===j&&O===t)return;let I=g.concat(P);v.push(O===n?{op:O,path:I}:{op:O,path:I,value:j}),R.push(O===r?{op:n,path:I}:O===n?{op:r,path:I,value:h(E)}:{op:t,path:I,value:h(E)})})}function f(S,g,v,R){let{base_:k,copy_:x}=S,P=0;k.forEach(w=>{if(!x.has(w)){let E=g.concat([P]);v.push({op:n,path:E,value:w}),R.unshift({op:r,path:E,value:w})}P++}),P=0,x.forEach(w=>{if(!k.has(w)){let E=g.concat([P]);v.push({op:r,path:E,value:w}),R.unshift({op:n,path:E,value:w})}P++})}function m(S,g,v,R){v.push({op:t,path:[],value:g===ra?void 0:g}),R.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:R,op:k}=v,x=S;for(let j=0;j<R.length-1;j++){let O=Vt(x),I=R[j];typeof I!="string"&&typeof I!="number"&&(I=""+I),(O===0||O===1)&&(I==="__proto__"||I==="constructor")&&Ae(19),typeof x=="function"&&I==="prototype"&&Ae(19),x=Gi(x,I),typeof x!="object"&&Ae(18,R.join("/"))}let P=Vt(x),w=y(v.value),E=R[R.length-1];switch(k){case t:switch(P){case 2:return x.set(E,w);case 3:Ae(16);default:return x[E]=w}case r:switch(P){case 1:return E==="-"?x.push(w):x.splice(E,0,w);case 2:return x.set(E,w);case 3:return x.add(w);default:return x[E]=w}case n:switch(P){case 1:return x.splice(E,1);case 2:return x.delete(E);case 3:return x.delete(v.value);default:return delete x[E]}default:Ae(17,k)}}),S}function y(S){if(!De(S))return S;if(Array.isArray(S))return S.map(y);if(nr(S))return new Map(Array.from(S.entries()).map(([v,R])=>[v,y(R)]));if(an(S))return new Set(Array.from(S).map(y));let g=Object.create(_t(S));for(let v in S)g[v]=y(S[v]);return tn(S,Zr)&&(g[Zr]=S[Zr]),g}function h(S){return je(S)?y(S):S}Qm("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:m})}var on=new Gm,nt=on.produce,Yn=on.produceWithPatches.bind(on);var ia=on.applyPatches.bind(on);d();c();l();u();function Wm(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Km(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ym(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 Gc=e=>Array.isArray(e)?e:[e];function Jm(e){let t=Array.isArray(e[0])?e[0]:e;return Ym(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Xm(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Bx=Symbol();var $x=Object.getPrototypeOf({});var Zm=class{constructor(e){this.value=e}deref(){return this.value}},eg=typeof WeakRef<"u"?WeakRef:Zm,tg=0,Wc=1;function Jn(){return{s:tg,v:void 0,o:null,p:null}}function or(e,t={}){let r=Jn(),{resultEqualityCheck:n}=t,o,i=0;function a(){let f=r,{length:m}=arguments;for(let h=0,S=m;h<S;h++){let g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=f.o;v===null&&(f.o=v=new WeakMap);let R=v.get(g);R===void 0?(f=Jn(),v.set(g,f)):f=R}else{let v=f.p;v===null&&(f.p=v=new Map);let R=v.get(g);R===void 0?(f=Jn(),v.set(g,f)):f=R}}let p=f,y;if(f.s===Wc)y=f.v;else if(y=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,y)&&(y=h,i!==0&&i--),o=typeof y=="object"&&y!==null||typeof y=="function"?new eg(y):y}return p.s=Wc,p.v=y,y}return a.clearCache=()=>{r=Jn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Kc(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,f,m={},p=o.pop();typeof p=="object"&&(m=p,p=o.pop()),Wm(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let y={...r,...m},{memoize:h,memoizeOptions:S=[],argsMemoize:g=or,argsMemoizeOptions:v=[],devModeChecks:R={}}=y,k=Gc(S),x=Gc(v),P=Jm(o),w=h(function(){return i++,p.apply(null,arguments)},...k),E=!0,j=g(function(){a++;let I=Xm(P,arguments);return f=w.apply(null,I),f},...x);return Object.assign(j,{resultFunc:p,memoizedResultFunc:w,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>f,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var pe=Kc(or),rg=Object.assign((e,t=pe)=>{Km(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,f,m)=>(a[r[m]]=f,a),{}))},{withTypes:()=>rg});d();c();l();u();function Yc(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Jc=Yc(),Xc=Yc;var ng=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?rr:rr.apply(null,arguments)},cR=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},og=e=>e&&typeof e.match=="function";function D(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error($e(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>$n(n)&&n.type===e,r}var nu=class sn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sn.prototype)}static get[Symbol.species](){return sn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sn(...t[0].concat(this)):new sn(...t.concat(this))}};function Zc(e){return De(e)?nt(e,()=>{}):e}function eu(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ig(e){return typeof e=="boolean"}var ag=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new nu;return r&&(ig(r)?a.push(Jc):a.push(Xc(r.extraArgument))),a},cn="RTK_autoBatch",ar=()=>e=>({payload:e,meta:{[cn]:!0}}),tu=e=>t=>{setTimeout(t,e)},sg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,f=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tu(10):e.type==="callback"?e.queueNotification:tu(e.timeout),p=()=>{a=!1,i&&(i=!1,f.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let h=()=>o&&y(),S=n.subscribe(h);return f.add(y),()=>{S(),f.delete(y)}},dispatch(y){try{return o=!y?.meta?.[cn],i=!o,i&&(a||(a=!0,m(p))),n.dispatch(y)}finally{o=!0}}})},cg=e=>function(r){let{autoBatch:n=!0}=r??{},o=new nu(e);return n&&o.push(sg(typeof n=="object"?n:void 0)),o};function ou(e){let t=ag(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},f;if(typeof r=="function")f=r;else if(We(r))f=tr(r);else throw new Error($e(1));let m;typeof n=="function"?m=n(t):m=t();let p=rr;o&&(p=ng({trace:!1,...(typeof o=="object"&&o)}));let y=Mc(...m),h=cg(y),S=typeof a=="function"?a(h):h(),g=p(...S);return zi(f,i,g)}function iu(e){let t={},r=[],n,o={addCase(i,a){let f=typeof i=="string"?i:i.type;if(!f)throw new Error($e(28));if(f in t)throw new Error($e(29));return t[f]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function ug(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=iu(t),i;if(ug(e))i=()=>Zc(e());else{let f=Zc(e);i=()=>f}function a(f=i(),m){let p=[r[m.type],...n.filter(({matcher:y})=>y(m)).map(({reducer:y})=>y)];return p.filter(y=>!!y).length===0&&(p=[o]),p.reduce((y,h)=>{if(h)if(je(y)){let g=h(y,m);return g===void 0?y:g}else{if(De(y))return nt(y,S=>h(S,m));{let S=h(y,m);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return y},f)}return a.getInitialState=i,a}var au=(e,t)=>og(e)?e.match(t):e(t);function Ke(...e){return t=>e.some(r=>au(r,t))}function ir(...e){return t=>e.every(r=>au(r,t))}function Zn(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function un(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function eo(...e){return e.length===0?t=>Zn(t,["pending"]):un(e)?Ke(...e.map(t=>t.pending)):eo()(e[0])}function Ut(...e){return e.length===0?t=>Zn(t,["rejected"]):un(e)?Ke(...e.map(t=>t.rejected)):Ut()(e[0])}function ln(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ir(Ut(...e),t):un(e)?ir(Ut(...e),t):ln()(e[0])}function ot(...e){return e.length===0?t=>Zn(t,["fulfilled"]):un(e)?Ke(...e.map(t=>t.fulfilled)):ot()(e[0])}function to(...e){return e.length===0?t=>Zn(t,["pending","fulfilled","rejected"]):un(e)?Ke(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):to()(e[0])}var lg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ro=(e=21)=>{let t="",r=e;for(;r--;)t+=lg[Math.random()*64|0];return t},dg=["name","message","stack","code"],aa=class{constructor(e,t){le(this,"_type");this.payload=e,this.meta=t}},ru=class{constructor(e,t){le(this,"_type");this.payload=e,this.meta=t}},pg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of dg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},de=(()=>{function e(t,r,n){let o=D(t+"/fulfilled",(m,p,y,h)=>({payload:m,meta:{...(h||{}),arg:y,requestId:p,requestStatus:"fulfilled"}})),i=D(t+"/pending",(m,p,y)=>({payload:void 0,meta:{...(y||{}),arg:p,requestId:m,requestStatus:"pending"}})),a=D(t+"/rejected",(m,p,y,h,S)=>({payload:h,error:(n&&n.serializeError||pg)(m||"Rejected"),meta:{...(S||{}),arg:y,requestId:p,rejectedWithValue:!!h,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function f(m){return(p,y,h)=>{let S=n?.idGenerator?n.idGenerator(m):ro(),g=new s.AbortController,v,R;function k(P){R=P,g.abort()}let x=_asyncToGenerator(function*(){let P;try{let E=n?.condition?.(m,{getState:y,extra:h});if(mg(E)&&(E=yield E),E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let j=new Promise((O,I)=>{v=()=>{I({name:"AbortError",message:R||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,m,n?.getPendingMeta?.({requestId:S,arg:m},{getState:y,extra:h}))),P=yield Promise.race([j,Promise.resolve(r(m,{dispatch:p,getState:y,extra:h,requestId:S,signal:g.signal,abort:k,rejectWithValue:(O,I)=>new aa(O,I),fulfillWithValue:(O,I)=>new ru(O,I)})).then(O=>{if(O instanceof aa)throw O;return O instanceof ru?o(O.payload,S,m,O.meta):o(O,S,m)})])}catch(E){P=E instanceof aa?a(null,S,m,E.payload,E.meta):a(E,S,m)}finally{v&&g.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(P)&&P.meta.condition||p(P),P})();return Object.assign(x,{abort:k,requestId:S,arg:m,unwrap(){return x.then(fg)}})}}return Object.assign(f,{pending:i,rejected:a,fulfilled:o,settled:Ke(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function fg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function mg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var su=Symbol.for("rtk-slice-createasyncthunk"),fR={[su]:de};function gg(e,t){return`${e}/${t}`}function yg({creators:e}={}){let t=e?.asyncThunk?.[su];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error($e(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Sg()):n.reducers)||{},f=Object.keys(a),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(P,w){let E=typeof P=="string"?P:P.type;if(!E)throw new Error($e(12));if(E in m.sliceCaseReducersByType)throw new Error($e(13));return m.sliceCaseReducersByType[E]=w,p},addMatcher(P,w){return m.sliceMatchers.push({matcher:P,reducer:w}),p},exposeAction(P,w){return m.actionCreators[P]=w,p},exposeCaseReducer(P,w){return m.sliceCaseReducersByName[P]=w,p}};f.forEach(P=>{let w=a[P],E={reducerName:P,type:gg(o,P),createNotation:typeof n.reducers=="function"};bg(w)?Cg(E,w,p,t):vg(E,w,p)});function y(){let[P={},w=[],E=void 0]=typeof n.extraReducers=="function"?iu(n.extraReducers):[n.extraReducers],j={...P,...m.sliceCaseReducersByType};return ge(n.initialState,O=>{for(let I in j)O.addCase(I,j[I]);for(let I of m.sliceMatchers)O.addMatcher(I.matcher,I.reducer);for(let I of w)O.addMatcher(I.matcher,I.reducer);E&&O.addDefaultCase(E)})}let h=P=>P,S=new Map,g;function v(P,w){return g||(g=y()),g(P,w)}function R(){return g||(g=y()),g.getInitialState()}function k(P,w=!1){function E(O){let I=O[P];return typeof I>"u"&&w&&(I=R()),I}function j(O=h){let I=eu(S,w,()=>new WeakMap);return eu(I,O,()=>{let F={};for(let[T,N]of Object.entries(n.selectors??{}))F[T]=hg(N,O,R,w);return F})}return{reducerPath:P,getSelectors:j,get selectors(){return j(E)},selectSlice:E}}let x={name:o,reducer:v,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:R,...k(i),injectInto(P,{reducerPath:w,...E}={}){let j=w??i;return P.inject({reducerPath:j,reducer:v},E),{...x,...k(j,!0)}}};return x}}function hg(e,t,r,n){function o(i,...a){let f=t(i);return typeof f>"u"&&n&&(f=r()),e(f,...a)}return o.unwrapped=e,o}var Qt=yg();function Sg(){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 vg({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Ag(n))throw new Error($e(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?D(e,a):D(e))}function bg(e){return e._reducerDefinitionType==="asyncThunk"}function Ag(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Cg({type:e,reducerName:t},r,n,o){if(!o)throw new Error($e(18));let{payloadCreator:i,fulfilled:a,pending:f,rejected:m,settled:p,options:y}=r,h=o(e,i,y);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),f&&n.addCase(h.pending,f),m&&n.addCase(h.rejected,m),p&&n.addMatcher(h.settled,p),n.exposeCaseReducer(t,{fulfilled:a||Xn,pending:f||Xn,rejected:m||Xn,settled:p||Xn})}function Xn(){}var cu="listener",uu="completed",lu="cancelled",mR=`task-${lu}`,gR=`task-${uu}`,yR=`${cu}-${lu}`,hR=`${cu}-${uu}`;var{assign:du}=Object;var sa="listenerMiddleware";var wg=du(D(`${sa}/add`),{withTypes:()=>wg}),SR=D(`${sa}/removeAll`),xg=du(D(`${sa}/remove`),{withTypes:()=>xg});var vR=Symbol.for("rtk-state-proxy-original");function $e(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();var W=new H({required:!0,emptyAllowed:!1}),Ce=new H({required:!1,emptyAllowed:!1}),we=new H({required:!0,emptyAllowed:!0}),FR=new H({required:!1,emptyAllowed:!0}),no=new ie({each:W,required:!0}),pu=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),fu=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),OR=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),it=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ve=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new Wr(o);return{payload:e}},Q=(e,t)=>{try{return Ve(e,t)}catch(r){return{payload:e,error:it(r)}}},mu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return yu(e,t,r,o,"Controller initialization error")},gu=(e,t,r,n)=>{let o=`Check the options of ${n}`;return yu(e,t,r,o,"Controller initialization error")},yu=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var sr="4.0.0-pre.e3bf4d7bb2",hu=["@coveo/atomic","@coveo/quantic"];var ca=()=>Ce,Su=()=>W,at=D("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:Ce,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ce})),Ye=D("configuration/updateSearchConfiguration",e=>Q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,timezone:Ce,locale:Ce,authenticationProviders:new ie({required:!1,each:W})})),Rg={enabled:new ne({default:!0}),originContext:ca(),originLevel2:ca(),originLevel3:ca(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new fe,anonymous:new ne({default:!1}),deviceId:Ce,userDisplayName:Ce,documentLocation:Ce,trackingId:fu,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:hu.reduce((e,t)=>(e[t]=pu,e),{})})},cr=D("configuration/updateAnalyticsConfiguration",e=>Q(e,Rg)),ur=D("configuration/analytics/disable"),lr=D("configuration/analytics/enable"),oo=D("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:Su()})),io=D("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:Su()}));d();c();l();u();d();c();l();u();d();c();l();u();var vu={q:new H,enableQuerySyntax:new ne,aq:new H,cq:new H,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new H,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new ne,sf:new K,tab:new H,af:new K};var ht=D("searchParameters/restore",e=>Q(e,vu)),bu=D("searchParameters/restoreTab",e=>Q(e,W));d();c();l();u();var ao=D("debug/enable"),so=D("debug/disable");d();c();l();u();var co=()=>!1;var uo=ge(co(),e=>{e.addCase(ao,()=>!0).addCase(so,()=>!1).addCase(ht,(t,r)=>r.payload.debug??t)});d();c();l();u();var dr=D("pipeline/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var Eg=D("history/undo"),Ig=D("history/redo"),Je=D("history/snapshot"),LE=de("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(Eg()),yield t(qe())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),UE=de("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(Ig()),yield t(qe())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),qe=de("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());d();c();l();u();var pr=()=>"";var fr=ge(pr(),e=>{e.addCase(dr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ye,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var lo=D("app/setError");d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var mr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let f=window.location.hostname,m=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;m.test(f)||p.test(f)||f.indexOf(".")===-1?ua(t,r,i):(a=f.split("."),o=a[a.length-2]+"."+a[a.length-1],ua(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ua(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function kg(){return typeof navigator<"u"}function Au(){try{return typeof localStorage<"u"}catch{return!1}}function Cu(){try{return typeof sessionStorage<"u"}catch{return!1}}function wu(){return!!(kg()&&navigator.cookieEnabled)}var xu=null;function Ru(){return xu||(Au()?localStorage:wu()?new la:Cu()?sessionStorage:new da)}var gr=class gr{getItem(t){return mr.get(`${gr.prefix}${t}`)}removeItem(t){mr.erase(`${gr.prefix}${t}`)}setItem(t,r,n){mr.set(`${gr.prefix}${t}`,r,n)}};le(gr,"prefix","coveo_");var la=gr;var da=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var po="__coveo.analytics.history",Pg=20,Fg=1e3*60,Og=75,Bt=class Bt{constructor(t){le(this,"store");this.store=t||Ru()}static getInstance(t){return Bt.instance||(Bt.instance=new Bt(t)),Bt.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(po);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(po);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(po,JSON.stringify(t.slice(0,Pg)))}catch{}}clear(){try{this.store.removeItem(po)}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,Og)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Fg:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};le(Bt,"instance",null);var pa=Bt,Xe=pa;d();c();l();u();d();c();l();u();var yr=pe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${sr}`));d();c();l();u();d();c();l();u();function st(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function q(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(y){try{p(n.next(y))}catch(h){a(h)}}function m(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(f,m)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function ga(){return typeof window<"u"}function ka(){return typeof navigator<"u"}function hr(){return typeof document<"u"}function ya(){try{return typeof localStorage<"u"}catch{return!1}}function Tg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Vu(){return ka()&&navigator.cookieEnabled}var Dg=[ae.click,ae.custom,ae.search,ae.view],qg=(e,t)=>Dg.indexOf(e)!==-1?Object.assign({language:hr()?document.documentElement.lang:"unknown",userAgent:ka()?navigator.userAgent:"unknown"},t):t,pn=class e{static set(t,r,n){var o,i,a,f;n&&(i=new Date,i.setTime(i.getTime()+n)),f=window.location.hostname,f.indexOf(".")===-1?Eu(t,r,i):(a=f.split("."),o=a[a.length-2]+"."+a[a.length-1],Eu(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Eu(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Mg(){return ya()?localStorage:Vu()?new fn:Tg()?sessionStorage:new vr}var fn=class e{getItem(t){return pn.get(`${e.prefix}${t}`)}removeItem(t){pn.erase(`${e.prefix}${t}`)}setItem(t,r,n){pn.set(`${e.prefix}${t}`,r,n)}};fn.prefix="coveo_";var ha=class{constructor(){this.cookieStorage=new fn}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},vr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},fo="__coveo.analytics.history",jg=20,Ng=1e3*60,_g=75,yo=class{constructor(t){this.store=t||Mg()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return q(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(fo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(fo);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(fo,JSON.stringify(t.slice(0,jg)))}catch{}}clear(){try{this.store.removeItem(fo)}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,_g)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Ng:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Vg=(e,t)=>q(void 0,void 0,void 0,function*(){return e===ae.view?(yield Lg(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Lg=e=>q(void 0,void 0,void 0,function*(){let t=new yo,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),mo,Ug=new Uint8Array(16);function Qg(){if(!mo&&(mo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mo(Ug)}var Bg=/^(?:[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 ho(e){return typeof e=="string"&&Bg.test(e)}var xe=[];for(let e=0;e<256;++e)xe.push((e+256).toString(16).slice(1));function Lu(e,t=0){return(xe[e[t+0]]+xe[e[t+1]]+xe[e[t+2]]+xe[e[t+3]]+"-"+xe[e[t+4]]+xe[e[t+5]]+"-"+xe[e[t+6]]+xe[e[t+7]]+"-"+xe[e[t+8]]+xe[e[t+9]]+"-"+xe[e[t+10]]+xe[e[t+11]]+xe[e[t+12]]+xe[e[t+13]]+xe[e[t+14]]+xe[e[t+15]]).toLowerCase()}function $g(e){if(!ho(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 Hg(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var zg="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Gg="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Wg(e,t,r){function n(o,i,a,f){var m;if(typeof o=="string"&&(o=Hg(o)),typeof i=="string"&&(i=$g(i)),((m=i)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){f=f||0;for(let y=0;y<16;++y)a[f+y]=p[y];return a}return Lu(p)}try{n.name=e}catch{}return n.DNS=zg,n.URL=Gg,n}var Kg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Iu={randomUUID:Kg};function $t(e,t,r){if(Iu.randomUUID&&!t&&!e)return Iu.randomUUID();e=e||{};let n=e.random||(e.rng||Qg)();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 Lu(n)}function Yg(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 fa(e,t){return e<<t|e>>>32-t}function Jg(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let f=0;f<a.length;++f)e.push(a.charCodeAt(f))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let f=new Uint32Array(16);for(let m=0;m<16;++m)f[m]=e[a*64+m*4]<<24|e[a*64+m*4+1]<<16|e[a*64+m*4+2]<<8|e[a*64+m*4+3];i[a]=f}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let f=new Uint32Array(80);for(let g=0;g<16;++g)f[g]=i[a][g];for(let g=16;g<80;++g)f[g]=fa(f[g-3]^f[g-8]^f[g-14]^f[g-16],1);let m=r[0],p=r[1],y=r[2],h=r[3],S=r[4];for(let g=0;g<80;++g){let v=Math.floor(g/20),R=fa(m,5)+Yg(v,p,y,h)+S+t[v]+f[g]>>>0;S=h,h=y,y=fa(p,30)>>>0,p=m,m=R}r[0]=r[0]+m>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Xg=Wg("v5",80,Jg),ku=Xg,Uu="2.30.45",Pu=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,dn={pageview:"pageview",event:"event"},So=class{constructor({client:t,uuidGenerator:r=$t}){this.client=t,this.uuidGenerator=r}},Sa=class extends So{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Pu(window.location),this.lastReferrer=hr()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:hr()?document.title:"",encoding:hr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===dn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===dn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===dn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===dn.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Pu(window.location)}},St=class e{constructor(t,r){if(!ho(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return ho(i)?new e(i,Number.parseInt(o)*1e3):null}};St.cvo_cid="cvo_cid";St.expirationTime=120;var va=class extends So{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return q(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(St.cvo_cid,new St(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};va.Id="link";var Ue=Object.keys;function go(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ma=128,Qu=192,Fu=224,Ou=240;function Zg(e){return(e&248)===Ou?4:(e&Ou)===Fu?3:(e&Fu)===Qu?2:1}function ey(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&ma)!=ma)break;if(r-=3,(n&Qu)!=ma){t-r>=Zg(n)*3&&(r=t);break}}return e.substring(0,r)}var ba={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"},ty=Ue(ba).map(e=>ba[e]),ry=[...ty].join("|"),ny=new RegExp(`^(${ry}$)`),oy={svcAction:"svc_action",svcActionData:"svc_action_data"},iy=e=>Ue(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=ba[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),ay=e=>ny.test(e),sy=[ay],Tu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Du={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},vo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},cy=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Aa={id:"quoteId",affiliation:"quoteAffiliation"},Ca={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},uy={add:Ee,bookmark_add:Ee,bookmark_remove:Ee,click:Ee,checkout:Ee,checkout_option:Ee,detail:Ee,impression:Ee,remove:Ee,refund:Object.assign(Object.assign({},Ee),vo),purchase:Object.assign(Object.assign({},Ee),vo),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Aa),review:Object.assign(Object.assign({},Ee),Ca)},ly=Ue(Tu).map(e=>Tu[e]),dy=Ue(Du).map(e=>Du[e]),py=Ue(Ee).map(e=>Ee[e]),fy=Ue(vo).map(e=>vo[e]),my=Ue(Ca).map(e=>Ca[e]),gy=Ue(Aa).map(e=>Aa[e]),yy=[...ly,"custom"].join("|"),hy=[...dy,"custom"].join("|"),Bu="(pr[0-9]+)",$u="(il[0-9]+pi[0-9]+)",Sy=new RegExp(`^${Bu}(${yy})$`),vy=new RegExp(`^(${$u}(${hy}))|(il[0-9]+nm)$`),by=new RegExp(`^(${py.join("|")})$`),Ay=new RegExp(`^(${fy.join("|")})$`),Cy=new RegExp(`^${Bu}custom$`),wy=new RegExp(`^${$u}custom$`),xy=new RegExp(`^(${[...cy,...my,...gy].join("|")})$`),Ry=e=>Sy.test(e),Ey=e=>vy.test(e),Iy=e=>by.test(e),ky=e=>Ay.test(e),Py=e=>xy.test(e),Fy=[Ey,Ry,Iy,ky,Py],Oy=[Cy,wy],Ty={anonymizeIp:"aip"},Dy={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},qy={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},My=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],jy=Object.assign(Object.assign(Object.assign(Object.assign({},Ty),Dy),qy),My.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),wa=Object.assign(Object.assign({},jy),oy),Ny=e=>{let t=!!e.action&&uy[e.action]||{};return Ue(e).reduce((r,n)=>{let o=t[n]||wa[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},_y=Ue(wa).map(e=>wa[e]),Vy=e=>_y.indexOf(e)!==-1,Ly=e=>e==="custom",Uy=e=>[...Fy,...sy,Vy,Ly].some(t=>t(e)),Qy=e=>Ue(e).reduce((t,r)=>{let n=By(r);return n?Object.assign(Object.assign({},t),$y(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),By=e=>{let t;return[...Oy].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},$y=(e,t)=>Ue(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),xa=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:f}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),m=this.encodeForEventType(t,f),p=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:f,body:m}=a;o=f||t;try{i=JSON.parse(m)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Ra=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},qu=b.fetch,bo=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",f={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},f),i?yield i(f,"analyticsFetch"):{}),{url:p}=m,y=st(m,["url"]),h;try{h=yield qu(p,y)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{h.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,h,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield qu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return q(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Ea=class{constructor(t,r){ya()&&Vu()?this.storage=new ha:ya()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new vr),this.client=new bo(t),this.beaconClient=new xa(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Ia=class{constructor(t,r){this.storage=r||new vr,this.client=new bo(t)}getClientDependingOnEventType(t){return this.client}},Ao=class{constructor(){this.storage=new vr,this.client=new Ra}getClientDependingOnEventType(t){return this.client}},Hy="xx",zy=e=>e?.startsWith(Hy)||!1,Gy=`
|
|
26
|
+
`;return new Wr(r)}var Wr=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Fe=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw Xf(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&X(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function ve(e){return e===void 0}function Zf(e){return e===null}function X(e){return ve(e)||Zf(e)}var ne=class{constructor(e={}){de(this,"value");this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(em(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function em(e){return ve(e)||mc(e)}function mc(e){return typeof e=="boolean"}var J=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t||(tm(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 tm(e){return ve(e)||gc(e)}function gc(e){return typeof e=="number"&&!Number.isNaN(e)}var rm=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){de(this,"value");de(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ve(e))return null;if(!jn(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(rm.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 jn(e){return Object.prototype.toString.call(e)==="[object String]"}var K=class{constructor(e={}){de(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ve(e))return this.config.options.required?"value is required and is currently undefined":null;if(!yc(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&X(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function yc(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"value");this.config=e,this.value=new fe(this.config)}validate(e){if(!X(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(X(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&X(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return mc(e)||jn(e)||gc(e)||yc(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function hc(e){return Array.isArray(e)}var Vi=class{constructor(e){de(this,"value");this.config=e,this.value=new fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ve(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();function Sc(e){return Array.isArray(e)}function Mn(e){return e.trim()===""}var nm=new Set(["1",1,"yes",!0]);function vc(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>nm.has(r))}function bc(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Kr(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function om(e){if(Mn(e.openingDelimiter)||Mn(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(X(e.content)||Mn(e.content))return e.content;if(e.highlights.length===0)return Zt(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,f=a+i.length;if(f>t)break;r+=Zt(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Zt(e.content.slice(a,f)),r+=e.closingDelimiter,n=f}return n!==t&&(r+=Zt(e.content.slice(n))),r}function im(e,t){return e=Zt(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Li(n,t.notMatchDelimiters):o?Li(o,t.exactMatchDelimiters):i?Li(i,t.correctionDelimiters):r)}function Li(e,t){return t?t.open+e+t.close:e}function Zt(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}d();c();l();u();var Tc=Qe(kc(),1);d();c();l();u();var ze=new Error("Failed to load reducers."),er=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},Mt=class extends Error{constructor(r,n){super();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function Pc(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Fc(e){return typeof e!="object"||!e?!1:Object.values(e).every(Om)}function Om(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Oc(e){return e===429}var Be=class e{static call(t){return _asyncToGenerator(function*(){let r=Tm(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,f=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let m=yield A(i,a);if(Oc(m.status))throw m;return m});return function f(){return _ref.apply(this,arguments)}}();try{let m=yield(0,Tc.backOff)(f,{retry:p=>{let y=p&&Oc(p.status);return y&&n.info("Platform retrying request"),y}});switch(m.status){case 419:case 401:throw n.info("Platform renewing token"),new er;case 404:throw new Mt(i,m.status);default:return n.info({response:m,requestInfo:o},"Platform response"),m}}catch(m){return m.message==="Failed to fetch"?new Mt(i):m}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:f,...m}=t,p=Kr(m);try{let y=yield o(t,n,a);return{...t,...y}}catch(y){i.error(y,"Platform request preprocessing failed. Returning default request options.")}return p})()}};function ke(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function mt(e,t="prod"){return`${ke(e,t)}/rest/search/v2`}function _n(e,t="prod"){return`${ke(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function Tm(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,f=e.method==="POST"||e.method==="PUT",m=Dm(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(f&&{body:m}),signal:a}}function Dm(e,t){return t==="application/x-www-form-urlencoded"?Fc(e)?Pc(e):"":JSON.stringify(e)}d();c();l();u();d();c();l();u();var Vn=e=>e;d();c();l();u();d();c();l();u();function Ln(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Ge(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Ln(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Ln(),extendedResults:{},searchAction:void 0}}d();c();l();u();function gt(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var yt=e=>{let{response:t}=e;return t.body?qm(e):jm(t)},qm=e=>Nm(e)?_m(e):Mm(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},jm=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function Mm(e){return e.body.statusCode!==void 0}function Nm(e){return e.body.exception!==void 0}var _m=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var ht=class{constructor(){de(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();var Xr=class{constructor(t){de(this,"_basePath");de(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};d();c();l();u();function Dc(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var nt=(e,t,r,n)=>{let o=new Xr(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var qc=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(e,t){let r=yield Be.call({...nt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:gt(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Dc(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return Vm(a)?{success:a}:{error:yt({response:r,body:a})}});return function qc(_x,_x2){return _ref2.apply(this,arguments)}}();function Vm(e){return typeof e=="string"}d();c();l();u();function Lm(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function Um(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Un(e,t){if(t&&e.name==="AbortError")return{error:Um(e)};if(e instanceof Mt)return{error:Lm(e)};throw e}var Qn=class{constructor(t){this.options=t;de(this,"apiCallsQueues",{unknown:new ht,mainSearch:new ht,facetValues:new ht,foldingCollection:new ht,instantResults:new ht})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Be.call({...nt(t,"POST","application/json","/plan"),requestParams:gt(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Un(r);let n=yield r.json();return Bm(n)?{success:n}:{error:yt({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Be.call({...nt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:gt(t),..._this3.options});if(r instanceof Error)return Un(r);let n=yield r.json(),o={response:r,body:n};return Qm(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:yt(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(f=>Be.call({...nt(t,"POST","application/json",""),requestParams:gt(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:f??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Un(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return jc(i)?(a.body=Mc(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:yt(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Be.call({...nt(t,"POST","application/json","/facet"),requestParams:gt(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Be.call({...nt(t,"POST","application/json",""),requestParams:gt(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(jc(n)){let o={response:r,body:n};return o.body=Mc(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:yt({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return qc(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Be.call({...nt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return $m(n)?{success:n}:{error:yt({response:r,body:n})}})()}},Bn=e=>e.success!==void 0,Oe=e=>e.error!==void 0;function jc(e){return e.results!==void 0}function Mc(e){let t=Ln();return X(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function Qm(e){return e.completions!==void 0}function Bm(e){return e.preprocessingOutput!==void 0}function $m(e){return e.fields!==void 0}d();c();l();u();var Nc=e=>e,_c=e=>e,Vc=e=>e;d();c();l();u();d();c();l();u();d();c();l();u();function be(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Hm=typeof Symbol=="function"&&Symbol.observable||"@@observable",Lc=Hm,Yi=()=>Math.random().toString(36).substring(7).split("").join("."),zm={INIT:`@@redux/INIT${Yi()}`,REPLACE:`@@redux/REPLACE${Yi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yi()}`},$n=zm;function We(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Ji(e,t,r){if(typeof e!="function")throw new Error(be(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(be(1));return r(Ji)(e,t)}let n=e,o=t,i=new Map,a=i,f=0,m=!1;function p(){a===i&&(a=new Map,i.forEach((k,x)=>{a.set(x,k)}))}function y(){if(m)throw new Error(be(3));return o}function h(k){if(typeof k!="function")throw new Error(be(4));if(m)throw new Error(be(5));let x=!0;p();let P=f++;return a.set(P,k),function(){if(x){if(m)throw new Error(be(6));x=!1,p(),a.delete(P),i=null}}}function S(k){if(!We(k))throw new Error(be(7));if(typeof k.type>"u")throw new Error(be(8));if(typeof k.type!="string")throw new Error(be(17));if(m)throw new Error(be(9));try{m=!0,o=n(o,k)}finally{m=!1}return(i=a).forEach(P=>{P()}),k}function g(k){if(typeof k!="function")throw new Error(be(10));n=k,S({type:$n.REPLACE})}function v(){let k=h;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(be(11));function P(){let E=x;E.next&&E.next(y())}return P(),{unsubscribe:k(P)}},[Lc](){return this}}}return S({type:$n.INIT}),{dispatch:S,subscribe:h,getState:y,replaceReducer:g,[Lc]:v}}function Gm(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:$n.INIT})>"u")throw new Error(be(12));if(typeof r(void 0,{type:$n.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function tr(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let f=t[a];typeof e[f]=="function"&&(r[f]=e[f])}let n=Object.keys(r),o,i;try{Gm(r)}catch(a){i=a}return function(f={},m){if(i)throw i;let p=!1,y={};for(let h=0;h<n.length;h++){let S=n[h],g=r[S],v=f[S],R=g(v,m);if(typeof R>"u"){let k=m&&m.type;throw new Error(be(14))}y[S]=R,p=p||R!==v}return p=p||n.length!==Object.keys(f).length,p?y:f}}function rr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Uc(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(be(15))},a={getState:o.getState,dispatch:(m,...p)=>i(m,...p)},f=e.map(m=>m(a));return i=rr(...f)(o.dispatch),{...o,dispatch:i}}}function Hn(e){return We(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var sa=Symbol.for("immer-nothing"),Zr=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function Ae(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var _t=Object.getPrototypeOf;function Me(e){return!!e&&!!e[Te]}function De(e){return e?zc(e)||Array.isArray(e)||!!e[Zr]||!!e.constructor?.[Zr]||nr(e)||an(e):!1}var Wm=Object.prototype.constructor.toString();function zc(e){if(!e||typeof e!="object")return!1;let t=_t(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)===Wm}function ca(e){return Me(e)||Ae(15,e),e[Te].base_}function en(e,t){Vt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Vt(e){let t=e[Te];return t?t.type_:Array.isArray(e)?1:nr(e)?2:an(e)?3:0}function tn(e,t){return Vt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Xi(e,t){return Vt(e)===2?e.get(t):e[t]}function Gc(e,t,r){let n=Vt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Km(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nr(e){return e instanceof Map}function an(e){return e instanceof Set}function Nt(e){return e.copy_||e.base_}function ta(e,t){if(nr(e))return new Map(e);if(an(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=zc(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Te];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],f=n[a];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(n[a]={configurable:!0,writable:!0,enumerable:f.enumerable,value:e[a]})}return Object.create(_t(e),n)}else{let n=_t(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function Kn(e,t=!1){return Yn(e)||Me(e)||!De(e)||(Vt(e)>1&&Object.defineProperties(e,{set:{value:zn},add:{value:zn},clear:{value:zn},delete:{value:zn}}),Object.freeze(e),t&&Object.values(e).forEach(r=>Kn(r,!0))),e}function zn(){Ae(2)}function Yn(e){return Object.isFrozen(e)}var ra={};function Lt(e){let t=ra[e];return t||Ae(0,e),t}function Ym(e,t){ra[e]||(ra[e]=t)}var rn;function Wc(){return rn}function Jm(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Qc(e,t){t&&(Lt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function na(e){oa(e),e.drafts_.forEach(Xm),e.drafts_=null}function oa(e){e===rn&&(rn=e.parent_)}function Bc(e){return rn=Jm(rn,e)}function Xm(e){let t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $c(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Te].modified_&&(na(t),Ae(4)),De(e)&&(e=Gn(t,e),t.parent_||Wn(t,e)),t.patches_&&Lt("Patches").generateReplacementPatches_(r[Te].base_,e,t.patches_,t.inversePatches_)):e=Gn(t,r,[]),na(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sa?e:void 0}function Gn(e,t,r){if(Yn(t))return t;let n=t[Te];if(!n)return en(t,(o,i)=>Hc(e,n,t,o,i,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Wn(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let o=n.copy_,i=o,a=!1;n.type_===3&&(i=new Set(o),o.clear(),a=!0),en(i,(f,m)=>Hc(e,n,o,f,m,r,a)),Wn(e,o,!1),r&&e.patches_&&Lt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Hc(e,t,r,n,o,i,a){if(Me(o)){let f=i&&t&&t.type_!==3&&!tn(t.assigned_,n)?i.concat(n):void 0,m=Gn(e,o,f);if(Gc(r,n,m),Me(m))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(De(o)&&!Yn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Gn(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(nr(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Wn(e,o)}}function Wn(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kn(t,r)}function Zm(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Wc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=ua;r&&(o=[n],i=nn);let{revoke:a,proxy:f}=Proxy.revocable(o,i);return n.draft_=f,n.revoke_=a,f}var ua={get(e,t){if(t===Te)return e;let r=Nt(e);if(!tn(r,t))return eg(e,r,t);let n=r[t];return e.finalized_||!De(n)?n:n===Zi(e.base_,t)?(ea(e),e.copy_[t]=aa(n,e)):n},has(e,t){return t in Nt(e)},ownKeys(e){return Reflect.ownKeys(Nt(e))},set(e,t,r){let n=Kc(Nt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zi(Nt(e),t),i=o?.[Te];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Km(r,o)&&(r!==void 0||tn(e.base_,t)))return!0;ea(e),ia(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Zi(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ea(e),ia(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Nt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ae(11)},getPrototypeOf(e){return _t(e.base_)},setPrototypeOf(){Ae(12)}},nn={};en(ua,(e,t)=>{nn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});nn.deleteProperty=function(e,t){return nn.set.call(this,e,t,void 0)};nn.set=function(e,t,r){return ua.set.call(this,e[0],t,r,e[0])};function Zi(e,t){let r=e[Te];return(r?Nt(r):e)[t]}function eg(e,t,r){let n=Kc(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Kc(e,t){if(!(t in e))return;let r=_t(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=_t(r)}}function ia(e){e.modified_||(e.modified_=!0,e.parent_&&ia(e.parent_))}function ea(e){e.copy_||(e.copy_=ta(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var tg=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let i=r;r=t;let a=this;return function(m=i,...p){return a.produce(m,y=>r.call(this,y,...p))}}typeof r!="function"&&Ae(6),n!==void 0&&typeof n!="function"&&Ae(7);let o;if(De(t)){let i=Bc(this),a=aa(t,void 0),f=!0;try{o=r(a),f=!1}finally{f?na(i):oa(i)}return Qc(i,n),$c(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===sa&&(o=void 0),this.autoFreeze_&&Kn(o,!0),n){let i=[],a=[];Lt("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ae(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...f)=>this.produceWithPatches(a,m=>t(m,...f));let n,o;return[this.produce(t,r,(a,f)=>{n=a,o=f}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){De(e)||Ae(8),Me(e)&&(e=Yc(e));let t=Bc(this),r=aa(e,void 0);return r[Te].isManual_=!0,oa(t),r}finishDraft(e,t){let r=e&&e[Te];(!r||!r.isManual_)&&Ae(9);let{scope_:n}=r;return Qc(n,t),$c(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=Lt("Patches").applyPatches_;return Me(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aa(e,t){let r=nr(e)?Lt("MapSet").proxyMap_(e,t):an(e)?Lt("MapSet").proxySet_(e,t):Zm(e,t);return(t?t.scope_:Wc()).drafts_.push(r),r}function Yc(e){return Me(e)||Ae(10,e),Jc(e)}function Jc(e){if(!De(e)||Yn(e))return e;let t=e[Te],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ta(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ta(e,!0);return en(r,(n,o)=>{Gc(r,n,Jc(o))}),t&&(t.finalized_=!1),r}function Xc(){let t="replace",r="add",n="remove";function o(S,g,v,R){switch(S.type_){case 0:case 2:return a(S,g,v,R);case 1:return i(S,g,v,R);case 3:return f(S,g,v,R)}}function i(S,g,v,R){let{base_:k,assigned_:x}=S,P=S.copy_;P.length<k.length&&([k,P]=[P,k],[v,R]=[R,v]);for(let w=0;w<k.length;w++)if(x[w]&&P[w]!==k[w]){let E=g.concat([w]);v.push({op:t,path:E,value:h(P[w])}),R.push({op:t,path:E,value:h(k[w])})}for(let w=k.length;w<P.length;w++){let E=g.concat([w]);v.push({op:r,path:E,value:h(P[w])})}for(let w=P.length-1;k.length<=w;--w){let E=g.concat([w]);R.push({op:n,path:E})}}function a(S,g,v,R){let{base_:k,copy_:x}=S;en(S.assigned_,(P,w)=>{let E=Xi(k,P),M=Xi(x,P),O=w?tn(k,P)?t:r:n;if(E===M&&O===t)return;let I=g.concat(P);v.push(O===n?{op:O,path:I}:{op:O,path:I,value:M}),R.push(O===r?{op:n,path:I}:O===n?{op:r,path:I,value:h(E)}:{op:t,path:I,value:h(E)})})}function f(S,g,v,R){let{base_:k,copy_:x}=S,P=0;k.forEach(w=>{if(!x.has(w)){let E=g.concat([P]);v.push({op:n,path:E,value:w}),R.unshift({op:r,path:E,value:w})}P++}),P=0,x.forEach(w=>{if(!k.has(w)){let E=g.concat([P]);v.push({op:r,path:E,value:w}),R.unshift({op:n,path:E,value:w})}P++})}function m(S,g,v,R){v.push({op:t,path:[],value:g===sa?void 0:g}),R.push({op:t,path:[],value:S})}function p(S,g){return g.forEach(v=>{let{path:R,op:k}=v,x=S;for(let M=0;M<R.length-1;M++){let O=Vt(x),I=R[M];typeof I!="string"&&typeof I!="number"&&(I=""+I),(O===0||O===1)&&(I==="__proto__"||I==="constructor")&&Ae(19),typeof x=="function"&&I==="prototype"&&Ae(19),x=Xi(x,I),typeof x!="object"&&Ae(18,R.join("/"))}let P=Vt(x),w=y(v.value),E=R[R.length-1];switch(k){case t:switch(P){case 2:return x.set(E,w);case 3:Ae(16);default:return x[E]=w}case r:switch(P){case 1:return E==="-"?x.push(w):x.splice(E,0,w);case 2:return x.set(E,w);case 3:return x.add(w);default:return x[E]=w}case n:switch(P){case 1:return x.splice(E,1);case 2:return x.delete(E);case 3:return x.delete(v.value);default:return delete x[E]}default:Ae(17,k)}}),S}function y(S){if(!De(S))return S;if(Array.isArray(S))return S.map(y);if(nr(S))return new Map(Array.from(S.entries()).map(([v,R])=>[v,y(R)]));if(an(S))return new Set(Array.from(S).map(y));let g=Object.create(_t(S));for(let v in S)g[v]=y(S[v]);return tn(S,Zr)&&(g[Zr]=S[Zr]),g}function h(S){return Me(S)?y(S):S}Ym("Patches",{applyPatches_:p,generatePatches_:o,generateReplacementPatches_:m})}var on=new tg,ot=on.produce,Jn=on.produceWithPatches.bind(on);var la=on.applyPatches.bind(on);d();c();l();u();function rg(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ng(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function og(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Zc=e=>Array.isArray(e)?e:[e];function ig(e){let t=Array.isArray(e[0])?e[0]:e;return og(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ag(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Kx=Symbol();var Yx=Object.getPrototypeOf({});var sg=class{constructor(e){this.value=e}deref(){return this.value}},cg=typeof WeakRef<"u"?WeakRef:sg,ug=0,eu=1;function Xn(){return{s:ug,v:void 0,o:null,p:null}}function or(e,t={}){let r=Xn(),{resultEqualityCheck:n}=t,o,i=0;function a(){let f=r,{length:m}=arguments;for(let h=0,S=m;h<S;h++){let g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=f.o;v===null&&(f.o=v=new WeakMap);let R=v.get(g);R===void 0?(f=Xn(),v.set(g,f)):f=R}else{let v=f.p;v===null&&(f.p=v=new Map);let R=v.get(g);R===void 0?(f=Xn(),v.set(g,f)):f=R}}let p=f,y;if(f.s===eu)y=f.v;else if(y=e.apply(null,arguments),i++,n){let h=o?.deref?.()??o;h!=null&&n(h,y)&&(y=h,i!==0&&i--),o=typeof y=="object"&&y!==null||typeof y=="function"?new cg(y):y}return p.s=eu,p.v=y,y}return a.clearCache=()=>{r=Xn(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function tu(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,f,m={},p=o.pop();typeof p=="object"&&(m=p,p=o.pop()),rg(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);let y={...r,...m},{memoize:h,memoizeOptions:S=[],argsMemoize:g=or,argsMemoizeOptions:v=[],devModeChecks:R={}}=y,k=Zc(S),x=Zc(v),P=ig(o),w=h(function(){return i++,p.apply(null,arguments)},...k),E=!0,M=g(function(){a++;let I=ag(P,arguments);return f=w.apply(null,I),f},...x);return Object.assign(M,{resultFunc:p,memoizedResultFunc:w,dependencies:P,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>f,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:h,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var pe=tu(or),lg=Object.assign((e,t=pe)=>{ng(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,f,m)=>(a[r[m]]=f,a),{}))},{withTypes:()=>lg});d();c();l();u();function ru(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var nu=ru(),ou=ru;var dg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?rr:rr.apply(null,arguments)},mR=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},pg=e=>e&&typeof e.match=="function";function D(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error($e(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Hn(n)&&n.type===e,r}var uu=class sn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sn.prototype)}static get[Symbol.species](){return sn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sn(...t[0].concat(this)):new sn(...t.concat(this))}};function iu(e){return De(e)?ot(e,()=>{}):e}function au(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function fg(e){return typeof e=="boolean"}var mg=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new uu;return r&&(fg(r)?a.push(nu):a.push(ou(r.extraArgument))),a},cn="RTK_autoBatch",ar=()=>e=>({payload:e,meta:{[cn]:!0}}),su=e=>t=>{setTimeout(t,e)},gg=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,f=new Set,m=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:su(10):e.type==="callback"?e.queueNotification:su(e.timeout),p=()=>{a=!1,i&&(i=!1,f.forEach(y=>y()))};return Object.assign({},n,{subscribe(y){let h=()=>o&&y(),S=n.subscribe(h);return f.add(y),()=>{S(),f.delete(y)}},dispatch(y){try{return o=!y?.meta?.[cn],i=!o,i&&(a||(a=!0,m(p))),n.dispatch(y)}finally{o=!0}}})},yg=e=>function(r){let{autoBatch:n=!0}=r??{},o=new uu(e);return n&&o.push(gg(typeof n=="object"?n:void 0)),o};function lu(e){let t=mg(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},f;if(typeof r=="function")f=r;else if(We(r))f=tr(r);else throw new Error($e(1));let m;typeof n=="function"?m=n(t):m=t();let p=rr;o&&(p=dg({trace:!1,...(typeof o=="object"&&o)}));let y=Uc(...m),h=yg(y),S=typeof a=="function"?a(h):h(),g=p(...S);return Ji(f,i,g)}function du(e){let t={},r=[],n,o={addCase(i,a){let f=typeof i=="string"?i:i.type;if(!f)throw new Error($e(28));if(f in t)throw new Error($e(29));return t[f]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function hg(e){return typeof e=="function"}function ge(e,t){let[r,n,o]=du(t),i;if(hg(e))i=()=>iu(e());else{let f=iu(e);i=()=>f}function a(f=i(),m){let p=[r[m.type],...n.filter(({matcher:y})=>y(m)).map(({reducer:y})=>y)];return p.filter(y=>!!y).length===0&&(p=[o]),p.reduce((y,h)=>{if(h)if(Me(y)){let g=h(y,m);return g===void 0?y:g}else{if(De(y))return ot(y,S=>h(S,m));{let S=h(y,m);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return y},f)}return a.getInitialState=i,a}var pu=(e,t)=>pg(e)?e.match(t):e(t);function Ke(...e){return t=>e.some(r=>pu(r,t))}function ir(...e){return t=>e.every(r=>pu(r,t))}function eo(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function un(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function to(...e){return e.length===0?t=>eo(t,["pending"]):un(e)?Ke(...e.map(t=>t.pending)):to()(e[0])}function Ut(...e){return e.length===0?t=>eo(t,["rejected"]):un(e)?Ke(...e.map(t=>t.rejected)):Ut()(e[0])}function ln(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ir(Ut(...e),t):un(e)?ir(Ut(...e),t):ln()(e[0])}function it(...e){return e.length===0?t=>eo(t,["fulfilled"]):un(e)?Ke(...e.map(t=>t.fulfilled)):it()(e[0])}function ro(...e){return e.length===0?t=>eo(t,["pending","fulfilled","rejected"]):un(e)?Ke(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ro()(e[0])}var Sg="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",no=(e=21)=>{let t="",r=e;for(;r--;)t+=Sg[Math.random()*64|0];return t},vg=["name","message","stack","code"],da=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},cu=class{constructor(e,t){de(this,"_type");this.payload=e,this.meta=t}},bg=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of vg)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ue=(()=>{function e(t,r,n){let o=D(t+"/fulfilled",(m,p,y,h)=>({payload:m,meta:{...(h||{}),arg:y,requestId:p,requestStatus:"fulfilled"}})),i=D(t+"/pending",(m,p,y)=>({payload:void 0,meta:{...(y||{}),arg:p,requestId:m,requestStatus:"pending"}})),a=D(t+"/rejected",(m,p,y,h,S)=>({payload:h,error:(n&&n.serializeError||bg)(m||"Rejected"),meta:{...(S||{}),arg:y,requestId:p,rejectedWithValue:!!h,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"}}));function f(m){return(p,y,h)=>{let S=n?.idGenerator?n.idGenerator(m):no(),g=new s.AbortController,v,R;function k(P){R=P,g.abort()}let x=_asyncToGenerator(function*(){let P;try{let E=n?.condition?.(m,{getState:y,extra:h});if(Cg(E)&&(E=yield E),E===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((O,I)=>{v=()=>{I({name:"AbortError",message:R||"Aborted"})},g.signal.addEventListener("abort",v)});p(i(S,m,n?.getPendingMeta?.({requestId:S,arg:m},{getState:y,extra:h}))),P=yield Promise.race([M,Promise.resolve(r(m,{dispatch:p,getState:y,extra:h,requestId:S,signal:g.signal,abort:k,rejectWithValue:(O,I)=>new da(O,I),fulfillWithValue:(O,I)=>new cu(O,I)})).then(O=>{if(O instanceof da)throw O;return O instanceof cu?o(O.payload,S,m,O.meta):o(O,S,m)})])}catch(E){P=E instanceof da?a(null,S,m,E.payload,E.meta):a(E,S,m)}finally{v&&g.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&a.match(P)&&P.meta.condition||p(P),P})();return Object.assign(x,{abort:k,requestId:S,arg:m,unwrap(){return x.then(Ag)}})}}return Object.assign(f,{pending:i,rejected:a,fulfilled:o,settled:Ke(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Ag(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Cg(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var fu=Symbol.for("rtk-slice-createasyncthunk"),vR={[fu]:ue};function wg(e,t){return`${e}/${t}`}function xg({creators:e}={}){let t=e?.asyncThunk?.[fu];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error($e(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Eg()):n.reducers)||{},f=Object.keys(a),m={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(P,w){let E=typeof P=="string"?P:P.type;if(!E)throw new Error($e(12));if(E in m.sliceCaseReducersByType)throw new Error($e(13));return m.sliceCaseReducersByType[E]=w,p},addMatcher(P,w){return m.sliceMatchers.push({matcher:P,reducer:w}),p},exposeAction(P,w){return m.actionCreators[P]=w,p},exposeCaseReducer(P,w){return m.sliceCaseReducersByName[P]=w,p}};f.forEach(P=>{let w=a[P],E={reducerName:P,type:wg(o,P),createNotation:typeof n.reducers=="function"};kg(w)?Fg(E,w,p,t):Ig(E,w,p)});function y(){let[P={},w=[],E=void 0]=typeof n.extraReducers=="function"?du(n.extraReducers):[n.extraReducers],M={...P,...m.sliceCaseReducersByType};return ge(n.initialState,O=>{for(let I in M)O.addCase(I,M[I]);for(let I of m.sliceMatchers)O.addMatcher(I.matcher,I.reducer);for(let I of w)O.addMatcher(I.matcher,I.reducer);E&&O.addDefaultCase(E)})}let h=P=>P,S=new Map,g;function v(P,w){return g||(g=y()),g(P,w)}function R(){return g||(g=y()),g.getInitialState()}function k(P,w=!1){function E(O){let I=O[P];return typeof I>"u"&&w&&(I=R()),I}function M(O=h){let I=au(S,w,()=>new WeakMap);return au(I,O,()=>{let F={};for(let[T,N]of Object.entries(n.selectors??{}))F[T]=Rg(N,O,R,w);return F})}return{reducerPath:P,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}let x={name:o,reducer:v,actions:m.actionCreators,caseReducers:m.sliceCaseReducersByName,getInitialState:R,...k(i),injectInto(P,{reducerPath:w,...E}={}){let M=w??i;return P.inject({reducerPath:M,reducer:v},E),{...x,...k(M,!0)}}};return x}}function Rg(e,t,r,n){function o(i,...a){let f=t(i);return typeof f>"u"&&n&&(f=r()),e(f,...a)}return o.unwrapped=e,o}var Qt=xg();function Eg(){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 Ig({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Pg(n))throw new Error($e(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?D(e,a):D(e))}function kg(e){return e._reducerDefinitionType==="asyncThunk"}function Pg(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Fg({type:e,reducerName:t},r,n,o){if(!o)throw new Error($e(18));let{payloadCreator:i,fulfilled:a,pending:f,rejected:m,settled:p,options:y}=r,h=o(e,i,y);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),f&&n.addCase(h.pending,f),m&&n.addCase(h.rejected,m),p&&n.addMatcher(h.settled,p),n.exposeCaseReducer(t,{fulfilled:a||Zn,pending:f||Zn,rejected:m||Zn,settled:p||Zn})}function Zn(){}var mu="listener",gu="completed",yu="cancelled",bR=`task-${yu}`,AR=`task-${gu}`,CR=`${mu}-${yu}`,wR=`${mu}-${gu}`;var{assign:hu}=Object;var pa="listenerMiddleware";var Og=hu(D(`${pa}/add`),{withTypes:()=>Og}),xR=D(`${pa}/removeAll`),Tg=hu(D(`${pa}/remove`),{withTypes:()=>Tg});var RR=Symbol.for("rtk-state-proxy-original");function $e(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();var W=new H({required:!0,emptyAllowed:!1}),Ce=new H({required:!1,emptyAllowed:!1}),we=new H({required:!0,emptyAllowed:!0}),MR=new H({required:!1,emptyAllowed:!0}),oo=new ie({each:W,required:!0}),Su=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),vu=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),NR=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),at=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Ve=(e,t)=>{if("required"in t)return{payload:new Fe({value:t}).validate({value:e}).value};let o=new K({options:{required:!0},values:t}).validate(e);if(o)throw new Wr(o);return{payload:e}},Q=(e,t)=>{try{return Ve(e,t)}catch(r){return{payload:e,error:at(r)}}},bu=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Cu(e,t,r,o,"Controller initialization error")},Au=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Cu(e,t,r,o,"Controller initialization error")},Cu=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};d();c();l();u();var sr="3.30.0-pre.e4dec75021",wu=["@coveo/atomic","@coveo/quantic"];var fa=()=>Ce,xu=()=>W,st=D("configuration/updateBasicConfiguration",e=>Q(e,{accessToken:Ce,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Ce})),Ye=D("configuration/updateSearchConfiguration",e=>Q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,timezone:Ce,locale:Ce,authenticationProviders:new ie({required:!1,each:W})})),Dg={enabled:new ne({default:!0}),originContext:fa(),originLevel2:fa(),originLevel3:fa(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new fe,anonymous:new ne({default:!1}),deviceId:Ce,userDisplayName:Ce,documentLocation:Ce,trackingId:vu,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new K({options:{required:!1},values:wu.reduce((e,t)=>(e[t]=Su,e),{})})},cr=D("configuration/updateAnalyticsConfiguration",e=>Q(e,Dg)),ur=D("configuration/analytics/disable"),lr=D("configuration/analytics/enable"),io=D("configuration/analytics/originlevel2",e=>Q(e,{originLevel2:xu()})),ao=D("configuration/analytics/originlevel3",e=>Q(e,{originLevel3:xu()}));d();c();l();u();d();c();l();u();d();c();l();u();var Ru={q:new H,enableQuerySyntax:new ne,aq:new H,cq:new H,firstResult:new J({min:0}),numberOfResults:new J({min:0}),sortCriteria:new H,f:new K,fExcluded:new K,cf:new K,nf:new K,mnf:new K,df:new K,debug:new ne,sf:new K,tab:new H,af:new K};var St=D("searchParameters/restore",e=>Q(e,Ru)),Eu=D("searchParameters/restoreTab",e=>Q(e,W));d();c();l();u();var so=D("debug/enable"),co=D("debug/disable");d();c();l();u();var uo=()=>!1;var lo=ge(uo(),e=>{e.addCase(so,()=>!0).addCase(co,()=>!1).addCase(St,(t,r)=>r.payload.debug??t)});d();c();l();u();var dr=D("pipeline/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();d();c();l();u();var qg=D("history/undo"),jg=D("history/redo"),Je=D("history/snapshot"),zE=ue("history/back",/*#__PURE__*/function(){var _ref4=_asyncToGenerator(function*(e,{dispatch:t}){t(qg()),yield t(qe())});return function(_x3,_x4){return _ref4.apply(this,arguments)}}()),GE=ue("history/forward",/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,{dispatch:t}){t(jg()),yield t(qe())});return function(_x5,_x6){return _ref5.apply(this,arguments)}}()),qe=ue("history/change",/*#__PURE__*/function(){var _ref6=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x7,_x8){return _ref6.apply(this,arguments)}}());d();c();l();u();var pr=()=>"";var fr=ge(pr(),e=>{e.addCase(dr,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ye,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var po=D("app/setError");d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var mr=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let f=window.location.hostname,m=/^(\d{1,3}\.){3}\d{1,3}$/,p=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;m.test(f)||p.test(f)||f.indexOf(".")===-1?ma(t,r,i):(a=f.split("."),o=a[a.length-2]+"."+a[a.length-1],ma(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function ma(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function Mg(){return typeof navigator<"u"}function Iu(){try{return typeof localStorage<"u"}catch{return!1}}function ku(){try{return typeof sessionStorage<"u"}catch{return!1}}function Pu(){return!!(Mg()&&navigator.cookieEnabled)}var Fu=null;function Ou(){return Fu||(Iu()?localStorage:Pu()?new ga:ku()?sessionStorage:new ya)}var gr=class gr{getItem(t){return mr.get(`${gr.prefix}${t}`)}removeItem(t){mr.erase(`${gr.prefix}${t}`)}setItem(t,r,n){mr.set(`${gr.prefix}${t}`,r,n)}};de(gr,"prefix","coveo_");var ga=gr;var ya=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var fo="__coveo.analytics.history",Ng=20,_g=1e3*60,Vg=75,Bt=class Bt{constructor(t){de(this,"store");this.store=t||Ou()}static getInstance(t){return Bt.instance||(Bt.instance=new Bt(t)),Bt.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(fo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(fo);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(fo,JSON.stringify(t.slice(0,Ng)))}catch{}}clear(){try{this.store.removeItem(fo)}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,Vg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>_g:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};de(Bt,"instance",null);var ha=Bt,Xe=ha;d();c();l();u();d();c();l();u();var yr=pe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${sr}`));d();c();l();u();d();c();l();u();function ct(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function q(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function f(y){try{p(n.next(y))}catch(h){a(h)}}function m(y){try{p(n.throw(y))}catch(h){a(h)}}function p(y){y.done?i(y.value):o(y.value).then(f,m)}p((n=n.apply(e,t||[])).next())})}var ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ae||(ae={}));function ba(){return typeof window<"u"}function Da(){return typeof navigator<"u"}function hr(){return typeof document<"u"}function Aa(){try{return typeof localStorage<"u"}catch{return!1}}function Lg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Hu(){return Da()&&navigator.cookieEnabled}var Ug=[ae.click,ae.custom,ae.search,ae.view],Qg=(e,t)=>Ug.indexOf(e)!==-1?Object.assign({language:hr()?document.documentElement.lang:"unknown",userAgent:Da()?navigator.userAgent:"unknown"},t):t,pn=class e{static set(t,r,n){var o,i,a,f;n&&(i=new Date,i.setTime(i.getTime()+n)),f=window.location.hostname,f.indexOf(".")===-1?Tu(t,r,i):(a=f.split("."),o=a[a.length-2]+"."+a[a.length-1],Tu(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Tu(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Bg(){return Aa()?localStorage:Hu()?new fn:Lg()?sessionStorage:new vr}var fn=class e{getItem(t){return pn.get(`${e.prefix}${t}`)}removeItem(t){pn.erase(`${e.prefix}${t}`)}setItem(t,r,n){pn.set(`${e.prefix}${t}`,r,n)}};fn.prefix="coveo_";var Ca=class{constructor(){this.cookieStorage=new fn}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},vr=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},mo="__coveo.analytics.history",$g=20,Hg=1e3*60,zg=75,ho=class{constructor(t){this.store=t||Bg()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return q(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(mo);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(mo);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(mo,JSON.stringify(t.slice(0,$g)))}catch{}}clear(){try{this.store.removeItem(mo)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,zg)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Hg:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Gg=(e,t)=>q(void 0,void 0,void 0,function*(){return e===ae.view?(yield Wg(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Wg=e=>q(void 0,void 0,void 0,function*(){let t=new ho,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),go,Kg=new Uint8Array(16);function Yg(){if(!go&&(go=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!go))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return go(Kg)}var Jg=/^(?:[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 So(e){return typeof e=="string"&&Jg.test(e)}var xe=[];for(let e=0;e<256;++e)xe.push((e+256).toString(16).slice(1));function zu(e,t=0){return(xe[e[t+0]]+xe[e[t+1]]+xe[e[t+2]]+xe[e[t+3]]+"-"+xe[e[t+4]]+xe[e[t+5]]+"-"+xe[e[t+6]]+xe[e[t+7]]+"-"+xe[e[t+8]]+xe[e[t+9]]+"-"+xe[e[t+10]]+xe[e[t+11]]+xe[e[t+12]]+xe[e[t+13]]+xe[e[t+14]]+xe[e[t+15]]).toLowerCase()}function Xg(e){if(!So(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 Zg(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var ey="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ty="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function ry(e,t,r){function n(o,i,a,f){var m;if(typeof o=="string"&&(o=Zg(o)),typeof i=="string"&&(i=Xg(i)),((m=i)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let p=new Uint8Array(16+o.length);if(p.set(i),p.set(o,i.length),p=r(p),p[6]=p[6]&15|t,p[8]=p[8]&63|128,a){f=f||0;for(let y=0;y<16;++y)a[f+y]=p[y];return a}return zu(p)}try{n.name=e}catch{}return n.DNS=ey,n.URL=ty,n}var ny=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Du={randomUUID:ny};function $t(e,t,r){if(Du.randomUUID&&!t&&!e)return Du.randomUUID();e=e||{};let n=e.random||(e.rng||Yg)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return zu(n)}function oy(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function Sa(e,t){return e<<t|e>>>32-t}function iy(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let f=0;f<a.length;++f)e.push(a.charCodeAt(f))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let f=new Uint32Array(16);for(let m=0;m<16;++m)f[m]=e[a*64+m*4]<<24|e[a*64+m*4+1]<<16|e[a*64+m*4+2]<<8|e[a*64+m*4+3];i[a]=f}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let f=new Uint32Array(80);for(let g=0;g<16;++g)f[g]=i[a][g];for(let g=16;g<80;++g)f[g]=Sa(f[g-3]^f[g-8]^f[g-14]^f[g-16],1);let m=r[0],p=r[1],y=r[2],h=r[3],S=r[4];for(let g=0;g<80;++g){let v=Math.floor(g/20),R=Sa(m,5)+oy(v,p,y,h)+S+t[v]+f[g]>>>0;S=h,h=y,y=Sa(p,30)>>>0,p=m,m=R}r[0]=r[0]+m>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+S>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var ay=ry("v5",80,iy),qu=ay,Gu="2.30.45",ju=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,dn={pageview:"pageview",event:"event"},vo=class{constructor({client:t,uuidGenerator:r=$t}){this.client=t,this.uuidGenerator=r}},wa=class extends vo{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ju(window.location),this.lastReferrer=hr()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:hr()?document.title:"",encoding:hr()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===dn.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===dn.pageview?this.nextPageViewId:this.pageViewId,referrer:t===dn.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===dn.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return ju(window.location)}},vt=class e{constructor(t,r){if(!So(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return So(i)?new e(i,Number.parseInt(o)*1e3):null}};vt.cvo_cid="cvo_cid";vt.expirationTime=120;var xa=class extends vo{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return q(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(vt.cvo_cid,new vt(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};xa.Id="link";var Ue=Object.keys;function yo(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var va=128,Wu=192,Mu=224,Nu=240;function sy(e){return(e&248)===Nu?4:(e&Nu)===Mu?3:(e&Mu)===Wu?2:1}function cy(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&va)!=va)break;if(r-=3,(n&Wu)!=va){t-r>=sy(n)*3&&(r=t);break}}return e.substring(0,r)}var Ra={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"},uy=Ue(Ra).map(e=>Ra[e]),ly=[...uy].join("|"),dy=new RegExp(`^(${ly}$)`),py={svcAction:"svc_action",svcActionData:"svc_action_data"},fy=e=>Ue(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ra[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),my=e=>dy.test(e),gy=[my],_u={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Vu={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Ee={action:"pa",list:"pal",listSource:"pls"},bo={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},yy=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ea={id:"quoteId",affiliation:"quoteAffiliation"},Ia={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},hy={add:Ee,bookmark_add:Ee,bookmark_remove:Ee,click:Ee,checkout:Ee,checkout_option:Ee,detail:Ee,impression:Ee,remove:Ee,refund:Object.assign(Object.assign({},Ee),bo),purchase:Object.assign(Object.assign({},Ee),bo),quickview:Ee,quote:Object.assign(Object.assign({},Ee),Ea),review:Object.assign(Object.assign({},Ee),Ia)},Sy=Ue(_u).map(e=>_u[e]),vy=Ue(Vu).map(e=>Vu[e]),by=Ue(Ee).map(e=>Ee[e]),Ay=Ue(bo).map(e=>bo[e]),Cy=Ue(Ia).map(e=>Ia[e]),wy=Ue(Ea).map(e=>Ea[e]),xy=[...Sy,"custom"].join("|"),Ry=[...vy,"custom"].join("|"),Ku="(pr[0-9]+)",Yu="(il[0-9]+pi[0-9]+)",Ey=new RegExp(`^${Ku}(${xy})$`),Iy=new RegExp(`^(${Yu}(${Ry}))|(il[0-9]+nm)$`),ky=new RegExp(`^(${by.join("|")})$`),Py=new RegExp(`^(${Ay.join("|")})$`),Fy=new RegExp(`^${Ku}custom$`),Oy=new RegExp(`^${Yu}custom$`),Ty=new RegExp(`^(${[...yy,...Cy,...wy].join("|")})$`),Dy=e=>Ey.test(e),qy=e=>Iy.test(e),jy=e=>ky.test(e),My=e=>Py.test(e),Ny=e=>Ty.test(e),_y=[qy,Dy,jy,My,Ny],Vy=[Fy,Oy],Ly={anonymizeIp:"aip"},Uy={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Qy={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},By=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],$y=Object.assign(Object.assign(Object.assign(Object.assign({},Ly),Uy),Qy),By.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),ka=Object.assign(Object.assign({},$y),py),Hy=e=>{let t=!!e.action&&hy[e.action]||{};return Ue(e).reduce((r,n)=>{let o=t[n]||ka[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},zy=Ue(ka).map(e=>ka[e]),Gy=e=>zy.indexOf(e)!==-1,Wy=e=>e==="custom",Ky=e=>[..._y,...gy,Gy,Wy].some(t=>t(e)),Yy=e=>Ue(e).reduce((t,r)=>{let n=Jy(r);return n?Object.assign(Object.assign({},t),Xy(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Jy=e=>{let t;return[...Vy].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Xy=(e,t)=>Ue(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Pa=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:f}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),m=this.encodeForEventType(t,f),p=new Blob([m],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,p)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return q(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:f,body:m}=a;o=f||t;try{i=JSON.parse(m)}catch(p){console.error("Unable to process the request body as a JSON string",p)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},Fa=class{sendEvent(t,r){return q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){return Promise.resolve()})}},Lu=b.fetch,Ao=class{constructor(t){this.opts=t}sendEvent(t,r){return q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",f={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},m=Object.assign(Object.assign({},f),i?yield i(f,"analyticsFetch"):{}),{url:p}=m,y=ct(m,["url"]),h;try{h=yield Lu(p,y)}catch(S){console.error("An error has occured when sending the event.",S);return}if(h.ok){let S=yield h.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{h.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,h,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Lu(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ae.click,ae.custom,ae.search,ae.view].indexOf(t)!==-1}getVisitorIdParam(){return q(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Oa=class{constructor(t,r){Aa()&&Hu()?this.storage=new Ca:Aa()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new vr),this.client=new Ao(t),this.beaconClient=new Pa(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Ta=class{constructor(t,r){this.storage=r||new vr,this.client=new Ao(t)}getClientDependingOnEventType(t){return this.client}},Co=class{constructor(){this.storage=new vr,this.client=new Fa}getClientDependingOnEventType(t){return this.client}},Zy="xx",eh=e=>e?.startsWith(Zy)||!1,th=`
|
|
27
27
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
28
28
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
29
29
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
30
|
-
`;function Wy(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Ky=["1",1,"yes",!0];function Co(){let e=[];return ga()&&e.push(window.doNotTrack),ka()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Ky.indexOf(t)!==-1)}var Hu="v15",zu={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function Yy(e=zu.default,t=Hu,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var Jy="38824e1f-37f5-42d3-8372-a4b8fa9df946",Ze=class{get defaultOptions(){return{endpoint:zu.default,isCustomEndpoint:!1,token:"",version:Hu,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Uu}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[Vg,qg].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Co()?this.runtime=new Ao:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ae.view,{newEventType:ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(ae.click,{newEventType:ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(ae.custom,{newEventType:ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ae.search,{newEventType:ae.search,addClientIdParameter:!0})}initRuntime(t){return ga()&&hr()?new Ea(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Wy()&&console.warn(Gy),new Ia(t))}get storage(){return this.runtime.storage}determineVisitorId(){return q(this,void 0,void 0,function*(){try{return ga()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||$t()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),$t()}})}getCurrentVisitorId(){return q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return q(this,void 0,void 0,function*(){if(ho(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(ku(t,ku(r,Jy)))}})}getParameters(t,...r){return q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId($t()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Co())return null;try{let r=new URL(t).searchParams.get(St.cvo_cid);if(r==null)return null;let n=St.fromString(r);return!n||!hr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>q(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((v,R)=>q(this,void 0,void 0,function*(){let k=yield v;return yield R(t,k)}),g)].reduce((g,v)=>q(this,void 0,void 0,function*(){let R=yield g;return yield v(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?Ny(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>q(this,void 0,void 0,function*(){let g=yield h;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(f=>f(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new yo().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.search,t)})}sendSearchEvent(t){var{searchQueryUid:r}=t,n=st(t,["searchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.click,t)})}sendClickEvent(t){var{searchQueryUid:r}=t,n=st(t,["searchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.custom,t)})}sendCustomEvent(t){var{lastSearchQueryUid:r}=t,n=st(t,["lastSearchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.view,t)})}sendViewEvent(t){return q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return q(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return q(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Uy(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=st(t,["custom"]),o={};r&&go(r)&&(o=this.lowercaseKeys(r));let i=Qy(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=st(t,["custom"]);if(r&&go(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=st(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ae.view||r==ae.click||r==ae.search||r==ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=st(t,["userId"]);return zy(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=st(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&go(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&go(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?ey(t,r):t}get baseUrl(){return Yy(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},ct;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(ct||(ct={}));var M;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(M||(M={}));var Mu={[M.triggerNotify]:"queryPipelineTriggers",[M.triggerExecute]:"queryPipelineTriggers",[M.triggerQuery]:"queryPipelineTriggers",[M.triggerRedirect]:"queryPipelineTriggers",[M.queryError]:"errors",[M.queryErrorBack]:"errors",[M.queryErrorClear]:"errors",[M.queryErrorRetry]:"errors",[M.pagerNext]:"getMoreResults",[M.pagerPrevious]:"getMoreResults",[M.pagerNumber]:"getMoreResults",[M.pagerResize]:"getMoreResults",[M.pagerScrolling]:"getMoreResults",[M.facetSearch]:"facet",[M.facetShowLess]:"facet",[M.facetShowMore]:"facet",[M.recommendation]:"recommendation",[M.likeSmartSnippet]:"smartSnippet",[M.dislikeSmartSnippet]:"smartSnippet",[M.expandSmartSnippet]:"smartSnippet",[M.collapseSmartSnippet]:"smartSnippet",[M.openSmartSnippetFeedbackModal]:"smartSnippet",[M.closeSmartSnippetFeedbackModal]:"smartSnippet",[M.sendSmartSnippetReason]:"smartSnippet",[M.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[M.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[M.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[M.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[M.clearRecentQueries]:"recentQueries",[M.recentResultClick]:"recentlyClickedDocuments",[M.clearRecentResults]:"recentlyClickedDocuments",[M.showLessFoldedResults]:"folding",[M.caseDetach]:"case",[M.likeGeneratedAnswer]:"generatedAnswer",[M.dislikeGeneratedAnswer]:"generatedAnswer",[M.openGeneratedAnswerSource]:"generatedAnswer",[M.generatedAnswerStreamEnd]:"generatedAnswer",[M.generatedAnswerSourceHover]:"generatedAnswer",[M.generatedAnswerCopyToClipboard]:"generatedAnswer",[M.generatedAnswerHideAnswers]:"generatedAnswer",[M.generatedAnswerShowAnswers]:"generatedAnswer",[M.generatedAnswerExpand]:"generatedAnswer",[M.generatedAnswerCollapse]:"generatedAnswer",[M.generatedAnswerFeedbackSubmit]:"generatedAnswer",[M.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[ct.expandToFullUI]:"interface",[ct.openUserActions]:"User Actions",[ct.showPrecedingSessions]:"User Actions",[ct.showFollowingSessions]:"User Actions",[ct.clickViewedDocument]:"User Actions",[ct.clickPageView]:"User Actions",[ct.createArticle]:"createArticle"},br=class{constructor(){this.runtime=new Ao,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Uu}};function Xy(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function Zy(e){return e.map(t=>t.replace(/;/g,""))}function Gu(e){let r=e.join(";");return r.length<=256?r:Gu(e.slice(1))}var ju=e=>{let t=Zy(e),r=Xy(t);return Gu(r)};function Nu(e){let t=typeof e.partialQueries=="string"?e.partialQueries:ju(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:ju(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var wo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Co();this.coveoAnalyticsClient=n?new br:new Ze(t)}disable(){this.coveoAnalyticsClient=new br}enable(){this.coveoAnalyticsClient=new Ze(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(M.interfaceLoad)}logInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(M.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(M.recommendation)}logRecommendation(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(M.recommendationOpen,t,r)}logRecommendationOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(M.staticFilterClearAll,t)}logStaticFilterClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(M.staticFilterSelect,t)}logStaticFilterSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(M.staticFilterDeselect,t)}logStaticFilterDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(M.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(M.interfaceChange,t)}logInterfaceChange(t){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(M.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(M.didyoumeanClick)}logDidYouMeanClick(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(M.resultsSort,t)}logResultsSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(M.searchboxSubmit)}logSearchboxSubmit(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(M.searchboxClear)}logSearchboxClear(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(M.searchboxAsYouType)}logSearchboxAsYouType(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(M.breadcrumbFacet,t)}logBreadcrumbFacet(t){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(M.breadcrumbResetAll)}logBreadcrumbResetAll(){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(M.documentQuickview,t,r)}logDocumentQuickview(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(M.documentOpen,t,r)}logDocumentOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(M.omniboxAnalytics,Nu(t))}logOmniboxAnalytics(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(M.omniboxFromLink,Nu(t))}logOmniboxFromLink(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(M.searchFromLink)}logSearchFromLink(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(M.triggerNotify,t)}logTriggerNotify(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(M.triggerExecute,t)}logTriggerExecute(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(M.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(M.undoTriggerQuery,t)}logUndoTriggerQuery(t){return q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(M.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(M.pagerResize,t)}logPagerResize(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(M.pagerNumber,t)}logPagerNumber(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(M.pagerNext,t)}logPagerNext(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(M.pagerPrevious,t)}logPagerPrevious(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(M.pagerScrolling)}logPagerScrolling(){return q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(M.facetClearAll,t)}logFacetClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(M.facetSearch,t)}logFacetSearch(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(M.facetSelect,t)}logFacetSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(M.facetDeselect,t)}logFacetDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(M.facetExclude,t)}logFacetExclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(M.facetUnexclude,t)}logFacetUnexclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(M.facetSelectAll,t)}logFacetSelectAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(M.facetUpdateSort,t)}logFacetUpdateSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(M.facetShowMore,t)}logFacetShowMore(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(M.facetShowLess,t)}logFacetShowLess(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(M.queryError,t)}logQueryError(t){return q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(M.queryErrorBack);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(M.queryErrorBack)})}})}logQueryErrorBack(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(M.queryErrorRetry);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(M.queryErrorRetry)})}})}logQueryErrorRetry(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(M.queryErrorClear);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(M.queryErrorClear)})}})}logQueryErrorClear(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(M.likeSmartSnippet)}logLikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(M.dislikeSmartSnippet)}logDislikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(M.expandSmartSnippet)}logExpandSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(M.collapseSmartSnippet)}logCollapseSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(M.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(M.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(M.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(M.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(M.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(M.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(M.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(M.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(M.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(M.copyToClipboard,t,r)}logCopyToClipboard(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(M.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(M.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(M.recentQueryClick)}logRecentQueryClick(){return q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(M.clearRecentQueries)}logClearRecentQueries(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(M.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(M.clearRecentResults)}logClearRecentResults(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(M.noResultsBack)}logNoResultsBack(){return q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(M.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(M.showLessFoldedResults)}logShowLessFoldedResults(){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r,n=Mu[t]){return q(this,void 0,void 0,function*(){this.coveoAnalyticsClient.getParameters;let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:n,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({lastSearchQueryUid:f})}})}logCustomEvent(t,r,n=Mu[t]){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({lastSearchQueryUid:f})}})}logCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({searchQueryUid:f})}})}logClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){var n,o;return q(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(M.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(M.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(M.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(M.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(M.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(M.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(M.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(M.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(M.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(M.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(M.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(M.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(M.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(M.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(M.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},xo=Object.assign({},dn),_u=Object.keys(xo).map(e=>xo[e]),Sr=class extends Sa{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>_u.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(_u.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(xo.pageview,{newEventType:ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(xo.event,{newEventType:ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return iy(this.ticket)}};Sr.Id="svc";var Ro;(function(e){e.click="click",e.flowStart="flowStart"})(Ro||(Ro={}));var Le;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(Le||(Le={}));var Eo;(function(e){e.quit="Quit",e.solved="Solved"})(Eo||(Eo={}));var Io=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Co();this.coveoAnalyticsClient=o?new Ze(t):new br,this.svc=new Sr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new br,this.svc=new Sr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Ze(this.options),this.svc=new Sr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Le.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Le.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Le.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Le.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Le.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Le.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Le.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Le.caseCancelled,{reason:Eo.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Le.caseSolved,{reason:Eo.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Le.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ro.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ro.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){var r,n;return q(this,void 0,void 0,function*(){let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){var i,a;return q(this,void 0,void 0,function*(){let f=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(f)})}};var Wu=e=>new Ze(e).getCurrentVisitorId(),mn=(e,t)=>typeof t=="function"?(...r)=>{let n=Kr(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,gn=(e,t)=>(...r)=>{let n=Kr(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function ko(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();d();c();l();u();function Ku(e){let{activeValue:t,ancestryMap:r}=eh(e);return t?th(t,r):[]}function eh(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function th(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var rh=(e,t)=>e.categoryFacetSet[t]?.request;var Oa=(e,t)=>{let r=rh(e,t);return Ku(r?.currentValues??[])};d();c();l();u();function Po(){return{}}d();c();l();u();function Fo(){return{}}d();c();l();u();function Oo(){return{}}d();c();l();u();function To(){return{}}function Ta(e){return{facetSet:e.facetSet??To(),categoryFacetSet:e.categoryFacetSet??Po(),dateFacetSet:e.dateFacetSet??Fo(),numericFacetSet:e.numericFacetSet??Oo(),automaticFacetSet:e.automaticFacetSet??ko()}}var Da=e=>{let t=[];return ih(e).forEach((r,n)=>{let o=fh(e,r.facetId),i=dh(r,n+1);if(oh(r)){if(!!!Oa(e,r.facetId).length)return;t.push({...i,...uh(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,f)=>{if(a.state==="idle")return;let m=Yu(a,f+1,o),p=nh(r)?Ju(a):sh(a);t.push({...i,...m,...p})})}),ah(e).forEach((r,n)=>{let o=lh(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let f=Yu(i,a+1,"specific"),m=Ju(i);t.push({...o,...f,...m})})}),t},nh=e=>e.type==="specific",oh=e=>e.type==="hierarchical",ih=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),ah=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Yu=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),sh=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Ju=e=>({displayValue:e.value,value:e.value}),ch=(e,t)=>Oa(e,t).map(n=>n.value).join(";"),uh=(e,t)=>{let n=ch(e,t);return{value:n,valuePosition:1,displayValue:n}},lh=(e,t)=>({title:Xu(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),dh=(e,t)=>({title:Xu(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Xu=(e,t)=>`${e}_${t}`,ph=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,fh=(e,t)=>{let r=ph(e,t);return r?r.type:"specific"};d();c();l();u();var Ar=e=>{if(mh(e)){let t=Object.values(e.answer.queries).pop()?.data;return typeof t=="object"&&t!==null&&"answerId"in t?t.answerId:void 0}if(gh(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},mh=e=>"answer"in e&&"generatedAnswer"in e&&!X(e.generatedAnswer?.answerConfigurationId),gh=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object";var yh=pe(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var Ne=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();var Zu=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Zu||{}),el=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(el||{}),qa=e=>{if(dc(e))return e.map(t=>qa(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},tl=()=>({by:"relevancy"});var wP=new K({values:{by:new qi({enum:el,required:!0}),order:new qi({enum:Zu}),field:new H}});function Do(){return qa(tl())}d();c();l();u();d();c();l();u();var Cr=()=>"default";var hh=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},ut=class{constructor(t){this.getState=t;le(this,"state");this.state=t()}getLanguage(){return hh(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let f=`context_${i}`;o[f]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=sr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Cr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var yn=class yn extends ut{constructor(){super(...arguments);le(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return Da(Ta(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||yn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||Ge().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||yn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ar(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Do()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(p=>p.expression),a=o.partialQueries.length-1,f=o.partialQueries[a]||"",m=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:f,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:m}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||Ne().q}get responseTime(){return this.state.search?.duration||Ge().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Ge().response.totalCountFiltered}};le(yn,"fallbackPipelineName","default");var vt=yn,rl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new wo({token:a,endpoint:f,runtimeEnvironment:m,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:f,token:a},"Analytics request"),S)]},o);return p||y.disable(),y},Ma=()=>{let t=Xe.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var qo=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Wu(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(Ma()&&{pageId:Ma()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:yr(e)})}}});return function qo(_x9,_x0){return _ref7.apply(this,arguments)}}();d();c();l();u();d();c();l();u();d();c();l();u();var wr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var hn=class extends ut{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ne().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||wr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||wr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||wr().recommendations.length}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var nl=/^(?:[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 Sh(e){return typeof e=="string"&&nl.test(e)}var ja=Sh;d();c();l();u();var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function ol(e,t=0){return(Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]).toLowerCase()}d();c();l();u();var Na,vh=new Uint8Array(16);function _a(){if(!Na){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Na=crypto.getRandomValues.bind(crypto)}return Na(vh)}d();c();l();u();d();c();l();u();var bh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Va={randomUUID:bh};function Ah(e,t,r){if(Va.randomUUID&&!t&&!e)return Va.randomUUID();e=e||{};let n=e.random??e.rng?.()??_a();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 ol(n)}var La=Ah;d();c();l();u();function il(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Ch({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var al="visitorId";function wh(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(al),o=n&&ja(n)?n:t.generateUUID();return r.setItem(al,o),o}}}var dl="1.2.7",Ua=128,pl=192,sl=224,cl=240,xh=248;function Rh(e){return(e&xh)===cl?4:(e&cl)===sl?3:(e&sl)===pl?2:1}function Eh(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&Ua)!=Ua)break;if(r-=3,(n&pl)!=Ua){t-r>=Rh(n)*3&&(r=t);break}}return e.substring(0,r)}function Ih(e){let{trackingId:t}=e;return{trackingId:t}}function kh(e){return(e.source||[]).concat([`relay@${dl}`])}function fl(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,f=Ih(t),m=n.getClientId();return Object.freeze({type:e,config:f,ts:Date.now(),source:kh(t),clientId:m,userAgent:a(),referrer:ul(o()),location:ul(i())})}function ul(e){return e!==null?Eh(e,1024):null}function Ph(e,t,r,n,o){return{...t,meta:fl(e,r,n,o)}}var Fh="*";function Oh(){let e=[];function t({type:m,callback:p}){return e.findIndex(y=>y.type===m&&y.callback===p)}function r(m,p){return m.type==="*"||p===m.type}function n(m){return t(m)<0&&e.push(m),()=>f(m.type,m.callback)}function o(m){e.forEach(p=>{if(r(p,m.meta.type))try{p.callback(m)}catch(y){console.error(y)}})}function i(m){if(m===Fh)e.length=0;else for(let p=e.length-1;p>=0;p--)e[p].type===m&&e.splice(p,1)}function a(m){let p=t(m);p>=0&&e.splice(p,1)}function f(m,p){p?a({type:m,callback:p}):i(m)}return{add:n,call:o,remove:f}}function ll({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 Th(e){let t=ll(e);return{get:()=>t,update:r=>{t=ll({...t,...r})}}}var Qa=Dh();function Dh(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,f=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${f};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function qh(){return{getItem(e){return Qa.getItem(e)||localStorage.getItem(e)},removeItem(e){Qa.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Qa.setItem(e,t,31556952e3)}}}function Mh(){let e=document.referrer;return e===""?null:e}function Ba(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(il().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:()=>Mh(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>La(),storage:qh()}}function jh(){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 Nh(){return{getItem(){return null},removeItem(){},setItem(){}}}function _h(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:Nh()}}function Vh(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=_h();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&Lh()&&jh()?Ba():n}function Lh(){try{return typeof window=="object"}catch{return!1}}function Uh(e){return{get:()=>Object.freeze(Vh(e))}}function ml(e){let t=Th(e),r=Oh(),n=Uh(t),o=wh(n);return{emit:(i,a)=>{let f=t.get(),m=n.get(),p=Ph(i,a,f,m,o);return Ch({config:f,environment:m,event:p,listenerManager:r})},getMeta:i=>fl(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:dl}}d();c();l();u();function gl(){return typeof window<"u"&&typeof document<"u"}var Sn=pe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>yr(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,f)=>{let m=Bh(f);return ml({mode:i?"emit":"disabled",url:o??Nn(e,t),token:r,trackingId:n??null,source:a,environment:m})}),Qh={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,runtime:"custom",send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},Bh=e=>{if(!e)return;let t=e();return{...(gl()?Ba():Qh),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();var vn=class extends ut{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},yl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new vn(t)})=>{let i=t(),a=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new Io({enableAnalytics:p,token:a,endpoint:f,runtimeEnvironment:m,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:f,token:a},"Analytics request"),S)]},o);return p||y.disable(),y};d();c();l();u();d();c();l();u();function hl(e,t){return{...new vt(t).getBaseMetadata(),actionCause:e,type:e}}function $h(e){return Object.assign(e,{instantlyCallable:!0})}function Hh(e,t){let r=i=>$h(de(e,i)),n=r(/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(i,{getState:a,extra:f}){let{analyticsClientMiddleware:m,preprocessRequest:p,logger:y}=f;return yield(yield t({getState:a,analyticsClientMiddleware:m,preprocessRequest:p,logger:y})).log({state:a(),extra:f})});return function(_x1,_x10){return _ref8.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref9=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:f,logger:m}){let{description:p,log:y}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:f,logger:m});return{description:p,action:r(/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(h,{getState:S,extra:g}){return yield y({state:S(),extra:g})});return function(_x12,_x13){return _ref0.apply(this,arguments)}}())}});return function prepare(_x11){return _ref9.apply(this,arguments)}}()}),n}var Sl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return Wh(i)}return n},zh=e=>e.configuration.analytics.analyticsMode==="legacy",Gh=e=>e.configuration.analytics.analyticsMode==="next",Wh=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=f=>new a(f)),Hh(e,/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*({getState:f,analyticsClientMiddleware:m,preprocessRequest:p,logger:y}){let h=[],S={log:function(){var _ref10=_asyncToGenerator(function*({state:x}){for(let P of h)yield P(x)});return function log(_x15){return _ref10.apply(this,arguments)}}()},g=f(),v=i({getState:f,logger:y,analyticsClientMiddleware:m,preprocessRequest:p,provider:r(f)}),R=yield t(v,f());S.description=R?.description,h.push(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(x){zh(x)&&(yield Kh(R,r,x,y,v.coveoAnalyticsClient))});return function(_x16){return _ref11.apply(this,arguments)}}());let{emit:k}=Sn(g);return h.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x){if(Gh(x)&&o&&n){let P=n(x);yield rS(k,o,P)}});return function(_x17){return _ref12.apply(this,arguments)}}()),S});return function(_x14){return _ref1.apply(this,arguments)}}()));function Kh(_x18,_x19,_x20,_x21,_x22){return _Kh.apply(this,arguments)}function _Kh(){_Kh=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _Kh.apply(this,arguments)}var Yh=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref13=_asyncToGenerator(function*(i){r(n,o)});return function log(_x23){return _ref13.apply(this,arguments)}}()}),Me=Sl(e=>rl({...e,provider:e.provider||new vt(e.getState)}),e=>e,vt),DT=Sl(yl,Yh("caseAssist"),vn);var $a=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return Jh(e,r,t)};function Jh(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:eS(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:tS(e),queryPipeline:r.pipeline||pr()}}var Mo=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),vl={urihash:new H,sourcetype:new H,permanentid:new H},bl={uniqueId:W,raw:new K({values:vl}),title:W,uri:W,clickUri:W,rankingModifier:new H({required:!1,emptyAllowed:!0})};function Xh(e){return Object.assign({},...Object.keys(vl).map(t=>({[t]:e[t]})))}function Zh(e){return Object.assign({},...Object.keys(bl).map(t=>({[t]:e[t]})),{raw:Xh(e.raw)})}function eS(e){let t=e.raw.author;return X(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function tS(e){let t=e.raw.source;return X(t)?"unknown":t}var Ha=e=>new Fe(bl).validate(Zh(e));function rS(_x24,_x25,_x26){return _rS.apply(this,arguments)}function _rS(){_rS=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _rS.apply(this,arguments)}d();c();l();u();var Al=()=>Me("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new hn(e)),Cl=()=>({actionCause:"recommendationInterfaceLoad"}),No=e=>Me({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Ha(e),t.makeRecommendationOpen($a(e,r),Mo(e))),__legacy__provider:t=>new hn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=$a(e,t),n=Mo(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var xr=D("recommendation/set",e=>Q(e,{id:W})),bt=de("recommendation/get",/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield nS(o),f=yield n.recommendations(a),m=Date.now()-i;return Oe(f)?r(f.error):{recommendations:f.success.results,analyticsAction:Al(),duration:m,searchUid:f.success.searchUid,splitTestRun:f.success.splitTestRun,pipeline:f.success.pipeline}});return function(_x27,_x28){return _ref14.apply(this,arguments)}}()),nS=/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ft(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Xe.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield oS(e,Cl()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function nS(_x29){return _ref15.apply(this,arguments)}}(),oS=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield qo(e.configuration.analytics,r)});return function oS(_x30,_x31){return _ref16.apply(this,arguments)}}();var Rr=ge(wr(),e=>{e.addCase(xr,(t,r)=>{t.id=r.payload.id}).addCase(bt.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(bt.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(bt.pending,t=>{t.isLoading=!0}).addCase(lo,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Er=D("searchHub/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();var Ir=ge(Cr(),e=>{e.addCase(Er,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ye,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();var za=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};d();c();l();u();var iS=pe(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Ga=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:yr(e)}});d();c();l();u();var aS=pe(e=>e.context,e=>e);d();c();l();u();d();c();l();u();var _o=e=>Me({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ar(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ar(t)??"",answerGenerated:e??!1})});d();c();l();u();var wl=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ke(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function wl(_x32){return _ref17.apply(this,arguments)}}();d();c();l();u();var xl=["text/plain","text/markdown"];var kr=new H({required:!0}),El=new H,Pr=new ne({required:!0}),sS={id:kr,title:kr,uri:kr,permanentid:kr,clickUri:El},Il=new H({required:!0,constrainTo:xl}),D0=D("generatedAnswer/setIsVisible",e=>Q(e,Pr)),q0=D("generatedAnswer/setIsEnabled",e=>Q(e,Pr)),Ka=D("generatedAnswer/updateMessage",e=>Q(e,{textDelta:kr})),Ya=D("generatedAnswer/updateCitations",e=>Q(e,{citations:new ie({required:!0,each:new K({values:sS})})})),cS=D("generatedAnswer/updateError",e=>Q(e,{message:El,code:new J({min:0})})),uS=D("generatedAnswer/resetAnswer"),M0=D("generatedAnswer/like"),j0=D("generatedAnswer/dislike"),N0=D("generatedAnswer/feedbackModal/open"),_0=D("generatedAnswer/expand"),V0=D("generatedAnswer/collapse"),L0=D("generatedAnswer/setId",e=>Q(e,{id:new H({required:!0})})),U0=D("generatedAnswer/feedbackModal/close"),Q0=D("generatedAnswer/sendFeedback"),Wa=D("generatedAnswer/setIsLoading",e=>Q(e,Pr)),Rl=D("generatedAnswer/setIsStreaming",e=>Q(e,Pr)),Ja=D("generatedAnswer/setAnswerContentFormat",e=>Q(e,Il)),B0=D("generatedAnswer/updateResponseFormat",e=>Q(e,{contentFormat:new ie({each:Il,default:["text/plain"]})})),$0=D("knowledge/updateAnswerConfigurationId",e=>Q(e,kr)),H0=D("generatedAnswer/registerFieldsToIncludeInCitations",e=>Q(e,no)),lS=D("generatedAnswer/setIsAnswerGenerated",e=>Q(e,Pr)),Xa=D("generatedAnswer/setCannotAnswer",e=>Q(e,Pr)),z0=de("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:f}=a,{setAbortControllerRef:m}=e,p=yield wl(r),y=(g,v)=>{switch(g){case"genqa.headerMessageType":{let R=JSON.parse(v);n(Ja(R.contentFormat));break}case"genqa.messageType":n(Ka(JSON.parse(v)));break;case"genqa.citationsType":n(Ya(JSON.parse(v)));break;case"genqa.endOfStreamType":{let R=JSON.parse(v).answerGenerated,k=f.length!==0&&!R;n(Xa(k)),n(Rl(!1)),n(lS(R)),n(_o(R));break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Wa(!0));let h=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(p,{write:g=>{h(p)&&(n(Wa(!1)),g.payload&&g.payloadType&&y(g.payloadType,g.payload))},abort:g=>{h(p)&&n(cS(g))},close:()=>{h(p)&&n(Rl(!1))},resetAnswer:()=>{h(p)&&n(uS())}});S?m(S):n(Wa(!1))});return function(_x33,_x34){return _ref18.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var dS=pe(e=>e.pipeline,e=>e);d();c();l();u();var kl=pe(e=>e.query,e=>e);d();c();l();u();d();c();l();u();var bn=Qe(Vo(),1),ql=Qe(Pl(),1);d();c();l();u();var Lo=Qe(Vo(),1),Ol=Qe(Fl(),1);Lo.default.extend(Ol.default);var Tl="YYYY/MM/DD@HH:mm:ss",pS="1401-01-01";function Fr(e,t){let r=(0,Lo.default)(e,t);return!r.isValid()&&!t?(0,Lo.default)(e,Tl):r}function Uo(e){return e.format(Tl)}function Dl(e,t){let r=Fr(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}is(r)}function is(e){if(e.isBefore(pS))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}bn.default.extend(ql.default);var Ml=["past","now","next"],jl=["minute","hour","day","week","month","quarter","year"],fS=e=>{let t=e==="now";return{amount:new J({required:!t,min:1}),unit:new H({required:!t,constrainTo:jl}),period:new H({required:!0,constrainTo:Ml})}};function as(e){if(typeof e=="string"&&!At(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Ul(e):e;new Fe(fS(t.period)).validate(t);let r=_l(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);is(r)}function Nl(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function _l(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,bn.default)().subtract(r,n);case"next":return(0,bn.default)().add(r,n);case"now":return(0,bn.default)()}}function An(e){return Uo(_l(Ul(e)))}function Vl(e){return e.toLocaleLowerCase().split("-")}function At(e){let[t,r,n]=Vl(e);if(t==="now")return!0;if(!Ml.includes(t)||!jl.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function Ll(e){return!!e&&typeof e=="object"&&"period"in e}function Ul(e){let[t,r,n]=Vl(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}d();c();l();u();function Ql(e){return e.type==="dateRange"}function Bl(e){return`start${e}`}function $l(e){return`end${e}`}var Hl=()=>({dateFacetValueMap:{}});function mS(e,t,r){let n=e.start,o=e.end;return At(n)&&(n=An(n),r.dateFacetValueMap[t][Bl(n)]=e.start),At(o)&&(o=An(o),r.dateFacetValueMap[t][$l(o)]=e.end),{...e,start:n,end:o}}function zl(e,t){if(Ql(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>mS(o,r,t))}}return e}function Ct(e){let t=Hl();return{request:{...e,facets:e.facets?.map(n=>zl(n,t))},mappings:t}}function gS(e,t,r){return{...e,start:r.dateFacetValueMap[t][Bl(e.start)]||e.start,end:r.dateFacetValueMap[t][$l(e.end)]||e.end}}function yS(e,t){return e.facetId in t.dateFacetValueMap}function hS(e,t){return yS(e,t)?{...e,values:e.values.map(r=>gS(r,e.facetId,t))}:e}function Qo(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>hS(n,t))}}:e}d();c();l();u();d();c();l();u();var Cn=(e,t)=>{let r=e;return X(r[t])?X(e.raw[t])?null:e.raw[t]:r[t]},SS=e=>t=>e.every(r=>!X(Cn(t,r))),vS=e=>t=>e.every(r=>X(Cn(t,r))),bS=(e,t)=>r=>{let n=Gl(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},AS=(e,t)=>r=>{let n=Gl(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Gl=(e,t)=>{let r=Cn(t,e);return pc(r)?r:[r]},Wl={getResultProperty:Cn,fieldsMustBeDefined:SS,fieldsMustNotBeDefined:vS,fieldMustMatch:bS,fieldMustNotMatch:AS};var CS=pe(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();var wS=pe(e=>e.searchHub,e=>e);d();c();l();u();var ss=pe(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));d();c();l();u();var Kl=pe(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),xS=pe(e=>e,e=>{let t=Kl(e);return t&&e?e[t].expression:""});d();c();l();u();d();c();l();u();function wt(e){return Object.values(e).map(t=>t.request)}function cs(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function Yl(e){return wt(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var us={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function RS(e){return wt(e).map(t=>{let r=us[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ES(e){return[...RS(e.facetSet??{}),...Yl(e.numericFacetSet??{}),...Yl(e.dateFacetSet??{}),...wt(e.categoryFacetSet??{})]}function IS(e){return ES(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function ls(e){return cs(IS(e),e.facetOrder??[])}d();c();l();u();d();c();l();u();function Xl(_x35,_x36){return _Xl.apply(this,arguments)}function _Xl(){_Xl=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Xl.apply(this,arguments)}function Zl(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=PS(t,a);let f=t.length,m=0;for(;r<f;){o&&(t[r]===10&&(m=++r),o=!1);let p=-1;for(;r<f&&p===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:o=!0,p=r;break;case 10:p=r;break}if(p===-1)break;e(t.subarray(m,p),n),m=r,n=-1}m===f?t=void 0:m!==0&&(t=t.subarray(m),r-=m)}}function ed(e,t,r){let n=Jl(),o=new TextDecoder;return function(a,f){if(a.length===0)r?.(n),n=Jl();else if(f>0){let m=o.decode(a.subarray(0,f)),p=f+(a[f+1]===32?2:1),y=o.decode(a.subarray(p));switch(m){case"data":n.data=n.data?`${n.data}
|
|
31
|
-
${y}`:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":kS(y,n,t);break}}}}function kS(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function PS(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Jl(){return{data:"",event:"",id:"",retry:void 0}}var ds="text/event-stream",FS=1e3,td="last-event-id";function rd(){return typeof window<"u"}function nd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:f,fetch:m,...p}){return new Promise((y,h)=>{let S={...r};S.accept||(S.accept=ds);let g;function v(){g?.abort(),document.hidden||E()}!f&&rd()&&document.addEventListener("visibilitychange",v);let R=FS,k;function x(){rd()&&document.removeEventListener("visibilitychange",v),clearTimeout(k),g?.abort()}t?.addEventListener("abort",()=>{x(),y()});let P=m??A,w=n??OS;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let j=yield P(e,{...p,headers:S,signal:g?.signal});yield w(j),yield Xl(j.body,Zl(ed(O=>{O?S[td]=O:delete S[td]},O=>{R=O},o))),i?.(),x(),y()}catch(j){if(!g?.signal?.aborted)try{let O=a?.(j)??R;clearTimeout(k),k=setTimeout(E,O)}catch(O){x(),h(O)}}});return _E.apply(this,arguments)}E()})}function OS(e){let t=e.headers.get("content-type");if(!t?.startsWith(ds))throw new Error(`Expected content-type to be ${ds}, Actual: ${t}`)}d();c();l();u();d();c();l();u();function od(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var id=We;function hd(e,t){if(e===t||!(id(e)&&id(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=hd(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function Or(e){let t=0;for(let r in e)t++;return t}var ad=e=>[].concat(...e);function TS(e){return new RegExp("(^|:)//").test(e)}function DS(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Ho(e){return e!=null}function qS(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var MS=e=>e.replace(/\/$/,""),jS=e=>e.replace(/^\//,"");function NS(e,t){if(!e)return t;if(!t)return e;if(TS(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=MS(e),t=jS(t),`${e}${r}${t}`}function _S(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var sd=(...e)=>A(...e),VS=e=>e.status>=200&&e.status<=299,LS=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function cd(e){if(!We(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function Sd({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=sd,paramsSerializer:n,isJsonContentType:o=LS,jsonContentType:i="application/json",jsonReplacer:a,timeout:f,responseHandler:m,validateStatus:p,...y}={}){return typeof A>"u"&&r===sd&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(S,g,v){let{getState:R,extra:k,endpoint:x,forced:P,type:w}=g,E,{url:j,headers:O=new C(y.headers),params:I=void 0,responseHandler:F=m??"json",validateStatus:T=p??VS,timeout:N=f,...$}=typeof S=="string"?{url:S}:S,U,V=g.signal;N&&(U=new s.AbortController,g.signal.addEventListener("abort",U.abort),V=U.signal);let _={...y,signal:V,...$};O=new C(cd(O)),_.headers=(yield t(O,{getState:R,arg:S,extra:k,endpoint:x,forced:P,type:w,extraOptions:v}))||O;let B=Z=>typeof Z=="object"&&(We(Z)||Array.isArray(Z)||typeof Z.toJSON=="function");if(!_.headers.has("content-type")&&B(_.body)&&_.headers.set("content-type",i),B(_.body)&&o(_.headers)&&(_.body=JSON.stringify(_.body,a)),I){let Z=~j.indexOf("?")?"&":"?",oe=n?n(I):new URLSearchParams(cd(I));j+=Z+oe}j=NS(e,j);let L=new Request(j,_);E={request:new Request(j,_)};let G,Y=!1,te=U&&setTimeout(()=>{Y=!0,U.abort()},N);try{G=yield r(L)}catch(Z){return{error:{status:Y?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Z)},meta:E}}finally{te&&clearTimeout(te),U?.signal.removeEventListener("abort",U.abort)}let se=G.clone();E.response=se;let ee,re="";try{let Z;if(yield Promise.all([h(G,F).then(oe=>ee=oe,oe=>Z=oe),se.text().then(oe=>re=oe,()=>{})]),Z)throw Z}catch(Z){return{error:{status:"PARSING_ERROR",originalStatus:G.status,data:re,error:String(Z)},meta:E}}return T(G,ee)?{data:ee,meta:E}:{error:{status:G.status,data:ee},meta:E}});return function(_x37,_x38,_x39){return _ref19.apply(this,arguments)}}());function h(_x40,_x41){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _h2.apply(this,arguments)}}var Tr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function US(){return _US.apply(this,arguments)}function _US(){_US=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _US.apply(this,arguments)}function QS(e,t){throw Object.assign(new Tr({error:e,meta:t}),{throwImmediately:!0})}var ud={},BS=(e,t)=>(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(r,n,o){let i=[5,(t||ud).maxRetries,(o||ud).maxRetries].filter(y=>y!==void 0),[a]=i.slice(-1),m={maxRetries:a,backoff:US,retryCondition:(y,h,{attempt:S})=>S<=a,...t,...o},p=0;for(;;)try{let y=yield e(r,n,o);if(y.error)throw new Tr(y);return y}catch(y){if(p++,y.throwImmediately){if(y instanceof Tr)return y.value;throw y}if(y instanceof Tr&&!m.retryCondition(y.value.error,r,{attempt:p,baseQueryApi:n,extraOptions:o}))return y.value;yield m.backoff(p,m.maxRetries)}});return function(_x42,_x43,_x44){return _ref20.apply(this,arguments)}}()),vd=Object.assign(BS,{fail:QS}),ys=D("__rtkq/focused"),bd=D("__rtkq/unfocused"),hs=D("__rtkq/online"),Ad=D("__rtkq/offline");function Ss(e){return e.type==="query"}function $S(e){return e.type==="mutation"}function vs(e){return e.type==="infinitequery"}function bs(e,t,r,n,o,i){return HS(e)?e(t,r,n,o).filter(Ho).map(fs).map(i):Array.isArray(e)?e.map(fs).map(i):[]}function HS(e){return typeof e=="function"}function fs(e){return typeof e=="string"?{type:e}:e}function zS(e,t){return e.catch(t)}var xn=Symbol("forceQueryFn"),ms=e=>typeof e[xn]=="function";function GS({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,f=new Map,{unsubscribeQueryResult:m,removeMutationResult:p,updateSubscriptionOptions:y}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:P,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:v};function h(E,j){return O=>{let I=i.endpointDefinitions[E],F=e({queryArgs:j,endpointDefinition:I,endpointName:E});return a.get(O)?.[F]}}function S(E,j){return O=>f.get(O)?.[j]}function g(){return E=>Object.values(a.get(E)||{}).filter(Ho)}function v(){return E=>Object.values(f.get(E)||{}).filter(Ho)}function R(E){}function k(E,j){let O=(I,{subscribe:F=!0,forceRefetch:T,subscriptionOptions:N,[xn]:$,...U}={})=>(V,_)=>{let B=e({queryArgs:I,endpointDefinition:j,endpointName:E}),L,z={...U,type:"query",subscribe:F,forceRefetch:T,subscriptionOptions:N,endpointName:E,originalArgs:I,queryCacheKey:B,[xn]:$};if(Ss(j))L=t(z);else{let{direction:ce,initialPageParam:me}=U;L=r({...z,direction:ce,initialPageParam:me})}let G=o.endpoints[E].select(I),Y=V(L),te=G(_());let{requestId:se,abort:ee}=Y,re=te.requestId!==se,Z=a.get(V)?.[B],oe=()=>G(_()),ye=Object.assign($?Y.then(oe):re&&!Z?Promise.resolve(te):Promise.all([Z,Y]).then(oe),{arg:I,requestId:se,subscriptionOptions:N,queryCacheKey:B,abort:ee,unwrap(){return _asyncToGenerator(function*(){let ce=yield ye;if(ce.isError)throw ce.error;return ce.data})()},refetch:()=>V(O(I,{subscribe:!1,forceRefetch:!0})),unsubscribe(){F&&V(m({queryCacheKey:B,requestId:se}))},updateSubscriptionOptions(ce){ye.subscriptionOptions=ce,V(y({endpointName:E,requestId:se,queryCacheKey:B,options:ce}))}});if(!Z&&!re&&!$){let ce=_S(a,V,{});ce[B]=ye,ye.then(()=>{delete ce[B],Or(ce)||a.delete(V)})}return ye};return O}function x(E,j){return k(E,j)}function P(E,j){return k(E,j)}function w(E){return(j,{track:O=!0,fixedCacheKey:I}={})=>(F,T)=>{let N=n({type:"mutation",endpointName:E,originalArgs:j,track:O,fixedCacheKey:I}),$=F(N);let{requestId:U,abort:V,unwrap:_}=$,B=zS($.unwrap().then(Y=>({data:Y})),Y=>({error:Y})),L=()=>{F(p({requestId:U,fixedCacheKey:I}))},z=Object.assign(B,{arg:$.arg,requestId:U,abort:V,unwrap:_,reset:L}),G=f.get(F)||{};return f.set(F,G),G[U]=z,z.then(()=>{delete G[U],Or(G)||f.delete(F)}),I&&(G[I]=z,z.then(()=>{G[I]===z&&(delete G[I],Or(G)||f.delete(F))})),z}}}function WS(e){return e}var Bo=(e={})=>({...e,[cn]:!0});function KS({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let f=(F,T,N,$)=>(U,V)=>{let _=r[F],B=n({queryArgs:T,endpointDefinition:_,endpointName:F});if(U(o.internalActions.queryResultPatched({queryCacheKey:B,patches:N})),!$)return;let L=o.endpoints[F].select(T)(V()),z=bs(_.providesTags,L.data,void 0,T,{},i);U(o.internalActions.updateProvidedBy({queryCacheKey:B,providedTags:z}))};function m(F,T,N=0){let $=[T,...F];return N&&$.length>N?$.slice(0,-1):$}function p(F,T,N=0){let $=[...F,T];return N&&$.length>N?$.slice(1):$}let y=(F,T,N,$=!0)=>(U,V)=>{let B=o.endpoints[F].select(T)(V()),L={patches:[],inversePatches:[],undo:()=>U(o.util.patchQueryData(F,T,L.inversePatches,$))};if(B.status==="uninitialized")return L;let z;if("data"in B)if(De(B.data)){let[G,Y,te]=Yn(B.data,N);L.patches.push(...Y),L.inversePatches.push(...te),z=G}else z=N(B.data),L.patches.push({op:"replace",path:[],value:z}),L.inversePatches.push({op:"replace",path:[],value:B.data});return L.patches.length===0||U(o.util.patchQueryData(F,T,L.patches,$)),L},h=(F,T,N)=>$=>$(o.endpoints[F].initiate(T,{subscribe:!1,forceRefetch:!0,[xn]:()=>({data:N})})),S=(F,T)=>F.query&&F[T]?F[T]:WS,g=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(F,{signal:T,abort:N,rejectWithValue:$,fulfillWithValue:U,dispatch:V,getState:_,extra:B}){let L=r[F.endpointName];try{let z=S(L,"transformResponse"),G={signal:T,abort:N,dispatch:V,getState:_,extra:B,endpoint:F.endpointName,type:F.type,forced:F.type==="query"?v(F,_()):void 0,queryCacheKey:F.type==="query"?F.queryCacheKey:void 0},Y=F.type==="query"?F[xn]:void 0,te,se=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(re,Z,oe,ye){if(Z==null&&re.pages.length)return Promise.resolve({data:re});let ce={queryArg:F.originalArgs,pageParam:Z},me=yield ee(ce),he=ye?m:p;return{data:{pages:he(re.pages,me.data,oe),pageParams:he(re.pageParams,Z,oe)}}});return function se(_x47,_x48,_x49,_x50){return _ref22.apply(this,arguments)}}();function ee(_x51){return _ee.apply(this,arguments)}function _ee(){_ee=_asyncToGenerator(function*(re){let Z,{extraOptions:oe}=L;if(Y?Z=Y():L.query?Z=yield t(L.query(re),G,oe):Z=yield L.queryFn(re,G,oe,ce=>t(ce,G,oe)),typeof process<"u",Z.error)throw new Tr(Z.error,Z.meta);let ye=yield z(Z.data,Z.meta,re);return{...Z,data:ye}});return _ee.apply(this,arguments)}if(F.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:re}=L,{maxPages:Z=1/0}=re,oe,ye={pages:[],pageParams:[]},ce=a.selectQueryEntry(_(),F.queryCacheKey)?.data,he=v(F,_())&&!F.direction||!ce?ye:ce;if("direction"in F&&F.direction&&he.pages.length){let Pe=F.direction==="backward",pt=(Pe?Cd:gs)(re,he);oe=yield se(he,pt,Z,Pe)}else{let{initialPageParam:Pe=re.initialPageParam}=F,_e=ce?.pageParams??[],pt=_e[0]??Pe,Kt=_e.length;oe=yield se(he,pt,Z),Y&&(oe={data:oe.data.pages[0]});for(let Yt=1;Yt<Kt;Yt++){let Qr=gs(re,oe.data);oe=yield se(oe.data,Qr,Z)}}te=oe}else te=yield ee(F.originalArgs);return U(te.data,Bo({fulfilledTimeStamp:Date.now(),baseQueryMeta:te.meta}))}catch(z){let G=z;if(G instanceof Tr){let Y=S(L,"transformErrorResponse");try{return $(yield Y(G.value,G.meta,F.originalArgs),Bo({baseQueryMeta:G.meta}))}catch(te){G=te}}throw typeof process<"u",console.error(G),G}});return function g(_x45,_x46){return _ref21.apply(this,arguments)}}();function v(F,T){let N=a.selectQueryEntry(T,F.queryCacheKey),$=a.selectConfig(T).refetchOnMountOrArgChange,U=N?.fulfilledTimeStamp,V=F.forceRefetch??(F.subscribe&&$);return V?V===!0||(Number(new Date)-Number(U))/1e3>=V:!1}let R=()=>de(`${e}/executeQuery`,g,{getPendingMeta({arg:T}){let N=r[T.endpointName];return Bo({startedTimeStamp:Date.now(),...(vs(N)?{direction:T.direction}:{})})},condition(T,{getState:N}){let $=N(),U=a.selectQueryEntry($,T.queryCacheKey),V=U?.fulfilledTimeStamp,_=T.originalArgs,B=U?.originalArgs,L=r[T.endpointName],z=T.direction;return ms(T)?!0:U?.status==="pending"?!1:v(T,$)||Ss(L)&&L?.forceRefetch?.({currentArg:_,previousArg:B,endpointState:U,state:$})?!0:!(V&&!z)},dispatchConditionRejection:!0}),k=R(),x=R(),P=de(`${e}/executeMutation`,g,{getPendingMeta(){return Bo({startedTimeStamp:Date.now()})}}),w=F=>"force"in F,E=F=>"ifOlderThan"in F,j=(F,T,N)=>($,U)=>{let V=w(N)&&N.force,_=E(N)&&N.ifOlderThan,B=(z=!0)=>{let G={forceRefetch:z,isPrefetch:!0};return o.endpoints[F].initiate(T,G)},L=o.endpoints[F].select(T)(U());if(V)$(B());else if(_){let z=L?.fulfilledTimeStamp;if(!z){$(B());return}(Number(new Date)-Number(new Date(z)))/1e3>=_&&$(B())}else $(B(!1))};function O(F){return T=>T?.meta?.arg?.endpointName===F}function I(F,T){return{matchPending:ir(eo(F),O(T)),matchFulfilled:ir(ot(F),O(T)),matchRejected:ir(Ut(F),O(T))}}return{queryThunk:k,mutationThunk:P,infiniteQueryThunk:x,prefetch:j,updateQueryData:y,upsertQueryData:h,patchQueryData:f,buildMatchThunkActions:I}}function gs(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Cd(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function wd(e,t,r,n){return bs(r[e.meta.arg.endpointName][t],ot(e)?e.payload:void 0,ln(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function $o(e,t,r){let n=e[t];n&&r(n)}function Rn(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function ld(e,t,r){let n=e[Rn(t)];n&&r(n)}var wn={};function YS({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:f},assertTagType:m,config:p}){let y=D(`${e}/resetApiState`);function h(O,I,F,T){var N;O[N=I.queryCacheKey]??(O[N]={status:"uninitialized",endpointName:I.endpointName}),$o(O,I.queryCacheKey,$=>{$.status="pending",$.requestId=F&&$.requestId?$.requestId:T.requestId,I.originalArgs!==void 0&&($.originalArgs=I.originalArgs),$.startedTimeStamp=T.startedTimeStamp;let U=o[T.arg.endpointName];vs(U)&&"direction"in I&&($.direction=I.direction)})}function S(O,I,F,T){$o(O,I.arg.queryCacheKey,N=>{if(N.requestId!==I.requestId&&!T)return;let{merge:$}=o[I.arg.endpointName];if(N.status="fulfilled",$){if(N.data!==void 0){let{fulfilledTimeStamp:U,arg:V,baseQueryMeta:_,requestId:B}=I,L=nt(N.data,z=>$(z,F,{arg:V.originalArgs,baseQueryMeta:_,fulfilledTimeStamp:U,requestId:B}));N.data=L}else N.data=F;}else N.data=o[I.arg.endpointName].structuralSharing??!0?hd(je(N.data)?na(N.data):N.data,F):F;delete N.error,N.fulfilledTimeStamp=I.fulfilledTimeStamp})}let g=Qt({name:`${e}/queries`,initialState:wn,reducers:{removeQueryResult:{reducer(O,{payload:{queryCacheKey:I}}){delete O[I]},prepare:ar()},cacheEntriesUpserted:{reducer(O,I){for(let F of I.payload){let{queryDescription:T,value:N}=F;h(O,T,!0,{arg:T,requestId:I.meta.requestId,startedTimeStamp:I.meta.timestamp}),S(O,{arg:T,requestId:I.meta.requestId,fulfilledTimeStamp:I.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:O=>({payload:O.map(T=>{let{endpointName:N,arg:$,value:U}=T,V=o[N];return{queryDescription:{type:"query",endpointName:N,originalArgs:T.arg,queryCacheKey:n({queryArgs:$,endpointDefinition:V,endpointName:N})},value:U}}),meta:{[cn]:!0,requestId:ro(),timestamp:Date.now()}})},queryResultPatched:{reducer(O,{payload:{queryCacheKey:I,patches:F}}){$o(O,I,T=>{T.data=ia(T.data,F.concat())})},prepare:ar()}},extraReducers(O){O.addCase(t.pending,(I,{meta:F,meta:{arg:T}})=>{let N=ms(T);h(I,T,N,F)}).addCase(t.fulfilled,(I,{meta:F,payload:T})=>{let N=ms(F.arg);S(I,F,T,N)}).addCase(t.rejected,(I,{meta:{condition:F,arg:T,requestId:N},error:$,payload:U})=>{$o(I,T.queryCacheKey,V=>{if(!F){if(V.requestId!==N)return;V.status="rejected",V.error=U??$}})}).addMatcher(f,(I,F)=>{let{queries:T}=a(F);for(let[N,$]of Object.entries(T))($?.status==="fulfilled"||$?.status==="rejected")&&(I[N]=$)})}}),v=Qt({name:`${e}/mutations`,initialState:wn,reducers:{removeMutationResult:{reducer(O,{payload:I}){let F=Rn(I);F in O&&delete O[F]},prepare:ar()}},extraReducers(O){O.addCase(r.pending,(I,{meta:F,meta:{requestId:T,arg:N,startedTimeStamp:$}})=>{N.track&&(I[Rn(F)]={requestId:T,status:"pending",endpointName:N.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,(I,{payload:F,meta:T})=>{T.arg.track&&ld(I,T,N=>{N.requestId===T.requestId&&(N.status="fulfilled",N.data=F,N.fulfilledTimeStamp=T.fulfilledTimeStamp)})}).addCase(r.rejected,(I,{payload:F,error:T,meta:N})=>{N.arg.track&&ld(I,N,$=>{$.requestId===N.requestId&&($.status="rejected",$.error=F??T)})}).addMatcher(f,(I,F)=>{let{mutations:T}=a(F);for(let[N,$]of Object.entries(T))($?.status==="fulfilled"||$?.status==="rejected")&&N!==$?.requestId&&(I[N]=$)})}}),R=Qt({name:`${e}/invalidation`,initialState:wn,reducers:{updateProvidedBy:{reducer(O,I){var N,$;let{queryCacheKey:F,providedTags:T}=I.payload;for(let U of Object.values(O))for(let V of Object.values(U)){let _=V.indexOf(F);_!==-1&&V.splice(_,1)}for(let{type:U,id:V}of T){let _=(N=O[U]??(O[U]={}))[$=V||"__internal_without_id"]??(N[$]=[]);_.includes(F)||_.push(F)}},prepare:ar()}},extraReducers(O){O.addCase(g.actions.removeQueryResult,(I,{payload:{queryCacheKey:F}})=>{for(let T of Object.values(I))for(let N of Object.values(T)){let $=N.indexOf(F);$!==-1&&N.splice($,1)}}).addMatcher(f,(I,F)=>{var N,$;let{provided:T}=a(F);for(let[U,V]of Object.entries(T))for(let[_,B]of Object.entries(V)){let L=(N=I[U]??(I[U]={}))[$=_||"__internal_without_id"]??(N[$]=[]);for(let z of B)L.includes(z)||L.push(z)}}).addMatcher(Ke(ot(t),ln(t)),(I,F)=>{let T=wd(F,"providesTags",o,m),{queryCacheKey:N}=F.meta.arg;R.caseReducers.updateProvidedBy(I,R.actions.updateProvidedBy({queryCacheKey:N,providedTags:T}))})}}),k=Qt({name:`${e}/subscriptions`,initialState:wn,reducers:{updateSubscriptionOptions(O,I){},unsubscribeQueryResult(O,I){},internal_getRTKQSubscriptions(){}}}),x=Qt({name:`${e}/internalSubscriptions`,initialState:wn,reducers:{subscriptionsUpdated:{reducer(O,I){return ia(O,I.payload)},prepare:ar()}}}),P=Qt({name:`${e}/config`,initialState:{online:qS(),focused:DS(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(O,{payload:I}){O.middlewareRegistered=O.middlewareRegistered==="conflict"||i!==I?"conflict":!0}},extraReducers:O=>{O.addCase(hs,I=>{I.online=!0}).addCase(Ad,I=>{I.online=!1}).addCase(ys,I=>{I.focused=!0}).addCase(bd,I=>{I.focused=!1}).addMatcher(f,I=>({...I}))}}),w=tr({queries:g.reducer,mutations:v.reducer,provided:R.reducer,subscriptions:x.reducer,config:P.reducer}),E=(O,I)=>w(y.match(I)?void 0:O,I),j={...P.actions,...g.actions,...k.actions,...x.actions,...v.actions,...R.actions,resetApiState:y};return{reducer:E,actions:j}}var ps=Symbol.for("RTKQ/skipToken"),xd={status:"uninitialized"},dd=nt(xd,()=>{}),pd=nt(xd,()=>{});function JS({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>dd,o=w=>pd;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:v,selectInvalidatedBy:R,selectCachedArgsForQuery:k,selectApiState:a,selectQueries:f,selectMutations:p,selectQueryEntry:m,selectConfig:y};function i(w){return{...w,...od(w.status)}}function a(w){return w[t]}function f(w){return a(w)?.queries}function m(w,E){return f(w)?.[E]}function p(w){return a(w)?.mutations}function y(w){return a(w)?.config}function h(w,E,j){return O=>{if(O===ps)return r(n,j);let I=e({queryArgs:O,endpointDefinition:E,endpointName:w});return r(T=>m(T,I)??dd,j)}}function S(w,E){return h(w,E,i)}function g(w,E){let{infiniteQueryOptions:j}=E;function O(I){let F={...I,...od(I.status)},{isLoading:T,isError:N,direction:$}=F,U=$==="forward",V=$==="backward";return{...F,hasNextPage:x(j,F.data),hasPreviousPage:P(j,F.data),isFetchingNextPage:T&&U,isFetchingPreviousPage:T&&V,isFetchNextPageError:N&&U,isFetchPreviousPageError:N&&V}}return h(w,E,O)}function v(){return w=>{let E;return typeof w=="object"?E=Rn(w)??ps:E=w,r(E===ps?o:I=>a(I)?.mutations?.[E]??pd,i)}}function R(w,E){let j=w[t],O=new Set;for(let I of E.filter(Ho).map(fs)){let F=j.provided[I.type];if(!F)continue;let T=(I.id!==void 0?F[I.id]:ad(Object.values(F)))??[];for(let N of T)O.add(N)}return ad(Array.from(O.values()).map(I=>{let F=j.queries[I];return F?[{queryCacheKey:I,endpointName:F.endpointName,originalArgs:F.originalArgs}]:[]}))}function k(w,E){return Object.values(f(w)).filter(j=>j?.endpointName===E&&j.status!=="uninitialized").map(j=>j.originalArgs)}function x(w,E){return E?gs(w,E)!=null:!1}function P(w,E){return!E||!w.getPreviousPageParam?!1:Cd(w,E)!=null}}var fd=WeakMap?new WeakMap:void 0,md=({endpointName:e,queryArgs:t})=>{let r="",n=fd?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=We(a)?Object.keys(a).sort().reduce((f,m)=>(f[m]=a[m],f),{}):a,a));We(t)&&fd?.set(t,o),r=o}return`${e}(${r})`};function XS(...e){return function(r){let n=or(p=>r.extractRehydrationInfo?.(p,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(p){let y=md;if("serializeQueryArgs"in p.endpointDefinition){let h=p.endpointDefinition.serializeQueryArgs;y=S=>{let g=h(S);return typeof g=="string"?g:md({...S,queryArgs:g})}}else r.serializeQueryArgs&&(y=r.serializeQueryArgs);return y(p)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(p){p()},apiUid:ro(),extractRehydrationInfo:n,hasRehydrationInfo:or(p=>n(p)!=null)},a={injectEndpoints:m,enhanceEndpoints({addTagTypes:p,endpoints:y}){if(p)for(let h of p)o.tagTypes.includes(h)||o.tagTypes.push(h);if(y)for(let[h,S]of Object.entries(y))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},f=e.map(p=>p.init(a,o,i));function m(p){let y=p.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(y)){if(p.overrideExisting!==!0&&h in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error($e(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let g of f)g.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function lt(e,...t){return Object.assign(e,...t)}var ZS=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:f}=e.internalActions,m=(g,v)=>{var k,x;if(a.match(v)){let{queryCacheKey:P,requestId:w,options:E}=v.payload;return g?.[P]?.[w]&&(g[P][w]=E),!0}if(f.match(v)){let{queryCacheKey:P,requestId:w}=v.payload;return g[P]&&delete g[P][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete g[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:P,requestId:w}}=v,E=g[k=P.queryCacheKey]??(g[k]={});return E[`${w}_running`]={},P.subscribe&&(E[w]=P.subscriptionOptions??E[w]??{}),!0}let R=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let P=g[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;R||(R=!!P[w]),delete P[w]}if(t.rejected.match(v)){let{meta:{condition:P,arg:w,requestId:E}}=v;if(P&&w.subscribe){let j=g[x=w.queryCacheKey]??(g[x]={});j[E]=w.subscriptionOptions??j[E]??{},R=!0}}return R},p=()=>r.currentSubscriptions,S={getSubscriptions:p,getSubscriptionCount:g=>{let R=p()[g]??{};return Or(R)},isRequestSubscribed:(g,v)=>!!p()?.[g]?.[v]};return(g,v)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let R=m(r.currentSubscriptions,g),k=!0;if(R){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=Yn(o,()=>w);v.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let x=typeof g.type=="string"&&!!g.type.startsWith(n),P=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;k=!x&&!P}return[k,!1]}};function ev(e){for(let t in e)return!1;return!0}var tv=2147483647/1e3-1,rv=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:f,unsubscribeQueryResult:m,cacheEntriesUpserted:p}=t.internalActions,y=Ke(m.match,r.fulfilled,r.rejected,p.match);function h(k){let x=o.currentSubscriptions[k];return!!x&&!ev(x)}let S={},g=(k,x,P)=>{let w=x.getState(),E=a(w);if(y(k)){let j;if(p.match(k))j=k.payload.map(O=>O.queryDescription.queryCacheKey);else{let{queryCacheKey:O}=m.match(k)?k.payload:k.meta.arg;j=[O]}v(j,x,E)}if(t.util.resetApiState.match(k))for(let[j,O]of Object.entries(S))O&&clearTimeout(O),delete S[j];if(n.hasRehydrationInfo(k)){let{queries:j}=n.extractRehydrationInfo(k);v(Object.keys(j),x,E)}};function v(k,x,P){let w=x.getState();for(let E of k){let j=i(w,E);R(E,j?.endpointName,x,P)}}function R(k,x,P,w){let j=n.endpointDefinitions[x]?.keepUnusedDataFor??w.keepUnusedDataFor;if(j===1/0)return;let O=Math.max(0,Math.min(j,tv));if(!h(k)){let I=S[k];I&&clearTimeout(I),S[k]=setTimeout(()=>{h(k)||P.dispatch(f({queryCacheKey:k})),delete S[k]},O*1e3)}}return g},gd=new Error("Promise never resolved before cacheEntryRemoved."),nv=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:f}})=>{let m=to(n),p=to(o),y=ot(n,o),h={};function S(x,P,w){let E=h[x];E?.valueResolved&&(E.valueResolved({data:P,meta:w}),delete E.valueResolved)}function g(x){let P=h[x];P&&(delete h[x],P.cacheEntryRemoved())}let v=(x,P,w)=>{let E=R(x);function j(O,I,F,T){let N=a(w,I),$=a(P.getState(),I);!N&&$&&k(O,T,I,P,F)}if(n.pending.match(x))j(x.meta.arg.endpointName,E,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:O,value:I}of x.payload){let{endpointName:F,originalArgs:T,queryCacheKey:N}=O;j(F,N,x.meta.requestId,T),S(N,I,{})}else if(o.pending.match(x))P.getState()[t].mutations[E]&&k(x.meta.arg.endpointName,x.meta.arg.originalArgs,E,P,x.meta.requestId);else if(y(x))S(E,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))g(E);else if(e.util.resetApiState.match(x))for(let O of Object.keys(h))g(O)};function R(x){return m(x)?x.meta.arg.queryCacheKey:p(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?Rn(x.payload):""}function k(x,P,w,E,j){let O=r.endpointDefinitions[x],I=O?.onCacheEntryAdded;if(!I)return;let F={},T=new Promise(B=>{F.cacheEntryRemoved=B}),N=Promise.race([new Promise(B=>{F.valueResolved=B}),T.then(()=>{throw gd})]);N.catch(()=>{}),h[w]=F;let $=e.endpoints[x].select(O.type==="query"?P:w),U=E.dispatch((B,L,z)=>z),V={...E,getCacheEntry:()=>$(E.getState()),requestId:j,extra:U,updateCachedData:O.type==="query"?B=>E.dispatch(e.util.updateQueryData(x,P,B)):void 0,cacheDataLoaded:N,cacheEntryRemoved:T},_=I(P,V);Promise.resolve(_).catch(B=>{if(B!==gd)throw B})}return v},ov=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},iv=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:f,internalState:m})=>{let{removeQueryResult:p}=i.internalActions,y=Ke(ot(n),ln(n)),h=Ke(ot(n,o),Ut(n,o)),S=[],g=(k,x)=>{y(k)?R(wd(k,"invalidatesTags",r,a),x):h(k)?R([],x):i.util.invalidateTags.match(k)&&R(bs(k.payload,void 0,void 0,void 0,void 0,a),x)};function v(k){let{queries:x,mutations:P}=k;for(let w of[x,P])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function R(k,x){let P=x.getState(),w=P[e];if(S.push(...k),w.config.invalidationBehavior==="delayed"&&v(w))return;let E=S;if(S=[],E.length===0)return;let j=i.util.selectInvalidatedBy(P,E);t.batch(()=>{let O=Array.from(j.values());for(let{queryCacheKey:I}of O){let F=w.queries[I],T=m.currentSubscriptions[I]??{};F&&(Or(T)===0?x.dispatch(p({queryCacheKey:I})):F.status!=="uninitialized"&&x.dispatch(f(F)))}})}return g},av=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,v)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&p(g.payload,v),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&p(g.meta.arg,v),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&m(g.meta.arg,v),r.util.resetApiState.match(g)&&h()};function f(g,v){let k=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!(!k||k.status==="uninitialized"))return x}function m({queryCacheKey:g},v){let R=v.getState()[e],k=R.queries[g],x=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:P,skipPollingIfUnfocused:w}=S(x);if(!Number.isFinite(P))return;let E=i[g];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let j=Date.now()+P;i[g]={nextPollTimestamp:j,pollingInterval:P,timeout:setTimeout(()=>{(R.config.focused||!w)&&v.dispatch(n(k)),m({queryCacheKey:g},v)},P)}}function p({queryCacheKey:g},v){let k=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:P}=S(x);if(!Number.isFinite(P)){y(g);return}let w=i[g],E=Date.now()+P;(!w||E<w.nextPollTimestamp)&&m({queryCacheKey:g},v)}function y(g){let v=i[g];v?.timeout&&clearTimeout(v.timeout),delete i[g]}function h(){for(let g of Object.keys(i))y(g)}function S(g={}){let v=!1,R=Number.POSITIVE_INFINITY;for(let k in g)g[k].pollingInterval&&(R=Math.min(g[k].pollingInterval,R),v=g[k].skipPollingIfUnfocused||v);return{lowestPollingInterval:R,skipPollingIfUnfocused:v}}return a},sv=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=eo(r,n),i=Ut(r,n),a=ot(r,n),f={};return(p,y)=>{if(o(p)){let{requestId:h,arg:{endpointName:S,originalArgs:g}}=p.meta,v=t.endpointDefinitions[S],R=v?.onQueryStarted;if(R){let k={},x=new Promise((j,O)=>{k.resolve=j,k.reject=O});x.catch(()=>{}),f[h]=k;let P=e.endpoints[S].select(v.type==="query"?g:h),w=y.dispatch((j,O,I)=>I),E={...y,getCacheEntry:()=>P(y.getState()),requestId:h,extra:w,updateCachedData:v.type==="query"?j=>y.dispatch(e.util.updateQueryData(S,g,j)):void 0,queryFulfilled:x};R(g,E)}}else if(a(p)){let{requestId:h,baseQueryMeta:S}=p.meta;f[h]?.resolve({data:p.payload,meta:S}),delete f[h]}else if(i(p)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:g}=p.meta;f[h]?.reject({error:p.payload??p.error,isUnhandledError:!S,meta:g}),delete f[h]}}},cv=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(m,p)=>{ys.match(m)&&f(p,"refetchOnFocus"),hs.match(m)&&f(p,"refetchOnReconnect")};function f(m,p){let y=m.getState()[e],h=y.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let v=h[g],R=S[g];if(!R||!v)continue;(Object.values(R).some(x=>x[p]===!0)||Object.values(R).every(x=>x[p]===void 0)&&y.config[p])&&(Or(R)===0?m.dispatch(i({queryCacheKey:g})):v.status!=="uninitialized"&&m.dispatch(n(v)))}})}return a};function uv(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:D(`${t}/invalidateTags`)},f=h=>h.type.startsWith(`${t}/`),m=[ov,rv,iv,av,nv,sv];return{middleware:h=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:y,isThisApiSliceAction:f},R=m.map(P=>P(v)),k=ZS(v),x=cv(v);return P=>w=>{if(!$n(w))return P(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:P},j=h.getState(),[O,I]=k(w,E,j),F;if(O?F=P(w):F=I,h.getState()[t]&&(x(w,E,j),f(w)||o.hasRehydrationInfo(w)))for(let T of R)T(w,E,j);return F}},actions:a};function y(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var yd=Symbol(),lv=({createSelector:e=pe}={})=>({name:yd,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:f,refetchOnFocus:m,refetchOnReconnect:p,invalidationBehavior:y},h){zc();let S=ee=>(typeof process<"u",ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:hs,onOffline:Ad,onFocus:ys,onFocusLost:bd},util:{}});let g=JS({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:R,buildQuerySelector:k,buildInfiniteQuerySelector:x,buildMutationSelector:P}=g;lt(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:j,patchQueryData:O,updateQueryData:I,upsertQueryData:F,prefetch:T,buildMatchThunkActions:N}=KS({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:$,actions:U}=YS({context:h,queryThunk:w,infiniteQueryThunk:E,mutationThunk:j,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:m,refetchOnReconnect:p,refetchOnMountOrArgChange:f,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:y}});lt(t.util,{patchQueryData:O,updateQueryData:I,upsertQueryData:F,prefetch:T,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),lt(t.internalActions,U);let{middleware:V,actions:_}=uv({reducerPath:o,context:h,queryThunk:w,mutationThunk:j,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:g});lt(t.util,_),lt(t,{reducer:$,middleware:V});let{buildInitiateQuery:B,buildInitiateInfiniteQuery:L,buildInitiateMutation:z,getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueriesThunk:te,getRunningQueryThunk:se}=GS({queryThunk:w,mutationThunk:j,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return lt(t.util,{getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueryThunk:se,getRunningQueriesThunk:te}),{name:yd,injectEndpoint(ee,re){var ye;let oe=(ye=t.endpoints)[ee]??(ye[ee]={});Ss(re)&<(oe,{name:ee,select:k(ee,re),initiate:B(ee,re)},N(w,ee)),$S(re)&<(oe,{name:ee,select:P(),initiate:z(ee)},N(j,ee)),vs(re)&<(oe,{name:ee,select:x(ee,re),initiate:L(ee,re)},N(w,ee))}}}}),Rd=XS(lv());var dv=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,f=n.generatedAnswer.answerConfigurationId,m={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let p=ke(a,i);return{data:Sd({baseUrl:`${p}/rest/organizations/${a}/answer/v1/configs/${f}`,fetchFn:function(){var _ref24=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{g[v]=h[v]}),g.duplex="half",g.body=yield h.text(),A(S,g)});return function fetchFn(_x55){return _ref24.apply(this,arguments)}}()})(m,{...t,signal:null},r)}}catch(p){return{error:p}}});return function dv(_x52,_x53,_x54){return _ref23.apply(this,arguments)}}(),Ed=Rd({reducerPath:"answer",baseQuery:vd(dv,{maxRetries:3}),endpoints:()=>({})});var pv=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},fv=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},mv=(e,t)=>{e.citations=t.citations},gv=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},yv=(e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)},hv=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&yv(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(pv(t,o),r(Ja(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(fv(t,o),r(Ka({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(mv(t,o),r(Ya({citations:o.citations})));break;case"genqa.endOfStreamType":gv(t,o),r(_o(o.answerGenerated??!1));break}},Id=Ed.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x56,_x57){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:f,insightConfiguration:m}=r(),{organizationId:p,environment:y,accessToken:h}=a,S=ke(p,y),g=`${S}/rest/organizations/${p}/insight/v1/configs/${m?.insightId}/answer/${f.answerConfigurationId}/generate`,v=`${S}/rest/organizations/${p}/answer/v1/configs/${f.answerConfigurationId}/generate`;yield nd(m?g:v,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref25=_asyncToGenerator(function*(R){let k=R.headers.get("x-answer-id");k&&o(x=>{x.answerId=k})});return function onopen(_x58){return _ref25.apply(this,arguments)}}(),onmessage:R=>{o(k=>{hv(R,k,i)})},onerror:R=>{throw R},onclose:()=>{o(R=>{i(Xa(!R.generated))})}})}).apply(this,arguments)}})})}),Qj=pe(e=>kl(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o}));d();c();l();u();var kd=ge(sr,e=>e);d();c();l();u();function Sv(e){let t=e.payload?.analyticsAction;return Pd(e)&&!X(t)}function Pd(e){return"type"in e}var Fd=e=>t=>r=>{let n;Sv(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return Pd(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var lN=D("tab/register",e=>{let t=new K({values:{id:W,expression:we}});return Q(e,t)}),zo=D("tab/updateActiveTab",e=>Q(e,W));d();c();l();u();var Go=Qe(Vo(),1),Dd=Qe(Od(),1),qd=Qe(Td(),1);Go.default.extend(qd.default);Go.default.extend(Dd.default);var Md=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Go.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});d();c();l();u();var vv=/(^|; )Coveo-Pendragon=([^;]*)/;function Rs(){return typeof window>"u"?!1:vv.exec(document.cookie)?.pop()||null}var jd=ge(Md(),e=>e.addCase(at,(t,r)=>{bv(t,r.payload)}).addCase(Ye,(t,r)=>{Av(t,r.payload)}).addCase(cr,(t,r)=>{Cv(t,r.payload)}).addCase(ur,t=>{t.analytics.enabled=!1}).addCase(lr,t=>{t.analytics.enabled=!0}).addCase(oo,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(io,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(zo,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(bu,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ht,(t,r)=>{X(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function bv(e,t){X(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",X(t.organizationId)||(e.organizationId=t.organizationId)}function Av(e,t){X(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),X(t.locale)||(e.search.locale=t.locale),X(t.timezone)||(e.search.timezone=t.timezone),X(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function Cv(e,t){X(t.enabled)||(e.analytics.enabled=t.enabled),X(t.originContext)||(e.analytics.originContext=t.originContext),X(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),X(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),X(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),X(t.trackingId)||(e.analytics.trackingId=t.trackingId),X(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),X(t.source)||(e.analytics.source=t.source);try{let r=Rs();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}X(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),X(t.anonymous)||(e.analytics.anonymous=t.anonymous),X(t.deviceId)||(e.analytics.deviceId=t.deviceId),X(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),X(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var He=jd;d();c();l();u();function wv(e){return e.instantlyCallable}var Nd=()=>e=>t=>e(wv(t)?t():t);d();c();l();u();var _d=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error,i=[n.payload?.errorCode,n.payload?.message].filter(Boolean).join(" - ");if(n.payload?.ignored||e.error(i||o.stack||o.message||o.name||"Error",`Action dispatch error ${n.type}`,r),n.error.name!=="SchemaValidationError")return t(r)},Vd=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();function Ld(e,t){let r={...e},n,o=i=>(a,f)=>{let m=i(a,f);return n?n(m,f):m};return{get combinedReducer(){let i=mc(Object.entries(t).filter(([a])=>!(a in r)).map(([a,f])=>[a,()=>f]));return o(tr({...i,...r}))},containsAll(i){return Object.keys(i).every(f=>f in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function Wo(e,t,r){var n,o,i;t===void 0&&(t=50),r===void 0&&(r={});var a=(n=r.isImmediate)!=null&&n,f=(o=r.callback)!=null&&o,m=r.maxWait,p=Date.now(),y=[];function h(){if(m!==void 0){var g=Date.now()-p;if(g+t>=m)return m-g}return t}var S=function(){var g=[].slice.call(arguments),v=this;return new Promise(function(R,k){var x=a&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,p=Date.now(),!a){var w=e.apply(v,g);f&&f(w),y.forEach(function(E){return(0,E.resolve)(w)}),y=[]}},h()),x){var P=e.apply(v,g);return f&&f(P),R(P)}y.push({resolve:R,reject:k})})};return S.cancel=function(g){i!==void 0&&clearTimeout(i),y.forEach(function(v){return(0,v.reject)(g)}),y=[]},S}d();c();l();u();function xv(e){if(!e||!Rv(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Ud(e,t=60){if(!e)return!1;let r=xv(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function Rv(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Bd(e,t){let r=0,n=Wo(()=>{r=0},500);return o=>i=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(a){if(!(typeof a=="function"))return i(a);let m=typeof t=="function";if(m){let h=o.getState(),S=kv(h);if(S&&Ud(S)){e.debug("Access token is expired or about to expire, attempting renewal.");try{let g=yield t();g?(o.dispatch(at({accessToken:g})),e.debug("Access token was renewed.")):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(g){e.warn(g,"Access token renewal failed. A retry will occur if necessary.")}}}let p=yield i(a);if(!Ev(p))return p;if(!m)return e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),Qd(o,p.error),p;if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Qd(o,p.error),p;r++,n();let y=yield Iv(t);o.dispatch(at({accessToken:y})),o.dispatch(a)});return function(_x59){return _ref26.apply(this,arguments)}}())}function Ev(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new er().name}function Qd(e,t){e.dispatch(lo({status:401,statusCode:401,message:t.message,type:t.name}))}function Iv(_x60){return _Iv.apply(this,arguments)}function _Iv(){_Iv=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _Iv.apply(this,arguments)}function kv(e){return e.configuration.accessToken}d();c();l();u();function $d({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return ou({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Vd(n.logger))})}function Pv(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&fc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function Hd(e,t){let r={...e.reducers,configuration:He,version:kd},n=Fv({...e,reducers:r},t,He),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(at({accessToken:o,environment:i,organizationId:a}));let f=Pv(e.configuration,n.logger);return f&&n.dispatch(cr(f)),n}function Fv(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=Ld({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,f={...t,get relay(){return Sn(p.state,o)},get navigatorContext(){return za(this.relay,o)}},m=Ov(e,f,i),p={addReducers(y){i.containsAll(y)||(i.add(y),m.replaceReducer(i.combinedReducer))},dispatch:m.dispatch,subscribe:m.subscribe,enableAnalytics(){m.dispatch(lr())},disableAnalytics(){m.dispatch(ur())},get state(){return m.getState()},get relay(){return Sn(this.state,o)},get navigatorContext(){return za(this.relay,o)},logger:a,store:m};return p}function Ov(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=Tv(e,t.logger);return $d({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function Tv(e,t){let{renewAccessToken:r}=e.configuration,n=Bd(t,r);return[Nd,n,_d(t),Fd].concat(Id.middleware,e.middlewares||[])}d();c();l();u();var ep=Qe(Zd(),1);function tp(e){return(0,ep.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function rp(e,t){let r=Yv(e),n=Ve,o=Jv(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function Yv(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function Jv(e){return e.preprocessRequest||_n}d();c();l();u();d();c();l();u();var np={organizationId:W,accessToken:W,name:new H({required:!1,emptyAllowed:!1}),analytics:new K({options:{required:!1},values:{enabled:new ne({required:!1}),originContext:new H({required:!1}),originLevel2:new H({required:!1}),originLevel3:new H({required:!1}),analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new H({required:!1,url:!0}),trackingId:new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new H({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function op(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var ip=new Fe({...np,pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,locale:Ce,timezone:Ce});function Os(){return{...op(),searchHub:"default"}}var Xv={debug:uo,pipeline:fr,searchHub:Ir,recommendation:Rr};function ap(e){let t=tp(e.loggerOptions);Zv(e.configuration,t);let r=eb(e.configuration,t),n={...rp(e.configuration,t),apiClient:r},o={...e,reducers:Xv},i=Hd(o,n),{pipeline:a,searchHub:f,timezone:m,locale:p,proxyBaseUrl:y}=e.configuration;return i.dispatch(Ye({timezone:m,locale:p,proxyBaseUrl:y})),X(a)||i.dispatch(dr(a)),X(f)||i.dispatch(Er(f)),{...i,get state(){return i.state}}}function Zv(e,t){try{ip.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function eb(e,t){return new Un({logger:t,preprocessRequest:e.preprocessRequest||_n,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Oc,postprocessFacetSearchResponseMiddleware:Tc,postprocessQuerySuggestResponseMiddleware:Dc})}d();c();l();u();d();c();l();u();d();c();l();u();var tb=new ie({each:W,required:!0}),sp=(e,t)=>(Q(e,W),qn(t)?Q(t,W):Q(t,tb),{payload:{contextKey:e,contextValue:t}}),zt=D("context/set",e=>{for(let[t,r]of Object.entries(e))sp(t,r);return{payload:e}}),Gt=D("context/add",e=>sp(e.contextKey,e.contextValue)),Wt=D("context/remove",e=>Q(e,W));d();c();l();u();d();c();l();u();function Jo(){return{contextValues:{}}}var Xo=ge(Jo(),e=>{e.addCase(zt,(t,r)=>{t.contextValues=r.payload}).addCase(Gt,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Wt,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();function Et(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),f=t!==a;return t=a,f}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),f;return n()&&(t=JSON.stringify(this.state),f=e.subscribe(()=>{o(this.state)&&r.forEach(m=>m())})),r.set(a,i),()=>{r.delete(a),n()&&f?.()}},get state(){return{}}}}d();c();l();u();var rb=["caseId","caseNumber"],nb={caseId:"caseContext",caseNumber:"caseContext"},In=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${nb[t]} to set this value.}`)}};function Ts(e){return rb.includes(e)}var ob=new Fe({values:new K({options:{required:!1}})});function cp(e,t={}){if(!sb(e))throw ze;let r=Et(e),{dispatch:n}=e,o=()=>e.state,i=mu(e,ob,t.initialState,"buildContext");return i.values&&n(zt(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(zt(a))},...(o().configuration.analytics.analyticsMode==="legacy"?ib(n):ab(n))}}var ib=e=>({add(t,r){e(Gt({contextKey:t,contextValue:r}))},remove(t){e(Wt(t))}}),ab=e=>({add(t,r){if(Ts(t))throw new In(t);e(Gt({contextKey:t,contextValue:r}))},remove(t){if(Ts(t))throw new In(t);e(Wt(t))}});function sb(e){return e.addReducers({context:Xo}),!0}function up(e,t){return cp(e,t)}d();c();l();u();d();c();l();u();var qr=D("dictionaryFieldContext/set",e=>{let t=new K({options:{required:!0}}),r=Q(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:we}),i=Q(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Mr=D("dictionaryFieldContext/add",e=>{let t=new K({options:{required:!0},values:{field:we,key:we}});return Q(e,t)}),jr=D("dictionaryFieldContext/remove",e=>Q(e,we));d();c();l();u();d();c();l();u();function Zo(){return{contextValues:{}}}var ei=ge(Zo(),e=>{e.addCase(qr,(t,r)=>{t.contextValues=r.payload}).addCase(Mr,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(jr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function lp(e){if(!cb(e))throw ze;let t=Et(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(qr(o))},add(o,i){r(Mr({field:o,key:i}))},remove(o){r(jr(o))}}}function cb(e){return e.addReducers({dictionaryFieldContext:ei}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ti=D("breadcrumb/deselectAll"),dp=D("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();d();c();l();u();var kn={value:W,numberOfResults:new J({min:0}),state:W};d();c();l();u();var ue=W;var pb=new J({min:1,default:8,required:!1}),fb=new J({min:1,max:20,default:5,required:!1}),mb={desiredCount:fb,numberOfValues:pb},s1=D("automaticFacet/setOptions",e=>Q(e,mb)),c1=D("automaticFacet/deselectAll",e=>Q(e,ue)),gb=W,pp=D("automaticFacet/toggleSelectValue",e=>Q(e,{field:gb,selection:new K({values:kn})}));d();c();l();u();d();c();l();u();var yb={state:new fe({required:!0}),numberOfResults:new J({required:!0,min:0}),value:new H({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:W}),moreValuesAvailable:new ne({required:!1})};function Ds(e){e.children.forEach(t=>{Ds(t)}),Ve({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},yb)}var Nr={facetId:ue,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),delimitingCharacter:new H({required:!1,emptyAllowed:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),basePath:new ie({required:!1,each:W}),filterByBasePath:new ne({required:!1})};var E1=D("categoryFacet/register",e=>Q(e,Nr)),fp=D("categoryFacet/toggleSelectValue",e=>{try{return Ve(e.facetId,W),Ds(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),mp=D("categoryFacet/deselectAll",e=>Q(e,Nr.facetId)),I1=D("categoryFacet/updateNumberOfValues",e=>Q(e,{facetId:Nr.facetId,numberOfValues:Nr.numberOfValues})),k1=D("categoryFacet/updateSortCriterion",e=>Q(e,{facetId:Nr.facetId,criterion:new fe})),P1=D("categoryFacet/updateBasePath",e=>Q(e,{facetId:Nr.facetId,basePath:new ie({each:W})}));d();c();l();u();d();c();l();u();var Pn={facetId:ue,captions:new K({options:{required:!1}}),numberOfValues:new J({required:!1,min:1}),query:new H({required:!1,emptyAllowed:!0})};var hb={path:new ie({required:!0,each:W}),displayValue:we,rawValue:we,count:new J({required:!0,min:0})},gp=D("categoryFacet/selectSearchResult",e=>Q(e,{facetId:ue,value:new K({values:hb})})),G1=D("categoryFacetSearch/register",e=>Q(e,Pn));d();c();l();u();var yp={facetId:ue,value:new K({values:{displayValue:we,rawValue:we,count:new J({required:!0,min:0})}})},oQ=D("facetSearch/register",e=>Q(e,Pn)),iQ=D("facetSearch/update",e=>Q(e,Pn)),hp=D("facetSearch/toggleSelectValue",e=>Q(e,yp)),Sp=D("facetSearch/toggleExcludeValue",e=>Q(e,yp));d();c();l();u();d();c();l();u();var pQ=new H({regex:/^[a-zA-Z0-9-_]+$/}),fQ=new H({required:!0}),mQ=new ie({each:new H}),gQ=new H,yQ=new ne,hQ=new ne,SQ=new J({min:0}),Sb=new J({min:1}),vQ=new ne({required:!0}),vb=new K,bb=new H,Ab={captions:vb,numberOfValues:Sb,query:bb},bQ=new K({values:Ab}),vp=new K({options:{required:!1},values:{type:new H({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new H({emptyAllowed:!1,required:!0})})}}),AQ=new ne,bp=new ie({min:1,max:25,required:!1,each:new H({emptyAllowed:!1,required:!0})});var Cb={facetId:ue,field:new H({required:!0,emptyAllowed:!0}),tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),resultsMustMatch:new fe({required:!1}),allowedValues:vp,customSort:bp},DQ=D("facet/register",e=>Q(e,Cb)),Ap=D("facet/toggleSelectValue",e=>Q(e,{facetId:ue,selection:new K({values:kn})})),Cp=D("facet/toggleExcludeValue",e=>Q(e,{facetId:ue,selection:new K({values:kn})})),ri=D("facet/deselectAll",e=>Q(e,ue)),qQ=D("facet/updateSortCriterion",e=>Q(e,{facetId:ue,criterion:new fe({required:!0})})),MQ=D("facet/updateNumberOfValues",e=>Q(e,{facetId:ue,numberOfValues:new J({required:!0,min:1})})),jQ=D("facet/updateIsFieldExpanded",e=>Q(e,{facetId:ue,isFieldExpanded:new ne({required:!0})})),NQ=D("facet/updateFreezeCurrentValues",e=>Q(e,{facetId:ue,freezeCurrentValues:new ne({required:!0})}));d();c();l();u();d();c();l();u();function xp(e){let t=wp(e.start,e),r=wp(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function wp(e,t){let{dateFormat:r}=t;return Ll(e)?(as(e),Nl(e)):typeof e=="string"&&At(e)?(as(e),e):(Dl(e,r),Uo(Fr(e,r)))}d();c();l();u();var Rp=D("rangeFacet/updateSortCriterion",e=>Q(e,{facetId:ue,criterion:new fe({required:!0})}));d();c();l();u();var ni={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ne({required:!0}),numberOfResults:new J({required:!0,min:0})},oi={start:W,end:W,endInclusive:new ne({required:!0}),state:W,numberOfResults:new J({required:!0,min:0})};var wb={start:W,end:W,endInclusive:new ne({required:!0}),state:W},xb={facetId:ue,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:wb})}),generateAutomaticRanges:new ne({required:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function Ep(e){return At(e)?An(e):e}function Ip(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=xp(t);if(Fr(Ep(r)).isAfter(Fr(Ep(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var wB=D("dateFacet/register",e=>{try{return Ve(e,xb),Ip(e),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),kp=D("dateFacet/toggleSelectValue",e=>Q(e,{facetId:ue,selection:new K({values:oi})})),Pp=D("dateFacet/toggleExcludeValue",e=>Q(e,{facetId:ue,selection:new K({values:oi})})),Fp=D("dateFacet/updateFacetValues",e=>{try{return Ve(e,{facetId:ue,values:new ie({each:new K({values:oi})})}),Ip({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}});d();c();l();u();var Rb={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ne({required:!0})},Eb={facetId:ue,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:Rb})}),generateAutomaticRanges:new ne({required:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function Op(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var jB=D("numericFacet/register",e=>{try{return Q(e,Eb),Op(e),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}}),Tp=D("numericFacet/toggleSelectValue",e=>Q(e,{facetId:ue,selection:new K({values:ni})})),Dp=D("numericFacet/toggleExcludeValue",e=>Q(e,{facetId:ue,selection:new K({values:ni})})),qp=D("numericFacet/updateFacetValues",e=>{try{return Ve(e,{facetId:ue,values:new ie({each:new K({values:ni})})}),Op({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:it(t)}}});d();c();l();u();d();c();l();u();var Mp=D("facet/updateFacetAutoSelection",e=>Q(e,{allow:new ne({required:!0})}));d();c();l();u();d();c();l();u();var ii=class extends vt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Ne().q}get responseTime(){return this.activeInstantResultCache?.duration??Ge().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Ge().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var jp=()=>Me("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new ii(e)),Np=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var qs={id:W},Ib={...qs,q:we},g$=D("instantResults/register",e=>Q(e,qs)),ai=D("instantResults/updateQuery",e=>Q(e,Ib)),y$=D("instantResults/clearExpired",e=>Q(e,qs));d();c();l();u();var si=new J({required:!0,min:0}),ci=D("pagination/registerNumberOfResults",e=>Q(e,si)),ui=D("pagination/updateNumberOfResults",e=>Q(e,si)),li=D("pagination/registerPage",e=>Q(e,si)),_r=D("pagination/updatePage",e=>Q(e,si)),di=D("pagination/nextPage"),pi=D("pagination/previousPage");d();c();l();u();var Vr=D("query/updateQuery",e=>Q(e,{q:new H,enableQuerySyntax:new ne}));d();c();l();u();var Lr=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ft(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Ga(e.configuration.analytics,t,r)),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();var It=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ft(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Xe.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield qo(e.configuration.analytics,t))),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function It(_x61,_x62){return _ref27.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var kt=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var Ms=()=>Me("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Pt=e=>Me("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ne().q,aq:r.advancedSearchQueries?.aq||kt().aq,cq:r.advancedSearchQueries?.cq||kt().cq,dq:r.advancedSearchQueries?.dq||kt().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var hH=D("didYouMean/enable"),SH=D("didYouMean/disable"),vH=D("didYouMean/automaticCorrections/disable"),bH=D("didYouMean/automaticCorrections/enable"),fi=D("didYouMean/correction",e=>Q(e,W)),AH=D("didYouMean/automaticCorrections/mode",e=>Q(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var js=()=>Me("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var _p=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Vp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Lp(){return[]}d();c();l();u();function Fn(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Up(){return{}}d();c();l();u();function Qp(){return{}}d();c();l();u();function Bp(){return{}}function et(e){return{context:e.context||Jo(),dictionaryFieldContext:e.dictionaryFieldContext||Zo(),facetSet:e.facetSet||To(),numericFacetSet:e.numericFacetSet||Oo(),dateFacetSet:e.dateFacetSet||Fo(),categoryFacetSet:e.categoryFacetSet||Po(),automaticFacetSet:e.automaticFacetSet??ko(),pagination:e.pagination||Fn(),query:e.query||Ne(),tabSet:e.tabSet||Bp(),advancedSearchQueries:e.advancedSearchQueries||kt(),staticFilterSet:e.staticFilterSet||Qp(),querySet:e.querySet||Up(),sortCriteria:e.sortCriteria||Do(),pipeline:e.pipeline||pr(),searchHub:e.searchHub||Cr(),facetOptions:e.facetOptions||Vp(),facetOrder:e.facetOrder??Lp(),debug:e.debug??co()}}d();c();l();u();var Nz=new K({values:{undoneQuery:we},options:{required:!0}}),$p=()=>Me("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var mi=D("trigger/query/ignore",e=>Q(e,new H({emptyAllowed:!0,required:!0}))),gi=D("trigger/query/modification",e=>Q(e,new K({values:{originalQuery:Ce,modification:Ce}})));d();c();l();u();var Ft=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=Fb(e),n=ls(e),o=kb(e),i=yield It(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Ct({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ft(_x63,_x64){return _ref28.apply(this,arguments)}}();function kb(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Pb).filter(r=>r.currentValues.length>0):void 0}function Pb(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function Fb(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Ob(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function Ob(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Ot=class{constructor(t,r=n=>{this.dispatch(Vr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x65,_x66){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Qo(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,f=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:f,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(Pt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:f,queryCorrection:m}=n;if(!o||!i)return null;let p=a.length===0&&f&&f.length!==0,y=!X(m)&&!X(m.correctedQuery);if(!p&&!y)return null;let S=p?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(Je(et(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this13.dispatch(Pt(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(Je(et(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:js()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:js()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(f=>f.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(mi("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this14.dispatch(Pt(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(Je(et(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:$p()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ne().enableQuerySyntax},search:{...Ge(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Je(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Qn(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Ft(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(fi(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(gi({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Ft(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var N2=de("search/executeSearch",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=t.getState();return yield yi(r,t,e)});return function(_x67,_x68){return _ref29.apply(this,arguments)}}()),_2=de("search/fetchPage",/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=t.getState();return yield _s(r,t,e)});return function(_x69,_x70){return _ref30.apply(this,arguments)}}()),V2=de("search/fetchMoreResults",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Vs(t,r)});return function(_x71,_x72){return _ref31.apply(this,arguments)}}()),L2=de("search/fetchFacetValues",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Mb(t,e,r)});return function(_x73,_x74){return _ref32.apply(this,arguments)}}()),U2=de("search/fetchInstantResults",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){return Ns(e,t)});return function(_x75,_x76){return _ref33.apply(this,arguments)}}()),Tb=/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=yield Ft(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function Tb(_x77,_x78){return _ref34.apply(this,arguments)}}(),Db=/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t,r){let n=yield It(e);return Ct({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function Db(_x79,_x80,_x81){return _ref35.apply(this,arguments)}}(),qb=/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=yield Ft(e,t);return r.request.numberOfResults=0,r});return function qb(_x82,_x83){return _ref36.apply(this,arguments)}}(),Hp=e=>{e.configuration.analytics.enabled&&Xe.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Ns(_x84,_x85){return _Ns.apply(this,arguments)}function _Ns(){_Ns=_asyncToGenerator(function*(e,t){Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Ot({...t,analyticsAction:jp()},p=>{t.dispatch(ai({q:p,id:e.id}))}),a=yield Db(o,r,n),f=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),m=yield i.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,analyticsAction:m.analyticsAction,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return _Ns.apply(this,arguments)}function _s(_x86,_x87,_x88){return _s2.apply(this,arguments)}function _s2(){_s2=_asyncToGenerator(function*(e,t,r){Hp(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=new Ot({...t,analyticsAction:r}),m=yield Ft(e,a),p=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(p)});return _s2.apply(this,arguments)}function Vs(_x89,_x90){return _Vs.apply(this,arguments)}function _Vs(){_Vs=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Ms().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Ot({...e,analyticsAction:Ms()}),f=yield Tb(t,i),m=yield a.fetchFromAPI(f,{origin:"mainSearch"});return yield a.process(m)});return _Vs.apply(this,arguments)}function Mb(_x91,_x92,_x93){return _Mb.apply(this,arguments)}function _Mb(){_Mb=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=new Ot({...e,analyticsAction:t}),m=yield qb(r,a),p=yield f.fetchFromAPI(m,{origin:"facetValues"});return yield f.process(p)});return _Mb.apply(this,arguments)}function yi(_x94,_x95,_x96){return _yi.apply(this,arguments)}function _yi(){_yi=_asyncToGenerator(function*(e,t,r){Hp(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i});a?.actionCause&&t.dispatch(Ls({actionCause:a.actionCause}));let f=yield Ft(e,a),m=new Ot({...t,analyticsAction:r}),p=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(p)});return _yi.apply(this,arguments)}d();c();l();u();d();c();l();u();var Tt=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t,r){let n=Qb(e),o=jb(e),i=Nb(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield It(e,r):Lr(e,t,r),f=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Ct({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:f(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Tt(_x97,_x98,_x99){return _ref37.apply(this,arguments)}}();function jb(e){return cs(Vb(e),e.facetOrder??[])}function Nb(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(_b).filter(r=>r.currentValues.length>0):void 0}function _b(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function Vb(e){return Lb(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Lb(e){return[...Ub(e.facetSet??{}),...zp(e.numericFacetSet??{}),...zp(e.dateFacetSet??{}),...wt(e.categoryFacetSet??{})]}function Ub(e){return wt(e).map(t=>{let r=us[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function zp(e){return wt(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function Qb(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=ss(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}var Dt=class{constructor(t,r=n=>{this.dispatch(Vr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x100,_x101){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Qo(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,f=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:f,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(Pt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:f,queryCorrection:m}=n;if(!o||!i)return null;let p=a.length===0&&f&&f.length!==0,y=!X(m)&&!X(m.correctedQuery);if(!p&&!y)return null;let S=p?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(Je(et(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this20.dispatch(Pt(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(Je(et(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(f=>f.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(mi("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this21.dispatch(Pt(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(Je(et(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Je(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Qn(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=_p(),o=yield _this22.fetchFromAPI(yield Tt(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(fi(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(gi({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Tt(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var _G=de("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;Q(e,{q:new H,enableQuerySyntax:new ne,clearFilters:new ne}),e.clearFilters&&(r(ti()),r(dp())),r(Mp({allow:!0})),r(Vr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(_r(1))}),Ls=D("search/updateSearchAction"),Gp=de("search/executeSearch",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return yi(r,t,e.legacy);Wp(r);let n=e.next?Kp(e.next):void 0;t.dispatch(Ls(e.next));let o=yield Tt(r,t.extra.navigatorContext,n),i=new Dt({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x102,_x103){return _ref38.apply(this,arguments)}}()),VG=de("search/fetchPage",/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){let r=t.getState();if(Wp(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return _s(r,t,e.legacy);let n=new Dt({...t,analyticsAction:e.next}),o=yield Tt(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x104,_x105){return _ref39.apply(this,arguments)}}()),LG=de("search/fetchMoreResults",/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Vs(t,r);let n=hl("browseResults",t.getState),o=new Dt({...t,analyticsAction:n}),i=yield Bb(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x106,_x107){return _ref40.apply(this,arguments)}}()),UG=de("search/fetchFacetValues",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return yi(r,t,e.legacy);let n=new Dt({...t,analyticsAction:{}}),o=yield Hb(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x108,_x109){return _ref41.apply(this,arguments)}}()),QG=de("search/fetchInstantResults",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ns(e,t);Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:n,maxResultsPerQuery:o}=e,i=Kp(Np()),a=yield $b(r,t.extra.navigatorContext,n,o,i),f=new Dt({...t,analyticsAction:i},y=>{t.dispatch(ai({q:y,id:e.id}))}),m=yield f.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),p=yield f.process(m);return"response"in p?{results:p.response.results,searchUid:p.response.searchUid,totalCountFiltered:p.response.totalCountFiltered,duration:p.duration}:p});return function(_x110,_x111){return _ref42.apply(this,arguments)}}()),Bb=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t,r){let n=yield Tt(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function Bb(_x112,_x113,_x114){return _ref43.apply(this,arguments)}}(),$b=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t,r,n,o){let i=Lr(e,t,o);return Ct({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function $b(_x115,_x116,_x117,_x118,_x119){return _ref44.apply(this,arguments)}}(),Hb=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t,r){let n=yield Tt(e,t,r);return n.request.numberOfResults=0,n});return function Hb(_x120,_x121,_x122){return _ref45.apply(this,arguments)}}(),Wp=e=>{e.configuration.analytics.enabled&&Xe.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Kp=e=>({actionCause:e.actionCause,type:e.actionCause});var Yp=ge(Fn(),e=>{e.addCase(ci,(t,r)=>{let n=Us(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=On(n,o)}).addCase(ui,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(zo,t=>{t.firstResult=0}).addCase(li,(t,r)=>{let n=r.payload;t.firstResult=On(n,t.numberOfResults)}).addCase(_r,(t,r)=>{let n=r.payload;t.firstResult=On(n,t.numberOfResults)}).addCase(pi,t=>{let r=Us(t),n=Math.max(r-1,1);t.firstResult=On(n,t.numberOfResults)}).addCase(di,t=>{let r=Us(t),n=Gb(t),o=Math.min(r+1,n);t.firstResult=On(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(ht,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Gp.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(ri,t=>{Ie(t)}).addCase(Pp,t=>{Ie(t)}).addCase(Cp,t=>{Ie(t)}).addCase(Dp,t=>{Ie(t)}).addCase(Sp,t=>{Ie(t)}).addCase(Ap,t=>{Ie(t)}).addCase(mp,t=>{Ie(t)}).addCase(fp,t=>{Ie(t)}).addCase(gp,t=>{Ie(t)}).addCase(kp,t=>{Ie(t)}).addCase(Tp,t=>{Ie(t)}).addCase(ti,t=>{Ie(t)}).addCase(Fp,t=>{Ie(t)}).addCase(qp,t=>{Ie(t)}).addCase(hp,t=>{Ie(t)}).addCase(pp,t=>{Ie(t)})});function Ie(e){e.firstResult=Fn().firstResult}function Us(e){let{firstResult:t,numberOfResults:r}=e;return Wb(t,r)}function Gb(e){let{totalCountFiltered:t,numberOfResults:r}=e;return Kb(t,r)}function On(e,t){return(e-1)*t}function Wb(e,t){return Math.round(e/t)+1}function Kb(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Qs(e){return e.addReducers({pagination:Yp}),{nextPage:di,previousPage:pi,registerNumberOfResults:ci,registerPage:li,updateNumberOfResults:ui,updatePage:_r}}var Yb=new Fe({id:new H({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new J({min:0})});function Jp(e,t={}){if(!Jb(e))throw ze;let r=Et(e),{dispatch:n}=e,o=()=>e.state,i=gu(e,Yb,t.options,"buildRecommendationList");return i.id!==""&&n(xr({id:i.id})),i.numberOfRecommendations&&n(Qs(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(bt())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function Jb(e){return e.addReducers({recommendation:Rr,configuration:He}),!0}d();c();l();u();d();c();l();u();function Xp(e,t,r){if(!Xb(e))throw ze;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Wo(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function Xb(e){return e.addReducers({configuration:He}),!0}function Zp(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(No(t.options.result)))};return Xp(e,t,()=>{n()})}d();c();l();u();d();c();l();u();d();c();l();u();var qt=()=>new H({required:!1,emptyAllowed:!0}),hi=D("advancedSearchQueries/update",e=>Q(e,{aq:qt(),cq:qt(),lq:qt(),dq:qt()})),Si=D("advancedSearchQueries/register",e=>Q(e,{aq:qt(),cq:qt(),lq:qt(),dq:qt()}));var ef=ge(kt(),e=>{e.addCase(hi,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0),ve(i)||(t.lq=i,t.lqWasSet=!0),ve(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(Si,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ve(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ve(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ve(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(ht,(t,r)=>{let{aq:n,cq:o}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0)})});function Zb(e){return e.addReducers({advancedSearchQueries:ef}),{updateAdvancedSearchQueries:hi,registerAdvancedSearchQueries:Si}}d();c();l();u();function eA(e){return e.addReducers({configuration:He}),{disableAnalytics:ur,enableAnalytics:lr,setOriginLevel2:oo,setOriginLevel3:io,updateAnalyticsConfiguration:cr,updateBasicConfiguration:at}}d();c();l();u();function tA(e){return e.addReducers({configuration:He,pipeline:fr,searchHub:Ir}),{updateSearchConfiguration:Ye}}d();c();l();u();function rA(e){return e.addReducers({context:Xo}),{addContext:Gt,removeContext:Wt,setContext:zt}}d();c();l();u();function nA(e){return e.addReducers({debug:uo}),{disableDebug:so,enableDebug:ao}}d();c();l();u();function oA(e){return e.addReducers({dictionaryFieldContext:ei}),{addContext:Mr,removeContext:jr,setContext:qr}}d();c();l();u();d();c();l();u();d();c();l();u();var iA={collectionField:new H({emptyAllowed:!1,required:!1}),parentField:new H({emptyAllowed:!1,required:!1}),childField:new H({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new J({min:0,required:!1})},tf=D("folding/register",e=>Q(e,iA)),dK=de("folding/loadCollection",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield It(i):Lr(i,o),f=yield n.search({...a,q:aA(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Oe(f)?r(f.error):{collectionId:e,results:f.success.results,searchUid:f.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x123,_x124){return _ref46.apply(this,arguments)}}());function aA(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var rf=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});d();c();l();u();var Ur=D("fields/registerFieldsToInclude",e=>Q(e,no)),vi=D("fields/fetchall/enable"),bi=D("fields/fetchall/disable"),Ai=de("fields/fetchDescription",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:f}=o.configuration,{apiBaseUrl:m}=o.configuration.search,p=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:f,url:m??ft(f,a)});return Oe(p)?n(p.error):p.success.fields});return function(_x125,_x126){return _ref47.apply(this,arguments)}}());d();c();l();u();var Ci=["author","language","urihash","objecttype","collection","source","permanentid"],Bs=[...Ci,"date","filetype","parents"],nf=[...Bs,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],of=()=>({fieldsToInclude:Ci,fetchAllFields:!1,fieldsDescription:[]});var wi=ge(of(),e=>e.addCase(Ur,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(vi,t=>{t.fetchAllFields=!0}).addCase(bi,t=>{t.fetchAllFields=!1}).addCase(Ai.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(tf,(t,{payload:r})=>{let n=rf().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function sA(e){return e.addReducers({fields:wi}),{registerFieldsToInclude:Ur,enableFetchAllFields:vi,disableFetchAllFields:bi,fetchFieldsDescription:Ai}}d();c();l();u();function cA(e){return e.addReducers({pipeline:fr}),{setPipeline:dr}}d();c();l();u();function uA(e){return e.addReducers({recommendation:Rr}),{getRecommendations:bt,setRecommendationId:xr}}d();c();l();u();function lA(e){return e.addReducers({}),{logRecommendationOpen:No}}d();c();l();u();d();c();l();u();var dA=new Fe({content:new fe({required:!0}),conditions:new fe({required:!0}),priority:new J({required:!1,default:0,min:0}),fields:new ie({required:!1,each:W})});function af(){let e=[],t=r=>{let n=dA.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new Wr("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function sf(e){if(!pA(e))throw ze;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=af();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Ur(i))},selectTemplate:r,selectLinkTemplate:n}}function pA(e){return e.addReducers({fields:wi}),!0}d();c();l();u();function fA(e){return e.addReducers({searchHub:Ir}),{setSearchHub:Er}}/**
|
|
30
|
+
`;function rh(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var nh=["1",1,"yes",!0];function wo(){let e=[];return ba()&&e.push(window.doNotTrack),Da()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>nh.indexOf(t)!==-1)}var Ju="v15",Xu={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function oh(e=Xu.default,t=Ju,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var ih="38824e1f-37f5-42d3-8372-a4b8fa9df946",Ze=class{get defaultOptions(){return{endpoint:Xu.default,isCustomEndpoint:!1,token:"",version:Ju,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Gu}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[Gg,Qg].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};wo()?this.runtime=new Co:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ae.view,{newEventType:ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(ae.click,{newEventType:ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(ae.custom,{newEventType:ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ae.search,{newEventType:ae.search,addClientIdParameter:!0})}initRuntime(t){return ba()&&hr()?new Oa(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(rh()&&console.warn(th),new Ta(t))}get storage(){return this.runtime.storage}determineVisitorId(){return q(this,void 0,void 0,function*(){try{return ba()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||$t()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),$t()}})}getCurrentVisitorId(){return q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return q(this,void 0,void 0,function*(){if(So(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(qu(t,qu(r,ih)))}})}getParameters(t,...r){return q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId($t()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(wo())return null;try{let r=new URL(t).searchParams.get(vt.cvo_cid);if(r==null)return null;let n=vt.fromString(r);return!n||!hr()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>q(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((v,R)=>q(this,void 0,void 0,function*(){let k=yield v;return yield R(t,k)}),g)].reduce((g,v)=>q(this,void 0,void 0,function*(){let R=yield g;return yield v(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[h=>this.setTrackingIdIfTrackingIdNotPresent(h),h=>this.removeEmptyPayloadValues(h,t),h=>this.validateParams(h,t),h=>n?Hy(h):h,h=>n?this.removeUnknownParameters(h):h,h=>n?this.processCustomParameters(h):this.mapCustomParametersToCustomData(h)].reduce((h,S)=>q(this,void 0,void 0,function*(){let g=yield h;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(f=>f(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new ho().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.search,t)})}sendSearchEvent(t){var{searchQueryUid:r}=t,n=ct(t,["searchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.click,t)})}sendClickEvent(t){var{searchQueryUid:r}=t,n=ct(t,["searchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.custom,t)})}sendCustomEvent(t){var{lastSearchQueryUid:r}=t,n=ct(t,["lastSearchQueryUid"]);return q(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return q(this,void 0,void 0,function*(){return this.makeEvent(ae.view,t)})}sendViewEvent(t){return q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return q(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return q(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Ky(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=ct(t,["custom"]),o={};r&&yo(r)&&(o=this.lowercaseKeys(r));let i=Yy(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=ct(t,["custom"]);if(r&&yo(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=ct(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ae.view||r==ae.click||r==ae.search||r==ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=ct(t,["userId"]);return eh(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=ct(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&yo(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&yo(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?cy(t,r):t}get baseUrl(){return oh(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},ut;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(ut||(ut={}));var j;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick"})(j||(j={}));var Uu={[j.triggerNotify]:"queryPipelineTriggers",[j.triggerExecute]:"queryPipelineTriggers",[j.triggerQuery]:"queryPipelineTriggers",[j.triggerRedirect]:"queryPipelineTriggers",[j.queryError]:"errors",[j.queryErrorBack]:"errors",[j.queryErrorClear]:"errors",[j.queryErrorRetry]:"errors",[j.pagerNext]:"getMoreResults",[j.pagerPrevious]:"getMoreResults",[j.pagerNumber]:"getMoreResults",[j.pagerResize]:"getMoreResults",[j.pagerScrolling]:"getMoreResults",[j.facetSearch]:"facet",[j.facetShowLess]:"facet",[j.facetShowMore]:"facet",[j.recommendation]:"recommendation",[j.likeSmartSnippet]:"smartSnippet",[j.dislikeSmartSnippet]:"smartSnippet",[j.expandSmartSnippet]:"smartSnippet",[j.collapseSmartSnippet]:"smartSnippet",[j.openSmartSnippetFeedbackModal]:"smartSnippet",[j.closeSmartSnippetFeedbackModal]:"smartSnippet",[j.sendSmartSnippetReason]:"smartSnippet",[j.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[j.clearRecentQueries]:"recentQueries",[j.recentResultClick]:"recentlyClickedDocuments",[j.clearRecentResults]:"recentlyClickedDocuments",[j.showLessFoldedResults]:"folding",[j.caseDetach]:"case",[j.likeGeneratedAnswer]:"generatedAnswer",[j.dislikeGeneratedAnswer]:"generatedAnswer",[j.openGeneratedAnswerSource]:"generatedAnswer",[j.generatedAnswerStreamEnd]:"generatedAnswer",[j.generatedAnswerSourceHover]:"generatedAnswer",[j.generatedAnswerCopyToClipboard]:"generatedAnswer",[j.generatedAnswerHideAnswers]:"generatedAnswer",[j.generatedAnswerShowAnswers]:"generatedAnswer",[j.generatedAnswerExpand]:"generatedAnswer",[j.generatedAnswerCollapse]:"generatedAnswer",[j.generatedAnswerFeedbackSubmit]:"generatedAnswer",[j.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[ut.expandToFullUI]:"interface",[ut.openUserActions]:"User Actions",[ut.showPrecedingSessions]:"User Actions",[ut.showFollowingSessions]:"User Actions",[ut.clickViewedDocument]:"User Actions",[ut.clickPageView]:"User Actions",[ut.createArticle]:"createArticle"},br=class{constructor(){this.runtime=new Co,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Gu}};function ah(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function sh(e){return e.map(t=>t.replace(/;/g,""))}function Zu(e){let r=e.join(";");return r.length<=256?r:Zu(e.slice(1))}var Qu=e=>{let t=sh(e),r=ah(t);return Zu(r)};function Bu(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Qu(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Qu(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var xo=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||wo();this.coveoAnalyticsClient=n?new br:new Ze(t)}disable(){this.coveoAnalyticsClient=new br}enable(){this.coveoAnalyticsClient=new Ze(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(j.interfaceLoad)}logInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(j.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(j.recommendation)}logRecommendation(){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(j.recommendationOpen,t,r)}logRecommendationOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(j.staticFilterClearAll,t)}logStaticFilterClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(j.staticFilterSelect,t)}logStaticFilterSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(j.staticFilterDeselect,t)}logStaticFilterDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(j.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(j.interfaceChange,t)}logInterfaceChange(t){return q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(j.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(j.didyoumeanClick)}logDidYouMeanClick(){return q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(j.resultsSort,t)}logResultsSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(j.searchboxSubmit)}logSearchboxSubmit(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(j.searchboxClear)}logSearchboxClear(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(j.searchboxAsYouType)}logSearchboxAsYouType(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(j.breadcrumbFacet,t)}logBreadcrumbFacet(t){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(j.breadcrumbResetAll)}logBreadcrumbResetAll(){return q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(j.documentQuickview,t,r)}logDocumentQuickview(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(j.documentOpen,t,r)}logDocumentOpen(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(j.omniboxAnalytics,Bu(t))}logOmniboxAnalytics(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(j.omniboxFromLink,Bu(t))}logOmniboxFromLink(t){return q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(j.searchFromLink)}logSearchFromLink(){return q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(j.triggerNotify,t)}logTriggerNotify(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(j.triggerExecute,t)}logTriggerExecute(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(j.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(j.undoTriggerQuery,t)}logUndoTriggerQuery(t){return q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(j.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(j.pagerResize,t)}logPagerResize(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(j.pagerNumber,t)}logPagerNumber(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(j.pagerNext,t)}logPagerNext(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(j.pagerPrevious,t)}logPagerPrevious(t){return q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(j.pagerScrolling)}logPagerScrolling(){return q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(j.facetClearAll,t)}logFacetClearAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(j.facetSearch,t)}logFacetSearch(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(j.facetSelect,t)}logFacetSelect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(j.facetDeselect,t)}logFacetDeselect(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(j.facetExclude,t)}logFacetExclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(j.facetUnexclude,t)}logFacetUnexclude(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(j.facetSelectAll,t)}logFacetSelectAll(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(j.facetUpdateSort,t)}logFacetUpdateSort(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(j.facetShowMore,t)}logFacetShowMore(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(j.facetShowLess,t)}logFacetShowLess(t){return q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(j.queryError,t)}logQueryError(t){return q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorBack);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorBack)})}})}logQueryErrorBack(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorRetry);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorRetry)})}})}logQueryErrorRetry(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(j.queryErrorClear);return{description:t.description,log:()=>q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(j.queryErrorClear)})}})}logQueryErrorClear(){return q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(j.likeSmartSnippet)}logLikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(j.dislikeSmartSnippet)}logDislikeSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(j.expandSmartSnippet)}logExpandSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(j.collapseSmartSnippet)}logCollapseSmartSnippet(){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(j.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(j.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(j.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(j.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(j.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(j.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(j.copyToClipboard,t,r)}logCopyToClipboard(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(j.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(j.recentQueryClick)}logRecentQueryClick(){return q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(j.clearRecentQueries)}logClearRecentQueries(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(j.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(j.clearRecentResults)}logClearRecentResults(){return q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(j.noResultsBack)}logNoResultsBack(){return q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(j.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(j.showLessFoldedResults)}logShowLessFoldedResults(){return q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r,n=Uu[t]){return q(this,void 0,void 0,function*(){this.coveoAnalyticsClient.getParameters;let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:n,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({lastSearchQueryUid:f})}})}logCustomEvent(t,r,n=Uu[t]){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEvent(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({lastSearchQueryUid:f})}})}logCustomEventWithType(t,r,n){return q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:f})=>a.log({searchQueryUid:f})}})}logClickEvent(t,r,n,o){return q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){var n,o;return q(this,void 0,void 0,function*(){return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(j.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(j.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(j.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(j.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(j.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(j.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(j.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(j.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(j.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(j.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(j.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(j.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(j.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(j.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Ro=Object.assign({},dn),$u=Object.keys(Ro).map(e=>Ro[e]),Sr=class extends wa{constructor({client:t,uuidGenerator:r=$t}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>$u.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>($u.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Ro.pageview,{newEventType:ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Ro.event,{newEventType:ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return fy(this.ticket)}};Sr.Id="svc";var Eo;(function(e){e.click="click",e.flowStart="flowStart"})(Eo||(Eo={}));var Le;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(Le||(Le={}));var Io;(function(e){e.quit="Quit",e.solved="Solved"})(Io||(Io={}));var ko=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!wo();this.coveoAnalyticsClient=o?new Ze(t):new br,this.svc=new Sr({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new br,this.svc=new Sr({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Ze(this.options),this.svc=new Sr({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Le.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Le.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Le.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Le.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Le.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Le.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Le.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Le.caseCancelled,{reason:Io.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Le.caseSolved,{reason:Io.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Le.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Eo.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Eo.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){var r,n;return q(this,void 0,void 0,function*(){let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Ze?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){var i,a;return q(this,void 0,void 0,function*(){let f=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(f)})}};var el=e=>new Ze(e).getCurrentVisitorId(),mn=(e,t)=>typeof t=="function"?(...r)=>{let n=Kr(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,gn=(e,t)=>(...r)=>{let n=Kr(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Po(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();d();c();l();u();function tl(e){let{activeValue:t,ancestryMap:r}=ch(e);return t?uh(t,r):[]}function ch(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function uh(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var lh=(e,t)=>e.categoryFacetSet[t]?.request;var Ma=(e,t)=>{let r=lh(e,t);return tl(r?.currentValues??[])};d();c();l();u();function Fo(){return{}}d();c();l();u();function Oo(){return{}}d();c();l();u();function To(){return{}}d();c();l();u();function Do(){return{}}function Na(e){return{facetSet:e.facetSet??Do(),categoryFacetSet:e.categoryFacetSet??Fo(),dateFacetSet:e.dateFacetSet??Oo(),numericFacetSet:e.numericFacetSet??To(),automaticFacetSet:e.automaticFacetSet??Po()}}var _a=e=>{let t=[];return fh(e).forEach((r,n)=>{let o=Ah(e,r.facetId),i=vh(r,n+1);if(ph(r)){if(!!!Ma(e,r.facetId).length)return;t.push({...i,...hh(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,f)=>{if(a.state==="idle")return;let m=rl(a,f+1,o),p=dh(r)?nl(a):gh(a);t.push({...i,...m,...p})})}),mh(e).forEach((r,n)=>{let o=Sh(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let f=rl(i,a+1,"specific"),m=nl(i);t.push({...o,...f,...m})})}),t},dh=e=>e.type==="specific",ph=e=>e.type==="hierarchical",fh=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),mh=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),rl=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),gh=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),nl=e=>({displayValue:e.value,value:e.value}),yh=(e,t)=>Ma(e,t).map(n=>n.value).join(";"),hh=(e,t)=>{let n=yh(e,t);return{value:n,valuePosition:1,displayValue:n}},Sh=(e,t)=>({title:ol(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),vh=(e,t)=>({title:ol(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),ol=(e,t)=>`${e}_${t}`,bh=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Ah=(e,t)=>{let r=bh(e,t);return r?r.type:"specific"};d();c();l();u();var Ar=e=>{if(Ch(e)){let t=Object.values(e.answer.queries).pop()?.data;return typeof t=="object"&&t!==null&&"answerId"in t?t.answerId:void 0}if(wh(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},Ch=e=>"answer"in e&&"generatedAnswer"in e&&!X(e.generatedAnswer?.answerConfigurationId),wh=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",il=e=>e.generatedAnswer?.fieldsToIncludeInCitations,xh=pe(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var Ne=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();var al=(r=>(r.Ascending="ascending",r.Descending="descending",r))(al||{}),sl=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(sl||{}),Va=e=>{if(hc(e))return e.map(t=>Va(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},cl=()=>({by:"relevancy"});var PP=new K({values:{by:new Vi({enum:sl,required:!0}),order:new Vi({enum:al}),field:new H}});function qo(){return Va(cl())}d();c();l();u();d();c();l();u();var Cr=()=>"default";var Rh=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},lt=class{constructor(t){this.getState=t;de(this,"state");this.state=t()}getLanguage(){return Rh(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let f=`context_${i}`;o[f]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=sr),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Cr()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var yn=class yn extends lt{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return _a(Na(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||yn.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||Ge().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||yn.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ar(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??qo()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(p=>p.expression),a=o.partialQueries.length-1,f=o.partialQueries[a]||"",m=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:f,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:m}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||Ne().q}get responseTime(){return this.state.search?.duration||Ge().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Ge().response.totalCountFiltered}};de(yn,"fallbackPipelineName","default");var bt=yn,ul=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new xo({token:a,endpoint:f,runtimeEnvironment:m,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:f,token:a},"Analytics request"),S)]},o);return p||y.disable(),y},La=()=>{let t=Xe.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var jo=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield el(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(La()&&{pageId:La()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:yr(e)})}}});return function jo(_x9,_x0){return _ref7.apply(this,arguments)}}();d();c();l();u();d();c();l();u();d();c();l();u();var wr=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var hn=class extends lt{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ne().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||wr().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||wr().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||wr().recommendations.length}};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ll=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Eh(e){return typeof e=="string"&&ll.test(e)}var Ua=Eh;d();c();l();u();var Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function dl(e,t=0){return(Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]).toLowerCase()}d();c();l();u();var Qa,Ih=new Uint8Array(16);function Ba(){if(!Qa){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Qa=crypto.getRandomValues.bind(crypto)}return Qa(Ih)}d();c();l();u();d();c();l();u();var kh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$a={randomUUID:kh};function Ph(e,t,r){if($a.randomUUID&&!t&&!e)return $a.randomUUID();e=e||{};let n=e.random??e.rng?.()??Ba();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return dl(n)}var Ha=Ph;d();c();l();u();function pl(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function Fh({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;a!=="disabled"&&(n.call(r),t.send(o,i,r))}var fl="visitorId";function Oh(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(fl),o=n&&Ua(n)?n:t.generateUUID();return r.setItem(fl,o),o}}}var Sl="1.2.6",za=128,vl=192,ml=224,gl=240,Th=248;function Dh(e){return(e&Th)===gl?4:(e&gl)===ml?3:(e&ml)===vl?2:1}function qh(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&za)!=za)break;if(r-=3,(n&vl)!=za){t-r>=Dh(n)*3&&(r=t);break}}return e.substring(0,r)}function jh(e){let{trackingId:t}=e;return{trackingId:t}}function Mh(e){return(e.source||[]).concat([`relay@${Sl}`])}function bl(e,t,r,n){let{getReferrer:o,getLocation:i,getUserAgent:a}=r,f=jh(t),m=n.getClientId();return Object.freeze({type:e,config:f,ts:Date.now(),source:Mh(t),clientId:m,userAgent:a(),referrer:yl(o()),location:yl(i())})}function yl(e){return e!==null?qh(e,1024):null}function Nh(e,t,r,n,o){return{...t,meta:bl(e,r,n,o)}}var _h="*";function Vh(){let e=[];function t({type:m,callback:p}){return e.findIndex(y=>y.type===m&&y.callback===p)}function r(m,p){return m.type==="*"||p===m.type}function n(m){return t(m)<0&&e.push(m),()=>f(m.type,m.callback)}function o(m){e.forEach(p=>{if(r(p,m.meta.type))try{p.callback(m)}catch(y){console.error(y)}})}function i(m){if(m===_h)e.length=0;else for(let p=e.length-1;p>=0;p--)e[p].type===m&&e.splice(p,1)}function a(m){let p=t(m);p>=0&&e.splice(p,1)}function f(m,p){p?a({type:m,callback:p}):i(m)}return{add:n,call:o,remove:f}}function hl({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function Lh(e){let t=hl(e);return{get:()=>t,update:r=>{t=hl({...t,...r})}}}var Ga=Uh();function Uh(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,f=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${f};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function Qh(){return{getItem(e){return Ga.getItem(e)||localStorage.getItem(e)},removeItem(e){Ga.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ga.setItem(e,t,31556952e3)}}}function Bh(){let e=document.referrer;return e===""?null:e}function $h(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(pl().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>Bh(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Ha(),storage:Qh()}}function Hh(){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 zh(){return{getItem(){return null},removeItem(){},setItem(){}}}function Gh(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:zh()}}function Wh(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=Gh();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&Kh()&&Hh()?$h():n}function Kh(){try{return typeof window=="object"}catch{return!1}}function Yh(e){return{get:()=>Object.freeze(Wh(e))}}function Al(e){let t=Lh(e),r=Vh(),n=Yh(t),o=Oh(n);return{emit:(i,a)=>{let f=t.get(),m=n.get(),p=Nh(i,a,f,m,o);return Fh({config:f,environment:m,event:p,listenerManager:r})},getMeta:i=>bl(i,t.get(),n.get(),o),on:(i,a)=>r.add({type:i,callback:a}),off:(i,a)=>r.remove(i,a),updateConfig:i=>t.update(i),version:Sl}}var Sn=pe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>yr(e.configuration.analytics),(e,t)=>Jh(t),(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,f)=>Al({mode:i?"emit":"disabled",url:o??_n(e,t),token:r,trackingId:n??null,source:a,environment:f})),Jh=e=>{if(!e)return;let t=e();return{getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent,generateUUID:()=>t.clientId}};d();c();l();u();var vn=class extends lt{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Cl=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new vn(t)})=>{let i=t(),a=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??ke(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,p=i.configuration.analytics.enabled,y=new ko({enableAnalytics:p,token:a,endpoint:f,runtimeEnvironment:m,preprocessRequest:mn(e,n),beforeSendHooks:[gn(e,r),(h,S)=>(e.info({...S,type:h,endpoint:f,token:a},"Analytics request"),S)]},o);return p||y.disable(),y};d();c();l();u();d();c();l();u();function wl(e,t){return{...new bt(t).getBaseMetadata(),actionCause:e,type:e}}function Xh(e){return Object.assign(e,{instantlyCallable:!0})}function Zh(e,t){let r=i=>Xh(ue(e,i)),n=r(/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(i,{getState:a,extra:f}){let{analyticsClientMiddleware:m,preprocessRequest:p,logger:y}=f;return yield(yield t({getState:a,analyticsClientMiddleware:m,preprocessRequest:p,logger:y})).log({state:a(),extra:f})});return function(_x1,_x10){return _ref8.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref9=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:f,logger:m}){let{description:p,log:y}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:f,logger:m});return{description:p,action:r(/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(h,{getState:S,extra:g}){return yield y({state:S(),extra:g})});return function(_x12,_x13){return _ref0.apply(this,arguments)}}())}});return function prepare(_x11){return _ref9.apply(this,arguments)}}()}),n}var xl=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return rS(i)}return n},eS=e=>e.configuration.analytics.analyticsMode==="legacy",tS=e=>e.configuration.analytics.analyticsMode==="next",rS=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=f=>new a(f)),Zh(e,/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*({getState:f,analyticsClientMiddleware:m,preprocessRequest:p,logger:y}){let h=[],S={log:function(){var _ref10=_asyncToGenerator(function*({state:x}){for(let P of h)yield P(x)});return function log(_x15){return _ref10.apply(this,arguments)}}()},g=f(),v=i({getState:f,logger:y,analyticsClientMiddleware:m,preprocessRequest:p,provider:r(f)}),R=yield t(v,f());S.description=R?.description,h.push(/*#__PURE__*/function(){var _ref11=_asyncToGenerator(function*(x){eS(x)&&(yield nS(R,r,x,y,v.coveoAnalyticsClient))});return function(_x16){return _ref11.apply(this,arguments)}}());let{emit:k}=Sn(g);return h.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x){if(tS(x)&&o&&n){let P=n(x);yield lS(k,o,P)}});return function(_x17){return _ref12.apply(this,arguments)}}()),S});return function(_x14){return _ref1.apply(this,arguments)}}()));function nS(_x18,_x19,_x20,_x21,_x22){return _nS.apply(this,arguments)}function _nS(){_nS=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _nS.apply(this,arguments)}var oS=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref13=_asyncToGenerator(function*(i){r(n,o)});return function log(_x23){return _ref13.apply(this,arguments)}}()}),je=xl(e=>ul({...e,provider:e.provider||new bt(e.getState)}),e=>e,bt),DT=xl(Cl,oS("caseAssist"),vn);var Wa=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return iS(e,r,t)};function iS(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:cS(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:uS(e),queryPipeline:r.pipeline||pr()}}var Mo=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),Rl={urihash:new H,sourcetype:new H,permanentid:new H},El={uniqueId:W,raw:new K({values:Rl}),title:W,uri:W,clickUri:W,rankingModifier:new H({required:!1,emptyAllowed:!0})};function aS(e){return Object.assign({},...Object.keys(Rl).map(t=>({[t]:e[t]})))}function sS(e){return Object.assign({},...Object.keys(El).map(t=>({[t]:e[t]})),{raw:aS(e.raw)})}function cS(e){let t=e.raw.author;return X(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function uS(e){let t=e.raw.source;return X(t)?"unknown":t}var Ka=e=>new Fe(El).validate(sS(e));function lS(_x24,_x25,_x26){return _lS.apply(this,arguments)}function _lS(){_lS=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _lS.apply(this,arguments)}d();c();l();u();var Il=()=>je("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new hn(e)),kl=()=>({actionCause:"recommendationInterfaceLoad"}),_o=e=>je({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Ka(e),t.makeRecommendationOpen(Wa(e,r),Mo(e))),__legacy__provider:t=>new hn(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Wa(e,t),n=Mo(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var xr=D("recommendation/set",e=>Q(e,{id:W})),At=ue("recommendation/get",/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield dS(o),f=yield n.recommendations(a),m=Date.now()-i;return Oe(f)?r(f.error):{recommendations:f.success.results,analyticsAction:Il(),duration:m,searchUid:f.success.searchUid,splitTestRun:f.success.splitTestRun,pipeline:f.success.pipeline}});return function(_x27,_x28){return _ref14.apply(this,arguments)}}()),dS=/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??mt(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Xe.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield pS(e,kl()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function dS(_x29){return _ref15.apply(this,arguments)}}(),pS=/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield jo(e.configuration.analytics,r)});return function pS(_x30,_x31){return _ref16.apply(this,arguments)}}();var Rr=ge(wr(),e=>{e.addCase(xr,(t,r)=>{t.id=r.payload.id}).addCase(At.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(At.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(At.pending,t=>{t.isLoading=!0}).addCase(po,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Er=D("searchHub/set",e=>Q(e,new H({required:!0,emptyAllowed:!0})));d();c();l();u();var Ir=ge(Cr(),e=>{e.addCase(Er,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ye,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();var Ya=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};d();c();l();u();var Ja=pe(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Vo=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:yr(e)}});d();c();l();u();var Pl=pe(e=>e.context,e=>e);d();c();l();u();d();c();l();u();d();c();l();u();var Lo=D("breadcrumb/deselectAll"),Fl=D("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var Ol=D("facet/updateFacetAutoSelection",e=>Q(e,{allow:new ne({required:!0})}));d();c();l();u();d();c();l();u();var Uo=class extends bt{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??Ne().q}get responseTime(){return this.activeInstantResultCache?.duration??Ge().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Ge().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Tl=()=>je("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Uo(e)),Dl=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var Xa={id:W},fS={...Xa,q:we},V0=D("instantResults/register",e=>Q(e,Xa)),Qo=D("instantResults/updateQuery",e=>Q(e,fS)),L0=D("instantResults/clearExpired",e=>Q(e,Xa));d();c();l();u();var Bo=new J({required:!0,min:0}),$o=D("pagination/registerNumberOfResults",e=>Q(e,Bo)),Ho=D("pagination/updateNumberOfResults",e=>Q(e,Bo)),zo=D("pagination/registerPage",e=>Q(e,Bo)),kr=D("pagination/updatePage",e=>Q(e,Bo)),Go=D("pagination/nextPage"),Wo=D("pagination/previousPage");d();c();l();u();var Pr=D("query/updateQuery",e=>Q(e,{q:new H,enableQuerySyntax:new ne}));d();c();l();u();var Fr=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??mt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Vo(e.configuration.analytics,t,r)),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();var Ct=/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??mt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Xe.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield jo(e.configuration.analytics,t))),...(e.excerptLength&&!X(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Ct(_x32,_x33){return _ref17.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var wt=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var Za=()=>je("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),xt=e=>je("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ne().q,aq:r.advancedSearchQueries?.aq||wt().aq,cq:r.advancedSearchQueries?.cq||wt().cq,dq:r.advancedSearchQueries?.dq||wt().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var bn=Qe(Ko(),1),Vl=Qe(ql(),1);d();c();l();u();var Yo=Qe(Ko(),1),Ml=Qe(jl(),1);Yo.default.extend(Ml.default);var Nl="YYYY/MM/DD@HH:mm:ss",mS="1401-01-01";function Or(e,t){let r=(0,Yo.default)(e,t);return!r.isValid()&&!t?(0,Yo.default)(e,Nl):r}function Jo(e){return e.format(Nl)}function _l(e,t){let r=Or(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}as(r)}function as(e){if(e.isBefore(mS))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}bn.default.extend(Vl.default);var Ll=["past","now","next"],Ul=["minute","hour","day","week","month","quarter","year"],gS=e=>{let t=e==="now";return{amount:new J({required:!t,min:1}),unit:new H({required:!t,constrainTo:Ul}),period:new H({required:!0,constrainTo:Ll})}};function ss(e){if(typeof e=="string"&&!Rt(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?zl(e):e;new Fe(gS(t.period)).validate(t);let r=Bl(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);as(r)}function Ql(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Bl(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,bn.default)().subtract(r,n);case"next":return(0,bn.default)().add(r,n);case"now":return(0,bn.default)()}}function An(e){return Jo(Bl(zl(e)))}function $l(e){return e.toLocaleLowerCase().split("-")}function Rt(e){let[t,r,n]=$l(e);if(t==="now")return!0;if(!Ll.includes(t)||!Ul.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function Hl(e){return!!e&&typeof e=="object"&&"period"in e}function zl(e){let[t,r,n]=$l(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}d();c();l();u();function Gl(e){return e.type==="dateRange"}function Wl(e){return`start${e}`}function Kl(e){return`end${e}`}var cs=()=>({dateFacetValueMap:{}});function yS(e,t,r){let n=e.start,o=e.end;return Rt(n)&&(n=An(n),r.dateFacetValueMap[t][Wl(n)]=e.start),Rt(o)&&(o=An(o),r.dateFacetValueMap[t][Kl(o)]=e.end),{...e,start:n,end:o}}function us(e,t){if(Gl(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>yS(o,r,t))}}return e}function Et(e){let t=cs();return{request:{...e,facets:e.facets?.map(n=>us(n,t))},mappings:t}}function hS(e,t,r){return{...e,start:r.dateFacetValueMap[t][Wl(e.start)]||e.start,end:r.dateFacetValueMap[t][Kl(e.end)]||e.end}}function SS(e,t){return e.facetId in t.dateFacetValueMap}function vS(e,t){return SS(e,t)?{...e,values:e.values.map(r=>hS(r,e.facetId,t))}:e}function Xo(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>vS(n,t))}}:e}d();c();l();u();d();c();l();u();var wj=D("didYouMean/enable"),xj=D("didYouMean/disable"),Rj=D("didYouMean/automaticCorrections/disable"),Ej=D("didYouMean/automaticCorrections/enable"),Zo=D("didYouMean/correction",e=>Q(e,W)),Ij=D("didYouMean/automaticCorrections/mode",e=>Q(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var ls=()=>je("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Yl=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function ei(){return{contextValues:{}}}d();c();l();u();function ti(){return{contextValues:{}}}d();c();l();u();function Jl(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Xl(){return[]}d();c();l();u();function Cn(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Zl(){return{}}d();c();l();u();function ed(){return{}}d();c();l();u();function td(){return{}}function et(e){return{context:e.context||ei(),dictionaryFieldContext:e.dictionaryFieldContext||ti(),facetSet:e.facetSet||Do(),numericFacetSet:e.numericFacetSet||To(),dateFacetSet:e.dateFacetSet||Oo(),categoryFacetSet:e.categoryFacetSet||Fo(),automaticFacetSet:e.automaticFacetSet??Po(),pagination:e.pagination||Cn(),query:e.query||Ne(),tabSet:e.tabSet||td(),advancedSearchQueries:e.advancedSearchQueries||wt(),staticFilterSet:e.staticFilterSet||ed(),querySet:e.querySet||Zl(),sortCriteria:e.sortCriteria||qo(),pipeline:e.pipeline||pr(),searchHub:e.searchHub||Cr(),facetOptions:e.facetOptions||Jl(),facetOrder:e.facetOrder??Xl(),debug:e.debug??uo()}}d();c();l();u();var ZM=new K({values:{undoneQuery:we},options:{required:!0}}),rd=()=>je("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var ri=D("trigger/query/ignore",e=>Q(e,new H({emptyAllowed:!0,required:!0}))),ni=D("trigger/query/modification",e=>Q(e,new K({values:{originalQuery:Ce,modification:Ce}})));d();c();l();u();d();c();l();u();d();c();l();u();function It(e){return Object.values(e).map(t=>t.request)}function ds(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function nd(e){return It(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var ps={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function bS(e){return It(e).map(t=>{let r=ps[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function AS(e){return[...bS(e.facetSet??{}),...nd(e.numericFacetSet??{}),...nd(e.dateFacetSet??{}),...It(e.categoryFacetSet??{})]}function CS(e){return AS(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function oi(e){return ds(CS(e),e.facetOrder??[])}d();c();l();u();var kt=/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,t){let r=RS(e),n=oi(e),o=wS(e),i=yield Ct(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Et({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function kt(_x34,_x35){return _ref18.apply(this,arguments)}}();function wS(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(xS).filter(r=>r.currentValues.length>0):void 0}function xS(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function RS(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=ES(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function ES(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Pt=class{constructor(t,r=n=>{this.dispatch(Pr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x36,_x37){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Xo(yield _this10.extra.apiClient.search(r,n),t),a=Date.now()-o,f=_this10.getState().query?.q||"";return{response:i,duration:a,queryExecuted:f,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(xt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:f,queryCorrection:m}=n;if(!o||!i)return null;let p=a.length===0&&f&&f.length!==0,y=!X(m)&&!X(m.correctedQuery);if(!p&&!y)return null;let S=p?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(Je(et(_this12.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this13.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this13.dispatch(xt(i.response.error)),_this13.rejectWithValue(i.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(Je(et(_this13.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:ls()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:ls()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(f=>f.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(ri("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let i=_this14.getCurrentQuery(),a=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this14.dispatch(xt(a.response.error)),_this14.rejectWithValue(a.response.error)):(_this14.dispatch(Je(et(_this14.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:rd()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ne().enableQuerySyntax},search:{...Ge(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Je(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Bn(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield kt(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Zo(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(ni({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield kt(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var g_=ue("search/executeSearch",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,t){let r=t.getState();return yield ii(r,t,e)});return function(_x38,_x39){return _ref19.apply(this,arguments)}}()),y_=ue("search/fetchPage",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,t){let r=t.getState();return yield ms(r,t,e)});return function(_x40,_x41){return _ref20.apply(this,arguments)}}()),h_=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=t.getState();return yield gs(t,r)});return function(_x42,_x43){return _ref21.apply(this,arguments)}}()),S_=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){let r=t.getState();return yield FS(t,e,r)});return function(_x44,_x45){return _ref22.apply(this,arguments)}}()),v_=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){return fs(e,t)});return function(_x46,_x47){return _ref23.apply(this,arguments)}}()),IS=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=yield kt(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function IS(_x48,_x49){return _ref24.apply(this,arguments)}}(),kS=/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t,r){let n=yield Ct(e);return Et({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function kS(_x50,_x51,_x52){return _ref25.apply(this,arguments)}}(),PS=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=yield kt(e,t);return r.request.numberOfResults=0,r});return function PS(_x53,_x54){return _ref26.apply(this,arguments)}}(),od=e=>{e.configuration.analytics.enabled&&Xe.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function fs(_x55,_x56){return _fs.apply(this,arguments)}function _fs(){_fs=_asyncToGenerator(function*(e,t){Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Pt({...t,analyticsAction:Tl()},p=>{t.dispatch(Qo({q:p,id:e.id}))}),a=yield kS(o,r,n),f=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),m=yield i.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,analyticsAction:m.analyticsAction,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return _fs.apply(this,arguments)}function ms(_x57,_x58,_x59){return _ms.apply(this,arguments)}function _ms(){_ms=_asyncToGenerator(function*(e,t,r){od(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=new Pt({...t,analyticsAction:r}),m=yield kt(e,a),p=yield f.fetchFromAPI(m,{origin:"mainSearch"});return yield f.process(p)});return _ms.apply(this,arguments)}function gs(_x60,_x61){return _gs.apply(this,arguments)}function _gs(){_gs=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield Za().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Pt({...e,analyticsAction:Za()}),f=yield IS(t,i),m=yield a.fetchFromAPI(f,{origin:"mainSearch"});return yield a.process(m)});return _gs.apply(this,arguments)}function FS(_x62,_x63,_x64){return _FS.apply(this,arguments)}function _FS(){_FS=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),f=new Pt({...e,analyticsAction:t}),m=yield PS(r,a),p=yield f.fetchFromAPI(m,{origin:"facetValues"});return yield f.process(p)});return _FS.apply(this,arguments)}function ii(_x65,_x66,_x67){return _ii.apply(this,arguments)}function _ii(){_ii=_asyncToGenerator(function*(e,t,r){od(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i});a?.actionCause&&t.dispatch(wn({actionCause:a.actionCause}));let f=yield kt(e,a),m=new Pt({...t,analyticsAction:r}),p=yield m.fetchFromAPI(f,{origin:"mainSearch"});return yield m.process(p)});return _ii.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var ai=pe(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Ft=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t,r){let n=NS(e),o=OS(e),i=TS(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Ct(e,r):Fr(e,t,r),f=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Et({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:f(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ft(_x68,_x69,_x70){return _ref27.apply(this,arguments)}}();function OS(e){return ds(qS(e),e.facetOrder??[])}function TS(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(DS).filter(r=>r.currentValues.length>0):void 0}function DS(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function qS(e){return jS(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function jS(e){return[...MS(e.facetSet??{}),...id(e.numericFacetSet??{}),...id(e.dateFacetSet??{}),...It(e.categoryFacetSet??{})]}function MS(e){return It(e).map(t=>{let r=ps[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function id(e){return It(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function NS(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=ai(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}var Ot=class{constructor(t,r=n=>{this.dispatch(Pr({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x71,_x72){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Xo(yield _this17.extra.apiClient.search(r,n),t),a=Date.now()-o,f=_this17.getState().query?.q||"";return{response:i,duration:a,queryExecuted:f,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return Oe(t.response)?(this.dispatch(xt(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:f,queryCorrection:m}=n;if(!o||!i)return null;let p=a.length===0&&f&&f.length!==0,y=!X(m)&&!X(m.correctedQuery);if(!p&&!y)return null;let S=p?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(Je(et(_this19.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this20.automaticallyRetryQueryWithCorrection(o);return Oe(i.response)?(_this20.dispatch(xt(i.response.error)),_this20.rejectWithValue(i.response.error)):(_this20.dispatch(Je(et(_this20.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(f=>f.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(ri("")),null;let i=_this21.getCurrentQuery(),a=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return Oe(a.response)?(_this21.dispatch(xt(a.response.error)),_this21.rejectWithValue(a.response.error)):(_this21.dispatch(Je(et(_this21.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Je(et(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Bn(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Yl(),o=yield _this22.fetchFromAPI(yield Ft(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Zo(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(ni({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Ft(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var CV=ue("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;Q(e,{q:new H,enableQuerySyntax:new ne,clearFilters:new ne}),e.clearFilters&&(r(Lo()),r(Fl())),r(Ol({allow:!0})),r(Pr({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(kr(1))}),wn=D("search/updateSearchAction"),ad=ue("search/executeSearch",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return ii(r,t,e.legacy);sd(r);let n=e.next?cd(e.next):void 0;t.dispatch(wn(e.next));let o=yield Ft(r,t.extra.navigatorContext,n),i=new Ot({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x73,_x74){return _ref28.apply(this,arguments)}}()),wV=ue("search/fetchPage",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=t.getState();if(sd(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return ms(r,t,e.legacy);let n=new Ot({...t,analyticsAction:e.next}),o=yield Ft(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x75,_x76){return _ref29.apply(this,arguments)}}()),xV=ue("search/fetchMoreResults",/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return gs(t,r);let n=wl("browseResults",t.getState),o=new Ot({...t,analyticsAction:n}),i=yield _S(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x77,_x78){return _ref30.apply(this,arguments)}}()),RV=ue("search/fetchFacetValues",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return ii(r,t,e.legacy);let n=new Ot({...t,analyticsAction:{}}),o=yield LS(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x79,_x80){return _ref31.apply(this,arguments)}}()),EV=ue("search/fetchInstantResults",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return fs(e,t);Q(e,{id:W,q:W,maxResultsPerQuery:new J({required:!0,min:1}),cacheTimeout:new J});let{q:n,maxResultsPerQuery:o}=e,i=cd(Dl()),a=yield VS(r,t.extra.navigatorContext,n,o,i),f=new Ot({...t,analyticsAction:i},y=>{t.dispatch(Qo({q:y,id:e.id}))}),m=yield f.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),p=yield f.process(m);return"response"in p?{results:p.response.results,searchUid:p.response.searchUid,totalCountFiltered:p.response.totalCountFiltered,duration:p.duration}:p});return function(_x81,_x82){return _ref32.apply(this,arguments)}}()),_S=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t,r){let n=yield Ft(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function _S(_x83,_x84,_x85){return _ref33.apply(this,arguments)}}(),VS=/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t,r,n,o){let i=Fr(e,t,o);return Et({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function VS(_x86,_x87,_x88,_x89,_x90){return _ref34.apply(this,arguments)}}(),LS=/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t,r){let n=yield Ft(e,t,r);return n.request.numberOfResults=0,n});return function LS(_x91,_x92,_x93){return _ref35.apply(this,arguments)}}(),sd=e=>{e.configuration.analytics.enabled&&Xe.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},cd=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();var si=e=>je({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Ar(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:Ar(t)??"",answerGenerated:e??!1})});d();c();l();u();var ud=/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ke(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function ud(_x94){return _ref36.apply(this,arguments)}}();d();c();l();u();var ld=["text/plain","text/markdown"];var Tr=new H({required:!0}),pd=new H,Dr=new ne({required:!0}),US={id:Tr,title:Tr,uri:Tr,permanentid:Tr,clickUri:pd},fd=new H({required:!0,constrainTo:ld}),sL=D("generatedAnswer/setIsVisible",e=>Q(e,Dr)),cL=D("generatedAnswer/setIsEnabled",e=>Q(e,Dr)),hs=D("generatedAnswer/updateMessage",e=>Q(e,{textDelta:Tr})),Ss=D("generatedAnswer/updateCitations",e=>Q(e,{citations:new ie({required:!0,each:new K({values:US})})})),QS=D("generatedAnswer/updateError",e=>Q(e,{message:pd,code:new J({min:0})})),md=D("generatedAnswer/resetAnswer"),uL=D("generatedAnswer/like"),lL=D("generatedAnswer/dislike"),dL=D("generatedAnswer/feedbackModal/open"),pL=D("generatedAnswer/expand"),fL=D("generatedAnswer/collapse"),mL=D("generatedAnswer/setId",e=>Q(e,{id:new H({required:!0})})),gL=D("generatedAnswer/feedbackModal/close"),yL=D("generatedAnswer/sendFeedback"),ys=D("generatedAnswer/setIsLoading",e=>Q(e,Dr)),dd=D("generatedAnswer/setIsStreaming",e=>Q(e,Dr)),vs=D("generatedAnswer/setAnswerContentFormat",e=>Q(e,fd)),hL=D("generatedAnswer/updateResponseFormat",e=>Q(e,{contentFormat:new ie({each:fd,default:["text/plain"]})})),SL=D("knowledge/updateAnswerConfigurationId",e=>Q(e,Tr)),vL=D("generatedAnswer/registerFieldsToIncludeInCitations",e=>Q(e,oo)),BS=D("generatedAnswer/setIsAnswerGenerated",e=>Q(e,Dr)),bs=D("generatedAnswer/setCannotAnswer",e=>Q(e,Dr)),bL=ue("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:f}=a,{setAbortControllerRef:m}=e,p=yield ud(r),y=(g,v)=>{switch(g){case"genqa.headerMessageType":{let R=JSON.parse(v);n(vs(R.contentFormat));break}case"genqa.messageType":n(hs(JSON.parse(v)));break;case"genqa.citationsType":n(Ss(JSON.parse(v)));break;case"genqa.endOfStreamType":{let R=JSON.parse(v).answerGenerated,k=f.length!==0&&!R;n(bs(k)),n(dd(!1)),n(BS(R)),n(si(R));break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(ys(!0));let h=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(p,{write:g=>{h(p)&&(n(ys(!1)),g.payload&&g.payloadType&&y(g.payloadType,g.payload))},abort:g=>{h(p)&&n(QS(g))},close:()=>{h(p)&&n(dd(!1))},resetAnswer:()=>{h(p)&&n(md())}});S?m(S):n(ys(!1))});return function(_x95,_x96){return _ref37.apply(this,arguments)}}()),AL=ue("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){let i=t();i.generatedAnswer.answerConfigurationId?(r(md()),yield r(gd(i,n)),r(wn(void 0))):o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x97,_x98){return _ref38.apply(this,arguments)}}());d();c();l();u();var yd=pe(e=>e.pipeline,e=>e);d();c();l();u();var As=pe(e=>e.query,e=>e);d();c();l();u();d();c();l();u();var xn=(e,t)=>{let r=e;return X(r[t])?X(e.raw[t])?null:e.raw[t]:r[t]},$S=e=>t=>e.every(r=>!X(xn(t,r))),HS=e=>t=>e.every(r=>X(xn(t,r))),zS=(e,t)=>r=>{let n=hd(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},GS=(e,t)=>r=>{let n=hd(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},hd=(e,t)=>{let r=xn(t,e);return Sc(r)?r:[r]},Sd={getResultProperty:xn,fieldsMustBeDefined:$S,fieldsMustNotBeDefined:HS,fieldMustMatch:zS,fieldMustNotMatch:GS};var vd=pe(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();var bd=pe(e=>e.searchHub,e=>e);d();c();l();u();var Cs=pe(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),Ad=pe(e=>e,e=>{let t=Cs(e);return t&&e?e[t].expression:""});d();c();l();u();d();c();l();u();function wd(_x99,_x100){return _wd.apply(this,arguments)}function _wd(){_wd=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _wd.apply(this,arguments)}function xd(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=KS(t,a);let f=t.length,m=0;for(;r<f;){o&&(t[r]===10&&(m=++r),o=!1);let p=-1;for(;r<f&&p===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-m);break;case 13:o=!0,p=r;break;case 10:p=r;break}if(p===-1)break;e(t.subarray(m,p),n),m=r,n=-1}m===f?t=void 0:m!==0&&(t=t.subarray(m),r-=m)}}function Rd(e,t,r){let n=Cd(),o=new TextDecoder;return function(a,f){if(a.length===0)r?.(n),n=Cd();else if(f>0){let m=o.decode(a.subarray(0,f)),p=f+(a[f+1]===32?2:1),y=o.decode(a.subarray(p));switch(m){case"data":n.data=n.data?`${n.data}
|
|
31
|
+
${y}`:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":WS(y,n,t);break}}}}function WS(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function KS(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Cd(){return{data:"",event:"",id:"",retry:void 0}}var ws="text/event-stream",YS=1e3,Ed="last-event-id";function Id(){return typeof window<"u"}function kd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:f,fetch:m,...p}){return new Promise((y,h)=>{let S={...r};S.accept||(S.accept=ws);let g;function v(){g?.abort(),document.hidden||E()}!f&&Id()&&document.addEventListener("visibilitychange",v);let R=YS,k;function x(){Id()&&document.removeEventListener("visibilitychange",v),clearTimeout(k),g?.abort()}t?.addEventListener("abort",()=>{x(),y()});let P=m??A,w=n??JS;function E(){return _E.apply(this,arguments)}function _E(){_E=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let M=yield P(e,{...p,headers:S,signal:g?.signal});yield w(M),yield wd(M.body,xd(Rd(O=>{O?S[Ed]=O:delete S[Ed]},O=>{R=O},o))),i?.(),x(),y()}catch(M){if(!g?.signal?.aborted)try{let O=a?.(M)??R;clearTimeout(k),k=setTimeout(E,O)}catch(O){x(),h(O)}}});return _E.apply(this,arguments)}E()})}function JS(e){let t=e.headers.get("content-type");if(!t?.startsWith(ws))throw new Error(`Expected content-type to be ${ws}, Actual: ${t}`)}d();c();l();u();d();c();l();u();function Pd(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Fd=We;function Qd(e,t){if(e===t||!(Fd(e)&&Fd(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Qd(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function qr(e){let t=0;for(let r in e)t++;return t}var Od=e=>[].concat(...e);function XS(e){return new RegExp("(^|:)//").test(e)}function ZS(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function li(e){return e!=null}function ev(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var tv=e=>e.replace(/\/$/,""),rv=e=>e.replace(/^\//,"");function nv(e,t){if(!e)return t;if(!t)return e;if(XS(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=tv(e),t=rv(t),`${e}${r}${t}`}function ov(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Td=(...e)=>A(...e),iv=e=>e.status>=200&&e.status<=299,av=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Dd(e){if(!We(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function Bd({baseUrl:e,prepareHeaders:t=h=>h,fetchFn:r=Td,paramsSerializer:n,isJsonContentType:o=av,jsonContentType:i="application/json",jsonReplacer:a,timeout:f,responseHandler:m,validateStatus:p,...y}={}){return typeof A>"u"&&r===Td&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(S,g,v){let{getState:R,extra:k,endpoint:x,forced:P,type:w}=g,E,{url:M,headers:O=new C(y.headers),params:I=void 0,responseHandler:F=m??"json",validateStatus:T=p??iv,timeout:N=f,...$}=typeof S=="string"?{url:S}:S,U,V=g.signal;N&&(U=new s.AbortController,g.signal.addEventListener("abort",U.abort),V=U.signal);let _={...y,signal:V,...$};O=new C(Dd(O)),_.headers=(yield t(O,{getState:R,arg:S,extra:k,endpoint:x,forced:P,type:w,extraOptions:v}))||O;let B=Z=>typeof Z=="object"&&(We(Z)||Array.isArray(Z)||typeof Z.toJSON=="function");if(!_.headers.has("content-type")&&B(_.body)&&_.headers.set("content-type",i),B(_.body)&&o(_.headers)&&(_.body=JSON.stringify(_.body,a)),I){let Z=~M.indexOf("?")?"&":"?",oe=n?n(I):new URLSearchParams(Dd(I));M+=Z+oe}M=nv(e,M);let L=new Request(M,_);E={request:new Request(M,_)};let G,Y=!1,te=U&&setTimeout(()=>{Y=!0,U.abort()},N);try{G=yield r(L)}catch(Z){return{error:{status:Y?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Z)},meta:E}}finally{te&&clearTimeout(te),U?.signal.removeEventListener("abort",U.abort)}let se=G.clone();E.response=se;let ee,re="";try{let Z;if(yield Promise.all([h(G,F).then(oe=>ee=oe,oe=>Z=oe),se.text().then(oe=>re=oe,()=>{})]),Z)throw Z}catch(Z){return{error:{status:"PARSING_ERROR",originalStatus:G.status,data:re,error:String(Z)},meta:E}}return T(G,ee)?{data:ee,meta:E}:{error:{status:G.status,data:ee},meta:E}});return function(_x101,_x102,_x103){return _ref39.apply(this,arguments)}}());function h(_x104,_x105){return _h2.apply(this,arguments)}function _h2(){_h2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let v=yield S.text();return v.length?JSON.parse(v):null}return S.text()});return _h2.apply(this,arguments)}}var jr=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function sv(){return _sv.apply(this,arguments)}function _sv(){_sv=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _sv.apply(this,arguments)}function cv(e,t){throw Object.assign(new jr({error:e,meta:t}),{throwImmediately:!0})}var qd={},uv=(e,t)=>(/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(r,n,o){let i=[5,(t||qd).maxRetries,(o||qd).maxRetries].filter(y=>y!==void 0),[a]=i.slice(-1),m={maxRetries:a,backoff:sv,retryCondition:(y,h,{attempt:S})=>S<=a,...t,...o},p=0;for(;;)try{let y=yield e(r,n,o);if(y.error)throw new jr(y);return y}catch(y){if(p++,y.throwImmediately){if(y instanceof jr)return y.value;throw y}if(y instanceof jr&&!m.retryCondition(y.value.error,r,{attempt:p,baseQueryApi:n,extraOptions:o}))return y.value;yield m.backoff(p,m.maxRetries)}});return function(_x106,_x107,_x108){return _ref40.apply(this,arguments)}}()),$d=Object.assign(uv,{fail:cv}),ks=D("__rtkq/focused"),Hd=D("__rtkq/unfocused"),Ps=D("__rtkq/online"),zd=D("__rtkq/offline");function Fs(e){return e.type==="query"}function lv(e){return e.type==="mutation"}function Os(e){return e.type==="infinitequery"}function Ts(e,t,r,n,o,i){return dv(e)?e(t,r,n,o).filter(li).map(Rs).map(i):Array.isArray(e)?e.map(Rs).map(i):[]}function dv(e){return typeof e=="function"}function Rs(e){return typeof e=="string"?{type:e}:e}function pv(e,t){return e.catch(t)}var En=Symbol("forceQueryFn"),Es=e=>typeof e[En]=="function";function fv({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,f=new Map,{unsubscribeQueryResult:m,removeMutationResult:p,updateSubscriptionOptions:y}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:P,buildInitiateMutation:w,getRunningQueryThunk:h,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:v};function h(E,M){return O=>{let I=i.endpointDefinitions[E],F=e({queryArgs:M,endpointDefinition:I,endpointName:E});return a.get(O)?.[F]}}function S(E,M){return O=>f.get(O)?.[M]}function g(){return E=>Object.values(a.get(E)||{}).filter(li)}function v(){return E=>Object.values(f.get(E)||{}).filter(li)}function R(E){}function k(E,M){let O=(I,{subscribe:F=!0,forceRefetch:T,subscriptionOptions:N,[En]:$,...U}={})=>(V,_)=>{let B=e({queryArgs:I,endpointDefinition:M,endpointName:E}),L,z={...U,type:"query",subscribe:F,forceRefetch:T,subscriptionOptions:N,endpointName:E,originalArgs:I,queryCacheKey:B,[En]:$};if(Fs(M))L=t(z);else{let{direction:ce,initialPageParam:me}=U;L=r({...z,direction:ce,initialPageParam:me})}let G=o.endpoints[E].select(I),Y=V(L),te=G(_());let{requestId:se,abort:ee}=Y,re=te.requestId!==se,Z=a.get(V)?.[B],oe=()=>G(_()),ye=Object.assign($?Y.then(oe):re&&!Z?Promise.resolve(te):Promise.all([Z,Y]).then(oe),{arg:I,requestId:se,subscriptionOptions:N,queryCacheKey:B,abort:ee,unwrap(){return _asyncToGenerator(function*(){let ce=yield ye;if(ce.isError)throw ce.error;return ce.data})()},refetch:()=>V(O(I,{subscribe:!1,forceRefetch:!0})),unsubscribe(){F&&V(m({queryCacheKey:B,requestId:se}))},updateSubscriptionOptions(ce){ye.subscriptionOptions=ce,V(y({endpointName:E,requestId:se,queryCacheKey:B,options:ce}))}});if(!Z&&!re&&!$){let ce=ov(a,V,{});ce[B]=ye,ye.then(()=>{delete ce[B],qr(ce)||a.delete(V)})}return ye};return O}function x(E,M){return k(E,M)}function P(E,M){return k(E,M)}function w(E){return(M,{track:O=!0,fixedCacheKey:I}={})=>(F,T)=>{let N=n({type:"mutation",endpointName:E,originalArgs:M,track:O,fixedCacheKey:I}),$=F(N);let{requestId:U,abort:V,unwrap:_}=$,B=pv($.unwrap().then(Y=>({data:Y})),Y=>({error:Y})),L=()=>{F(p({requestId:U,fixedCacheKey:I}))},z=Object.assign(B,{arg:$.arg,requestId:U,abort:V,unwrap:_,reset:L}),G=f.get(F)||{};return f.set(F,G),G[U]=z,z.then(()=>{delete G[U],qr(G)||f.delete(F)}),I&&(G[I]=z,z.then(()=>{G[I]===z&&(delete G[I],qr(G)||f.delete(F))})),z}}}function mv(e){return e}var ci=(e={})=>({...e,[cn]:!0});function gv({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let f=(F,T,N,$)=>(U,V)=>{let _=r[F],B=n({queryArgs:T,endpointDefinition:_,endpointName:F});if(U(o.internalActions.queryResultPatched({queryCacheKey:B,patches:N})),!$)return;let L=o.endpoints[F].select(T)(V()),z=Ts(_.providesTags,L.data,void 0,T,{},i);U(o.internalActions.updateProvidedBy({queryCacheKey:B,providedTags:z}))};function m(F,T,N=0){let $=[T,...F];return N&&$.length>N?$.slice(0,-1):$}function p(F,T,N=0){let $=[...F,T];return N&&$.length>N?$.slice(1):$}let y=(F,T,N,$=!0)=>(U,V)=>{let B=o.endpoints[F].select(T)(V()),L={patches:[],inversePatches:[],undo:()=>U(o.util.patchQueryData(F,T,L.inversePatches,$))};if(B.status==="uninitialized")return L;let z;if("data"in B)if(De(B.data)){let[G,Y,te]=Jn(B.data,N);L.patches.push(...Y),L.inversePatches.push(...te),z=G}else z=N(B.data),L.patches.push({op:"replace",path:[],value:z}),L.inversePatches.push({op:"replace",path:[],value:B.data});return L.patches.length===0||U(o.util.patchQueryData(F,T,L.patches,$)),L},h=(F,T,N)=>$=>$(o.endpoints[F].initiate(T,{subscribe:!1,forceRefetch:!0,[En]:()=>({data:N})})),S=(F,T)=>F.query&&F[T]?F[T]:mv,g=/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(F,{signal:T,abort:N,rejectWithValue:$,fulfillWithValue:U,dispatch:V,getState:_,extra:B}){let L=r[F.endpointName];try{let z=S(L,"transformResponse"),G={signal:T,abort:N,dispatch:V,getState:_,extra:B,endpoint:F.endpointName,type:F.type,forced:F.type==="query"?v(F,_()):void 0,queryCacheKey:F.type==="query"?F.queryCacheKey:void 0},Y=F.type==="query"?F[En]:void 0,te,se=/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(re,Z,oe,ye){if(Z==null&&re.pages.length)return Promise.resolve({data:re});let ce={queryArg:F.originalArgs,pageParam:Z},me=yield ee(ce),he=ye?m:p;return{data:{pages:he(re.pages,me.data,oe),pageParams:he(re.pageParams,Z,oe)}}});return function se(_x111,_x112,_x113,_x114){return _ref42.apply(this,arguments)}}();function ee(_x115){return _ee.apply(this,arguments)}function _ee(){_ee=_asyncToGenerator(function*(re){let Z,{extraOptions:oe}=L;if(Y?Z=Y():L.query?Z=yield t(L.query(re),G,oe):Z=yield L.queryFn(re,G,oe,ce=>t(ce,G,oe)),typeof process<"u",Z.error)throw new jr(Z.error,Z.meta);let ye=yield z(Z.data,Z.meta,re);return{...Z,data:ye}});return _ee.apply(this,arguments)}if(F.type==="query"&&"infiniteQueryOptions"in L){let{infiniteQueryOptions:re}=L,{maxPages:Z=1/0}=re,oe,ye={pages:[],pageParams:[]},ce=a.selectQueryEntry(_(),F.queryCacheKey)?.data,he=v(F,_())&&!F.direction||!ce?ye:ce;if("direction"in F&&F.direction&&he.pages.length){let Pe=F.direction==="backward",ft=(Pe?Gd:Is)(re,he);oe=yield se(he,ft,Z,Pe)}else{let{initialPageParam:Pe=re.initialPageParam}=F,_e=ce?.pageParams??[],ft=_e[0]??Pe,Kt=_e.length;oe=yield se(he,ft,Z),Y&&(oe={data:oe.data.pages[0]});for(let Yt=1;Yt<Kt;Yt++){let Qr=Is(re,oe.data);oe=yield se(oe.data,Qr,Z)}}te=oe}else te=yield ee(F.originalArgs);return U(te.data,ci({fulfilledTimeStamp:Date.now(),baseQueryMeta:te.meta}))}catch(z){let G=z;if(G instanceof jr){let Y=S(L,"transformErrorResponse");try{return $(yield Y(G.value,G.meta,F.originalArgs),ci({baseQueryMeta:G.meta}))}catch(te){G=te}}throw typeof process<"u",console.error(G),G}});return function g(_x109,_x110){return _ref41.apply(this,arguments)}}();function v(F,T){let N=a.selectQueryEntry(T,F.queryCacheKey),$=a.selectConfig(T).refetchOnMountOrArgChange,U=N?.fulfilledTimeStamp,V=F.forceRefetch??(F.subscribe&&$);return V?V===!0||(Number(new Date)-Number(U))/1e3>=V:!1}let R=()=>ue(`${e}/executeQuery`,g,{getPendingMeta({arg:T}){let N=r[T.endpointName];return ci({startedTimeStamp:Date.now(),...(Os(N)?{direction:T.direction}:{})})},condition(T,{getState:N}){let $=N(),U=a.selectQueryEntry($,T.queryCacheKey),V=U?.fulfilledTimeStamp,_=T.originalArgs,B=U?.originalArgs,L=r[T.endpointName],z=T.direction;return Es(T)?!0:U?.status==="pending"?!1:v(T,$)||Fs(L)&&L?.forceRefetch?.({currentArg:_,previousArg:B,endpointState:U,state:$})?!0:!(V&&!z)},dispatchConditionRejection:!0}),k=R(),x=R(),P=ue(`${e}/executeMutation`,g,{getPendingMeta(){return ci({startedTimeStamp:Date.now()})}}),w=F=>"force"in F,E=F=>"ifOlderThan"in F,M=(F,T,N)=>($,U)=>{let V=w(N)&&N.force,_=E(N)&&N.ifOlderThan,B=(z=!0)=>{let G={forceRefetch:z,isPrefetch:!0};return o.endpoints[F].initiate(T,G)},L=o.endpoints[F].select(T)(U());if(V)$(B());else if(_){let z=L?.fulfilledTimeStamp;if(!z){$(B());return}(Number(new Date)-Number(new Date(z)))/1e3>=_&&$(B())}else $(B(!1))};function O(F){return T=>T?.meta?.arg?.endpointName===F}function I(F,T){return{matchPending:ir(to(F),O(T)),matchFulfilled:ir(it(F),O(T)),matchRejected:ir(Ut(F),O(T))}}return{queryThunk:k,mutationThunk:P,infiniteQueryThunk:x,prefetch:M,updateQueryData:y,upsertQueryData:h,patchQueryData:f,buildMatchThunkActions:I}}function Is(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Gd(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function Wd(e,t,r,n){return Ts(r[e.meta.arg.endpointName][t],it(e)?e.payload:void 0,ln(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function ui(e,t,r){let n=e[t];n&&r(n)}function In(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function jd(e,t,r){let n=e[In(t)];n&&r(n)}var Rn={};function yv({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:f},assertTagType:m,config:p}){let y=D(`${e}/resetApiState`);function h(O,I,F,T){var N;O[N=I.queryCacheKey]??(O[N]={status:"uninitialized",endpointName:I.endpointName}),ui(O,I.queryCacheKey,$=>{$.status="pending",$.requestId=F&&$.requestId?$.requestId:T.requestId,I.originalArgs!==void 0&&($.originalArgs=I.originalArgs),$.startedTimeStamp=T.startedTimeStamp;let U=o[T.arg.endpointName];Os(U)&&"direction"in I&&($.direction=I.direction)})}function S(O,I,F,T){ui(O,I.arg.queryCacheKey,N=>{if(N.requestId!==I.requestId&&!T)return;let{merge:$}=o[I.arg.endpointName];if(N.status="fulfilled",$){if(N.data!==void 0){let{fulfilledTimeStamp:U,arg:V,baseQueryMeta:_,requestId:B}=I,L=ot(N.data,z=>$(z,F,{arg:V.originalArgs,baseQueryMeta:_,fulfilledTimeStamp:U,requestId:B}));N.data=L}else N.data=F;}else N.data=o[I.arg.endpointName].structuralSharing??!0?Qd(Me(N.data)?ca(N.data):N.data,F):F;delete N.error,N.fulfilledTimeStamp=I.fulfilledTimeStamp})}let g=Qt({name:`${e}/queries`,initialState:Rn,reducers:{removeQueryResult:{reducer(O,{payload:{queryCacheKey:I}}){delete O[I]},prepare:ar()},cacheEntriesUpserted:{reducer(O,I){for(let F of I.payload){let{queryDescription:T,value:N}=F;h(O,T,!0,{arg:T,requestId:I.meta.requestId,startedTimeStamp:I.meta.timestamp}),S(O,{arg:T,requestId:I.meta.requestId,fulfilledTimeStamp:I.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:O=>({payload:O.map(T=>{let{endpointName:N,arg:$,value:U}=T,V=o[N];return{queryDescription:{type:"query",endpointName:N,originalArgs:T.arg,queryCacheKey:n({queryArgs:$,endpointDefinition:V,endpointName:N})},value:U}}),meta:{[cn]:!0,requestId:no(),timestamp:Date.now()}})},queryResultPatched:{reducer(O,{payload:{queryCacheKey:I,patches:F}}){ui(O,I,T=>{T.data=la(T.data,F.concat())})},prepare:ar()}},extraReducers(O){O.addCase(t.pending,(I,{meta:F,meta:{arg:T}})=>{let N=Es(T);h(I,T,N,F)}).addCase(t.fulfilled,(I,{meta:F,payload:T})=>{let N=Es(F.arg);S(I,F,T,N)}).addCase(t.rejected,(I,{meta:{condition:F,arg:T,requestId:N},error:$,payload:U})=>{ui(I,T.queryCacheKey,V=>{if(!F){if(V.requestId!==N)return;V.status="rejected",V.error=U??$}})}).addMatcher(f,(I,F)=>{let{queries:T}=a(F);for(let[N,$]of Object.entries(T))($?.status==="fulfilled"||$?.status==="rejected")&&(I[N]=$)})}}),v=Qt({name:`${e}/mutations`,initialState:Rn,reducers:{removeMutationResult:{reducer(O,{payload:I}){let F=In(I);F in O&&delete O[F]},prepare:ar()}},extraReducers(O){O.addCase(r.pending,(I,{meta:F,meta:{requestId:T,arg:N,startedTimeStamp:$}})=>{N.track&&(I[In(F)]={requestId:T,status:"pending",endpointName:N.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,(I,{payload:F,meta:T})=>{T.arg.track&&jd(I,T,N=>{N.requestId===T.requestId&&(N.status="fulfilled",N.data=F,N.fulfilledTimeStamp=T.fulfilledTimeStamp)})}).addCase(r.rejected,(I,{payload:F,error:T,meta:N})=>{N.arg.track&&jd(I,N,$=>{$.requestId===N.requestId&&($.status="rejected",$.error=F??T)})}).addMatcher(f,(I,F)=>{let{mutations:T}=a(F);for(let[N,$]of Object.entries(T))($?.status==="fulfilled"||$?.status==="rejected")&&N!==$?.requestId&&(I[N]=$)})}}),R=Qt({name:`${e}/invalidation`,initialState:Rn,reducers:{updateProvidedBy:{reducer(O,I){var N,$;let{queryCacheKey:F,providedTags:T}=I.payload;for(let U of Object.values(O))for(let V of Object.values(U)){let _=V.indexOf(F);_!==-1&&V.splice(_,1)}for(let{type:U,id:V}of T){let _=(N=O[U]??(O[U]={}))[$=V||"__internal_without_id"]??(N[$]=[]);_.includes(F)||_.push(F)}},prepare:ar()}},extraReducers(O){O.addCase(g.actions.removeQueryResult,(I,{payload:{queryCacheKey:F}})=>{for(let T of Object.values(I))for(let N of Object.values(T)){let $=N.indexOf(F);$!==-1&&N.splice($,1)}}).addMatcher(f,(I,F)=>{var N,$;let{provided:T}=a(F);for(let[U,V]of Object.entries(T))for(let[_,B]of Object.entries(V)){let L=(N=I[U]??(I[U]={}))[$=_||"__internal_without_id"]??(N[$]=[]);for(let z of B)L.includes(z)||L.push(z)}}).addMatcher(Ke(it(t),ln(t)),(I,F)=>{let T=Wd(F,"providesTags",o,m),{queryCacheKey:N}=F.meta.arg;R.caseReducers.updateProvidedBy(I,R.actions.updateProvidedBy({queryCacheKey:N,providedTags:T}))})}}),k=Qt({name:`${e}/subscriptions`,initialState:Rn,reducers:{updateSubscriptionOptions(O,I){},unsubscribeQueryResult(O,I){},internal_getRTKQSubscriptions(){}}}),x=Qt({name:`${e}/internalSubscriptions`,initialState:Rn,reducers:{subscriptionsUpdated:{reducer(O,I){return la(O,I.payload)},prepare:ar()}}}),P=Qt({name:`${e}/config`,initialState:{online:ev(),focused:ZS(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(O,{payload:I}){O.middlewareRegistered=O.middlewareRegistered==="conflict"||i!==I?"conflict":!0}},extraReducers:O=>{O.addCase(Ps,I=>{I.online=!0}).addCase(zd,I=>{I.online=!1}).addCase(ks,I=>{I.focused=!0}).addCase(Hd,I=>{I.focused=!1}).addMatcher(f,I=>({...I}))}}),w=tr({queries:g.reducer,mutations:v.reducer,provided:R.reducer,subscriptions:x.reducer,config:P.reducer}),E=(O,I)=>w(y.match(I)?void 0:O,I),M={...P.actions,...g.actions,...k.actions,...x.actions,...v.actions,...R.actions,resetApiState:y};return{reducer:E,actions:M}}var xs=Symbol.for("RTKQ/skipToken"),Kd={status:"uninitialized"},Md=ot(Kd,()=>{}),Nd=ot(Kd,()=>{});function hv({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=w=>Md,o=w=>Nd;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:v,selectInvalidatedBy:R,selectCachedArgsForQuery:k,selectApiState:a,selectQueries:f,selectMutations:p,selectQueryEntry:m,selectConfig:y};function i(w){return{...w,...Pd(w.status)}}function a(w){return w[t]}function f(w){return a(w)?.queries}function m(w,E){return f(w)?.[E]}function p(w){return a(w)?.mutations}function y(w){return a(w)?.config}function h(w,E,M){return O=>{if(O===xs)return r(n,M);let I=e({queryArgs:O,endpointDefinition:E,endpointName:w});return r(T=>m(T,I)??Md,M)}}function S(w,E){return h(w,E,i)}function g(w,E){let{infiniteQueryOptions:M}=E;function O(I){let F={...I,...Pd(I.status)},{isLoading:T,isError:N,direction:$}=F,U=$==="forward",V=$==="backward";return{...F,hasNextPage:x(M,F.data),hasPreviousPage:P(M,F.data),isFetchingNextPage:T&&U,isFetchingPreviousPage:T&&V,isFetchNextPageError:N&&U,isFetchPreviousPageError:N&&V}}return h(w,E,O)}function v(){return w=>{let E;return typeof w=="object"?E=In(w)??xs:E=w,r(E===xs?o:I=>a(I)?.mutations?.[E]??Nd,i)}}function R(w,E){let M=w[t],O=new Set;for(let I of E.filter(li).map(Rs)){let F=M.provided[I.type];if(!F)continue;let T=(I.id!==void 0?F[I.id]:Od(Object.values(F)))??[];for(let N of T)O.add(N)}return Od(Array.from(O.values()).map(I=>{let F=M.queries[I];return F?[{queryCacheKey:I,endpointName:F.endpointName,originalArgs:F.originalArgs}]:[]}))}function k(w,E){return Object.values(f(w)).filter(M=>M?.endpointName===E&&M.status!=="uninitialized").map(M=>M.originalArgs)}function x(w,E){return E?Is(w,E)!=null:!1}function P(w,E){return!E||!w.getPreviousPageParam?!1:Gd(w,E)!=null}}var _d=WeakMap?new WeakMap:void 0,Vd=({endpointName:e,queryArgs:t})=>{let r="",n=_d?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=We(a)?Object.keys(a).sort().reduce((f,m)=>(f[m]=a[m],f),{}):a,a));We(t)&&_d?.set(t,o),r=o}return`${e}(${r})`};function Sv(...e){return function(r){let n=or(p=>r.extractRehydrationInfo?.(p,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(p){let y=Vd;if("serializeQueryArgs"in p.endpointDefinition){let h=p.endpointDefinition.serializeQueryArgs;y=S=>{let g=h(S);return typeof g=="string"?g:Vd({...S,queryArgs:g})}}else r.serializeQueryArgs&&(y=r.serializeQueryArgs);return y(p)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(p){p()},apiUid:no(),extractRehydrationInfo:n,hasRehydrationInfo:or(p=>n(p)!=null)},a={injectEndpoints:m,enhanceEndpoints({addTagTypes:p,endpoints:y}){if(p)for(let h of p)o.tagTypes.includes(h)||o.tagTypes.push(h);if(y)for(let[h,S]of Object.entries(y))typeof S=="function"?S(i.endpointDefinitions[h]):Object.assign(i.endpointDefinitions[h]||{},S);return a}},f=e.map(p=>p.init(a,o,i));function m(p){let y=p.endpoints({query:h=>({...h,type:"query"}),mutation:h=>({...h,type:"mutation"}),infiniteQuery:h=>({...h,type:"infinitequery"})});for(let[h,S]of Object.entries(y)){if(p.overrideExisting!==!0&&h in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error($e(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[h]=S;for(let g of f)g.injectEndpoint(h,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function dt(e,...t){return Object.assign(e,...t)}var vv=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:f}=e.internalActions,m=(g,v)=>{var k,x;if(a.match(v)){let{queryCacheKey:P,requestId:w,options:E}=v.payload;return g?.[P]?.[w]&&(g[P][w]=E),!0}if(f.match(v)){let{queryCacheKey:P,requestId:w}=v.payload;return g[P]&&delete g[P][w],!0}if(e.internalActions.removeQueryResult.match(v))return delete g[v.payload.queryCacheKey],!0;if(t.pending.match(v)){let{meta:{arg:P,requestId:w}}=v,E=g[k=P.queryCacheKey]??(g[k]={});return E[`${w}_running`]={},P.subscribe&&(E[w]=P.subscriptionOptions??E[w]??{}),!0}let R=!1;if(t.fulfilled.match(v)||t.rejected.match(v)){let P=g[v.meta.arg.queryCacheKey]||{},w=`${v.meta.requestId}_running`;R||(R=!!P[w]),delete P[w]}if(t.rejected.match(v)){let{meta:{condition:P,arg:w,requestId:E}}=v;if(P&&w.subscribe){let M=g[x=w.queryCacheKey]??(g[x]={});M[E]=w.subscriptionOptions??M[E]??{},R=!0}}return R},p=()=>r.currentSubscriptions,S={getSubscriptions:p,getSubscriptionCount:g=>{let R=p()[g]??{};return qr(R)},isRequestSubscribed:(g,v)=>!!p()?.[g]?.[v]};return(g,v)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let R=m(r.currentSubscriptions,g),k=!0;if(R){i||(i=setTimeout(()=>{let w=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,E]=Jn(o,()=>w);v.next(e.internalActions.subscriptionsUpdated(E)),o=w,i=null},500));let x=typeof g.type=="string"&&!!g.type.startsWith(n),P=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;k=!x&&!P}return[k,!1]}};function bv(e){for(let t in e)return!1;return!0}var Av=2147483647/1e3-1,Cv=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:f,unsubscribeQueryResult:m,cacheEntriesUpserted:p}=t.internalActions,y=Ke(m.match,r.fulfilled,r.rejected,p.match);function h(k){let x=o.currentSubscriptions[k];return!!x&&!bv(x)}let S={},g=(k,x,P)=>{let w=x.getState(),E=a(w);if(y(k)){let M;if(p.match(k))M=k.payload.map(O=>O.queryDescription.queryCacheKey);else{let{queryCacheKey:O}=m.match(k)?k.payload:k.meta.arg;M=[O]}v(M,x,E)}if(t.util.resetApiState.match(k))for(let[M,O]of Object.entries(S))O&&clearTimeout(O),delete S[M];if(n.hasRehydrationInfo(k)){let{queries:M}=n.extractRehydrationInfo(k);v(Object.keys(M),x,E)}};function v(k,x,P){let w=x.getState();for(let E of k){let M=i(w,E);R(E,M?.endpointName,x,P)}}function R(k,x,P,w){let M=n.endpointDefinitions[x]?.keepUnusedDataFor??w.keepUnusedDataFor;if(M===1/0)return;let O=Math.max(0,Math.min(M,Av));if(!h(k)){let I=S[k];I&&clearTimeout(I),S[k]=setTimeout(()=>{h(k)||P.dispatch(f({queryCacheKey:k})),delete S[k]},O*1e3)}}return g},Ld=new Error("Promise never resolved before cacheEntryRemoved."),wv=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:f}})=>{let m=ro(n),p=ro(o),y=it(n,o),h={};function S(x,P,w){let E=h[x];E?.valueResolved&&(E.valueResolved({data:P,meta:w}),delete E.valueResolved)}function g(x){let P=h[x];P&&(delete h[x],P.cacheEntryRemoved())}let v=(x,P,w)=>{let E=R(x);function M(O,I,F,T){let N=a(w,I),$=a(P.getState(),I);!N&&$&&k(O,T,I,P,F)}if(n.pending.match(x))M(x.meta.arg.endpointName,E,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:O,value:I}of x.payload){let{endpointName:F,originalArgs:T,queryCacheKey:N}=O;M(F,N,x.meta.requestId,T),S(N,I,{})}else if(o.pending.match(x))P.getState()[t].mutations[E]&&k(x.meta.arg.endpointName,x.meta.arg.originalArgs,E,P,x.meta.requestId);else if(y(x))S(E,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))g(E);else if(e.util.resetApiState.match(x))for(let O of Object.keys(h))g(O)};function R(x){return m(x)?x.meta.arg.queryCacheKey:p(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?In(x.payload):""}function k(x,P,w,E,M){let O=r.endpointDefinitions[x],I=O?.onCacheEntryAdded;if(!I)return;let F={},T=new Promise(B=>{F.cacheEntryRemoved=B}),N=Promise.race([new Promise(B=>{F.valueResolved=B}),T.then(()=>{throw Ld})]);N.catch(()=>{}),h[w]=F;let $=e.endpoints[x].select(O.type==="query"?P:w),U=E.dispatch((B,L,z)=>z),V={...E,getCacheEntry:()=>$(E.getState()),requestId:M,extra:U,updateCachedData:O.type==="query"?B=>E.dispatch(e.util.updateQueryData(x,P,B)):void 0,cacheDataLoaded:N,cacheEntryRemoved:T},_=I(P,V);Promise.resolve(_).catch(B=>{if(B!==Ld)throw B})}return v},xv=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Rv=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:f,internalState:m})=>{let{removeQueryResult:p}=i.internalActions,y=Ke(it(n),ln(n)),h=Ke(it(n,o),Ut(n,o)),S=[],g=(k,x)=>{y(k)?R(Wd(k,"invalidatesTags",r,a),x):h(k)?R([],x):i.util.invalidateTags.match(k)&&R(Ts(k.payload,void 0,void 0,void 0,void 0,a),x)};function v(k){let{queries:x,mutations:P}=k;for(let w of[x,P])for(let E in w)if(w[E]?.status==="pending")return!0;return!1}function R(k,x){let P=x.getState(),w=P[e];if(S.push(...k),w.config.invalidationBehavior==="delayed"&&v(w))return;let E=S;if(S=[],E.length===0)return;let M=i.util.selectInvalidatedBy(P,E);t.batch(()=>{let O=Array.from(M.values());for(let{queryCacheKey:I}of O){let F=w.queries[I],T=m.currentSubscriptions[I]??{};F&&(qr(T)===0?x.dispatch(p({queryCacheKey:I})):F.status!=="uninitialized"&&x.dispatch(f(F)))}})}return g},Ev=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,v)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&p(g.payload,v),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&p(g.meta.arg,v),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&m(g.meta.arg,v),r.util.resetApiState.match(g)&&h()};function f(g,v){let k=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!(!k||k.status==="uninitialized"))return x}function m({queryCacheKey:g},v){let R=v.getState()[e],k=R.queries[g],x=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:P,skipPollingIfUnfocused:w}=S(x);if(!Number.isFinite(P))return;let E=i[g];E?.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);let M=Date.now()+P;i[g]={nextPollTimestamp:M,pollingInterval:P,timeout:setTimeout(()=>{(R.config.focused||!w)&&v.dispatch(n(k)),m({queryCacheKey:g},v)},P)}}function p({queryCacheKey:g},v){let k=v.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!k||k.status==="uninitialized")return;let{lowestPollingInterval:P}=S(x);if(!Number.isFinite(P)){y(g);return}let w=i[g],E=Date.now()+P;(!w||E<w.nextPollTimestamp)&&m({queryCacheKey:g},v)}function y(g){let v=i[g];v?.timeout&&clearTimeout(v.timeout),delete i[g]}function h(){for(let g of Object.keys(i))y(g)}function S(g={}){let v=!1,R=Number.POSITIVE_INFINITY;for(let k in g)g[k].pollingInterval&&(R=Math.min(g[k].pollingInterval,R),v=g[k].skipPollingIfUnfocused||v);return{lowestPollingInterval:R,skipPollingIfUnfocused:v}}return a},Iv=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=to(r,n),i=Ut(r,n),a=it(r,n),f={};return(p,y)=>{if(o(p)){let{requestId:h,arg:{endpointName:S,originalArgs:g}}=p.meta,v=t.endpointDefinitions[S],R=v?.onQueryStarted;if(R){let k={},x=new Promise((M,O)=>{k.resolve=M,k.reject=O});x.catch(()=>{}),f[h]=k;let P=e.endpoints[S].select(v.type==="query"?g:h),w=y.dispatch((M,O,I)=>I),E={...y,getCacheEntry:()=>P(y.getState()),requestId:h,extra:w,updateCachedData:v.type==="query"?M=>y.dispatch(e.util.updateQueryData(S,g,M)):void 0,queryFulfilled:x};R(g,E)}}else if(a(p)){let{requestId:h,baseQueryMeta:S}=p.meta;f[h]?.resolve({data:p.payload,meta:S}),delete f[h]}else if(i(p)){let{requestId:h,rejectedWithValue:S,baseQueryMeta:g}=p.meta;f[h]?.reject({error:p.payload??p.error,isUnhandledError:!S,meta:g}),delete f[h]}}},kv=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(m,p)=>{ks.match(m)&&f(p,"refetchOnFocus"),Ps.match(m)&&f(p,"refetchOnReconnect")};function f(m,p){let y=m.getState()[e],h=y.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let v=h[g],R=S[g];if(!R||!v)continue;(Object.values(R).some(x=>x[p]===!0)||Object.values(R).every(x=>x[p]===void 0)&&y.config[p])&&(qr(R)===0?m.dispatch(i({queryCacheKey:g})):v.status!=="uninitialized"&&m.dispatch(n(v)))}})}return a};function Pv(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:D(`${t}/invalidateTags`)},f=h=>h.type.startsWith(`${t}/`),m=[xv,Cv,Rv,Ev,wv,Iv];return{middleware:h=>{let S=!1,v={...e,internalState:{currentSubscriptions:{}},refetchQuery:y,isThisApiSliceAction:f},R=m.map(P=>P(v)),k=vv(v),x=kv(v);return P=>w=>{if(!Hn(w))return P(w);S||(S=!0,h.dispatch(n.internalActions.middlewareRegistered(i)));let E={...h,next:P},M=h.getState(),[O,I]=k(w,E,M),F;if(O?F=P(w):F=I,h.getState()[t]&&(x(w,E,M),f(w)||o.hasRehydrationInfo(w)))for(let T of R)T(w,E,M);return F}},actions:a};function y(h){return e.api.endpoints[h.endpointName].initiate(h.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Ud=Symbol(),Fv=({createSelector:e=pe}={})=>({name:Ud,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:f,refetchOnFocus:m,refetchOnReconnect:p,invalidationBehavior:y},h){Xc();let S=ee=>(typeof process<"u",ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Ps,onOffline:zd,onFocus:ks,onFocusLost:Hd},util:{}});let g=hv({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:v,selectCachedArgsForQuery:R,buildQuerySelector:k,buildInfiniteQuerySelector:x,buildMutationSelector:P}=g;dt(t.util,{selectInvalidatedBy:v,selectCachedArgsForQuery:R});let{queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,patchQueryData:O,updateQueryData:I,upsertQueryData:F,prefetch:T,buildMatchThunkActions:N}=gv({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:$,actions:U}=yv({context:h,queryThunk:w,infiniteQueryThunk:E,mutationThunk:M,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:m,refetchOnReconnect:p,refetchOnMountOrArgChange:f,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:y}});dt(t.util,{patchQueryData:O,updateQueryData:I,upsertQueryData:F,prefetch:T,resetApiState:U.resetApiState,upsertQueryEntries:U.cacheEntriesUpserted}),dt(t.internalActions,U);let{middleware:V,actions:_}=Pv({reducerPath:o,context:h,queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,assertTagType:S,selectors:g});dt(t.util,_),dt(t,{reducer:$,middleware:V});let{buildInitiateQuery:B,buildInitiateInfiniteQuery:L,buildInitiateMutation:z,getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueriesThunk:te,getRunningQueryThunk:se}=fv({queryThunk:w,mutationThunk:M,infiniteQueryThunk:E,api:t,serializeQueryArgs:i,context:h});return dt(t.util,{getRunningMutationThunk:G,getRunningMutationsThunk:Y,getRunningQueryThunk:se,getRunningQueriesThunk:te}),{name:Ud,injectEndpoint(ee,re){var ye;let oe=(ye=t.endpoints)[ee]??(ye[ee]={});Fs(re)&&dt(oe,{name:ee,select:k(ee,re),initiate:B(ee,re)},N(w,ee)),lv(re)&&dt(oe,{name:ee,select:P(),initiate:z(ee)},N(M,ee)),Os(re)&&dt(oe,{name:ee,select:x(ee,re),initiate:L(ee,re)},N(w,ee))}}}}),Yd=Sv(Fv());var Ov=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,f=n.generatedAnswer.answerConfigurationId,m={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let p=ke(a,i);return{data:Bd({baseUrl:`${p}/rest/organizations/${a}/answer/v1/configs/${f}`,fetchFn:function(){var _ref44=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=h.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{g[v]=h[v]}),g.duplex="half",g.body=yield h.text(),A(S,g)});return function fetchFn(_x119){return _ref44.apply(this,arguments)}}()})(m,{...t,signal:null},r)}}catch(p){return{error:p}}});return function Ov(_x116,_x117,_x118){return _ref43.apply(this,arguments)}}(),Jd=Yd({reducerPath:"answer",baseQuery:$d(Ov,{maxRetries:3}),endpoints:()=>({})});var Tv=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},Dv=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},qv=(e,t)=>{e.citations=t.citations},jv=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},Mv=(e,t)=>{e.error={message:t.errorMessage,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`${t.errorMessage} - code ${t.code}`)},Nv=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&Mv(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(Tv(t,o),r(vs(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(Dv(t,o),r(hs({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(qv(t,o),r(Ss({citations:o.citations})));break;case"genqa.endOfStreamType":jv(t,o),r(si(o.answerGenerated??!1));break}},Ds=Jd.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x120,_x121){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:f,insightConfiguration:m}=r(),{organizationId:p,environment:y,accessToken:h}=a,S=ke(p,y),g=`${S}/rest/organizations/${p}/insight/v1/configs/${m?.insightId}/answer/${f.answerConfigurationId}/generate`,v=`${S}/rest/organizations/${p}/answer/v1/configs/${f.answerConfigurationId}/generate`;yield kd(m?g:v,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref45=_asyncToGenerator(function*(R){let k=R.headers.get("x-answer-id");k&&o(x=>{x.answerId=k})});return function onopen(_x122){return _ref45.apply(this,arguments)}}(),onmessage:R=>{o(k=>{Nv(R,k,i)})},onerror:R=>{throw R},onclose:()=>{o(R=>{i(bs(!R.generated))})}})}).apply(this,arguments)}})})}),p1=pe(e=>As(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),di={},_v=(e,t)=>({...di,[e]:oi(t)?.map(r=>us(r,cs())).sort((r,n)=>r.facetId>n.facetId?1:n.facetId>r.facetId?-1:0)}),Vv=e=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,Lv=e=>{let t=Ja(e),r=Uv(e);return{...t,...(r&&{cq:r})}},Uv=e=>{let t=Ad(e.tabSet),r=ai(e),{cq:n}=Ja(e);return[t,...r,n].filter(o=>!!o).join(" AND ")},Qv=(e,t,r)=>{let n=As(e)?.q,{aq:o,cq:i,dq:a,lq:f}=Lv(e),m=Pl(e),p=t==="select"?{}:Vo(e.configuration.analytics,r,{actionCause:vd(e)}),y=bd(e),h=yd(e),S=il(e)??[];return n&&t==="fetch"&&(di=_v(n,e)),{q:n,...(o&&{aq:o}),...(i&&{cq:i}),...(a&&{dq:a}),...(f&&{lq:f}),...(e.query&&{enableQuerySyntax:e.query.enableQuerySyntax}),...(m?.contextValues&&{context:m.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:S}},...(y?.length&&{searchHub:y}),...(h?.length&&{pipeline:h}),...(di[n]?.length&&{facets:di[n]}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Vv(e),firstResult:e.pagination.firstResult}),tab:Cs(e.tabSet),...p}},gd=(e,t)=>Ds.endpoints.getAnswer.initiate(Qv(e,"fetch",t));d();c();l();u();var Xd=ge(sr,e=>e);d();c();l();u();function Bv(e){let t=e.payload?.analyticsAction;return Zd(e)&&!X(t)}function Zd(e){return"type"in e}var ep=e=>t=>r=>{let n;Bv(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return Zd(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var q1=D("tab/register",e=>{let t=new K({values:{id:W,expression:we}});return Q(e,t)}),pi=D("tab/updateActiveTab",e=>Q(e,W));d();c();l();u();var fi=Qe(Ko(),1),np=Qe(tp(),1),op=Qe(rp(),1);fi.default.extend(op.default);fi.default.extend(np.default);var ip=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:fi.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:""},environment:"prod"});d();c();l();u();var $v=/(^|; )Coveo-Pendragon=([^;]*)/;function _s(){return typeof window>"u"?!1:$v.exec(document.cookie)?.pop()||null}var ap=ge(ip(),e=>e.addCase(st,(t,r)=>{Hv(t,r.payload)}).addCase(Ye,(t,r)=>{zv(t,r.payload)}).addCase(cr,(t,r)=>{Gv(t,r.payload)}).addCase(ur,t=>{t.analytics.enabled=!1}).addCase(lr,t=>{t.analytics.enabled=!0}).addCase(io,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(ao,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(pi,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Eu,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(St,(t,r)=>{X(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}));function Hv(e,t){X(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",X(t.organizationId)||(e.organizationId=t.organizationId)}function zv(e,t){X(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),X(t.locale)||(e.search.locale=t.locale),X(t.timezone)||(e.search.timezone=t.timezone),X(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function Gv(e,t){X(t.enabled)||(e.analytics.enabled=t.enabled),X(t.originContext)||(e.analytics.originContext=t.originContext),X(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),X(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),X(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),X(t.trackingId)||(e.analytics.trackingId=t.trackingId),X(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),X(t.source)||(e.analytics.source=t.source);try{let r=_s();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}X(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),X(t.anonymous)||(e.analytics.anonymous=t.anonymous),X(t.deviceId)||(e.analytics.deviceId=t.deviceId),X(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),X(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var He=ap;d();c();l();u();function Wv(e){return e.instantlyCallable}var sp=()=>e=>t=>e(Wv(t)?t():t);d();c();l();u();var cp=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error,i=[n.payload?.errorCode,n.payload?.message].filter(Boolean).join(" - ");if(n.payload?.ignored||e.error(i||o.stack||o.message||o.name||"Error",`Action dispatch error ${n.type}`,r),n.error.name!=="SchemaValidationError")return t(r)},up=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();function lp(e,t){let r={...e},n,o=i=>(a,f)=>{let m=i(a,f);return n?n(m,f):m};return{get combinedReducer(){let i=bc(Object.entries(t).filter(([a])=>!(a in r)).map(([a,f])=>[a,()=>f]));return o(tr({...i,...r}))},containsAll(i){return Object.keys(i).every(f=>f in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}d();c();l();u();d();c();l();u();function mi(e,t,r){var n,o,i;t===void 0&&(t=50),r===void 0&&(r={});var a=(n=r.isImmediate)!=null&&n,f=(o=r.callback)!=null&&o,m=r.maxWait,p=Date.now(),y=[];function h(){if(m!==void 0){var g=Date.now()-p;if(g+t>=m)return m-g}return t}var S=function(){var g=[].slice.call(arguments),v=this;return new Promise(function(R,k){var x=a&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,p=Date.now(),!a){var w=e.apply(v,g);f&&f(w),y.forEach(function(E){return(0,E.resolve)(w)}),y=[]}},h()),x){var P=e.apply(v,g);return f&&f(P),R(P)}y.push({resolve:R,reject:k})})};return S.cancel=function(g){i!==void 0&&clearTimeout(i),y.forEach(function(v){return(0,v.reject)(g)}),y=[]},S}d();c();l();u();function Kv(e){if(!e||!Yv(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function dp(e,t=60){if(!e)return!1;let r=Kv(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function Yv(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function fp(e,t){let r=0,n=mi(()=>{r=0},500);return o=>i=>(/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(a){if(!(typeof a=="function"))return i(a);let m=typeof t=="function";if(m){let h=o.getState(),S=Zv(h);if(S&&dp(S)){e.debug("Access token is expired or about to expire, attempting renewal.");try{let g=yield t();g?(o.dispatch(st({accessToken:g})),e.debug("Access token was renewed.")):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(g){e.warn(g,"Access token renewal failed. A retry will occur if necessary.")}}}let p=yield i(a);if(!Jv(p))return p;if(!m)return e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),pp(o,p.error),p;if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),pp(o,p.error),p;r++,n();let y=yield Xv(t);o.dispatch(st({accessToken:y})),o.dispatch(a)});return function(_x123){return _ref46.apply(this,arguments)}}())}function Jv(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new er().name}function pp(e,t){e.dispatch(po({status:401,statusCode:401,message:t.message,type:t.name}))}function Xv(_x124){return _Xv.apply(this,arguments)}function _Xv(){_Xv=_asyncToGenerator(function*(e){try{return yield e()}catch{return""}});return _Xv.apply(this,arguments)}function Zv(e){return e.configuration.accessToken}d();c();l();u();function mp({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return lu({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(up(n.logger))})}function eb(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&vc()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function gp(e,t){let r={...e.reducers,configuration:He,version:Xd},n=tb({...e,reducers:r},t,He),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(st({accessToken:o,environment:i,organizationId:a}));let f=eb(e.configuration,n.logger);return f&&n.dispatch(cr(f)),n}function tb(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=lp({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,f={...t,get relay(){return Sn(p.state,o)},get navigatorContext(){return Ya(this.relay,o)}},m=rb(e,f,i),p={addReducers(y){i.containsAll(y)||(i.add(y),m.replaceReducer(i.combinedReducer))},dispatch:m.dispatch,subscribe:m.subscribe,enableAnalytics(){m.dispatch(lr())},disableAnalytics(){m.dispatch(ur())},get state(){return m.getState()},get relay(){return Sn(this.state,o)},get navigatorContext(){return Ya(this.relay,o)},logger:a,store:m};return p}function rb(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=nb(e,t.logger);return mp({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function nb(e,t){let{renewAccessToken:r}=e.configuration,n=fp(t,r);return[sp,n,cp(t),ep].concat(Ds.middleware,e.middlewares||[])}d();c();l();u();var xp=Qe(wp(),1);function Rp(e){return(0,xp.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function Ep(e,t){let r=Ab(e),n=Ve,o=Cb(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function Ab(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function Cb(e){return e.preprocessRequest||Vn}d();c();l();u();d();c();l();u();var Ip={organizationId:W,accessToken:W,name:new H({required:!1,emptyAllowed:!1}),analytics:new K({options:{required:!1},values:{enabled:new ne({required:!1}),originContext:new H({required:!1}),originLevel2:new H({required:!1}),originLevel3:new H({required:!1}),analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new H({required:!1,url:!0}),trackingId:new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new H({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function kp(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var Pp=new Fe({...Ip,pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Ce,locale:Ce,timezone:Ce});function $s(){return{...kp(),searchHub:"default"}}var wb={debug:lo,pipeline:fr,searchHub:Ir,recommendation:Rr};function Fp(e){let t=Rp(e.loggerOptions);xb(e.configuration,t);let r=Rb(e.configuration,t),n={...Ep(e.configuration,t),apiClient:r},o={...e,reducers:wb},i=gp(o,n),{pipeline:a,searchHub:f,timezone:m,locale:p,proxyBaseUrl:y}=e.configuration;return i.dispatch(Ye({timezone:m,locale:p,proxyBaseUrl:y})),X(a)||i.dispatch(dr(a)),X(f)||i.dispatch(Er(f)),{...i,get state(){return i.state}}}function xb(e,t){try{Pp.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function Rb(e,t){return new Qn({logger:t,preprocessRequest:e.preprocessRequest||Vn,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Nc,postprocessFacetSearchResponseMiddleware:_c,postprocessQuerySuggestResponseMiddleware:Vc})}d();c();l();u();d();c();l();u();d();c();l();u();var Eb=new ie({each:W,required:!0}),Op=(e,t)=>(Q(e,W),jn(t)?Q(t,W):Q(t,Eb),{payload:{contextKey:e,contextValue:t}}),zt=D("context/set",e=>{for(let[t,r]of Object.entries(e))Op(t,r);return{payload:e}}),Gt=D("context/add",e=>Op(e.contextKey,e.contextValue)),Wt=D("context/remove",e=>Q(e,W));d();c();l();u();var hi=ge(ei(),e=>{e.addCase(zt,(t,r)=>{t.contextValues=r.payload}).addCase(Gt,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Wt,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();function Dt(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),f=t!==a;return t=a,f}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),f;return n()&&(t=JSON.stringify(this.state),f=e.subscribe(()=>{o(this.state)&&r.forEach(m=>m())})),r.set(a,i),()=>{r.delete(a),n()&&f?.()}},get state(){return{}}}}d();c();l();u();var Ib=["caseId","caseNumber"],kb={caseId:"caseContext",caseNumber:"caseContext"},Pn=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${kb[t]} to set this value.}`)}};function Hs(e){return Ib.includes(e)}var Pb=new Fe({values:new K({options:{required:!1}})});function Tp(e,t={}){if(!Tb(e))throw ze;let r=Dt(e),{dispatch:n}=e,o=()=>e.state,i=bu(e,Pb,t.initialState,"buildContext");return i.values&&n(zt(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(zt(a))},...(o().configuration.analytics.analyticsMode==="legacy"?Fb(n):Ob(n))}}var Fb=e=>({add(t,r){e(Gt({contextKey:t,contextValue:r}))},remove(t){e(Wt(t))}}),Ob=e=>({add(t,r){if(Hs(t))throw new Pn(t);e(Gt({contextKey:t,contextValue:r}))},remove(t){if(Hs(t))throw new Pn(t);e(Wt(t))}});function Tb(e){return e.addReducers({context:hi}),!0}function Dp(e,t){return Tp(e,t)}d();c();l();u();d();c();l();u();var Nr=D("dictionaryFieldContext/set",e=>{let t=new K({options:{required:!0}}),r=Q(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:we}),i=Q(n,o).error;return i?{payload:e,error:i}:{payload:e}}),_r=D("dictionaryFieldContext/add",e=>{let t=new K({options:{required:!0},values:{field:we,key:we}});return Q(e,t)}),Vr=D("dictionaryFieldContext/remove",e=>Q(e,we));d();c();l();u();var Si=ge(ti(),e=>{e.addCase(Nr,(t,r)=>{t.contextValues=r.payload}).addCase(_r,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Vr,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function qp(e){if(!Db(e))throw ze;let t=Dt(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Nr(o))},add(o,i){r(_r({field:o,key:i}))},remove(o){r(Vr(o))}}}function Db(e){return e.addReducers({dictionaryFieldContext:Si}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Fn={value:W,numberOfResults:new J({min:0}),state:W};d();c();l();u();var le=W;var Nb=new J({min:1,default:8,required:!1}),_b=new J({min:1,max:20,default:5,required:!1}),Vb={desiredCount:_b,numberOfValues:Nb},gz=D("automaticFacet/setOptions",e=>Q(e,Vb)),yz=D("automaticFacet/deselectAll",e=>Q(e,le)),Lb=W,jp=D("automaticFacet/toggleSelectValue",e=>Q(e,{field:Lb,selection:new K({values:Fn})}));d();c();l();u();d();c();l();u();var Ub={state:new fe({required:!0}),numberOfResults:new J({required:!0,min:0}),value:new H({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:W}),moreValuesAvailable:new ne({required:!1})};function zs(e){e.children.forEach(t=>{zs(t)}),Ve({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},Ub)}var Lr={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),delimitingCharacter:new H({required:!1,emptyAllowed:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),basePath:new ie({required:!1,each:W}),filterByBasePath:new ne({required:!1})};var qz=D("categoryFacet/register",e=>Q(e,Lr)),Mp=D("categoryFacet/toggleSelectValue",e=>{try{return Ve(e.facetId,W),zs(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:at(t)}}}),Np=D("categoryFacet/deselectAll",e=>Q(e,Lr.facetId)),jz=D("categoryFacet/updateNumberOfValues",e=>Q(e,{facetId:Lr.facetId,numberOfValues:Lr.numberOfValues})),Mz=D("categoryFacet/updateSortCriterion",e=>Q(e,{facetId:Lr.facetId,criterion:new fe})),Nz=D("categoryFacet/updateBasePath",e=>Q(e,{facetId:Lr.facetId,basePath:new ie({each:W})}));d();c();l();u();d();c();l();u();var On={facetId:le,captions:new K({options:{required:!1}}),numberOfValues:new J({required:!1,min:1}),query:new H({required:!1,emptyAllowed:!0})};var Qb={path:new ie({required:!0,each:W}),displayValue:we,rawValue:we,count:new J({required:!0,min:0})},_p=D("categoryFacet/selectSearchResult",e=>Q(e,{facetId:le,value:new K({values:Qb})})),t2=D("categoryFacetSearch/register",e=>Q(e,On));d();c();l();u();var Vp={facetId:le,value:new K({values:{displayValue:we,rawValue:we,count:new J({required:!0,min:0})}})},p2=D("facetSearch/register",e=>Q(e,On)),f2=D("facetSearch/update",e=>Q(e,On)),Lp=D("facetSearch/toggleSelectValue",e=>Q(e,Vp)),Up=D("facetSearch/toggleExcludeValue",e=>Q(e,Vp));d();c();l();u();d();c();l();u();var b2=new H({regex:/^[a-zA-Z0-9-_]+$/}),A2=new H({required:!0}),C2=new ie({each:new H}),w2=new H,x2=new ne,R2=new ne,E2=new J({min:0}),Bb=new J({min:1}),I2=new ne({required:!0}),$b=new K,Hb=new H,zb={captions:$b,numberOfValues:Bb,query:Hb},k2=new K({values:zb}),Qp=new K({options:{required:!1},values:{type:new H({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new H({emptyAllowed:!1,required:!0})})}}),P2=new ne,Bp=new ie({min:1,max:25,required:!1,each:new H({emptyAllowed:!1,required:!0})});var Gb={facetId:le,field:new H({required:!0,emptyAllowed:!0}),tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),resultsMustMatch:new fe({required:!1}),allowedValues:Qp,customSort:Bp},U2=D("facet/register",e=>Q(e,Gb)),$p=D("facet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:Fn})})),Hp=D("facet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:Fn})})),vi=D("facet/deselectAll",e=>Q(e,le)),Q2=D("facet/updateSortCriterion",e=>Q(e,{facetId:le,criterion:new fe({required:!0})})),B2=D("facet/updateNumberOfValues",e=>Q(e,{facetId:le,numberOfValues:new J({required:!0,min:1})})),$2=D("facet/updateIsFieldExpanded",e=>Q(e,{facetId:le,isFieldExpanded:new ne({required:!0})})),H2=D("facet/updateFreezeCurrentValues",e=>Q(e,{facetId:le,freezeCurrentValues:new ne({required:!0})}));d();c();l();u();d();c();l();u();function Gp(e){let t=zp(e.start,e),r=zp(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function zp(e,t){let{dateFormat:r}=t;return Hl(e)?(ss(e),Ql(e)):typeof e=="string"&&Rt(e)?(ss(e),e):(_l(e,r),Jo(Or(e,r)))}d();c();l();u();var Wp=D("rangeFacet/updateSortCriterion",e=>Q(e,{facetId:le,criterion:new fe({required:!0})}));d();c();l();u();var bi={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ne({required:!0}),numberOfResults:new J({required:!0,min:0})},Ai={start:W,end:W,endInclusive:new ne({required:!0}),state:W,numberOfResults:new J({required:!0,min:0})};var Wb={start:W,end:W,endInclusive:new ne({required:!0}),state:W},Kb={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:Wb})}),generateAutomaticRanges:new ne({required:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function Kp(e){return Rt(e)?An(e):e}function Yp(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Gp(t);if(Or(Kp(r)).isAfter(Or(Kp(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var OG=D("dateFacet/register",e=>{try{return Ve(e,Kb),Yp(e),{payload:e,error:null}}catch(t){return{payload:e,error:at(t)}}}),Jp=D("dateFacet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:Ai})})),Xp=D("dateFacet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:Ai})})),Zp=D("dateFacet/updateFacetValues",e=>{try{return Ve(e,{facetId:le,values:new ie({each:new K({values:Ai})})}),Yp({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:at(t)}}});d();c();l();u();var Yb={state:W,start:new J({required:!0}),end:new J({required:!0}),endInclusive:new ne({required:!0})},Jb={facetId:le,field:W,tabs:new K({options:{required:!1},values:{included:new ie({each:new H}),excluded:new ie({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ie({required:!1,each:new K({values:Yb})}),generateAutomaticRanges:new ne({required:!0}),filterFacetCount:new ne({required:!1}),injectionDepth:new J({required:!1,min:0}),numberOfValues:new J({required:!1,min:1}),sortCriteria:new fe({required:!1}),rangeAlgorithm:new fe({required:!1})};function ef(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var $G=D("numericFacet/register",e=>{try{return Q(e,Jb),ef(e),{payload:e,error:null}}catch(t){return{payload:e,error:at(t)}}}),tf=D("numericFacet/toggleSelectValue",e=>Q(e,{facetId:le,selection:new K({values:bi})})),rf=D("numericFacet/toggleExcludeValue",e=>Q(e,{facetId:le,selection:new K({values:bi})})),nf=D("numericFacet/updateFacetValues",e=>{try{return Ve(e,{facetId:le,values:new ie({each:new K({values:bi})})}),ef({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:at(t)}}});var of=ge(Cn(),e=>{e.addCase($o,(t,r)=>{let n=Gs(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Tn(n,o)}).addCase(Ho,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(pi,t=>{t.firstResult=0}).addCase(zo,(t,r)=>{let n=r.payload;t.firstResult=Tn(n,t.numberOfResults)}).addCase(kr,(t,r)=>{let n=r.payload;t.firstResult=Tn(n,t.numberOfResults)}).addCase(Wo,t=>{let r=Gs(t),n=Math.max(r-1,1);t.firstResult=Tn(n,t.numberOfResults)}).addCase(Go,t=>{let r=Gs(t),n=Zb(t),o=Math.min(r+1,n);t.firstResult=Tn(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(St,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(ad.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(vi,t=>{Ie(t)}).addCase(Xp,t=>{Ie(t)}).addCase(Hp,t=>{Ie(t)}).addCase(rf,t=>{Ie(t)}).addCase(Up,t=>{Ie(t)}).addCase($p,t=>{Ie(t)}).addCase(Np,t=>{Ie(t)}).addCase(Mp,t=>{Ie(t)}).addCase(_p,t=>{Ie(t)}).addCase(Jp,t=>{Ie(t)}).addCase(tf,t=>{Ie(t)}).addCase(Lo,t=>{Ie(t)}).addCase(Zp,t=>{Ie(t)}).addCase(nf,t=>{Ie(t)}).addCase(Lp,t=>{Ie(t)}).addCase(jp,t=>{Ie(t)})});function Ie(e){e.firstResult=Cn().firstResult}function Gs(e){let{firstResult:t,numberOfResults:r}=e;return eA(t,r)}function Zb(e){let{totalCountFiltered:t,numberOfResults:r}=e;return tA(t,r)}function Tn(e,t){return(e-1)*t}function eA(e,t){return Math.round(e/t)+1}function tA(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Ws(e){return e.addReducers({pagination:of}),{nextPage:Go,previousPage:Wo,registerNumberOfResults:$o,registerPage:zo,updateNumberOfResults:Ho,updatePage:kr}}var rA=new Fe({id:new H({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new J({min:0})});function af(e,t={}){if(!nA(e))throw ze;let r=Dt(e),{dispatch:n}=e,o=()=>e.state,i=Au(e,rA,t.options,"buildRecommendationList");return i.id!==""&&n(xr({id:i.id})),i.numberOfRecommendations&&n(Ws(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(At())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function nA(e){return e.addReducers({recommendation:Rr,configuration:He}),!0}d();c();l();u();d();c();l();u();function sf(e,t,r){if(!oA(e))throw ze;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:mi(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function oA(e){return e.addReducers({configuration:He}),!0}function cf(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(_o(t.options.result)))};return sf(e,t,()=>{n()})}d();c();l();u();d();c();l();u();d();c();l();u();var qt=()=>new H({required:!1,emptyAllowed:!0}),Ci=D("advancedSearchQueries/update",e=>Q(e,{aq:qt(),cq:qt(),lq:qt(),dq:qt()})),wi=D("advancedSearchQueries/register",e=>Q(e,{aq:qt(),cq:qt(),lq:qt(),dq:qt()}));var uf=ge(wt(),e=>{e.addCase(Ci,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0),ve(i)||(t.lq=i,t.lqWasSet=!0),ve(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(wi,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ve(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ve(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ve(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ve(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(St,(t,r)=>{let{aq:n,cq:o}=r.payload;ve(n)||(t.aq=n,t.aqWasSet=!0),ve(o)||(t.cq=o,t.cqWasSet=!0)})});function iA(e){return e.addReducers({advancedSearchQueries:uf}),{updateAdvancedSearchQueries:Ci,registerAdvancedSearchQueries:wi}}d();c();l();u();function aA(e){return e.addReducers({configuration:He}),{disableAnalytics:ur,enableAnalytics:lr,setOriginLevel2:io,setOriginLevel3:ao,updateAnalyticsConfiguration:cr,updateBasicConfiguration:st}}d();c();l();u();function sA(e){return e.addReducers({configuration:He,pipeline:fr,searchHub:Ir}),{updateSearchConfiguration:Ye}}d();c();l();u();function cA(e){return e.addReducers({context:hi}),{addContext:Gt,removeContext:Wt,setContext:zt}}d();c();l();u();function uA(e){return e.addReducers({debug:lo}),{disableDebug:co,enableDebug:so}}d();c();l();u();function lA(e){return e.addReducers({dictionaryFieldContext:Si}),{addContext:_r,removeContext:Vr,setContext:Nr}}d();c();l();u();d();c();l();u();d();c();l();u();var dA={collectionField:new H({emptyAllowed:!1,required:!1}),parentField:new H({emptyAllowed:!1,required:!1}),childField:new H({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new J({min:0,required:!1})},lf=D("folding/register",e=>Q(e,dA)),fK=ue("folding/loadCollection",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Ct(i):Fr(i,o),f=yield n.search({...a,q:pA(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return Oe(f)?r(f.error):{collectionId:e,results:f.success.results,searchUid:f.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x125,_x126){return _ref47.apply(this,arguments)}}());function pA(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var df=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});d();c();l();u();var Ur=D("fields/registerFieldsToInclude",e=>Q(e,oo)),xi=D("fields/fetchall/enable"),Ri=D("fields/fetchall/disable"),Ei=ue("fields/fetchDescription",/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:f}=o.configuration,{apiBaseUrl:m}=o.configuration.search,p=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:f,url:m??mt(f,a)});return Oe(p)?n(p.error):p.success.fields});return function(_x127,_x128){return _ref48.apply(this,arguments)}}());d();c();l();u();var Ii=["author","language","urihash","objecttype","collection","source","permanentid"],Ks=[...Ii,"date","filetype","parents"],pf=[...Ks,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],ff=()=>({fieldsToInclude:Ii,fetchAllFields:!1,fieldsDescription:[]});var ki=ge(ff(),e=>e.addCase(Ur,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(xi,t=>{t.fetchAllFields=!0}).addCase(Ri,t=>{t.fetchAllFields=!1}).addCase(Ei.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(lf,(t,{payload:r})=>{let n=df().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function fA(e){return e.addReducers({fields:ki}),{registerFieldsToInclude:Ur,enableFetchAllFields:xi,disableFetchAllFields:Ri,fetchFieldsDescription:Ei}}d();c();l();u();function mA(e){return e.addReducers({pipeline:fr}),{setPipeline:dr}}d();c();l();u();function gA(e){return e.addReducers({recommendation:Rr}),{getRecommendations:At,setRecommendationId:xr}}d();c();l();u();function yA(e){return e.addReducers({}),{logRecommendationOpen:_o}}d();c();l();u();d();c();l();u();var hA=new Fe({content:new fe({required:!0}),conditions:new fe({required:!0}),priority:new J({required:!1,default:0,min:0}),fields:new ie({required:!1,each:W})});function mf(){let e=[],t=r=>{let n=hA.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new Wr("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function gf(e){if(!SA(e))throw ze;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=mf();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Ur(i))},selectTemplate:r,selectLinkTemplate:n}}function SA(e){return e.addReducers({fields:ki}),!0}d();c();l();u();function vA(e){return e.addReducers({searchHub:Ir}),{setSearchHub:Er}}/**
|
|
32
32
|
* @license
|
|
33
33
|
*
|
|
34
34
|
* Copyright 2025 Coveo Solutions Inc.
|
|
@@ -46,4 +46,4 @@ ${y}`:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":k
|
|
|
46
46
|
* limitations under the License.
|
|
47
47
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
48
48
|
|
|
49
|
-
window.coveoQuanticVersion = '3.30.0-pre.
|
|
49
|
+
window.coveoQuanticVersion = '3.30.0-pre.e4dec75021';
|