@coveo/quantic 3.37.6 → 3.37.7
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/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +42 -1
- package/force-app/main/default/lwc/quanticResultLink/quanticResultLink.html +1 -1
- package/force-app/main/default/lwc/quanticResultLink/quanticResultLink.js +4 -10
- package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +4 -10
- package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +8 -11
- package/force-app/main/default/staticresources/coveobueno/browser/bueno.js +5 -0
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +19 -18
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/compare-utils.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +19 -18
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +19 -18
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +17 -16
- package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
- package/package.json +7 -7
|
@@ -14,38 +14,39 @@ 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("CoveoHeadless",["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["CoveoHeadless"]=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 a,i=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return i=f.done,f},e:function(f){p=!0,a=f},f:function(){try{i||r.return==null||r.return()}finally{if(p)throw a}}}}function iy(){return iy=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=eN(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},iy.apply(null,arguments)}function Ii(e){return Ii=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ii(e)}function XO(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&&sy(e,t)}function CA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CA=function(){return!!e})()}function ZO(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 YO(e)}function sy(e,t){return sy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},sy(e,t)}function eN(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ii(e))!==null;);return e}function tN(e,t,r,n){var o=iy(Ii(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function rN(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 nN(e){var t=rN(e,"string");return typeof t=="symbol"?t:t+""}function oN(e,t){if(e){if(typeof e=="string")return SA(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)?SA(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function aN(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 iN(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 AA=function(){function e(){cy(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return uy(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],a=0,i=o.length;a<i;a++)if(o[a].callback===n){o.splice(a,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],a=o.slice(),i=function(){var h=a[p];try{h.callback.call(n,r)}catch(x){Promise.resolve().then(function(){throw x})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},p=0,f=a.length;p<f;p++)i();return!r.defaultPrevented}}}])}(),ly=function(e){function t(){var r;return cy(this,t),r=JO(this,t),r.listeners||AA.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 XO(t,e),uy(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)),tN(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,a=o===void 0?"Aborted":o;if(n)throw a}}],[{key:"timeout",value:function(n){var o=new od;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 od;function a(){o.abort(this.reason),i()}function i(){var h=xA(n),x;try{for(h.s();!(x=h.n()).done;){var A=x.value;A.removeEventListener("abort",a)}}catch(y){h.e(y)}finally{h.f()}}var p=xA(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",a)}}catch(h){p.e(h)}finally{p.f()}return o.signal}}])}(AA),od=function(){function e(){cy(this,e),Object.defineProperty(this,"signal",{value:new ly,writable:!0,configurable:!0})}return uy(e,[{key:"abort",value:function(r){var n=iN(r),o=aN(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(od.prototype[Symbol.toStringTag]="AbortController",ly.prototype[Symbol.toStringTag]="AbortSignal");function sN(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 cN(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,a=t.AbortController,i=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=i===void 0?!1:i;if(!sN({fetch:r,Request:o,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(A,y){var C;y&&y.signal&&(C=y.signal,delete y.signal);var R=new o(A,y);return C&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:C}),R},f.prototype=o.prototype);var m=r,h=function(A,y){var C=f&&f.prototype.isPrototypeOf(A)?A.signal:y?y.signal:void 0;if(C){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(C.aborted)return Promise.reject(R);var b=new Promise(function(w,P){C.addEventListener("abort",function(){return P(R)},{once:!0})});return y&&y.signal&&delete y.signal,Promise.race([b,m(A,y)])}return m(A,y)};return{fetch:h,Request:f}}vu.AbortController=od;vu.AbortSignal=ly;vu.abortableFetch=cN});var bA,s,S,l=Ei(()=>{"use strict";bA=Mr(dy(),1),s=Mr(dy(),1),{fetch:S}=(0,bA.abortableFetch)({fetch})});function py(e){return typeof e!="string"||e in{}}function fy(){return Object.create(null)}function wA(e){return typeof e=="string"&&!!e.trim()}function my(e,t){var r=e.split(";").filter(wA),n=r.shift(),o=uN(n),a=o.name,i=o.value;if(t=t?Object.assign({},ad,t):ad,py(a))return null;try{i=t.decodeValues?decodeURIComponent(i):i}catch(f){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",f)}var p=fy();return p.name=a,p.value=i,r.forEach(function(f){var m=f.split("="),h=m.shift().trimLeft().toLowerCase();if(!py(h)){var x=m.join("=");if(h==="expires")p.expires=new Date(x);else if(h==="max-age"){var A=parseInt(x,10);Number.isNaN(A)||(p.maxAge=A)}else h==="secure"?p.secure=!0:h==="httponly"?p.httpOnly=!0:h==="samesite"?p.sameSite=x:h==="partitioned"?p.partitioned=!0:h&&(p[h]=x)}}),p}function uN(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function Ti(e,t){if(t=t?Object.assign({},ad,t):ad,!e)return t.map?fy():[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(i){return i.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.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."),e=r}var n=t.split,o=Array.isArray(e);if(n==="auto"&&(n=!o),o||(e=[e]),e=e.filter(wA),n&&(e=e.map(id).flat()),t.map){var a=fy();return e.reduce(function(i,p){var f=my(p,t);return f&&!py(f.name)&&(i[f.name]=f),i},a)}else return e.map(function(i){return my(i,t)}).filter(Boolean)}function id(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,a,i,p;function f(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function m(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,p=!1;f();)if(o=e.charAt(r),o===","){for(a=r,r+=1,f(),i=r;r<e.length&&m();)r+=1;r<e.length&&e.charAt(r)==="="?(p=!0,r=i,t.push(e.substring(n,a)),n=r):r=a+1}else r+=1;(!p||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var ad,RA=Ei(()=>{"use strict";d();c();l();u();ad={decodeValues:!0,map:!1,silent:!1,split:"auto"};Ti.parseSetCookie=Ti;Ti.parse=Ti;Ti.parseString=my;Ti.splitCookiesString=id});function xu(e){if(lN.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function gy(e){return e.replace(dN,"")}function Au(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||!pN(r))return!1}return!0}function pN(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function EA(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 lN,FA,dN,IA,Pi,hy,TA,v,kA=Ei(()=>{"use strict";d();c();l();u();RA();lN=/[^a-z0-9\-#$%&'*+.^_`|~]/i;FA=[`
|
|
19
|
-
`,"\r","\t"," "],dN=new RegExp(`(^[${FA.join("")}]|$[${FA.join("")}])`,"g");Pi=Symbol("normalizedHeaders"),hy=Symbol("rawHeaderNames"),TA=", ",v=class PA{constructor(t){this[Pi]={},this[hy]=new Map,this[IA]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof PA||typeof g.Headers<"u"&&t instanceof g.Headers?t.forEach((r,n)=>{this.append(n,r)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(TA):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(TA):n)})}[(IA=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[Pi]).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(!Au(t))throw new TypeError(`Invalid header name "${t}"`);return this[Pi].hasOwnProperty(xu(t))}get(t){if(!Au(t))throw TypeError(`Invalid header name "${t}"`);return this[Pi][xu(t)]??null}set(t,r){if(!Au(t)||!EA(r))return;let n=xu(t),o=gy(r);this[Pi][n]=gy(o),this[hy].set(n,t)}append(t,r){if(!Au(t)||!EA(r))return;let n=xu(t),o=gy(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!Au(t)||!this.has(t))return;let r=xu(t);delete this[Pi][r],this[hy].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===""?[""]:id(t)}}});var d=Ei(()=>{"use strict";kA()});var $A=It(Fu=>{"use strict";d();c();l();u();var md=Fu&&Fu.__assign||function(){return md=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},md.apply(this,arguments)};Object.defineProperty(Fu,"__esModule",{value:!0});var IN={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function TN(e){var t=md(md({},IN),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Fu.getSanitizedOptions=TN});var HA=It(wy=>{"use strict";d();c();l();u();Object.defineProperty(wy,"__esModule",{value:!0});function PN(e){var t=Math.random()*e;return Math.round(t)}wy.fullJitter=PN});var zA=It(Ry=>{"use strict";d();c();l();u();Object.defineProperty(Ry,"__esModule",{value:!0});function kN(e){return e}Ry.noJitter=kN});var WA=It(Fy=>{"use strict";d();c();l();u();Object.defineProperty(Fy,"__esModule",{value:!0});var ON=HA(),NN=zA();function _N(e){return e.jitter==="full"?ON.fullJitter:NN.noJitter}Fy.JitterFactory=_N});var Iy=It(Ey=>{"use strict";d();c();l();u();Object.defineProperty(Ey,"__esModule",{value:!0});var DN=WA(),qN=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=DN.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}();Ey.Delay=qN});var KA=It(Ln=>{"use strict";d();c();l();u();var MN=Ln&&Ln.__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 a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},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)}}(),VN=Ln&&Ln.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(h){try{m(n.next(h))}catch(x){i(x)}}function f(h){try{m(n.throw(h))}catch(x){i(x)}}function m(h){h.done?a(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},jN=Ln&&Ln.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Ln,"__esModule",{value:!0});var LN=Iy(),UN=function(e){MN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return VN(this,void 0,void 0,function(){return jN(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}(LN.Delay);Ln.SkipFirstDelay=UN});var YA=It(Eu=>{"use strict";d();c();l();u();var QN=Eu&&Eu.__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 a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},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(Eu,"__esModule",{value:!0});var BN=Iy(),GN=function(e){QN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(BN.Delay);Eu.AlwaysDelay=GN});var JA=It(Ty=>{"use strict";d();c();l();u();Object.defineProperty(Ty,"__esModule",{value:!0});var $N=KA(),HN=YA();function zN(e,t){var r=WN(e);return r.setAttemptNumber(t),r}Ty.DelayFactory=zN;function WN(e){return e.delayFirstAttempt?new HN.AlwaysDelay(e):new $N.SkipFirstDelay(e)}});var XA=It(ua=>{"use strict";d();c();l();u();var Py=ua&&ua.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(h){try{m(n.next(h))}catch(x){i(x)}}function f(h){try{m(n.throw(h))}catch(x){i(x)}}function m(h){h.done?a(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},ky=ua&&ua.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(ua,"__esModule",{value:!0});var KN=$A(),YN=JA();function JN(e,t){return t===void 0&&(t={}),Py(this,void 0,void 0,function(){var r,n;return ky(this,function(o){switch(o.label){case 0:return r=KN.getSanitizedOptions(t),n=new XN(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}ua.backOff=JN;var XN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Py(this,void 0,void 0,function(){var t,r;return ky(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 Py(this,void 0,void 0,function(){var t;return ky(this,function(r){switch(r.label){case 0:return t=YN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Ep=It((BS,GS)=>{"use strict";d();c();l();u();(function(e,t){typeof BS=="object"&&typeof GS<"u"?GS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof g<"u"?g:e||self).dayjs=t()})(BS,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",p="day",f="week",m="month",h="quarter",x="year",A="date",y="Invalid Date",C=/^(\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,b={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(N){var _=["th","st","nd","rd"],q=N%100;return"["+N+(_[(q-20)%10]||_[q]||_[0])+"]"}},w=function(N,_,q){var Y=String(N);return!Y||Y.length>=_?N:""+Array(_+1-Y.length).join(q)+N},P={s:w,z:function(N){var _=-N.utcOffset(),q=Math.abs(_),Y=Math.floor(q/60),H=q%60;return(_<=0?"+":"-")+w(Y,2,"0")+":"+w(H,2,"0")},m:function N(_,q){if(_.date()<q.date())return-N(q,_);var Y=12*(q.year()-_.year())+(q.month()-_.month()),H=_.clone().add(Y,m),ne=q-H<0,te=_.clone().add(Y+(ne?-1:1),m);return+(-(Y+(q-H)/(ne?H-te:te-H))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:m,y:x,w:f,d:p,D:A,h:i,m:a,s:o,ms:n,Q:h}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},F="en",k={};k[F]=b;var T="$isDayjsObject",D=function(N){return N instanceof Q||!(!N||!N[T])},G=function N(_,q,Y){var H;if(!_)return F;if(typeof _=="string"){var ne=_.toLowerCase();k[ne]&&(H=ne),q&&(k[ne]=q,H=ne);var te=_.split("-");if(!H&&te.length>1)return N(te[0])}else{var Z=_.name;k[Z]=_,H=Z}return!Y&&H&&(F=H),H||!Y&&F},L=function(N,_){if(D(N))return N.clone();var q=typeof _=="object"?_:{};return q.date=N,q.args=arguments,new Q(q)},V=P;V.l=G,V.i=D,V.w=function(N,_){return L(N,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var Q=function(){function N(q){this.$L=G(q.locale,null,!0),this.parse(q),this.$x=this.$x||q.x||{},this[T]=!0}var _=N.prototype;return _.parse=function(q){this.$d=function(Y){var H=Y.date,ne=Y.utc;if(H===null)return new Date(NaN);if(V.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var te=H.match(C);if(te){var Z=te[2]-1||0,ce=(te[7]||"0").substring(0,3);return ne?new Date(Date.UTC(te[1],Z,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ce)):new Date(te[1],Z,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ce)}}return new Date(H)}(q),this.init()},_.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},_.$utils=function(){return V},_.isValid=function(){return this.$d.toString()!==y},_.isSame=function(q,Y){var H=L(q);return this.startOf(Y)<=H&&H<=this.endOf(Y)},_.isAfter=function(q,Y){return L(q)<this.startOf(Y)},_.isBefore=function(q,Y){return this.endOf(Y)<L(q)},_.$g=function(q,Y,H){return V.u(q)?this[Y]:this.set(H,q)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(q,Y){var H=this,ne=!!V.u(Y)||Y,te=V.p(q),Z=function(Re,be){var Ie=V.w(H.$u?Date.UTC(H.$y,be,Re):new Date(H.$y,be,Re),H);return ne?Ie:Ie.endOf(p)},ce=function(Re,be){return V.w(H.toDate()[Re].apply(H.toDate("s"),(ne?[0,0,0,0]:[23,59,59,999]).slice(be)),H)},he=this.$W,qe=this.$M,Je=this.$D,Le="set"+(this.$u?"UTC":"");switch(te){case x:return ne?Z(1,0):Z(31,11);case m:return ne?Z(1,qe):Z(0,qe+1);case f:var He=this.$locale().weekStart||0,ze=(he<He?he+7:he)-He;return Z(ne?Je-ze:Je+(6-ze),qe);case p:case A:return ce(Le+"Hours",0);case i:return ce(Le+"Minutes",1);case a:return ce(Le+"Seconds",2);case o:return ce(Le+"Milliseconds",3);default:return this.clone()}},_.endOf=function(q){return this.startOf(q,!1)},_.$set=function(q,Y){var H,ne=V.p(q),te="set"+(this.$u?"UTC":""),Z=(H={},H[p]=te+"Date",H[A]=te+"Date",H[m]=te+"Month",H[x]=te+"FullYear",H[i]=te+"Hours",H[a]=te+"Minutes",H[o]=te+"Seconds",H[n]=te+"Milliseconds",H)[ne],ce=ne===p?this.$D+(Y-this.$W):Y;if(ne===m||ne===x){var he=this.clone().set(A,1);he.$d[Z](ce),he.init(),this.$d=he.set(A,Math.min(this.$D,he.daysInMonth())).$d}else Z&&this.$d[Z](ce);return this.init(),this},_.set=function(q,Y){return this.clone().$set(q,Y)},_.get=function(q){return this[V.p(q)]()},_.add=function(q,Y){var H,ne=this;q=Number(q);var te=V.p(Y),Z=function(qe){var Je=L(ne);return V.w(Je.date(Je.date()+Math.round(qe*q)),ne)};if(te===m)return this.set(m,this.$M+q);if(te===x)return this.set(x,this.$y+q);if(te===p)return Z(1);if(te===f)return Z(7);var ce=(H={},H[a]=t,H[i]=r,H[o]=e,H)[te]||1,he=this.$d.getTime()+q*ce;return V.w(he,this)},_.subtract=function(q,Y){return this.add(-1*q,Y)},_.format=function(q){var Y=this,H=this.$locale();if(!this.isValid())return H.invalidDate||y;var ne=q||"YYYY-MM-DDTHH:mm:ssZ",te=V.z(this),Z=this.$H,ce=this.$m,he=this.$M,qe=H.weekdays,Je=H.months,Le=H.meridiem,He=function(be,Ie,Fe,ut){return be&&(be[Ie]||be(Y,ne))||Fe[Ie].slice(0,ut)},ze=function(be){return V.s(Z%12||12,be,"0")},Re=Le||function(be,Ie,Fe){var ut=be<12?"AM":"PM";return Fe?ut.toLowerCase():ut};return ne.replace(R,function(be,Ie){return Ie||function(Fe){switch(Fe){case"YY":return String(Y.$y).slice(-2);case"YYYY":return V.s(Y.$y,4,"0");case"M":return he+1;case"MM":return V.s(he+1,2,"0");case"MMM":return He(H.monthsShort,he,Je,3);case"MMMM":return He(Je,he);case"D":return Y.$D;case"DD":return V.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return He(H.weekdaysMin,Y.$W,qe,2);case"ddd":return He(H.weekdaysShort,Y.$W,qe,3);case"dddd":return qe[Y.$W];case"H":return String(Z);case"HH":return V.s(Z,2,"0");case"h":return ze(1);case"hh":return ze(2);case"a":return Re(Z,ce,!0);case"A":return Re(Z,ce,!1);case"m":return String(ce);case"mm":return V.s(ce,2,"0");case"s":return String(Y.$s);case"ss":return V.s(Y.$s,2,"0");case"SSS":return V.s(Y.$ms,3,"0");case"Z":return te}return null}(be)||te.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(q,Y,H){var ne,te=this,Z=V.p(Y),ce=L(q),he=(ce.utcOffset()-this.utcOffset())*t,qe=this-ce,Je=function(){return V.m(te,ce)};switch(Z){case x:ne=Je()/12;break;case m:ne=Je();break;case h:ne=Je()/3;break;case f:ne=(qe-he)/6048e5;break;case p:ne=(qe-he)/864e5;break;case i:ne=qe/r;break;case a:ne=qe/t;break;case o:ne=qe/e;break;default:ne=qe}return H?ne:V.a(ne)},_.daysInMonth=function(){return this.endOf(m).$D},_.$locale=function(){return k[this.$L]},_.locale=function(q,Y){if(!q)return this.$L;var H=this.clone(),ne=G(q,Y,!0);return ne&&(H.$L=ne),H},_.clone=function(){return V.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},N}(),j=Q.prototype;return L.prototype=j,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",p],["$M",m],["$y",x],["$D",A]].forEach(function(N){j[N[1]]=function(_){return this.$g(_,N[0],N[1])}}),L.extend=function(N,_){return N.$i||(N(_,Q,L),N.$i=!0),L},L.locale=G,L.isDayjs=D,L.unix=function(N){return L(1e3*N)},L.en=k[F],L.Ls=k,L.p={},L})});var Iw=It(($S,HS)=>{"use strict";d();c();l();u();(function(e,t){typeof $S=="object"&&typeof HS<"u"?HS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof g<"u"?g:e||self).dayjs_plugin_quarterOfYear=t()})($S,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var a=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):a.bind(this)(p,f)};var i=o.startOf;o.startOf=function(p,f){var m=this.$utils(),h=!!m.u(f)||f;if(m.p(p)===t){var x=this.quarter()-1;return h?this.month(3*x).startOf(e).startOf("day"):this.month(3*x+2).endOf(e).endOf("day")}return i.bind(this)(p,f)}}})});var Tw=It((zS,WS)=>{"use strict";d();c();l();u();(function(e,t){typeof zS=="object"&&typeof WS<"u"?WS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof g<"u"?g:e||self).dayjs_plugin_customParseFormat=t()})(zS,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?/,a=/\d*[^-_:/,()\s\d]+/,i={},p=function(C){return(C=+C)+(C>68?1900:2e3)},f=function(C){return function(R){this[C]=+R}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var b=R.match(/([+-]|\d\d)/g),w=60*b[1]+(+b[2]||0);return w===0?0:b[0]==="+"?-w:w}(C)}],h=function(C){var R=i[C];return R&&(R.indexOf?R:R.s.concat(R.f))},x=function(C,R){var b,w=i.meridiem;if(w){for(var P=1;P<=24;P+=1)if(C.indexOf(w(P,0,R))>-1){b=P>12;break}}else b=C===(R?"pm":"PM");return b},A={A:[a,function(C){this.afternoon=x(C,!1)}],a:[a,function(C){this.afternoon=x(C,!0)}],Q:[r,function(C){this.month=3*(C-1)+1}],S:[r,function(C){this.milliseconds=100*+C}],SS:[n,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[a,function(C){var R=i.ordinal,b=C.match(/\d+/);if(this.day=b[0],R)for(var w=1;w<=31;w+=1)R(w).replace(/\[|\]/g,"")===C&&(this.day=w)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(C){var R=h("months"),b=(h("monthsShort")||R.map(function(w){return w.slice(0,3)})).indexOf(C)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[a,function(C){var R=h("months").indexOf(C)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(C){this.year=p(C)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function y(C){var R,b;R=C,b=i&&i.formats;for(var w=(C=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(L,V,Q){var j=Q&&Q.toUpperCase();return V||b[Q]||e[Q]||b[j].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(N,_,q){return _||q.slice(1)})})).match(t),P=w.length,F=0;F<P;F+=1){var k=w[F],T=A[k],D=T&&T[0],G=T&&T[1];w[F]=G?{regex:D,parser:G}:k.replace(/^\[|\]$/g,"")}return function(L){for(var V={},Q=0,j=0;Q<P;Q+=1){var N=w[Q];if(typeof N=="string")j+=N.length;else{var _=N.regex,q=N.parser,Y=L.slice(j),H=_.exec(Y)[0];q.call(V,H),L=L.replace(H,"")}}return function(ne){var te=ne.afternoon;if(te!==void 0){var Z=ne.hours;te?Z<12&&(ne.hours+=12):Z===12&&(ne.hours=0),delete ne.afternoon}}(V),V}}return function(C,R,b){b.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(p=C.parseTwoDigitYear);var w=R.prototype,P=w.parse;w.parse=function(F){var k=F.date,T=F.utc,D=F.args;this.$u=T;var G=D[1];if(typeof G=="string"){var L=D[2]===!0,V=D[3]===!0,Q=L||V,j=D[2];V&&(j=D[2]),i=this.$locale(),!L&&j&&(i=b.Ls[j]),this.$d=function(Y,H,ne,te){try{if(["x","X"].indexOf(H)>-1)return new Date((H==="X"?1e3:1)*Y);var Z=y(H)(Y),ce=Z.year,he=Z.month,qe=Z.day,Je=Z.hours,Le=Z.minutes,He=Z.seconds,ze=Z.milliseconds,Re=Z.zone,be=Z.week,Ie=new Date,Fe=qe||(ce||he?1:Ie.getDate()),ut=ce||Ie.getFullYear(),St=0;ce&&!he||(St=he>0?he-1:Ie.getMonth());var Dr,ar=Je||0,Kr=Le||0,fr=He||0,qr=ze||0;return Re?new Date(Date.UTC(ut,St,Fe,ar,Kr,fr,qr+60*Re.offset*1e3)):ne?new Date(Date.UTC(ut,St,Fe,ar,Kr,fr,qr)):(Dr=new Date(ut,St,Fe,ar,Kr,fr,qr),be&&(Dr=te(Dr).week(be).toDate()),Dr)}catch{return new Date("")}}(k,G,T,b),this.init(),j&&j!==!0&&(this.$L=this.locale(j).$L),Q&&k!=this.format(G)&&(this.$d=new Date("")),i={}}else if(G instanceof Array)for(var N=G.length,_=1;_<=N;_+=1){D[1]=G[_-1];var q=b.apply(this,D);if(q.isValid()){this.$d=q.$d,this.$L=q.$L,this.init();break}_===N&&(this.$d=new Date(""))}else P.call(this,F)}}})});var iF=It((Fv,Ev)=>{"use strict";d();c();l();u();(function(e,t){typeof Fv=="object"&&typeof Ev<"u"?Ev.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof g<"u"?g:e||self).dayjs_plugin_timezone=t()})(Fv,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(h,x,A){A===void 0&&(A={});var y=new Date(h),C=function(R,b){b===void 0&&(b={});var w=b.timeZoneName||"short",P=R+"|"+w,F=t[P];return F||(F=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:w}),t[P]=F),F}(x,A);return C.formatToParts(y)},p=function(h,x){for(var A=i(h,x),y=[],C=0;C<A.length;C+=1){var R=A[C],b=R.type,w=R.value,P=e[b];P>=0&&(y[P]=parseInt(w,10))}var F=y[3],k=F===24?0:F,T=y[0]+"-"+y[1]+"-"+y[2]+" "+k+":"+y[4]+":"+y[5]+":000",D=+h;return(o.utc(T).valueOf()-(D-=D%1e3))/6e4},f=n.prototype;f.tz=function(h,x){h===void 0&&(h=a);var A,y=this.utcOffset(),C=this.toDate(),R=C.toLocaleString("en-US",{timeZone:h}),b=Math.round((C-new Date(R))/1e3/60),w=15*-Math.round(C.getTimezoneOffset()/15)-b;if(!Number(w))A=this.utcOffset(0,x);else if(A=o(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(w,!0),x){var P=A.utcOffset();A=A.add(y-P,"minute")}return A.$x.$timezone=h,A},f.offsetName=function(h){var x=this.$x.$timezone||o.tz.guess(),A=i(this.valueOf(),x,{timeZoneName:h}).find(function(y){return y.type.toLowerCase()==="timezonename"});return A&&A.value};var m=f.startOf;f.startOf=function(h,x){if(!this.$x||!this.$x.$timezone)return m.call(this,h,x);var A=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(A,h,x).tz(this.$x.$timezone,!0)},o.tz=function(h,x,A){var y=A&&x,C=A||x||a,R=p(+o(),C);if(typeof h!="string")return o(h).tz(C);var b=function(k,T,D){var G=k-60*T*1e3,L=p(G,D);if(T===L)return[G,T];var V=p(G-=60*(L-T)*1e3,D);return L===V?[G,L]:[k-60*Math.min(L,V)*1e3,Math.max(L,V)]}(o.utc(h,y).valueOf(),R,C),w=b[0],P=b[1],F=o(w).utcOffset(P);return F.$x.$timezone=C,F},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){a=h}}})});var sF=It((Iv,Tv)=>{"use strict";d();c();l();u();(function(e,t){typeof Iv=="object"&&typeof Tv<"u"?Tv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof g<"u"?g:e||self).dayjs_plugin_utc=t()})(Iv,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(y){var C={date:y,utc:!0,args:arguments};return new o(C)},i.utc=function(y){var C=a(this.toDate(),{locale:this.$L,utc:!0});return y?C.add(this.utcOffset(),e):C},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var p=i.parse;i.parse=function(y){y.utc&&(this.$u=!0),this.$utils().u(y.$offset)||(this.$offset=y.$offset),p.call(this,y)};var f=i.init;i.init=function(){if(this.$u){var y=this.$d;this.$y=y.getUTCFullYear(),this.$M=y.getUTCMonth(),this.$D=y.getUTCDate(),this.$W=y.getUTCDay(),this.$H=y.getUTCHours(),this.$m=y.getUTCMinutes(),this.$s=y.getUTCSeconds(),this.$ms=y.getUTCMilliseconds()}else f.call(this)};var m=i.utcOffset;i.utcOffset=function(y,C){var R=this.$utils().u;if(R(y))return this.$u?0:R(this.$offset)?m.call(this):this.$offset;if(typeof y=="string"&&(y=function(F){F===void 0&&(F="");var k=F.match(t);if(!k)return null;var T=(""+k[0]).match(r)||["-",0,0],D=T[0],G=60*+T[1]+ +T[2];return G===0?0:D==="+"?G:-G}(y),y===null))return this;var b=Math.abs(y)<=16?60*y:y;if(b===0)return this.utc(C);var w=this.clone();if(C)return w.$offset=b,w.$u=!1,w;var P=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(w=this.local().add(b+P,e)).$offset=b,w.$x.$localOffset=P,w};var h=i.format;i.format=function(y){var C=y||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,C)},i.valueOf=function(){var y=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*y},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var x=i.toDate;i.toDate=function(y){return y==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():x.call(this)};var A=i.diff;i.diff=function(y,C,R){if(y&&this.$u===y.$u)return A.call(this,y,C,R);var b=this.local(),w=a(y).local();return A.call(b,w,C,R)}}})});var iI=It(($Ce,aI)=>{"use strict";d();c();l();u();function vQ(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}aI.exports=xQ;function xQ(e,t,r){var n=r&&r.stringify||vQ,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var p=1;p<a;p++)i[p]=n(t[p]);return i.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",h=1-o,x=-1,A=e&&e.length||0,y=0;y<A;){if(e.charCodeAt(y)===37&&y+1<A){switch(x=x>-1?x:0,e.charCodeAt(y+1)){case 100:case 102:if(h>=f||t[h]==null)break;x<y&&(m+=e.slice(x,y)),m+=Number(t[h]),x=y+2,y++;break;case 105:if(h>=f||t[h]==null)break;x<y&&(m+=e.slice(x,y)),m+=Math.floor(Number(t[h])),x=y+2,y++;break;case 79:case 111:case 106:if(h>=f||t[h]===void 0)break;x<y&&(m+=e.slice(x,y));var C=typeof t[h];if(C==="string"){m+="'"+t[h]+"'",x=y+2,y++;break}if(C==="function"){m+=t[h].name||"<anonymous>",x=y+2,y++;break}m+=n(t[h]),x=y+2,y++;break;case 115:if(h>=f)break;x<y&&(m+=e.slice(x,y)),m+=String(t[h]),x=y+2,y++;break;case 37:x<y&&(m+=e.slice(x,y)),m+="%",x=y+2,y++,h--;break}++h}++y}return x===-1?e:(x<A&&(m+=e.slice(x)),m)}});var pI=It((YCe,ng)=>{"use strict";d();c();l();u();var sI=iI();ng.exports=no;var _l=DQ().console||{},AQ={mapHttpRequest:rg,mapHttpResponse:rg,wrapRequestSerializer:Sx,wrapResponseSerializer:Sx,wrapErrorSerializer:Sx,req:rg,res:rg,err:uI,errWithCause:uI};function Ho(e,t){return e==="silent"?1/0:t.levels.values[e]}var Ax=Symbol("pino.logFuncs"),vx=Symbol("pino.hierarchy"),CQ={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function cI(e,t){let r={logger:t,parent:e[vx]};t[vx]=r}function bQ(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:_l[o]||_l[CQ[o]||"log"]||oc}),e[Ax]=n}function wQ(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function no(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||_l;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=wQ(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&p.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=oc),bQ(m,p,r),cI({},m),Object.defineProperty(m,"levelVal",{get:x}),Object.defineProperty(m,"level",{get:A,set:y});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:p,timestamp:OQ(e),messageKey:e.messageKey||"msg",onChild:e.onChild||oc};m.levels=RQ(e),m.level=f,m.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=oc,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...R){return C.call(this,h,...R)},t&&(m._logEvent=xx());function x(){return Ho(this.level,this)}function A(){return this._level}function y(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,si(this,h,m,"error"),si(this,h,m,"fatal"),si(this,h,m,"warn"),si(this,h,m,"info"),si(this,h,m,"debug"),si(this,h,m,"trace"),i.forEach(b=>{si(this,h,m,b)})}function C(R,b,w){if(!b)throw new Error("missing bindings for child Pino");w=w||{},o&&b.serializers&&(w.serializers=b.serializers);let P=w.serializers;if(o&&P){var F=Object.assign({},n,P),k=e.browser.serialize===!0?Object.keys(F):o;delete b.serializers,Cx([b],k,F,this._stdErrSerialize)}function T(G){this._childLevel=(G._childLevel|0)+1,this.bindings=b,F&&(this.serializers=F,this._serialize=k),t&&(this._logEvent=xx([].concat(G._logEvent.bindings,b)))}T.prototype=this;let D=new T(this);return cI(this,D),D.child=function(...G){return C.call(this,R,...G)},D.level=w.level||this.level,R.onChild(D),D}return m}function RQ(e){let t=e.customLevels||{},r=Object.assign({},no.levels.values,t),n=Object.assign({},no.levels.labels,FQ(t));return{values:r,labels:n}}function FQ(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}no.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"}};no.stdSerializers=AQ;no.stdTimeFunctions=Object.assign({},{nullTime:lI,epochTime:dI,unixTime:NQ,isoTime:_Q});function EQ(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[vx];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function si(e,t,r,n){if(Object.defineProperty(e,n,{value:Ho(e.level,r)>Ho(n,r)?oc:r[Ax][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===oc){if(!t.transmit)return;let a=t.transmit.level||e.level,i=Ho(a,r);if(Ho(n,r)<i)return}e[n]=TQ(e,t,r,n);let o=EQ(e);o.length!==0&&(e[n]=IQ(o,e[n]))}function IQ(e,t){return function(){return t.apply(this,[...e,...arguments])}}function TQ(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===_l?_l:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var h=!1;if(t.serialize&&(Cx(p,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(f,...PQ(this,n,p,i,t)):o.apply(f,p),t.transmit){let x=t.transmit.level||e._level,A=Ho(x,r),y=Ho(n,r);if(y<A)return;kQ(this,{ts:i,methodLevel:n,methodValue:y,transmitLevel:x,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Ho(e._level,r)},p,h)}}}(e[Ax][n])}function PQ(e,t,r,n,o){let{level:a,log:i=x=>x}=o.formatters||{},p=r.slice(),f=p[0],m={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(m.time=n),a){let x=a(t,e.levels.values[t]);Object.assign(m,x)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;h--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[i(m),...p]}else{if(f!==null&&typeof f=="object"){for(;h--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?sI(p.shift(),p):void 0}else typeof f=="string"&&(f=sI(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function Cx(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=no.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function kQ(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||Cx(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(h){return m.indexOf(h)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=p,o(i,e._logEvent,f),e._logEvent=xx(m)}function xx(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function uI(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 OQ(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?lI:dI}function rg(){return{}}function Sx(e){return e}function oc(){}function lI(){return!1}function dI(){return Date.now()}function NQ(){return Math.round(Date.now()/1e3)}function _Q(){return new Date(Date.now()).toISOString()}function DQ(){function e(t){return typeof t<"u"&&t}try{return typeof g<"u"?g:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),g)}catch{return e(self)||e(window)||e(this)||{}}}ng.exports.default=no;ng.exports.pino=no});var mH={};Su(mH,{API_DATE_FORMAT:()=>Cs,DefaultFieldsToInclude:()=>Dx,EcommerceDefaultFieldsToInclude:()=>rP,HighlightUtils:()=>vy,MinimumFieldsToInclude:()=>Sh,ResultTemplatesHelpers:()=>aR,SortBy:()=>Aa,SortOrder:()=>rl,VERSION:()=>vo,baseFacetResponseSelector:()=>jr,buildAutomaticFacetGenerator:()=>gT,buildBreadcrumbManager:()=>KI,buildCategoryFacet:()=>FT,buildCategoryFieldSuggestions:()=>KT,buildContext:()=>XI,buildController:()=>oe,buildCriterionExpression:()=>en,buildDateFacet:()=>LT,buildDateFilter:()=>QT,buildDateRange:()=>Ko,buildDateSortCriterion:()=>dp,buildDictionaryFieldContext:()=>tT,buildDidYouMean:()=>sT,buildExecuteTrigger:()=>cO,buildFacet:()=>_T,buildFacetConditionsManager:()=>eT,buildFacetManager:()=>uT,buildFieldSortCriterion:()=>pp,buildFieldSuggestions:()=>YT,buildFoldedResultList:()=>aP,buildGeneratedAnswer:()=>gP,buildHistoryManager:()=>IP,buildInstantResults:()=>VP,buildInteractiveCitation:()=>yP,buildInteractiveInstantResult:()=>TP,buildInteractiveRecentResult:()=>nk,buildInteractiveResult:()=>dk,buildNoSortCriterion:()=>mp,buildNotifyTrigger:()=>lO,buildNumericFacet:()=>HT,buildNumericFilter:()=>WT,buildNumericRange:()=>Pc,buildPager:()=>UP,buildQueryError:()=>BP,buildQueryExpression:()=>pH,buildQueryRankingExpressionSortCriterion:()=>fp,buildQuerySummary:()=>$P,buildQueryTrigger:()=>dO,buildQuickview:()=>KP,buildRecentQueriesList:()=>ek,buildRecentResultsList:()=>ak,buildRedirectionTrigger:()=>pO,buildRelevanceInspector:()=>lk,buildRelevanceSortCriterion:()=>ts,buildResultList:()=>pk,buildResultTemplatesManager:()=>wO,buildResultsPerPage:()=>mk,buildSearchBox:()=>Lh,buildSearchEngine:()=>RI,buildSearchParameterManager:()=>$h,buildSearchParameterSerializer:()=>ed,buildSearchStatus:()=>Mk,buildSmartSnippet:()=>Uk,buildSmartSnippetQuestionsList:()=>Gk,buildSort:()=>Wk,buildStandaloneSearchBox:()=>Xk,buildStaticFilter:()=>Zk,buildStaticFilterValue:()=>fA,buildTab:()=>tO,buildTabManager:()=>rO,buildUrlManager:()=>SO,currentPageSelector:()=>fo,currentPagesSelector:()=>Th,deserializeRelativeDate:()=>jw,facetRequestSelector:()=>ip,facetResponseSelectedValuesSelector:()=>Gb,facetResponseSelector:()=>Wi,getAnalyticsNextApiBaseUrl:()=>gd,getOrganizationEndpoint:()=>Pt,getSampleSearchEngineConfiguration:()=>Rx,getSearchApiBaseUrl:()=>lt,loadAdvancedSearchQueryActions:()=>A2,loadAutomaticFacetSetActions:()=>_2,loadBreadcrumbActions:()=>R2,loadCategoryFacetSetActions:()=>D2,loadClickAnalyticsActions:()=>C2,loadConfigurationActions:()=>F2,loadContextActions:()=>I2,loadDateFacetSetActions:()=>M2,loadDebugActions:()=>T2,loadDictionaryFieldContextActions:()=>P2,loadDidYouMeanActions:()=>k2,loadExcerptLengthActions:()=>O2,loadFacetOptionsActions:()=>N2,loadFacetSetActions:()=>q2,loadFieldActions:()=>j2,loadFoldingActions:()=>L2,loadGeneratedAnswerActions:()=>U2,loadGenericAnalyticsActions:()=>b2,loadHistoryActions:()=>Q2,loadIPXActionsHistoryActions:()=>x2,loadInstantResultsActions:()=>B2,loadNumericFacetSetActions:()=>V2,loadPaginationActions:()=>G2,loadPipelineActions:()=>$2,loadQueryActions:()=>H2,loadQuerySetActions:()=>z2,loadQuerySuggestActions:()=>W2,loadQuestionAnsweringActions:()=>K2,loadRecentQueriesActions:()=>Y2,loadRecentResultsActions:()=>J2,loadResultPreviewActions:()=>X2,loadSearchActions:()=>tH,loadSearchAnalyticsActions:()=>w2,loadSearchConfigurationActions:()=>E2,loadSearchHubActions:()=>rH,loadSearchParameterActions:()=>nH,loadSortCriteriaActions:()=>iH,loadStandaloneSearchBoxSetActions:()=>sH,loadStaticFilterSetActions:()=>cH,loadTabSetActions:()=>uH,maxPageSelector:()=>Kl,parseCriterionExpression:()=>RO,validateRelativeDate:()=>To});module.exports=$O(mH);d();c();l();u();var vy={};Su(vy,{escapeHtml:()=>_i,getHighlightedSuggestion:()=>Sy,highlightString:()=>xN});d();c();l();u();d();c();l();u();function fN(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("CoveoHeadless",["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["CoveoHeadless"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var m_=Object.create;var Su=Object.defineProperty;var g_=Object.getOwnPropertyDescriptor;var h_=Object.getOwnPropertyNames;var y_=Object.getPrototypeOf,S_=Object.prototype.hasOwnProperty;var v_=(e,t,r)=>t in e?Su(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ii=(e,t)=>()=>(e&&(t=e(e=0)),t);var It=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vu=(e,t)=>{for(var r in t)Su(e,r,{get:t[r],enumerable:!0})},DA=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h_(t))!S_.call(e,o)&&o!==r&&Su(e,o,{get:()=>t[o],enumerable:!(n=g_(t,o))||n.enumerable});return e};var Vr=(e,t,r)=>(r=e!=null?m_(y_(e)):{},DA(t||!e||!e.__esModule?Su(r,"default",{value:e,enumerable:!0}):r,e)),x_=e=>DA(Su({},"__esModule",{value:!0}),e);var ye=(e,t,r)=>v_(e,typeof t!="symbol"?t+"":t,r);var y,c=Ii(()=>{"use strict";y=typeof globalThis<"u"?globalThis:window});function ad(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ad=function(t){return typeof t}:ad=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ad(e)}function b_(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=w_.bind(this))}function w_(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","*/*"),A_(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):C_(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var A_,C_,u=Ii(()=>{"use strict";A_=function(t){return typeof t=="string"},C_=function(t){return t instanceof Blob};b_.call((typeof window>"u"?"undefined":ad(window))==="object"?window:{})});var Ry=It(xu=>{"use strict";d();c();l();u();Object.defineProperty(xu,"__esModule",{value:!0});function qA(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 R_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F_(e,t,r){return t=Ti(t),I_(e,LA()?Reflect.construct(t,r||[],Ti(e).constructor):t.apply(e,r))}function Cy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MA(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,O_(n.key),n)}}function by(e,t,r){return t&&MA(e.prototype,t),r&&MA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function VA(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=__(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(f){throw f},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 a,i=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return i=f.done,f},e:function(f){p=!0,a=f},f:function(){try{i||r.return==null||r.return()}finally{if(p)throw a}}}}function xy(){return xy=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=T_(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},xy.apply(null,arguments)}function Ti(e){return Ti=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ti(e)}function E_(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&&Ay(e,t)}function LA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LA=function(){return!!e})()}function I_(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 R_(e)}function Ay(e,t){return Ay=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ay(e,t)}function T_(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ti(e))!==null;);return e}function P_(e,t,r,n){var o=xy(Ti(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function k_(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 O_(e){var t=k_(e,"string");return typeof t=="symbol"?t:t+""}function __(e,t){if(e){if(typeof e=="string")return qA(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)?qA(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function N_(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 D_(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 jA=function(){function e(){Cy(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return by(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],a=0,i=o.length;a<i;a++)if(o[a].callback===n){o.splice(a,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],a=o.slice(),i=function(){var g=a[p];try{g.callback.call(n,r)}catch(v){Promise.resolve().then(function(){throw v})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},p=0,f=a.length;p<f;p++)i();return!r.defaultPrevented}}}])}(),wy=function(e){function t(){var r;return Cy(this,t),r=F_(this,t),r.listeners||jA.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 E_(t,e),by(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)),P_(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,a=o===void 0?"Aborted":o;if(n)throw a}}],[{key:"timeout",value:function(n){var o=new id;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 id;function a(){o.abort(this.reason),i()}function i(){var g=VA(n),v;try{for(g.s();!(v=g.n()).done;){var C=v.value;C.removeEventListener("abort",a)}}catch(h){g.e(h)}finally{g.f()}}var p=VA(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",a)}}catch(g){p.e(g)}finally{p.f()}return o.signal}}])}(jA),id=function(){function e(){Cy(this,e),Object.defineProperty(this,"signal",{value:new wy,writable:!0,configurable:!0})}return by(e,[{key:"abort",value:function(r){var n=D_(r),o=N_(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(id.prototype[Symbol.toStringTag]="AbortController",wy.prototype[Symbol.toStringTag]="AbortSignal");function q_(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 M_(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,a=t.AbortController,i=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=i===void 0?!1:i;if(!q_({fetch:r,Request:o,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(C,h){var A;h&&h.signal&&(A=h.signal,delete h.signal);var b=new o(C,h);return A&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:A}),b},f.prototype=o.prototype);var m=r,g=function(C,h){var A=f&&f.prototype.isPrototypeOf(C)?C.signal:h?h.signal:void 0;if(A){var b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(A.aborted)return Promise.reject(b);var w=new Promise(function(R,E){A.addEventListener("abort",function(){return E(b)},{once:!0})});return h&&h.signal&&delete h.signal,Promise.race([w,m(C,h)])}return m(C,h)};return{fetch:g,Request:f}}xu.AbortController=id;xu.AbortSignal=wy;xu.abortableFetch=M_});var UA,s,S,l=Ii(()=>{"use strict";UA=Vr(Ry(),1),s=Vr(Ry(),1),{fetch:S}=(0,UA.abortableFetch)({fetch})});function Fy(e){return typeof e!="string"||e in{}}function Ey(){return Object.create(null)}function QA(e){return typeof e=="string"&&!!e.trim()}function Iy(e,t){var r=e.split(";").filter(QA),n=r.shift(),o=V_(n),a=o.name,i=o.value;if(t=t?Object.assign({},sd,t):sd,Fy(a))return null;try{i=t.decodeValues?decodeURIComponent(i):i}catch(f){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",f)}var p=Ey();return p.name=a,p.value=i,r.forEach(function(f){var m=f.split("="),g=m.shift().trimLeft().toLowerCase();if(!Fy(g)){var v=m.join("=");if(g==="expires")p.expires=new Date(v);else if(g==="max-age"){var C=parseInt(v,10);Number.isNaN(C)||(p.maxAge=C)}else g==="secure"?p.secure=!0:g==="httponly"?p.httpOnly=!0:g==="samesite"?p.sameSite=v:g==="partitioned"?p.partitioned=!0:g&&(p[g]=v)}}),p}function V_(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function Pi(e,t){if(t=t?Object.assign({},sd,t):sd,!e)return t.map?Ey():[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(i){return i.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.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."),e=r}var n=t.split,o=Array.isArray(e);if(n==="auto"&&(n=!o),o||(e=[e]),e=e.filter(QA),n&&(e=e.map(cd).flat()),t.map){var a=Ey();return e.reduce(function(i,p){var f=Iy(p,t);return f&&!Fy(f.name)&&(i[f.name]=f),i},a)}else return e.map(function(i){return Iy(i,t)}).filter(Boolean)}function cd(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,a,i,p;function f(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function m(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,p=!1;f();)if(o=e.charAt(r),o===","){for(a=r,r+=1,f(),i=r;r<e.length&&m();)r+=1;r<e.length&&e.charAt(r)==="="?(p=!0,r=i,t.push(e.substring(n,a)),n=r):r=a+1}else r+=1;(!p||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var sd,BA=Ii(()=>{"use strict";d();c();l();u();sd={decodeValues:!0,map:!1,silent:!1,split:"auto"};Pi.parseSetCookie=Pi;Pi.parse=Pi;Pi.parseString=Iy;Pi.splitCookiesString=cd});function Au(e){if(j_.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Ty(e){return e.replace(L_,"")}function Cu(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||!U_(r))return!1}return!0}function U_(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function $A(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 j_,GA,L_,HA,ki,Py,zA,x,KA=Ii(()=>{"use strict";d();c();l();u();BA();j_=/[^a-z0-9\-#$%&'*+.^_`|~]/i;GA=[`
|
|
19
|
+
`,"\r","\t"," "],L_=new RegExp(`(^[${GA.join("")}]|$[${GA.join("")}])`,"g");ki=Symbol("normalizedHeaders"),Py=Symbol("rawHeaderNames"),zA=", ",x=class WA{constructor(t){this[ki]={},this[Py]=new Map,this[HA]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof WA||typeof y.Headers<"u"&&t instanceof y.Headers?t.forEach((r,n)=>{this.append(n,r)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(zA):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(zA):n)})}[(HA=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[ki]).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(!Cu(t))throw new TypeError(`Invalid header name "${t}"`);return this[ki].hasOwnProperty(Au(t))}get(t){if(!Cu(t))throw TypeError(`Invalid header name "${t}"`);return this[ki][Au(t)]??null}set(t,r){if(!Cu(t)||!$A(r))return;let n=Au(t),o=Ty(r);this[ki][n]=Ty(o),this[Py].set(n,t)}append(t,r){if(!Cu(t)||!$A(r))return;let n=Au(t),o=Ty(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!Cu(t)||!this.has(t))return;let r=Au(t);delete this[ki][r],this[Py].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===""?[""]:cd(t)}}});var d=Ii(()=>{"use strict";KA()});var uC=It(Eu=>{"use strict";d();c();l();u();var yd=Eu&&Eu.__assign||function(){return yd=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},yd.apply(this,arguments)};Object.defineProperty(Eu,"__esModule",{value:!0});var cN={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function uN(e){var t=yd(yd({},cN),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Eu.getSanitizedOptions=uN});var lC=It(Vy=>{"use strict";d();c();l();u();Object.defineProperty(Vy,"__esModule",{value:!0});function lN(e){var t=Math.random()*e;return Math.round(t)}Vy.fullJitter=lN});var dC=It(jy=>{"use strict";d();c();l();u();Object.defineProperty(jy,"__esModule",{value:!0});function dN(e){return e}jy.noJitter=dN});var pC=It(Ly=>{"use strict";d();c();l();u();Object.defineProperty(Ly,"__esModule",{value:!0});var pN=lC(),fN=dC();function mN(e){return e.jitter==="full"?pN.fullJitter:fN.noJitter}Ly.JitterFactory=mN});var Qy=It(Uy=>{"use strict";d();c();l();u();Object.defineProperty(Uy,"__esModule",{value:!0});var gN=pC(),hN=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=gN.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}();Uy.Delay=hN});var fC=It(Un=>{"use strict";d();c();l();u();var yN=Un&&Un.__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 a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},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)}}(),SN=Un&&Un.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(v){i(v)}}function f(g){try{m(n.throw(g))}catch(v){i(v)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},vN=Un&&Un.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Un,"__esModule",{value:!0});var xN=Qy(),AN=function(e){yN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return SN(this,void 0,void 0,function(){return vN(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}(xN.Delay);Un.SkipFirstDelay=AN});var mC=It(Iu=>{"use strict";d();c();l();u();var CN=Iu&&Iu.__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 a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},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(Iu,"__esModule",{value:!0});var bN=Qy(),wN=function(e){CN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(bN.Delay);Iu.AlwaysDelay=wN});var gC=It(By=>{"use strict";d();c();l();u();Object.defineProperty(By,"__esModule",{value:!0});var RN=fC(),FN=mC();function EN(e,t){var r=IN(e);return r.setAttemptNumber(t),r}By.DelayFactory=EN;function IN(e){return e.delayFirstAttempt?new FN.AlwaysDelay(e):new RN.SkipFirstDelay(e)}});var hC=It(la=>{"use strict";d();c();l();u();var Gy=la&&la.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(v){i(v)}}function f(g){try{m(n.throw(g))}catch(v){i(v)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},$y=la&&la.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(la,"__esModule",{value:!0});var TN=uC(),PN=gC();function kN(e,t){return t===void 0&&(t={}),Gy(this,void 0,void 0,function(){var r,n;return $y(this,function(o){switch(o.label){case 0:return r=TN.getSanitizedOptions(t),n=new ON(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}la.backOff=kN;var ON=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Gy(this,void 0,void 0,function(){var t,r;return $y(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 Gy(this,void 0,void 0,function(){var t;return $y(this,function(r){switch(r.label){case 0:return t=PN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Tp=It((nv,ov)=>{"use strict";d();c();l();u();(function(e,t){typeof nv=="object"&&typeof ov<"u"?ov.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(nv,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",p="day",f="week",m="month",g="quarter",v="year",C="date",h="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,w={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(_){var N=["th","st","nd","rd"],q=_%100;return"["+_+(N[(q-20)%10]||N[q]||N[0])+"]"}},R=function(_,N,q){var Y=String(_);return!Y||Y.length>=N?_:""+Array(N+1-Y.length).join(q)+_},E={s:R,z:function(_){var N=-_.utcOffset(),q=Math.abs(N),Y=Math.floor(q/60),H=q%60;return(N<=0?"+":"-")+R(Y,2,"0")+":"+R(H,2,"0")},m:function _(N,q){if(N.date()<q.date())return-_(q,N);var Y=12*(q.year()-N.year())+(q.month()-N.month()),H=N.clone().add(Y,m),ne=q-H<0,te=N.clone().add(Y+(ne?-1:1),m);return+(-(Y+(q-H)/(ne?H-te:te-H))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:m,y:v,w:f,d:p,D:C,h:i,m:a,s:o,ms:n,Q:g}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},I="en",k={};k[I]=w;var T="$isDayjsObject",D=function(_){return _ instanceof Q||!(!_||!_[T])},B=function _(N,q,Y){var H;if(!N)return I;if(typeof N=="string"){var ne=N.toLowerCase();k[ne]&&(H=ne),q&&(k[ne]=q,H=ne);var te=N.split("-");if(!H&&te.length>1)return _(te[0])}else{var Z=N.name;k[Z]=N,H=Z}return!Y&&H&&(I=H),H||!Y&&I},L=function(_,N){if(D(_))return _.clone();var q=typeof N=="object"?N:{};return q.date=_,q.args=arguments,new Q(q)},V=E;V.l=B,V.i=D,V.w=function(_,N){return L(_,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var Q=function(){function _(q){this.$L=B(q.locale,null,!0),this.parse(q),this.$x=this.$x||q.x||{},this[T]=!0}var N=_.prototype;return N.parse=function(q){this.$d=function(Y){var H=Y.date,ne=Y.utc;if(H===null)return new Date(NaN);if(V.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var te=H.match(A);if(te){var Z=te[2]-1||0,ue=(te[7]||"0").substring(0,3);return ne?new Date(Date.UTC(te[1],Z,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ue)):new Date(te[1],Z,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ue)}}return new Date(H)}(q),this.init()},N.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},N.$utils=function(){return V},N.isValid=function(){return this.$d.toString()!==h},N.isSame=function(q,Y){var H=L(q);return this.startOf(Y)<=H&&H<=this.endOf(Y)},N.isAfter=function(q,Y){return L(q)<this.startOf(Y)},N.isBefore=function(q,Y){return this.endOf(Y)<L(q)},N.$g=function(q,Y,H){return V.u(q)?this[Y]:this.set(H,q)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(q,Y){var H=this,ne=!!V.u(Y)||Y,te=V.p(q),Z=function(Ee,Re){var Pe=V.w(H.$u?Date.UTC(H.$y,Re,Ee):new Date(H.$y,Re,Ee),H);return ne?Pe:Pe.endOf(p)},ue=function(Ee,Re){return V.w(H.toDate()[Ee].apply(H.toDate("s"),(ne?[0,0,0,0]:[23,59,59,999]).slice(Re)),H)},he=this.$W,Ve=this.$M,Xe=this.$D,Ue="set"+(this.$u?"UTC":"");switch(te){case v:return ne?Z(1,0):Z(31,11);case m:return ne?Z(1,Ve):Z(0,Ve+1);case f:var He=this.$locale().weekStart||0,ze=(he<He?he+7:he)-He;return Z(ne?Xe-ze:Xe+(6-ze),Ve);case p:case C:return ue(Ue+"Hours",0);case i:return ue(Ue+"Minutes",1);case a:return ue(Ue+"Seconds",2);case o:return ue(Ue+"Milliseconds",3);default:return this.clone()}},N.endOf=function(q){return this.startOf(q,!1)},N.$set=function(q,Y){var H,ne=V.p(q),te="set"+(this.$u?"UTC":""),Z=(H={},H[p]=te+"Date",H[C]=te+"Date",H[m]=te+"Month",H[v]=te+"FullYear",H[i]=te+"Hours",H[a]=te+"Minutes",H[o]=te+"Seconds",H[n]=te+"Milliseconds",H)[ne],ue=ne===p?this.$D+(Y-this.$W):Y;if(ne===m||ne===v){var he=this.clone().set(C,1);he.$d[Z](ue),he.init(),this.$d=he.set(C,Math.min(this.$D,he.daysInMonth())).$d}else Z&&this.$d[Z](ue);return this.init(),this},N.set=function(q,Y){return this.clone().$set(q,Y)},N.get=function(q){return this[V.p(q)]()},N.add=function(q,Y){var H,ne=this;q=Number(q);var te=V.p(Y),Z=function(Ve){var Xe=L(ne);return V.w(Xe.date(Xe.date()+Math.round(Ve*q)),ne)};if(te===m)return this.set(m,this.$M+q);if(te===v)return this.set(v,this.$y+q);if(te===p)return Z(1);if(te===f)return Z(7);var ue=(H={},H[a]=t,H[i]=r,H[o]=e,H)[te]||1,he=this.$d.getTime()+q*ue;return V.w(he,this)},N.subtract=function(q,Y){return this.add(-1*q,Y)},N.format=function(q){var Y=this,H=this.$locale();if(!this.isValid())return H.invalidDate||h;var ne=q||"YYYY-MM-DDTHH:mm:ssZ",te=V.z(this),Z=this.$H,ue=this.$m,he=this.$M,Ve=H.weekdays,Xe=H.months,Ue=H.meridiem,He=function(Re,Pe,Ie,ut){return Re&&(Re[Pe]||Re(Y,ne))||Ie[Pe].slice(0,ut)},ze=function(Re){return V.s(Z%12||12,Re,"0")},Ee=Ue||function(Re,Pe,Ie){var ut=Re<12?"AM":"PM";return Ie?ut.toLowerCase():ut};return ne.replace(b,function(Re,Pe){return Pe||function(Ie){switch(Ie){case"YY":return String(Y.$y).slice(-2);case"YYYY":return V.s(Y.$y,4,"0");case"M":return he+1;case"MM":return V.s(he+1,2,"0");case"MMM":return He(H.monthsShort,he,Xe,3);case"MMMM":return He(Xe,he);case"D":return Y.$D;case"DD":return V.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return He(H.weekdaysMin,Y.$W,Ve,2);case"ddd":return He(H.weekdaysShort,Y.$W,Ve,3);case"dddd":return Ve[Y.$W];case"H":return String(Z);case"HH":return V.s(Z,2,"0");case"h":return ze(1);case"hh":return ze(2);case"a":return Ee(Z,ue,!0);case"A":return Ee(Z,ue,!1);case"m":return String(ue);case"mm":return V.s(ue,2,"0");case"s":return String(Y.$s);case"ss":return V.s(Y.$s,2,"0");case"SSS":return V.s(Y.$ms,3,"0");case"Z":return te}return null}(Re)||te.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(q,Y,H){var ne,te=this,Z=V.p(Y),ue=L(q),he=(ue.utcOffset()-this.utcOffset())*t,Ve=this-ue,Xe=function(){return V.m(te,ue)};switch(Z){case v:ne=Xe()/12;break;case m:ne=Xe();break;case g:ne=Xe()/3;break;case f:ne=(Ve-he)/6048e5;break;case p:ne=(Ve-he)/864e5;break;case i:ne=Ve/r;break;case a:ne=Ve/t;break;case o:ne=Ve/e;break;default:ne=Ve}return H?ne:V.a(ne)},N.daysInMonth=function(){return this.endOf(m).$D},N.$locale=function(){return k[this.$L]},N.locale=function(q,Y){if(!q)return this.$L;var H=this.clone(),ne=B(q,Y,!0);return ne&&(H.$L=ne),H},N.clone=function(){return V.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},_}(),j=Q.prototype;return L.prototype=j,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",p],["$M",m],["$y",v],["$D",C]].forEach(function(_){j[_[1]]=function(N){return this.$g(N,_[0],_[1])}}),L.extend=function(_,N){return _.$i||(_(N,Q,L),_.$i=!0),L},L.locale=B,L.isDayjs=D,L.unix=function(_){return L(1e3*_)},L.en=k[I],L.Ls=k,L.p={},L})});var zw=It((av,iv)=>{"use strict";d();c();l();u();(function(e,t){typeof av=="object"&&typeof iv<"u"?iv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(av,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var a=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):a.bind(this)(p,f)};var i=o.startOf;o.startOf=function(p,f){var m=this.$utils(),g=!!m.u(f)||f;if(m.p(p)===t){var v=this.quarter()-1;return g?this.month(3*v).startOf(e).startOf("day"):this.month(3*v+2).endOf(e).endOf("day")}return i.bind(this)(p,f)}}})});var Ww=It((sv,cv)=>{"use strict";d();c();l();u();(function(e,t){typeof sv=="object"&&typeof cv<"u"?cv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(sv,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?/,a=/\d*[^-_:/,()\s\d]+/,i={},p=function(A){return(A=+A)+(A>68?1900:2e3)},f=function(A){return function(b){this[A]=+b}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(A){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var w=b.match(/([+-]|\d\d)/g),R=60*w[1]+(+w[2]||0);return R===0?0:w[0]==="+"?-R:R}(A)}],g=function(A){var b=i[A];return b&&(b.indexOf?b:b.s.concat(b.f))},v=function(A,b){var w,R=i.meridiem;if(R){for(var E=1;E<=24;E+=1)if(A.indexOf(R(E,0,b))>-1){w=E>12;break}}else w=A===(b?"pm":"PM");return w},C={A:[a,function(A){this.afternoon=v(A,!1)}],a:[a,function(A){this.afternoon=v(A,!0)}],Q:[r,function(A){this.month=3*(A-1)+1}],S:[r,function(A){this.milliseconds=100*+A}],SS:[n,function(A){this.milliseconds=10*+A}],SSS:[/\d{3}/,function(A){this.milliseconds=+A}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[a,function(A){var b=i.ordinal,w=A.match(/\d+/);if(this.day=w[0],b)for(var R=1;R<=31;R+=1)b(R).replace(/\[|\]/g,"")===A&&(this.day=R)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(A){var b=g("months"),w=(g("monthsShort")||b.map(function(R){return R.slice(0,3)})).indexOf(A)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[a,function(A){var b=g("months").indexOf(A)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(A){this.year=p(A)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function h(A){var b,w;b=A,w=i&&i.formats;for(var R=(A=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(L,V,Q){var j=Q&&Q.toUpperCase();return V||w[Q]||e[Q]||w[j].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(_,N,q){return N||q.slice(1)})})).match(t),E=R.length,I=0;I<E;I+=1){var k=R[I],T=C[k],D=T&&T[0],B=T&&T[1];R[I]=B?{regex:D,parser:B}:k.replace(/^\[|\]$/g,"")}return function(L){for(var V={},Q=0,j=0;Q<E;Q+=1){var _=R[Q];if(typeof _=="string")j+=_.length;else{var N=_.regex,q=_.parser,Y=L.slice(j),H=N.exec(Y)[0];q.call(V,H),L=L.replace(H,"")}}return function(ne){var te=ne.afternoon;if(te!==void 0){var Z=ne.hours;te?Z<12&&(ne.hours+=12):Z===12&&(ne.hours=0),delete ne.afternoon}}(V),V}}return function(A,b,w){w.p.customParseFormat=!0,A&&A.parseTwoDigitYear&&(p=A.parseTwoDigitYear);var R=b.prototype,E=R.parse;R.parse=function(I){var k=I.date,T=I.utc,D=I.args;this.$u=T;var B=D[1];if(typeof B=="string"){var L=D[2]===!0,V=D[3]===!0,Q=L||V,j=D[2];V&&(j=D[2]),i=this.$locale(),!L&&j&&(i=w.Ls[j]),this.$d=function(Y,H,ne,te){try{if(["x","X"].indexOf(H)>-1)return new Date((H==="X"?1e3:1)*Y);var Z=h(H)(Y),ue=Z.year,he=Z.month,Ve=Z.day,Xe=Z.hours,Ue=Z.minutes,He=Z.seconds,ze=Z.milliseconds,Ee=Z.zone,Re=Z.week,Pe=new Date,Ie=Ve||(ue||he?1:Pe.getDate()),ut=ue||Pe.getFullYear(),yt=0;ue&&!he||(yt=he>0?he-1:Pe.getMonth());var qr,ar=Xe||0,Yr=Ue||0,mr=He||0,Mr=ze||0;return Ee?new Date(Date.UTC(ut,yt,Ie,ar,Yr,mr,Mr+60*Ee.offset*1e3)):ne?new Date(Date.UTC(ut,yt,Ie,ar,Yr,mr,Mr)):(qr=new Date(ut,yt,Ie,ar,Yr,mr,Mr),Re&&(qr=te(qr).week(Re).toDate()),qr)}catch{return new Date("")}}(k,B,T,w),this.init(),j&&j!==!0&&(this.$L=this.locale(j).$L),Q&&k!=this.format(B)&&(this.$d=new Date("")),i={}}else if(B instanceof Array)for(var _=B.length,N=1;N<=_;N+=1){D[1]=B[N-1];var q=w.apply(this,D);if(q.isValid()){this.$d=q.$d,this.$L=q.$L,this.init();break}N===_&&(this.$d=new Date(""))}else E.call(this,I)}}})});var RF=It((Lv,Uv)=>{"use strict";d();c();l();u();(function(e,t){typeof Lv=="object"&&typeof Uv<"u"?Uv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(Lv,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(g,v,C){C===void 0&&(C={});var h=new Date(g),A=function(b,w){w===void 0&&(w={});var R=w.timeZoneName||"short",E=b+"|"+R,I=t[E];return I||(I=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:b,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:R}),t[E]=I),I}(v,C);return A.formatToParts(h)},p=function(g,v){for(var C=i(g,v),h=[],A=0;A<C.length;A+=1){var b=C[A],w=b.type,R=b.value,E=e[w];E>=0&&(h[E]=parseInt(R,10))}var I=h[3],k=I===24?0:I,T=h[0]+"-"+h[1]+"-"+h[2]+" "+k+":"+h[4]+":"+h[5]+":000",D=+g;return(o.utc(T).valueOf()-(D-=D%1e3))/6e4},f=n.prototype;f.tz=function(g,v){g===void 0&&(g=a);var C,h=this.utcOffset(),A=this.toDate(),b=A.toLocaleString("en-US",{timeZone:g}),w=Math.round((A-new Date(b))/1e3/60),R=15*-Math.round(A.getTimezoneOffset()/15)-w;if(!Number(R))C=this.utcOffset(0,v);else if(C=o(b,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(R,!0),v){var E=C.utcOffset();C=C.add(h-E,"minute")}return C.$x.$timezone=g,C},f.offsetName=function(g){var v=this.$x.$timezone||o.tz.guess(),C=i(this.valueOf(),v,{timeZoneName:g}).find(function(h){return h.type.toLowerCase()==="timezonename"});return C&&C.value};var m=f.startOf;f.startOf=function(g,v){if(!this.$x||!this.$x.$timezone)return m.call(this,g,v);var C=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(C,g,v).tz(this.$x.$timezone,!0)},o.tz=function(g,v,C){var h=C&&v,A=C||v||a,b=p(+o(),A);if(typeof g!="string")return o(g).tz(A);var w=function(k,T,D){var B=k-60*T*1e3,L=p(B,D);if(T===L)return[B,T];var V=p(B-=60*(L-T)*1e3,D);return L===V?[B,L]:[k-60*Math.min(L,V)*1e3,Math.max(L,V)]}(o.utc(g,h).valueOf(),b,A),R=w[0],E=w[1],I=o(R).utcOffset(E);return I.$x.$timezone=A,I},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){a=g}}})});var FF=It((Qv,Bv)=>{"use strict";d();c();l();u();(function(e,t){typeof Qv=="object"&&typeof Bv<"u"?Bv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(Qv,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(h){var A={date:h,utc:!0,args:arguments};return new o(A)},i.utc=function(h){var A=a(this.toDate(),{locale:this.$L,utc:!0});return h?A.add(this.utcOffset(),e):A},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var p=i.parse;i.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),p.call(this,h)};var f=i.init;i.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else f.call(this)};var m=i.utcOffset;i.utcOffset=function(h,A){var b=this.$utils().u;if(b(h))return this.$u?0:b(this.$offset)?m.call(this):this.$offset;if(typeof h=="string"&&(h=function(I){I===void 0&&(I="");var k=I.match(t);if(!k)return null;var T=(""+k[0]).match(r)||["-",0,0],D=T[0],B=60*+T[1]+ +T[2];return B===0?0:D==="+"?B:-B}(h),h===null))return this;var w=Math.abs(h)<=16?60*h:h;if(w===0)return this.utc(A);var R=this.clone();if(A)return R.$offset=w,R.$u=!1,R;var E=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(R=this.local().add(w+E,e)).$offset=w,R.$x.$localOffset=E,R};var g=i.format;i.format=function(h){var A=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,A)},i.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var v=i.toDate;i.toDate=function(h){return h==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var C=i.diff;i.diff=function(h,A,b){if(h&&this.$u===h.$u)return C.call(this,h,A,b);var w=this.local(),R=a(h).local();return C.call(w,R,A,b)}}})});var NI=It(($be,_I)=>{"use strict";d();c();l();u();function mB(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}_I.exports=gB;function gB(e,t,r){var n=r&&r.stringify||mB,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var p=1;p<a;p++)i[p]=n(t[p]);return i.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",g=1-o,v=-1,C=e&&e.length||0,h=0;h<C;){if(e.charCodeAt(h)===37&&h+1<C){switch(v=v>-1?v:0,e.charCodeAt(h+1)){case 100:case 102:if(g>=f||t[g]==null)break;v<h&&(m+=e.slice(v,h)),m+=Number(t[g]),v=h+2,h++;break;case 105:if(g>=f||t[g]==null)break;v<h&&(m+=e.slice(v,h)),m+=Math.floor(Number(t[g])),v=h+2,h++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;v<h&&(m+=e.slice(v,h));var A=typeof t[g];if(A==="string"){m+="'"+t[g]+"'",v=h+2,h++;break}if(A==="function"){m+=t[g].name||"<anonymous>",v=h+2,h++;break}m+=n(t[g]),v=h+2,h++;break;case 115:if(g>=f)break;v<h&&(m+=e.slice(v,h)),m+=String(t[g]),v=h+2,h++;break;case 37:v<h&&(m+=e.slice(v,h)),m+="%",v=h+2,h++,g--;break}++g}++h}return v===-1?e:(v<C&&(m+=e.slice(v)),m)}});var UI=It((Ybe,yg)=>{"use strict";d();c();l();u();var DI=NI();yg.exports=oo;var ql=PB().console||{},hB={mapHttpRequest:hg,mapHttpResponse:hg,wrapRequestSerializer:Dx,wrapResponseSerializer:Dx,wrapErrorSerializer:Dx,req:hg,res:hg,err:MI,errWithCause:MI};function zo(e,t){return e==="silent"?1/0:t.levels.values[e]}var Vx=Symbol("pino.logFuncs"),qx=Symbol("pino.hierarchy"),yB={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function qI(e,t){let r={logger:t,parent:e[qx]};t[qx]=r}function SB(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:ql[o]||ql[yB[o]||"log"]||ac}),e[Vx]=n}function vB(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function oo(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||ql;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=vB(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&p.forEach(function(b){r[b]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=ac),SB(m,p,r),qI({},m),Object.defineProperty(m,"levelVal",{get:v}),Object.defineProperty(m,"level",{get:C,set:h});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:p,timestamp:EB(e),messageKey:e.messageKey||"msg",onChild:e.onChild||ac};m.levels=xB(e),m.level=f,m.isLevelEnabled=function(b){return this.levels.values[b]?this.levels.values[b]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=ac,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...b){return A.call(this,g,...b)},t&&(m._logEvent=Mx());function v(){return zo(this.level,this)}function C(){return this._level}function h(b){if(b!=="silent"&&!this.levels.values[b])throw Error("unknown level "+b);this._level=b,ci(this,g,m,"error"),ci(this,g,m,"fatal"),ci(this,g,m,"warn"),ci(this,g,m,"info"),ci(this,g,m,"debug"),ci(this,g,m,"trace"),i.forEach(w=>{ci(this,g,m,w)})}function A(b,w,R){if(!w)throw new Error("missing bindings for child Pino");R=R||{},o&&w.serializers&&(R.serializers=w.serializers);let E=R.serializers;if(o&&E){var I=Object.assign({},n,E),k=e.browser.serialize===!0?Object.keys(I):o;delete w.serializers,jx([w],k,I,this._stdErrSerialize)}function T(B){this._childLevel=(B._childLevel|0)+1,this.bindings=w,I&&(this.serializers=I,this._serialize=k),t&&(this._logEvent=Mx([].concat(B._logEvent.bindings,w)))}T.prototype=this;let D=new T(this);return qI(this,D),D.child=function(...B){return A.call(this,b,...B)},D.level=R.level||this.level,b.onChild(D),D}return m}function xB(e){let t=e.customLevels||{},r=Object.assign({},oo.levels.values,t),n=Object.assign({},oo.levels.labels,AB(t));return{values:r,labels:n}}function AB(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}oo.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"}};oo.stdSerializers=hB;oo.stdTimeFunctions=Object.assign({},{nullTime:jI,epochTime:LI,unixTime:IB,isoTime:TB});function CB(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[qx];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function ci(e,t,r,n){if(Object.defineProperty(e,n,{value:zo(e.level,r)>zo(n,r)?ac:r[Vx][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===ac){if(!t.transmit)return;let a=t.transmit.level||e.level,i=zo(a,r);if(zo(n,r)<i)return}e[n]=wB(e,t,r,n);let o=CB(e);o.length!==0&&(e[n]=bB(o,e[n]))}function bB(e,t){return function(){return t.apply(this,[...e,...arguments])}}function wB(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ql?ql:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&(jx(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters){let v=RB(this,n,p,i,t);if(t.reportCaller&&v&&v.length>0&&v[0]&&typeof v[0]=="object")try{let C=VI();C&&(v[0].caller=C)}catch{}o.call(f,...v)}else{if(t.reportCaller)try{let v=VI();v&&p.push(v)}catch{}o.apply(f,p)}if(t.transmit){let v=t.transmit.level||e._level,C=zo(v,r),h=zo(n,r);if(h<C)return;FB(this,{ts:i,methodLevel:n,methodValue:h,transmitLevel:v,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:zo(e._level,r)},p,g)}}}(e[Vx][n])}function RB(e,t,r,n,o){let{level:a,log:i=v=>v}=o.formatters||{},p=r.slice(),f=p[0],m={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(m.time=n),a){let v=a(t,e.levels.values[t]);Object.assign(m,v)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[i(m),...p]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?DI(p.shift(),p):void 0}else typeof f=="string"&&(f=DI(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function jx(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=oo.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function FB(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||jx(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(g){return m.indexOf(g)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=p,o(i,e._logEvent,f),e._logEvent=Mx(m)}function Mx(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function MI(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 EB(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?jI:LI}function hg(){return{}}function Dx(e){return e}function ac(){}function jI(){return!1}function LI(){return Date.now()}function IB(){return Math.round(Date.now()/1e3)}function TB(){return new Date(Date.now()).toISOString()}function PB(){function e(t){return typeof t<"u"&&t}try{return typeof y<"u"?y:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),y)}catch{return e(self)||e(window)||e(this)||{}}}yg.exports.default=oo;yg.exports.pino=oo;function VI(){let e=new Error().stack;if(!e)return null;let t=e.split(`
|
|
20
|
+
`);for(let r=1;r<t.length;r++){let n=t[r].trim();if(/(^at\s+)?(createWrap|LOG|set\s*\(|asObject|Object\.apply|Function\.apply)/.test(n)||n.indexOf("browser.js")!==-1||n.indexOf("node:internal")!==-1||n.indexOf("node_modules")!==-1)continue;let o=n.match(/\((.*?):(\d+):(\d+)\)/);if(o||(o=n.match(/at\s+(.*?):(\d+):(\d+)/)),o){let a=o[1],i=o[2],p=o[3];return a+":"+i+":"+p}}return null}});var u3={};vu(u3,{API_DATE_FORMAT:()=>bs,DefaultFieldsToInclude:()=>Jx,EcommerceDefaultFieldsToInclude:()=>kP,HighlightUtils:()=>_y,MinimumFieldsToInclude:()=>Oh,ResultTemplatesHelpers:()=>wR,SortBy:()=>Ca,SortOrder:()=>nl,VERSION:()=>xo,baseFacetResponseSelector:()=>Lr,buildAutomaticFacetGenerator:()=>GT,buildBreadcrumbManager:()=>wT,buildCategoryFacet:()=>tP,buildCategoryFieldSuggestions:()=>wP,buildContext:()=>ET,buildController:()=>oe,buildCriterionExpression:()=>tn,buildDateFacet:()=>gP,buildDateFilter:()=>yP,buildDateRange:()=>Yo,buildDateSortCriterion:()=>fp,buildDictionaryFieldContext:()=>PT,buildDidYouMean:()=>qT,buildExecuteTrigger:()=>MO,buildFacet:()=>uP,buildFacetConditionsManager:()=>TT,buildFacetManager:()=>VT,buildFieldSortCriterion:()=>mp,buildFieldSuggestions:()=>RP,buildFoldedResultList:()=>NP,buildGeneratedAnswer:()=>GP,buildHistoryManager:()=>nk,buildInstantResults:()=>fk,buildInteractiveCitation:()=>HP,buildInteractiveInstantResult:()=>ok,buildInteractiveRecentResult:()=>Ok,buildInteractiveResult:()=>Lk,buildNoSortCriterion:()=>hp,buildNotifyTrigger:()=>jO,buildNumericFacet:()=>AP,buildNumericFilter:()=>bP,buildNumericRange:()=>kc,buildPager:()=>hk,buildQueryError:()=>Sk,buildQueryExpression:()=>s3,buildQueryRankingExpressionSortCriterion:()=>gp,buildQuerySummary:()=>xk,buildQueryTrigger:()=>LO,buildQuickview:()=>wk,buildRecentQueriesList:()=>Tk,buildRecentResultsList:()=>Nk,buildRedirectionTrigger:()=>UO,buildRelevanceInspector:()=>jk,buildRelevanceSortCriterion:()=>rs,buildResultList:()=>Uk,buildResultTemplatesManager:()=>ZO,buildResultsPerPage:()=>Bk,buildSearchBox:()=>ey,buildSearchEngine:()=>eT,buildSearchParameterManager:()=>ay,buildSearchParameterSerializer:()=>rd,buildSearchStatus:()=>pO,buildSmartSnippet:()=>hO,buildSmartSnippetQuestionsList:()=>vO,buildSort:()=>bO,buildStandaloneSearchBox:()=>EO,buildStaticFilter:()=>IO,buildStaticFilterValue:()=>kA,buildTab:()=>PO,buildTabManager:()=>kO,buildUrlManager:()=>zO,currentPageSelector:()=>mo,currentPagesSelector:()=>Bh,deserializeRelativeDate:()=>oR,facetRequestSelector:()=>cp,facetResponseSelectedValuesSelector:()=>cw,facetResponseSelector:()=>Ki,getAnalyticsNextApiBaseUrl:()=>Sd,getOrganizationEndpoint:()=>Pt,getSampleSearchEngineConfiguration:()=>Qx,getSearchApiBaseUrl:()=>St,loadAdvancedSearchQueryActions:()=>hH,loadAutomaticFacetSetActions:()=>TH,loadBreadcrumbActions:()=>xH,loadCategoryFacetSetActions:()=>PH,loadClickAnalyticsActions:()=>yH,loadConfigurationActions:()=>AH,loadContextActions:()=>bH,loadDateFacetSetActions:()=>OH,loadDebugActions:()=>wH,loadDictionaryFieldContextActions:()=>RH,loadDidYouMeanActions:()=>FH,loadExcerptLengthActions:()=>EH,loadFacetOptionsActions:()=>IH,loadFacetSetActions:()=>kH,loadFieldActions:()=>NH,loadFoldingActions:()=>DH,loadGeneratedAnswerActions:()=>qH,loadGenericAnalyticsActions:()=>SH,loadHistoryActions:()=>MH,loadIPXActionsHistoryActions:()=>gH,loadInstantResultsActions:()=>VH,loadNumericFacetSetActions:()=>_H,loadPaginationActions:()=>jH,loadPipelineActions:()=>LH,loadQueryActions:()=>UH,loadQuerySetActions:()=>QH,loadQuerySuggestActions:()=>BH,loadQuestionAnsweringActions:()=>GH,loadRecentQueriesActions:()=>$H,loadRecentResultsActions:()=>HH,loadResultPreviewActions:()=>zH,loadSearchActions:()=>YH,loadSearchAnalyticsActions:()=>vH,loadSearchConfigurationActions:()=>CH,loadSearchHubActions:()=>XH,loadSearchParameterActions:()=>JH,loadSortCriteriaActions:()=>t3,loadStandaloneSearchBoxSetActions:()=>r3,loadStaticFilterSetActions:()=>n3,loadTabSetActions:()=>o3,maxPageSelector:()=>Xl,parseCriterionExpression:()=>e_,validateRelativeDate:()=>Po});module.exports=x_(u3);d();c();l();u();var _y={};vu(_y,{escapeHtml:()=>Di,getHighlightedSuggestion:()=>Oy,highlightString:()=>K_});d();c();l();u();d();c();l();u();function Q_(e,t){let r=`
|
|
20
21
|
The following properties are invalid:
|
|
21
22
|
|
|
22
23
|
${e.join(`
|
|
23
24
|
`)}
|
|
24
25
|
|
|
25
26
|
${t}
|
|
26
|
-
`;return new
|
|
27
|
-
${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":AN(h,n,t);break}}}}function AN(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function CN(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function VA(){return{data:"",event:"",id:"",retry:void 0}}var xy="text/event-stream",bN=1e3,QA="last-event-id";function BA(){return typeof window<"u"}function pd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((h,x)=>{let A={...r};A.accept||(A.accept=xy);let y;function C(){y?.abort(),document.hidden||k()}!p&&BA()&&document.addEventListener("visibilitychange",C);let R=bN,b;function w(){BA()&&document.removeEventListener("visibilitychange",C),clearTimeout(b),y?.abort()}t?.addEventListener("abort",()=>{w(),h()});let P=f??S,F=n??wN;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){y=s.AbortController?new s.AbortController:null;try{let T=yield P(e,{...m,headers:A,signal:y?.signal});yield F(T),yield jA(T.body,LA(UA(D=>{D?A[QA]=D:delete A[QA]},D=>{R=D},o))),a?.(),w(),h()}catch(T){if(!y?.signal?.aborted)try{let D=i?.(T)??R;clearTimeout(b),b=setTimeout(k,D)}catch(D){w(),x(D)}}});return _k2.apply(this,arguments)}k()})}function wN(e){let t=e.headers.get("content-type");if(!t?.startsWith(xy))throw new Error(`Expected content-type to be ${xy}, Actual: ${t}`)}d();c();l();u();var go=class{constructor(t){ke(this,"_basePath");ke(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var RN=(e,t,r)=>new go(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,GA=3,FN=5e3,EN="text/event-stream",by=1,Ay=class extends Error{},Ru=class extends Error{constructor(r){super(r.message);this.payload=r}},Cy=class{constructor(){ke(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},fd=class{constructor(t){ke(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:h}=r,x=new Cy;if(!a){this.logger.error("No stream ID found");return}let A=0,y,C=()=>{y&&!x.isActive(y)&&(b?.abort(),h(),w())},R=()=>{x.remove(y),y=MA(C,y,FN),x.add(y)},b=new s.AbortController,w=()=>pd(RN(n,o,a),{method:"GET",fetch:S,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:b?.signal,onopen(P){return _asyncToGenerator(function*(){if(P.ok&&P.headers.get("content-type")===EN)return;throw P.status>=400&&P.status<500&&P.status!==429?new Ru({message:"Error opening stream",code:P.status}):new Ay})()},onmessage:P=>{if(b?.signal.aborted)return;let F=JSON.parse(P.data);if(F.finishReason==="ERROR"){x.remove(y),b?.abort(),f({message:F.errorMessage,code:F.statusCode});return}p(F),A=0,F.finishReason==="COMPLETED"?(x.remove(y),m()):R()},onerror:P=>{if(!b?.signal.aborted){if(x.remove(y),P instanceof Ru)throw b?.abort(),f(P),P;if(++A>GA){this.logger.info("Maximum retry exceeded.");let F={message:"Failed to complete stream.",code:by};throw b?.abort(),f(F),new Ru(F)}this.logger.info(`Retrying...(${A}/${GA})`),h()}}});return w(),b}};d();c();l();u();var rC=Mr(XA(),1);d();c();l();u();var K=new Error("Failed to load reducers."),Di=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."}},la=class extends Error{constructor(r,n){super();ke(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 ZA(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function eC(e){return typeof e!="object"||!e?!1:Object.values(e).every(ZN)}function ZN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function tC(e){return e===429}var Vr=class e{static call(t){return _asyncToGenerator(function*(){let r=e_(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield S(a,i);if(tC(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,rC.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let h=m&&tC(m.status);return h&&(n.info("Platform retrying request"),yield new Promise(x=>setTimeout(x,1e3))),h});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Di;case 404:throw new la(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new la(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=wu(f);try{let h=yield o(t,n,i);return{...t,...h}}catch(h){a.error(h,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function Pt(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function lt(e,t="prod"){return`${Pt(e,t)}/rest/search/v2`}function gd(e,t="prod"){return`${Pt(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function e_(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=t_(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function t_(e,t){return t==="application/x-www-form-urlencoded"?eC(e)?ZA(e):"":JSON.stringify(e)}d();c();l();u();var hd=e=>e;d();c();l();u();d();c();l();u();function qi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function ir(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:qi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:qi(),extendedResults:{},searchAction:void 0}}d();c();l();u();function ho(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var yo=e=>{let{response:t}=e;return t.body?r_(e):n_(t)},r_=e=>a_(e)?i_(e):o_(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},n_=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function o_(e){return e.body.statusCode!==void 0}function a_(e){return e.body.exception!==void 0}var i_=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var So=class{constructor(){ke(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();function nC(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Un=(e,t,r,n)=>{let o=new go(`${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 oC=(e,t)=>{let r=new go(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},aC=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Vr.call({...Un(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:ho(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=nC(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return s_(i)?{success:i}:{error:yo({response:r,body:i})}});return function aC(_x5,_x6){return _ref3.apply(this,arguments)}}();function s_(e){return typeof e=="string"}d();c();l();u();function c_(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function u_(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function yd(e,t){if(t&&e.name==="AbortError")return{error:u_(e)};if(e instanceof la)return{error:c_(e)};throw e}var Sd=class{constructor(t){this.options=t;ke(this,"apiCallsQueues",{unknown:new So,mainSearch:new So,facetValues:new So,foldingCollection:new So,instantResults:new So})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...Un(t,"POST","application/json","/plan"),requestParams:ho(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return yd(r);let n=yield r.json();return d_(n)?{success:n}:{error:yo({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...Un(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:ho(t),..._this3.options});if(r instanceof Error)return yd(r);let n=yield r.json(),o={response:r,body:n};return l_(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:yo(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>Vr.call({...Un(t,"POST","application/json",""),requestParams:ho(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return yd(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return iC(a)?(i.body=sC(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:yo(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...Un(t,"POST","application/json","/facet"),requestParams:ho(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 Vr.call({...Un(t,"POST","application/json",""),requestParams:ho(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(iC(n)){let o={response:r,body:n};return o.body=sC(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:yo({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return aC(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Vr.call({...Un(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return p_(n)?{success:n}:{error:yo({response:r,body:n})}})()}},vd=e=>e.success!==void 0,vt=e=>e.error!==void 0;function iC(e){return e.results!==void 0}function sC(e){let t=qi();return de(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function l_(e){return e.completions!==void 0}function d_(e){return e.preprocessingOutput!==void 0}function p_(e){return e.fields!==void 0}d();c();l();u();var cC=e=>e,uC=e=>e,lC=e=>e;d();c();l();u();d();c();l();u();var W=new U({required:!0,emptyAllowed:!1}),st=new U({required:!1,emptyAllowed:!1}),Qe=new U({required:!0,emptyAllowed:!0}),o4=new U({required:!1,emptyAllowed:!0}),xd=new ie({each:W,required:!0}),dC=new U({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),pC=new U({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),a4=new U({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Qn=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),mr=(e,t)=>{if("required"in t)return{payload:new ye({value:t}).validate({value:e}).value};let o=new X({options:{required:!0},values:t}).validate(e);if(o)throw new Cu(o);return{payload:e}},O=(e,t)=>{try{return mr(e,t)}catch(r){return{payload:e,error:Qn(r)}}},dt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return fC(e,t,r,o,"Controller initialization error")},Ge=(e,t,r,n)=>{let o=`Check the options of ${n}`;return fC(e,t,r,o,"Controller initialization error")},fC=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function kt(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 f_=typeof Symbol=="function"&&Symbol.observable||"@@observable",mC=f_,Oy=()=>Math.random().toString(36).substring(7).split("").join("."),m_={INIT:`@@redux/INIT${Oy()}`,REPLACE:`@@redux/REPLACE${Oy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Oy()}`},Ad=m_;function Yr(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 Ny(e,t,r){if(typeof e!="function")throw new Error(kt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(kt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(kt(1));return r(Ny)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((b,w)=>{i.set(w,b)}))}function h(){if(f)throw new Error(kt(3));return o}function x(b){if(typeof b!="function")throw new Error(kt(4));if(f)throw new Error(kt(5));let w=!0;m();let P=p++;return i.set(P,b),function(){if(w){if(f)throw new Error(kt(6));w=!1,m(),i.delete(P),a=null}}}function A(b){if(!Yr(b))throw new Error(kt(7));if(typeof b.type>"u")throw new Error(kt(8));if(typeof b.type!="string")throw new Error(kt(17));if(f)throw new Error(kt(9));try{f=!0,o=n(o,b)}finally{f=!1}return(a=i).forEach(P=>{P()}),b}function y(b){if(typeof b!="function")throw new Error(kt(10));n=b,A({type:Ad.REPLACE})}function C(){let b=x;return{subscribe(w){if(typeof w!="object"||w===null)throw new Error(kt(11));function P(){let k=w;k.next&&k.next(h())}return P(),{unsubscribe:b(P)}},[mC](){return this}}}return A({type:Ad.INIT}),{dispatch:A,subscribe:x,getState:h,replaceReducer:y,[mC]:C}}function g_(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ad.INIT})>"u")throw new Error(kt(12));if(typeof r(void 0,{type:Ad.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(kt(13))})}function Mi(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{g_(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,h={};for(let x=0;x<n.length;x++){let A=n[x],y=r[A],C=p[A],R=y(C,f);if(typeof R>"u"){let b=f&&f.type;throw new Error(kt(14))}h[A]=R,m=m||R!==C}return m=m||n.length!==Object.keys(p).length,m?h:p}}function Iu(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function gC(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(kt(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=Iu(...p)(o.dispatch),{...o,dispatch:a}}}function Tu(e){return Yr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var Qy=Symbol.for("immer-nothing"),Pu=Symbol.for("immer-draftable"),xt=Symbol.for("immer-state");function Ot(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,pa=sr.getPrototypeOf,Ou="constructor",Mu="prototype",qy="configurable",Rd="enumerable",bd="writable",Nu="value",zt=e=>!!e&&!!e[xt];function Wt(e){return e?bC(e)||ju(e)||!!e[Pu]||!!e[Ou]?.[Pu]||Lu(e)||Uu(e):!1}var h_=sr[Mu][Ou].toString(),hC=new WeakMap;function bC(e){if(!e||!Vi(e))return!1;let t=pa(e);if(t===null||t===sr[Mu])return!0;let r=sr.hasOwnProperty.call(t,Ou)&&t[Ou];if(r===Object)return!0;if(!da(r))return!1;let n=hC.get(r);return n===void 0&&(n=Function.toString.call(r),hC.set(r,n)),n===h_}function wC(e){return zt(e)||Ot(15,e),e[xt].base_}function Vu(e,t,r=!0){fa(e)===0?(r?Reflect.ownKeys(e):sr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function fa(e){let t=e[xt];return t?t.type_:ju(e)?1:Lu(e)?2:Uu(e)?3:0}var ku=(e,t,r=fa(e))=>r===2?e.has(t):sr[Mu].hasOwnProperty.call(e,t),Bn=(e,t,r=fa(e))=>r===2?e.get(t):e[t],Fd=(e,t,r,n=fa(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function y_(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ju=Array.isArray,Lu=e=>e instanceof Map,Uu=e=>e instanceof Set,Vi=e=>typeof e=="object",da=e=>typeof e=="function",_y=e=>typeof e=="boolean";function S_(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var v_=e=>Vi(e)?e?.[xt]:null,Gn=e=>e.copy_||e.base_;var By=e=>e.modified_?e.copy_:e.base_;function My(e,t){if(Lu(e))return new Map(e);if(Uu(e))return new Set(e);if(ju(e))return Array[Mu].slice.call(e);let r=bC(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[xt];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[bd]===!1&&(p[bd]=!0,p[qy]=!0),(p.get||p.set)&&(n[i]={[qy]:!0,[bd]:!0,[Rd]:p[Rd],[Nu]:e[i]})}return sr.create(pa(e),n)}else{let n=pa(e);if(n!==null&&r)return{...e};let o=sr.create(n);return sr.assign(o,e)}}function Gy(e,t=!1){return Od(e)||zt(e)||!Wt(e)||(fa(e)>1&&sr.defineProperties(e,{set:Cd,add:Cd,clear:Cd,delete:Cd}),sr.freeze(e),t&&Vu(e,(r,n)=>{Gy(n,!0)},!1)),e}function x_(){Ot(2)}var Cd={[Nu]:x_};function Od(e){return e===null||!Vi(e)?!0:sr.isFrozen(e)}var Ed="MapSet",Id="Patches",yC="ArrayMethods",Td={};function ma(e){let t=Td[e];return t||Ot(0,e),t}var SC=e=>!!Td[e];function A_(e,t){Td[e]||(Td[e]=t)}var _u,RC=()=>_u,C_=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:SC(Ed)?ma(Ed):void 0,arrayMethodsPlugin_:SC(yC)?ma(yC):void 0});function vC(e,t){t&&(e.patchPlugin_=ma(Id),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vy(e){jy(e),e.drafts_.forEach(b_),e.drafts_=null}function jy(e){e===_u&&(_u=e.parent_)}var xC=e=>_u=C_(_u,e);function b_(e){let t=e[xt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function AC(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[xt].modified_&&(Vy(t),Ot(4)),Wt(e)&&(e=CC(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[xt].base_,e,t)}else e=CC(t,r);return w_(t,e,!0),Vy(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Qy?e:void 0}function CC(e,t){if(Od(t))return t;let r=t[xt];if(!r)return Pd(t,e.handledSet_,e);if(!Nd(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);IC(r,e)}return r.copy_}function w_(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Gy(t,r)}function FC(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Nd=(e,t)=>e.scope_===t,R_=[];function EC(e,t,r,n){let o=Gn(e),a=e.type_;if(n!==void 0&&Bn(o,n,a)===t){Fd(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;Vu(o,(f,m)=>{if(zt(m)){let h=p.get(m)||[];h.push(f),p.set(m,h)}})}let i=e.draftLocations_.get(t)??R_;for(let p of i)Fd(o,p,r,a)}function F_(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Nd(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=By(a);EC(e,a.draft_??a,i,r),IC(a,o)})}function IC(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}FC(e)}}function E_(e,t,r){let{scope_:n}=e;if(zt(r)){let o=r[xt];Nd(o,n)&&o.callbacks_.push(function(){wd(e);let i=By(o);EC(e,r,i,t)})}else Wt(r)&&e.callbacks_.push(function(){let a=Gn(e);e.type_===3?a.has(r)&&Pd(r,n.handledSet_,n):Bn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Pd(Bn(e.copy_,t,e.type_),n.handledSet_,n)})}function Pd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||zt(e)||t.has(e)||!Wt(e)||Od(e)||(t.add(e),Vu(e,(n,o)=>{if(zt(o)){let a=o[xt];if(Nd(a,r)){let i=By(a);Fd(e,n,i,e.type_),FC(a)}}else Wt(o)&&Pd(o,t,r)})),e}function I_(e,t){let r=ju(e),n={type_:r?1:0,scope_:t?t.scope_:RC(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=kd;r&&(o=[n],a=Du);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var kd={get(e,t){if(t===xt)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=Gn(e);if(!ku(o,t,e.type_))return T_(e,o,t);let a=o[t];if(e.finalized_||!Wt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&S_(t))return a;if(a===Dy(e.base_,t)){wd(e);let i=e.type_===1?+t:t,p=Uy(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in Gn(e)},ownKeys(e){return Reflect.ownKeys(Gn(e))},set(e,t,r){let n=TC(Gn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Dy(Gn(e),t),a=o?.[xt];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(y_(r,o)&&(r!==void 0||ku(e.base_,t,e.type_)))return!0;wd(e),Ly(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_.set(t,!0),E_(e,t,r)),!0},deleteProperty(e,t){return wd(e),Dy(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ly(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Gn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[bd]:!0,[qy]:e.type_!==1||t!=="length",[Rd]:n[Rd],[Nu]:r[t]}},defineProperty(){Ot(11)},getPrototypeOf(e){return pa(e.base_)},setPrototypeOf(){Ot(12)}},Du={};for(let e in kd){let t=kd[e];Du[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Du.deleteProperty=function(e,t){return Du.set.call(this,e,t,void 0)};Du.set=function(e,t,r){return kd.set.call(this,e[0],t,r,e[0])};function Dy(e,t){let r=e[xt];return(r?Gn(r):e)[t]}function T_(e,t,r){let n=TC(t,r);return n?Nu in n?n[Nu]:n.get?.call(e.draft_):void 0}function TC(e,t){if(!(t in e))return;let r=pa(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=pa(r)}}function Ly(e){e.modified_||(e.modified_=!0,e.parent_&&Ly(e.parent_))}function wd(e){e.copy_||(e.assigned_=new Map,e.copy_=My(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var P_=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(da(t)&&!da(r)){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,h=>r.call(this,h,...m))}}da(r)||Ot(6),n!==void 0&&!da(n)&&Ot(7);let o;if(Wt(t)){let a=xC(this),i=Uy(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?Vy(a):jy(a)}return vC(a,n),AC(o,a)}else if(!t||!Vi(t)){if(o=r(t),o===void 0&&(o=t),o===Qy&&(o=void 0),this.autoFreeze_&&Gy(o,!0),n){let a=[],i=[];ma(Id).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else Ot(1,t)},this.produceWithPatches=(t,r)=>{if(da(t))return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},_y(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),_y(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),_y(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Wt(e)||Ot(8),zt(e)&&(e=_d(e));let t=xC(this),r=Uy(t,e,void 0);return r[xt].isManual_=!0,jy(t),r}finishDraft(e,t){let r=e&&e[xt];(!r||!r.isManual_)&&Ot(9);let{scope_:n}=r;return vC(n,t),AC(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}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=ma(Id).applyPatches_;return zt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Uy(e,t,r,n){let[o,a]=Lu(t)?ma(Ed).proxyMap_(t,r):Uu(t)?ma(Ed).proxySet_(t,r):I_(t,r);return(r?.scope_??RC()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?F_(r,a,n):a.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:m}=f;a.modified_&&m&&m.generatePatches_(a,[],f)}),o}function _d(e){return zt(e)||Ot(10,e),PC(e)}function PC(e){if(!Wt(e)||Od(e))return e;let t=e[xt],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=My(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=My(e,!0);return Vu(r,(o,a)=>{Fd(r,o,PC(a))},n),t&&(t.finalized_=!1),r}function kC(){function t(C,R=[]){if(C.key_!==void 0){let b=C.parent_.copy_??C.parent_.base_,w=v_(Bn(b,C.key_)),P=Bn(b,C.key_);if(P===void 0||P!==C.draft_&&P!==C.base_&&P!==C.copy_||w!=null&&w.base_!==C.base_)return null;let F=C.parent_.type_===3,k;if(F){let T=C.parent_;k=Array.from(T.drafts_.keys()).indexOf(C.key_)}else k=C.key_;if(!(F&&b.size>k||ku(b,k)))return null;R.push(k)}if(C.parent_)return t(C.parent_,R);R.reverse();try{r(C.copy_,R)}catch{return null}return R}function r(C,R){let b=C;for(let w=0;w<R.length-1;w++){let P=R[w];if(b=Bn(b,P),!Vi(b)||b===null)throw new Error(`Cannot resolve path at '${R.join("/")}'`)}return b}let n="replace",o="add",a="remove";function i(C,R,b){if(C.scope_.processedForPatches_.has(C))return;C.scope_.processedForPatches_.add(C);let{patches_:w,inversePatches_:P}=b;switch(C.type_){case 0:case 2:return f(C,R,w,P);case 1:return p(C,R,w,P);case 3:return m(C,R,w,P)}}function p(C,R,b,w){let{base_:P,assigned_:F}=C,k=C.copy_;k.length<P.length&&([P,k]=[k,P],[b,w]=[w,b]);let T=C.allIndicesReassigned_===!0;for(let D=0;D<P.length;D++){let G=k[D],L=P[D];if((T||F?.get(D.toString()))&&G!==L){let Q=G?.[xt];if(Q&&Q.modified_)continue;let j=R.concat([D]);b.push({op:n,path:j,value:y(G)}),w.push({op:n,path:j,value:y(L)})}}for(let D=P.length;D<k.length;D++){let G=R.concat([D]);b.push({op:o,path:G,value:y(k[D])})}for(let D=k.length-1;P.length<=D;--D){let G=R.concat([D]);w.push({op:a,path:G})}}function f(C,R,b,w){let{base_:P,copy_:F,type_:k}=C;Vu(C.assigned_,(T,D)=>{let G=Bn(P,T,k),L=Bn(F,T,k),V=D?ku(P,T)?n:o:a;if(G===L&&V===n)return;let Q=R.concat(T);b.push(V===a?{op:V,path:Q}:{op:V,path:Q,value:y(L)}),w.push(V===o?{op:a,path:Q}:V===a?{op:o,path:Q,value:y(G)}:{op:n,path:Q,value:y(G)})})}function m(C,R,b,w){let{base_:P,copy_:F}=C,k=0;P.forEach(T=>{if(!F.has(T)){let D=R.concat([k]);b.push({op:a,path:D,value:T}),w.unshift({op:o,path:D,value:T})}k++}),k=0,F.forEach(T=>{if(!P.has(T)){let D=R.concat([k]);b.push({op:o,path:D,value:T}),w.unshift({op:a,path:D,value:T})}k++})}function h(C,R,b){let{patches_:w,inversePatches_:P}=b;w.push({op:n,path:[],value:R===Qy?void 0:R}),P.push({op:n,path:[],value:C})}function x(C,R){return R.forEach(b=>{let{path:w,op:P}=b,F=C;for(let G=0;G<w.length-1;G++){let L=fa(F),V=w[G];typeof V!="string"&&typeof V!="number"&&(V=""+V),(L===0||L===1)&&(V==="__proto__"||V===Ou)&&Ot(19),da(F)&&V===Mu&&Ot(19),F=Bn(F,V),Vi(F)||Ot(18,w.join("/"))}let k=fa(F),T=A(b.value),D=w[w.length-1];switch(P){case n:switch(k){case 2:return F.set(D,T);case 3:Ot(16);default:return F[D]=T}case o:switch(k){case 1:return D==="-"?F.push(T):F.splice(D,0,T);case 2:return F.set(D,T);case 3:return F.add(T);default:return F[D]=T}case a:switch(k){case 1:return F.splice(D,1);case 2:return F.delete(D);case 3:return F.delete(b.value);default:return delete F[D]}default:Ot(17,P)}}),C}function A(C){if(!Wt(C))return C;if(ju(C))return C.map(A);if(Lu(C))return new Map(Array.from(C.entries()).map(([b,w])=>[b,A(w)]));if(Uu(C))return new Set(Array.from(C).map(A));let R=Object.create(pa(C));for(let b in C)R[b]=A(C[b]);return ku(C,Pu)&&(R[Pu]=C[Pu]),R}function y(C){return zt(C)?A(C):C}A_(Id,{applyPatches_:x,generatePatches_:i,generateReplacementPatches_:h,getPath:t})}var qu=new P_,ga=qu.produce,$y=qu.produceWithPatches.bind(qu);var Hy=qu.applyPatches.bind(qu);d();c();l();u();function k_(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function O_(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function N_(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 OC=e=>Array.isArray(e)?e:[e];function __(e){let t=Array.isArray(e[0])?e[0]:e;return N_(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function D_(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var C4=Object.getPrototypeOf({});var q_=class{constructor(e){this.value=e}deref(){return this.value}},M_=typeof WeakRef<"u"?WeakRef:q_,V_=0,NC=1;function Dd(){return{s:V_,v:void 0,o:null,p:null}}function Qu(e,t={}){let r=Dd(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let x=0,A=f;x<A;x++){let y=arguments[x];if(typeof y=="function"||typeof y=="object"&&y!==null){let C=p.o;C===null&&(p.o=C=new WeakMap);let R=C.get(y);R===void 0?(p=Dd(),C.set(y,p)):p=R}else{let C=p.p;C===null&&(p.p=C=new Map);let R=C.get(y);R===void 0?(p=Dd(),C.set(y,p)):p=R}}let m=p,h;if(p.s===NC)h=p.v;else if(h=e.apply(null,arguments),a++,n){let x=o?.deref?.()??o;x!=null&&n(x,h)&&(h=x,a!==0&&a--),o=typeof h=="object"&&h!==null||typeof h=="function"?new M_(h):h}return m.s=NC,m.v=h,h}return i.clearCache=()=>{r=Dd(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function j_(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),k_(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let h={...r,...f},{memoize:x,memoizeOptions:A=[],argsMemoize:y=Qu,argsMemoizeOptions:C=[],devModeChecks:R={}}=h,b=OC(A),w=OC(C),P=__(o),F=x(function(){return a++,m.apply(null,arguments)},...b),k=!0,T=y(function(){i++;let G=D_(P,arguments);return p=F.apply(null,G),p},...w);return Object.assign(T,{resultFunc:m,memoizedResultFunc:F,dependencies:P,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:x,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var Xe=j_(Qu),L_=Object.assign((e,t=Xe)=>{O_(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((i,p,f)=>(i[r[f]]=p,i),{}))},{withTypes:()=>L_});d();c();l();u();function _C(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var DC=_C(),qC=_C;var U_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Iu:Iu.apply(null,arguments)},L4=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Q_=e=>e&&typeof e.match=="function";function I(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Kt(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=>Tu(n)&&n.type===e,r}var GC=class Bu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Bu.prototype)}static get[Symbol.species](){return Bu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Bu(...t[0].concat(this)):new Bu(...t.concat(this))}};function MC(e){return Wt(e)?ga(e,()=>{}):e}function qd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function B_(e){return typeof e=="boolean"}var G_=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new GC;return r&&(B_(r)?i.push(DC):i.push(qC(r.extraArgument))),i},Gu="RTK_autoBatch",Ui=()=>e=>({payload:e,meta:{[Gu]:!0}}),VC=e=>t=>{setTimeout(t,e)},$_=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:VC(10):e.type==="callback"?e.queueNotification:VC(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let x=()=>o&&h(),A=n.subscribe(x);return p.add(h),()=>{A(),p.delete(h)}},dispatch(h){try{return o=!h?.meta?.[Gu],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(h)}finally{o=!0}}})},H_=e=>function(r){let{autoBatch:n=!0}=r??{},o=new GC(e);return n&&o.push($_(typeof n=="object"?n:void 0)),o};function $C(e){let t=G_(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Yr(r))f=Mi(r);else throw new Error(Kt(1));let m;typeof n=="function"?m=n(t):m=t();let h=Iu;o&&(h=U_({trace:!1,...(typeof o=="object"&&o)}));let x=gC(...m),A=H_(x),y=typeof p=="function"?p(A):A(),C=h(...y);return Ny(f,i,C)}function HC(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Kt(28));if(p in t)throw new Error(Kt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function z_(e){return typeof e=="function"}function ae(e,t){let[r,n,o]=HC(t),a;if(z_(e))a=()=>MC(e());else{let p=MC(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:h})=>h(f)).map(({reducer:h})=>h)];return m.filter(h=>!!h).length===0&&(m=[o]),m.reduce((h,x)=>{if(x)if(zt(h)){let y=x(h,f);return y===void 0?h:y}else{if(Wt(h))return ga(h,A=>x(A,f));{let A=x(h,f);if(A===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return A}}return h},p)}return i.getInitialState=a,i}var zC=(e,t)=>Q_(e)?e.match(t):e(t);function Jr(...e){return t=>e.some(r=>zC(r,t))}function Li(...e){return t=>e.every(r=>zC(r,t))}function Ld(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 $u(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Ud(...e){return e.length===0?t=>Ld(t,["pending"]):$u(e)?Jr(...e.map(t=>t.pending)):Ud()(e[0])}function ya(...e){return e.length===0?t=>Ld(t,["rejected"]):$u(e)?Jr(...e.map(t=>t.rejected)):ya()(e[0])}function Hu(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Li(ya(...e),t):$u(e)?Li(ya(...e),t):Hu()(e[0])}function $n(...e){return e.length===0?t=>Ld(t,["fulfilled"]):$u(e)?Jr(...e.map(t=>t.fulfilled)):$n()(e[0])}function Qd(...e){return e.length===0?t=>Ld(t,["pending","fulfilled","rejected"]):$u(e)?Jr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Qd()(e[0])}var W_="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",zu=(e=21)=>{let t="",r=e;for(;r--;)t+=W_[Math.random()*64|0];return t},K_=["name","message","stack","code"],zy=class{constructor(e,t){ke(this,"_type");this.payload=e,this.meta=t}},jC=class{constructor(e,t){ke(this,"_type");this.payload=e,this.meta=t}},Y_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of K_)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},LC="External signal was aborted",xe=(()=>{function e(t,r,n){let o=I(t+"/fulfilled",(f,m,h,x)=>({payload:f,meta:{...(x||{}),arg:h,requestId:m,requestStatus:"fulfilled"}})),a=I(t+"/pending",(f,m,h)=>({payload:void 0,meta:{...(h||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=I(t+"/rejected",(f,m,h,x,A)=>({payload:x,error:(n&&n.serializeError||Y_)(f||"Rejected"),meta:{...(A||{}),arg:h,requestId:m,rejectedWithValue:!!x,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(h,x,A)=>{let y=n?.idGenerator?n.idGenerator(f):zu(),C=new s.AbortController,R,b;function w(F){b=F,C.abort()}m&&(m.aborted?w(LC):m.addEventListener("abort",()=>w(LC),{once:!0}));let P=_asyncToGenerator(function*(){let F;try{let T=n?.condition?.(f,{getState:x,extra:A});if(X_(T)&&(T=yield T),T===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,L)=>{R=()=>{L({name:"AbortError",message:b||"Aborted"})},C.signal.addEventListener("abort",R,{once:!0})});h(a(y,f,n?.getPendingMeta?.({requestId:y,arg:f},{getState:x,extra:A}))),F=yield Promise.race([D,Promise.resolve(r(f,{dispatch:h,getState:x,extra:A,requestId:y,signal:C.signal,abort:w,rejectWithValue:(G,L)=>new zy(G,L),fulfillWithValue:(G,L)=>new jC(G,L)})).then(G=>{if(G instanceof zy)throw G;return G instanceof jC?o(G.payload,y,f,G.meta):o(G,y,f)})])}catch(T){F=T instanceof zy?i(null,y,f,T.payload,T.meta):i(T,y,f)}finally{R&&C.signal.removeEventListener("abort",R)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||h(F),F})();return Object.assign(P,{abort:w,requestId:y,arg:f,unwrap(){return P.then(J_)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Jr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function J_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function X_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var WC=Symbol.for("rtk-slice-createasyncthunk"),Q4={[WC]:xe};function Z_(e,t){return`${e}/${t}`}function e0({creators:e}={}){let t=e?.asyncThunk?.[WC];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Kt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(r0()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(F,k){let T=typeof F=="string"?F:F.type;if(!T)throw new Error(Kt(12));if(T in f.sliceCaseReducersByType)throw new Error(Kt(13));return f.sliceCaseReducersByType[T]=k,m},addMatcher(F,k){return f.sliceMatchers.push({matcher:F,reducer:k}),m},exposeAction(F,k){return f.actionCreators[F]=k,m},exposeCaseReducer(F,k){return f.sliceCaseReducersByName[F]=k,m}};p.forEach(F=>{let k=i[F],T={reducerName:F,type:Z_(o,F),createNotation:typeof n.reducers=="function"};o0(k)?i0(T,k,m,t):n0(T,k,m)});function h(){let[F={},k=[],T=void 0]=typeof n.extraReducers=="function"?HC(n.extraReducers):[n.extraReducers],D={...F,...f.sliceCaseReducersByType};return ae(n.initialState,G=>{for(let L in D)G.addCase(L,D[L]);for(let L of f.sliceMatchers)G.addMatcher(L.matcher,L.reducer);for(let L of k)G.addMatcher(L.matcher,L.reducer);T&&G.addDefaultCase(T)})}let x=F=>F,A=new Map,y=new WeakMap,C;function R(F,k){return C||(C=h()),C(F,k)}function b(){return C||(C=h()),C.getInitialState()}function w(F,k=!1){function T(G){let L=G[F];return typeof L>"u"&&k&&(L=qd(y,T,b)),L}function D(G=x){let L=qd(A,k,()=>new WeakMap);return qd(L,G,()=>{let V={};for(let[Q,j]of Object.entries(n.selectors??{}))V[Q]=t0(j,G,()=>qd(y,G,b),k);return V})}return{reducerPath:F,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}let P={name:o,reducer:R,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:b,...w(a),injectInto(F,{reducerPath:k,...T}={}){let D=k??a;return F.inject({reducerPath:D,reducer:R},T),{...P,...w(D,!0)}}};return P}}function t0(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var Sa=e0();function r0(){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 n0({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!a0(n))throw new Error(Kt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?I(e,i):I(e))}function o0(e){return e._reducerDefinitionType==="asyncThunk"}function a0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function i0({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Kt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:h}=r,x=o(e,a,h);n.exposeAction(t,x),i&&n.addCase(x.fulfilled,i),p&&n.addCase(x.pending,p),f&&n.addCase(x.rejected,f),m&&n.addMatcher(x.settled,m),n.exposeCaseReducer(t,{fulfilled:i||Md,pending:p||Md,rejected:f||Md,settled:m||Md})}function Md(){}var s0="task",KC="listener",YC="completed",Yy="cancelled",c0=`task-${Yy}`,u0=`task-${YC}`,Wy=`${KC}-${Yy}`,l0=`${KC}-${YC}`,Bd=class{constructor(e){ke(this,"name","TaskAbortError");ke(this,"message");this.code=e,this.message=`${s0} ${Yy} (reason: ${e})`}},Jy=(e,t)=>{if(typeof e!="function")throw new TypeError(Kt(32))},Vd=()=>{},JC=(e,t=Vd)=>(e.catch(t),e),XC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ha=e=>{if(e.aborted)throw new Bd(e.reason)};function ZC(e,t){let r=Vd;return new Promise((n,o)=>{let a=()=>o(new Bd(e.reason));if(e.aborted){a();return}r=XC(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Vd})}var d0=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Bd?"cancelled":"rejected",error:r}}finally{t?.()}});return function d0(_x7,_x8){return _ref5.apply(this,arguments)}}(),jd=e=>t=>JC(ZC(e,t).then(r=>(ha(e),r))),eb=e=>{let t=jd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ji}=Object,UC={},Gd="listenerMiddleware",p0=(e,t)=>{let r=n=>XC(e,()=>n.abort(e.reason));return(n,o)=>{Jy(n,"taskExecutor");let a=new s.AbortController;r(a);let i=d0(/*#__PURE__*/_asyncToGenerator(function*(){ha(e),ha(a.signal);let p=yield n({pause:jd(a.signal),delay:eb(a.signal),signal:a.signal});return ha(a.signal),p}),()=>a.abort(u0));return o?.autoJoin&&t.push(i.catch(Vd)),{result:jd(e)(i),cancel(){a.abort(c0)}}}},f0=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){ha(t);let a=()=>{},p=[new Promise((f,m)=>{let h=e({predicate:n,effect:(x,A)=>{A.unsubscribe(),f([x,A.getState(),A.getOriginalState()])}});a=()=>{h(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield ZC(t,Promise.race(p));return ha(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>JC(r(n,o))},tb=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=I(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Kt(21));return Jy(a,"options.listener"),{predicate:o,type:t,effect:a}},rb=ji(e=>{let{type:t,predicate:r,effect:n}=tb(e);return{id:zu(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Kt(22))}}},{withTypes:()=>rb}),QC=(e,t)=>{let{type:r,effect:n,predicate:o}=tb(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},Ky=e=>{e.pending.forEach(t=>{t.abort(Wy)})},m0=(e,t)=>()=>{for(let r of t.keys())Ky(r);e.clear()},BC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},nb=ji(I(`${Gd}/add`),{withTypes:()=>nb}),g0=I(`${Gd}/removeAll`),ob=ji(I(`${Gd}/remove`),{withTypes:()=>ob}),h0=(...e)=>{console.error(`${Gd}/error`,...e)},ab=(e={})=>{let t=new Map,r=new Map,n=y=>{let C=r.get(y)??0;r.set(y,C+1)},o=y=>{let C=r.get(y)??1;C===1?r.delete(y):r.set(y,C-1)},{extra:a,onError:i=h0}=e;Jy(i,"onError");let p=y=>(y.unsubscribe=()=>t.delete(y.id),t.set(y.id,y),C=>{y.unsubscribe(),C?.cancelActive&&Ky(y)}),f=y=>{let C=QC(t,y)??rb(y);return p(C)};ji(f,{withTypes:()=>f});let m=y=>{let C=QC(t,y);return C&&(C.unsubscribe(),y.cancelActive&&Ky(C)),!!C};ji(m,{withTypes:()=>m});let h=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(y,C,R,b){let w=new s.AbortController,P=f0(f,w.signal),F=[];try{y.pending.add(w),n(y),yield Promise.resolve(y.effect(C,ji({},R,{getOriginalState:b,condition:(k,T)=>P(k,T).then(Boolean),take:P,delay:eb(w.signal),pause:jd(w.signal),extra:a,signal:w.signal,fork:p0(w.signal,F),unsubscribe:y.unsubscribe,subscribe:()=>{t.set(y.id,y)},cancelActiveListeners:()=>{y.pending.forEach((k,T,D)=>{k!==w&&(k.abort(Wy),D.delete(k))})},cancel:()=>{w.abort(Wy),y.pending.delete(w)},throwIfCancelled:()=>{ha(w.signal)}})))}catch(k){k instanceof Bd||BC(i,k,{raisedBy:"effect"})}finally{yield Promise.all(F),w.abort(l0),o(y),y.pending.delete(w)}});return function h(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),x=m0(t,r);return{middleware:y=>C=>R=>{if(!Tu(R))return C(R);if(nb.match(R))return f(R.payload);if(g0.match(R)){x();return}if(ob.match(R))return m(R.payload);let b=y.getState(),w=()=>{if(b===UC)throw new Error(Kt(23));return b},P;try{if(P=C(R),t.size>0){let F=y.getState(),k=Array.from(t.values());for(let T of k){let D=!1;try{D=T.predicate(R,F,b)}catch(G){D=!1,BC(i,G,{raisedBy:"predicate"})}D&&h(T,R,y,w)}}}finally{b=UC}return P},startListening:f,stopListening:m,clearListeners:x}};function Kt(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();d();c();l();u();d();c();l();u();function ib(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var sb=/^(?:[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 y0(e){return typeof e=="string"&&sb.test(e)}var Xy=y0;d();c();l();u();var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function cb(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}d();c();l();u();var Zy,S0=new Uint8Array(16);function eS(){if(!Zy){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Zy=crypto.getRandomValues.bind(crypto)}return Zy(S0)}d();c();l();u();d();c();l();u();var v0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),tS={randomUUID:v0};function x0(e,t,r){e=e||{};let n=e.random??e.rng?.()??eS();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 cb(n)}function A0(e,t,r){return tS.randomUUID&&!t&&!e?tS.randomUUID():x0(e,t,r)}var rS=A0;function C0(_x13){return _C2.apply(this,arguments)}function _C2(){_C2=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _C2.apply(this,arguments)}var mb="2.1.1",nS=128,gb=192,ub=224,lb=240,b0=248;function w0(e){return(e&b0)===lb?4:(e&lb)===ub?3:(e&ub)===gb?2:1}function R0(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&nS)!=nS)break;if(r-=3,(n&gb)!=nS){t-r>=w0(n)*3&&(r=t);break}}return e.substring(0,r)}function F0(e){let{trackingId:t}=e;return{trackingId:t}}function E0(e){return(e.source||[]).concat([`relay@${mb}`])}function hb(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=F0(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:E0(t),clientId:p,userAgent:a(),referrer:db(n()),location:db(o())})}function db(e){return e!==null?R0(e,1024):null}function I0(e,t,r,n){return{...t,meta:hb(e,r,n)}}var T0="*";function P0(){let e=[];function t({type:f,callback:m}){return e.findIndex(h=>h.type===f&&h.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(h){console.error(h)}})}function a(f){if(f===T0)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function pb({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 k0(e){let t=pb(e);return{get:()=>t,update:r=>{t=pb({...t,...r})}}}var oS=O0();function O0(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function N0(){return{getItem(e){return oS.getItem(e)||localStorage.getItem(e)},removeItem(e){oS.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),oS.setItem(e,t,31556952e3)}}}var fb="visitorId";function _0(){let e=document.referrer;return e===""?null:e}function aS(){let e=N0();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=S(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});ib().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>_0(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(fb);if(t&&Xy(t))return t;let r=rS();return e.setItem(fb,r),r}}}function D0(){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 q0(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function M0(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=q0();return t&&r?{...r,runtime:"custom"}:t&&V0()&&D0()?aS():n}function V0(){try{return typeof window=="object"}catch{return!1}}function j0(e){return{get:()=>Object.freeze(M0(e))}}function yb(e){let t=k0(e),r=P0(),n=j0(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=I0(o,a,i,p);return C0({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>hb(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:mb}}d();c();l();u();function Sb(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var vo="3.49.3",vb=["@coveo/atomic","@coveo/quantic"];var Qi=Xe(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${vo}`));var Wu=Xe(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Qi(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=U0(p);return yb({mode:a?"emit":"disabled",url:o??gd(e,t),token:r,trackingId:n??null,source:i,environment:f})}),L0={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},U0=e=>{if(!e)return;let t=e();return{...(Sb()?aS():L0),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Hn(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 B(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(h){try{m(n.next(h))}catch(x){i(x)}}function f(h){try{m(n.throw(h))}catch(x){i(x)}}function m(h){h.done?a(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var Pe;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Pe||(Pe={}));function cS(){return typeof window<"u"}function AS(){return typeof navigator<"u"}function Bi(){return typeof document<"u"}function uS(){try{return typeof localStorage<"u"}catch{return!1}}function Q0(){try{return typeof sessionStorage<"u"}catch{return!1}}function Nb(){return AS()&&navigator.cookieEnabled}var B0=[Pe.click,Pe.custom,Pe.search,Pe.view],G0=(e,t)=>B0.indexOf(e)!==-1?Object.assign({language:Bi()?document.documentElement.lang:"unknown",userAgent:AS()?navigator.userAgent:"unknown"},t):t,Yu=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?xb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],xb(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function xb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function $0(){return uS()?localStorage:Nb()?new Ju:Q0()?sessionStorage:new $i}var Ju=class e{getItem(t){return Yu.get(`${e.prefix}${t}`)}removeItem(t){Yu.erase(`${e.prefix}${t}`)}setItem(t,r,n){Yu.set(`${e.prefix}${t}`,r,n)}};Ju.prefix="coveo_";var lS=class{constructor(){this.cookieStorage=new Ju}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)}},$i=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},$d="__coveo.analytics.history",H0=20,z0=1e3*60,W0=75,Wd=class{constructor(t){this.store=t||$0()}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 B(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 B(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem($d);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return B(this,void 0,void 0,function*(){try{let t=yield this.store.getItem($d);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem($d,JSON.stringify(t.slice(0,H0)))}catch{}}clear(){try{this.store.removeItem($d)}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,W0)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>z0:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var K0=(e,t)=>B(void 0,void 0,void 0,function*(){return e===Pe.view?(yield Y0(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Y0=e=>B(void 0,void 0,void 0,function*(){let t=new Wd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Hd,J0=new Uint8Array(16);function X0(){if(!Hd&&(Hd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hd(J0)}var Z0=/^(?:[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 Kd(e){return typeof e=="string"&&Z0.test(e)}var _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function _b(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}function eD(e){if(!Kd(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 tD(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var rD="6ba7b810-9dad-11d1-80b4-00c04fd430c8",nD="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function oD(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=tD(o)),typeof a=="string"&&(a=eD(a)),((f=a)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let h=0;h<16;++h)i[p+h]=m[h];return i}return _b(m)}try{n.name=e}catch{}return n.DNS=rD,n.URL=nD,n}var aD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ab={randomUUID:aD};function va(e,t,r){if(Ab.randomUUID&&!t&&!e)return Ab.randomUUID();e=e||{};let n=e.random||(e.rng||X0)();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 _b(n)}function iD(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 iS(e,t){return e<<t|e>>>32-t}function sD(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let p=0;p<i.length;++p)e.push(i.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let p=new Uint32Array(80);for(let y=0;y<16;++y)p[y]=a[i][y];for(let y=16;y<80;++y)p[y]=iS(p[y-3]^p[y-8]^p[y-14]^p[y-16],1);let f=r[0],m=r[1],h=r[2],x=r[3],A=r[4];for(let y=0;y<80;++y){let C=Math.floor(y/20),R=iS(f,5)+iD(C,m,h,x)+A+t[C]+p[y]>>>0;A=x,x=h,h=iS(m,30)>>>0,m=f,f=R}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+x>>>0,r[4]=r[4]+A>>>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 cD=oD("v5",80,sD),Cb=cD,Db="2.30.54",bb=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ku={pageview:"pageview",event:"event"},Yd=class{constructor({client:t,uuidGenerator:r=va}){this.client=t,this.uuidGenerator=r}},dS=class extends Yd{constructor({client:t,uuidGenerator:r=va}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=bb(window.location),this.lastReferrer=Bi()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction: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:Bi()?document.title:"",encoding:Bi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Ku.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ku.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ku.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ku.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 bb(window.location)}},xo=class e{constructor(t,r){if(!Kd(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Kd(a)?new e(a,Number.parseInt(o)*1e3):null}};xo.cvo_cid="cvo_cid";xo.expirationTime=120;var pS=class extends Yd{constructor({client:t,uuidGenerator:r=va}){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 B(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(xo.cvo_cid,new xo(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};pS.Id="link";var hr=Object.keys;function zd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var sS=128,qb=192,wb=224,Rb=240;function uD(e){return(e&248)===Rb?4:(e&Rb)===wb?3:(e&wb)===qb?2:1}function lD(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&sS)!=sS)break;if(r-=3,(n&qb)!=sS){t-r>=uD(n)*3&&(r=t);break}}return e.substring(0,r)}var fS={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"},dD=hr(fS).map(e=>fS[e]),pD=[...dD].join("|"),fD=new RegExp(`^(${pD}$)`),mD={svcAction:"svc_action",svcActionData:"svc_action_data"},gD=e=>hr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=fS[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),hD=e=>fD.test(e),yD=[hD],Fb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Eb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Vt={action:"pa",list:"pal",listSource:"pls"},Jd={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},SD=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],mS={id:"quoteId",affiliation:"quoteAffiliation"},gS={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},vD={add:Vt,bookmark_add:Vt,bookmark_remove:Vt,click:Vt,checkout:Vt,checkout_option:Vt,detail:Vt,impression:Vt,remove:Vt,refund:Object.assign(Object.assign({},Vt),Jd),purchase:Object.assign(Object.assign({},Vt),Jd),quickview:Vt,quote:Object.assign(Object.assign({},Vt),mS),review:Object.assign(Object.assign({},Vt),gS)},xD=hr(Fb).map(e=>Fb[e]),AD=hr(Eb).map(e=>Eb[e]),CD=hr(Vt).map(e=>Vt[e]),bD=hr(Jd).map(e=>Jd[e]),wD=hr(gS).map(e=>gS[e]),RD=hr(mS).map(e=>mS[e]),FD=[...xD,"custom"].join("|"),ED=[...AD,"custom"].join("|"),Mb="(pr[0-9]+)",Vb="(il[0-9]+pi[0-9]+)",ID=new RegExp(`^${Mb}(${FD})$`),TD=new RegExp(`^(${Vb}(${ED}))|(il[0-9]+nm)$`),PD=new RegExp(`^(${CD.join("|")})$`),kD=new RegExp(`^(${bD.join("|")})$`),OD=new RegExp(`^${Mb}custom$`),ND=new RegExp(`^${Vb}custom$`),_D=new RegExp(`^(${[...SD,...wD,...RD].join("|")})$`),DD=e=>ID.test(e),qD=e=>TD.test(e),MD=e=>PD.test(e),VD=e=>kD.test(e),jD=e=>_D.test(e),LD=[qD,DD,MD,VD,jD],UD=[OD,ND],QD={anonymizeIp:"aip"},BD={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},GD={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},$D=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],HD=Object.assign(Object.assign(Object.assign(Object.assign({},QD),BD),GD),$D.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),hS=Object.assign(Object.assign({},HD),mD),zD=e=>{let t=!!e.action&&vD[e.action]||{};return hr(e).reduce((r,n)=>{let o=t[n]||hS[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},WD=hr(hS).map(e=>hS[e]),KD=e=>WD.indexOf(e)!==-1,YD=e=>e==="custom",JD=e=>[...LD,...yD,KD,YD].some(t=>t(e)),XD=e=>hr(e).reduce((t,r)=>{let n=ZD(r);return n?Object.assign(Object.assign({},t),eq(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),ZD=e=>{let t;return[...UD].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},eq=(e,t)=>hr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),yS=class{constructor(t){this.opts=t}sendEvent(t,r){return B(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return B(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return B(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[Pe.click,Pe.custom,Pe.search,Pe.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}},SS=class{sendEvent(t,r){return B(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return B(this,void 0,void 0,function*(){return Promise.resolve()})}},Ib=g.fetch,Xd=class{constructor(t){this.opts=t}sendEvent(t,r){return B(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,h=Hn(f,["url"]),x;try{x=yield Ib(m,h)}catch(A){console.error("An error has occured when sending the event.",A);return}if(x.ok){let A=yield x.json();return A.visitorId&&o.setCurrentVisitorId(A.visitorId),A}else{try{x.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,x,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return B(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Ib(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Pe.click,Pe.custom,Pe.search,Pe.view].indexOf(t)!==-1}getVisitorIdParam(){return B(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"})}},vS=class{constructor(t,r){uS()&&Nb()?this.storage=new lS:uS()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new $i),this.client=new Xd(t),this.beaconClient=new yS(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},xS=class{constructor(t,r){this.storage=r||new $i,this.client=new Xd(t)}getClientDependingOnEventType(t){return this.client}},Zd=class{constructor(){this.storage=new $i,this.client=new SS}getClientDependingOnEventType(t){return this.client}},tq="xx",rq=e=>e?.startsWith(tq)||!1,nq=`
|
|
27
|
+
`;return new bu(r)}var bu=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Se=class{constructor(e){ye(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw Q_(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}},Qe=class{constructor(e={}){ye(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&pe(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 Tt(e){return e===void 0}function B_(e){return e===null}function pe(e){return Tt(e)||B_(e)}var de=class{constructor(e={}){ye(this,"value");this.value=new Qe(e)}validate(e){let t=this.value.validate(e);return t||(G_(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function G_(e){return Tt(e)||ud(e)}function ud(e){return typeof e=="boolean"}var re=class{constructor(e={}){ye(this,"config");ye(this,"value");this.config=e,this.value=new Qe(e)}validate(e){let t=this.value.validate(e);return t||($_(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 $_(e){return Tt(e)||YA(e)}function YA(e){return typeof e=="number"&&!Number.isNaN(e)}var H_=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,U=class{constructor(e={}){ye(this,"value");ye(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Qe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,i=this.value.validate(e);if(i)return i;if(Tt(e))return null;if(!Oi(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(H_.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 Oi(e){return Object.prototype.toString.call(e)==="[object String]"}var J=class{constructor(e={}){ye(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Tt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!XA(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&pe(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=` ${a}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function XA(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){ye(this,"config");ye(this,"value");this.config=e,this.value=new Qe(this.config)}validate(e){if(!pe(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(pe(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&&pe(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 ud(e)||Oi(e)||YA(e)||XA(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function _i(e){return Array.isArray(e)}var wu=class{constructor(e){ye(this,"config");ye(this,"value");this.config=e,this.value=new Qe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Tt(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();var go=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function ld(e){return Array.isArray(e)}function dd(e){return e.trim()===""}function JA(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function z_(e){return btoa(encodeURI(e))}function pd(e,t){let{[e]:r,...n}=t;return n}function Ni(e){return z_(JSON.stringify(e))}var W_=new Set(["1",1,"yes",!0]);function ZA(){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=>W_.has(r))}function eC(e){let t={};for(let[r,n]of e)t[r]=n;return t}function tC(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Ru(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function fd(e,t,r={}){let n;return(...o)=>{let a=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),a)return e.apply(void 0,o)}}function K_(e){if(dd(e.openingDelimiter)||dd(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(pe(e.content)||dd(e.content))return e.content;if(e.highlights.length===0)return Di(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],i=a.offset,p=i+a.length;if(p>t)break;r+=Di(e.content.slice(n,i)),r+=e.openingDelimiter,r+=Di(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Di(e.content.slice(n))),r}function Oy(e,t){return e=Di(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?ky(n,t.notMatchDelimiters):o?ky(o,t.exactMatchDelimiters):a?ky(a,t.correctionDelimiters):r)}function ky(e,t){return t?t.open+e+t.close:e}function Di(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function nC(_x2,_x3){return _nC.apply(this,arguments)}function _nC(){_nC=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _nC.apply(this,arguments)}function oC(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=X_(t,i);let p=t.length,f=0;for(;r<p;){o&&(t[r]===10&&(f=++r),o=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function aC(e,t,r){let n=rC(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=rC();else if(p>0){let f=o.decode(i.subarray(0,p)),m=p+(i[p+1]===32?2:1),g=o.decode(i.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
|
|
28
|
+
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":Y_(g,n,t);break}}}}function Y_(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function X_(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function rC(){return{data:"",event:"",id:"",retry:void 0}}var Ny="text/event-stream",J_=1e3,iC="last-event-id";function sC(){return typeof window<"u"}function md(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,v)=>{let C={...r};C.accept||(C.accept=Ny);let h;function A(){h?.abort(),document.hidden||k()}!p&&sC()&&document.addEventListener("visibilitychange",A);let b=J_,w;function R(){sC()&&document.removeEventListener("visibilitychange",A),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{R(),g()});let E=f??S,I=n??Z_;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let T=yield E(e,{...m,headers:C,signal:h?.signal});yield I(T),yield nC(T.body,oC(aC(D=>{D?C[iC]=D:delete C[iC]},D=>{b=D},o))),a?.(),R(),g()}catch(T){if(!h?.signal?.aborted)try{let D=i?.(T)??b;clearTimeout(w),w=setTimeout(k,D)}catch(D){R(),v(D)}}});return _k2.apply(this,arguments)}k()})}function Z_(e){let t=e.headers.get("content-type");if(!t?.startsWith(Ny))throw new Error(`Expected content-type to be ${Ny}, Actual: ${t}`)}d();c();l();u();var ho=class{constructor(t){ye(this,"_basePath");ye(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var eN=(e,t,r)=>new ho(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,cC=3,tN=5e3,rN="text/event-stream",My=1,Dy=class extends Error{},Fu=class extends Error{constructor(r){super(r.message);ye(this,"payload",r)}},qy=class{constructor(){ye(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},gd=class{constructor(t){ye(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,v=new qy;if(!a){this.logger.error("No stream ID found");return}let C=0,h,A=()=>{h&&!v.isActive(h)&&(w?.abort(),g(),R())},b=()=>{v.remove(h),h=tC(A,h,tN),v.add(h)},w=new s.AbortController,R=()=>md(eN(n,o,a),{method:"GET",fetch:S,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(E){return _asyncToGenerator(function*(){if(E.ok&&E.headers.get("content-type")===rN)return;throw E.status>=400&&E.status<500&&E.status!==429?new Fu({message:"Error opening stream",code:E.status}):new Dy})()},onmessage:E=>{if(w?.signal.aborted)return;let I=JSON.parse(E.data);if(I.finishReason==="ERROR"){v.remove(h),w?.abort(),f({message:I.errorMessage,code:I.statusCode});return}p(I),C=0,I.finishReason==="COMPLETED"?(v.remove(h),m()):b()},onerror:E=>{if(!w?.signal.aborted){if(v.remove(h),E instanceof Fu)throw w?.abort(),f(E),E;if(++C>cC){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:My};throw w?.abort(),f(I),new Fu(I)}this.logger.info(`Retrying...(${C}/${cC})`),g()}}});return R(),w}};d();c();l();u();var hd=e=>e;d();c();l();u();d();c();l();u();function qi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function ir(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:qi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:qi(),extendedResults:{},searchAction:void 0}}d();c();l();u();function yo(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var So=e=>{let{response:t}=e;return t.body?nN(e):oN(t)},nN=e=>iN(e)?sN(e):aN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},oN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function aN(e){return e.body.statusCode!==void 0}function iN(e){return e.body.exception!==void 0}var sN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var xC=Vr(hC(),1);d();c();l();u();var K=new Error("Failed to load reducers."),Mi=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."}},da=class extends Error{constructor(r,n){super();ye(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 yC(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function SC(e){return typeof e!="object"||!e?!1:Object.values(e).every(_N)}function _N(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function vC(e){return e===429}var jr=class e{static call(t){return _asyncToGenerator(function*(){let r=NN(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield S(a,i);if(vC(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,xC.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&vC(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),g});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Mi;case 404:throw new da(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new da(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=Ru(f);try{let g=yield o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function Pt(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function St(e,t="prod"){return`${Pt(e,t)}/rest/search/v2`}function Sd(e,t="prod"){return`${Pt(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function NN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=DN(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function DN(e,t){return t==="application/x-www-form-urlencoded"?SC(e)?yC(e):"":JSON.stringify(e)}d();c();l();u();var vo=class{constructor(){ye(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();function AC(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Qn=(e,t,r,n)=>{let o=new ho(`${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 CC=(e,t)=>{let r=new ho(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},bC=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jr.call({...Qn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:yo(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=AC(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return qN(i)?{success:i}:{error:So({response:r,body:i})}});return function bC(_x5,_x6){return _ref3.apply(this,arguments)}}();function qN(e){return typeof e=="string"}d();c();l();u();function MN(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function VN(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function vd(e,t){if(t&&e.name==="AbortError")return{error:VN(e)};if(e instanceof da)return{error:MN(e)};throw e}var xd=class{constructor(t){ye(this,"options",t);ye(this,"apiCallsQueues",{unknown:new vo,mainSearch:new vo,facetValues:new vo,foldingCollection:new vo,instantResults:new vo})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/plan"),requestParams:yo(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return vd(r);let n=yield r.json();return LN(n)?{success:n}:{error:So({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:yo(t),..._this3.options});if(r instanceof Error)return vd(r);let n=yield r.json(),o={response:r,body:n};return jN(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:So(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>jr.call({...Qn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return vd(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return wC(a)?(i.body=RC(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:So(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"POST","application/json","/facet"),requestParams:yo(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 jr.call({...Qn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(wC(n)){let o={response:r,body:n};return o.body=RC(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:So({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return bC(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Qn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return UN(n)?{success:n}:{error:So({response:r,body:n})}})()}},Ad=e=>e.success!==void 0,vt=e=>e.error!==void 0;function wC(e){return e.results!==void 0}function RC(e){let t=qi();return pe(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function jN(e){return e.completions!==void 0}function LN(e){return e.preprocessingOutput!==void 0}function UN(e){return e.fields!==void 0}d();c();l();u();var FC=e=>e,EC=e=>e,IC=e=>e;d();c();l();u();d();c();l();u();var W=new U({required:!0,emptyAllowed:!1}),st=new U({required:!1,emptyAllowed:!1}),Be=new U({required:!0,emptyAllowed:!0}),Z4=new U({required:!1,emptyAllowed:!0}),Cd=new ie({each:W,required:!0}),TC=new U({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),PC=new U({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),eK=new U({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Bn=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),gr=(e,t)=>{if("required"in t)return{payload:new Se({value:t}).validate({value:e}).value};let o=new J({options:{required:!0},values:t}).validate(e);if(o)throw new bu(o);return{payload:e}},O=(e,t)=>{try{return gr(e,t)}catch(r){return{payload:e,error:Bn(r)}}},lt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return kC(e,t,r,o,"Controller initialization error")},$e=(e,t,r,n)=>{let o=`Check the options of ${n}`;return kC(e,t,r,o,"Controller initialization error")},kC=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function kt(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 QN=typeof Symbol=="function"&&Symbol.observable||"@@observable",OC=QN,Hy=()=>Math.random().toString(36).substring(7).split("").join("."),BN={INIT:`@@redux/INIT${Hy()}`,REPLACE:`@@redux/REPLACE${Hy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Hy()}`},bd=BN;function Xr(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 zy(e,t,r){if(typeof e!="function")throw new Error(kt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(kt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(kt(1));return r(zy)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((w,R)=>{i.set(R,w)}))}function g(){if(f)throw new Error(kt(3));return o}function v(w){if(typeof w!="function")throw new Error(kt(4));if(f)throw new Error(kt(5));let R=!0;m();let E=p++;return i.set(E,w),function(){if(R){if(f)throw new Error(kt(6));R=!1,m(),i.delete(E),a=null}}}function C(w){if(!Xr(w))throw new Error(kt(7));if(typeof w.type>"u")throw new Error(kt(8));if(typeof w.type!="string")throw new Error(kt(17));if(f)throw new Error(kt(9));try{f=!0,o=n(o,w)}finally{f=!1}return(a=i).forEach(E=>{E()}),w}function h(w){if(typeof w!="function")throw new Error(kt(10));n=w,C({type:bd.REPLACE})}function A(){let w=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(kt(11));function E(){let k=R;k.next&&k.next(g())}return E(),{unsubscribe:w(E)}},[OC](){return this}}}return C({type:bd.INIT}),{dispatch:C,subscribe:v,getState:g,replaceReducer:h,[OC]:A}}function GN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:bd.INIT})>"u")throw new Error(kt(12));if(typeof r(void 0,{type:bd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(kt(13))})}function Vi(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{GN(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let v=0;v<n.length;v++){let C=n[v],h=r[C],A=p[C],b=h(A,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(kt(14))}g[C]=b,m=m||b!==A}return m=m||n.length!==Object.keys(p).length,m?g:p}}function Tu(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function _C(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(kt(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=Tu(...p)(o.dispatch),{...o,dispatch:a}}}function Pu(e){return Xr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var rS=Symbol.for("immer-nothing"),ku=Symbol.for("immer-draftable"),xt=Symbol.for("immer-state");function Ot(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,fa=sr.getPrototypeOf,_u="constructor",Vu="prototype",Yy="configurable",Ed="enumerable",Rd="writable",Nu="value",zt=e=>!!e&&!!e[xt];function Wt(e){return e?UC(e)||Lu(e)||!!e[ku]||!!e[_u]?.[ku]||Uu(e)||Qu(e):!1}var $N=sr[Vu][_u].toString(),NC=new WeakMap;function UC(e){if(!e||!ji(e))return!1;let t=fa(e);if(t===null||t===sr[Vu])return!0;let r=sr.hasOwnProperty.call(t,_u)&&t[_u];if(r===Object)return!0;if(!pa(r))return!1;let n=NC.get(r);return n===void 0&&(n=Function.toString.call(r),NC.set(r,n)),n===$N}function QC(e){return zt(e)||Ot(15,e),e[xt].base_}function ju(e,t,r=!0){ma(e)===0?(r?Reflect.ownKeys(e):sr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ma(e){let t=e[xt];return t?t.type_:Lu(e)?1:Uu(e)?2:Qu(e)?3:0}var Ou=(e,t,r=ma(e))=>r===2?e.has(t):sr[Vu].hasOwnProperty.call(e,t),Gn=(e,t,r=ma(e))=>r===2?e.get(t):e[t],Id=(e,t,r,n=ma(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function HN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Lu=Array.isArray,Uu=e=>e instanceof Map,Qu=e=>e instanceof Set,ji=e=>typeof e=="object",pa=e=>typeof e=="function",Wy=e=>typeof e=="boolean";function zN(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var WN=e=>ji(e)?e?.[xt]:null,$n=e=>e.copy_||e.base_;var nS=e=>e.modified_?e.copy_:e.base_;function Xy(e,t){if(Uu(e))return new Map(e);if(Qu(e))return new Set(e);if(Lu(e))return Array[Vu].slice.call(e);let r=UC(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[xt];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Rd]===!1&&(p[Rd]=!0,p[Yy]=!0),(p.get||p.set)&&(n[i]={[Yy]:!0,[Rd]:!0,[Ed]:p[Ed],[Nu]:e[i]})}return sr.create(fa(e),n)}else{let n=fa(e);if(n!==null&&r)return{...e};let o=sr.create(n);return sr.assign(o,e)}}function oS(e,t=!1){return Nd(e)||zt(e)||!Wt(e)||(ma(e)>1&&sr.defineProperties(e,{set:wd,add:wd,clear:wd,delete:wd}),sr.freeze(e),t&&ju(e,(r,n)=>{oS(n,!0)},!1)),e}function KN(){Ot(2)}var wd={[Nu]:KN};function Nd(e){return e===null||!ji(e)?!0:sr.isFrozen(e)}var Td="MapSet",Pd="Patches",DC="ArrayMethods",kd={};function ga(e){let t=kd[e];return t||Ot(0,e),t}var qC=e=>!!kd[e];function YN(e,t){kd[e]||(kd[e]=t)}var Du,BC=()=>Du,XN=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:qC(Td)?ga(Td):void 0,arrayMethodsPlugin_:qC(DC)?ga(DC):void 0});function MC(e,t){t&&(e.patchPlugin_=ga(Pd),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Jy(e){Zy(e),e.drafts_.forEach(JN),e.drafts_=null}function Zy(e){e===Du&&(Du=e.parent_)}var VC=e=>Du=XN(Du,e);function JN(e){let t=e[xt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jC(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[xt].modified_&&(Jy(t),Ot(4)),Wt(e)&&(e=LC(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[xt].base_,e,t)}else e=LC(t,r);return ZN(t,e,!0),Jy(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rS?e:void 0}function LC(e,t){if(Nd(t))return t;let r=t[xt];if(!r)return Od(t,e.handledSet_,e);if(!Dd(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);HC(r,e)}return r.copy_}function ZN(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&oS(t,r)}function GC(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Dd=(e,t)=>e.scope_===t,e0=[];function $C(e,t,r,n){let o=$n(e),a=e.type_;if(n!==void 0&&Gn(o,n,a)===t){Id(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;ju(o,(f,m)=>{if(zt(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??e0;for(let p of i)Id(o,p,r,a)}function t0(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Dd(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=nS(a);$C(e,a.draft_??a,i,r),HC(a,o)})}function HC(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}GC(e)}}function r0(e,t,r){let{scope_:n}=e;if(zt(r)){let o=r[xt];Dd(o,n)&&o.callbacks_.push(function(){Fd(e);let i=nS(o);$C(e,r,i,t)})}else Wt(r)&&e.callbacks_.push(function(){let a=$n(e);e.type_===3?a.has(r)&&Od(r,n.handledSet_,n):Gn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Od(Gn(e.copy_,t,e.type_),n.handledSet_,n)})}function Od(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||zt(e)||t.has(e)||!Wt(e)||Nd(e)||(t.add(e),ju(e,(n,o)=>{if(zt(o)){let a=o[xt];if(Dd(a,r)){let i=nS(a);Id(e,n,i,e.type_),GC(a)}}else Wt(o)&&Od(o,t,r)})),e}function n0(e,t){let r=Lu(e),n={type_:r?1:0,scope_:t?t.scope_:BC(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=_d;r&&(o=[n],a=qu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var _d={get(e,t){if(t===xt)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=$n(e);if(!Ou(o,t,e.type_))return o0(e,o,t);let a=o[t];if(e.finalized_||!Wt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&zN(t))return a;if(a===Ky(e.base_,t)){Fd(e);let i=e.type_===1?+t:t,p=tS(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in $n(e)},ownKeys(e){return Reflect.ownKeys($n(e))},set(e,t,r){let n=zC($n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Ky($n(e),t),a=o?.[xt];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(HN(r,o)&&(r!==void 0||Ou(e.base_,t,e.type_)))return!0;Fd(e),eS(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_.set(t,!0),r0(e,t,r)),!0},deleteProperty(e,t){return Fd(e),Ky(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),eS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$n(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Rd]:!0,[Yy]:e.type_!==1||t!=="length",[Ed]:n[Ed],[Nu]:r[t]}},defineProperty(){Ot(11)},getPrototypeOf(e){return fa(e.base_)},setPrototypeOf(){Ot(12)}},qu={};for(let e in _d){let t=_d[e];qu[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}qu.deleteProperty=function(e,t){return qu.set.call(this,e,t,void 0)};qu.set=function(e,t,r){return _d.set.call(this,e[0],t,r,e[0])};function Ky(e,t){let r=e[xt];return(r?$n(r):e)[t]}function o0(e,t,r){let n=zC(t,r);return n?Nu in n?n[Nu]:n.get?.call(e.draft_):void 0}function zC(e,t){if(!(t in e))return;let r=fa(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=fa(r)}}function eS(e){e.modified_||(e.modified_=!0,e.parent_&&eS(e.parent_))}function Fd(e){e.copy_||(e.assigned_=new Map,e.copy_=Xy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var a0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(pa(t)&&!pa(r)){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}pa(r)||Ot(6),n!==void 0&&!pa(n)&&Ot(7);let o;if(Wt(t)){let a=VC(this),i=tS(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?Jy(a):Zy(a)}return MC(a,n),jC(o,a)}else if(!t||!ji(t)){if(o=r(t),o===void 0&&(o=t),o===rS&&(o=void 0),this.autoFreeze_&&oS(o,!0),n){let a=[],i=[];ga(Pd).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else Ot(1,t)},this.produceWithPatches=(t,r)=>{if(pa(t))return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},Wy(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Wy(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Wy(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Wt(e)||Ot(8),zt(e)&&(e=qd(e));let t=VC(this),r=tS(t,e,void 0);return r[xt].isManual_=!0,Zy(t),r}finishDraft(e,t){let r=e&&e[xt];(!r||!r.isManual_)&&Ot(9);let{scope_:n}=r;return MC(n,t),jC(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}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=ga(Pd).applyPatches_;return zt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function tS(e,t,r,n){let[o,a]=Uu(t)?ga(Td).proxyMap_(t,r):Qu(t)?ga(Td).proxySet_(t,r):n0(t,r);return(r?.scope_??BC()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?t0(r,a,n):a.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:m}=f;a.modified_&&m&&m.generatePatches_(a,[],f)}),o}function qd(e){return zt(e)||Ot(10,e),WC(e)}function WC(e){if(!Wt(e)||Nd(e))return e;let t=e[xt],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Xy(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Xy(e,!0);return ju(r,(o,a)=>{Id(r,o,WC(a))},n),t&&(t.finalized_=!1),r}function KC(){function t(A,b=[]){if(A.key_!==void 0){let w=A.parent_.copy_??A.parent_.base_,R=WN(Gn(w,A.key_)),E=Gn(w,A.key_);if(E===void 0||E!==A.draft_&&E!==A.base_&&E!==A.copy_||R!=null&&R.base_!==A.base_)return null;let I=A.parent_.type_===3,k;if(I){let T=A.parent_;k=Array.from(T.drafts_.keys()).indexOf(A.key_)}else k=A.key_;if(!(I&&w.size>k||Ou(w,k)))return null;b.push(k)}if(A.parent_)return t(A.parent_,b);b.reverse();try{r(A.copy_,b)}catch{return null}return b}function r(A,b){let w=A;for(let R=0;R<b.length-1;R++){let E=b[R];if(w=Gn(w,E),!ji(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(A,b,w){if(A.scope_.processedForPatches_.has(A))return;A.scope_.processedForPatches_.add(A);let{patches_:R,inversePatches_:E}=w;switch(A.type_){case 0:case 2:return f(A,b,R,E);case 1:return p(A,b,R,E);case 3:return m(A,b,R,E)}}function p(A,b,w,R){let{base_:E,assigned_:I}=A,k=A.copy_;k.length<E.length&&([E,k]=[k,E],[w,R]=[R,w]);let T=A.allIndicesReassigned_===!0;for(let D=0;D<E.length;D++){let B=k[D],L=E[D];if((T||I?.get(D.toString()))&&B!==L){let Q=B?.[xt];if(Q&&Q.modified_)continue;let j=b.concat([D]);w.push({op:n,path:j,value:h(B)}),R.push({op:n,path:j,value:h(L)})}}for(let D=E.length;D<k.length;D++){let B=b.concat([D]);w.push({op:o,path:B,value:h(k[D])})}for(let D=k.length-1;E.length<=D;--D){let B=b.concat([D]);R.push({op:a,path:B})}}function f(A,b,w,R){let{base_:E,copy_:I,type_:k}=A;ju(A.assigned_,(T,D)=>{let B=Gn(E,T,k),L=Gn(I,T,k),V=D?Ou(E,T)?n:o:a;if(B===L&&V===n)return;let Q=b.concat(T);w.push(V===a?{op:V,path:Q}:{op:V,path:Q,value:h(L)}),R.push(V===o?{op:a,path:Q}:V===a?{op:o,path:Q,value:h(B)}:{op:n,path:Q,value:h(B)})})}function m(A,b,w,R){let{base_:E,copy_:I}=A,k=0;E.forEach(T=>{if(!I.has(T)){let D=b.concat([k]);w.push({op:a,path:D,value:T}),R.unshift({op:o,path:D,value:T})}k++}),k=0,I.forEach(T=>{if(!E.has(T)){let D=b.concat([k]);w.push({op:o,path:D,value:T}),R.unshift({op:a,path:D,value:T})}k++})}function g(A,b,w){let{patches_:R,inversePatches_:E}=w;R.push({op:n,path:[],value:b===rS?void 0:b}),E.push({op:n,path:[],value:A})}function v(A,b){return b.forEach(w=>{let{path:R,op:E}=w,I=A;for(let B=0;B<R.length-1;B++){let L=ma(I),V=R[B];typeof V!="string"&&typeof V!="number"&&(V=""+V),(L===0||L===1)&&(V==="__proto__"||V===_u)&&Ot(19),pa(I)&&V===Vu&&Ot(19),I=Gn(I,V),ji(I)||Ot(18,R.join("/"))}let k=ma(I),T=C(w.value),D=R[R.length-1];switch(E){case n:switch(k){case 2:return I.set(D,T);case 3:Ot(16);default:return I[D]=T}case o:switch(k){case 1:return D==="-"?I.push(T):I.splice(D,0,T);case 2:return I.set(D,T);case 3:return I.add(T);default:return I[D]=T}case a:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(w.value);default:return delete I[D]}default:Ot(17,E)}}),A}function C(A){if(!Wt(A))return A;if(Lu(A))return A.map(C);if(Uu(A))return new Map(Array.from(A.entries()).map(([w,R])=>[w,C(R)]));if(Qu(A))return new Set(Array.from(A).map(C));let b=Object.create(fa(A));for(let w in A)b[w]=C(A[w]);return Ou(A,ku)&&(b[ku]=A[ku]),b}function h(A){return zt(A)?C(A):A}YN(Pd,{applyPatches_:v,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var Mu=new a0,ha=Mu.produce,aS=Mu.produceWithPatches.bind(Mu);var iS=Mu.applyPatches.bind(Mu);d();c();l();u();function i0(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function s0(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function c0(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 YC=e=>Array.isArray(e)?e:[e];function u0(e){let t=Array.isArray(e[0])?e[0]:e;return c0(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function l0(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var yK=Object.getPrototypeOf({});var d0=class{constructor(e){this.value=e}deref(){return this.value}},p0=typeof WeakRef<"u"?WeakRef:d0,f0=0,XC=1;function Md(){return{s:f0,v:void 0,o:null,p:null}}function Bu(e,t={}){let r=Md(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let v=0,C=f;v<C;v++){let h=arguments[v];if(typeof h=="function"||typeof h=="object"&&h!==null){let A=p.o;A===null&&(p.o=A=new WeakMap);let b=A.get(h);b===void 0?(p=Md(),A.set(h,p)):p=b}else{let A=p.p;A===null&&(p.p=A=new Map);let b=A.get(h);b===void 0?(p=Md(),A.set(h,p)):p=b}}let m=p,g;if(p.s===XC)g=p.v;else if(g=e.apply(null,arguments),a++,n){let v=o?.deref?.()??o;v!=null&&n(v,g)&&(g=v,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new p0(g):g}return m.s=XC,m.v=g,g}return i.clearCache=()=>{r=Md(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function m0(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),i0(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:v,memoizeOptions:C=[],argsMemoize:h=Bu,argsMemoizeOptions:A=[],devModeChecks:b={}}=g,w=YC(C),R=YC(A),E=u0(o),I=v(function(){return a++,m.apply(null,arguments)},...w),k=!0,T=h(function(){i++;let B=l0(E,arguments);return p=I.apply(null,B),p},...R);return Object.assign(T,{resultFunc:m,memoizedResultFunc:I,dependencies:E,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var Je=m0(Bu),g0=Object.assign((e,t=Je)=>{s0(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((i,p,f)=>(i[r[f]]=p,i),{}))},{withTypes:()=>g0});d();c();l();u();function JC(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var ZC=JC(),eb=JC;var h0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Tu:Tu.apply(null,arguments)},DK=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},y0=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Kt(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=>Pu(n)&&n.type===e,r}var cb=class Gu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Gu.prototype)}static get[Symbol.species](){return Gu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Gu(...t[0].concat(this)):new Gu(...t.concat(this))}};function tb(e){return Wt(e)?ha(e,()=>{}):e}function Vd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function S0(e){return typeof e=="boolean"}var v0=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new cb;return r&&(S0(r)?i.push(ZC):i.push(eb(r.extraArgument))),i},$u="RTK_autoBatch",Qi=()=>e=>({payload:e,meta:{[$u]:!0}}),rb=e=>t=>{setTimeout(t,e)},x0=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:rb(10):e.type==="callback"?e.queueNotification:rb(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),C=n.subscribe(v);return p.add(g),()=>{C(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[$u],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},A0=e=>function(r){let{autoBatch:n=!0}=r??{},o=new cb(e);return n&&o.push(x0(typeof n=="object"?n:void 0)),o};function ub(e){let t=v0(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Xr(r))f=Vi(r);else throw new Error(Kt(1));let m;typeof n=="function"?m=n(t):m=t();let g=Tu;o&&(g=h0({trace:!1,...(typeof o=="object"&&o)}));let v=_C(...m),C=A0(v),h=typeof p=="function"?p(C):C(),A=g(...h);return zy(f,i,A)}function lb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Kt(28));if(p in t)throw new Error(Kt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function C0(e){return typeof e=="function"}function ae(e,t){let[r,n,o]=lb(t),a;if(C0(e))a=()=>tb(e());else{let p=tb(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,v)=>{if(v)if(zt(g)){let h=v(g,f);return h===void 0?g:h}else{if(Wt(g))return ha(g,C=>v(C,f));{let C=v(g,f);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return g},p)}return i.getInitialState=a,i}var db=(e,t)=>y0(e)?e.match(t):e(t);function Jr(...e){return t=>e.some(r=>db(r,t))}function Ui(...e){return t=>e.every(r=>db(r,t))}function Qd(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 Hu(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Bd(...e){return e.length===0?t=>Qd(t,["pending"]):Hu(e)?Jr(...e.map(t=>t.pending)):Bd()(e[0])}function Sa(...e){return e.length===0?t=>Qd(t,["rejected"]):Hu(e)?Jr(...e.map(t=>t.rejected)):Sa()(e[0])}function zu(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Ui(Sa(...e),t):Hu(e)?Ui(Sa(...e),t):zu()(e[0])}function Hn(...e){return e.length===0?t=>Qd(t,["fulfilled"]):Hu(e)?Jr(...e.map(t=>t.fulfilled)):Hn()(e[0])}function Gd(...e){return e.length===0?t=>Qd(t,["pending","fulfilled","rejected"]):Hu(e)?Jr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Gd()(e[0])}var b0="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Wu=(e=21)=>{let t="",r=e;for(;r--;)t+=b0[Math.random()*64|0];return t},w0=["name","message","stack","code"],sS=class{constructor(e,t){ye(this,"_type");this.payload=e,this.meta=t}},nb=class{constructor(e,t){ye(this,"_type");this.payload=e,this.meta=t}},R0=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of w0)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ob="External signal was aborted",Ae=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(f,m,g,v)=>({payload:f,meta:{...(v||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=P(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=P(t+"/rejected",(f,m,g,v,C)=>({payload:v,error:(n&&n.serializeError||R0)(f||"Rejected"),meta:{...(C||{}),arg:g,requestId:m,rejectedWithValue:!!v,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(g,v,C)=>{let h=n?.idGenerator?n.idGenerator(f):Wu(),A=new s.AbortController,b,w;function R(I){w=I,A.abort()}m&&(m.aborted?R(ob):m.addEventListener("abort",()=>R(ob),{once:!0}));let E=_asyncToGenerator(function*(){let I;try{let T=n?.condition?.(f,{getState:v,extra:C});if(E0(T)&&(T=yield T),T===!1||A.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((B,L)=>{b=()=>{L({name:"AbortError",message:w||"Aborted"})},A.signal.addEventListener("abort",b,{once:!0})});g(a(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:v,extra:C}))),I=yield Promise.race([D,Promise.resolve(r(f,{dispatch:g,getState:v,extra:C,requestId:h,signal:A.signal,abort:R,rejectWithValue:(B,L)=>new sS(B,L),fulfillWithValue:(B,L)=>new nb(B,L)})).then(B=>{if(B instanceof sS)throw B;return B instanceof nb?o(B.payload,h,f,B.meta):o(B,h,f)})])}catch(T){I=T instanceof sS?i(null,h,f,T.payload,T.meta):i(T,h,f)}finally{b&&A.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&i.match(I)&&I.meta.condition||g(I),I})();return Object.assign(E,{abort:R,requestId:h,arg:f,unwrap(){return E.then(F0)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Jr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function F0(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function E0(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pb=Symbol.for("rtk-slice-createasyncthunk"),MK={[pb]:Ae};function I0(e,t){return`${e}/${t}`}function T0({creators:e}={}){let t=e?.asyncThunk?.[pb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Kt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(k0()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(I,k){let T=typeof I=="string"?I:I.type;if(!T)throw new Error(Kt(12));if(T in f.sliceCaseReducersByType)throw new Error(Kt(13));return f.sliceCaseReducersByType[T]=k,m},addMatcher(I,k){return f.sliceMatchers.push({matcher:I,reducer:k}),m},exposeAction(I,k){return f.actionCreators[I]=k,m},exposeCaseReducer(I,k){return f.sliceCaseReducersByName[I]=k,m}};p.forEach(I=>{let k=i[I],T={reducerName:I,type:I0(o,I),createNotation:typeof n.reducers=="function"};_0(k)?D0(T,k,m,t):O0(T,k,m)});function g(){let[I={},k=[],T=void 0]=typeof n.extraReducers=="function"?lb(n.extraReducers):[n.extraReducers],D={...I,...f.sliceCaseReducersByType};return ae(n.initialState,B=>{for(let L in D)B.addCase(L,D[L]);for(let L of f.sliceMatchers)B.addMatcher(L.matcher,L.reducer);for(let L of k)B.addMatcher(L.matcher,L.reducer);T&&B.addDefaultCase(T)})}let v=I=>I,C=new Map,h=new WeakMap,A;function b(I,k){return A||(A=g()),A(I,k)}function w(){return A||(A=g()),A.getInitialState()}function R(I,k=!1){function T(B){let L=B[I];return typeof L>"u"&&k&&(L=Vd(h,T,w)),L}function D(B=v){let L=Vd(C,k,()=>new WeakMap);return Vd(L,B,()=>{let V={};for(let[Q,j]of Object.entries(n.selectors??{}))V[Q]=P0(j,B,()=>Vd(h,B,w),k);return V})}return{reducerPath:I,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}let E={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(a),injectInto(I,{reducerPath:k,...T}={}){let D=k??a;return I.inject({reducerPath:D,reducer:b},T),{...E,...R(D,!0)}}};return E}}function P0(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var va=T0();function k0(){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 O0({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!N0(n))throw new Error(Kt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?P(e,i):P(e))}function _0(e){return e._reducerDefinitionType==="asyncThunk"}function N0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function D0({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Kt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,v=o(e,a,g);n.exposeAction(t,v),i&&n.addCase(v.fulfilled,i),p&&n.addCase(v.pending,p),f&&n.addCase(v.rejected,f),m&&n.addMatcher(v.settled,m),n.exposeCaseReducer(t,{fulfilled:i||jd,pending:p||jd,rejected:f||jd,settled:m||jd})}function jd(){}var q0="task",fb="listener",mb="completed",lS="cancelled",M0=`task-${lS}`,V0=`task-${mb}`,cS=`${fb}-${lS}`,j0=`${fb}-${mb}`,$d=class{constructor(e){ye(this,"name","TaskAbortError");ye(this,"message");this.code=e,this.message=`${q0} ${lS} (reason: ${e})`}},dS=(e,t)=>{if(typeof e!="function")throw new TypeError(Kt(32))},Ld=()=>{},gb=(e,t=Ld)=>(e.catch(t),e),hb=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ya=e=>{if(e.aborted)throw new $d(e.reason)};function yb(e,t){let r=Ld;return new Promise((n,o)=>{let a=()=>o(new $d(e.reason));if(e.aborted){a();return}r=hb(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ld})}var L0=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof $d?"cancelled":"rejected",error:r}}finally{t?.()}});return function L0(_x7,_x8){return _ref5.apply(this,arguments)}}(),Ud=e=>t=>gb(yb(e,t).then(r=>(ya(e),r))),Sb=e=>{let t=Ud(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Li}=Object,ab={},Hd="listenerMiddleware",U0=(e,t)=>{let r=n=>hb(e,()=>n.abort(e.reason));return(n,o)=>{dS(n,"taskExecutor");let a=new s.AbortController;r(a);let i=L0(/*#__PURE__*/_asyncToGenerator(function*(){ya(e),ya(a.signal);let p=yield n({pause:Ud(a.signal),delay:Sb(a.signal),signal:a.signal});return ya(a.signal),p}),()=>a.abort(V0));return o?.autoJoin&&t.push(i.catch(Ld)),{result:Ud(e)(i),cancel(){a.abort(M0)}}}},Q0=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){ya(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(v,C)=>{C.unsubscribe(),f([v,C.getState(),C.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield yb(t,Promise.race(p));return ya(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>gb(r(n,o))},vb=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Kt(21));return dS(a,"options.listener"),{predicate:o,type:t,effect:a}},xb=Li(e=>{let{type:t,predicate:r,effect:n}=vb(e);return{id:Wu(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Kt(22))}}},{withTypes:()=>xb}),ib=(e,t)=>{let{type:r,effect:n,predicate:o}=vb(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},uS=e=>{e.pending.forEach(t=>{t.abort(cS)})},B0=(e,t)=>()=>{for(let r of t.keys())uS(r);e.clear()},sb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Ab=Li(P(`${Hd}/add`),{withTypes:()=>Ab}),G0=P(`${Hd}/removeAll`),Cb=Li(P(`${Hd}/remove`),{withTypes:()=>Cb}),$0=(...e)=>{console.error(`${Hd}/error`,...e)},bb=(e={})=>{let t=new Map,r=new Map,n=h=>{let A=r.get(h)??0;r.set(h,A+1)},o=h=>{let A=r.get(h)??1;A===1?r.delete(h):r.set(h,A-1)},{extra:a,onError:i=$0}=e;dS(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),A=>{h.unsubscribe(),A?.cancelActive&&uS(h)}),f=h=>{let A=ib(t,h)??xb(h);return p(A)};Li(f,{withTypes:()=>f});let m=h=>{let A=ib(t,h);return A&&(A.unsubscribe(),h.cancelActive&&uS(A)),!!A};Li(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,A,b,w){let R=new s.AbortController,E=Q0(f,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(A,Li({},b,{getOriginalState:w,condition:(k,T)=>E(k,T).then(Boolean),take:E,delay:Sb(R.signal),pause:Ud(R.signal),extra:a,signal:R.signal,fork:U0(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,T,D)=>{k!==R&&(k.abort(cS),D.delete(k))})},cancel:()=>{R.abort(cS),h.pending.delete(R)},throwIfCancelled:()=>{ya(R.signal)}})))}catch(k){k instanceof $d||sb(i,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(j0),o(h),h.pending.delete(R)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),v=B0(t,r);return{middleware:h=>A=>b=>{if(!Pu(b))return A(b);if(Ab.match(b))return f(b.payload);if(G0.match(b)){v();return}if(Cb.match(b))return m(b.payload);let w=h.getState(),R=()=>{if(w===ab)throw new Error(Kt(23));return w},E;try{if(E=A(b),t.size>0){let I=h.getState(),k=Array.from(t.values());for(let T of k){let D=!1;try{D=T.predicate(b,I,w)}catch(B){D=!1,sb(i,B,{raisedBy:"predicate"})}D&&g(T,b,h,R)}}}finally{w=ab}return E},startListening:f,stopListening:m,clearListeners:v}};function Kt(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();d();c();l();u();d();c();l();u();function wb(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var Rb=/^(?:[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 H0(e){return typeof e=="string"&&Rb.test(e)}var pS=H0;d();c();l();u();var _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function Fb(e,t=0){return(_t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]).toLowerCase()}d();c();l();u();var fS,z0=new Uint8Array(16);function mS(){if(!fS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");fS=crypto.getRandomValues.bind(crypto)}return fS(z0)}d();c();l();u();d();c();l();u();var W0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gS={randomUUID:W0};function K0(e,t,r){e=e||{};let n=e.random??e.rng?.()??mS();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 Fb(n)}function Y0(e,t,r){return gS.randomUUID&&!t&&!e?gS.randomUUID():K0(e,t,r)}var hS=Y0;function X0(_x13){return _X.apply(this,arguments)}function _X(){_X=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _X.apply(this,arguments)}var Ob="2.1.1",yS=128,_b=192,Eb=224,Ib=240,J0=248;function Z0(e){return(e&J0)===Ib?4:(e&Ib)===Eb?3:(e&Eb)===_b?2:1}function eD(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&yS)!=yS)break;if(r-=3,(n&_b)!=yS){t-r>=Z0(n)*3&&(r=t);break}}return e.substring(0,r)}function tD(e){let{trackingId:t}=e;return{trackingId:t}}function rD(e){return(e.source||[]).concat([`relay@${Ob}`])}function Nb(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=tD(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:rD(t),clientId:p,userAgent:a(),referrer:Tb(n()),location:Tb(o())})}function Tb(e){return e!==null?eD(e,1024):null}function nD(e,t,r,n){return{...t,meta:Nb(e,r,n)}}var oD="*";function aD(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function a(f){if(f===oD)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function Pb({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 iD(e){let t=Pb(e);return{get:()=>t,update:r=>{t=Pb({...t,...r})}}}var SS=sD();function sD(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function cD(){return{getItem(e){return SS.getItem(e)||localStorage.getItem(e)},removeItem(e){SS.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),SS.setItem(e,t,31556952e3)}}}var kb="visitorId";function uD(){let e=document.referrer;return e===""?null:e}function vS(){let e=cD();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=S(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});wb().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>uD(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(kb);if(t&&pS(t))return t;let r=hS();return e.setItem(kb,r),r}}}function lD(){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 dD(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function pD(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=dD();return t&&r?{...r,runtime:"custom"}:t&&fD()&&lD()?vS():n}function fD(){try{return typeof window=="object"}catch{return!1}}function mD(e){return{get:()=>Object.freeze(pD(e))}}function Db(e){let t=iD(e),r=aD(),n=mD(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=nD(o,a,i,p);return X0({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>Nb(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:Ob}}d();c();l();u();function qb(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var xo="3.49.4",Mb=["@coveo/atomic","@coveo/quantic"];var Bi=Je(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${xo}`));var Ku=Je(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Bi(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=hD(p);return Db({mode:a?"emit":"disabled",url:o??Sd(e,t),token:r,trackingId:n??null,source:i,environment:f})}),gD={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},hD=e=>{if(!e)return;let t=e();return{...(qb()?vS():gD),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function zn(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 G(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(v){i(v)}}function f(g){try{m(n.throw(g))}catch(v){i(v)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var _e;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(_e||(_e={}));function CS(){return typeof window<"u"}function DS(){return typeof navigator<"u"}function Gi(){return typeof document<"u"}function bS(){try{return typeof localStorage<"u"}catch{return!1}}function yD(){try{return typeof sessionStorage<"u"}catch{return!1}}function Xb(){return DS()&&navigator.cookieEnabled}var SD=[_e.click,_e.custom,_e.search,_e.view],vD=(e,t)=>SD.indexOf(e)!==-1?Object.assign({language:Gi()?document.documentElement.lang:"unknown",userAgent:DS()?navigator.userAgent:"unknown"},t):t,Xu=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Vb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Vb(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Vb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function xD(){return bS()?localStorage:Xb()?new Ju:yD()?sessionStorage:new Hi}var Ju=class e{getItem(t){return Xu.get(`${e.prefix}${t}`)}removeItem(t){Xu.erase(`${e.prefix}${t}`)}setItem(t,r,n){Xu.set(`${e.prefix}${t}`,r,n)}};Ju.prefix="coveo_";var wS=class{constructor(){this.cookieStorage=new Ju}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)}},Hi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},zd="__coveo.analytics.history",AD=20,CD=1e3*60,bD=75,Yd=class{constructor(t){this.store=t||xD()}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 G(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 G(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(zd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return G(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(zd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(zd,JSON.stringify(t.slice(0,AD)))}catch{}}clear(){try{this.store.removeItem(zd)}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,bD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>CD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var wD=(e,t)=>G(void 0,void 0,void 0,function*(){return e===_e.view?(yield RD(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),RD=e=>G(void 0,void 0,void 0,function*(){let t=new Yd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Wd,FD=new Uint8Array(16);function ED(){if(!Wd&&(Wd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Wd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wd(FD)}var ID=/^(?:[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 Xd(e){return typeof e=="string"&&ID.test(e)}var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function Jb(e,t=0){return Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]}function TD(e){if(!Xd(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 PD(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var kD="6ba7b810-9dad-11d1-80b4-00c04fd430c8",OD="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function _D(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=PD(o)),typeof a=="string"&&(a=TD(a)),((f=a)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let g=0;g<16;++g)i[p+g]=m[g];return i}return Jb(m)}try{n.name=e}catch{}return n.DNS=kD,n.URL=OD,n}var ND=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),jb={randomUUID:ND};function xa(e,t,r){if(jb.randomUUID&&!t&&!e)return jb.randomUUID();e=e||{};let n=e.random||(e.rng||ED)();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 Jb(n)}function DD(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 xS(e,t){return e<<t|e>>>32-t}function qD(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let p=0;p<i.length;++p)e.push(i.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=a[i][h];for(let h=16;h<80;++h)p[h]=xS(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],v=r[3],C=r[4];for(let h=0;h<80;++h){let A=Math.floor(h/20),b=xS(f,5)+DD(A,m,g,v)+C+t[A]+p[h]>>>0;C=v,v=g,g=xS(m,30)>>>0,m=f,f=b}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+C>>>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 MD=_D("v5",80,qD),Lb=MD,Zb="2.30.54",Ub=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Yu={pageview:"pageview",event:"event"},Jd=class{constructor({client:t,uuidGenerator:r=xa}){this.client=t,this.uuidGenerator=r}},RS=class extends Jd{constructor({client:t,uuidGenerator:r=xa}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Ub(window.location),this.lastReferrer=Gi()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction: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:Gi()?document.title:"",encoding:Gi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Yu.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Yu.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Yu.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Yu.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 Ub(window.location)}},Ao=class e{constructor(t,r){if(!Xd(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Xd(a)?new e(a,Number.parseInt(o)*1e3):null}};Ao.cvo_cid="cvo_cid";Ao.expirationTime=120;var FS=class extends Jd{constructor({client:t,uuidGenerator:r=xa}){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 G(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(Ao.cvo_cid,new Ao(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};FS.Id="link";var yr=Object.keys;function Kd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var AS=128,ew=192,Qb=224,Bb=240;function VD(e){return(e&248)===Bb?4:(e&Bb)===Qb?3:(e&Qb)===ew?2:1}function jD(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&AS)!=AS)break;if(r-=3,(n&ew)!=AS){t-r>=VD(n)*3&&(r=t);break}}return e.substring(0,r)}var ES={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"},LD=yr(ES).map(e=>ES[e]),UD=[...LD].join("|"),QD=new RegExp(`^(${UD}$)`),BD={svcAction:"svc_action",svcActionData:"svc_action_data"},GD=e=>yr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=ES[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),$D=e=>QD.test(e),HD=[$D],Gb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},$b={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Vt={action:"pa",list:"pal",listSource:"pls"},Zd={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},zD=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],IS={id:"quoteId",affiliation:"quoteAffiliation"},TS={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},WD={add:Vt,bookmark_add:Vt,bookmark_remove:Vt,click:Vt,checkout:Vt,checkout_option:Vt,detail:Vt,impression:Vt,remove:Vt,refund:Object.assign(Object.assign({},Vt),Zd),purchase:Object.assign(Object.assign({},Vt),Zd),quickview:Vt,quote:Object.assign(Object.assign({},Vt),IS),review:Object.assign(Object.assign({},Vt),TS)},KD=yr(Gb).map(e=>Gb[e]),YD=yr($b).map(e=>$b[e]),XD=yr(Vt).map(e=>Vt[e]),JD=yr(Zd).map(e=>Zd[e]),ZD=yr(TS).map(e=>TS[e]),eq=yr(IS).map(e=>IS[e]),tq=[...KD,"custom"].join("|"),rq=[...YD,"custom"].join("|"),tw="(pr[0-9]+)",rw="(il[0-9]+pi[0-9]+)",nq=new RegExp(`^${tw}(${tq})$`),oq=new RegExp(`^(${rw}(${rq}))|(il[0-9]+nm)$`),aq=new RegExp(`^(${XD.join("|")})$`),iq=new RegExp(`^(${JD.join("|")})$`),sq=new RegExp(`^${tw}custom$`),cq=new RegExp(`^${rw}custom$`),uq=new RegExp(`^(${[...zD,...ZD,...eq].join("|")})$`),lq=e=>nq.test(e),dq=e=>oq.test(e),pq=e=>aq.test(e),fq=e=>iq.test(e),mq=e=>uq.test(e),gq=[dq,lq,pq,fq,mq],hq=[sq,cq],yq={anonymizeIp:"aip"},Sq={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},vq={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},xq=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Aq=Object.assign(Object.assign(Object.assign(Object.assign({},yq),Sq),vq),xq.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),PS=Object.assign(Object.assign({},Aq),BD),Cq=e=>{let t=!!e.action&&WD[e.action]||{};return yr(e).reduce((r,n)=>{let o=t[n]||PS[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},bq=yr(PS).map(e=>PS[e]),wq=e=>bq.indexOf(e)!==-1,Rq=e=>e==="custom",Fq=e=>[...gq,...HD,wq,Rq].some(t=>t(e)),Eq=e=>yr(e).reduce((t,r)=>{let n=Iq(r);return n?Object.assign(Object.assign({},t),Tq(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Iq=e=>{let t;return[...hq].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Tq=(e,t)=>yr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),kS=class{constructor(t){this.opts=t}sendEvent(t,r){return G(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return G(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return G(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[_e.click,_e.custom,_e.search,_e.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}},OS=class{sendEvent(t,r){return G(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return G(this,void 0,void 0,function*(){return Promise.resolve()})}},Hb=y.fetch,ep=class{constructor(t){this.opts=t}sendEvent(t,r){return G(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=zn(f,["url"]),v;try{v=yield Hb(m,g)}catch(C){console.error("An error has occured when sending the event.",C);return}if(v.ok){let C=yield v.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return G(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Hb(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[_e.click,_e.custom,_e.search,_e.view].indexOf(t)!==-1}getVisitorIdParam(){return G(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"})}},_S=class{constructor(t,r){bS()&&Xb()?this.storage=new wS:bS()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Hi),this.client=new ep(t),this.beaconClient=new kS(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},NS=class{constructor(t,r){this.storage=r||new Hi,this.client=new ep(t)}getClientDependingOnEventType(t){return this.client}},tp=class{constructor(){this.storage=new Hi,this.client=new OS}getClientDependingOnEventType(t){return this.client}},Pq="xx",kq=e=>e?.startsWith(Pq)||!1,Oq=`
|
|
28
29
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
29
30
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
30
31
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
31
|
-
`;function oq(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var aq=["1",1,"yes",!0];function ep(){let e=[];return cS()&&e.push(window.doNotTrack),AS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>aq.indexOf(t)!==-1)}var jb="v15",Lb={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 iq(e=Lb.default,t=jb,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 sq="38824e1f-37f5-42d3-8372-a4b8fa9df946",Xr=class{get defaultOptions(){return{endpoint:Lb.default,isCustomEndpoint:!1,token:"",version:jb,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Db}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=[K0,G0].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};ep()?this.runtime=new Zd:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Pe.view,{newEventType:Pe.view,addClientIdParameter:!0}),this.addEventTypeMapping(Pe.click,{newEventType:Pe.click,addClientIdParameter:!0}),this.addEventTypeMapping(Pe.custom,{newEventType:Pe.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Pe.search,{newEventType:Pe.search,addClientIdParameter:!0})}initRuntime(t){return cS()&&Bi()?new vS(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(oq()&&console.warn(nq),new xS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return B(this,void 0,void 0,function*(){try{return cS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||va()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),va()}})}getCurrentVisitorId(){return B(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return B(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return B(this,void 0,void 0,function*(){if(Kd(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Cb(t,Cb(r,sq)))}})}getParameters(t,...r){return B(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return B(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(va()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(ep())return null;try{let r=new URL(t).searchParams.get(xo.cvo_cid);if(r==null)return null;let n=xo.fromString(r);return!n||!Bi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return B(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[y=>n.length>0?this.parseVariableArgumentsPayload(n,y):y[0],y=>B(this,void 0,void 0,function*(){return Object.assign(Object.assign({},y),{visitorId:o?yield this.getCurrentVisitorId():""})}),y=>B(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},y),{clientId:yield this.getCurrentVisitorId()}):y}),y=>a?this.ensureAnonymousUserWhenUsingApiKey(y):y,y=>this.beforeSendHooks.reduce((C,R)=>B(this,void 0,void 0,function*(){let b=yield C;return yield R(t,b)}),y)].reduce((y,C)=>B(this,void 0,void 0,function*(){let R=yield y;return yield C(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return B(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[x=>this.setTrackingIdIfTrackingIdNotPresent(x),x=>this.removeEmptyPayloadValues(x,t),x=>this.validateParams(x,t),x=>n?zD(x):x,x=>n?this.removeUnknownParameters(x):x,x=>n?this.processCustomParameters(x):this.mapCustomParametersToCustomData(x)].reduce((x,A)=>B(this,void 0,void 0,function*(){let y=yield x;return yield A(y)}),Promise.resolve(r))})}makeEvent(t,...r){return B(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>B(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return B(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return B(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 Wd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return B(this,void 0,void 0,function*(){return this.makeEvent(Pe.search,t)})}sendSearchEvent(t){return B(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Hn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return B(this,void 0,void 0,function*(){return this.makeEvent(Pe.click,t)})}sendClickEvent(t){return B(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Hn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return B(this,void 0,void 0,function*(){return this.makeEvent(Pe.custom,t)})}sendCustomEvent(t){return B(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Hn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return B(this,void 0,void 0,function*(){return this.makeEvent(Pe.view,t)})}sendViewEvent(t){return B(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return B(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return B(this,void 0,void 0,function*(){return yield(yield S(`${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,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[Pe.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,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(JD(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=Hn(t,["custom"]),o={};r&&zd(r)&&(o=this.lowercaseKeys(r));let a=XD(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Hn(t,["custom"]);if(r&&zd(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=Hn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Pe.view||r==Pe.click||r==Pe.search||r==Pe.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Pe.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=Hn(t,["userId"]);return rq(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Hn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&zd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&zd(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"?lD(t,r):t}get baseUrl(){return iq(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},zn;(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"})(zn||(zn={}));var $;(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",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})($||($={}));var Tb={[$.triggerNotify]:"queryPipelineTriggers",[$.triggerExecute]:"queryPipelineTriggers",[$.triggerQuery]:"queryPipelineTriggers",[$.triggerRedirect]:"queryPipelineTriggers",[$.queryErrorBack]:"errors",[$.queryErrorClear]:"errors",[$.queryErrorRetry]:"errors",[$.pagerNext]:"getMoreResults",[$.pagerPrevious]:"getMoreResults",[$.pagerNumber]:"getMoreResults",[$.pagerResize]:"getMoreResults",[$.pagerScrolling]:"getMoreResults",[$.facetSearch]:"facet",[$.facetShowLess]:"facet",[$.facetShowMore]:"facet",[$.recommendation]:"recommendation",[$.likeSmartSnippet]:"smartSnippet",[$.dislikeSmartSnippet]:"smartSnippet",[$.expandSmartSnippet]:"smartSnippet",[$.collapseSmartSnippet]:"smartSnippet",[$.openSmartSnippetFeedbackModal]:"smartSnippet",[$.closeSmartSnippetFeedbackModal]:"smartSnippet",[$.sendSmartSnippetReason]:"smartSnippet",[$.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.clearRecentQueries]:"recentQueries",[$.recentResultClick]:"recentlyClickedDocuments",[$.clearRecentResults]:"recentlyClickedDocuments",[$.showLessFoldedResults]:"folding",[$.caseDetach]:"case",[$.likeGeneratedAnswer]:"generatedAnswer",[$.dislikeGeneratedAnswer]:"generatedAnswer",[$.openGeneratedAnswerSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[zn.expandToFullUI]:"interface",[zn.openUserActions]:"User Actions",[zn.showPrecedingSessions]:"User Actions",[zn.showFollowingSessions]:"User Actions",[zn.clickViewedDocument]:"User Actions",[zn.clickPageView]:"User Actions",[zn.createArticle]:"createArticle"},Hi=class{constructor(){this.runtime=new Zd,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(Pe.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Pe.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Pe.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Pe.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Db}};function cq(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function uq(e){return e.map(t=>t.replace(/;/g,""))}function Ub(e){let r=e.join(";");return r.length<=256?r:Ub(e.slice(1))}var Pb=e=>{let t=uq(e),r=cq(t);return Ub(r)};function kb(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Pb(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Pb(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var tp=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||ep();this.coveoAnalyticsClient=n?new Hi:new Xr(t)}disable(){this.coveoAnalyticsClient=new Hi}enable(){this.coveoAnalyticsClient=new Xr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return B(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return B(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return B(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return B(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return B(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return B(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return B(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return B(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return B(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return B(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent($.resultsSort,t)}logResultsSort(t){return B(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return B(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return B(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return B(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent($.breadcrumbFacet,t)}logBreadcrumbFacet(t){return B(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return B(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,kb(t))}logOmniboxAnalytics(t){return B(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,kb(t))}logOmniboxFromLink(t){return B(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return B(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent($.triggerNotify,t)}logTriggerNotify(t){return B(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent($.triggerExecute,t)}logTriggerExecute(t){return B(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent($.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return B(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent($.undoTriggerQuery,t)}logUndoTriggerQuery(t){return B(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent($.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return B(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent($.pagerResize,t)}logPagerResize(t){return B(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent($.pagerNumber,t)}logPagerNumber(t){return B(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent($.pagerNext,t)}logPagerNext(t){return B(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent($.pagerPrevious,t)}logPagerPrevious(t){return B(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return B(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent($.facetClearAll,t)}logFacetClearAll(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent($.facetSearch,t)}logFacetSearch(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent($.facetSelect,t)}logFacetSelect(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent($.facetDeselect,t)}logFacetDeselect(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent($.facetExclude,t)}logFacetExclude(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent($.facetUnexclude,t)}logFacetUnexclude(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent($.facetSelectAll,t)}logFacetSelectAll(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent($.facetUpdateSort,t)}logFacetUpdateSort(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent($.facetShowMore,t)}logFacetShowMore(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent($.facetShowLess,t)}logFacetShowLess(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent($.queryError,t)}logQueryError(t){return B(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return B(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>B(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return B(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return B(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>B(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return B(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return B(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>B(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return B(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return B(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return B(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return B(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return B(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return B(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return B(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return B(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return B(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return B(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return B(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return B(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return B(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return B(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return B(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){return B(this,arguments,void 0,function*(n,o,a=Tb[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return B(this,arguments,void 0,function*(n,o,a=Tb[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return B(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return B(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return B(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:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return B(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return B(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return B(this,void 0,void 0,function*(){var n,o;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 B(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 Xr?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($.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return B(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent($.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return B(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent($.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return B(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent($.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return B(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return B(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent($.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},rp=Object.assign({},Ku),Ob=Object.keys(rp).map(e=>rp[e]),Gi=class extends dS{constructor({client:t,uuidGenerator:r=va}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>Ob.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(Ob.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(rp.pageview,{newEventType:Pe.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(rp.event,{newEventType:Pe.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}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return gD(this.ticket)}};Gi.Id="svc";var np;(function(e){e.click="click",e.flowStart="flowStart"})(np||(np={}));var gr;(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"})(gr||(gr={}));var op;(function(e){e.quit="Quit",e.solved="Solved"})(op||(op={}));var ap=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!ep();this.coveoAnalyticsClient=o?new Xr(t):new Hi,this.svc=new Gi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Hi,this.svc=new Gi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Xr(this.options),this.svc=new Gi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(gr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(gr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(gr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(gr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(gr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(gr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(gr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(gr.caseCancelled,{reason:op.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(gr.caseSolved,{reason:op.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(gr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",np.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",np.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return B(this,void 0,void 0,function*(){var r,n;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 Xr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;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:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return B(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var Ao=()=>"default";var lq=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},xa=class{constructor(t){this.getState=t;ke(this,"state");this.state=t()}getLanguage(){return lq(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=vo),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Ao()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var Qb=e=>new Xr(e).getCurrentVisitorId(),Xu=(e,t)=>typeof t=="function"?(...r)=>{let n=wu(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Zu=(e,t)=>(...r)=>{let n=wu(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var el=class extends xa{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Bb=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new el(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Pt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,h=new ap({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Xu(e,n),beforeSendHooks:[Zu(e,r),(x,A)=>(e.info({...A,type:x,endpoint:p,token:i},"Analytics request"),A)]},o);return m||h.disable(),h};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function zi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function dq(e,t){return!!t&&t.facetId in e.facetSet}var jr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),ip=(e,t)=>e.facetSet[t]?.request,Wi=(e,t)=>{let r=jr(e,t);return dq(e,r)?r:void 0},Gb=(e,t)=>Wi(e,t)?.values.filter(r=>r.state==="selected")||[],$b=(e,t)=>Wi(e,t)?.values.filter(r=>r.state!=="idle")||[],Zr=e=>e.search.isLoading;d();c();l();u();function Hb(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function cr(e){let{activeValue:t,ancestryMap:r}=pq(e);return t?fq(t,r):[]}function pq(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 fq(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function mq(e,t){return!!t&&t.facetId in e.categoryFacetSet}var wS=(e,t)=>{let r=jr(e,t);if(mq(e,r))return r},RS=(e,t)=>e.categoryFacetSet[t]?.request,zb=(e,t)=>{let r=wS(e,t);return cr(r?.values??[])},FS=(e,t)=>{let r=RS(e,t);return cr(r?.currentValues??[])};d();c();l();u();function Ki(){return{}}d();c();l();u();function Wb(e,t){return{request:e,tabs:t}}function Yi(){return{}}d();c();l();u();function Kb(e,t){return{request:e,tabs:t}}function Ji(){return{}}d();c();l();u();function Yb(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function Xi(){return{}}var Zi=(e,t)=>{let r=ew(t,e),n=r?r.field:"",o=IS(n,e);return{facetId:e,facetField:n,facetTitle:o}};function es(e,t){let{facetId:r,facetValue:n}=e,o=Zi(r,t),a=tw(t,r);return{...o,facetValue:a==="hierarchical"?Zb(t,r):n}}function ur(e){return{facetSet:e.facetSet??Xi(),categoryFacetSet:e.categoryFacetSet??Ki(),dateFacetSet:e.dateFacetSet??Yi(),numericFacetSet:e.numericFacetSet??Ji(),automaticFacetSet:e.automaticFacetSet??zi()}}var ES=e=>{let t=[];return yq(e).forEach((r,n)=>{let o=tw(e,r.facetId),a=Cq(r,n+1);if(hq(r)){if(!!!FS(e,r.facetId).length)return;t.push({...a,...xq(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Jb(i,p+1,o),m=gq(r)?Xb(i):vq(i);t.push({...a,...f,...m})})}),Sq(e).forEach((r,n)=>{let o=Aq(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Jb(a,i+1,"specific"),f=Xb(a);t.push({...o,...p,...f})})}),t},gq=e=>e.type==="specific",hq=e=>e.type==="hierarchical",yq=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),Sq=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Jb=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),vq=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Xb=e=>({displayValue:e.value,value:e.value}),Zb=(e,t)=>FS(e,t).map(n=>n.value).join(";"),xq=(e,t)=>{let n=Zb(e,t);return{value:n,valuePosition:1,displayValue:n}},Aq=(e,t)=>({title:IS(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),Cq=(e,t)=>({title:IS(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),IS=(e,t)=>`${e}_${t}`,ew=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,tw=(e,t)=>{let r=ew(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var TS=e=>e.configuration.search.locale,rw=e=>e.configuration.search.timezone,sp=e=>e.configuration.accessToken,cp=e=>e.configuration.organizationId,up=e=>e.configuration.environment,lp=e=>e.configuration?.knowledge?.agentId,nw=e=>e.configuration.knowledge.debugAgentSession;var We=e=>{if(bq(e)||PS(e))return e.generatedAnswer?.answerId;if(wq(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},bq=e=>"answer"in e&&"generatedAnswer"in e&&!de(e.generatedAnswer?.answerConfigurationId),PS=e=>{let t=lp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},wq=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",kS=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Rq=e=>e.generatedAnswer?.citations,Fq=e=>e.followUpAnswers?.followUpAnswers,Eq=Xe(Fq,e=>e?.flatMap(t=>t.citations)),Iq=(e,t)=>t,tl=Xe(Rq,Eq,Iq,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var pt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var rl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(rl||{}),Aa=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(Aa||{}),en=e=>{if(Oi(e))return e.map(t=>en(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""}},ts=()=>({by:"relevancy"}),dp=e=>({by:"date",order:e}),pp=(e,t)=>({by:"field",order:t,field:e}),fp=()=>({by:"qre"}),mp=()=>({by:"nosort"}),ow=new X({values:{by:new bu({enum:Aa,required:!0}),order:new bu({enum:rl}),field:new U}});function yr(){return en(ts())}d();c();l();u();d();c();l();u();d();c();l();u();var rs=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?OS(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],OS(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function OS(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function Tq(){return typeof navigator<"u"}function aw(){try{return typeof localStorage<"u"}catch{return!1}}function iw(){try{return typeof sessionStorage<"u"}catch{return!1}}function sw(){return!!(Tq()&&navigator.cookieEnabled)}var cw=null;function uw(){return cw||(aw()?localStorage:sw()?new NS:iw()?sessionStorage:new _S)}var ns=class ns{getItem(t){return rs.get(`${ns.prefix}${t}`)}removeItem(t){rs.erase(`${ns.prefix}${t}`)}setItem(t,r,n){rs.set(`${ns.prefix}${t}`,r,n)}};ke(ns,"prefix","coveo_");var NS=ns;var _S=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var gp="__coveo.analytics.history",Pq=20,kq=1e3*60,Oq=75,Ca=class Ca{constructor(t){ke(this,"store");this.store=t||uw()}static getInstance(t){return Ca.instance||(Ca.instance=new Ca(t)),Ca.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(gp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(gp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(gp,JSON.stringify(t.slice(0,Pq)))}catch{}}clear(){try{this.store.removeItem(gp)}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,Oq)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>kq:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};ke(Ca,"instance",null);var DS=Ca,Jt=DS;var nl=class nl extends xa{constructor(){super(...arguments);ke(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 ES(ur(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||nl.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||ir().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||nl.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=We(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??yr()}}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 a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}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||pt().q}get responseTime(){return this.state.search?.duration||ir().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ir().response.totalCountFiltered}};ke(nl,"fallbackPipelineName","default");var Co=nl,lw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Pt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,h=new tp({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Xu(e,n),beforeSendHooks:[Zu(e,r),(x,A)=>(e.info({...A,type:x,endpoint:p,token:i},"Analytics request"),A)]},o);return m||h.disable(),h},qS=()=>{let t=Jt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function hp(e){let t=dw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return _A([e,...t,...r],o=>o.uniqueId)}function dw(e){return e.childResults?e.childResults.flatMap(t=>[t,...dw(t)]):[]}d();c();l();u();var Wn=()=>"";function pw(e,t){return{...new Co(t).getBaseMetadata(),actionCause:e,type:e}}function Nq(e){return Object.assign(e,{instantlyCallable:!0})}function _q(e,t){let r=a=>{let i=xe(e,a);return Nq(Object.assign(i,{type:i.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:h}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:h})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:h}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x,{getState:A,extra:y}){return yield h({state:A(),extra:y})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var fw=(e,t,r)=>{function n(...o){let a=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 Mq(a)}return n},Dq=e=>e.configuration.analytics.analyticsMode==="legacy",qq=e=>e.configuration.analytics.analyticsMode==="next",Mq=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),_q(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:h}){let x=[],A={log:function(){var _ref14=_asyncToGenerator(function*({state:w}){for(let P of x)yield P(w)});return function log(_x25){return _ref14.apply(this,arguments)}}()},y=p(),C=a({getState:p,logger:h,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),R=yield t(C,p());A.description=R?.description,x.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(w){Dq(w)&&(yield Vq(R,r,w,h,C.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:b}=Wu(y);return x.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(w){if(qq(w)&&o&&n){let P=n(w);yield zq(b,o,P)}});return function(_x27){return _ref16.apply(this,arguments)}}()),A});return function(_x24){return _ref13.apply(this,arguments)}}()));function Vq(_x28,_x29,_x30,_x31,_x32){return _Vq.apply(this,arguments)}function _Vq(){_Vq=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _Vq.apply(this,arguments)}var jq=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),J=fw(e=>lw({...e,provider:e.provider||new Co(e.getState)}),e=>e,Co),u5=fw(Bb,jq("caseAssist"),el);var ft=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=yw(e,o),n<0&&(n=Hq(e,o)),n<0&&(n=0),Uq(e,r(n),t)};var mw=(e,t)=>({sourceName:Lq(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Wn()});function Lq(e){let t=e.source;return de(t)?"unknown":t}var gw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function Uq(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:Gq(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:$q(e),queryPipeline:r.pipeline||Wn()}}var Ke=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||""}),hw={urihash:new U,sourcetype:new U,permanentid:new U},yp={uniqueId:W,raw:new X({values:hw}),title:W,uri:W,clickUri:W,rankingModifier:new U({required:!1,emptyAllowed:!0})};function Qq(e){return Object.assign({},...Object.keys(hw).map(t=>({[t]:e[t]})))}function Bq(e){return Object.assign({},...Object.keys(yp).map(t=>({[t]:e[t]})),{raw:Qq(e.raw)})}function Gq(e){let t=e.raw.author;return de(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function $q(e){let t=e.raw.source;return de(t)?"unknown":t}var Xt=e=>new ye(yp).validate(Bq(e));function Hq(e,t){for(let[r,n]of t.entries()){let o=hp(n);if(yw(e,o)!==-1)return r}return-1}function yw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function zq(_x34,_x35,_x36){return _zq.apply(this,arguments)}function _zq(){_zq=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _zq.apply(this,arguments)}d();c();l();u();var MS=e=>O(e,{evt:W,type:st}),Sw=e=>J("analytics/generic/search",t=>{MS(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),vw=e=>J("analytics/generic/click",(t,r)=>(Xt(e.result),MS(e),t.makeClickEvent(e.evt,ft(e.result,r),Ke(e.result),e.meta))),xw=e=>J("analytics/generic/custom",t=>(MS(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Sp=()=>J("analytics/interface/load",e=>e.makeInterfaceLoad()),bo=()=>J("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),vp=()=>J("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),xp=e=>J("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),Aw=()=>({actionCause:"interfaceLoad"}),os=()=>({actionCause:"interfaceChange"}),Cw=()=>({actionCause:"searchFromLink"}),bw=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var VS=()=>st,ww=()=>W,tn=I("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new U({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),Sr=I("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new U({required:!1,url:!0}),pipeline:new U({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new ie({required:!1,each:W})})),Wq={enabled:new le({default:!0}),originContext:VS(),originLevel2:VS(),originLevel3:VS(),proxyBaseUrl:new U({required:!1,url:!0}),runtimeEnvironment:new Ue,anonymous:new le({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:pC,analyticsMode:new U({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new X({options:{required:!1},values:vb.reduce((e,t)=>(e[t]=dC,e),{})})},wo=I("configuration/updateAnalyticsConfiguration",e=>O(e,Wq)),as=I("configuration/analytics/disable"),is=I("configuration/analytics/enable"),Ap=I("configuration/analytics/originlevel2",e=>O(e,{originLevel2:ww()})),Cp=I("configuration/analytics/originlevel3",e=>O(e,{originLevel3:ww()})),bp=I("knowledge/setAgentId",e=>O(e,new U({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var wp={q:new U,enableQuerySyntax:new le,aq:new U,cq:new U,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new U,f:new X,fExcluded:new X,cf:new X,nf:new X,mnf:new X,df:new X,debug:new le,sf:new X,tab:new U,af:new X};var De=I("searchParameters/restore",e=>O(e,wp)),ss=I("searchParameters/restoreTab",e=>O(e,W));d();c();l();u();var Ro=I("debug/enable"),cs=I("debug/disable");d();c();l();u();var Fo=()=>!1;var us=ae(Fo(),e=>{e.addCase(Ro,()=>!0).addCase(cs,()=>!1).addCase(De,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var jS=I("history/undo"),LS=I("history/redo"),lr=I("history/snapshot"),ol=xe("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(jS()),yield t(_e())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),Rp=xe("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(LS()),yield t(_e())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),_e=xe("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var ls=I("pipeline/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var ds=ae(Wn(),e=>{e.addCase(ls,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Sr,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var mt=I("breadcrumb/deselectAll"),ps=I("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var rn=I("facet/updateFacetAutoSelection",e=>O(e,{allow:new le({required:!0})}));d();c();l();u();d();c();l();u();var al=class extends Co{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??pt().q}get responseTime(){return this.activeInstantResultCache?.duration??ir().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ir().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Rw=e=>J({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Xt(e),t.makeDocumentOpen(ft(e,r),Ke(e))),__legacy__provider:t=>new al(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=ft(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),Fw=()=>J("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new al(e)),Ew=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var US={id:W},Kq={...US,q:Qe},fs=I("instantResults/register",e=>O(e,US)),nn=I("instantResults/updateQuery",e=>O(e,Kq)),ms=I("instantResults/clearExpired",e=>O(e,US));d();c();l();u();var Fp=new re({required:!0,min:0}),gs=I("pagination/registerNumberOfResults",e=>O(e,Fp)),hs=I("pagination/updateNumberOfResults",e=>O(e,Fp)),ys=I("pagination/registerPage",e=>O(e,Fp)),on=I("pagination/updatePage",e=>O(e,Fp)),Ss=I("pagination/nextPage"),vs=I("pagination/previousPage");d();c();l();u();var jt=I("query/updateQuery",e=>O(e,{q:new U,enableQuerySyntax:new le}));d();c();l();u();d();c();l();u();var Lr=(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:Qi(e)}});var xs=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??lt(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&&Lr(e.configuration.analytics,t,r)),...(e.excerptLength&&!de(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();d();c();l();u();var As=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Qb(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}),...(qS()&&{pageId:qS()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Qi(e)})}}});return function As(_x43,_x44){return _ref21.apply(this,arguments)}}();var Eo=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??lt(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:Jt.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 As(e.configuration.analytics,t))),...(e.excerptLength&&!de(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Eo(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Ur=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var QS=()=>J("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Io=e=>J("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||pt().q,aq:r.advancedSearchQueries?.aq||Ur().aq,cq:r.advancedSearchQueries?.cq||Ur().cq,dq:r.advancedSearchQueries?.dq||Ur().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var sl=Mr(Ep(),1),Ow=Mr(Iw(),1);d();c();l();u();var Ip=Mr(Ep(),1),Pw=Mr(Tw(),1);Ip.default.extend(Pw.default);var Cs="YYYY/MM/DD@HH:mm:ss",Yq="1401-01-01";function ba(e,t){let r=(0,Ip.default)(e,t);return!r.isValid()&&!t?(0,Ip.default)(e,Cs):r}function il(e){return e.format(Cs)}function kw(e){return il(ba(e))===e}function Tp(e,t){let r=ba(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}`)}KS(r)}function KS(e){if(e.isBefore(Yq))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}sl.default.extend(Ow.default);var Nw=["past","now","next"],_w=["minute","hour","day","week","month","quarter","year"],Jq=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new U({required:!t,constrainTo:_w}),period:new U({required:!0,constrainTo:Nw})}};function To(e){if(typeof e=="string"&&!an(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?YS(e):e;new ye(Jq(t.period)).validate(t);let r=qw(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);KS(r)}function Dw(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function qw(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,sl.default)().subtract(r,n);case"next":return(0,sl.default)().add(r,n);case"now":return(0,sl.default)()}}function cl(e){return il(qw(YS(e)))}function Mw(e){return e.toLocaleLowerCase().split("-")}function an(e){let[t,r,n]=Mw(e);if(t==="now")return!0;if(!Nw.includes(t)||!_w.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function Vw(e){return!!e&&typeof e=="object"&&"period"in e}function YS(e){let[t,r,n]=Mw(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function jw(e){return To(e),YS(e)}d();c();l();u();function Lw(e){return e.type==="dateRange"}function Uw(e){return`start${e}`}function Qw(e){return`end${e}`}var JS=()=>({dateFacetValueMap:{}});function Xq(e,t,r){let n=e.start,o=e.end;return an(n)&&(n=cl(n),r.dateFacetValueMap[t][Uw(n)]=e.start),an(o)&&(o=cl(o),r.dateFacetValueMap[t][Qw(o)]=e.end),{...e,start:n,end:o}}function XS(e,t){if(Lw(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>Xq(o,r,t))}}return e}function Po(e){let t=JS();return{request:{...e,facets:e.facets?.map(n=>XS(n,t))},mappings:t}}function Zq(e,t,r){return{...e,start:r.dateFacetValueMap[t][Uw(e.start)]||e.start,end:r.dateFacetValueMap[t][Qw(e.end)]||e.end}}function eM(e,t){return e.facetId in t.dateFacetValueMap}function tM(e,t){return eM(e,t)?{...e,values:e.values.map(r=>Zq(r,e.facetId,t))}:e}function Pp(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>tM(n,t))}}:e}d();c();l();u();d();c();l();u();var bs=I("didYouMean/enable"),kp=I("didYouMean/disable"),ws=I("didYouMean/automaticCorrections/disable"),Op=I("didYouMean/automaticCorrections/enable"),vr=I("didYouMean/correction",e=>O(e,W)),wa=I("didYouMean/automaticCorrections/mode",e=>O(e,new U({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Np=()=>J("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),ZS=()=>J("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),Bw=()=>({actionCause:"didYouMeanClick"}),Gw=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function _p(){return{contextValues:{}}}d();c();l();u();function Dp(){return{contextValues:{}}}d();c();l();u();function ev(){return{enabled:!0,tabs:{}}}function qp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Mp(){return[]}d();c();l();u();function xr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Vp(){return{}}d();c();l();u();function jp(){return{}}d();c();l();u();function Lp(){return{}}function $w(){return Qr({})}function Qr(e){return{context:e.context||_p(),dictionaryFieldContext:e.dictionaryFieldContext||Dp(),facetSet:e.facetSet||Xi(),numericFacetSet:e.numericFacetSet||Ji(),dateFacetSet:e.dateFacetSet||Yi(),categoryFacetSet:e.categoryFacetSet||Ki(),automaticFacetSet:e.automaticFacetSet??zi(),pagination:e.pagination||xr(),query:e.query||pt(),tabSet:e.tabSet||Lp(),advancedSearchQueries:e.advancedSearchQueries||Ur(),staticFilterSet:e.staticFilterSet||jp(),querySet:e.querySet||Vp(),sortCriteria:e.sortCriteria||yr(),pipeline:e.pipeline||Wn(),searchHub:e.searchHub||Ao(),facetOptions:e.facetOptions||qp(),facetOrder:e.facetOrder??Mp(),debug:e.debug??Fo()}}d();c();l();u();var rM=new X({values:{undoneQuery:Qe},options:{required:!0}}),Up=()=>J("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Qp=e=>J("analytics/trigger/query/undo",t=>(O(e,rM),t.makeUndoTriggerQuery(e))),Bp=()=>J("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Gp=()=>J("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),$p=()=>J("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var ko=I("trigger/query/ignore",e=>O(e,new U({emptyAllowed:!0,required:!0}))),Rs=I("trigger/query/modification",e=>O(e,new X({values:{originalQuery:st,modification:st}})));d();c();l();u();d();c();l();u();d();c();l();u();function Oo(e){return Object.values(e).map(t=>t.request)}function ul(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function Hw(e){return Oo(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var tv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function nM(e){return Oo(e).map(t=>{let r=tv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function oM(e){return[...nM(e.facetSet??{}),...Hw(e.numericFacetSet??{}),...Hw(e.dateFacetSet??{}),...Oo(e.categoryFacetSet??{})]}function aM(e){return oM(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Hp(e){return ul(aM(e),e.facetOrder??[])}d();c();l();u();var No=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=cM(e),n=Hp(e),o=iM(e),a=yield Eo(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Po({...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"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),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 No(_x47,_x48){return _ref23.apply(this,arguments)}}();function iM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(sM).filter(r=>r.currentValues.length>0):void 0}function sM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function cM(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=uM(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function uM(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var _o=class{constructor(t,r=n=>{this.dispatch(jt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Pp(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,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 vt(t.response)?(this.dispatch(Io(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:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,h=!de(f)&&!de(f.correctedQuery);if(!m&&!h)return null;let A=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(lr(Qr(_this12.getState()))),A})()}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],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this13.dispatch(Io(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(lr(Qr(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:ZS()})})()}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:ZS()}}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(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(ko("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this14.dispatch(Io(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(lr(Qr(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:Up()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??pt().enableQuerySyntax},search:{...ir(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(lr(Qr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return vd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield No(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(vr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Rs({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield No(_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 zw=xe("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield zp(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),Ww=xe("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield nv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),Kw=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield ov(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),Yw=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield fM(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),Jw=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return rv(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),lM=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function lM(_x61,_x62){return _ref29.apply(this,arguments)}}(),dM=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield Eo(e);return Po({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function dM(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),pM=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request.numberOfResults=0,r});return function pM(_x66,_x67){return _ref31.apply(this,arguments)}}(),Xw=e=>{e.configuration.analytics.enabled&&Jt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function rv(_x68,_x69){return _rv.apply(this,arguments)}function _rv(){_rv=_asyncToGenerator(function*(e,t){O(e,{id:W,q:W,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new _o({...t,analyticsAction:Fw()},m=>{t.dispatch(nn({q:m,id:e.id}))}),i=yield dM(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _rv.apply(this,arguments)}function nv(_x70,_x71,_x72){return _nv.apply(this,arguments)}function _nv(){_nv=_asyncToGenerator(function*(e,t,r){Xw(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new _o({...t,analyticsAction:r}),f=yield No(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _nv.apply(this,arguments)}function ov(_x73,_x74){return _ov.apply(this,arguments)}function _ov(){_ov=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield QS().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new _o({...e,analyticsAction:QS()}),p=yield lM(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _ov.apply(this,arguments)}function fM(_x75,_x76,_x77){return _fM.apply(this,arguments)}function _fM(){_fM=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new _o({...e,analyticsAction:t}),f=yield pM(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _fM.apply(this,arguments)}function zp(_x78,_x79,_x80){return _zp.apply(this,arguments)}function _zp(){_zp=_asyncToGenerator(function*(e,t,r){Xw(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield No(e,i),f=new _o({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _zp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var Zw=Xe(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Ar=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=iv(e),o=mM(e),a=gM(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield Eo(e,r):xs(e,t,r);return Po({...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"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:av(e),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:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ar(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function av(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function mM(e){return ul(yM(e),e.facetOrder??[])}function gM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(hM).filter(r=>r.currentValues.length>0):void 0}function hM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function yM(e){return SM(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function SM(e){return[...vM(e.facetSet??{}),...eR(e.numericFacetSet??{}),...eR(e.dateFacetSet??{}),...Oo(e.categoryFacetSet??{})]}function vM(e){return Oo(e).map(t=>{let r=tv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function eR(e){return Oo(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function iv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=Zw(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var Do=class{constructor(t,r=n=>{this.dispatch(jt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Pp(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,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 vt(t.response)?(this.dispatch(Io(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:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,h=!de(f)&&!de(f.correctedQuery);if(!m&&!h)return null;let A=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(lr(Qr(_this19.getState()))),A})()}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],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this20.dispatch(Io(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(lr(Qr(_this20.getState()))),{...a,response:{...a.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(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(ko("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this21.dispatch(Io(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(lr(Qr(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(lr(Qr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return vd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=Gw(),o=yield _this22.fetchFromAPI(yield Ar(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(vr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Rs({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Ar(_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 Fs=xe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new U,enableQuerySyntax:new le,clearFilters:new le}),e.clearFilters&&(r(mt()),r(ps())),r(rn({allow:!0})),r(jt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(on(1))}),tR=I("search/updateSearchAction"),z=xe("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return zp(r,t,e.legacy);rR(r);let n=e.next?nR(e.next):void 0,o=yield Ar(r,t.extra.navigatorContext,n),a=new Do({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),Lt=xe("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(rR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return nv(r,t,e.legacy);let n=new Do({...t,analyticsAction:e.next}),o=yield Ar(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),Cr=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return ov(t,r);let n=pw("browseResults",t.getState),o=new Do({...t,analyticsAction:n}),a=yield xM(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),br=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return zp(r,t,e.legacy);let n=new Do({...t,analyticsAction:{}}),o=yield CM(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),Es=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return rv(e,t);O(e,{id:W,q:W,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=nR(Ew()),i=yield AM(r,t.extra.navigatorContext,n,o,a),p=new Do({...t,analyticsAction:a},h=>{t.dispatch(nn({q:h,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x94,_x95){return _ref37.apply(this,arguments)}}()),xM=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield Ar(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function xM(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),AM=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=xs(e,t,o);return Po({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function AM(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),CM=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield Ar(e,t,r);return n.request.numberOfResults=0,n});return function CM(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),rR=e=>{e.configuration.analytics.enabled&&Jt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},nR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var qo=(e,t)=>{let r=e;return de(r[t])?de(e.raw[t])?null:e.raw[t]:r[t]},bM=e=>t=>e.every(r=>!de(qo(t,r))),wM=e=>t=>e.every(r=>de(qo(t,r))),RM=(e,t)=>r=>{let n=oR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},FM=(e,t)=>r=>{let n=oR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},oR=(e,t)=>{let r=qo(t,e);return cd(r)?r:[r]},aR={getResultProperty:qo,fieldsMustBeDefined:bM,fieldsMustNotBeDefined:wM,fieldMustMatch:RM,fieldMustNotMatch:FM};function ll(e){return e.search.response.searchUid!==""}function iR(e,t,r){return e.search.results.find(n=>qo(n,t)===r)}var sv=Xe(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Is=I("app/setError");function cv(e,t){let r=t.payload??null;r&&(e.response=ir().response,e.results=[],e.questionAnswer=qi()),e.error=r,e.isLoading=!1}function uv(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function EM(e,t){uv(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function sR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function IM(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var me=ae(ir(),e=>{e.addCase(z.rejected,(t,r)=>cv(t,r)),e.addCase(Cr.rejected,(t,r)=>cv(t,r)),e.addCase(Lt.rejected,(t,r)=>cv(t,r)),e.addCase(z.fulfilled,(t,r)=>{EM(t,r)}),e.addCase(Cr.fulfilled,(t,r)=>{uv(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Lt.fulfilled,(t,r)=>{uv(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(br.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(z.pending,sR),e.addCase(Cr.pending,IM),e.addCase(Lt.pending,sR),e.addCase(tR,(t,r)=>{t.searchAction=r.payload}),e.addCase(Is,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var Ts=I("searchHub/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var Ps=ae(Ao(),e=>{e.addCase(Ts,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Sr,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var cR=class extends Error{constructor(t){super(t[0].message);ke(this,"issues");this.name="SchemaError",this.issues=t}};var Yn="uninitialized",dv="pending",pl="fulfilled",fl="rejected";function uR(e){return{status:e,isUninitialized:e===Yn,isLoading:e===dv,isSuccess:e===pl,isError:e===fl}}var lR=Yr;function wR(e,t){if(e===t||!(lR(e)&&lR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=wR(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function pv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function TM(e){return new RegExp("(^|:)//").test(e)}function PM(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function hv(e){return e!=null}function dR(e){return[...(e?.values()??[])].filter(hv)}function kM(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var OM=e=>e.replace(/\/$/,""),NM=e=>e.replace(/^\//,"");function _M(e,t){if(!e)return t;if(!t)return e;if(TM(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=OM(e),t=NM(t),`${e}${r}${t}`}function Yp(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var fv=()=>new Map,DM=e=>{let t=new s.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},qM=(...e)=>{for(let r of e)if(r.aborted)return s.AbortSignal.abort(r.reason);let t=new s.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},pR=(...e)=>S(...e),MM=e=>e.status>=200&&e.status<=299,VM=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function fR(e){if(!Yr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var jM=e=>typeof e=="object"&&(Yr(e)||Array.isArray(e)||typeof e.toJSON=="function");function RR({baseUrl:e,prepareHeaders:t=x=>x,fetchFn:r=pR,paramsSerializer:n,isJsonContentType:o=VM,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...h}={}){return typeof S>"u"&&r===pR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(A,y,C){let{getState:R,extra:b,endpoint:w,forced:P,type:F}=y,k,{url:T,headers:D=new v(h.headers),params:G=void 0,responseHandler:L=f??"json",validateStatus:V=m??MM,timeout:Q=p,...j}=typeof A=="string"?{url:A}:A,N={...h,signal:Q?qM(y.signal,DM(Q)):y.signal,...j};D=new v(fR(D)),N.headers=(yield t(D,{getState:R,arg:A,extra:b,endpoint:w,forced:P,type:F,extraOptions:C}))||D;let _=jM(N.body);if(N.body!=null&&!_&&typeof N.body!="string"&&N.headers.delete("content-type"),!N.headers.has("content-type")&&_&&N.headers.set("content-type",a),_&&o(N.headers)&&(N.body=JSON.stringify(N.body,i)),N.headers.has("accept")||(L==="json"?N.headers.set("accept","application/json"):L==="text"&&N.headers.set("accept","text/plain, text/html, */*")),G){let ce=~T.indexOf("?")?"&":"?",he=n?n(G):new URLSearchParams(fR(G));T+=ce+he}T=_M(e,T);let q=new Request(T,N);k={request:new Request(T,N)};let H;try{H=yield r(q)}catch(ce){return{error:{status:(ce instanceof Error||typeof DOMException<"u"&&ce instanceof DOMException)&&ce.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ce)},meta:k}}let ne=H.clone();k.response=ne;let te,Z="";try{let ce;if(yield Promise.all([x(H,L).then(he=>te=he,he=>ce=he),ne.text().then(he=>Z=he,()=>{})]),ce)throw ce}catch(ce){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(ce)},meta:k}}return V(H,te)?{data:te,meta:k}:{error:{status:H.status,data:te},meta:k}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function x(_x110,_x111){return _x112.apply(this,arguments)}function _x112(){_x112=_asyncToGenerator(function*(A,y){if(typeof y=="function")return y(A);if(y==="content-type"&&(y=o(A.headers)?"json":"text"),y==="json"){let C=yield A.text();return C.length?JSON.parse(C):null}return A.text()});return _x112.apply(this,arguments)}}var ks=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function LM(){return _LM.apply(this,arguments)}function _LM(){_LM=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((a,i)=>{let p=setTimeout(()=>a(),o);if(r){let f=()=>{clearTimeout(p),i(new Error("Aborted"))};r.aborted?(clearTimeout(p),i(new Error("Aborted"))):r.addEventListener("abort",f,{once:!0})}})});return _LM.apply(this,arguments)}function FR(e,t){throw Object.assign(new ks({error:e,meta:t}),{throwImmediately:!0})}function lv(e){e.aborted&&FR({status:"CUSTOM_ERROR",error:"Aborted"})}var mR={},UM=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||mR).maxRetries,(o||mR).maxRetries].filter(h=>h!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:LM,retryCondition:(h,x,{attempt:A})=>A<=i,...t,...o},m=0;for(;;){lv(n.signal);try{let h=yield e(r,n,o);if(h.error)throw new ks(h);return h}catch(h){if(m++,h.throwImmediately){if(h instanceof ks)return h.value;throw h}if(h instanceof ks){if(!f.retryCondition(h.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return h.value}else if(m>f.maxRetries)return{error:h};lv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(x){throw lv(n.signal),x}}}});return function(_x113,_x114,_x115){return _ref42.apply(this,arguments)}}()),ER=Object.assign(UM,{fail:FR}),Xp="__rtkq/",QM="online",BM="offline";var IR="focused";var yv=I(`${Xp}${IR}`),TR=I(`${Xp}un${IR}`),Sv=I(`${Xp}${QM}`),PR=I(`${Xp}${BM}`);var hl="query",kR="mutation",OR="infinitequery";function Zp(e){return e.type===hl}function GM(e){return e.type===kR}function ef(e){return e.type===OR}function Jp(e){return Zp(e)||ef(e)}function vv(e,t,r,n,o,a){let i=$M(e)?e(t,r,n,o):e;return i?pv(i,hv,p=>a(NR(p))):[]}function $M(e){return typeof e=="function"}function NR(e){return typeof e=="string"?{type:e}:e}function HM(e,t){return e.catch(t)}var Os=(e,t)=>e.endpointDefinitions[t],ml=Symbol("forceQueryFn"),mv=e=>typeof e[ml]=="function";function zM({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=T=>i(T)?.runningQueries,f=T=>i(T)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:h,updateSubscriptionOptions:x}=o.internalActions;return{buildInitiateQuery:P,buildInitiateInfiniteQuery:F,buildInitiateMutation:k,getRunningQueryThunk:A,getRunningMutationThunk:y,getRunningQueriesThunk:C,getRunningMutationsThunk:R};function A(T,D){return G=>{let L=Os(a,T),V=e({queryArgs:D,endpointDefinition:L,endpointName:T});return p(G)?.get(V)}}function y(T,D){return G=>f(G)?.get(D)}function C(){return T=>dR(p(T))}function R(){return T=>dR(f(T))}function b(T){}function w(T,D){let G=(L,{subscribe:V=!0,forceRefetch:Q,subscriptionOptions:j,[ml]:N,..._}={})=>(q,Y)=>{let H=e({queryArgs:L,endpointDefinition:D,endpointName:T}),ne,te={..._,type:hl,subscribe:V,forceRefetch:Q,subscriptionOptions:j,endpointName:T,originalArgs:L,queryCacheKey:H,[ml]:N};if(Zp(D))ne=t(te);else{let{direction:be,initialPageParam:Ie,refetchCachedPages:Fe}=_;ne=r({...te,direction:be,initialPageParam:Ie,refetchCachedPages:Fe})}let Z=o.endpoints[T].select(L),ce=q(ne),he=Z(Y());let{requestId:qe,abort:Je}=ce,Le=he.requestId!==qe,He=p(q)?.get(H),ze=()=>Z(Y()),Re=Object.assign(N?ce.then(ze):Le&&!He?Promise.resolve(he):Promise.all([He,ce]).then(ze),{arg:L,requestId:qe,subscriptionOptions:j,queryCacheKey:H,abort:Je,unwrap(){return _asyncToGenerator(function*(){let be=yield Re;if(be.isError)throw be.error;return be.data})()},refetch:be=>q(G(L,{subscribe:!1,forceRefetch:!0,...be})),unsubscribe(){V&&q(m({queryCacheKey:H,requestId:qe}))},updateSubscriptionOptions(be){Re.subscriptionOptions=be,q(x({endpointName:T,requestId:qe,queryCacheKey:H,options:be}))}});if(!He&&!Le&&!N){let be=p(q);be.set(H,Re),Re.then(()=>{be.delete(H)})}return Re};return G}function P(T,D){return w(T,D)}function F(T,D){return w(T,D)}function k(T){return(D,{track:G=!0,fixedCacheKey:L}={})=>(V,Q)=>{let j=n({type:"mutation",endpointName:T,originalArgs:D,track:G,fixedCacheKey:L}),N=V(j);let{requestId:_,abort:q,unwrap:Y}=N,H=HM(N.unwrap().then(ce=>({data:ce})),ce=>({error:ce})),ne=()=>{V(h({requestId:_,fixedCacheKey:L}))},te=Object.assign(H,{arg:N.arg,requestId:_,abort:q,unwrap:Y,reset:ne}),Z=f(V);return Z.set(_,te),te.then(()=>{Z.delete(_)}),L&&(Z.set(L,te),te.then(()=>{Z.get(L)===te&&Z.delete(L)})),te}}}var _R=class extends cR{constructor(e,t,r,n){super(e),this.value=t,this.schemaName=r,this._bqMeta=n}},Fa=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ea(_x116,_x117,_x118,_x119){return _Ea.apply(this,arguments)}function _Ea(){_Ea=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new _R(o.issues,t,r,n);return o.value});return _Ea.apply(this,arguments)}function gR(e){return e}var dl=(e={})=>({...e,[Gu]:!0});function WM({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let h=(j,N,_,q)=>(Y,H)=>{let ne=r[j],te=n({queryArgs:N,endpointDefinition:ne,endpointName:j});if(Y(o.internalActions.queryResultPatched({queryCacheKey:te,patches:_})),!q)return;let Z=o.endpoints[j].select(N)(H()),ce=vv(ne.providesTags,Z.data,void 0,N,{},a);Y(o.internalActions.updateProvidedBy([{queryCacheKey:te,providedTags:ce}]))};function x(j,N,_=0){let q=[N,...j];return _&&q.length>_?q.slice(0,-1):q}function A(j,N,_=0){let q=[...j,N];return _&&q.length>_?q.slice(1):q}let y=(j,N,_,q=!0)=>(Y,H)=>{let te=o.endpoints[j].select(N)(H()),Z={patches:[],inversePatches:[],undo:()=>Y(o.util.patchQueryData(j,N,Z.inversePatches,q))};if(te.status===Yn)return Z;let ce;if("data"in te)if(Wt(te.data)){let[he,qe,Je]=$y(te.data,_);Z.patches.push(...qe),Z.inversePatches.push(...Je),ce=he}else ce=_(te.data),Z.patches.push({op:"replace",path:[],value:ce}),Z.inversePatches.push({op:"replace",path:[],value:te.data});return Z.patches.length===0||Y(o.util.patchQueryData(j,N,Z.patches,q)),Z},C=(j,N,_)=>q=>q(o.endpoints[j].initiate(N,{subscribe:!1,forceRefetch:!0,[ml]:()=>({data:_})})),R=(j,N)=>j.query&&j[N]?j[N]:gR,b=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(j,{signal:N,abort:_,rejectWithValue:q,fulfillWithValue:Y,dispatch:H,getState:ne,extra:te}){let Z=r[j.endpointName],{metaSchema:ce,skipSchemaValidation:he=m}=Z,qe=j.type===hl;try{let Je=gR,Le={signal:N,abort:_,dispatch:H,getState:ne,extra:te,endpoint:j.endpointName,type:j.type,forced:qe?w(j,ne()):void 0,queryCacheKey:qe?j.queryCacheKey:void 0},He=qe?j[ml]:void 0,ze,Re=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(Ie,Fe,ut,St){if(Fe==null&&Ie.pages.length)return Promise.resolve({data:Ie});let Dr={queryArg:j.originalArgs,pageParam:Fe},ar=yield be(Dr),Kr=St?x:A;return{data:{pages:Kr(Ie.pages,ar.data,ut),pageParams:Kr(Ie.pageParams,Fe,ut)},meta:ar.meta}});return function Re(_x122,_x123,_x124,_x125){return _ref44.apply(this,arguments)}}();function be(_x126){return _be.apply(this,arguments)}function _be(){_be=_asyncToGenerator(function*(Ie){let Fe,{extraOptions:ut,argSchema:St,rawResponseSchema:Dr,responseSchema:ar}=Z;if(St&&!Fa(he,"arg")&&(Ie=yield Ea(St,Ie,"argSchema",{})),He?Fe=He():Z.query?(Je=R(Z,"transformResponse"),Fe=yield t(Z.query(Ie),Le,ut)):Fe=yield Z.queryFn(Ie,Le,ut,qr=>t(qr,Le,ut)),typeof process<"u",Fe.error)throw new ks(Fe.error,Fe.meta);let{data:Kr}=Fe;Dr&&!Fa(he,"rawResponse")&&(Kr=yield Ea(Dr,Fe.data,"rawResponseSchema",Fe.meta));let fr=yield Je(Kr,Fe.meta,Ie);return ar&&!Fa(he,"response")&&(fr=yield Ea(ar,fr,"responseSchema",Fe.meta)),{...Fe,data:fr}});return _be.apply(this,arguments)}if(qe&&"infiniteQueryOptions"in Z){let{infiniteQueryOptions:Ie}=Z,{maxPages:Fe=1/0}=Ie,ut=j.refetchCachedPages??Ie.refetchCachedPages??!0,St,Dr={pages:[],pageParams:[]},ar=i.selectQueryEntry(ne(),j.queryCacheKey)?.data,fr=w(j,ne())&&!j.direction||!ar?Dr:ar;if("direction"in j&&j.direction&&fr.pages.length){let qr=j.direction==="backward",rd=(qr?DR:gv)(Ie,fr,j.originalArgs);St=yield Re(fr,rd,Fe,qr)}else{let{initialPageParam:qr=Ie.initialPageParam}=j,hu=ar?.pageParams??[],rd=hu[0]??qr,MO=hu.length;if(St=yield Re(fr,rd,Fe),He&&(St={data:St.data.pages[0]}),ut)for(let hA=1;hA<MO;hA++){let VO=gv(Ie,St.data,j.originalArgs);St=yield Re(St.data,VO,Fe)}}ze=St}else ze=yield be(j.originalArgs);return ce&&!Fa(he,"meta")&&ze.meta&&(ze.meta=yield Ea(ce,ze.meta,"metaSchema",ze.meta)),Y(ze.data,dl({fulfilledTimeStamp:Date.now(),baseQueryMeta:ze.meta}))}catch(Je){let Le=Je;if(Le instanceof ks){let He=R(Z,"transformErrorResponse"),{rawErrorResponseSchema:ze,errorResponseSchema:Re}=Z,{value:be,meta:Ie}=Le;try{ze&&!Fa(he,"rawErrorResponse")&&(be=yield Ea(ze,be,"rawErrorResponseSchema",Ie)),ce&&!Fa(he,"meta")&&(Ie=yield Ea(ce,Ie,"metaSchema",Ie));let Fe=yield He(be,Ie,j.originalArgs);return Re&&!Fa(he,"errorResponse")&&(Fe=yield Ea(Re,Fe,"errorResponseSchema",Ie)),q(Fe,dl({baseQueryMeta:Ie}))}catch(Fe){Le=Fe}}try{if(Le instanceof _R){let He={endpoint:j.endpointName,arg:j.originalArgs,type:j.type,queryCacheKey:qe?j.queryCacheKey:void 0};Z.onSchemaFailure?.(Le,He),p?.(Le,He);let{catchSchemaFailure:ze=f}=Z;if(ze)return q(ze(Le,He),dl({baseQueryMeta:Le._bqMeta}))}}catch(He){Le=He}throw typeof process<"u",console.error(Le),Le}});return function b(_x120,_x121){return _ref43.apply(this,arguments)}}();function w(j,N){let _=i.selectQueryEntry(N,j.queryCacheKey),q=i.selectConfig(N).refetchOnMountOrArgChange,Y=_?.fulfilledTimeStamp,H=j.forceRefetch??(j.subscribe&&q);return H?H===!0||(Number(new Date)-Number(Y))/1e3>=H:!1}let P=()=>xe(`${e}/executeQuery`,b,{getPendingMeta({arg:N}){let _=r[N.endpointName];return dl({startedTimeStamp:Date.now(),...(ef(_)?{direction:N.direction}:{})})},condition(N,{getState:_}){let q=_(),Y=i.selectQueryEntry(q,N.queryCacheKey),H=Y?.fulfilledTimeStamp,ne=N.originalArgs,te=Y?.originalArgs,Z=r[N.endpointName],ce=N.direction;return mv(N)?!0:Y?.status==="pending"?!1:w(N,q)||Zp(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ce)},dispatchConditionRejection:!0}),F=P(),k=P(),T=xe(`${e}/executeMutation`,b,{getPendingMeta(){return dl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,G=j=>"ifOlderThan"in j,L=(j,N,_={})=>(q,Y)=>{let H=D(_)&&_.force,ne=G(_)&&_.ifOlderThan,te=(ce=!0)=>{let he={forceRefetch:ce,subscribe:!1};return o.endpoints[j].initiate(N,he)},Z=o.endpoints[j].select(N)(Y());if(H)q(te());else if(ne){let ce=Z?.fulfilledTimeStamp;if(!ce){q(te());return}(Number(new Date)-Number(new Date(ce)))/1e3>=ne&&q(te())}else q(te(!1))};function V(j){return N=>N?.meta?.arg?.endpointName===j}function Q(j,N){return{matchPending:Li(Ud(j),V(N)),matchFulfilled:Li($n(j),V(N)),matchRejected:Li(ya(j),V(N))}}return{queryThunk:F,mutationThunk:T,infiniteQueryThunk:k,prefetch:L,updateQueryData:y,upsertQueryData:C,patchQueryData:h,buildMatchThunkActions:Q}}function gv(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function DR(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function qR(e,t,r,n){return vv(r[e.meta.arg.endpointName][t],$n(e)?e.payload:void 0,Hu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function hR(e){return zt(e)?_d(e):e}function Wp(e,t,r){let n=e[t];n&&r(n)}function gl(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function yR(e,t,r){let n=e[gl(t)];n&&r(n)}var Kp={};function KM({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let h=I(`${e}/resetApiState`);function x(V,Q,j,N){var _;V[_=Q.queryCacheKey]??(V[_]={status:Yn,endpointName:Q.endpointName}),Wp(V,Q.queryCacheKey,q=>{q.status=dv,q.requestId=j&&q.requestId?q.requestId:N.requestId,Q.originalArgs!==void 0&&(q.originalArgs=Q.originalArgs),q.startedTimeStamp=N.startedTimeStamp;let Y=o[N.arg.endpointName];ef(Y)&&"direction"in Q&&(q.direction=Q.direction)})}function A(V,Q,j,N){Wp(V,Q.arg.queryCacheKey,_=>{if(_.requestId!==Q.requestId&&!N)return;let{merge:q}=o[Q.arg.endpointName];if(_.status=pl,q){if(_.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=Q,Z=ga(_.data,ce=>q(ce,j,{arg:H.originalArgs,baseQueryMeta:ne,fulfilledTimeStamp:Y,requestId:te}));_.data=Z}else _.data=j;}else _.data=o[Q.arg.endpointName].structuralSharing??!0?wR(zt(_.data)?wC(_.data):_.data,j):j;delete _.error,_.fulfilledTimeStamp=Q.fulfilledTimeStamp})}let y=Sa({name:`${e}/queries`,initialState:Kp,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:Q}}){delete V[Q]},prepare:Ui()},cacheEntriesUpserted:{reducer(V,Q){for(let j of Q.payload){let{queryDescription:N,value:_}=j;x(V,N,!0,{arg:N,requestId:Q.meta.requestId,startedTimeStamp:Q.meta.timestamp}),A(V,{arg:N,requestId:Q.meta.requestId,fulfilledTimeStamp:Q.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:V=>({payload:V.map(N=>{let{endpointName:_,arg:q,value:Y}=N,H=o[_];return{queryDescription:{type:hl,endpointName:_,originalArgs:N.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:_})},value:Y}}),meta:{[Gu]:!0,requestId:zu(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:Q,patches:j}}){Wp(V,Q,N=>{N.data=Hy(N.data,j.concat())})},prepare:Ui()}},extraReducers(V){V.addCase(t.pending,(Q,{meta:j,meta:{arg:N}})=>{let _=mv(N);x(Q,N,_,j)}).addCase(t.fulfilled,(Q,{meta:j,payload:N})=>{let _=mv(j.arg);A(Q,j,N,_)}).addCase(t.rejected,(Q,{meta:{condition:j,arg:N,requestId:_},error:q,payload:Y})=>{Wp(Q,N.queryCacheKey,H=>{if(!j){if(H.requestId!==_)return;H.status=fl,H.error=Y??q}})}).addMatcher(p,(Q,j)=>{let{queries:N}=i(j);for(let[_,q]of Object.entries(N))(q?.status===pl||q?.status===fl)&&(Q[_]=q)})}}),C=Sa({name:`${e}/mutations`,initialState:Kp,reducers:{removeMutationResult:{reducer(V,{payload:Q}){let j=gl(Q);j in V&&delete V[j]},prepare:Ui()}},extraReducers(V){V.addCase(r.pending,(Q,{meta:j,meta:{requestId:N,arg:_,startedTimeStamp:q}})=>{_.track&&(Q[gl(j)]={requestId:N,status:dv,endpointName:_.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(Q,{payload:j,meta:N})=>{N.arg.track&&yR(Q,N,_=>{_.requestId===N.requestId&&(_.status=pl,_.data=j,_.fulfilledTimeStamp=N.fulfilledTimeStamp)})}).addCase(r.rejected,(Q,{payload:j,error:N,meta:_})=>{_.arg.track&&yR(Q,_,q=>{q.requestId===_.requestId&&(q.status=fl,q.error=j??N)})}).addMatcher(p,(Q,j)=>{let{mutations:N}=i(j);for(let[_,q]of Object.entries(N))(q?.status===pl||q?.status===fl)&&_!==q?.requestId&&(Q[_]=q)})}}),R={tags:{},keys:{}},b=Sa({name:`${e}/invalidation`,initialState:R,reducers:{updateProvidedBy:{reducer(V,Q){var j,N,_;for(let{queryCacheKey:q,providedTags:Y}of Q.payload){w(V,q);for(let{type:H,id:ne}of Y){let te=(N=(j=V.tags)[H]??(j[H]={}))[_=ne||"__internal_without_id"]??(N[_]=[]);te.includes(q)||te.push(q)}V.keys[q]=Y}},prepare:Ui()}},extraReducers(V){V.addCase(y.actions.removeQueryResult,(Q,{payload:{queryCacheKey:j}})=>{w(Q,j)}).addMatcher(p,(Q,j)=>{var _,q,Y;let{provided:N}=i(j);for(let[H,ne]of Object.entries(N.tags??{}))for(let[te,Z]of Object.entries(ne)){let ce=(q=(_=Q.tags)[H]??(_[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let he of Z)ce.includes(he)||ce.push(he),Q.keys[he]=N.keys[he]}}).addMatcher(Jr($n(t),Hu(t)),(Q,j)=>{P(Q,[j])}).addMatcher(y.actions.cacheEntriesUpserted.match,(Q,j)=>{let N=j.payload.map(({queryDescription:_,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:_}}));P(Q,N)})}});function w(V,Q){let j=hR(V.keys[Q]??[]);for(let N of j){let _=N.type,q=N.id??"__internal_without_id",Y=V.tags[_]?.[q];Y&&(V.tags[_][q]=hR(Y).filter(H=>H!==Q))}delete V.keys[Q]}function P(V,Q){let j=Q.map(N=>{let _=qR(N,"providesTags",o,f),{queryCacheKey:q}=N.meta.arg;return{queryCacheKey:q,providedTags:_}});b.caseReducers.updateProvidedBy(V,b.actions.updateProvidedBy(j))}let F=Sa({name:`${e}/subscriptions`,initialState:Kp,reducers:{updateSubscriptionOptions(V,Q){},unsubscribeQueryResult(V,Q){},internal_getRTKQSubscriptions(){}}}),k=Sa({name:`${e}/internalSubscriptions`,initialState:Kp,reducers:{subscriptionsUpdated:{reducer(V,Q){return Hy(V,Q.payload)},prepare:Ui()}}}),T=Sa({name:`${e}/config`,initialState:{online:kM(),focused:PM(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:Q}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==Q?"conflict":!0}},extraReducers:V=>{V.addCase(Sv,Q=>{Q.online=!0}).addCase(PR,Q=>{Q.online=!1}).addCase(yv,Q=>{Q.focused=!0}).addCase(TR,Q=>{Q.focused=!1}).addMatcher(p,Q=>({...Q}))}}),D=Mi({queries:y.reducer,mutations:C.reducer,provided:b.reducer,subscriptions:k.reducer,config:T.reducer}),G=(V,Q)=>D(h.match(Q)?void 0:V,Q),L={...T.actions,...y.actions,...F.actions,...k.actions,...C.actions,...b.actions,resetApiState:h};return{reducer:G,actions:L}}var Ia=Symbol.for("RTKQ/skipToken"),MR={status:Yn},SR=ga(MR,()=>{}),vR=ga(MR,()=>{});function YM({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=F=>SR,o=F=>vR;return{buildQuerySelector:A,buildInfiniteQuerySelector:y,buildMutationSelector:C,selectInvalidatedBy:R,selectCachedArgsForQuery:b,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:h};function a(F){return{...F,...uR(F.status)}}function i(F){return F[t]}function p(F){return i(F)?.queries}function f(F,k){return p(F)?.[k]}function m(F){return i(F)?.mutations}function h(F){return i(F)?.config}function x(F,k,T){return D=>{if(D===Ia)return r(n,T);let G=e({queryArgs:D,endpointDefinition:k,endpointName:F});return r(V=>f(V,G)??SR,T)}}function A(F,k){return x(F,k,a)}function y(F,k){let{infiniteQueryOptions:T}=k;function D(G){let L={...G,...uR(G.status)},{isLoading:V,isError:Q,direction:j}=L,N=j==="forward",_=j==="backward";return{...L,hasNextPage:w(T,L.data,L.originalArgs),hasPreviousPage:P(T,L.data,L.originalArgs),isFetchingNextPage:V&&N,isFetchingPreviousPage:V&&_,isFetchNextPageError:Q&&N,isFetchPreviousPageError:Q&&_}}return x(F,k,D)}function C(){return F=>{let k;return typeof F=="object"?k=gl(F)??Ia:k=F,r(k===Ia?o:G=>i(G)?.mutations?.[k]??vR,a)}}function R(F,k){let T=F[t],D=new Set,G=pv(k,hv,NR);for(let L of G){let V=T.provided.tags[L.type];if(!V)continue;let Q=(L.id!==void 0?V[L.id]:Object.values(V).flat())??[];for(let j of Q)D.add(j)}return Array.from(D.values()).flatMap(L=>{let V=T.queries[L];return V?{queryCacheKey:L,endpointName:V.endpointName,originalArgs:V.originalArgs}:[]})}function b(F,k){return pv(Object.values(p(F)),T=>T?.endpointName===k&&T.status!==Yn,T=>T.originalArgs)}function w(F,k,T){return k?gv(F,k,T)!=null:!1}function P(F,k,T){return!k||!F.getPreviousPageParam?!1:DR(F,k,T)!=null}}var xR=WeakMap?new WeakMap:void 0,AR=({endpointName:e,queryArgs:t})=>{let r="",n=xR?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Yr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Yr(t)&&xR?.set(t,o),r=o}return`${e}(${r})`};function JM(...e){return function(r){let n=Qu(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let h=AR;if("serializeQueryArgs"in m.endpointDefinition){let x=m.endpointDefinition.serializeQueryArgs;h=A=>{let y=x(A);return typeof y=="string"?y:AR({...A,queryArgs:y})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:zu(),extractRehydrationInfo:n,hasRehydrationInfo:Qu(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:h}){if(m)for(let x of m)o.tagTypes.includes(x)||o.tagTypes.push(x);if(h)for(let[x,A]of Object.entries(h))typeof A=="function"?A(Os(a,x)):Object.assign(Os(a,x)||{},A);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let h=m.endpoints({query:x=>({...x,type:hl}),mutation:x=>({...x,type:kR}),infiniteQuery:x=>({...x,type:OR})});for(let[x,A]of Object.entries(h)){if(m.overrideExisting!==!0&&x in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Kt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[x]=A;for(let y of p)y.injectEndpoint(x,A)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Kn(e,...t){return Object.assign(e,...t)}var XM=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,a=null,i=null,{updateSubscriptionOptions:p,unsubscribeQueryResult:f}=e.internalActions,m=(R,b)=>{if(p.match(b)){let{queryCacheKey:P,requestId:F,options:k}=b.payload,T=R.get(P);return T?.has(F)&&T.set(F,k),!0}if(f.match(b)){let{queryCacheKey:P,requestId:F}=b.payload,k=R.get(P);return k&&k.delete(F),!0}if(e.internalActions.removeQueryResult.match(b))return R.delete(b.payload.queryCacheKey),!0;if(t.pending.match(b)){let{meta:{arg:P,requestId:F}}=b,k=Yp(R,P.queryCacheKey,fv);return P.subscribe&&k.set(F,P.subscriptionOptions??k.get(F)??{}),!0}let w=!1;if(t.rejected.match(b)){let{meta:{condition:P,arg:F,requestId:k}}=b;if(P&&F.subscribe){let T=Yp(R,F.queryCacheKey,fv);T.set(k,F.subscriptionOptions??T.get(k)??{}),w=!0}}return w},h=()=>r.currentSubscriptions,y={getSubscriptions:h,getSubscriptionCount:R=>h().get(R)?.size??0,isRequestSubscribed:(R,b)=>!!h()?.get(R)?.get(b)};function C(R){return JSON.parse(JSON.stringify(Object.fromEntries([...R].map(([b,w])=>[b,Object.fromEntries(w)]))))}return(R,b)=>{if(a||(a=C(r.currentSubscriptions)),e.util.resetApiState.match(R))return a={},r.currentSubscriptions.clear(),i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(R))return[!1,y];let w=m(r.currentSubscriptions,R),P=!0;if(w){i||(i=setTimeout(()=>{let T=C(r.currentSubscriptions),[,D]=$y(a,()=>T);b.next(e.internalActions.subscriptionsUpdated(D)),a=T,i=null},500));let F=typeof R.type=="string"&&!!R.type.startsWith(o),k=t.rejected.match(R)&&R.meta.condition&&!!R.meta.arg.subscribe;P=!F&&!k}return[P,!1]}},ZM=2147483647/1e3-1,eV=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i},getRunningQueryThunk:p,mwApi:f})=>{let{removeQueryResult:m,unsubscribeQueryResult:h,cacheEntriesUpserted:x}=t.internalActions,A=Jr(h.match,r.fulfilled,r.rejected,x.match);function y(F){let k=o.currentSubscriptions.get(F);return k?k.size>0:!1}let C={};function R(F){for(let k of F.values())k?.abort?.()}let b=(F,k)=>{let T=k.getState(),D=i(T);if(A(F)){let G;if(x.match(F))G=F.payload.map(L=>L.queryDescription.queryCacheKey);else{let{queryCacheKey:L}=h.match(F)?F.payload:F.meta.arg;G=[L]}w(G,k,D)}if(t.util.resetApiState.match(F)){for(let[G,L]of Object.entries(C))L&&clearTimeout(L),delete C[G];R(o.runningQueries),R(o.runningMutations)}if(n.hasRehydrationInfo(F)){let{queries:G}=n.extractRehydrationInfo(F);w(Object.keys(G),k,D)}};function w(F,k,T){let D=k.getState();for(let G of F){let L=a(D,G);L?.endpointName&&P(G,L.endpointName,k,T)}}function P(F,k,T,D){let L=Os(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let V=Math.max(0,Math.min(L,ZM));if(!y(F)){let Q=C[F];Q&&clearTimeout(Q),C[F]=setTimeout(()=>{if(!y(F)){let j=a(T.getState(),F);j?.endpointName&&T.dispatch(p(j.endpointName,j.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:F}))}delete C[F]},V*1e3)}}return b},CR=new Error("Promise never resolved before cacheEntryRemoved."),tV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Qd(n),m=Qd(o),h=$n(n,o),x={},{removeQueryResult:A,removeMutationResult:y,cacheEntriesUpserted:C}=e.internalActions;function R(T,D,G){let L=x[T];L?.valueResolved&&(L.valueResolved({data:D,meta:G}),delete L.valueResolved)}function b(T){let D=x[T];D&&(delete x[T],D.cacheEntryRemoved())}function w(T){let{arg:D,requestId:G}=T.meta,{endpointName:L,originalArgs:V}=D;return[L,V,G]}let P=(T,D,G)=>{let L=F(T);function V(Q,j,N,_){let q=i(G,j),Y=i(D.getState(),j);!q&&Y&&k(Q,_,j,D,N)}if(n.pending.match(T)){let[Q,j,N]=w(T);V(Q,L,N,j)}else if(C.match(T))for(let{queryDescription:Q,value:j}of T.payload){let{endpointName:N,originalArgs:_,queryCacheKey:q}=Q;V(N,q,T.meta.requestId,_),R(q,j,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[L]){let[j,N,_]=w(T);k(j,N,L,D,_)}}else if(h(T))R(L,T.payload,T.meta.baseQueryMeta);else if(A.match(T)||y.match(T))b(L);else if(e.util.resetApiState.match(T))for(let Q of Object.keys(x))b(Q)};function F(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:A.match(T)?T.payload.queryCacheKey:y.match(T)?gl(T.payload):""}function k(T,D,G,L,V){let Q=Os(r,T),j=Q?.onCacheEntryAdded;if(!j)return;let N={},_=new Promise(Z=>{N.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{N.valueResolved=Z}),_.then(()=>{throw CR})]);q.catch(()=>{}),x[G]=N;let Y=e.endpoints[T].select(Jp(Q)?D:G),H=L.dispatch((Z,ce,he)=>he),ne={...L,getCacheEntry:()=>Y(L.getState()),requestId:V,extra:H,updateCachedData:Jp(Q)?Z=>L.dispatch(e.util.updateQueryData(T,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:_},te=j(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==CR)throw Z})}return P},rV=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},nV=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,h=Jr($n(n),Hu(n)),x=Jr($n(o,n),ya(o,n)),A=[],y=0,C=(w,P)=>{(o.pending.match(w)||n.pending.match(w))&&y++,x(w)&&(y=Math.max(0,y-1)),h(w)?b(qR(w,"invalidatesTags",r,i),P):x(w)?b([],P):a.util.invalidateTags.match(w)&&b(vv(w.payload,void 0,void 0,void 0,void 0,i),P)};function R(){return y>0}function b(w,P){let F=P.getState(),k=F[e];if(A.push(...w),k.config.invalidationBehavior==="delayed"&&R())return;let T=A;if(A=[],T.length===0)return;let D=a.util.selectInvalidatedBy(F,T);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:L}of G){let V=k.queries[L],Q=Yp(f.currentSubscriptions,L,fv);V&&(Q.size===0?P.dispatch(m({queryCacheKey:L})):V.status!==Yn&&P.dispatch(p(V)))}})}return C},oV=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(b,w)=>{(r.internalActions.updateSubscriptionOptions.match(b)||r.internalActions.unsubscribeQueryResult.match(b))&&h(b.payload.queryCacheKey,w),(t.pending.match(b)||t.rejected.match(b)&&b.meta.condition)&&h(b.meta.arg.queryCacheKey,w),(t.fulfilled.match(b)||t.rejected.match(b)&&!b.meta.condition)&&x(b.meta.arg,w),r.util.resetApiState.match(b)&&(C(),f&&(clearTimeout(f),f=null),p.clear())};function h(b,w){p.add(b),f||(f=setTimeout(()=>{for(let P of p)A({queryCacheKey:P},w);p.clear(),f=null},0))}function x({queryCacheKey:b},w){let P=w.getState()[e],F=P.queries[b],k=i.get(b);if(!F||F.status===Yn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=R(k);if(!Number.isFinite(T))return;let G=a.get(b);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let L=Date.now()+T;a.set(b,{nextPollTimestamp:L,pollingInterval:T,timeout:setTimeout(()=>{(P.config.focused||!D)&&w.dispatch(n(F)),x({queryCacheKey:b},w)},T)})}function A({queryCacheKey:b},w){let F=w.getState()[e].queries[b],k=i.get(b);if(!F||F.status===Yn)return;let{lowestPollingInterval:T}=R(k);if(!Number.isFinite(T)){y(b);return}let D=a.get(b),G=Date.now()+T;(!D||G<D.nextPollTimestamp)&&x({queryCacheKey:b},w)}function y(b){let w=a.get(b);w?.timeout&&clearTimeout(w.timeout),a.delete(b)}function C(){for(let b of a.keys())y(b)}function R(b=new Map){let w=!1,P=Number.POSITIVE_INFINITY;for(let F of b.values())F.pollingInterval&&(P=Math.min(F.pollingInterval,P),w=F.skipPollingIfUnfocused||w);return{lowestPollingInterval:P,skipPollingIfUnfocused:w}}return m},aV=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Ud(r,n),a=ya(r,n),i=$n(r,n),p={};return(m,h)=>{if(o(m)){let{requestId:x,arg:{endpointName:A,originalArgs:y}}=m.meta,C=Os(t,A),R=C?.onQueryStarted;if(R){let b={},w=new Promise((T,D)=>{b.resolve=T,b.reject=D});w.catch(()=>{}),p[x]=b;let P=e.endpoints[A].select(Jp(C)?y:x),F=h.dispatch((T,D,G)=>G),k={...h,getCacheEntry:()=>P(h.getState()),requestId:x,extra:F,updateCachedData:Jp(C)?T=>h.dispatch(e.util.updateQueryData(A,y,T)):void 0,queryFulfilled:w};R(y,k)}}else if(i(m)){let{requestId:x,baseQueryMeta:A}=m.meta;p[x]?.resolve({data:m.payload,meta:A}),delete p[x]}else if(a(m)){let{requestId:x,rejectedWithValue:A,baseQueryMeta:y}=m.meta;p[x]?.reject({error:m.payload??m.error,isUnhandledError:!A,meta:y}),delete p[x]}}},iV=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{yv.match(f)&&p(m,"refetchOnFocus"),Sv.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let h=f.getState()[e],x=h.queries,A=o.currentSubscriptions;t.batch(()=>{for(let y of A.keys()){let C=x[y],R=A.get(y);if(!R||!C)continue;let b=[...R.values()];(b.some(P=>P[m]===!0)||b.every(P=>P[m]===void 0)&&h.config[m])&&(R.size===0?f.dispatch(a({queryCacheKey:y})):C.status!==Yn&&f.dispatch(n(C)))}})}return i};function sV(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:I(`${t}/invalidateTags`)},f=A=>A.type.startsWith(`${t}/`),m=[rV,eV,nV,oV,tV,aV];return{middleware:A=>{let y=!1,C=a(A.dispatch),R={...e,internalState:C,refetchQuery:x,isThisApiSliceAction:f,mwApi:A},b=m.map(F=>F(R)),w=XM(R),P=iV(R);return F=>k=>{if(!Tu(k))return F(k);y||(y=!0,A.dispatch(n.internalActions.middlewareRegistered(i)));let T={...A,next:F},D=A.getState(),[G,L]=w(k,T,D),V;if(G?V=F(k):V=L,A.getState()[t]&&(P(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let Q of b)Q(k,T,D);return V}},actions:p};function x(A){return e.api.endpoints[A.endpointName].initiate(A.originalArgs,{subscribe:!1,forceRefetch:!0})}}var bR=Symbol(),cV=({createSelector:e=Xe}={})=>({name:bR,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:h,onSchemaFailure:x,catchSchemaFailure:A,skipSchemaValidation:y},C){kC();let R=Re=>(typeof process<"u",Re);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Sv,onOffline:PR,onFocus:yv,onFocusLost:TR},util:{}});let b=YM({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:w,selectCachedArgsForQuery:P,buildQuerySelector:F,buildInfiniteQuerySelector:k,buildMutationSelector:T}=b;Kn(t.util,{selectInvalidatedBy:w,selectCachedArgsForQuery:P});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,patchQueryData:V,updateQueryData:Q,upsertQueryData:j,prefetch:N,buildMatchThunkActions:_}=WM({baseQuery:r,reducerPath:o,context:C,api:t,serializeQueryArgs:a,assertTagType:R,selectors:b,onSchemaFailure:x,catchSchemaFailure:A,skipSchemaValidation:y}),{reducer:q,actions:Y}=KM({context:C,queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,serializeQueryArgs:a,reducerPath:o,assertTagType:R,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:h}});Kn(t.util,{patchQueryData:V,updateQueryData:Q,upsertQueryData:j,prefetch:N,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Kn(t.internalActions,Y);let H=new WeakMap,ne=Re=>Yp(H,Re,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ce,getRunningMutationThunk:he,getRunningMutationsThunk:qe,getRunningQueriesThunk:Je,getRunningQueryThunk:Le}=zM({queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:C,getInternalState:ne});Kn(t.util,{getRunningMutationThunk:he,getRunningMutationsThunk:qe,getRunningQueryThunk:Le,getRunningQueriesThunk:Je});let{middleware:He,actions:ze}=sV({reducerPath:o,context:C,queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,assertTagType:R,selectors:b,getRunningQueryThunk:Le,getInternalState:ne});return Kn(t.util,ze),Kn(t,{reducer:q,middleware:He}),{name:bR,injectEndpoint(Re,be){var ut;let Fe=(ut=t.endpoints)[Re]??(ut[Re]={});Zp(be)&&Kn(Fe,{name:Re,select:F(Re,be),initiate:te(Re,be)},_(D,Re)),GM(be)&&Kn(Fe,{name:Re,select:T(),initiate:ce(Re)},_(L,Re)),ef(be)&&Kn(Fe,{name:Re,select:k(Re,be),initiate:Z(Re,be)},_(D,Re))}}}}),VR=JM(cV());d();c();l();u();d();c();l();u();var Ta=e=>e.query,jR=e=>e.query?.enableQuerySyntax;var LR=Xe(e=>Ta(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})),tf=Xe(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var rf=e=>{if(e==="yes")return!0;if(e==="no")return!1},uV=()=>J("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function lV(e,t){return J({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??We(n),a=tl(n,e);return!o||!a?null:r.makeGeneratedAnswerCitationClick(mw(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:gw(a)})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=tl(r,e);return{answerId:t??We(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function dV(e,t,r){return J({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??We(o),i=tl(o,e);return!a||!i?null:n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=tl(n,e);return{answerId:r??We(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function pV(e){return J({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??We(r);return n?t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"like"})})}function fV(e){return J({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??We(r);return n?t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"dislike"})})}var mV=e=>J({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=We(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=We(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:rf(o),documented:rf(a),correctTopic:rf(p),hallucinationFree:rf(i)},additionalNotes:m,correctAnswerUrl:f}}}),Jn=(e,t,r,n)=>J({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(o,a)=>{let i=t??We(a),p=e?r??(!a.generatedAnswer?.answer||!a.generatedAnswer?.answer.length):void 0;return i?o.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:i,answerGenerated:e,answerTextIsEmpty:p,...(n&&{conversationId:n})}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:o=>({answerId:t??We(o)??"",answerGenerated:e??!1})}),Mo=e=>J({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),gV=()=>J({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"show"})}),hV=()=>J({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"hide"})}),yV=()=>J({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"expand"})}),SV=()=>J({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"collapse"})});function vV(e){return J({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??We(r);return n?t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"copyToClipboard"})})}var Ns={logCopyGeneratedAnswer:vV,logGeneratedAnswerHideAnswers:hV,logGeneratedAnswerShowAnswers:gV,logGeneratedAnswerStreamEnd:Jn,logGeneratedAnswerFeedback:mV,logDislikeGeneratedAnswer:fV,logLikeGeneratedAnswer:pV,logHoverCitation:dV,logOpenGeneratedAnswerSource:lV,logRetryGeneratedAnswer:uV,logGeneratedAnswerExpand:yV,logGeneratedAnswerCollapse:SV};d();c();l();u();d();c();l();u();var UR=Xe(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 QR=e=>e.context;d();c();l();u();var xv=e=>e.pipeline;d();c();l();u();var Av=e=>e.searchHub;d();c();l();u();var Yt=Xe(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),lae=Xe(e=>e,e=>{let t=Yt(e);return t&&e?e[t].expression:""});d();c();l();u();var BR=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var GR=e=>e.excerptLength?.length;d();c();l();u();var sn=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,$R=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var HR=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var zR=e=>e.sortCriteria;var WR=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Pt(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function WR(_x127){return _ref45.apply(this,arguments)}}(),KR=(e,t)=>{let r=Ta(e)?.q,{aq:n,cq:o,dq:a,lq:i}=AV(e),p=QR(e),f=Lr(e.configuration.analytics,t,{actionCause:sv(e)}),m=Av(e),h=xv(e),x=kS(e)??[],A=JR(e),y=Yt(e.tabSet)||"default",C=TS(e),R=rw(e),b=t.referrer||"",w=$R(e),P=zR(e),F=xV(e),k=GR(e),T=HR(e),D=BR(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:jR(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:x}},...(m?.length&&{searchHub:m}),...(h?.length&&{pipeline:h}),...(A.length&&{facets:A}),...(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:av(e),firstResult:e.pagination.firstResult}),tab:y,locale:C,timezone:R,...(e.debug!==void 0&&{debug:e.debug}),referrer:b,...F,...(T??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:P,...(w&&{facetOptions:w}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},YR=(e,t)=>{let r=Ta(e)?.q,n=JR(e),o=Lr(e.configuration.analytics,t,{actionCause:sv(e)}),a=TS(e),i=Av(e),p=xv(e),f=kS(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:f,...(i?.length&&{searchHub:i}),...(p?.length&&{pipeline:p}),...o,locale:a}},JR=e=>Hp(e)?.map(t=>XS(t,JS())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),xV=e=>({actionsHistory:e.configuration.analytics.enabled?Jt.getInstance().getHistory():[]}),AV=e=>{let t=UR(e),r=iv(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var nf=["searching","thinking","answering"];function of(e){return e.toLowerCase()}function Cv(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var XR=["text/plain","text/markdown"];var _s=new U({required:!0}),ZR=new U,Ds=new le({required:!0}),bv={id:_s,title:_s,uri:_s,permanentid:_s,clickUri:ZR},af=new U({required:!0,constrainTo:XR}),eF=new U({required:!0,constrainTo:nf}),tF=e=>({...e,name:of(e.name)}),qs=I("generatedAnswer/setIsVisible",e=>O(e,Ds)),Ms=I("generatedAnswer/setAnswerId",e=>O(e,W)),sf=I("generatedAnswer/setAnswerGenerationMode",e=>O(e,new U({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),yl=I("generatedAnswer/setIsEnabled",e=>O(e,Ds)),ka=I("generatedAnswer/updateMessage",e=>O(e,{textDelta:_s})),Oa=I("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new X({values:bv})})})),Na=I("generatedAnswer/updateError",e=>O(e,{message:ZR,code:new re({min:0})})),dr=I("generatedAnswer/resetAnswer"),cf=I("generatedAnswer/like"),uf=I("generatedAnswer/dislike"),lf=I("generatedAnswer/feedbackModal/open"),Sl=I("generatedAnswer/expand"),df=I("generatedAnswer/collapse"),pf=I("generatedAnswer/setId",e=>O(e,{id:new U({required:!0})})),ff=I("generatedAnswer/feedbackModal/close"),Vs=I("generatedAnswer/sendFeedback"),cn=I("generatedAnswer/setIsLoading",e=>O(e,Ds)),Pa=I("generatedAnswer/setIsStreaming",e=>O(e,Ds)),_a=I("generatedAnswer/setAnswerContentFormat",e=>O(e,af)),mf=I("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:af,default:["text/plain"]})})),gf=I("knowledge/updateAnswerConfigurationId",e=>O(e,_s)),hf=I("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,xd)),vl=I("generatedAnswer/setIsAnswerGenerated",e=>O(e,Ds)),Da=I("generatedAnswer/setCannotAnswer",e=>O(e,Ds)),wv=I("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new X({}))),yf=I("generatedAnswer/startStep",e=>O(tF(e),{name:eF,startedAt:new re({min:0,required:!0})})),Sf=I("generatedAnswer/finishStep",e=>O(tF(e),{name:eF,finishedAt:new re({min:0,required:!0})})),rF=xe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield WR(r),h=(y,C)=>{switch(y){case"genqa.headerMessageType":{let R=JSON.parse(C);n(_a(R.contentFormat));break}case"genqa.messageType":n(ka(JSON.parse(C)));break;case"genqa.citationsType":n(Oa(JSON.parse(C)));break;case"genqa.endOfStreamType":{let R=JSON.parse(C).answerGenerated,b=a().generatedAnswer.answerId,w=p.length!==0&&!R,P=R?!a().generatedAnswer.answer?.length:void 0;n(Da(w)),n(Pa(!1)),n(vl(R)),n(Jn(R,b,P)),n(Mo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${y}"`)}};n(cn(!0));let x=y=>y.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,A=o.streamingClient?.streamGeneratedAnswer(m,{write:y=>{x(m)&&(n(cn(!1)),y.payload&&y.payloadType&&h(y.payloadType,y.payload))},abort:y=>{x(m)&&n(Na(y))},close:()=>{x(m)&&n(Pa(!1))},resetAnswer:()=>{x(m)&&n(dr())}});A?f(A):n(cn(!1))});return function(_x128,_x129){return _ref46.apply(this,arguments)}}()),vf=xe("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(dr());let a=t();if(a.generatedAnswer.answerConfigurationId){let i=KR(a,n);r(wv(i)),yield r(xf(i))}else 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(_x130,_x131){return _ref47.apply(this,arguments)}}());d();c();l();u();var CV=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Pt(i,a);return{data:RR({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(x){if(x instanceof String)throw new Error("The provided 'request' must be a Request object.");let A=x.url,y={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(C=>{y[C]=x[C]}),y.duplex="half",y.body=yield x.text(),S(A,y)});return function fetchFn(_x135){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(m){return{error:m}}});return function CV(_x132,_x133,_x134){return _ref48.apply(this,arguments)}}(),Af=VR({reducerPath:"answer",baseQuery:ER(CV,{maxRetries:3}),endpoints:()=>({})});var bV=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},wV=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},RV=(e,t)=>{e.citations=t.citations},FV=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},EV=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},IV=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&EV(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(bV(t,o),r(_a(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(wV(t,o),r(ka({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(RV(t,o),r(Oa({citations:o.citations})));break;case"genqa.endOfStreamType":{FV(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.length:void 0;r(Jn(i,a,p)),r(Mo());break}}},TV=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},qa=Af.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(_x136,_x137){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:h,accessToken:x}=i,A=Pt(m,h),y=TV(A,m,p.answerConfigurationId,f?.insightId);yield pd(y,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${x}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref50=_asyncToGenerator(function*(C){let R=C.headers.get("x-answer-id");R&&o(b=>{b.answerId=R,a(Ms(R))})});return function onopen(_x138){return _ref50.apply(this,arguments)}}(),onmessage:C=>{o(R=>{IV(C,R,a)})},onerror:C=>{throw C},onclose:()=>{o(C=>{a(Da(!C.generated))})}})}).apply(this,arguments)}})})}),xf=e=>qa.endpoints.getAnswer.initiate(e),Rv=e=>{let t=tf(e);return qa.endpoints.getAnswer.select(t??Ia)(e)};d();c();l();u();var nF=ae(vo,e=>e);d();c();l();u();function PV(e){let t=e.payload?.analyticsAction;return oF(e)&&!de(t)}function oF(e){return"type"in e}var aF=e=>t=>r=>{let n;PV(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return oF(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 js=I("tab/register",e=>{let t=new X({values:{id:W,expression:Qe}});return O(e,t)}),yt=I("tab/updateActiveTab",e=>O(e,W));d();c();l();u();var Cf=Mr(Ep(),1),cF=Mr(iF(),1),uF=Mr(sF(),1);Cf.default.extend(uF.default);Cf.default.extend(cF.default);var Ls=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Cf.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var kV=/(^|; )Coveo-Pendragon=([^;]*)/,OV=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function lF(){return typeof window>"u"?!1:kV.exec(document.cookie)?.pop()||null}function dF(){return typeof window>"u"?!1:OV.test(document.cookie)}var bf=ae(Ls(),e=>e.addCase(tn,(t,r)=>{NV(t,r.payload)}).addCase(Sr,(t,r)=>{_V(t,r.payload)}).addCase(wo,(t,r)=>{DV(t,r.payload)}).addCase(as,t=>{t.analytics.enabled=!1}).addCase(is,t=>{t.analytics.enabled=!0}).addCase(Ap,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Cp,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(yt,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ss,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(De,(t,r)=>{de(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(bp,(t,{payload:r})=>{qV(t,r)}));function NV(e,t){de(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",de(t.organizationId)||(e.organizationId=t.organizationId)}function _V(e,t){de(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),de(t.locale)||(e.search.locale=t.locale),de(t.timezone)||(e.search.timezone=t.timezone),de(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function DV(e,t){de(t.enabled)||(e.analytics.enabled=t.enabled),de(t.originContext)||(e.analytics.originContext=t.originContext),de(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),de(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),de(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),de(t.trackingId)||(e.analytics.trackingId=t.trackingId),de(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),de(t.source)||(e.analytics.source=t.source);try{let r=lF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}de(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),de(t.anonymous)||(e.analytics.anonymous=t.anonymous),de(t.deviceId)||(e.analytics.deviceId=t.deviceId),de(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),de(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function qV(e,t){e.knowledge.agentId=t;try{let r=dF();de(r)||(e.knowledge.debugAgentSession=!0)}catch{}}var pe=bf;d();c();l();u();function MV(e){return e.instantlyCallable}var pF=()=>e=>t=>e(MV(t)?t():t);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 Dt=[];for(let e=0;e<256;++e)Dt.push((e+256).toString(16).slice(1));function fF(e,t=0){return(Dt[e[t+0]]+Dt[e[t+1]]+Dt[e[t+2]]+Dt[e[t+3]]+"-"+Dt[e[t+4]]+Dt[e[t+5]]+"-"+Dt[e[t+6]]+Dt[e[t+7]]+"-"+Dt[e[t+8]]+Dt[e[t+9]]+"-"+Dt[e[t+10]]+Dt[e[t+11]]+Dt[e[t+12]]+Dt[e[t+13]]+Dt[e[t+14]]+Dt[e[t+15]]).toLowerCase()}d();c();l();u();var Pv,VV=new Uint8Array(16);function kv(){if(!Pv){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Pv=crypto.getRandomValues.bind(crypto)}return Pv(VV)}d();c();l();u();d();c();l();u();var jV=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ov={randomUUID:jV};function LV(e,t,r){if(Ov.randomUUID&&!t&&!e)return Ov.randomUUID();e=e||{};let n=e.random??e.rng?.()??kv();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 fF(n)}var Vo=LV;d();c();l();u();d();c();l();u();var E={};Su(E,{BRAND:()=>pj,DIRTY:()=>Ma,EMPTY_PATH:()=>GV,INVALID:()=>Ae,NEVER:()=>Yj,OK:()=>Ut,ParseStatus:()=>qt,Schema:()=>Te,ZodAny:()=>Uo,ZodArray:()=>to,ZodBigInt:()=>ja,ZodBoolean:()=>La,ZodBranded:()=>Al,ZodCatch:()=>Ja,ZodDate:()=>Ua,ZodDefault:()=>Ya,ZodDiscriminatedUnion:()=>Ff,ZodEffects:()=>Fr,ZodEnum:()=>Wa,ZodError:()=>er,ZodFirstPartyTypeKind:()=>Ce,ZodFunction:()=>If,ZodIntersection:()=>$a,ZodIssueCode:()=>ee,ZodLazy:()=>Ha,ZodLiteral:()=>za,ZodMap:()=>Hs,ZodNaN:()=>Ws,ZodNativeEnum:()=>Ka,ZodNever:()=>Br,ZodNull:()=>Ba,ZodNullable:()=>dn,ZodNumber:()=>Va,ZodObject:()=>tr,ZodOptional:()=>wr,ZodParsedType:()=>ue,ZodPipeline:()=>Cl,ZodPromise:()=>Qo,ZodReadonly:()=>Xa,ZodRecord:()=>Ef,ZodSchema:()=>Te,ZodSet:()=>zs,ZodString:()=>Lo,ZodSymbol:()=>Gs,ZodTransformer:()=>Fr,ZodTuple:()=>ln,ZodType:()=>Te,ZodUndefined:()=>Qa,ZodUnion:()=>Ga,ZodUnknown:()=>eo,ZodVoid:()=>$s,addIssueToContext:()=>se,any:()=>Aj,array:()=>Rj,bigint:()=>hj,boolean:()=>wF,coerce:()=>Kj,custom:()=>AF,date:()=>yj,datetimeRegex:()=>vF,defaultErrorMap:()=>Xn,discriminatedUnion:()=>Tj,effect:()=>Uj,enum:()=>Vj,function:()=>Dj,getErrorMap:()=>Us,getParsedType:()=>un,instanceof:()=>mj,intersection:()=>Pj,isAborted:()=>wf,isAsync:()=>Qs,isDirty:()=>Rf,isValid:()=>jo,late:()=>fj,lazy:()=>qj,literal:()=>Mj,makeIssue:()=>xl,map:()=>Nj,nan:()=>gj,nativeEnum:()=>jj,never:()=>bj,null:()=>xj,nullable:()=>Bj,number:()=>bF,object:()=>Fj,objectUtil:()=>Nv,oboolean:()=>Wj,onumber:()=>zj,optional:()=>Qj,ostring:()=>Hj,pipeline:()=>$j,preprocess:()=>Gj,promise:()=>Lj,quotelessJson:()=>UV,record:()=>Oj,set:()=>_j,setErrorMap:()=>BV,strictObject:()=>Ej,string:()=>CF,symbol:()=>Sj,transformer:()=>Uj,tuple:()=>kj,undefined:()=>vj,union:()=>Ij,unknown:()=>Cj,util:()=>Ne,void:()=>wj});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Ne;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(Ne||(Ne={}));var Nv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Nv||(Nv={}));var ue=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),un=e=>{switch(typeof e){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return Number.isNaN(e)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(e)?ue.array:e===null?ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ue.promise:typeof Map<"u"&&e instanceof Map?ue.map:typeof Set<"u"&&e instanceof Set?ue.set:typeof Date<"u"&&e instanceof Date?ue.date:ue.object;default:return ue.unknown}};var ee=Ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),UV=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),er=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=e=>new er(e);var QV=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ne.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ne.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ne.assertNever(e)}return{message:r}},Xn=QV;var mF=Xn;function BV(e){mF=e}function Us(){return mF}d();c();l();u();var xl=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},GV=[];function se(e,t){let r=Us(),n=xl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Xn?void 0:Xn].filter(o=>!!o)});e.common.issues.push(n)}var qt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Ae;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return Ae;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},Ae=Object.freeze({status:"aborted"}),Ma=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),wf=e=>e.status==="aborted",Rf=e=>e.status==="dirty",jo=e=>e.status==="valid",Qs=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(fe||(fe={}));var Rr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},gF=(e,t)=>{if(jo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(e.common.issues);return this._error=r,this._error}}};function Ee(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Te=class{get description(){return this._def.description}_getType(t){return un(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:un(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qt,ctx:{common:t.parent.common,data:t.data,parsedType:un(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Qs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:un(t)},o=this._parseSync({data:t,path:n.path,parent:n});return gF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:un(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return jo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>jo(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:un(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Qs(o)?o:Promise.resolve(o);return gF(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:ee.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Fr({schema:this,typeName:Ce.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return wr.create(this,this._def)}nullable(){return dn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return to.create(this)}promise(){return Qo.create(this,this._def)}or(t){return Ga.create([this,t],this._def)}and(t){return $a.create(this,t,this._def)}transform(t){return new Fr({...Ee(this._def),schema:this,typeName:Ce.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ya({...Ee(this._def),innerType:this,defaultValue:r,typeName:Ce.ZodDefault})}brand(){return new Al({typeName:Ce.ZodBranded,type:this,...Ee(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Ee(this._def),innerType:this,catchValue:r,typeName:Ce.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Cl.create(this,t)}readonly(){return Xa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$V=/^c[^\s-]{8,}$/i,HV=/^[0-9a-z]+$/,zV=/^[0-9A-HJKMNP-TV-Z]{26}$/i,WV=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,KV=/^[a-z0-9_-]{21}$/i,YV=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,JV=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,XV=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_v,ej=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,rj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ij=new RegExp(`^${yF}$`);function SF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function sj(e){return new RegExp(`^${SF(e)}$`)}function vF(e){let t=`${yF}T${SF(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function cj(e,t){return!!((t==="v4"||!t)&&ej.test(e)||(t==="v6"||!t)&&rj.test(e))}function uj(e,t){if(!YV.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function lj(e,t){return!!((t==="v4"||!t)&&tj.test(e)||(t==="v6"||!t)&&nj.test(e))}var Lo=class e extends Te{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){let a=this._getOrReturnCtx(t);return se(a,{code:ee.invalid_type,expected:ue.string,received:a.parsedType}),Ae}let n=new qt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?se(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&se(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")XV.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"email",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")_v||(_v=new RegExp(ZV,"u")),_v.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"emoji",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")WV.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"uuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")KV.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"nanoid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")$V.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")HV.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid2",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")zV.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ulid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),se(o,{validation:"url",code:ee.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"regex",code:ee.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),se(o,{code:ee.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:ee.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:ee.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?vF(a).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:ee.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ij.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?sj(a).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:ee.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?JV.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?cj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ip",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?uj(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"jwt",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?lj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cidr",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?oj.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?aj.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64url",code:ee.invalid_string,message:a.message}),n.dirty()):Ne.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ee.invalid_string,...fe.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...fe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...fe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...fe.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...fe.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...fe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...fe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...fe.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...fe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...fe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...fe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...fe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...fe.errToObj(r)})}nonempty(t){return this.min(1,fe.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Lo.create=e=>new Lo({checks:[],typeName:Ce.ZodString,coerce:e?.coerce??!1,...Ee(e)});function dj(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var Va=class e extends Te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ue.number){let a=this._getOrReturnCtx(t);return se(a,{code:ee.invalid_type,expected:ue.number,received:a.parsedType}),Ae}let n,o=new qt;for(let a of this._def.checks)a.kind==="int"?Ne.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),se(n,{code:ee.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:ee.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?dj(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),se(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),se(n,{code:ee.not_finite,message:a.message}),o.dirty()):Ne.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ne.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Va.create=e=>new Va({checks:[],typeName:Ce.ZodNumber,coerce:e?.coerce||!1,...Ee(e)});var ja=class e extends Te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ue.bigint)return this._getInvalidInput(t);let n,o=new qt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:ee.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:ee.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),se(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Ne.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return se(r,{code:ee.invalid_type,expected:ue.bigint,received:r.parsedType}),Ae}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};ja.create=e=>new ja({checks:[],typeName:Ce.ZodBigInt,coerce:e?.coerce??!1,...Ee(e)});var La=class extends Te{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){let n=this._getOrReturnCtx(t);return se(n,{code:ee.invalid_type,expected:ue.boolean,received:n.parsedType}),Ae}return Ut(t.data)}};La.create=e=>new La({typeName:Ce.ZodBoolean,coerce:e?.coerce||!1,...Ee(e)});var Ua=class e extends Te{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){let a=this._getOrReturnCtx(t);return se(a,{code:ee.invalid_type,expected:ue.date,received:a.parsedType}),Ae}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return se(a,{code:ee.invalid_date}),Ae}let n=new qt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:ee.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Ne.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:fe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:fe.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Ua.create=e=>new Ua({checks:[],coerce:e?.coerce||!1,typeName:Ce.ZodDate,...Ee(e)});var Gs=class extends Te{_parse(t){if(this._getType(t)!==ue.symbol){let n=this._getOrReturnCtx(t);return se(n,{code:ee.invalid_type,expected:ue.symbol,received:n.parsedType}),Ae}return Ut(t.data)}};Gs.create=e=>new Gs({typeName:Ce.ZodSymbol,...Ee(e)});var Qa=class extends Te{_parse(t){if(this._getType(t)!==ue.undefined){let n=this._getOrReturnCtx(t);return se(n,{code:ee.invalid_type,expected:ue.undefined,received:n.parsedType}),Ae}return Ut(t.data)}};Qa.create=e=>new Qa({typeName:Ce.ZodUndefined,...Ee(e)});var Ba=class extends Te{_parse(t){if(this._getType(t)!==ue.null){let n=this._getOrReturnCtx(t);return se(n,{code:ee.invalid_type,expected:ue.null,received:n.parsedType}),Ae}return Ut(t.data)}};Ba.create=e=>new Ba({typeName:Ce.ZodNull,...Ee(e)});var Uo=class extends Te{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}};Uo.create=e=>new Uo({typeName:Ce.ZodAny,...Ee(e)});var eo=class extends Te{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ut(t.data)}};eo.create=e=>new eo({typeName:Ce.ZodUnknown,...Ee(e)});var Br=class extends Te{_parse(t){let r=this._getOrReturnCtx(t);return se(r,{code:ee.invalid_type,expected:ue.never,received:r.parsedType}),Ae}};Br.create=e=>new Br({typeName:Ce.ZodNever,...Ee(e)});var $s=class extends Te{_parse(t){if(this._getType(t)!==ue.undefined){let n=this._getOrReturnCtx(t);return se(n,{code:ee.invalid_type,expected:ue.void,received:n.parsedType}),Ae}return Ut(t.data)}};$s.create=e=>new $s({typeName:Ce.ZodVoid,...Ee(e)});var to=class e extends Te{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ue.array)return se(r,{code:ee.invalid_type,expected:ue.array,received:r.parsedType}),Ae;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(se(r,{code:i?ee.too_big:ee.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(se(r,{code:ee.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(se(r,{code:ee.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Rr(r,i,r.path,p)))).then(i=>qt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Rr(r,i,r.path,p)));return qt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:fe.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:fe.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:fe.toString(r)}})}nonempty(t){return this.min(1,t)}};to.create=(e,t)=>new to({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ce.ZodArray,...Ee(t)});function Bs(e){if(e instanceof tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=wr.create(Bs(n))}return new tr({...e._def,shape:()=>t})}else return e instanceof to?new to({...e._def,type:Bs(e.element)}):e instanceof wr?wr.create(Bs(e.unwrap())):e instanceof dn?dn.create(Bs(e.unwrap())):e instanceof ln?ln.create(e.items.map(t=>Bs(t))):e}var tr=class e extends Te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ne.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ue.object){let m=this._getOrReturnCtx(t);return se(m,{code:ee.invalid_type,expected:ue.object,received:m.parsedType}),Ae}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Br&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let h=a[m],x=o.data[m];f.push({key:{status:"valid",value:m},value:h._parse(new Rr(o,x,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof Br){let m=this._def.unknownKeys;if(m==="passthrough")for(let h of p)f.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(m==="strict")p.length>0&&(se(o,{code:ee.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let h of p){let x=o.data[h];f.push({key:{status:"valid",value:h},value:m._parse(new Rr(o,x,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let h of f){let x=yield h.key,A=yield h.value;m.push({key:x,value:A,alwaysSet:h.alwaysSet})}return m})).then(m=>qt.mergeObjectSync(n,m)):qt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return fe.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:fe.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ce.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Ne.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Ne.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Bs(this)}partial(t){let r={};for(let n of Ne.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Ne.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof wr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return xF(Ne.objectKeys(this.shape))}};tr.create=(e,t)=>new tr({shape:()=>e,unknownKeys:"strip",catchall:Br.create(),typeName:Ce.ZodObject,...Ee(t)});tr.strictCreate=(e,t)=>new tr({shape:()=>e,unknownKeys:"strict",catchall:Br.create(),typeName:Ce.ZodObject,...Ee(t)});tr.lazycreate=(e,t)=>new tr({shape:e,unknownKeys:"strip",catchall:Br.create(),typeName:Ce.ZodObject,...Ee(t)});var Ga=class extends Te{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new er(p.ctx.common.issues));return se(r,{code:ee.invalid_union,unionErrors:i}),Ae}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x139){return _ref52.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},h=f._parseSync({data:r.data,path:r.path,parent:m});if(h.status==="valid")return h;h.status==="dirty"&&!a&&(a={result:h,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new er(f));return se(r,{code:ee.invalid_union,unionErrors:p}),Ae}}get options(){return this._def.options}};Ga.create=(e,t)=>new Ga({options:e,typeName:Ce.ZodUnion,...Ee(t)});var Zn=e=>e instanceof Ha?Zn(e.schema):e instanceof Fr?Zn(e.innerType()):e instanceof za?[e.value]:e instanceof Wa?e.options:e instanceof Ka?Ne.objectValues(e.enum):e instanceof Ya?Zn(e._def.innerType):e instanceof Qa?[void 0]:e instanceof Ba?[null]:e instanceof wr?[void 0,...Zn(e.unwrap())]:e instanceof dn?[null,...Zn(e.unwrap())]:e instanceof Al||e instanceof Xa?Zn(e.unwrap()):e instanceof Ja?Zn(e._def.innerType):[],Ff=class e extends Te{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.object)return se(r,{code:ee.invalid_type,expected:ue.object,received:r.parsedType}),Ae;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(se(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=Zn(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:Ce.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Ee(n)})}};function Dv(e,t){let r=un(e),n=un(t);if(e===t)return{valid:!0,data:e};if(r===ue.object&&n===ue.object){let o=Ne.objectKeys(t),a=Ne.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=Dv(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===ue.array&&n===ue.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=Dv(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===ue.date&&n===ue.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var $a=class extends Te{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(wf(a)||wf(i))return Ae;let p=Dv(a.value,i.value);return p.valid?((Rf(a)||Rf(i))&&r.dirty(),{status:r.value,value:p.data}):(se(n,{code:ee.invalid_intersection_types}),Ae)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};$a.create=(e,t,r)=>new $a({left:e,right:t,typeName:Ce.ZodIntersection,...Ee(r)});var ln=class e extends Te{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.array)return se(n,{code:ee.invalid_type,expected:ue.array,received:n.parsedType}),Ae;if(n.data.length<this._def.items.length)return se(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ae;!this._def.rest&&n.data.length>this._def.items.length&&(se(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Rr(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>qt.mergeArray(r,i)):qt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ln.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ln({items:e,typeName:Ce.ZodTuple,rest:null,...Ee(t)})};var Ef=class e extends Te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.object)return se(n,{code:ee.invalid_type,expected:ue.object,received:n.parsedType}),Ae;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Rr(n,p,n.path,p)),value:i._parse(new Rr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?qt.mergeObjectAsync(r,o):qt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Te?new e({keyType:t,valueType:r,typeName:Ce.ZodRecord,...Ee(n)}):new e({keyType:Lo.create(),valueType:t,typeName:Ce.ZodRecord,...Ee(r)})}},Hs=class extends Te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.map)return se(n,{code:ee.invalid_type,expected:ue.map,received:n.parsedType}),Ae;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Rr(n,p,n.path,[m,"key"])),value:a._parse(new Rr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,h=yield f.value;if(m.status==="aborted"||h.status==="aborted")return Ae;(m.status==="dirty"||h.status==="dirty")&&r.dirty(),p.set(m.value,h.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,h=f.value;if(m.status==="aborted"||h.status==="aborted")return Ae;(m.status==="dirty"||h.status==="dirty")&&r.dirty(),p.set(m.value,h.value)}return{status:r.value,value:p}}}};Hs.create=(e,t,r)=>new Hs({valueType:t,keyType:e,typeName:Ce.ZodMap,...Ee(r)});var zs=class e extends Te{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.set)return se(n,{code:ee.invalid_type,expected:ue.set,received:n.parsedType}),Ae;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(se(n,{code:ee.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(se(n,{code:ee.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let h of f){if(h.status==="aborted")return Ae;h.status==="dirty"&&r.dirty(),m.add(h.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Rr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:fe.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:fe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};zs.create=(e,t)=>new zs({valueType:e,minSize:null,maxSize:null,typeName:Ce.ZodSet,...Ee(t)});var If=class e extends Te{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.function)return se(r,{code:ee.invalid_type,expected:ue.function,received:r.parsedType}),Ae;function n(p,f){return xl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Us(),Xn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return xl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Us(),Xn].filter(m=>!!m),issueData:{code:ee.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Qo){let p=this;return Ut(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new er([]),h=yield p._def.args.parseAsync(f,a).catch(y=>{throw m.addIssue(n(f,y)),m}),x=yield Reflect.apply(i,this,h);return yield p._def.returns._def.type.parseAsync(x,a).catch(y=>{throw m.addIssue(o(x,y)),m})}))}else{let p=this;return Ut(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new er([n(f,m.error)]);let h=Reflect.apply(i,this,m.data),x=p._def.returns.safeParse(h,a);if(!x.success)throw new er([o(h,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ln.create(t).rest(eo.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ln.create([]).rest(eo.create()),returns:r||eo.create(),typeName:Ce.ZodFunction,...Ee(n)})}},Ha=class extends Te{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ha.create=(e,t)=>new Ha({getter:e,typeName:Ce.ZodLazy,...Ee(t)});var za=class extends Te{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return se(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),Ae}return{status:"valid",value:t.data}}get value(){return this._def.value}};za.create=(e,t)=>new za({value:e,typeName:Ce.ZodLiteral,...Ee(t)});function xF(e,t){return new Wa({values:e,typeName:Ce.ZodEnum,...Ee(t)})}var Wa=class e extends Te{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return se(r,{expected:Ne.joinValues(n),received:r.parsedType,code:ee.invalid_type}),Ae}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return se(r,{received:r.data,code:ee.invalid_enum_value,options:n}),Ae}return Ut(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Wa.create=xF;var Ka=class extends Te{_parse(t){let r=Ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ue.string&&n.parsedType!==ue.number){let o=Ne.objectValues(r);return se(n,{expected:Ne.joinValues(o),received:n.parsedType,code:ee.invalid_type}),Ae}if(this._cache||(this._cache=new Set(Ne.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ne.objectValues(r);return se(n,{received:n.data,code:ee.invalid_enum_value,options:o}),Ae}return Ut(t.data)}get enum(){return this._def.values}};Ka.create=(e,t)=>new Ka({values:e,typeName:Ce.ZodNativeEnum,...Ee(t)});var Qo=class extends Te{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.promise&&r.common.async===!1)return se(r,{code:ee.invalid_type,expected:ue.promise,received:r.parsedType}),Ae;let n=r.parsedType===ue.promise?r.data:Promise.resolve(r.data);return Ut(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Qo.create=(e,t)=>new Qo({type:e,typeName:Ce.ZodPromise,...Ee(t)});var Fr=class extends Te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{se(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return Ae;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?Ae:f.status==="dirty"?Ma(f.value):r.value==="dirty"?Ma(f.value):f});return function(_x140){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return Ae;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?Ae:p.status==="dirty"?Ma(p.value):r.value==="dirty"?Ma(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?Ae:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?Ae:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!jo(i))return Ae;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>jo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):Ae);Ne.assertNever(o)}};Fr.create=(e,t,r)=>new Fr({schema:e,typeName:Ce.ZodEffects,effect:t,...Ee(r)});Fr.createWithPreprocess=(e,t,r)=>new Fr({schema:t,effect:{type:"preprocess",transform:e},typeName:Ce.ZodEffects,...Ee(r)});var wr=class extends Te{_parse(t){return this._getType(t)===ue.undefined?Ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wr.create=(e,t)=>new wr({innerType:e,typeName:Ce.ZodOptional,...Ee(t)});var dn=class extends Te{_parse(t){return this._getType(t)===ue.null?Ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};dn.create=(e,t)=>new dn({innerType:e,typeName:Ce.ZodNullable,...Ee(t)});var Ya=class extends Te{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ue.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ya.create=(e,t)=>new Ya({innerType:e,typeName:Ce.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ee(t)});var Ja=class extends Te{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Qs(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:Ce.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ee(t)});var Ws=class extends Te{_parse(t){if(this._getType(t)!==ue.nan){let n=this._getOrReturnCtx(t);return se(n,{code:ee.invalid_type,expected:ue.nan,received:n.parsedType}),Ae}return{status:"valid",value:t.data}}};Ws.create=e=>new Ws({typeName:Ce.ZodNaN,...Ee(e)});var pj=Symbol("zod_brand"),Al=class extends Te{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Cl=class e extends Te{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ae:a.status==="dirty"?(r.dirty(),Ma(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ae:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Ce.ZodPipeline})}},Xa=class extends Te{_parse(t){let r=this._def.innerType._parse(t),n=o=>(jo(o)&&(o.value=Object.freeze(o.value)),o);return Qs(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Xa.create=(e,t)=>new Xa({innerType:e,typeName:Ce.ZodReadonly,...Ee(t)});function hF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function AF(e,t={},r){return e?Uo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=hF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=hF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Uo.create()}var fj={object:tr.lazycreate},Ce;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ce||(Ce={}));var mj=(e,t={message:`Input not instance of ${e.name}`})=>AF(r=>r instanceof e,t),CF=Lo.create,bF=Va.create,gj=Ws.create,hj=ja.create,wF=La.create,yj=Ua.create,Sj=Gs.create,vj=Qa.create,xj=Ba.create,Aj=Uo.create,Cj=eo.create,bj=Br.create,wj=$s.create,Rj=to.create,Fj=tr.create,Ej=tr.strictCreate,Ij=Ga.create,Tj=Ff.create,Pj=$a.create,kj=ln.create,Oj=Ef.create,Nj=Hs.create,_j=zs.create,Dj=If.create,qj=Ha.create,Mj=za.create,Vj=Wa.create,jj=Ka.create,Lj=Qo.create,Uj=Fr.create,Qj=wr.create,Bj=dn.create,Gj=Fr.createWithPreprocess,$j=Cl.create,Hj=()=>CF().optional(),zj=()=>bF().optional(),Wj=()=>wF().optional(),Kj={string:e=>Lo.create({...e,coerce:!0}),number:e=>Va.create({...e,coerce:!0}),boolean:e=>La.create({...e,coerce:!0}),bigint:e=>ja.create({...e,coerce:!0}),date:e=>Ua.create({...e,coerce:!0})};var Yj=Ae;var Jj=E.object({name:E.string(),arguments:E.string()}),Xj=E.object({id:E.string(),type:E.literal("function"),function:Jj,encryptedValue:E.string().optional()}),Tf=E.object({id:E.string(),role:E.string(),content:E.string().optional(),name:E.string().optional(),encryptedValue:E.string().optional()}),Zj=E.object({type:E.literal("text"),text:E.string()}),RF=E.object({type:E.literal("binary"),mimeType:E.string(),id:E.string().optional(),url:E.string().optional(),data:E.string().optional(),filename:E.string().optional()}),FF=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:E.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},Hue=RF.superRefine((e,t)=>{FF(e,t)}),eL=E.discriminatedUnion("type",[Zj,RF]),tL=eL.superRefine((e,t)=>{e.type==="binary"&&FF(e,t)}),rL=Tf.extend({role:E.literal("developer"),content:E.string()}),nL=Tf.extend({role:E.literal("system"),content:E.string()}),oL=Tf.extend({role:E.literal("assistant"),content:E.string().optional(),toolCalls:E.array(Xj).optional()}),aL=Tf.extend({role:E.literal("user"),content:E.union([E.string(),E.array(tL)])}),iL=E.object({id:E.string(),content:E.string(),role:E.literal("tool"),toolCallId:E.string(),error:E.string().optional(),encryptedValue:E.string().optional()}),sL=E.object({id:E.string(),role:E.literal("activity"),activityType:E.string(),content:E.record(E.any())}),cL=E.object({id:E.string(),role:E.literal("reasoning"),content:E.string(),encryptedValue:E.string().optional()}),EF=E.discriminatedUnion("role",[rL,nL,oL,aL,iL,sL,cL]),zue=E.union([E.literal("developer"),E.literal("system"),E.literal("assistant"),E.literal("user"),E.literal("tool"),E.literal("activity"),E.literal("reasoning")]),uL=E.object({description:E.string(),value:E.string()}),lL=E.object({name:E.string(),description:E.string(),parameters:E.any()}),dL=E.object({threadId:E.string(),runId:E.string(),parentRunId:E.string().optional(),state:E.any(),messages:E.array(EF),tools:E.array(lL),context:E.array(uL),forwardedProps:E.any()}),pL=E.any(),nt=class extends Error{constructor(e){super(e)}},qv=class extends nt{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},IF=E.union([E.literal("developer"),E.literal("system"),E.literal("assistant"),E.literal("user")]),M=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Ve=E.object({type:E.nativeEnum(M),timestamp:E.number().optional(),rawEvent:E.any().optional()}).passthrough(),fL=Ve.extend({type:E.literal(M.TEXT_MESSAGE_START),messageId:E.string(),role:IF.default("assistant")}),TF=Ve.extend({type:E.literal(M.TEXT_MESSAGE_CONTENT),messageId:E.string(),delta:E.string().refine(e=>e.length>0,"Delta must not be an empty string")}),mL=Ve.extend({type:E.literal(M.TEXT_MESSAGE_END),messageId:E.string()}),gL=Ve.extend({type:E.literal(M.TEXT_MESSAGE_CHUNK),messageId:E.string().optional(),role:IF.optional(),delta:E.string().optional()}),hL=Ve.extend({type:E.literal(M.THINKING_TEXT_MESSAGE_START)}),yL=TF.omit({messageId:!0,type:!0}).extend({type:E.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),SL=Ve.extend({type:E.literal(M.THINKING_TEXT_MESSAGE_END)}),vL=Ve.extend({type:E.literal(M.TOOL_CALL_START),toolCallId:E.string(),toolCallName:E.string(),parentMessageId:E.string().optional()}),xL=Ve.extend({type:E.literal(M.TOOL_CALL_ARGS),toolCallId:E.string(),delta:E.string()}),AL=Ve.extend({type:E.literal(M.TOOL_CALL_END),toolCallId:E.string()}),CL=Ve.extend({messageId:E.string(),type:E.literal(M.TOOL_CALL_RESULT),toolCallId:E.string(),content:E.string(),role:E.literal("tool").optional()}),bL=Ve.extend({type:E.literal(M.TOOL_CALL_CHUNK),toolCallId:E.string().optional(),toolCallName:E.string().optional(),parentMessageId:E.string().optional(),delta:E.string().optional()}),wL=Ve.extend({type:E.literal(M.THINKING_START),title:E.string().optional()}),RL=Ve.extend({type:E.literal(M.THINKING_END)}),FL=Ve.extend({type:E.literal(M.STATE_SNAPSHOT),snapshot:pL}),EL=Ve.extend({type:E.literal(M.STATE_DELTA),delta:E.array(E.any())}),IL=Ve.extend({type:E.literal(M.MESSAGES_SNAPSHOT),messages:E.array(EF)}),TL=Ve.extend({type:E.literal(M.ACTIVITY_SNAPSHOT),messageId:E.string(),activityType:E.string(),content:E.record(E.any()),replace:E.boolean().optional().default(!0)}),PL=Ve.extend({type:E.literal(M.ACTIVITY_DELTA),messageId:E.string(),activityType:E.string(),patch:E.array(E.any())}),kL=Ve.extend({type:E.literal(M.RAW),event:E.any(),source:E.string().optional()}),OL=Ve.extend({type:E.literal(M.CUSTOM),name:E.string(),value:E.any()}),NL=Ve.extend({type:E.literal(M.RUN_STARTED),threadId:E.string(),runId:E.string(),parentRunId:E.string().optional(),input:dL.optional()}),_L=Ve.extend({type:E.literal(M.RUN_FINISHED),threadId:E.string(),runId:E.string(),result:E.any().optional()}),DL=Ve.extend({type:E.literal(M.RUN_ERROR),message:E.string(),code:E.string().optional()}),qL=Ve.extend({type:E.literal(M.STEP_STARTED),stepName:E.string()}),ML=Ve.extend({type:E.literal(M.STEP_FINISHED),stepName:E.string()}),VL=E.union([E.literal("tool-call"),E.literal("message")]),jL=Ve.extend({type:E.literal(M.REASONING_START),messageId:E.string()}),LL=Ve.extend({type:E.literal(M.REASONING_MESSAGE_START),messageId:E.string(),role:E.literal("reasoning")}),UL=Ve.extend({type:E.literal(M.REASONING_MESSAGE_CONTENT),messageId:E.string(),delta:E.string().refine(e=>e.length>0,"Delta must not be an empty string")}),QL=Ve.extend({type:E.literal(M.REASONING_MESSAGE_END),messageId:E.string()}),BL=Ve.extend({type:E.literal(M.REASONING_MESSAGE_CHUNK),messageId:E.string().optional(),delta:E.string().optional()}),GL=Ve.extend({type:E.literal(M.REASONING_END),messageId:E.string()}),$L=Ve.extend({type:E.literal(M.REASONING_ENCRYPTED_VALUE),subtype:VL,entityId:E.string(),encryptedValue:E.string()}),Pf=E.discriminatedUnion("type",[fL,TF,mL,gL,wL,RL,hL,yL,SL,vL,xL,AL,bL,CL,FL,EL,IL,TL,PL,kL,OL,NL,_L,DL,qL,ML,jL,LL,UL,QL,BL,GL,$L]);d();c();l();u();var Mv={};Su(Mv,{JsonPatchError:()=>at,_areEquals:()=>Rl,applyOperation:()=>Za,applyPatch:()=>Bo,applyReducer:()=>YL,deepClone:()=>WL,getValueByPointer:()=>Df,validate:()=>kF,validator:()=>qf});d();c();l();u();d();c();l();u();var HL=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},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)}}(),zL=Object.prototype.hasOwnProperty;function Of(e,t){return zL.call(e,t)}function Nf(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)Of(e,o)&&n.push(o);return n}function Mt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function _f(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function pn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function bl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function kf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(kf(e[t]))return!0}else if(typeof e=="object"){for(var n=Nf(e),o=n.length,a=0;a<o;a++)if(kf(e[n[a]]))return!0}}return!1}function PF(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
|
|
32
|
-
`)}var wl=function(e){HL(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,PF(r,{name:n,index:o,operation:a,tree:i}))||this;return f.name=n,f.index=o,f.operation=a,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=PF(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var at=wl,WL=Mt,Ks={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=Df(r,this.path);n&&(n=Mt(n));var o=Za(r,{op:"remove",path:this.from}).removed;return Za(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Df(r,this.from);return Za(r,{op:"add",path:this.path,value:Mt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Rl(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},KL={add:function(e,t,r){return _f(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Ks.move,copy:Ks.copy,test:Ks.test,_get:Ks._get};function Df(e,t){if(t=="")return e;var r={op:"_get",path:t};return Za(e,r),r.value}function Za(e,t,r,n,o,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(t,0,e,t.path):qf(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=Df(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=Rl(e,t.value),i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=Mt(e));var p=t.path||"",f=p.split("/"),m=e,h=1,x=f.length,A=void 0,y=void 0,C=void 0;for(typeof r=="function"?C=r:C=qf;;){if(y=f[h],y&&y.indexOf("~")!=-1&&(y=bl(y)),o&&(y=="__proto__"||y=="prototype"&&h>0&&f[h-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&A===void 0&&(m[y]===void 0?A=f.slice(0,h).join("/"):h==x-1&&(A=t.path),A!==void 0&&C(t,0,e,A)),h++,Array.isArray(m)){if(y==="-")y=m.length;else{if(r&&!_f(y))throw new at("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);_f(y)&&(y=~~y)}if(h>=x){if(r&&t.op==="add"&&y>m.length)throw new at("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var i=KL[t.op].call(t,m,y,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(h>=x){var i=Ks[t.op].call(t,m,y,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[y],r&&h<x&&(!m||typeof m!="object"))throw new at("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function Bo(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Mt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=Za(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function YL(e,t,r){var n=Za(e,t);if(n.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function qf(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new at("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Ks[e.op]){if(typeof e.path!="string")throw new at("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new at("Operation `path` property must start with \"/\"","OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new at("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&kf(e.value))throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,a=n.split("/").length;if(o!==a+1&&o!==a)throw new at("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new at("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=kF([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new at("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function kF(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Bo(Mt(t),Mt(e),r||!0);else{r=r||qf;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof at)return o;throw o}}function Rl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,a,i;if(r&&n){if(a=e.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!Rl(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=a;o--!==0;)if(i=p[o],!Rl(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var Uv={};Su(Uv,{compare:()=>oU,generate:()=>Vv,observe:()=>nU,unobserve:()=>rU});d();c();l();u();var jv=new WeakMap,JL=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),XL=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function ZL(e){return jv.get(e)}function eU(e,t){return e.observers.get(t)}function tU(e,t){e.observers.delete(t.callback)}function rU(e,t){t.unobserve()}function nU(e,t){var r=[],n,o=ZL(e);if(!o)o=new JL(e),jv.set(e,o);else{var a=eU(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=Mt(e),t){n.callback=t,n.next=null;var i=function(){Vv(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){Vv(n),clearTimeout(n.next),tU(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new XL(t,n)),n}function Vv(e,t){t===void 0&&(t=!1);var r=jv.get(e.object);Lv(r.value,e.object,e.patches,"",t),e.patches.length&&Bo(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function Lv(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Nf(t),i=Nf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var h=i[m],x=e[h];if(Of(t,h)&&!(t[h]===void 0&&x!==void 0&&Array.isArray(t)===!1)){var A=t[h];typeof x=="object"&&x!=null&&typeof A=="object"&&A!=null&&Array.isArray(x)===Array.isArray(A)?Lv(x,A,r,n+"/"+pn(h),o):x!==A&&(p=!0,o&&r.push({op:"test",path:n+"/"+pn(h),value:Mt(x)}),r.push({op:"replace",path:n+"/"+pn(h),value:Mt(A)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+pn(h),value:Mt(x)}),r.push({op:"remove",path:n+"/"+pn(h)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&a.length==i.length))for(var m=0;m<a.length;m++){var h=a[m];!Of(e,h)&&t[h]!==void 0&&r.push({op:"add",path:n+"/"+pn(h),value:Mt(t[h])})}}}function oU(e,t,r){r===void 0&&(r=!1);var n=[];return Lv(e,t,n,"",r),n}var Sle=Object.assign({},Mv,Uv,{JsonPatchError:wl,deepClone:Mt,escapePathComponent:pn,unescapePathComponent:bl});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Qv=function(e,t){return Qv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Qv(e,t)};function fn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Qv(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function OF(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(h){try{m(n.next(h))}catch(x){i(x)}}function f(h){try{m(n.throw(h))}catch(x){i(x)}}function m(h){h.done?a(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function Mf(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function ro(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ys(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)a.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Js(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function ei(e){return this instanceof ei?(this.v=e,this):new ei(e)}function NF(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(y){return function(C){return Promise.resolve(C).then(y,x)}}function p(y,C){n[y]&&(o[y]=function(R){return new Promise(function(b,w){a.push([y,R,b,w])>1||f(y,R)})},C&&(o[y]=C(o[y])))}function f(y,C){try{m(n[y](C))}catch(R){A(a[0][3],R)}}function m(y){y.value instanceof ei?Promise.resolve(y.value.v).then(h,x):A(a[0][2],y)}function h(y){f("next",y)}function x(y){f("throw",y)}function A(y,C){y(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function _F(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof ro=="function"?ro(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(p,f){i=e[a](i),o(p,f,i.done,i.value)})}}function o(a,i,p,f){Promise.resolve(f).then(function(m){a({value:m,done:p})},i)}}d();c();l();u();function Oe(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function Xs(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Vf=Xs(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
32
|
+
`;function _q(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Nq=["1",1,"yes",!0];function rp(){let e=[];return CS()&&e.push(window.doNotTrack),DS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Nq.indexOf(t)!==-1)}var nw="v15",ow={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 Dq(e=ow.default,t=nw,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 qq="38824e1f-37f5-42d3-8372-a4b8fa9df946",Zr=class{get defaultOptions(){return{endpoint:ow.default,isCustomEndpoint:!1,token:"",version:nw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Zb}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=[wD,vD].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};rp()?this.runtime=new tp:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(_e.view,{newEventType:_e.view,addClientIdParameter:!0}),this.addEventTypeMapping(_e.click,{newEventType:_e.click,addClientIdParameter:!0}),this.addEventTypeMapping(_e.custom,{newEventType:_e.custom,addClientIdParameter:!0}),this.addEventTypeMapping(_e.search,{newEventType:_e.search,addClientIdParameter:!0})}initRuntime(t){return CS()&&Gi()?new _S(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(_q()&&console.warn(Oq),new NS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return G(this,void 0,void 0,function*(){try{return CS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||xa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),xa()}})}getCurrentVisitorId(){return G(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return G(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return G(this,void 0,void 0,function*(){if(Xd(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Lb(t,Lb(r,qq)))}})}getParameters(t,...r){return G(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return G(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(xa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(rp())return null;try{let r=new URL(t).searchParams.get(Ao.cvo_cid);if(r==null)return null;let n=Ao.fromString(r);return!n||!Gi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return G(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>G(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>G(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>a?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((A,b)=>G(this,void 0,void 0,function*(){let w=yield A;return yield b(t,w)}),h)].reduce((h,A)=>G(this,void 0,void 0,function*(){let b=yield h;return yield A(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return G(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?Cq(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,C)=>G(this,void 0,void 0,function*(){let h=yield v;return yield C(h)}),Promise.resolve(r))})}makeEvent(t,...r){return G(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>G(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return G(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return G(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 Yd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return G(this,void 0,void 0,function*(){return this.makeEvent(_e.search,t)})}sendSearchEvent(t){return G(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=zn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return G(this,void 0,void 0,function*(){return this.makeEvent(_e.click,t)})}sendClickEvent(t){return G(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=zn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return G(this,void 0,void 0,function*(){return this.makeEvent(_e.custom,t)})}sendCustomEvent(t){return G(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=zn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return G(this,void 0,void 0,function*(){return this.makeEvent(_e.view,t)})}sendViewEvent(t){return G(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return G(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return G(this,void 0,void 0,function*(){return yield(yield S(`${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,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[_e.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,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Fq(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=zn(t,["custom"]),o={};r&&Kd(r)&&(o=this.lowercaseKeys(r));let a=Eq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=zn(t,["custom"]);if(r&&Kd(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=zn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==_e.view||r==_e.click||r==_e.search||r==_e.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==_e.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=zn(t,["userId"]);return kq(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=zn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Kd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Kd(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"?jD(t,r):t}get baseUrl(){return Dq(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Wn;(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"})(Wn||(Wn={}));var $;(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",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})($||($={}));var zb={[$.triggerNotify]:"queryPipelineTriggers",[$.triggerExecute]:"queryPipelineTriggers",[$.triggerQuery]:"queryPipelineTriggers",[$.triggerRedirect]:"queryPipelineTriggers",[$.queryErrorBack]:"errors",[$.queryErrorClear]:"errors",[$.queryErrorRetry]:"errors",[$.pagerNext]:"getMoreResults",[$.pagerPrevious]:"getMoreResults",[$.pagerNumber]:"getMoreResults",[$.pagerResize]:"getMoreResults",[$.pagerScrolling]:"getMoreResults",[$.facetSearch]:"facet",[$.facetShowLess]:"facet",[$.facetShowMore]:"facet",[$.recommendation]:"recommendation",[$.likeSmartSnippet]:"smartSnippet",[$.dislikeSmartSnippet]:"smartSnippet",[$.expandSmartSnippet]:"smartSnippet",[$.collapseSmartSnippet]:"smartSnippet",[$.openSmartSnippetFeedbackModal]:"smartSnippet",[$.closeSmartSnippetFeedbackModal]:"smartSnippet",[$.sendSmartSnippetReason]:"smartSnippet",[$.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.clearRecentQueries]:"recentQueries",[$.recentResultClick]:"recentlyClickedDocuments",[$.clearRecentResults]:"recentlyClickedDocuments",[$.showLessFoldedResults]:"folding",[$.caseDetach]:"case",[$.likeGeneratedAnswer]:"generatedAnswer",[$.dislikeGeneratedAnswer]:"generatedAnswer",[$.openGeneratedAnswerSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Wn.expandToFullUI]:"interface",[Wn.openUserActions]:"User Actions",[Wn.showPrecedingSessions]:"User Actions",[Wn.showFollowingSessions]:"User Actions",[Wn.clickViewedDocument]:"User Actions",[Wn.clickPageView]:"User Actions",[Wn.createArticle]:"createArticle"},zi=class{constructor(){this.runtime=new tp,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(_e.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(_e.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(_e.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(_e.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Zb}};function Mq(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function Vq(e){return e.map(t=>t.replace(/;/g,""))}function aw(e){let r=e.join(";");return r.length<=256?r:aw(e.slice(1))}var Wb=e=>{let t=Vq(e),r=Mq(t);return aw(r)};function Kb(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Wb(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Wb(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var np=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||rp();this.coveoAnalyticsClient=n?new zi:new Zr(t)}disable(){this.coveoAnalyticsClient=new zi}enable(){this.coveoAnalyticsClient=new Zr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return G(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return G(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return G(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return G(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return G(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return G(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return G(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return G(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return G(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return G(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent($.resultsSort,t)}logResultsSort(t){return G(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return G(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return G(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return G(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent($.breadcrumbFacet,t)}logBreadcrumbFacet(t){return G(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return G(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,Kb(t))}logOmniboxAnalytics(t){return G(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,Kb(t))}logOmniboxFromLink(t){return G(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return G(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent($.triggerNotify,t)}logTriggerNotify(t){return G(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent($.triggerExecute,t)}logTriggerExecute(t){return G(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent($.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return G(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent($.undoTriggerQuery,t)}logUndoTriggerQuery(t){return G(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent($.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return G(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent($.pagerResize,t)}logPagerResize(t){return G(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent($.pagerNumber,t)}logPagerNumber(t){return G(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent($.pagerNext,t)}logPagerNext(t){return G(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent($.pagerPrevious,t)}logPagerPrevious(t){return G(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return G(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent($.facetClearAll,t)}logFacetClearAll(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent($.facetSearch,t)}logFacetSearch(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent($.facetSelect,t)}logFacetSelect(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent($.facetDeselect,t)}logFacetDeselect(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent($.facetExclude,t)}logFacetExclude(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent($.facetUnexclude,t)}logFacetUnexclude(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent($.facetSelectAll,t)}logFacetSelectAll(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent($.facetUpdateSort,t)}logFacetUpdateSort(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent($.facetShowMore,t)}logFacetShowMore(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent($.facetShowLess,t)}logFacetShowLess(t){return G(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent($.queryError,t)}logQueryError(t){return G(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return G(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>G(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return G(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return G(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>G(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return G(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return G(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>G(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return G(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return G(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return G(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return G(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return G(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return G(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return G(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return G(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return G(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return G(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return G(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return G(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return G(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return G(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return G(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return G(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){return G(this,arguments,void 0,function*(n,o,a=zb[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return G(this,arguments,void 0,function*(n,o,a=zb[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return G(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return G(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return G(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:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return G(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return G(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return G(this,void 0,void 0,function*(){var n,o;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 G(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 Zr?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($.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return G(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent($.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return G(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent($.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return G(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent($.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return G(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return G(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent($.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return G(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},op=Object.assign({},Yu),Yb=Object.keys(op).map(e=>op[e]),$i=class extends RS{constructor({client:t,uuidGenerator:r=xa}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>Yb.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(Yb.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(op.pageview,{newEventType:_e.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(op.event,{newEventType:_e.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}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return GD(this.ticket)}};$i.Id="svc";var ap;(function(e){e.click="click",e.flowStart="flowStart"})(ap||(ap={}));var hr;(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"})(hr||(hr={}));var ip;(function(e){e.quit="Quit",e.solved="Solved"})(ip||(ip={}));var sp=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!rp();this.coveoAnalyticsClient=o?new Zr(t):new zi,this.svc=new $i({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new zi,this.svc=new $i({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Zr(this.options),this.svc=new $i({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(hr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(hr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(hr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(hr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(hr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(hr.caseCancelled,{reason:ip.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(hr.caseSolved,{reason:ip.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(hr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",ap.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",ap.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return G(this,void 0,void 0,function*(){var r,n;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 Zr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;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:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return G(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var Co=()=>"default";var jq=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Aa=class{constructor(t){ye(this,"getState",t);ye(this,"state");this.state=t()}getLanguage(){return jq(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=xo),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Co()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var iw=e=>new Zr(e).getCurrentVisitorId(),Zu=(e,t)=>typeof t=="function"?(...r)=>{let n=Ru(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,el=(e,t)=>(...r)=>{let n=Ru(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var tl=class extends Aa{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},sw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new tl(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Pt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new sp({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Zu(e,n),beforeSendHooks:[el(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:i},"Analytics request"),C)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Wi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function Lq(e,t){return!!t&&t.facetId in e.facetSet}var Lr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),cp=(e,t)=>e.facetSet[t]?.request,Ki=(e,t)=>{let r=Lr(e,t);return Lq(e,r)?r:void 0},cw=(e,t)=>Ki(e,t)?.values.filter(r=>r.state==="selected")||[],uw=(e,t)=>Ki(e,t)?.values.filter(r=>r.state!=="idle")||[],en=e=>e.search.isLoading;d();c();l();u();function lw(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function cr(e){let{activeValue:t,ancestryMap:r}=Uq(e);return t?Qq(t,r):[]}function Uq(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 Qq(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function Bq(e,t){return!!t&&t.facetId in e.categoryFacetSet}var VS=(e,t)=>{let r=Lr(e,t);if(Bq(e,r))return r},jS=(e,t)=>e.categoryFacetSet[t]?.request,dw=(e,t)=>{let r=VS(e,t);return cr(r?.values??[])},LS=(e,t)=>{let r=jS(e,t);return cr(r?.currentValues??[])};d();c();l();u();function Yi(){return{}}d();c();l();u();function pw(e,t){return{request:e,tabs:t}}function Xi(){return{}}d();c();l();u();function fw(e,t){return{request:e,tabs:t}}function Ji(){return{}}d();c();l();u();function mw(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function Zi(){return{}}var es=(e,t)=>{let r=Sw(t,e),n=r?r.field:"",o=QS(n,e);return{facetId:e,facetField:n,facetTitle:o}};function ts(e,t){let{facetId:r,facetValue:n}=e,o=es(r,t),a=vw(t,r);return{...o,facetValue:a==="hierarchical"?yw(t,r):n}}function ur(e){return{facetSet:e.facetSet??Zi(),categoryFacetSet:e.categoryFacetSet??Yi(),dateFacetSet:e.dateFacetSet??Xi(),numericFacetSet:e.numericFacetSet??Ji(),automaticFacetSet:e.automaticFacetSet??Wi()}}var US=e=>{let t=[];return Hq(e).forEach((r,n)=>{let o=vw(e,r.facetId),a=Xq(r,n+1);if($q(r)){if(!!!LS(e,r.facetId).length)return;t.push({...a,...Kq(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=gw(i,p+1,o),m=Gq(r)?hw(i):Wq(i);t.push({...a,...f,...m})})}),zq(e).forEach((r,n)=>{let o=Yq(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=gw(a,i+1,"specific"),f=hw(a);t.push({...o,...p,...f})})}),t},Gq=e=>e.type==="specific",$q=e=>e.type==="hierarchical",Hq=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),zq=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),gw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),Wq=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),hw=e=>({displayValue:e.value,value:e.value}),yw=(e,t)=>LS(e,t).map(n=>n.value).join(";"),Kq=(e,t)=>{let n=yw(e,t);return{value:n,valuePosition:1,displayValue:n}},Yq=(e,t)=>({title:QS(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),Xq=(e,t)=>({title:QS(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),QS=(e,t)=>`${e}_${t}`,Sw=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,vw=(e,t)=>{let r=Sw(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var BS=e=>e.configuration.search.locale,xw=e=>e.configuration.search.timezone,up=e=>e.configuration.accessToken,lp=e=>e.configuration.organizationId,dp=e=>e.configuration.environment,pp=e=>e.configuration?.knowledge?.agentId,Aw=e=>e.configuration.knowledge.debugAgentSession;var We=e=>{if(Jq(e)||GS(e))return e.generatedAnswer?.answerId;if(Zq(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},Jq=e=>"answer"in e&&"generatedAnswer"in e&&!pe(e.generatedAnswer?.answerConfigurationId),GS=e=>{let t=pp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},Zq=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",$S=e=>e.generatedAnswer?.fieldsToIncludeInCitations,eM=e=>e.generatedAnswer?.citations,tM=e=>e.followUpAnswers?.followUpAnswers,rM=Je(tM,e=>e?.flatMap(t=>t.citations)),nM=(e,t)=>t,rl=Je(eM,rM,nM,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var dt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var nl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(nl||{}),Ca=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(Ca||{}),tn=e=>{if(_i(e))return e.map(t=>tn(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""}},rs=()=>({by:"relevancy"}),fp=e=>({by:"date",order:e}),mp=(e,t)=>({by:"field",order:t,field:e}),gp=()=>({by:"qre"}),hp=()=>({by:"nosort"}),Cw=new J({values:{by:new wu({enum:Ca,required:!0}),order:new wu({enum:nl}),field:new U}});function Sr(){return tn(rs())}d();c();l();u();d();c();l();u();d();c();l();u();var ns=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?HS(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],HS(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function HS(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}d();c();l();u();function oM(){return typeof navigator<"u"}function bw(){try{return typeof localStorage<"u"}catch{return!1}}function ww(){try{return typeof sessionStorage<"u"}catch{return!1}}function Rw(){return!!(oM()&&navigator.cookieEnabled)}var Fw=null;function Ew(){return Fw||(bw()?localStorage:Rw()?new zS:ww()?sessionStorage:new WS)}var os=class os{getItem(t){return ns.get(`${os.prefix}${t}`)}removeItem(t){ns.erase(`${os.prefix}${t}`)}setItem(t,r,n){ns.set(`${os.prefix}${t}`,r,n)}};ye(os,"prefix","coveo_");var zS=os;var WS=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var yp="__coveo.analytics.history",aM=20,iM=1e3*60,sM=75,ba=class ba{constructor(t){ye(this,"store");this.store=t||Ew()}static getInstance(t){return ba.instance||(ba.instance=new ba(t)),ba.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(yp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(yp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(yp,JSON.stringify(t.slice(0,aM)))}catch{}}clear(){try{this.store.removeItem(yp)}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,sM)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>iM:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};ye(ba,"instance",null);var KS=ba,Xt=KS;var ol=class ol extends Aa{constructor(){super(...arguments);ye(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 US(ur(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||ol.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||ir().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||ol.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=We(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Sr()}}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 a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}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||dt().q}get responseTime(){return this.state.search?.duration||ir().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ir().response.totalCountFiltered}};ye(ol,"fallbackPipelineName","default");var bo=ol,Iw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Pt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new np({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Zu(e,n),beforeSendHooks:[el(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:i},"Analytics request"),C)]},o);return m||g.disable(),g},YS=()=>{let t=Xt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Sp(e){let t=Tw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return JA([e,...t,...r],o=>o.uniqueId)}function Tw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Tw(t)]):[]}d();c();l();u();var Kn=()=>"";function kw(e,t){return{...new bo(t).getBaseMetadata(),actionCause:e,type:e}}function cM(e){return Object.assign(e,{instantlyCallable:!0})}function uM(e,t){let r=a=>{let i=Ae(e,a);return cM(Object.assign(i,{type:i.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(v,{getState:C,extra:h}){return yield g({state:C(),extra:h})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var Ow=(e,t,r)=>{function n(...o){let a=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 pM(a)}return n},lM=e=>e.configuration.analytics.analyticsMode==="legacy",dM=e=>e.configuration.analytics.analyticsMode==="next",pM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),uM(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let v=[],C={log:function(){var _ref14=_asyncToGenerator(function*({state:R}){for(let E of v)yield E(R)});return function log(_x25){return _ref14.apply(this,arguments)}}()},h=p(),A=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(A,p());C.description=b?.description,v.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(R){lM(R)&&(yield fM(b,r,R,g,A.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=Ku(h);return v.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(R){if(dM(R)&&o&&n){let E=n(R);yield CM(w,o,E)}});return function(_x27){return _ref16.apply(this,arguments)}}()),C});return function(_x24){return _ref13.apply(this,arguments)}}()));function fM(_x28,_x29,_x30,_x31,_x32){return _fM.apply(this,arguments)}function _fM(){_fM=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _fM.apply(this,arguments)}var mM=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),X=Ow(e=>Iw({...e,provider:e.provider||new bo(e.getState)}),e=>e,bo),o5=Ow(sw,mM("caseAssist"),tl);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=qw(e,o),n<0&&(n=AM(e,o)),n<0&&(n=0),hM(e,r(n),t)};var _w=(e,t)=>({sourceName:gM(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Kn()});function gM(e){let t=e.source;return pe(t)?"unknown":t}var Nw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function hM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:vM(e),...(Pw(e)?{documentCategory:Pw(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:xM(e),queryPipeline:r.pipeline||Kn()}}function Pw(e){return e.raw?.objecttype||void 0}var Ke=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||""}),Dw={urihash:new U,sourcetype:new U,permanentid:new U},vp={uniqueId:W,raw:new J({values:Dw}),title:W,uri:W,clickUri:W,rankingModifier:new U({required:!1,emptyAllowed:!0})};function yM(e){return Object.assign({},...Object.keys(Dw).map(t=>({[t]:e[t]})))}function SM(e){return Object.assign({},...Object.keys(vp).map(t=>({[t]:e[t]})),{raw:yM(e.raw)})}function vM(e){let t=e.raw.author;return pe(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function xM(e){let t=e.raw.source;return pe(t)?"unknown":t}var Jt=e=>new Se(vp).validate(SM(e));function AM(e,t){for(let[r,n]of t.entries()){let o=Sp(n);if(qw(e,o)!==-1)return r}return-1}function qw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function CM(_x34,_x35,_x36){return _CM.apply(this,arguments)}function _CM(){_CM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _CM.apply(this,arguments)}d();c();l();u();var XS=e=>O(e,{evt:W,type:st}),Mw=e=>X("analytics/generic/search",t=>{XS(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),Vw=e=>X("analytics/generic/click",(t,r)=>(Jt(e.result),XS(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),jw=e=>X("analytics/generic/custom",t=>(XS(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),xp=()=>X("analytics/interface/load",e=>e.makeInterfaceLoad()),wo=()=>X("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),Ap=()=>X("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),Cp=e=>X("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),Lw=()=>({actionCause:"interfaceLoad"}),as=()=>({actionCause:"interfaceChange"}),Uw=()=>({actionCause:"searchFromLink"}),Qw=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var JS=()=>st,Bw=()=>W,rn=P("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new U({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),vr=P("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new U({required:!1,url:!0}),pipeline:new U({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new ie({required:!1,each:W})})),bM={enabled:new de({default:!0}),originContext:JS(),originLevel2:JS(),originLevel3:JS(),proxyBaseUrl:new U({required:!1,url:!0}),runtimeEnvironment:new Qe,anonymous:new de({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:PC,analyticsMode:new U({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new J({options:{required:!1},values:Mb.reduce((e,t)=>(e[t]=TC,e),{})})},Ro=P("configuration/updateAnalyticsConfiguration",e=>O(e,bM)),is=P("configuration/analytics/disable"),ss=P("configuration/analytics/enable"),bp=P("configuration/analytics/originlevel2",e=>O(e,{originLevel2:Bw()})),wp=P("configuration/analytics/originlevel3",e=>O(e,{originLevel3:Bw()})),Rp=P("knowledge/setAgentId",e=>O(e,new U({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Fp={q:new U,enableQuerySyntax:new de,aq:new U,cq:new U,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new U,f:new J,fExcluded:new J,cf:new J,nf:new J,mnf:new J,df:new J,debug:new de,sf:new J,tab:new U,af:new J};var Me=P("searchParameters/restore",e=>O(e,Fp)),cs=P("searchParameters/restoreTab",e=>O(e,W));d();c();l();u();var Fo=P("debug/enable"),us=P("debug/disable");d();c();l();u();var Eo=()=>!1;var ls=ae(Eo(),e=>{e.addCase(Fo,()=>!0).addCase(us,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var ZS=P("history/undo"),ev=P("history/redo"),lr=P("history/snapshot"),al=Ae("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(ZS()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),Ep=Ae("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(ev()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=Ae("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var ds=P("pipeline/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var ps=ae(Kn(),e=>{e.addCase(ds,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(vr,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var ft=P("breadcrumb/deselectAll"),fs=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var nn=P("facet/updateFacetAutoSelection",e=>O(e,{allow:new de({required:!0})}));d();c();l();u();d();c();l();u();var il=class extends bo{constructor(r){super(r);ye(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??dt().q}get responseTime(){return this.activeInstantResultCache?.duration??ir().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ir().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Gw=e=>X({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Jt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new il(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),$w=()=>X("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new il(e)),Hw=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var tv={id:W},wM={...tv,q:Be},ms=P("instantResults/register",e=>O(e,tv)),on=P("instantResults/updateQuery",e=>O(e,wM)),gs=P("instantResults/clearExpired",e=>O(e,tv));d();c();l();u();var Ip=new re({required:!0,min:0}),hs=P("pagination/registerNumberOfResults",e=>O(e,Ip)),ys=P("pagination/updateNumberOfResults",e=>O(e,Ip)),Ss=P("pagination/registerPage",e=>O(e,Ip)),an=P("pagination/updatePage",e=>O(e,Ip)),vs=P("pagination/nextPage"),xs=P("pagination/previousPage");d();c();l();u();var jt=P("query/updateQuery",e=>O(e,{q:new U,enableQuerySyntax:new de}));d();c();l();u();d();c();l();u();var Ur=(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:Bi(e)}});var As=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(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&&Ur(e.configuration.analytics,t,r)),...(e.excerptLength&&!pe(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();d();c();l();u();var Cs=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield iw(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}),...(YS()&&{pageId:YS()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Bi(e)})}}});return function Cs(_x43,_x44){return _ref21.apply(this,arguments)}}();var Io=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(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:Xt.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 Cs(e.configuration.analytics,t))),...(e.excerptLength&&!pe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Io(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Qr=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var rv=()=>X("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),To=e=>X("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||dt().q,aq:r.advancedSearchQueries?.aq||Qr().aq,cq:r.advancedSearchQueries?.cq||Qr().cq,dq:r.advancedSearchQueries?.dq||Qr().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var cl=Vr(Tp(),1),Xw=Vr(zw(),1);d();c();l();u();var Pp=Vr(Tp(),1),Kw=Vr(Ww(),1);Pp.default.extend(Kw.default);var bs="YYYY/MM/DD@HH:mm:ss",RM="1401-01-01";function wa(e,t){let r=(0,Pp.default)(e,t);return!r.isValid()&&!t?(0,Pp.default)(e,bs):r}function sl(e){return e.format(bs)}function Yw(e){return sl(wa(e))===e}function kp(e,t){let r=wa(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}`)}uv(r)}function uv(e){if(e.isBefore(RM))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}cl.default.extend(Xw.default);var Jw=["past","now","next"],Zw=["minute","hour","day","week","month","quarter","year"],FM=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new U({required:!t,constrainTo:Zw}),period:new U({required:!0,constrainTo:Jw})}};function Po(e){if(typeof e=="string"&&!sn(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?lv(e):e;new Se(FM(t.period)).validate(t);let r=tR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);uv(r)}function eR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function tR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,cl.default)().subtract(r,n);case"next":return(0,cl.default)().add(r,n);case"now":return(0,cl.default)()}}function ul(e){return sl(tR(lv(e)))}function rR(e){return e.toLocaleLowerCase().split("-")}function sn(e){let[t,r,n]=rR(e);if(t==="now")return!0;if(!Jw.includes(t)||!Zw.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function nR(e){return!!e&&typeof e=="object"&&"period"in e}function lv(e){let[t,r,n]=rR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function oR(e){return Po(e),lv(e)}d();c();l();u();function aR(e){return e.type==="dateRange"}function iR(e){return`start${e}`}function sR(e){return`end${e}`}var dv=()=>({dateFacetValueMap:{}});function EM(e,t,r){let n=e.start,o=e.end;return sn(n)&&(n=ul(n),r.dateFacetValueMap[t][iR(n)]=e.start),sn(o)&&(o=ul(o),r.dateFacetValueMap[t][sR(o)]=e.end),{...e,start:n,end:o}}function pv(e,t){if(aR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>EM(o,r,t))}}return e}function ko(e){let t=dv();return{request:{...e,facets:e.facets?.map(n=>pv(n,t))},mappings:t}}function IM(e,t,r){return{...e,start:r.dateFacetValueMap[t][iR(e.start)]||e.start,end:r.dateFacetValueMap[t][sR(e.end)]||e.end}}function TM(e,t){return e.facetId in t.dateFacetValueMap}function PM(e,t){return TM(e,t)?{...e,values:e.values.map(r=>IM(r,e.facetId,t))}:e}function Op(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>PM(n,t))}}:e}d();c();l();u();d();c();l();u();var ws=P("didYouMean/enable"),_p=P("didYouMean/disable"),Rs=P("didYouMean/automaticCorrections/disable"),Np=P("didYouMean/automaticCorrections/enable"),xr=P("didYouMean/correction",e=>O(e,W)),Ra=P("didYouMean/automaticCorrections/mode",e=>O(e,new U({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Dp=()=>X("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),fv=()=>X("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),cR=()=>({actionCause:"didYouMeanClick"}),uR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function qp(){return{contextValues:{}}}d();c();l();u();function Mp(){return{contextValues:{}}}d();c();l();u();function mv(){return{enabled:!0,tabs:{}}}function Vp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function jp(){return[]}d();c();l();u();function Ar(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Lp(){return{}}d();c();l();u();function Up(){return{}}d();c();l();u();function Qp(){return{}}function lR(){return Br({})}function Br(e){return{context:e.context||qp(),dictionaryFieldContext:e.dictionaryFieldContext||Mp(),facetSet:e.facetSet||Zi(),numericFacetSet:e.numericFacetSet||Ji(),dateFacetSet:e.dateFacetSet||Xi(),categoryFacetSet:e.categoryFacetSet||Yi(),automaticFacetSet:e.automaticFacetSet??Wi(),pagination:e.pagination||Ar(),query:e.query||dt(),tabSet:e.tabSet||Qp(),advancedSearchQueries:e.advancedSearchQueries||Qr(),staticFilterSet:e.staticFilterSet||Up(),querySet:e.querySet||Lp(),sortCriteria:e.sortCriteria||Sr(),pipeline:e.pipeline||Kn(),searchHub:e.searchHub||Co(),facetOptions:e.facetOptions||Vp(),facetOrder:e.facetOrder??jp(),debug:e.debug??Eo()}}d();c();l();u();var kM=new J({values:{undoneQuery:Be},options:{required:!0}}),Bp=()=>X("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Gp=e=>X("analytics/trigger/query/undo",t=>(O(e,kM),t.makeUndoTriggerQuery(e))),$p=()=>X("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Hp=()=>X("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),zp=()=>X("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var Oo=P("trigger/query/ignore",e=>O(e,new U({emptyAllowed:!0,required:!0}))),Fs=P("trigger/query/modification",e=>O(e,new J({values:{originalQuery:st,modification:st}})));d();c();l();u();d();c();l();u();d();c();l();u();function _o(e){return Object.values(e).map(t=>t.request)}function ll(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function dR(e){return _o(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var gv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function OM(e){return _o(e).map(t=>{let r=gv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function _M(e){return[...OM(e.facetSet??{}),...dR(e.numericFacetSet??{}),...dR(e.dateFacetSet??{}),..._o(e.categoryFacetSet??{})]}function NM(e){return _M(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Wp(e){return ll(NM(e),e.facetOrder??[])}d();c();l();u();var No=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=MM(e),n=Wp(e),o=DM(e),a=yield Io(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return ko({...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"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),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 No(_x47,_x48){return _ref23.apply(this,arguments)}}();function DM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(qM).filter(r=>r.currentValues.length>0):void 0}function qM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function MM(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=VM(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function VM(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Do=class{constructor(t,r=n=>{this.dispatch(jt({q:n}))}){ye(this,"config",t);ye(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Op(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,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 vt(t.response)?(this.dispatch(To(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:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let C=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(lr(Br(_this12.getState()))),C})()}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],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this13.dispatch(To(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(lr(Br(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:fv()})})()}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:fv()}}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(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Oo("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this14.dispatch(To(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(lr(Br(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:Bp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...ir(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(lr(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Ad(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield No(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(xr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Fs({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield No(_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 pR=Ae("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Kp(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),fR=Ae("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield yv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),mR=Ae("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Sv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),gR=Ae("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield QM(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),hR=Ae("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return hv(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),jM=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function jM(_x61,_x62){return _ref29.apply(this,arguments)}}(),LM=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield Io(e);return ko({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function LM(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),UM=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request.numberOfResults=0,r});return function UM(_x66,_x67){return _ref31.apply(this,arguments)}}(),yR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function hv(_x68,_x69){return _hv.apply(this,arguments)}function _hv(){_hv=_asyncToGenerator(function*(e,t){O(e,{id:W,q:W,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new Do({...t,analyticsAction:$w()},m=>{t.dispatch(on({q:m,id:e.id}))}),i=yield LM(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _hv.apply(this,arguments)}function yv(_x70,_x71,_x72){return _yv.apply(this,arguments)}function _yv(){_yv=_asyncToGenerator(function*(e,t,r){yR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new Do({...t,analyticsAction:r}),f=yield No(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _yv.apply(this,arguments)}function Sv(_x73,_x74){return _Sv.apply(this,arguments)}function _Sv(){_Sv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield rv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new Do({...e,analyticsAction:rv()}),p=yield jM(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _Sv.apply(this,arguments)}function QM(_x75,_x76,_x77){return _QM.apply(this,arguments)}function _QM(){_QM=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new Do({...e,analyticsAction:t}),f=yield UM(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _QM.apply(this,arguments)}function Kp(_x78,_x79,_x80){return _Kp.apply(this,arguments)}function _Kp(){_Kp=_asyncToGenerator(function*(e,t,r){yR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield No(e,i),f=new Do({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Kp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var SR=Je(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Cr=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=xv(e),o=BM(e),a=GM(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield Io(e,r):As(e,t,r);return ko({...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"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:vv(e),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:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Cr(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function vv(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function BM(e){return ll(HM(e),e.facetOrder??[])}function GM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map($M).filter(r=>r.currentValues.length>0):void 0}function $M(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function HM(e){return zM(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function zM(e){return[...WM(e.facetSet??{}),...vR(e.numericFacetSet??{}),...vR(e.dateFacetSet??{}),..._o(e.categoryFacetSet??{})]}function WM(e){return _o(e).map(t=>{let r=gv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function vR(e){return _o(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function xv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=SR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var qo=class{constructor(t,r=n=>{this.dispatch(jt({q:n}))}){ye(this,"config",t);ye(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Op(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,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 vt(t.response)?(this.dispatch(To(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:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let C=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(lr(Br(_this19.getState()))),C})()}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],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this20.dispatch(To(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(lr(Br(_this20.getState()))),{...a,response:{...a.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(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Oo("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this21.dispatch(To(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(lr(Br(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(lr(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Ad(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=uR(),o=yield _this22.fetchFromAPI(yield Cr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(xr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Fs({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Cr(_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 Es=Ae("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new U,enableQuerySyntax:new de,clearFilters:new de}),e.clearFilters&&(r(ft()),r(fs())),r(nn({allow:!0})),r(jt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(an(1))}),xR=P("search/updateSearchAction"),z=Ae("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Kp(r,t,e.legacy);AR(r);let n=e.next?CR(e.next):void 0,o=yield Cr(r,t.extra.navigatorContext,n),a=new qo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),Lt=Ae("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(AR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return yv(r,t,e.legacy);let n=new qo({...t,analyticsAction:e.next}),o=yield Cr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),br=Ae("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Sv(t,r);let n=kw("browseResults",t.getState),o=new qo({...t,analyticsAction:n}),a=yield KM(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),wr=Ae("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Kp(r,t,e.legacy);let n=new qo({...t,analyticsAction:{}}),o=yield XM(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),Is=Ae("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return hv(e,t);O(e,{id:W,q:W,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=CR(Hw()),i=yield YM(r,t.extra.navigatorContext,n,o,a),p=new qo({...t,analyticsAction:a},g=>{t.dispatch(on({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x94,_x95){return _ref37.apply(this,arguments)}}()),KM=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function KM(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),YM=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=As(e,t,o);return ko({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function YM(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),XM=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request.numberOfResults=0,n});return function XM(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),AR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},CR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Mo=(e,t)=>{let r=e;return pe(r[t])?pe(e.raw[t])?null:e.raw[t]:r[t]},JM=e=>t=>e.every(r=>!pe(Mo(t,r))),ZM=e=>t=>e.every(r=>pe(Mo(t,r))),eV=(e,t)=>r=>{let n=bR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},tV=(e,t)=>r=>{let n=bR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},bR=(e,t)=>{let r=Mo(t,e);return ld(r)?r:[r]},wR={getResultProperty:Mo,fieldsMustBeDefined:JM,fieldsMustNotBeDefined:ZM,fieldMustMatch:eV,fieldMustNotMatch:tV};function dl(e){return e.search.response.searchUid!==""}function RR(e,t,r){return e.search.results.find(n=>Mo(n,t)===r)}var Av=Je(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Ts=P("app/setError");function Cv(e,t){let r=t.payload??null;r&&(e.response=ir().response,e.results=[],e.questionAnswer=qi()),e.error=r,e.isLoading=!1}function bv(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function rV(e,t){bv(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function FR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function nV(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var ge=ae(ir(),e=>{e.addCase(z.rejected,(t,r)=>Cv(t,r)),e.addCase(br.rejected,(t,r)=>Cv(t,r)),e.addCase(Lt.rejected,(t,r)=>Cv(t,r)),e.addCase(z.fulfilled,(t,r)=>{rV(t,r)}),e.addCase(br.fulfilled,(t,r)=>{bv(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Lt.fulfilled,(t,r)=>{bv(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(wr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(z.pending,FR),e.addCase(br.pending,nV),e.addCase(Lt.pending,FR),e.addCase(xR,(t,r)=>{t.searchAction=r.payload}),e.addCase(Ts,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var Ps=P("searchHub/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var ks=ae(Co(),e=>{e.addCase(Ps,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(vr,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ER=class extends Error{constructor(t){super(t[0].message);ye(this,"issues");this.name="SchemaError",this.issues=t}};var Xn="uninitialized",Rv="pending",fl="fulfilled",ml="rejected";function IR(e){return{status:e,isUninitialized:e===Xn,isLoading:e===Rv,isSuccess:e===fl,isError:e===ml}}var TR=Xr;function BR(e,t){if(e===t||!(TR(e)&&TR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=BR(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function Fv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function oV(e){return new RegExp("(^|:)//").test(e)}function aV(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Pv(e){return e!=null}function PR(e){return[...(e?.values()??[])].filter(Pv)}function iV(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var sV=e=>e.replace(/\/$/,""),cV=e=>e.replace(/^\//,"");function uV(e,t){if(!e)return t;if(!t)return e;if(oV(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=sV(e),t=cV(t),`${e}${r}${t}`}function Jp(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Ev=()=>new Map,lV=e=>{let t=new s.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},dV=(...e)=>{for(let r of e)if(r.aborted)return s.AbortSignal.abort(r.reason);let t=new s.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},kR=(...e)=>S(...e),pV=e=>e.status>=200&&e.status<=299,fV=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function OR(e){if(!Xr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var mV=e=>typeof e=="object"&&(Xr(e)||Array.isArray(e)||typeof e.toJSON=="function");function GR({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=kR,paramsSerializer:n,isJsonContentType:o=fV,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===kR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(C,h,A){let{getState:b,extra:w,endpoint:R,forced:E,type:I}=h,k,{url:T,headers:D=new x(g.headers),params:B=void 0,responseHandler:L=f??"json",validateStatus:V=m??pV,timeout:Q=p,...j}=typeof C=="string"?{url:C}:C,_={...g,signal:Q?dV(h.signal,lV(Q)):h.signal,...j};D=new x(OR(D)),_.headers=(yield t(D,{getState:b,arg:C,extra:w,endpoint:R,forced:E,type:I,extraOptions:A}))||D;let N=mV(_.body);if(_.body!=null&&!N&&typeof _.body!="string"&&_.headers.delete("content-type"),!_.headers.has("content-type")&&N&&_.headers.set("content-type",a),N&&o(_.headers)&&(_.body=JSON.stringify(_.body,i)),_.headers.has("accept")||(L==="json"?_.headers.set("accept","application/json"):L==="text"&&_.headers.set("accept","text/plain, text/html, */*")),B){let ue=~T.indexOf("?")?"&":"?",he=n?n(B):new URLSearchParams(OR(B));T+=ue+he}T=uV(e,T);let q=new Request(T,_);k={request:new Request(T,_)};let H;try{H=yield r(q)}catch(ue){return{error:{status:(ue instanceof Error||typeof DOMException<"u"&&ue instanceof DOMException)&&ue.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:k}}let ne=H.clone();k.response=ne;let te,Z="";try{let ue;if(yield Promise.all([v(H,L).then(he=>te=he,he=>ue=he),ne.text().then(he=>Z=he,()=>{})]),ue)throw ue}catch(ue){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(ue)},meta:k}}return V(H,te)?{data:te,meta:k}:{error:{status:H.status,data:te},meta:k}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function v(_x110,_x111){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(C,h){if(typeof h=="function")return h(C);if(h==="content-type"&&(h=o(C.headers)?"json":"text"),h==="json"){let A=yield C.text();return A.length?JSON.parse(A):null}return C.text()});return _v2.apply(this,arguments)}}var Os=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function gV(){return _gV.apply(this,arguments)}function _gV(){_gV=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((a,i)=>{let p=setTimeout(()=>a(),o);if(r){let f=()=>{clearTimeout(p),i(new Error("Aborted"))};r.aborted?(clearTimeout(p),i(new Error("Aborted"))):r.addEventListener("abort",f,{once:!0})}})});return _gV.apply(this,arguments)}function $R(e,t){throw Object.assign(new Os({error:e,meta:t}),{throwImmediately:!0})}function wv(e){e.aborted&&$R({status:"CUSTOM_ERROR",error:"Aborted"})}var _R={},hV=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||_R).maxRetries,(o||_R).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:gV,retryCondition:(g,v,{attempt:C})=>C<=i,...t,...o},m=0;for(;;){wv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Os(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Os)return g.value;throw g}if(g instanceof Os){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};wv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(v){throw wv(n.signal),v}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),HR=Object.assign(hV,{fail:$R}),ef="__rtkq/",yV="online",SV="offline";var zR="focused";var kv=P(`${ef}${zR}`),WR=P(`${ef}un${zR}`),Ov=P(`${ef}${yV}`),KR=P(`${ef}${SV}`);var yl="query",YR="mutation",XR="infinitequery";function tf(e){return e.type===yl}function vV(e){return e.type===YR}function rf(e){return e.type===XR}function Zp(e){return tf(e)||rf(e)}function _v(e,t,r,n,o,a){let i=xV(e)?e(t,r,n,o):e;return i?Fv(i,Pv,p=>a(JR(p))):[]}function xV(e){return typeof e=="function"}function JR(e){return typeof e=="string"?{type:e}:e}function AV(e,t){return e.catch(t)}var _s=(e,t)=>e.endpointDefinitions[t],gl=Symbol("forceQueryFn"),Iv=e=>typeof e[gl]=="function";function CV({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=T=>i(T)?.runningQueries,f=T=>i(T)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:g,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:E,buildInitiateInfiniteQuery:I,buildInitiateMutation:k,getRunningQueryThunk:C,getRunningMutationThunk:h,getRunningQueriesThunk:A,getRunningMutationsThunk:b};function C(T,D){return B=>{let L=_s(a,T),V=e({queryArgs:D,endpointDefinition:L,endpointName:T});return p(B)?.get(V)}}function h(T,D){return B=>f(B)?.get(D)}function A(){return T=>PR(p(T))}function b(){return T=>PR(f(T))}function w(T){}function R(T,D){let B=(L,{subscribe:V=!0,forceRefetch:Q,subscriptionOptions:j,[gl]:_,...N}={})=>(q,Y)=>{let H=e({queryArgs:L,endpointDefinition:D,endpointName:T}),ne,te={...N,type:yl,subscribe:V,forceRefetch:Q,subscriptionOptions:j,endpointName:T,originalArgs:L,queryCacheKey:H,[gl]:_};if(tf(D))ne=t(te);else{let{direction:Re,initialPageParam:Pe,refetchCachedPages:Ie}=N;ne=r({...te,direction:Re,initialPageParam:Pe,refetchCachedPages:Ie})}let Z=o.endpoints[T].select(L),ue=q(ne),he=Z(Y());let{requestId:Ve,abort:Xe}=ue,Ue=he.requestId!==Ve,He=p(q)?.get(H),ze=()=>Z(Y()),Ee=Object.assign(_?ue.then(ze):Ue&&!He?Promise.resolve(he):Promise.all([He,ue]).then(ze),{arg:L,requestId:Ve,subscriptionOptions:j,queryCacheKey:H,abort:Xe,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>q(B(L,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){V&&q(m({queryCacheKey:H,requestId:Ve}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,q(v({endpointName:T,requestId:Ve,queryCacheKey:H,options:Re}))}});if(!He&&!Ue&&!_){let Re=p(q);Re.set(H,Ee),Ee.then(()=>{Re.delete(H)})}return Ee};return B}function E(T,D){return R(T,D)}function I(T,D){return R(T,D)}function k(T){return(D,{track:B=!0,fixedCacheKey:L}={})=>(V,Q)=>{let j=n({type:"mutation",endpointName:T,originalArgs:D,track:B,fixedCacheKey:L}),_=V(j);let{requestId:N,abort:q,unwrap:Y}=_,H=AV(_.unwrap().then(ue=>({data:ue})),ue=>({error:ue})),ne=()=>{V(g({requestId:N,fixedCacheKey:L}))},te=Object.assign(H,{arg:_.arg,requestId:N,abort:q,unwrap:Y,reset:ne}),Z=f(V);return Z.set(N,te),te.then(()=>{Z.delete(N)}),L&&(Z.set(L,te),te.then(()=>{Z.get(L)===te&&Z.delete(L)})),te}}}var ZR=class extends ER{constructor(e,t,r,n){super(e),this.value=t,this.schemaName=r,this._bqMeta=n}},Ea=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ia(_x115,_x116,_x117,_x118){return _Ia.apply(this,arguments)}function _Ia(){_Ia=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new ZR(o.issues,t,r,n);return o.value});return _Ia.apply(this,arguments)}function NR(e){return e}var pl=(e={})=>({...e,[$u]:!0});function bV({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(j,_,N,q)=>(Y,H)=>{let ne=r[j],te=n({queryArgs:_,endpointDefinition:ne,endpointName:j});if(Y(o.internalActions.queryResultPatched({queryCacheKey:te,patches:N})),!q)return;let Z=o.endpoints[j].select(_)(H()),ue=_v(ne.providesTags,Z.data,void 0,_,{},a);Y(o.internalActions.updateProvidedBy([{queryCacheKey:te,providedTags:ue}]))};function v(j,_,N=0){let q=[_,...j];return N&&q.length>N?q.slice(0,-1):q}function C(j,_,N=0){let q=[...j,_];return N&&q.length>N?q.slice(1):q}let h=(j,_,N,q=!0)=>(Y,H)=>{let te=o.endpoints[j].select(_)(H()),Z={patches:[],inversePatches:[],undo:()=>Y(o.util.patchQueryData(j,_,Z.inversePatches,q))};if(te.status===Xn)return Z;let ue;if("data"in te)if(Wt(te.data)){let[he,Ve,Xe]=aS(te.data,N);Z.patches.push(...Ve),Z.inversePatches.push(...Xe),ue=he}else ue=N(te.data),Z.patches.push({op:"replace",path:[],value:ue}),Z.inversePatches.push({op:"replace",path:[],value:te.data});return Z.patches.length===0||Y(o.util.patchQueryData(j,_,Z.patches,q)),Z},A=(j,_,N)=>q=>q(o.endpoints[j].initiate(_,{subscribe:!1,forceRefetch:!0,[gl]:()=>({data:N})})),b=(j,_)=>j.query&&j[_]?j[_]:NR,w=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(j,{signal:_,abort:N,rejectWithValue:q,fulfillWithValue:Y,dispatch:H,getState:ne,extra:te}){let Z=r[j.endpointName],{metaSchema:ue,skipSchemaValidation:he=m}=Z,Ve=j.type===yl;try{let Xe=NR,Ue={signal:_,abort:N,dispatch:H,getState:ne,extra:te,endpoint:j.endpointName,type:j.type,forced:Ve?R(j,ne()):void 0,queryCacheKey:Ve?j.queryCacheKey:void 0},He=Ve?j[gl]:void 0,ze,Ee=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(Pe,Ie,ut,yt){if(Ie==null&&Pe.pages.length)return Promise.resolve({data:Pe});let qr={queryArg:j.originalArgs,pageParam:Ie},ar=yield Re(qr),Yr=yt?v:C;return{data:{pages:Yr(Pe.pages,ar.data,ut),pageParams:Yr(Pe.pageParams,Ie,ut)},meta:ar.meta}});return function Ee(_x121,_x122,_x123,_x124){return _ref44.apply(this,arguments)}}();function Re(_x125){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(Pe){let Ie,{extraOptions:ut,argSchema:yt,rawResponseSchema:qr,responseSchema:ar}=Z;if(yt&&!Ea(he,"arg")&&(Pe=yield Ia(yt,Pe,"argSchema",{})),He?Ie=He():Z.query?(Xe=b(Z,"transformResponse"),Ie=yield t(Z.query(Pe),Ue,ut)):Ie=yield Z.queryFn(Pe,Ue,ut,Mr=>t(Mr,Ue,ut)),typeof process<"u",Ie.error)throw new Os(Ie.error,Ie.meta);let{data:Yr}=Ie;qr&&!Ea(he,"rawResponse")&&(Yr=yield Ia(qr,Ie.data,"rawResponseSchema",Ie.meta));let mr=yield Xe(Yr,Ie.meta,Pe);return ar&&!Ea(he,"response")&&(mr=yield Ia(ar,mr,"responseSchema",Ie.meta)),{...Ie,data:mr}});return _Re.apply(this,arguments)}if(Ve&&"infiniteQueryOptions"in Z){let{infiniteQueryOptions:Pe}=Z,{maxPages:Ie=1/0}=Pe,ut=j.refetchCachedPages??Pe.refetchCachedPages??!0,yt,qr={pages:[],pageParams:[]},ar=i.selectQueryEntry(ne(),j.queryCacheKey)?.data,mr=R(j,ne())&&!j.direction||!ar?qr:ar;if("direction"in j&&j.direction&&mr.pages.length){let Mr=j.direction==="backward",od=(Mr?eF:Tv)(Pe,mr,j.originalArgs);yt=yield Ee(mr,od,Ie,Mr)}else{let{initialPageParam:Mr=Pe.initialPageParam}=j,yu=ar?.pageParams??[],od=yu[0]??Mr,p_=yu.length;if(yt=yield Ee(mr,od,Ie),He&&(yt={data:yt.data.pages[0]}),ut)for(let NA=1;NA<p_;NA++){let f_=Tv(Pe,yt.data,j.originalArgs);yt=yield Ee(yt.data,f_,Ie)}}ze=yt}else ze=yield Re(j.originalArgs);return ue&&!Ea(he,"meta")&&ze.meta&&(ze.meta=yield Ia(ue,ze.meta,"metaSchema",ze.meta)),Y(ze.data,pl({fulfilledTimeStamp:Date.now(),baseQueryMeta:ze.meta}))}catch(Xe){let Ue=Xe;if(Ue instanceof Os){let He=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:ze,errorResponseSchema:Ee}=Z,{value:Re,meta:Pe}=Ue;try{ze&&!Ea(he,"rawErrorResponse")&&(Re=yield Ia(ze,Re,"rawErrorResponseSchema",Pe)),ue&&!Ea(he,"meta")&&(Pe=yield Ia(ue,Pe,"metaSchema",Pe));let Ie=yield He(Re,Pe,j.originalArgs);return Ee&&!Ea(he,"errorResponse")&&(Ie=yield Ia(Ee,Ie,"errorResponseSchema",Pe)),q(Ie,pl({baseQueryMeta:Pe}))}catch(Ie){Ue=Ie}}try{if(Ue instanceof ZR){let He={endpoint:j.endpointName,arg:j.originalArgs,type:j.type,queryCacheKey:Ve?j.queryCacheKey:void 0};Z.onSchemaFailure?.(Ue,He),p?.(Ue,He);let{catchSchemaFailure:ze=f}=Z;if(ze)return q(ze(Ue,He),pl({baseQueryMeta:Ue._bqMeta}))}}catch(He){Ue=He}throw typeof process<"u",console.error(Ue),Ue}});return function w(_x119,_x120){return _ref43.apply(this,arguments)}}();function R(j,_){let N=i.selectQueryEntry(_,j.queryCacheKey),q=i.selectConfig(_).refetchOnMountOrArgChange,Y=N?.fulfilledTimeStamp,H=j.forceRefetch??(j.subscribe&&q);return H?H===!0||(Number(new Date)-Number(Y))/1e3>=H:!1}let E=()=>Ae(`${e}/executeQuery`,w,{getPendingMeta({arg:_}){let N=r[_.endpointName];return pl({startedTimeStamp:Date.now(),...(rf(N)?{direction:_.direction}:{})})},condition(_,{getState:N}){let q=N(),Y=i.selectQueryEntry(q,_.queryCacheKey),H=Y?.fulfilledTimeStamp,ne=_.originalArgs,te=Y?.originalArgs,Z=r[_.endpointName],ue=_.direction;return Iv(_)?!0:Y?.status==="pending"?!1:R(_,q)||tf(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ue)},dispatchConditionRejection:!0}),I=E(),k=E(),T=Ae(`${e}/executeMutation`,w,{getPendingMeta(){return pl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,B=j=>"ifOlderThan"in j,L=(j,_,N={})=>(q,Y)=>{let H=D(N)&&N.force,ne=B(N)&&N.ifOlderThan,te=(ue=!0)=>{let he={forceRefetch:ue,subscribe:!1};return o.endpoints[j].initiate(_,he)},Z=o.endpoints[j].select(_)(Y());if(H)q(te());else if(ne){let ue=Z?.fulfilledTimeStamp;if(!ue){q(te());return}(Number(new Date)-Number(new Date(ue)))/1e3>=ne&&q(te())}else q(te(!1))};function V(j){return _=>_?.meta?.arg?.endpointName===j}function Q(j,_){return{matchPending:Ui(Bd(j),V(_)),matchFulfilled:Ui(Hn(j),V(_)),matchRejected:Ui(Sa(j),V(_))}}return{queryThunk:I,mutationThunk:T,infiniteQueryThunk:k,prefetch:L,updateQueryData:h,upsertQueryData:A,patchQueryData:g,buildMatchThunkActions:Q}}function Tv(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function eF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function tF(e,t,r,n){return _v(r[e.meta.arg.endpointName][t],Hn(e)?e.payload:void 0,zu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function DR(e){return zt(e)?qd(e):e}function Yp(e,t,r){let n=e[t];n&&r(n)}function hl(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function qR(e,t,r){let n=e[hl(t)];n&&r(n)}var Xp={};function wV({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=P(`${e}/resetApiState`);function v(V,Q,j,_){var N;V[N=Q.queryCacheKey]??(V[N]={status:Xn,endpointName:Q.endpointName}),Yp(V,Q.queryCacheKey,q=>{q.status=Rv,q.requestId=j&&q.requestId?q.requestId:_.requestId,Q.originalArgs!==void 0&&(q.originalArgs=Q.originalArgs),q.startedTimeStamp=_.startedTimeStamp;let Y=o[_.arg.endpointName];rf(Y)&&"direction"in Q&&(q.direction=Q.direction)})}function C(V,Q,j,_){Yp(V,Q.arg.queryCacheKey,N=>{if(N.requestId!==Q.requestId&&!_)return;let{merge:q}=o[Q.arg.endpointName];if(N.status=fl,q){if(N.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=Q,Z=ha(N.data,ue=>q(ue,j,{arg:H.originalArgs,baseQueryMeta:ne,fulfilledTimeStamp:Y,requestId:te}));N.data=Z}else N.data=j;}else N.data=o[Q.arg.endpointName].structuralSharing??!0?BR(zt(N.data)?QC(N.data):N.data,j):j;delete N.error,N.fulfilledTimeStamp=Q.fulfilledTimeStamp})}let h=va({name:`${e}/queries`,initialState:Xp,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:Q}}){delete V[Q]},prepare:Qi()},cacheEntriesUpserted:{reducer(V,Q){for(let j of Q.payload){let{queryDescription:_,value:N}=j;v(V,_,!0,{arg:_,requestId:Q.meta.requestId,startedTimeStamp:Q.meta.timestamp}),C(V,{arg:_,requestId:Q.meta.requestId,fulfilledTimeStamp:Q.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:V=>({payload:V.map(_=>{let{endpointName:N,arg:q,value:Y}=_,H=o[N];return{queryDescription:{type:yl,endpointName:N,originalArgs:_.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:N})},value:Y}}),meta:{[$u]:!0,requestId:Wu(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:Q,patches:j}}){Yp(V,Q,_=>{_.data=iS(_.data,j.concat())})},prepare:Qi()}},extraReducers(V){V.addCase(t.pending,(Q,{meta:j,meta:{arg:_}})=>{let N=Iv(_);v(Q,_,N,j)}).addCase(t.fulfilled,(Q,{meta:j,payload:_})=>{let N=Iv(j.arg);C(Q,j,_,N)}).addCase(t.rejected,(Q,{meta:{condition:j,arg:_,requestId:N},error:q,payload:Y})=>{Yp(Q,_.queryCacheKey,H=>{if(!j){if(H.requestId!==N)return;H.status=ml,H.error=Y??q}})}).addMatcher(p,(Q,j)=>{let{queries:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===fl||q?.status===ml)&&(Q[N]=q)})}}),A=va({name:`${e}/mutations`,initialState:Xp,reducers:{removeMutationResult:{reducer(V,{payload:Q}){let j=hl(Q);j in V&&delete V[j]},prepare:Qi()}},extraReducers(V){V.addCase(r.pending,(Q,{meta:j,meta:{requestId:_,arg:N,startedTimeStamp:q}})=>{N.track&&(Q[hl(j)]={requestId:_,status:Rv,endpointName:N.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(Q,{payload:j,meta:_})=>{_.arg.track&&qR(Q,_,N=>{N.requestId===_.requestId&&(N.status=fl,N.data=j,N.fulfilledTimeStamp=_.fulfilledTimeStamp)})}).addCase(r.rejected,(Q,{payload:j,error:_,meta:N})=>{N.arg.track&&qR(Q,N,q=>{q.requestId===N.requestId&&(q.status=ml,q.error=j??_)})}).addMatcher(p,(Q,j)=>{let{mutations:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===fl||q?.status===ml)&&N!==q?.requestId&&(Q[N]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(V,Q){var j,_,N;for(let{queryCacheKey:q,providedTags:Y}of Q.payload){R(V,q);for(let{type:H,id:ne}of Y){let te=(_=(j=V.tags)[H]??(j[H]={}))[N=ne||"__internal_without_id"]??(_[N]=[]);te.includes(q)||te.push(q)}V.keys[q]=Y}},prepare:Qi()}},extraReducers(V){V.addCase(h.actions.removeQueryResult,(Q,{payload:{queryCacheKey:j}})=>{R(Q,j)}).addMatcher(p,(Q,j)=>{var N,q,Y;let{provided:_}=i(j);for(let[H,ne]of Object.entries(_.tags??{}))for(let[te,Z]of Object.entries(ne)){let ue=(q=(N=Q.tags)[H]??(N[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let he of Z)ue.includes(he)||ue.push(he),Q.keys[he]=_.keys[he]}}).addMatcher(Jr(Hn(t),zu(t)),(Q,j)=>{E(Q,[j])}).addMatcher(h.actions.cacheEntriesUpserted.match,(Q,j)=>{let _=j.payload.map(({queryDescription:N,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));E(Q,_)})}});function R(V,Q){let j=DR(V.keys[Q]??[]);for(let _ of j){let N=_.type,q=_.id??"__internal_without_id",Y=V.tags[N]?.[q];Y&&(V.tags[N][q]=DR(Y).filter(H=>H!==Q))}delete V.keys[Q]}function E(V,Q){let j=Q.map(_=>{let N=tF(_,"providesTags",o,f),{queryCacheKey:q}=_.meta.arg;return{queryCacheKey:q,providedTags:N}});w.caseReducers.updateProvidedBy(V,w.actions.updateProvidedBy(j))}let I=va({name:`${e}/subscriptions`,initialState:Xp,reducers:{updateSubscriptionOptions(V,Q){},unsubscribeQueryResult(V,Q){},internal_getRTKQSubscriptions(){}}}),k=va({name:`${e}/internalSubscriptions`,initialState:Xp,reducers:{subscriptionsUpdated:{reducer(V,Q){return iS(V,Q.payload)},prepare:Qi()}}}),T=va({name:`${e}/config`,initialState:{online:iV(),focused:aV(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:Q}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==Q?"conflict":!0}},extraReducers:V=>{V.addCase(Ov,Q=>{Q.online=!0}).addCase(KR,Q=>{Q.online=!1}).addCase(kv,Q=>{Q.focused=!0}).addCase(WR,Q=>{Q.focused=!1}).addMatcher(p,Q=>({...Q}))}}),D=Vi({queries:h.reducer,mutations:A.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),B=(V,Q)=>D(g.match(Q)?void 0:V,Q),L={...T.actions,...h.actions,...I.actions,...k.actions,...A.actions,...w.actions,resetApiState:g};return{reducer:B,actions:L}}var Ta=Symbol.for("RTKQ/skipToken"),rF={status:Xn},MR=ha(rF,()=>{}),VR=ha(rF,()=>{});function RV({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>MR,o=I=>VR;return{buildQuerySelector:C,buildInfiniteQuerySelector:h,buildMutationSelector:A,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(I){return{...I,...IR(I.status)}}function i(I){return I[t]}function p(I){return i(I)?.queries}function f(I,k){return p(I)?.[k]}function m(I){return i(I)?.mutations}function g(I){return i(I)?.config}function v(I,k,T){return D=>{if(D===Ta)return r(n,T);let B=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(V=>f(V,B)??MR,T)}}function C(I,k){return v(I,k,a)}function h(I,k){let{infiniteQueryOptions:T}=k;function D(B){let L={...B,...IR(B.status)},{isLoading:V,isError:Q,direction:j}=L,_=j==="forward",N=j==="backward";return{...L,hasNextPage:R(T,L.data,L.originalArgs),hasPreviousPage:E(T,L.data,L.originalArgs),isFetchingNextPage:V&&_,isFetchingPreviousPage:V&&N,isFetchNextPageError:Q&&_,isFetchPreviousPageError:Q&&N}}return v(I,k,D)}function A(){return I=>{let k;return typeof I=="object"?k=hl(I)??Ta:k=I,r(k===Ta?o:B=>i(B)?.mutations?.[k]??VR,a)}}function b(I,k){let T=I[t],D=new Set,B=Fv(k,Pv,JR);for(let L of B){let V=T.provided.tags[L.type];if(!V)continue;let Q=(L.id!==void 0?V[L.id]:Object.values(V).flat())??[];for(let j of Q)D.add(j)}return Array.from(D.values()).flatMap(L=>{let V=T.queries[L];return V?{queryCacheKey:L,endpointName:V.endpointName,originalArgs:V.originalArgs}:[]})}function w(I,k){return Fv(Object.values(p(I)),T=>T?.endpointName===k&&T.status!==Xn,T=>T.originalArgs)}function R(I,k,T){return k?Tv(I,k,T)!=null:!1}function E(I,k,T){return!k||!I.getPreviousPageParam?!1:eF(I,k,T)!=null}}var jR=WeakMap?new WeakMap:void 0,LR=({endpointName:e,queryArgs:t})=>{let r="",n=jR?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Xr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Xr(t)&&jR?.set(t,o),r=o}return`${e}(${r})`};function FV(...e){return function(r){let n=Bu(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=LR;if("serializeQueryArgs"in m.endpointDefinition){let v=m.endpointDefinition.serializeQueryArgs;g=C=>{let h=v(C);return typeof h=="string"?h:LR({...C,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Wu(),extractRehydrationInfo:n,hasRehydrationInfo:Bu(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let v of m)o.tagTypes.includes(v)||o.tagTypes.push(v);if(g)for(let[v,C]of Object.entries(g))typeof C=="function"?C(_s(a,v)):Object.assign(_s(a,v)||{},C);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:v=>({...v,type:yl}),mutation:v=>({...v,type:YR}),infiniteQuery:v=>({...v,type:XR})});for(let[v,C]of Object.entries(g)){if(m.overrideExisting!==!0&&v in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Kt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[v]=C;for(let h of p)h.injectEndpoint(v,C)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Yn(e,...t){return Object.assign(e,...t)}var EV=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,a=null,i=null,{updateSubscriptionOptions:p,unsubscribeQueryResult:f}=e.internalActions,m=(b,w)=>{if(p.match(w)){let{queryCacheKey:E,requestId:I,options:k}=w.payload,T=b.get(E);return T?.has(I)&&T.set(I,k),!0}if(f.match(w)){let{queryCacheKey:E,requestId:I}=w.payload,k=b.get(E);return k&&k.delete(I),!0}if(e.internalActions.removeQueryResult.match(w))return b.delete(w.payload.queryCacheKey),!0;if(t.pending.match(w)){let{meta:{arg:E,requestId:I}}=w,k=Jp(b,E.queryCacheKey,Ev);return E.subscribe&&k.set(I,E.subscriptionOptions??k.get(I)??{}),!0}let R=!1;if(t.rejected.match(w)){let{meta:{condition:E,arg:I,requestId:k}}=w;if(E&&I.subscribe){let T=Jp(b,I.queryCacheKey,Ev);T.set(k,I.subscriptionOptions??T.get(k)??{}),R=!0}}return R},g=()=>r.currentSubscriptions,h={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function A(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,R])=>[w,Object.fromEntries(R)]))))}return(b,w)=>{if(a||(a=A(r.currentSubscriptions)),e.util.resetApiState.match(b))return a={},r.currentSubscriptions.clear(),i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(b))return[!1,h];let R=m(r.currentSubscriptions,b),E=!0;if(R){i||(i=setTimeout(()=>{let T=A(r.currentSubscriptions),[,D]=aS(a,()=>T);w.next(e.internalActions.subscriptionsUpdated(D)),a=T,i=null},500));let I=typeof b.type=="string"&&!!b.type.startsWith(o),k=t.rejected.match(b)&&b.meta.condition&&!!b.meta.arg.subscribe;E=!I&&!k}return[E,!1]}},IV=2147483647/1e3-1,TV=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i},getRunningQueryThunk:p,mwApi:f})=>{let{removeQueryResult:m,unsubscribeQueryResult:g,cacheEntriesUpserted:v}=t.internalActions,C=Jr(g.match,r.fulfilled,r.rejected,v.match);function h(I){let k=o.currentSubscriptions.get(I);return k?k.size>0:!1}let A={};function b(I){for(let k of I.values())k?.abort?.()}let w=(I,k)=>{let T=k.getState(),D=i(T);if(C(I)){let B;if(v.match(I))B=I.payload.map(L=>L.queryDescription.queryCacheKey);else{let{queryCacheKey:L}=g.match(I)?I.payload:I.meta.arg;B=[L]}R(B,k,D)}if(t.util.resetApiState.match(I)){for(let[B,L]of Object.entries(A))L&&clearTimeout(L),delete A[B];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:B}=n.extractRehydrationInfo(I);R(Object.keys(B),k,D)}};function R(I,k,T){let D=k.getState();for(let B of I){let L=a(D,B);L?.endpointName&&E(B,L.endpointName,k,T)}}function E(I,k,T,D){let L=_s(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let V=Math.max(0,Math.min(L,IV));if(!h(I)){let Q=A[I];Q&&clearTimeout(Q),A[I]=setTimeout(()=>{if(!h(I)){let j=a(T.getState(),I);j?.endpointName&&T.dispatch(p(j.endpointName,j.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:I}))}delete A[I]},V*1e3)}}return w},UR=new Error("Promise never resolved before cacheEntryRemoved."),PV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Gd(n),m=Gd(o),g=Hn(n,o),v={},{removeQueryResult:C,removeMutationResult:h,cacheEntriesUpserted:A}=e.internalActions;function b(T,D,B){let L=v[T];L?.valueResolved&&(L.valueResolved({data:D,meta:B}),delete L.valueResolved)}function w(T){let D=v[T];D&&(delete v[T],D.cacheEntryRemoved())}function R(T){let{arg:D,requestId:B}=T.meta,{endpointName:L,originalArgs:V}=D;return[L,V,B]}let E=(T,D,B)=>{let L=I(T);function V(Q,j,_,N){let q=i(B,j),Y=i(D.getState(),j);!q&&Y&&k(Q,N,j,D,_)}if(n.pending.match(T)){let[Q,j,_]=R(T);V(Q,L,_,j)}else if(A.match(T))for(let{queryDescription:Q,value:j}of T.payload){let{endpointName:_,originalArgs:N,queryCacheKey:q}=Q;V(_,q,T.meta.requestId,N),b(q,j,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[L]){let[j,_,N]=R(T);k(j,_,L,D,N)}}else if(g(T))b(L,T.payload,T.meta.baseQueryMeta);else if(C.match(T)||h.match(T))w(L);else if(e.util.resetApiState.match(T))for(let Q of Object.keys(v))w(Q)};function I(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:C.match(T)?T.payload.queryCacheKey:h.match(T)?hl(T.payload):""}function k(T,D,B,L,V){let Q=_s(r,T),j=Q?.onCacheEntryAdded;if(!j)return;let _={},N=new Promise(Z=>{_.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{_.valueResolved=Z}),N.then(()=>{throw UR})]);q.catch(()=>{}),v[B]=_;let Y=e.endpoints[T].select(Zp(Q)?D:B),H=L.dispatch((Z,ue,he)=>he),ne={...L,getCacheEntry:()=>Y(L.getState()),requestId:V,extra:H,updateCachedData:Zp(Q)?Z=>L.dispatch(e.util.updateQueryData(T,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:N},te=j(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==UR)throw Z})}return E},kV=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},OV=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Jr(Hn(n),zu(n)),v=Jr(Hn(o,n),Sa(o,n)),C=[],h=0,A=(R,E)=>{(o.pending.match(R)||n.pending.match(R))&&h++,v(R)&&(h=Math.max(0,h-1)),g(R)?w(tF(R,"invalidatesTags",r,i),E):v(R)?w([],E):a.util.invalidateTags.match(R)&&w(_v(R.payload,void 0,void 0,void 0,void 0,i),E)};function b(){return h>0}function w(R,E){let I=E.getState(),k=I[e];if(C.push(...R),k.config.invalidationBehavior==="delayed"&&b())return;let T=C;if(C=[],T.length===0)return;let D=a.util.selectInvalidatedBy(I,T);t.batch(()=>{let B=Array.from(D.values());for(let{queryCacheKey:L}of B){let V=k.queries[L],Q=Jp(f.currentSubscriptions,L,Ev);V&&(Q.size===0?E.dispatch(m({queryCacheKey:L})):V.status!==Xn&&E.dispatch(p(V)))}})}return A},_V=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,R)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,R),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,R),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&v(w.meta.arg,R),r.util.resetApiState.match(w)&&(A(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,R){p.add(w),f||(f=setTimeout(()=>{for(let E of p)C({queryCacheKey:E},R);p.clear(),f=null},0))}function v({queryCacheKey:w},R){let E=R.getState()[e],I=E.queries[w],k=i.get(w);if(!I||I.status===Xn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=b(k);if(!Number.isFinite(T))return;let B=a.get(w);B?.timeout&&(clearTimeout(B.timeout),B.timeout=void 0);let L=Date.now()+T;a.set(w,{nextPollTimestamp:L,pollingInterval:T,timeout:setTimeout(()=>{(E.config.focused||!D)&&R.dispatch(n(I)),v({queryCacheKey:w},R)},T)})}function C({queryCacheKey:w},R){let I=R.getState()[e].queries[w],k=i.get(w);if(!I||I.status===Xn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){h(w);return}let D=a.get(w),B=Date.now()+T;(!D||B<D.nextPollTimestamp)&&v({queryCacheKey:w},R)}function h(w){let R=a.get(w);R?.timeout&&clearTimeout(R.timeout),a.delete(w)}function A(){for(let w of a.keys())h(w)}function b(w=new Map){let R=!1,E=Number.POSITIVE_INFINITY;for(let I of w.values())I.pollingInterval&&(E=Math.min(I.pollingInterval,E),R=I.skipPollingIfUnfocused||R);return{lowestPollingInterval:E,skipPollingIfUnfocused:R}}return m},NV=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Bd(r,n),a=Sa(r,n),i=Hn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:v,arg:{endpointName:C,originalArgs:h}}=m.meta,A=_s(t,C),b=A?.onQueryStarted;if(b){let w={},R=new Promise((T,D)=>{w.resolve=T,w.reject=D});R.catch(()=>{}),p[v]=w;let E=e.endpoints[C].select(Zp(A)?h:v),I=g.dispatch((T,D,B)=>B),k={...g,getCacheEntry:()=>E(g.getState()),requestId:v,extra:I,updateCachedData:Zp(A)?T=>g.dispatch(e.util.updateQueryData(C,h,T)):void 0,queryFulfilled:R};b(h,k)}}else if(i(m)){let{requestId:v,baseQueryMeta:C}=m.meta;p[v]?.resolve({data:m.payload,meta:C}),delete p[v]}else if(a(m)){let{requestId:v,rejectedWithValue:C,baseQueryMeta:h}=m.meta;p[v]?.reject({error:m.payload??m.error,isUnhandledError:!C,meta:h}),delete p[v]}}},DV=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{kv.match(f)&&p(m,"refetchOnFocus"),Ov.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],v=g.queries,C=o.currentSubscriptions;t.batch(()=>{for(let h of C.keys()){let A=v[h],b=C.get(h);if(!b||!A)continue;let w=[...b.values()];(w.some(E=>E[m]===!0)||w.every(E=>E[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:h})):A.status!==Xn&&f.dispatch(n(A)))}})}return i};function qV(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:P(`${t}/invalidateTags`)},f=C=>C.type.startsWith(`${t}/`),m=[kV,TV,OV,_V,PV,NV];return{middleware:C=>{let h=!1,A=a(C.dispatch),b={...e,internalState:A,refetchQuery:v,isThisApiSliceAction:f,mwApi:C},w=m.map(I=>I(b)),R=EV(b),E=DV(b);return I=>k=>{if(!Pu(k))return I(k);h||(h=!0,C.dispatch(n.internalActions.middlewareRegistered(i)));let T={...C,next:I},D=C.getState(),[B,L]=R(k,T,D),V;if(B?V=I(k):V=L,C.getState()[t]&&(E(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let Q of w)Q(k,T,D);return V}},actions:p};function v(C){return e.api.endpoints[C.endpointName].initiate(C.originalArgs,{subscribe:!1,forceRefetch:!0})}}var QR=Symbol(),MV=({createSelector:e=Je}={})=>({name:QR,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:h},A){KC();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Ov,onOffline:KR,onFocus:kv,onFocusLost:WR},util:{}});let w=RV({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:R,selectCachedArgsForQuery:E,buildQuerySelector:I,buildInfiniteQuerySelector:k,buildMutationSelector:T}=w;Yn(t.util,{selectInvalidatedBy:R,selectCachedArgsForQuery:E});let{queryThunk:D,infiniteQueryThunk:B,mutationThunk:L,patchQueryData:V,updateQueryData:Q,upsertQueryData:j,prefetch:_,buildMatchThunkActions:N}=bV({baseQuery:r,reducerPath:o,context:A,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:h}),{reducer:q,actions:Y}=wV({context:A,queryThunk:D,infiniteQueryThunk:B,mutationThunk:L,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Yn(t.util,{patchQueryData:V,updateQueryData:Q,upsertQueryData:j,prefetch:_,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Yn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>Jp(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ue,getRunningMutationThunk:he,getRunningMutationsThunk:Ve,getRunningQueriesThunk:Xe,getRunningQueryThunk:Ue}=CV({queryThunk:D,mutationThunk:L,infiniteQueryThunk:B,api:t,serializeQueryArgs:a,context:A,getInternalState:ne});Yn(t.util,{getRunningMutationThunk:he,getRunningMutationsThunk:Ve,getRunningQueryThunk:Ue,getRunningQueriesThunk:Xe});let{middleware:He,actions:ze}=qV({reducerPath:o,context:A,queryThunk:D,mutationThunk:L,infiniteQueryThunk:B,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Ue,getInternalState:ne});return Yn(t.util,ze),Yn(t,{reducer:q,middleware:He}),{name:QR,injectEndpoint(Ee,Re){var ut;let Ie=(ut=t.endpoints)[Ee]??(ut[Ee]={});tf(Re)&&Yn(Ie,{name:Ee,select:I(Ee,Re),initiate:te(Ee,Re)},N(D,Ee)),vV(Re)&&Yn(Ie,{name:Ee,select:T(),initiate:ue(Ee)},N(L,Ee)),rf(Re)&&Yn(Ie,{name:Ee,select:k(Ee,Re),initiate:Z(Ee,Re)},N(D,Ee))}}}}),nF=FV(MV());d();c();l();u();d();c();l();u();var Pa=e=>e.query,oF=e=>e.query?.enableQuerySyntax;var aF=Je(e=>Pa(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})),nf=Je(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var of=e=>{if(e==="yes")return!0;if(e==="no")return!1},VV=()=>X("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function jV(e,t){return X({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??We(n),a=rl(n,e);return!o||!a?null:r.makeGeneratedAnswerCitationClick(_w(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:Nw(a)})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=rl(r,e);return{answerId:t??We(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function LV(e,t,r){return X({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??We(o),i=rl(o,e);return!a||!i?null:n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=rl(n,e);return{answerId:r??We(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function UV(e){return X({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??We(r);return n?t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"like"})})}function QV(e){return X({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??We(r);return n?t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"dislike"})})}var BV=e=>X({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=We(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=We(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:of(o),documented:of(a),correctTopic:of(p),hallucinationFree:of(i)},additionalNotes:m,correctAnswerUrl:f}}}),Jn=(e,t,r,n)=>X({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(o,a)=>{let i=t??We(a),p=e?r??(!a.generatedAnswer?.answer||!a.generatedAnswer?.answer.length):void 0;return i?o.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:i,answerGenerated:e,answerTextIsEmpty:p,...(n&&{conversationId:n})}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:o=>({answerId:t??We(o)??"",answerGenerated:e??!1})}),Vo=e=>X({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),GV=()=>X({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"show"})}),$V=()=>X({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"hide"})}),HV=()=>X({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"expand"})}),zV=()=>X({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=We(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:We(e)??"",action:"collapse"})});function WV(e){return X({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??We(r);return n?t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"copyToClipboard"})})}var Ns={logCopyGeneratedAnswer:WV,logGeneratedAnswerHideAnswers:$V,logGeneratedAnswerShowAnswers:GV,logGeneratedAnswerStreamEnd:Jn,logGeneratedAnswerFeedback:BV,logDislikeGeneratedAnswer:QV,logLikeGeneratedAnswer:UV,logHoverCitation:LV,logOpenGeneratedAnswerSource:jV,logRetryGeneratedAnswer:VV,logGeneratedAnswerExpand:HV,logGeneratedAnswerCollapse:zV};d();c();l();u();d();c();l();u();var iF=Je(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 sF=e=>e.context;d();c();l();u();var Nv=e=>e.pipeline;d();c();l();u();var Dv=e=>e.searchHub;d();c();l();u();var Yt=Je(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),cie=Je(e=>e,e=>{let t=Yt(e);return t&&e?e[t].expression:""});d();c();l();u();var cF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var uF=e=>e.excerptLength?.length;d();c();l();u();var cn=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,lF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var dF=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var pF=e=>e.sortCriteria;var fF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Pt(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function fF(_x126){return _ref45.apply(this,arguments)}}(),mF=(e,t)=>{let r=Pa(e)?.q,{aq:n,cq:o,dq:a,lq:i}=YV(e),p=sF(e),f=Ur(e.configuration.analytics,t,{actionCause:Av(e)}),m=Dv(e),g=Nv(e),v=$S(e)??[],C=hF(e),h=Yt(e.tabSet)||"default",A=BS(e),b=xw(e),w=t.referrer||"",R=lF(e),E=pF(e),I=KV(e),k=uF(e),T=dF(e),D=cF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:oF(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(C.length&&{facets:C}),...(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:h,locale:A,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...I,...(T??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:E,...(R&&{facetOptions:R}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},gF=(e,t)=>{let r=Pa(e)?.q,n=hF(e),o=Ur(e.configuration.analytics,t,{actionCause:Av(e)}),a=BS(e),i=Dv(e),p=Nv(e),f=$S(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:f,...(i?.length&&{searchHub:i}),...(p?.length&&{pipeline:p}),...o,locale:a}},hF=e=>Wp(e)?.map(t=>pv(t,dv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),KV=e=>({actionsHistory:e.configuration.analytics.enabled?Xt.getInstance().getHistory():[]}),YV=e=>{let t=iF(e),r=xv(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var af=["searching","thinking","answering"];function sf(e){return e.toLowerCase()}function qv(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var yF=["text/plain","text/markdown"];var Ds=new U({required:!0}),SF=new U,qs=new de({required:!0}),Mv={id:Ds,title:Ds,uri:Ds,permanentid:Ds,clickUri:SF},cf=new U({required:!0,constrainTo:yF}),vF=new U({required:!0,constrainTo:af}),xF=e=>({...e,name:sf(e.name)}),Ms=P("generatedAnswer/setIsVisible",e=>O(e,qs)),Vs=P("generatedAnswer/setAnswerId",e=>O(e,W)),uf=P("generatedAnswer/setAnswerGenerationMode",e=>O(e,new U({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Sl=P("generatedAnswer/setIsEnabled",e=>O(e,qs)),Oa=P("generatedAnswer/updateMessage",e=>O(e,{textDelta:Ds})),_a=P("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new J({values:Mv})})})),Na=P("generatedAnswer/updateError",e=>O(e,{message:SF,code:new re({min:0})})),dr=P("generatedAnswer/resetAnswer"),lf=P("generatedAnswer/like"),df=P("generatedAnswer/dislike"),pf=P("generatedAnswer/feedbackModal/open"),vl=P("generatedAnswer/expand"),ff=P("generatedAnswer/collapse"),mf=P("generatedAnswer/setId",e=>O(e,{id:new U({required:!0})})),gf=P("generatedAnswer/feedbackModal/close"),js=P("generatedAnswer/sendFeedback"),un=P("generatedAnswer/setIsLoading",e=>O(e,qs)),ka=P("generatedAnswer/setIsStreaming",e=>O(e,qs)),Da=P("generatedAnswer/setAnswerContentFormat",e=>O(e,cf)),hf=P("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:cf,default:["text/plain"]})})),yf=P("knowledge/updateAnswerConfigurationId",e=>O(e,Ds)),Sf=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,Cd)),xl=P("generatedAnswer/setIsAnswerGenerated",e=>O(e,qs)),qa=P("generatedAnswer/setCannotAnswer",e=>O(e,qs)),Vv=P("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new J({}))),vf=P("generatedAnswer/startStep",e=>O(xF(e),{name:vF,startedAt:new re({min:0,required:!0})})),xf=P("generatedAnswer/finishStep",e=>O(xF(e),{name:vF,finishedAt:new re({min:0,required:!0})})),AF=Ae("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield fF(r),g=(h,A)=>{switch(h){case"genqa.headerMessageType":{let b=JSON.parse(A);n(Da(b.contentFormat));break}case"genqa.messageType":n(Oa(JSON.parse(A)));break;case"genqa.citationsType":n(_a(JSON.parse(A)));break;case"genqa.endOfStreamType":{let b=JSON.parse(A).answerGenerated,w=a().generatedAnswer.answerId,R=p.length!==0&&!b,E=b?!a().generatedAnswer.answer?.length:void 0;n(qa(R)),n(ka(!1)),n(xl(b)),n(Jn(b,w,E)),n(Vo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(un(!0));let v=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,C=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{v(m)&&(n(un(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{v(m)&&n(Na(h))},close:()=>{v(m)&&n(ka(!1))},resetAnswer:()=>{v(m)&&n(dr())}});C?f(C):n(un(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),Af=Ae("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(dr());let a=t();if(a.generatedAnswer.answerConfigurationId){let i=mF(a,n);r(Vv(i)),yield r(Cf(i))}else 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(_x129,_x130){return _ref47.apply(this,arguments)}}());d();c();l();u();var XV=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Pt(i,a);return{data:GR({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(v){if(v instanceof String)throw new Error("The provided 'request' must be a Request object.");let C=v.url,h={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(A=>{h[A]=v[A]}),h.duplex="half",h.body=yield v.text(),S(C,h)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(m){return{error:m}}});return function XV(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),bf=nF({reducerPath:"answer",baseQuery:HR(XV,{maxRetries:3}),endpoints:()=>({})});var JV=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},ZV=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},ej=(e,t)=>{e.citations=t.citations},tj=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},rj=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},nj=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&rj(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(JV(t,o),r(Da(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(ZV(t,o),r(Oa({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(ej(t,o),r(_a({citations:o.citations})));break;case"genqa.endOfStreamType":{tj(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.length:void 0;r(Jn(i,a,p)),r(Vo());break}}},oj=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},Ma=bf.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(_x135,_x136){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:v}=i,C=Pt(m,g),h=oj(C,m,p.answerConfigurationId,f?.insightId);yield md(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref50=_asyncToGenerator(function*(A){let b=A.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(Vs(b))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:A=>{o(b=>{nj(A,b,a)})},onerror:A=>{throw A},onclose:()=>{o(A=>{a(qa(!A.generated))})}})}).apply(this,arguments)}})})}),Cf=e=>Ma.endpoints.getAnswer.initiate(e),jv=e=>{let t=nf(e);return Ma.endpoints.getAnswer.select(t??Ta)(e)};d();c();l();u();var CF=ae(xo,e=>e);d();c();l();u();function aj(e){let t=e.payload?.analyticsAction;return bF(e)&&!pe(t)}function bF(e){return"type"in e}var wF=e=>t=>r=>{let n;aj(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return bF(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 Ls=P("tab/register",e=>{let t=new J({values:{id:W,expression:Be}});return O(e,t)}),ht=P("tab/updateActiveTab",e=>O(e,W));d();c();l();u();var wf=Vr(Tp(),1),EF=Vr(RF(),1),IF=Vr(FF(),1);wf.default.extend(IF.default);wf.default.extend(EF.default);var Us=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:wf.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var ij=/(^|; )Coveo-Pendragon=([^;]*)/,sj=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function TF(){return typeof window>"u"?!1:ij.exec(document.cookie)?.pop()||null}function PF(){return typeof window>"u"?!1:sj.test(document.cookie)}var Rf=ae(Us(),e=>e.addCase(rn,(t,r)=>{cj(t,r.payload)}).addCase(vr,(t,r)=>{uj(t,r.payload)}).addCase(Ro,(t,r)=>{lj(t,r.payload)}).addCase(is,t=>{t.analytics.enabled=!1}).addCase(ss,t=>{t.analytics.enabled=!0}).addCase(bp,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(wp,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(ht,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(cs,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{pe(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Rp,(t,{payload:r})=>{dj(t,r)}));function cj(e,t){pe(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",pe(t.organizationId)||(e.organizationId=t.organizationId)}function uj(e,t){pe(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),pe(t.locale)||(e.search.locale=t.locale),pe(t.timezone)||(e.search.timezone=t.timezone),pe(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function lj(e,t){pe(t.enabled)||(e.analytics.enabled=t.enabled),pe(t.originContext)||(e.analytics.originContext=t.originContext),pe(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),pe(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),pe(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),pe(t.trackingId)||(e.analytics.trackingId=t.trackingId),pe(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),pe(t.source)||(e.analytics.source=t.source);try{let r=TF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}pe(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),pe(t.anonymous)||(e.analytics.anonymous=t.anonymous),pe(t.deviceId)||(e.analytics.deviceId=t.deviceId),pe(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),pe(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function dj(e,t){e.knowledge.agentId=t;try{let r=PF();pe(r)||(e.knowledge.debugAgentSession=!0)}catch{}}var fe=Rf;d();c();l();u();function pj(e){return e.instantlyCallable}var kF=()=>e=>t=>e(pj(t)?t():t);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 Dt=[];for(let e=0;e<256;++e)Dt.push((e+256).toString(16).slice(1));function OF(e,t=0){return(Dt[e[t+0]]+Dt[e[t+1]]+Dt[e[t+2]]+Dt[e[t+3]]+"-"+Dt[e[t+4]]+Dt[e[t+5]]+"-"+Dt[e[t+6]]+Dt[e[t+7]]+"-"+Dt[e[t+8]]+Dt[e[t+9]]+"-"+Dt[e[t+10]]+Dt[e[t+11]]+Dt[e[t+12]]+Dt[e[t+13]]+Dt[e[t+14]]+Dt[e[t+15]]).toLowerCase()}d();c();l();u();var Gv,fj=new Uint8Array(16);function $v(){if(!Gv){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Gv=crypto.getRandomValues.bind(crypto)}return Gv(fj)}d();c();l();u();d();c();l();u();var mj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Hv={randomUUID:mj};function gj(e,t,r){if(Hv.randomUUID&&!t&&!e)return Hv.randomUUID();e=e||{};let n=e.random??e.rng?.()??$v();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 OF(n)}var jo=gj;d();c();l();u();d();c();l();u();var F={};vu(F,{BRAND:()=>Uj,DIRTY:()=>Va,EMPTY_PATH:()=>vj,INVALID:()=>Ce,NEVER:()=>RL,OK:()=>Ut,ParseStatus:()=>qt,Schema:()=>ke,ZodAny:()=>Qo,ZodArray:()=>ro,ZodBigInt:()=>La,ZodBoolean:()=>Ua,ZodBranded:()=>Cl,ZodCatch:()=>Ja,ZodDate:()=>Qa,ZodDefault:()=>Xa,ZodDiscriminatedUnion:()=>If,ZodEffects:()=>Er,ZodEnum:()=>Ka,ZodError:()=>er,ZodFirstPartyTypeKind:()=>be,ZodFunction:()=>Pf,ZodIntersection:()=>Ha,ZodIssueCode:()=>ee,ZodLazy:()=>za,ZodLiteral:()=>Wa,ZodMap:()=>zs,ZodNaN:()=>Ks,ZodNativeEnum:()=>Ya,ZodNever:()=>Gr,ZodNull:()=>Ga,ZodNullable:()=>pn,ZodNumber:()=>ja,ZodObject:()=>tr,ZodOptional:()=>Rr,ZodParsedType:()=>le,ZodPipeline:()=>bl,ZodPromise:()=>Bo,ZodReadonly:()=>Za,ZodRecord:()=>Tf,ZodSchema:()=>ke,ZodSet:()=>Ws,ZodString:()=>Uo,ZodSymbol:()=>$s,ZodTransformer:()=>Er,ZodTuple:()=>dn,ZodType:()=>ke,ZodUndefined:()=>Ba,ZodUnion:()=>$a,ZodUnknown:()=>to,ZodVoid:()=>Hs,addIssueToContext:()=>ce,any:()=>Yj,array:()=>eL,bigint:()=>$j,boolean:()=>BF,coerce:()=>wL,custom:()=>LF,date:()=>Hj,datetimeRegex:()=>VF,defaultErrorMap:()=>Zn,discriminatedUnion:()=>oL,effect:()=>hL,enum:()=>fL,function:()=>lL,getErrorMap:()=>Qs,getParsedType:()=>ln,instanceof:()=>Bj,intersection:()=>aL,isAborted:()=>Ff,isAsync:()=>Bs,isDirty:()=>Ef,isValid:()=>Lo,late:()=>Qj,lazy:()=>dL,literal:()=>pL,makeIssue:()=>Al,map:()=>cL,nan:()=>Gj,nativeEnum:()=>mL,never:()=>Jj,null:()=>Kj,nullable:()=>SL,number:()=>QF,object:()=>tL,objectUtil:()=>zv,oboolean:()=>bL,onumber:()=>CL,optional:()=>yL,ostring:()=>AL,pipeline:()=>xL,preprocess:()=>vL,promise:()=>gL,quotelessJson:()=>hj,record:()=>sL,set:()=>uL,setErrorMap:()=>Sj,strictObject:()=>rL,string:()=>UF,symbol:()=>zj,transformer:()=>hL,tuple:()=>iL,undefined:()=>Wj,union:()=>nL,unknown:()=>Xj,util:()=>De,void:()=>Zj});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var De;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(De||(De={}));var zv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(zv||(zv={}));var le=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ln=e=>{switch(typeof e){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(e)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(e)?le.array:e===null?le.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?le.promise:typeof Map<"u"&&e instanceof Map?le.map:typeof Set<"u"&&e instanceof Set?le.set:typeof Date<"u"&&e instanceof Date?le.date:le.object;default:return le.unknown}};var ee=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),er=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=e=>new er(e);var yj=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===le.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,De.assertNever(e)}return{message:r}},Zn=yj;var _F=Zn;function Sj(e){_F=e}function Qs(){return _F}d();c();l();u();var Al=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},vj=[];function ce(e,t){let r=Qs(),n=Al({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Zn?void 0:Zn].filter(o=>!!o)});e.common.issues.push(n)}var qt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Ce;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return Ce;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},Ce=Object.freeze({status:"aborted"}),Va=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),Ff=e=>e.status==="aborted",Ef=e=>e.status==="dirty",Lo=e=>e.status==="valid",Bs=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(me||(me={}));var Fr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},NF=(e,t)=>{if(Lo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(e.common.issues);return this._error=r,this._error}}};function Te(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var ke=class{get description(){return this._def.description}_getType(t){return ln(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ln(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qt,ctx:{common:t.parent.common,data:t.data,parsedType:ln(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Bs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ln(t)},o=this._parseSync({data:t,path:n.path,parent:n});return NF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ln(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Lo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Lo(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:ln(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Bs(o)?o:Promise.resolve(o);return NF(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:ee.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Er({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Rr.create(this,this._def)}nullable(){return pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return Bo.create(this,this._def)}or(t){return $a.create([this,t],this._def)}and(t){return Ha.create(this,t,this._def)}transform(t){return new Er({...Te(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Xa({...Te(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new Cl({typeName:be.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Te(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return bl.create(this,t)}readonly(){return Za.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xj=/^c[^\s-]{8,}$/i,Aj=/^[0-9a-z]+$/,Cj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wj=/^[a-z0-9_-]{21}$/i,Rj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Fj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ej=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ij="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Wv,Tj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,kj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Oj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_j=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Nj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Dj=new RegExp(`^${qF}$`);function MF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function qj(e){return new RegExp(`^${MF(e)}$`)}function VF(e){let t=`${qF}T${MF(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Mj(e,t){return!!((t==="v4"||!t)&&Tj.test(e)||(t==="v6"||!t)&&kj.test(e))}function Vj(e,t){if(!Rj.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function jj(e,t){return!!((t==="v4"||!t)&&Pj.test(e)||(t==="v6"||!t)&&Oj.test(e))}var Uo=class e extends ke{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==le.string){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.string,received:a.parsedType}),Ce}let n=new qt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Ej.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Wv||(Wv=new RegExp(Ij,"u")),Wv.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")bj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")wj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")xj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Aj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Cj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:ee.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"regex",code:ee.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?VF(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Dj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?qj(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Fj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Mj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Vj(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?jj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?_j.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Nj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:ee.invalid_string,message:a.message}),n.dirty()):De.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ee.invalid_string,...me.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...me.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...me.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...me.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...me.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...me.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...me.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...me.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...me.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...me.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...me.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...me.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...me.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...me.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...me.errToObj(r)})}nonempty(t){return this.min(1,me.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Uo.create=e=>new Uo({checks:[],typeName:be.ZodString,coerce:e?.coerce??!1,...Te(e)});function Lj(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var ja=class e extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==le.number){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.number,received:a.parsedType}),Ce}let n,o=new qt;for(let a of this._def.checks)a.kind==="int"?De.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?Lj(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_finite,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,me.toString(r))}gt(t,r){return this.setLimit("min",t,!1,me.toString(r))}lte(t,r){return this.setLimit("max",t,!0,me.toString(r))}lt(t,r){return this.setLimit("max",t,!1,me.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:me.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ja.create=e=>new ja({checks:[],typeName:be.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var La=class e extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==le.bigint)return this._getInvalidInput(t);let n,o=new qt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.bigint,received:r.parsedType}),Ce}gte(t,r){return this.setLimit("min",t,!0,me.toString(r))}gt(t,r){return this.setLimit("min",t,!1,me.toString(r))}lte(t,r){return this.setLimit("max",t,!0,me.toString(r))}lt(t,r){return this.setLimit("max",t,!1,me.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:me.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};La.create=e=>new La({checks:[],typeName:be.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var Ua=class extends ke{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==le.boolean){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.boolean,received:n.parsedType}),Ce}return Ut(t.data)}};Ua.create=e=>new Ua({typeName:be.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var Qa=class e extends ke{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==le.date){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.date,received:a.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_date}),Ce}let n=new qt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):De.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:me.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:me.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Qa.create=e=>new Qa({checks:[],coerce:e?.coerce||!1,typeName:be.ZodDate,...Te(e)});var $s=class extends ke{_parse(t){if(this._getType(t)!==le.symbol){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.symbol,received:n.parsedType}),Ce}return Ut(t.data)}};$s.create=e=>new $s({typeName:be.ZodSymbol,...Te(e)});var Ba=class extends ke{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.undefined,received:n.parsedType}),Ce}return Ut(t.data)}};Ba.create=e=>new Ba({typeName:be.ZodUndefined,...Te(e)});var Ga=class extends ke{_parse(t){if(this._getType(t)!==le.null){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.null,received:n.parsedType}),Ce}return Ut(t.data)}};Ga.create=e=>new Ga({typeName:be.ZodNull,...Te(e)});var Qo=class extends ke{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}};Qo.create=e=>new Qo({typeName:be.ZodAny,...Te(e)});var to=class extends ke{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ut(t.data)}};to.create=e=>new to({typeName:be.ZodUnknown,...Te(e)});var Gr=class extends ke{_parse(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.never,received:r.parsedType}),Ce}};Gr.create=e=>new Gr({typeName:be.ZodNever,...Te(e)});var Hs=class extends ke{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.void,received:n.parsedType}),Ce}return Ut(t.data)}};Hs.create=e=>new Hs({typeName:be.ZodVoid,...Te(e)});var ro=class e extends ke{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==le.array)return ce(r,{code:ee.invalid_type,expected:le.array,received:r.parsedType}),Ce;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ce(r,{code:i?ee.too_big:ee.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ce(r,{code:ee.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(ce(r,{code:ee.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Fr(r,i,r.path,p)))).then(i=>qt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Fr(r,i,r.path,p)));return qt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:me.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:me.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:me.toString(r)}})}nonempty(t){return this.min(1,t)}};ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...Te(t)});function Gs(e){if(e instanceof tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Rr.create(Gs(n))}return new tr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:Gs(e.element)}):e instanceof Rr?Rr.create(Gs(e.unwrap())):e instanceof pn?pn.create(Gs(e.unwrap())):e instanceof dn?dn.create(e.items.map(t=>Gs(t))):e}var tr=class e extends ke{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=De.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==le.object){let m=this._getOrReturnCtx(t);return ce(m,{code:ee.invalid_type,expected:le.object,received:m.parsedType}),Ce}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Gr&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],v=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Fr(o,v,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof Gr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(ce(o,{code:ee.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let v=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Fr(o,v,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let v=yield g.key,C=yield g.value;m.push({key:v,value:C,alwaysSet:g.alwaysSet})}return m})).then(m=>qt.mergeObjectSync(n,m)):qt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return me.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:me.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:be.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of De.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of De.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Gs(this)}partial(t){let r={};for(let n of De.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of De.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Rr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return jF(De.objectKeys(this.shape))}};tr.create=(e,t)=>new tr({shape:()=>e,unknownKeys:"strip",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});tr.strictCreate=(e,t)=>new tr({shape:()=>e,unknownKeys:"strict",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});tr.lazycreate=(e,t)=>new tr({shape:e,unknownKeys:"strip",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});var $a=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new er(p.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:i}),Ce}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x138){return _ref52.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new er(f));return ce(r,{code:ee.invalid_union,unionErrors:p}),Ce}}get options(){return this._def.options}};$a.create=(e,t)=>new $a({options:e,typeName:be.ZodUnion,...Te(t)});var eo=e=>e instanceof za?eo(e.schema):e instanceof Er?eo(e.innerType()):e instanceof Wa?[e.value]:e instanceof Ka?e.options:e instanceof Ya?De.objectValues(e.enum):e instanceof Xa?eo(e._def.innerType):e instanceof Ba?[void 0]:e instanceof Ga?[null]:e instanceof Rr?[void 0,...eo(e.unwrap())]:e instanceof pn?[null,...eo(e.unwrap())]:e instanceof Cl||e instanceof Za?eo(e.unwrap()):e instanceof Ja?eo(e._def.innerType):[],If=class e extends ke{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.object)return ce(r,{code:ee.invalid_type,expected:le.object,received:r.parsedType}),Ce;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(ce(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=eo(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:be.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Te(n)})}};function Kv(e,t){let r=ln(e),n=ln(t);if(e===t)return{valid:!0,data:e};if(r===le.object&&n===le.object){let o=De.objectKeys(t),a=De.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=Kv(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===le.array&&n===le.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=Kv(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===le.date&&n===le.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ha=class extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(Ff(a)||Ff(i))return Ce;let p=Kv(a.value,i.value);return p.valid?((Ef(a)||Ef(i))&&r.dirty(),{status:r.value,value:p.data}):(ce(n,{code:ee.invalid_intersection_types}),Ce)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ha.create=(e,t,r)=>new Ha({left:e,right:t,typeName:be.ZodIntersection,...Te(r)});var dn=class e extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.array)return ce(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),Ce;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Fr(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>qt.mergeArray(r,i)):qt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};dn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new dn({items:e,typeName:be.ZodTuple,rest:null,...Te(t)})};var Tf=class e extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.object)return ce(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),Ce;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Fr(n,p,n.path,p)),value:i._parse(new Fr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?qt.mergeObjectAsync(r,o):qt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ke?new e({keyType:t,valueType:r,typeName:be.ZodRecord,...Te(n)}):new e({keyType:Uo.create(),valueType:t,typeName:be.ZodRecord,...Te(r)})}},zs=class extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.map)return ce(n,{code:ee.invalid_type,expected:le.map,received:n.parsedType}),Ce;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Fr(n,p,n.path,[m,"key"])),value:a._parse(new Fr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};zs.create=(e,t,r)=>new zs({valueType:t,keyType:e,typeName:be.ZodMap,...Te(r)});var Ws=class e extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.set)return ce(n,{code:ee.invalid_type,expected:le.set,received:n.parsedType}),Ce;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ce(n,{code:ee.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(ce(n,{code:ee.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return Ce;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Fr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:me.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:me.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ws.create=(e,t)=>new Ws({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...Te(t)});var Pf=class e extends ke{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.function)return ce(r,{code:ee.invalid_type,expected:le.function,received:r.parsedType}),Ce;function n(p,f){return Al({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Qs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return Al({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Qs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Bo){let p=this;return Ut(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new er([]),g=yield p._def.args.parseAsync(f,a).catch(h=>{throw m.addIssue(n(f,h)),m}),v=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(v,a).catch(h=>{throw m.addIssue(o(v,h)),m})}))}else{let p=this;return Ut(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new er([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),v=p._def.returns.safeParse(g,a);if(!v.success)throw new er([o(g,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:dn.create(t).rest(to.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||dn.create([]).rest(to.create()),returns:r||to.create(),typeName:be.ZodFunction,...Te(n)})}},za=class extends ke{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};za.create=(e,t)=>new za({getter:e,typeName:be.ZodLazy,...Te(t)});var Wa=class extends ke{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};Wa.create=(e,t)=>new Wa({value:e,typeName:be.ZodLiteral,...Te(t)});function jF(e,t){return new Ka({values:e,typeName:be.ZodEnum,...Te(t)})}var Ka=class e extends ke{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:De.joinValues(n),received:r.parsedType,code:ee.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:ee.invalid_enum_value,options:n}),Ce}return Ut(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ka.create=jF;var Ya=class extends ke{_parse(t){let r=De.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==le.string&&n.parsedType!==le.number){let o=De.objectValues(r);return ce(n,{expected:De.joinValues(o),received:n.parsedType,code:ee.invalid_type}),Ce}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=De.objectValues(r);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:o}),Ce}return Ut(t.data)}get enum(){return this._def.values}};Ya.create=(e,t)=>new Ya({values:e,typeName:be.ZodNativeEnum,...Te(t)});var Bo=class extends ke{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.promise&&r.common.async===!1)return ce(r,{code:ee.invalid_type,expected:le.promise,received:r.parsedType}),Ce;let n=r.parsedType===le.promise?r.data:Promise.resolve(r.data);return Ut(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Bo.create=(e,t)=>new Bo({type:e,typeName:be.ZodPromise,...Te(t)});var Er=class extends ke{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ce(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return Ce;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?Ce:f.status==="dirty"?Va(f.value):r.value==="dirty"?Va(f.value):f});return function(_x139){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return Ce;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?Ce:p.status==="dirty"?Va(p.value):r.value==="dirty"?Va(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Lo(i))return Ce;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Lo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):Ce);De.assertNever(o)}};Er.create=(e,t,r)=>new Er({schema:e,typeName:be.ZodEffects,effect:t,...Te(r)});Er.createWithPreprocess=(e,t,r)=>new Er({schema:t,effect:{type:"preprocess",transform:e},typeName:be.ZodEffects,...Te(r)});var Rr=class extends ke{_parse(t){return this._getType(t)===le.undefined?Ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Rr.create=(e,t)=>new Rr({innerType:e,typeName:be.ZodOptional,...Te(t)});var pn=class extends ke{_parse(t){return this._getType(t)===le.null?Ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};pn.create=(e,t)=>new pn({innerType:e,typeName:be.ZodNullable,...Te(t)});var Xa=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===le.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Xa.create=(e,t)=>new Xa({innerType:e,typeName:be.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Ja=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Bs(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:be.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var Ks=class extends ke{_parse(t){if(this._getType(t)!==le.nan){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.nan,received:n.parsedType}),Ce}return{status:"valid",value:t.data}}};Ks.create=e=>new Ks({typeName:be.ZodNaN,...Te(e)});var Uj=Symbol("zod_brand"),Cl=class extends ke{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},bl=class e extends ke{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ce:a.status==="dirty"?(r.dirty(),Va(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ce:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:be.ZodPipeline})}},Za=class extends ke{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Lo(o)&&(o.value=Object.freeze(o.value)),o);return Bs(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Za.create=(e,t)=>new Za({innerType:e,typeName:be.ZodReadonly,...Te(t)});function DF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function LF(e,t={},r){return e?Qo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=DF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=DF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Qo.create()}var Qj={object:tr.lazycreate},be;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(be||(be={}));var Bj=(e,t={message:`Input not instance of ${e.name}`})=>LF(r=>r instanceof e,t),UF=Uo.create,QF=ja.create,Gj=Ks.create,$j=La.create,BF=Ua.create,Hj=Qa.create,zj=$s.create,Wj=Ba.create,Kj=Ga.create,Yj=Qo.create,Xj=to.create,Jj=Gr.create,Zj=Hs.create,eL=ro.create,tL=tr.create,rL=tr.strictCreate,nL=$a.create,oL=If.create,aL=Ha.create,iL=dn.create,sL=Tf.create,cL=zs.create,uL=Ws.create,lL=Pf.create,dL=za.create,pL=Wa.create,fL=Ka.create,mL=Ya.create,gL=Bo.create,hL=Er.create,yL=Rr.create,SL=pn.create,vL=Er.createWithPreprocess,xL=bl.create,AL=()=>UF().optional(),CL=()=>QF().optional(),bL=()=>BF().optional(),wL={string:e=>Uo.create({...e,coerce:!0}),number:e=>ja.create({...e,coerce:!0}),boolean:e=>Ua.create({...e,coerce:!0}),bigint:e=>La.create({...e,coerce:!0}),date:e=>Qa.create({...e,coerce:!0})};var RL=Ce;var FL=F.object({name:F.string(),arguments:F.string()}),EL=F.object({id:F.string(),type:F.literal("function"),function:FL,encryptedValue:F.string().optional()}),kf=F.object({id:F.string(),role:F.string(),content:F.string().optional(),name:F.string().optional(),encryptedValue:F.string().optional()}),IL=F.object({type:F.literal("text"),text:F.string()}),TL=F.object({type:F.literal("data"),value:F.string(),mimeType:F.string()}),PL=F.object({type:F.literal("url"),value:F.string(),mimeType:F.string().optional()}),Of=F.discriminatedUnion("type",[TL,PL]),kL=F.object({type:F.literal("image"),source:Of,metadata:F.unknown().optional()}),OL=F.object({type:F.literal("audio"),source:Of,metadata:F.unknown().optional()}),_L=F.object({type:F.literal("video"),source:Of,metadata:F.unknown().optional()}),NL=F.object({type:F.literal("document"),source:Of,metadata:F.unknown().optional()});var GF=F.object({type:F.literal("binary"),mimeType:F.string(),id:F.string().optional(),url:F.string().optional(),data:F.string().optional(),filename:F.string().optional()}),$F=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:F.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},Gle=GF.superRefine((e,t)=>{$F(e,t)}),DL=F.discriminatedUnion("type",[IL,kL,OL,_L,NL,GF]),qL=DL.superRefine((e,t)=>{e.type==="binary"&&$F(e,t)}),ML=kf.extend({role:F.literal("developer"),content:F.string()}),VL=kf.extend({role:F.literal("system"),content:F.string()}),jL=kf.extend({role:F.literal("assistant"),content:F.string().optional(),toolCalls:F.array(EL).optional()}),LL=kf.extend({role:F.literal("user"),content:F.union([F.string(),F.array(qL)])}),UL=F.object({id:F.string(),content:F.string(),role:F.literal("tool"),toolCallId:F.string(),error:F.string().optional(),encryptedValue:F.string().optional()}),QL=F.object({id:F.string(),role:F.literal("activity"),activityType:F.string(),content:F.record(F.any())}),BL=F.object({id:F.string(),role:F.literal("reasoning"),content:F.string(),encryptedValue:F.string().optional()}),HF=F.discriminatedUnion("role",[ML,VL,jL,LL,UL,QL,BL]),$le=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user"),F.literal("tool"),F.literal("activity"),F.literal("reasoning")]),GL=F.object({description:F.string(),value:F.string()}),zF=F.object({name:F.string(),description:F.string(),parameters:F.any(),metadata:F.record(F.any()).optional()}),$L=F.object({threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),state:F.any(),messages:F.array(HF),tools:F.array(zF),context:F.array(GL),forwardedProps:F.any()}),HL=F.any(),nt=class extends Error{constructor(e){super(e)}},Yv=class extends nt{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},zL=F.object({name:F.string(),description:F.string().optional()}),WL=F.object({name:F.string().optional(),type:F.string().optional(),description:F.string().optional(),version:F.string().optional(),provider:F.string().optional(),documentationUrl:F.string().optional(),metadata:F.record(F.unknown()).optional()}),KL=F.object({streaming:F.boolean().optional(),websocket:F.boolean().optional(),httpBinary:F.boolean().optional(),pushNotifications:F.boolean().optional(),resumable:F.boolean().optional()}),YL=F.object({supported:F.boolean().optional(),items:F.array(zF).optional(),parallelCalls:F.boolean().optional(),clientProvided:F.boolean().optional()}),XL=F.object({structuredOutput:F.boolean().optional(),supportedMimeTypes:F.array(F.string()).optional()}),JL=F.object({snapshots:F.boolean().optional(),deltas:F.boolean().optional(),memory:F.boolean().optional(),persistentState:F.boolean().optional()}),ZL=F.object({supported:F.boolean().optional(),delegation:F.boolean().optional(),handoffs:F.boolean().optional(),subAgents:F.array(zL).optional()}),eU=F.object({supported:F.boolean().optional(),streaming:F.boolean().optional(),encrypted:F.boolean().optional()}),tU=F.object({image:F.boolean().optional(),audio:F.boolean().optional(),video:F.boolean().optional(),pdf:F.boolean().optional(),file:F.boolean().optional()}),rU=F.object({image:F.boolean().optional(),audio:F.boolean().optional()}),nU=F.object({input:tU.optional(),output:rU.optional()}),oU=F.object({codeExecution:F.boolean().optional(),sandboxed:F.boolean().optional(),maxIterations:F.number().optional(),maxExecutionTime:F.number().optional()}),aU=F.object({supported:F.boolean().optional(),approvals:F.boolean().optional(),interventions:F.boolean().optional(),feedback:F.boolean().optional()}),Hle=F.object({identity:WL.optional(),transport:KL.optional(),tools:YL.optional(),output:XL.optional(),state:JL.optional(),multiAgent:ZL.optional(),reasoning:eU.optional(),multimodal:nU.optional(),execution:oU.optional(),humanInTheLoop:aU.optional(),custom:F.record(F.unknown()).optional()}),WF=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user")]),M=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),je=F.object({type:F.nativeEnum(M),timestamp:F.number().optional(),rawEvent:F.any().optional()}).passthrough(),iU=je.extend({type:F.literal(M.TEXT_MESSAGE_START),messageId:F.string(),role:WF.default("assistant"),name:F.string().optional()}),KF=je.extend({type:F.literal(M.TEXT_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),sU=je.extend({type:F.literal(M.TEXT_MESSAGE_END),messageId:F.string()}),cU=je.extend({type:F.literal(M.TEXT_MESSAGE_CHUNK),messageId:F.string().optional(),role:WF.optional(),delta:F.string().optional(),name:F.string().optional()}),uU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_START)}),lU=KF.omit({messageId:!0,type:!0}).extend({type:F.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),dU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_END)}),pU=je.extend({type:F.literal(M.TOOL_CALL_START),toolCallId:F.string(),toolCallName:F.string(),parentMessageId:F.string().optional()}),fU=je.extend({type:F.literal(M.TOOL_CALL_ARGS),toolCallId:F.string(),delta:F.string()}),mU=je.extend({type:F.literal(M.TOOL_CALL_END),toolCallId:F.string()}),gU=je.extend({messageId:F.string(),type:F.literal(M.TOOL_CALL_RESULT),toolCallId:F.string(),content:F.string(),role:F.literal("tool").optional()}),hU=je.extend({type:F.literal(M.TOOL_CALL_CHUNK),toolCallId:F.string().optional(),toolCallName:F.string().optional(),parentMessageId:F.string().optional(),delta:F.string().optional()}),yU=je.extend({type:F.literal(M.THINKING_START),title:F.string().optional()}),SU=je.extend({type:F.literal(M.THINKING_END)}),vU=je.extend({type:F.literal(M.STATE_SNAPSHOT),snapshot:HL}),xU=je.extend({type:F.literal(M.STATE_DELTA),delta:F.array(F.any())}),AU=je.extend({type:F.literal(M.MESSAGES_SNAPSHOT),messages:F.array(HF)}),CU=je.extend({type:F.literal(M.ACTIVITY_SNAPSHOT),messageId:F.string(),activityType:F.string(),content:F.record(F.any()),replace:F.boolean().optional().default(!0)}),bU=je.extend({type:F.literal(M.ACTIVITY_DELTA),messageId:F.string(),activityType:F.string(),patch:F.array(F.any())}),wU=je.extend({type:F.literal(M.RAW),event:F.any(),source:F.string().optional()}),RU=je.extend({type:F.literal(M.CUSTOM),name:F.string(),value:F.any()}),FU=je.extend({type:F.literal(M.RUN_STARTED),threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),input:$L.optional()}),EU=je.extend({type:F.literal(M.RUN_FINISHED),threadId:F.string(),runId:F.string(),result:F.any().optional()}),IU=je.extend({type:F.literal(M.RUN_ERROR),message:F.string(),code:F.string().optional()}),TU=je.extend({type:F.literal(M.STEP_STARTED),stepName:F.string()}),PU=je.extend({type:F.literal(M.STEP_FINISHED),stepName:F.string()}),kU=F.union([F.literal("tool-call"),F.literal("message")]),OU=je.extend({type:F.literal(M.REASONING_START),messageId:F.string()}),_U=je.extend({type:F.literal(M.REASONING_MESSAGE_START),messageId:F.string(),role:F.literal("reasoning")}),NU=je.extend({type:F.literal(M.REASONING_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),DU=je.extend({type:F.literal(M.REASONING_MESSAGE_END),messageId:F.string()}),qU=je.extend({type:F.literal(M.REASONING_MESSAGE_CHUNK),messageId:F.string().optional(),delta:F.string().optional()}),MU=je.extend({type:F.literal(M.REASONING_END),messageId:F.string()}),VU=je.extend({type:F.literal(M.REASONING_ENCRYPTED_VALUE),subtype:kU,entityId:F.string(),encryptedValue:F.string()}),_f=F.discriminatedUnion("type",[iU,KF,sU,cU,yU,SU,uU,lU,dU,pU,fU,mU,hU,gU,vU,xU,AU,CU,bU,wU,RU,FU,EU,IU,TU,PU,OU,_U,NU,DU,qU,MU,VU]);d();c();l();u();var Xv={};vu(Xv,{JsonPatchError:()=>at,_areEquals:()=>Fl,applyOperation:()=>ei,applyPatch:()=>Go,applyReducer:()=>BU,deepClone:()=>UU,getValueByPointer:()=>Vf,validate:()=>XF,validator:()=>jf});d();c();l();u();d();c();l();u();var jU=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},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)}}(),LU=Object.prototype.hasOwnProperty;function Df(e,t){return LU.call(e,t)}function qf(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)Df(e,o)&&n.push(o);return n}function Mt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Mf(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function fn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function wl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Nf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Nf(e[t]))return!0}else if(typeof e=="object"){for(var n=qf(e),o=n.length,a=0;a<o;a++)if(Nf(e[n[a]]))return!0}}return!1}function YF(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
|
|
33
|
+
`)}var Rl=function(e){jU(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,YF(r,{name:n,index:o,operation:a,tree:i}))||this;return f.name=n,f.index=o,f.operation=a,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=YF(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var at=Rl,UU=Mt,Ys={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=Vf(r,this.path);n&&(n=Mt(n));var o=ei(r,{op:"remove",path:this.from}).removed;return ei(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Vf(r,this.from);return ei(r,{op:"add",path:this.path,value:Mt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Fl(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},QU={add:function(e,t,r){return Mf(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Ys.move,copy:Ys.copy,test:Ys.test,_get:Ys._get};function Vf(e,t){if(t=="")return e;var r={op:"_get",path:t};return ei(e,r),r.value}function ei(e,t,r,n,o,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(t,0,e,t.path):jf(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=Vf(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=Fl(e,t.value),i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=Mt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,v=f.length,C=void 0,h=void 0,A=void 0;for(typeof r=="function"?A=r:A=jf;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=wl(h)),o&&(h=="__proto__"||h=="prototype"&&g>0&&f[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&C===void 0&&(m[h]===void 0?C=f.slice(0,g).join("/"):g==v-1&&(C=t.path),C!==void 0&&A(t,0,e,C)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!Mf(h))throw new at("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);Mf(h)&&(h=~~h)}if(g>=v){if(r&&t.op==="add"&&h>m.length)throw new at("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var i=QU[t.op].call(t,m,h,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(g>=v){var i=Ys[t.op].call(t,m,h,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[h],r&&g<v&&(!m||typeof m!="object"))throw new at("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function Go(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Mt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=ei(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function BU(e,t,r){var n=ei(e,t);if(n.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function jf(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new at("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Ys[e.op]){if(typeof e.path!="string")throw new at("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new at("Operation `path` property must start with \"/\"","OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new at("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Nf(e.value))throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,a=n.split("/").length;if(o!==a+1&&o!==a)throw new at("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new at("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=XF([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new at("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function XF(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Go(Mt(t),Mt(e),r||!0);else{r=r||jf;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof at)return o;throw o}}function Fl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,a,i;if(r&&n){if(a=e.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!Fl(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=a;o--!==0;)if(i=p[o],!Fl(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var tx={};vu(tx,{compare:()=>XU,generate:()=>Jv,observe:()=>YU,unobserve:()=>KU});d();c();l();u();var Zv=new WeakMap,GU=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),$U=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function HU(e){return Zv.get(e)}function zU(e,t){return e.observers.get(t)}function WU(e,t){e.observers.delete(t.callback)}function KU(e,t){t.unobserve()}function YU(e,t){var r=[],n,o=HU(e);if(!o)o=new GU(e),Zv.set(e,o);else{var a=zU(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=Mt(e),t){n.callback=t,n.next=null;var i=function(){Jv(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){Jv(n),clearTimeout(n.next),WU(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new $U(t,n)),n}function Jv(e,t){t===void 0&&(t=!1);var r=Zv.get(e.object);ex(r.value,e.object,e.patches,"",t),e.patches.length&&Go(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function ex(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=qf(t),i=qf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],v=e[g];if(Df(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var C=t[g];typeof v=="object"&&v!=null&&typeof C=="object"&&C!=null&&Array.isArray(v)===Array.isArray(C)?ex(v,C,r,n+"/"+fn(g),o):v!==C&&(p=!0,o&&r.push({op:"test",path:n+"/"+fn(g),value:Mt(v)}),r.push({op:"replace",path:n+"/"+fn(g),value:Mt(C)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+fn(g),value:Mt(v)}),r.push({op:"remove",path:n+"/"+fn(g)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&a.length==i.length))for(var m=0;m<a.length;m++){var g=a[m];!Df(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+fn(g),value:Mt(t[g])})}}}function XU(e,t,r){r===void 0&&(r=!1);var n=[];return ex(e,t,n,"",r),n}var yde=Object.assign({},Xv,tx,{JsonPatchError:Rl,deepClone:Mt,escapePathComponent:fn,unescapePathComponent:wl});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var rx=function(e,t){return rx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},rx(e,t)};function mn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");rx(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function JF(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(v){i(v)}}function f(g){try{m(n.throw(g))}catch(v){i(v)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function Lf(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function no(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xs(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)a.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Js(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function ti(e){return this instanceof ti?(this.v=e,this):new ti(e)}function ZF(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(h){return function(A){return Promise.resolve(A).then(h,v)}}function p(h,A){n[h]&&(o[h]=function(b){return new Promise(function(w,R){a.push([h,b,w,R])>1||f(h,b)})},A&&(o[h]=A(o[h])))}function f(h,A){try{m(n[h](A))}catch(b){C(a[0][3],b)}}function m(h){h.value instanceof ti?Promise.resolve(h.value.v).then(g,v):C(a[0][2],h)}function g(h){f("next",h)}function v(h){f("throw",h)}function C(h,A){h(A),a.shift(),a.length&&f(a[0][0],a[0][1])}}function eE(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof no=="function"?no(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(p,f){i=e[a](i),o(p,f,i.done,i.value)})}}function o(a,i,p,f){Promise.resolve(f).then(function(m){a({value:m,done:p})},i)}}d();c();l();u();function Ne(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function Zs(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Uf=Zs(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
33
34
|
`+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
34
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Fl(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Zs=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=ro(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(R){t={error:R}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var h=this.initialTeardown;if(Oe(h))try{h()}catch(R){a=R instanceof Vf?R.errors:[R]}var x=this._finalizers;if(x){this._finalizers=null;try{for(var A=ro(x),y=A.next();!y.done;y=A.next()){var C=y.value;try{DF(C)}catch(R){a=a??[],R instanceof Vf?a=Js(Js([],Ys(a)),Ys(R.errors)):a.push(R)}}}catch(R){n={error:R}}finally{try{y&&!y.done&&(o=A.return)&&o.call(A)}finally{if(n)throw n.error}}}if(a)throw new Vf(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)DF(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Fl(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Fl(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Bv=Zs.EMPTY;function jf(e){return e instanceof Zs||e&&"closed"in e&&Oe(e.remove)&&Oe(e.add)&&Oe(e.unsubscribe)}function DF(e){Oe(e)?e():e.unsubscribe()}d();c();l();u();var Gr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var ec={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=ec.delegate;return o?.setTimeout?o.setTimeout.apply(o,Js([e,t],Ys(r))):setTimeout.apply(void 0,Js([e,t],Ys(r)))},clearTimeout:function(e){var t=ec.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Lf(e){ec.setTimeout(function(){var t=Gr.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function El(){}d();c();l();u();var qF=function(){return Gv("C",void 0,void 0)}();function MF(e){return Gv("E",void 0,e)}function VF(e){return Gv("N",e,void 0)}function Gv(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var ti=null;function tc(e){if(Gr.useDeprecatedSynchronousErrorHandling){var t=!ti;if(t&&(ti={errorThrown:!1,error:null}),e(),t){var r=ti,n=r.errorThrown,o=r.error;if(ti=null,n)throw o}}else e()}function jF(e){Gr.useDeprecatedSynchronousErrorHandling&&ti&&(ti.errorThrown=!0,ti.error=e)}var Il=function(e){fn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,jf(r)&&r.add(n)):n.destination=uU,n}return t.create=function(r,n,o){return new Qf(r,n,o)},t.prototype.next=function(r){this.isStopped?Hv(VF(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Hv(MF(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Hv(qF,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Zs);var iU=Function.prototype.bind;function $v(e,t){return iU.call(e,t)}var sU=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Uf(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Uf(n)}else Uf(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Uf(r)}},e}(),Qf=function(e){fn(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(Oe(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&Gr.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&$v(r.next,p),error:r.error&&$v(r.error,p),complete:r.complete&&$v(r.complete,p)}):i=r}return a.destination=new sU(i),a}return t}(Il);function Uf(e){Gr.useDeprecatedSynchronousErrorHandling?jF(e):Lf(e)}function cU(e){throw e}function Hv(e,t){var r=Gr.onStoppedNotification;r&&ec.setTimeout(function(){return r(e,t)})}var uU={closed:!0,next:El,error:cU,complete:El};d();c();l();u();var rc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function nc(e){return e}function Bf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zv(e)}function zv(e){return e.length===0?nc:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ze=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=dU(t)?t:new Qf(t,r,n);return tc(function(){var i=o,p=i.operator,f=i.source;a.add(p?p.call(a,f):f?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=LF(r),new r(function(o,a){var i=new Qf({next:function(p){try{t(p)}catch(f){a(f),i.unsubscribe()}},error:a,complete:o});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[rc]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return zv(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=LF(t),new t(function(n,o){var a;r.subscribe(function(i){return a=i},function(i){return o(i)},function(){return n(a)})})},e.create=function(t){return new e(t)},e}();function LF(e){var t;return(t=e??Gr.Promise)!==null&&t!==void 0?t:Promise}function lU(e){return e&&Oe(e.next)&&Oe(e.error)&&Oe(e.complete)}function dU(e){return e&&e instanceof Il||lU(e)&&jf(e)}d();c();l();u();function pU(e){return Oe(e?.lift)}function gt(e){return function(t){if(pU(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function At(e,t,r,n,o){return new fU(e,t,r,n,o)}var fU=function(e){fn(t,e);function t(r,n,o,a,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(h){r.error(h)}}:e.prototype._next,f._error=a?function(m){try{a(m)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(Il);d();c();l();u();d();c();l();u();var UF=Xs(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var mn=function(e){fn(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new QF(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new UF},t.prototype.next=function(r){var n=this;tc(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=ro(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;tc(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;tc(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,i=o.isStopped,p=o.observers;return a||i?Bv:(this.currentObservers=null,p.push(r),new Zs(function(){n.currentObservers=null,Fl(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,i=n.isStopped;o?r.error(a):i&&r.complete()},t.prototype.asObservable=function(){var r=new Ze;return r.source=this,r},t.create=function(r,n){return new QF(r,n)},t}(Ze);var QF=function(e){fn(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Bv},t}(mn);d();c();l();u();d();c();l();u();var Wv={now:function(){return(Wv.delegate||Date).now()},delegate:void 0};var Gf=function(e){fn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Wv);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(a.push(r),!i&&a.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,i=o._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=a?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<a.length&&a.splice(0,a.length-p),!i){for(var f=o.now(),m=0,h=1;h<a.length&&a[h]<=f;h+=2)m=h;m&&a.splice(0,m+1)}},t}(mn);d();c();l();u();var $f=new Ze(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function BF(e){return e&&Oe(e.schedule)}function mU(e){return e[e.length-1]}function GF(e){return BF(mU(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Hf=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function zf(e){return Oe(e?.then)}d();c();l();u();function Wf(e){return Oe(e[rc])}d();c();l();u();function Kf(e){return Symbol.asyncIterator&&Oe(e?.[Symbol.asyncIterator])}d();c();l();u();function Yf(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function gU(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Jf=gU();function Xf(e){return Oe(e?.[Jf])}d();c();l();u();function Zf(e){return NF(this,arguments,function(){var r,n,o,a;return Mf(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,ei(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,ei(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,ei(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function em(e){return Oe(e?.getReader)}function Ct(e){if(e instanceof Ze)return e;if(e!=null){if(Wf(e))return hU(e);if(Hf(e))return yU(e);if(zf(e))return SU(e);if(Kf(e))return $F(e);if(Xf(e))return vU(e);if(em(e))return xU(e)}throw Yf(e)}function hU(e){return new Ze(function(t){var r=e[rc]();if(Oe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function yU(e){return new Ze(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function SU(e){return new Ze(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Lf)})}function vU(e){return new Ze(function(t){var r,n;try{for(var o=ro(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function $F(e){return new Ze(function(t){AU(e,t).catch(function(r){return t.error(r)})})}function xU(e){return $F(Zf(e))}function AU(e,t){var r,n,o,a;return OF(this,void 0,void 0,function(){var i,p;return Mf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=_F(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function Er(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function tm(e,t){return t===void 0&&(t=0),gt(function(r,n){r.subscribe(At(n,function(o){return Er(n,e,function(){return n.next(o)},t)},function(){return Er(n,e,function(){return n.complete()},t)},function(o){return Er(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function rm(e,t){return t===void 0&&(t=0),gt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function HF(e,t){return Ct(e).pipe(rm(t),tm(t))}d();c();l();u();function zF(e,t){return Ct(e).pipe(rm(t),tm(t))}d();c();l();u();function WF(e,t){return new Ze(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function KF(e,t){return new Ze(function(r){var n;return Er(r,t,function(){n=e[Jf](),Er(r,t,function(){var o,a,i;try{o=n.next(),a=o.value,i=o.done}catch(p){r.error(p);return}i?r.complete():r.next(a)},0,!0)}),function(){return Oe(n?.return)&&n.return()}})}d();c();l();u();function nm(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ze(function(r){Er(r,t,function(){var n=e[Symbol.asyncIterator]();Er(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function YF(e,t){return nm(Zf(e),t)}function JF(e,t){if(e!=null){if(Wf(e))return HF(e,t);if(Hf(e))return WF(e,t);if(zf(e))return zF(e,t);if(Kf(e))return nm(e,t);if(Xf(e))return KF(e,t);if(em(e))return YF(e,t)}throw Yf(e)}function ri(e,t){return t?JF(e,t):Ct(e)}function ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=GF(e);return ri(e,r)}d();c();l();u();function et(e,t){var r=Oe(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ze(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var XF=Xs(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function om(e,t){var r=typeof t=="object";return new Promise(function(n,o){var a=!1,i;e.subscribe({next:function(p){i=p,a=!0},error:o,complete:function(){a?n(i):r?n(t.defaultValue):o(new XF)}})})}d();c();l();u();function ni(e,t){return gt(function(r,n){var o=0;r.subscribe(At(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function ZF(e,t,r,n,o,a,i,p){var f=[],m=0,h=0,x=!1,A=function(){x&&!f.length&&!m&&t.complete()},y=function(R){return m<n?C(R):f.push(R)},C=function(R){a&&t.next(R),m++;var b=!1;Ct(r(R,h++)).subscribe(At(t,function(w){o?.(w),a?y(w):t.next(w)},function(){b=!0},void 0,function(){if(b)try{m--;for(var w=function(){var P=f.shift();i?Er(t,i,function(){return C(P)}):C(P)};f.length&&m<n;)w();A()}catch(P){t.error(P)}}))};return e.subscribe(At(t,y,function(){x=!0,A()})),function(){p?.()}}function rr(e,t,r){return r===void 0&&(r=1/0),Oe(t)?rr(function(n,o){return ni(function(a,i){return t(n,a,o,i)})(Ct(e(n,o)))},r):(typeof t=="number"&&(r=t),gt(function(n,o){return ZF(n,o,e,r)}))}function Kv(e){return e===void 0&&(e=1/0),rr(nc,e)}d();c();l();u();function Yv(e){return new Ze(function(t){Ct(e()).subscribe(t)})}d();c();l();u();function Tl(e){return gt(function(t,r){var n=null,o=!1,a;n=t.subscribe(At(r,void 0,void 0,function(i){a=Ct(e(i,Tl(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();l();u();function am(e,t){return Oe(t)?rr(e,t,1):rr(e,1)}d();c();l();u();function Jv(e){return gt(function(t,r){var n=!1;t.subscribe(At(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function oi(e){return gt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function Xv(e,t){return gt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(At(n,function(f){o?.unsubscribe();var m=0,h=a++;Ct(e(f,h)).subscribe(o=At(n,function(x){return n.next(t?t(f,x,h,m++):x)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function im(e){return gt(function(t,r){Ct(e).subscribe(At(r,function(){return r.complete()},El)),!r.closed&&t.subscribe(r)})}d();c();l();u();function Zv(e,t,r){var n=Oe(e)||t||r?{next:e,error:t,complete:r}:e;return n?gt(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(At(a,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),a.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),a.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),a.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):nc}d();c();l();u();d();c();l();u();function eE(e){return` \r
|
|
35
|
-
`.indexOf(e)>=0}function sm(e){for(var t=["topLevel"],r=0,n,o,a,i=function(P){return t.push(P)},p=function(P){return t[t.length-1]=P},f=function(P){n==null&&(n=r,o=t.length,a=P)},m=function(P){P===a&&(n=void 0,o=void 0,a=void 0)},h=function(){return t.pop()},x=function(){return r--},A=function(P){if("0"<=P&&P<="9"){i("number");return}switch(P){case"\"":i("string");return;case"-":i("numberNeedsDigit");return;case"t":i("true");return;case"f":i("false");return;case"n":i("null");return;case"[":i("arrayNeedsValue");return;case"{":i("objectNeedsKey");return}},y=e.length;r<y;r++){var C=e[r];switch(t[t.length-1]){case"topLevel":A(C);break;case"string":switch(C){case"\"":h();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":C==="u"?i("stringUnicode"):(m("stringEscape"),h());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),h());break;case"number":C==="."?p("numberNeedsDigit"):C==="e"||C==="E"?p("numberNeedsExponent"):(C<"0"||C>"9")&&(x(),h());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(C==="+"||C==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(C<"a"||C>"z")&&(x(),h());break;case"arrayNeedsValue":C==="]"?h():eE(C)||(m("collectionItem"),p("arrayNeedsComma"),A(C));break;case"arrayNeedsComma":C==="]"?h():C===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":C==="}"?h():C==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":C===":"&&p("objectNeedsValue");break;case"objectNeedsValue":eE(C)||(m("collectionItem"),p("objectNeedsComma"),A(C));break;case"objectNeedsComma":C==="}"?h():C===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var R=[n!=null?e.slice(0,n):e],b=function(P){return R.push(P.slice(e.length-e.lastIndexOf(P[0])))},w=t.length-1;w>=0;w--)switch(t[w]){case"string":R.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":R.push("0");break;case"true":b("true");break;case"false":b("false");break;case"null":b("null");break;case"arrayNeedsValue":case"arrayNeedsComma":R.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":R.push("}");break}return R.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function rE(){let e=0,t=0;for(let n=0;n<28;n+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function um(e,t,r){for(let a=0;a<28;a=a+7){let i=e>>>a,p=!(!(i>>>7)&&t==0),f=(p?i|128:i)&255;if(r.push(f),!p)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let a=3;a<31;a=a+7){let i=t>>>a,p=!!(i>>>7),f=(p?i|128:i)&255;if(r.push(f),!p)return}r.push(t>>>31&1)}}var cm=4294967296;function ex(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function a(i,p){let f=Number(e.slice(i,p));o*=r,n=n*r+f,n>=cm&&(o=o+(n/cm|0),n=n%cm)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?oE(n,o):rx(n,o)}function nE(e,t){let r=rx(e,t),n=r.hi&2147483648;n&&(r=oE(r.lo,r.hi));let o=tx(r.lo,r.hi);return n?"-"+o:o}function tx(e,t){if({lo:e,hi:t}=CU(e,t),t<=2097151)return String(cm*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,a=r+n*6777216+o*6710656,i=n+o*8147497,p=o*2,f=1e7;return a>=f&&(i+=Math.floor(a/f),a%=f),i>=f&&(p+=Math.floor(i/f),i%=f),p.toString()+tE(i)+tE(a)}function CU(e,t){return{lo:e>>>0,hi:t>>>0}}function rx(e,t){return{lo:e|0,hi:t|0}}function oE(e,t){return t=~t,e?e=~e+1:t+=1,rx(e,t)}var tE=e=>{let t=String(e);return"0000000".slice(t.length)+t};function nx(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function aE(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var $r=bU();function bU(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!g.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>n||p<r)throw new Error(`invalid int64: ${i}`);return p},uParse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>a||p<o)throw new Error(`invalid uint64: ${i}`);return p},enc(i){return e.setBigInt64(0,this.parse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(i){return e.setBigInt64(0,this.uParse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),iE(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),sE(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),iE(r),ex(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),sE(r),ex(r)},dec(r,n){return nE(r,n)},uDec(r,n){return tx(r,n)}}}function iE(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function sE(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var ox=Symbol.for("@bufbuild/protobuf/text-encoding");function ax(){if(g[ox]==null){let e=new g.TextEncoder,t=new g.TextDecoder;g[ox]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return g[ox]}var Go;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Go||(Go={}));var wU=34028234663852886e22,RU=-34028234663852886e22,FU=4294967295,EU=2147483647,IU=-2147483648,je=class{constructor(t=ax().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let o=0;o<this.chunks.length;o++)t+=this.chunks[o].length;let r=new Uint8Array(t),n=0;for(let o=0;o<this.chunks.length;o++)r.set(this.chunks[o],n),n+=this.chunks[o].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(cE(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return ix(t),nx(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){TU(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){cE(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){ix(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return ix(t),t=(t<<1^t>>31)>>>0,nx(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=$r.enc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=$r.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=$r.enc(t);return um(r.lo,r.hi,this.buf),this}sint64(t){let r=$r.enc(t),n=r.hi>>31,o=r.lo<<1^n,a=(r.hi<<1|r.lo>>>31)^n;return um(o,a,this.buf),this}uint64(t){let r=$r.uEnc(t);return um(r.lo,r.hi,this.buf),this}},ge=class{constructor(t,r=ax().decodeUtf8){this.decodeUtf8=r,this.varint64=rE,this.uint32=aE,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case Go.Varint:for(;this.buf[this.pos++]&128;);break;case Go.Bit64:this.pos+=4;case Go.Bit32:this.pos+=4;break;case Go.LengthDelimited:let o=this.uint32();this.pos+=o;break;case Go.StartGroup:for(;;){let[a,i]=this.tag();if(i===Go.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(i,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return $r.dec(...this.varint64())}uint64(){return $r.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,$r.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return $r.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return $r.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}};function ix(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>EU||e<IU)throw new Error("invalid int32: "+e)}function cE(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>FU||e<0)throw new Error("invalid uint32: "+e)}function TU(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>wU||e<RU))throw new Error("invalid float32: "+e)}var PU=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function sx(){return{fields:{}}}var Pl={encode(e,t=new je){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&lx.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=sx();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=lx.decode(r,r.uint32());i.value!==void 0&&(o.fields[i.key]=i.value);continue}}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Pl.fromPartial(e??{})},fromPartial(e){let t=sx();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=sx();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function uE(){return{key:"",value:void 0}}var lx={encode(e,t=new je){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=uE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.key=r.string();continue;case 2:if(a!==18)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return lx.fromPartial(e??{})},fromPartial(e){let t=uE();return t.key=e.key??"",t.value=e.value??void 0,t}};function cx(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Me={encode(e,t=new je){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&Pl.encode(Pl.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&kl.encode(kl.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=cx();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.nullValue=r.int32();continue;case 2:if(a!==17)break;o.numberValue=r.double();continue;case 3:if(a!==26)break;o.stringValue=r.string();continue;case 4:if(a!==32)break;o.boolValue=r.bool();continue;case 5:if(a!==42)break;o.structValue=Pl.unwrap(Pl.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=kl.unwrap(kl.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Me.fromPartial(e??{})},fromPartial(e){let t=cx();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=cx();if(e===null)t.nullValue=PU.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(g.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new g.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function ux(){return{values:[]}}var kl={encode(e,t=new je){for(let r of e.values)Me.encode(Me.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=ux();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.values.push(Me.unwrap(Me.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return kl.fromPartial(e??{})},fromPartial(e){let t=ux();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=ux();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&g.Array.isArray(e.values)?e.values:e}},kU=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function lE(){return{op:0,path:"",from:void 0,value:void 0}}var lm={encode(e,t=new je){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=lE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.op=r.int32();continue;case 2:if(a!==18)break;o.path=r.string();continue;case 3:if(a!==26)break;o.from=r.string();continue;case 4:if(a!==34)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return lm.fromPartial(e??{})},fromPartial(e){let t=lE();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function dE(){return{id:"",type:"",function:void 0}}var dm={encode(e,t=new je){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&pm.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=dE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.type=r.string();continue;case 3:if(a!==26)break;o.function=pm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return dm.fromPartial(e??{})},fromPartial(e){let t=dE();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?pm.fromPartial(e.function):void 0,t}};function pE(){return{name:"",arguments:""}}var pm={encode(e,t=new je){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=pE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.name=r.string();continue;case 2:if(a!==18)break;o.arguments=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return pm.fromPartial(e??{})},fromPartial(e){let t=pE();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function fE(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var fm={encode(e,t=new je){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)dm.encode(r,t.uint32(42).fork()).join();return e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=fE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.role=r.string();continue;case 3:if(a!==26)break;o.content=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue;case 5:if(a!==42)break;o.toolCalls.push(dm.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.toolCallId=r.string();continue;case 7:if(a!==58)break;o.error=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return fm.fromPartial(e??{})},fromPartial(e){let t=fE();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>dm.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},OU=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function mE(){return{type:0,timestamp:void 0,rawEvent:void 0}}var ve={encode(e,t=new je){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Me.encode(Me.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=mE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.type=r.int32();continue;case 2:if(a!==16)break;o.timestamp=NU(r.int64());continue;case 3:if(a!==26)break;o.rawEvent=Me.unwrap(Me.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ve.fromPartial(e??{})},fromPartial(e){let t=mE();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function gE(){return{baseEvent:void 0,messageId:"",role:void 0}}var mm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=gE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return mm.fromPartial(e??{})},fromPartial(e){let t=gE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function hE(){return{baseEvent:void 0,messageId:"",delta:""}}var gm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=hE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return gm.fromPartial(e??{})},fromPartial(e){let t=hE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function yE(){return{baseEvent:void 0,messageId:""}}var hm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=yE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return hm.fromPartial(e??{})},fromPartial(e){let t=yE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function SE(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var ym={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=SE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ym.fromPartial(e??{})},fromPartial(e){let t=SE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function vE(){return{baseEvent:void 0,toolCallId:"",delta:""}}var Sm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=vE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Sm.fromPartial(e??{})},fromPartial(e){let t=vE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function xE(){return{baseEvent:void 0,toolCallId:""}}var vm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=xE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return vm.fromPartial(e??{})},fromPartial(e){let t=xE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function AE(){return{baseEvent:void 0,snapshot:void 0}}var xm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Me.encode(Me.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=AE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.snapshot=Me.unwrap(Me.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return xm.fromPartial(e??{})},fromPartial(e){let t=AE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function CE(){return{baseEvent:void 0,delta:[]}}var Am={encode(e,t=new je){e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)lm.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=CE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(lm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Am.fromPartial(e??{})},fromPartial(e){let t=CE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>lm.fromPartial(r))||[],t}};function bE(){return{baseEvent:void 0,messages:[]}}var Cm={encode(e,t=new je){e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)fm.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=bE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(fm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Cm.fromPartial(e??{})},fromPartial(e){let t=bE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>fm.fromPartial(r))||[],t}};function wE(){return{baseEvent:void 0,event:void 0,source:void 0}}var bm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Me.encode(Me.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=wE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.event=Me.unwrap(Me.decode(r,r.uint32()));continue;case 3:if(a!==26)break;o.source=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return bm.fromPartial(e??{})},fromPartial(e){let t=wE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function RE(){return{baseEvent:void 0,name:"",value:void 0}}var wm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&Me.encode(Me.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=RE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.name=r.string();continue;case 3:if(a!==26)break;o.value=Me.unwrap(Me.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return wm.fromPartial(e??{})},fromPartial(e){let t=RE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function FE(){return{baseEvent:void 0,threadId:"",runId:""}}var Rm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=FE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Rm.fromPartial(e??{})},fromPartial(e){let t=FE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function EE(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var Fm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&Me.encode(Me.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=EE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue;case 4:if(a!==34)break;o.result=Me.unwrap(Me.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Fm.fromPartial(e??{})},fromPartial(e){let t=EE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function IE(){return{baseEvent:void 0,code:void 0,message:""}}var Em={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=IE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.code=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Em.fromPartial(e??{})},fromPartial(e){let t=IE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function TE(){return{baseEvent:void 0,stepName:""}}var Im={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=TE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Im.fromPartial(e??{})},fromPartial(e){let t=TE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function PE(){return{baseEvent:void 0,stepName:""}}var Tm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=PE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Tm.fromPartial(e??{})},fromPartial(e){let t=PE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function kE(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var Pm={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=kE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Pm.fromPartial(e??{})},fromPartial(e){let t=kE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function OE(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var km={encode(e,t=new je){return e.baseEvent!==void 0&&ve.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=OE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ve.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue;case 5:if(a!==42)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return km.fromPartial(e??{})},fromPartial(e){let t=OE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ve.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function NE(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var _E={encode(e,t=new je){return e.textMessageStart!==void 0&&mm.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&gm.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&hm.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&ym.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Sm.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&vm.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&xm.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Am.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Cm.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&bm.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&wm.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Rm.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Fm.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Em.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Im.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Tm.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Pm.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&km.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof ge?e:new ge(e),n=t===void 0?r.len:r.pos+t,o=NE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.textMessageStart=mm.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.textMessageContent=gm.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=hm.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=ym.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=Sm.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=vm.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=xm.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=Am.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=Cm.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=bm.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=wm.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Rm.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=Fm.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=Em.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=Im.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=Tm.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=Pm.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=km.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return _E.fromPartial(e??{})},fromPartial(e){let t=NE();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?mm.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?gm.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?hm.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?ym.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Sm.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?vm.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?xm.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Am.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Cm.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?bm.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?wm.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Rm.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Fm.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Em.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Im.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Tm.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Pm.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?km.fromPartial(e.toolCallChunk):void 0,t}};function NU(e){let t=g.Number(e.toString());if(t>g.Number.MAX_SAFE_INTEGER)throw new g.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<g.Number.MIN_SAFE_INTEGER)throw new g.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function DE(e){let t=_E.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=OU[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===M.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===M.STATE_DELTA)for(let n of r.delta)n.op=kU[n.op].toLowerCase(),Object.keys(n).forEach(o=>{n[o]===void 0&&delete n[o]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),Pf.parse(r)}var qE="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var DU=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,dx=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(DU);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},ME=e=>e==="*"||e==="x"||e==="X",VE=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},qU=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],MU=(e,t)=>{if(ME(e)||ME(t))return 0;let[r,n]=qU(VE(e),VE(t));return r>n?1:r<n?-1:0},px=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=MU(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var Om=(e,t)=>{let r=dx(e),n=dx(t),o=r.pop(),a=n.pop(),i=px(r,n);return i!==0?i:o&&a?px(o.split("."),a.split(".")):o||a?o?-1:1:0};var $e=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function Ol(){return Vo()}function Be(_x141,_x142,_x143,_x144){return _Be.apply(this,arguments)}function _Be(){_Be=_asyncToGenerator(function*(e,t,r,n){let o=t,a=r,i;for(let p of e)try{let f=yield n(p,$e(o),$e(a));if(f===void 0)continue;if(f.messages!==void 0&&(o=f.messages),f.state!==void 0&&(a=f.state),i=f.stopPropagation,i===!0)break}catch(f){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",f);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(a)===JSON.stringify(r)?{}:{state:a}),...(i===void 0?{}:{stopPropagation:i})}});return _Be.apply(this,arguments)}var GE=(e,t,r,n)=>{let o=$e(r.messages),a=$e(e.state),i={},p=m=>{m.messages!==void 0&&(o=m.messages,i.messages=m.messages),m.state!==void 0&&(a=m.state,i.state=m.state)},f=()=>{let m=$e(i);return i={},m.messages!==void 0||m.state!==void 0?ot(m):$f};return t.pipe(am(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(m){let h=yield Be(n,o,a,(x,A,y)=>x.onEvent?.({event:m,agent:r,input:e,messages:A,state:y}));if(p(h),h.stopPropagation===!0)return f();switch(m.type){case M.TEXT_MESSAGE_START:{let x=yield Be(n,o,a,(A,y,C)=>A.onTextMessageStartEvent?.({event:m,messages:y,state:C,agent:r,input:e}));if(p(x),x.stopPropagation!==!0){let{messageId:A,role:y="assistant"}=m;if(!o.find(C=>C.id===A)){let C={id:A,role:y,content:""};o.push(C),p({messages:o})}}return f()}case M.TEXT_MESSAGE_CONTENT:{let{messageId:x,delta:A}=m,y=o.find(R=>R.id===x);if(!y)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${x}'`),f();let C=yield Be(n,o,a,(R,b,w)=>R.onTextMessageContentEvent?.({event:m,messages:b,state:w,agent:r,input:e,textMessageBuffer:typeof y.content=="string"?y.content:""}));return p(C),C.stopPropagation!==!0&&(y.content=`${typeof y.content=="string"?y.content:""}${A}`,p({messages:o})),f()}case M.TEXT_MESSAGE_END:{let{messageId:x}=m,A=o.find(y=>y.id===x);return A?(p(yield Be(n,o,a,(y,C,R)=>y.onTextMessageEndEvent?.({event:m,messages:C,state:R,agent:r,input:e,textMessageBuffer:typeof A.content=="string"?A.content:""}))),yield Promise.all(n.map(y=>{y.onNewMessage?.({message:A,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${x}'`),f())}case M.TOOL_CALL_START:{let x=yield Be(n,o,a,(A,y,C)=>A.onToolCallStartEvent?.({event:m,messages:y,state:C,agent:r,input:e}));if(p(x),x.stopPropagation!==!0){let{toolCallId:A,toolCallName:y,parentMessageId:C}=m,R;C&&o.length>0&&o[o.length-1].id===C?R=o[o.length-1]:(R={id:C||A,role:"assistant",toolCalls:[]},o.push(R)),R.toolCalls??(R.toolCalls=[]),R.toolCalls.push({id:A,type:"function",function:{name:y,arguments:""}}),p({messages:o})}return f()}case M.TOOL_CALL_ARGS:{let{toolCallId:x,delta:A}=m,y=o.find(b=>b.toolCalls?.some(w=>w.id===x));if(!y)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${x}'`),f();let C=y.toolCalls?.find(b=>b.id===x);if(!C)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${x}'`),f();let R=yield Be(n,o,a,(b,w,P)=>{let F=C.function.arguments,k=C.function.name,T={};try{T=sm(F)}catch{}return b.onToolCallArgsEvent?.({event:m,messages:w,state:P,agent:r,input:e,toolCallBuffer:F,toolCallName:k,partialToolCallArgs:T})});return p(R),R.stopPropagation!==!0&&(C.function.arguments+=A,p({messages:o})),f()}case M.TOOL_CALL_END:{let{toolCallId:x}=m,A=o.find(C=>C.toolCalls?.some(R=>R.id===x));if(!A)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${x}'`),f();let y=A.toolCalls?.find(C=>C.id===x);return y?(p(yield Be(n,o,a,(C,R,b)=>{let w=y.function.arguments,P=y.function.name,F={};try{F=JSON.parse(w)}catch{}return C.onToolCallEndEvent?.({event:m,messages:R,state:b,agent:r,input:e,toolCallName:P,toolCallArgs:F})})),yield Promise.all(n.map(C=>{C.onNewToolCall?.({toolCall:y,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${x}'`),f())}case M.TOOL_CALL_RESULT:{let x=yield Be(n,o,a,(A,y,C)=>A.onToolCallResultEvent?.({event:m,messages:y,state:C,agent:r,input:e}));if(p(x),x.stopPropagation!==!0){let{messageId:A,toolCallId:y,content:C,role:R}=m,b={id:A,toolCallId:y,role:R||"tool",content:C};o.push(b),yield Promise.all(n.map(w=>{w.onNewMessage?.({message:b,messages:o,state:a,agent:r,input:e})})),p({messages:o})}return f()}case M.STATE_SNAPSHOT:{let x=yield Be(n,o,a,(A,y,C)=>A.onStateSnapshotEvent?.({event:m,messages:y,state:C,agent:r,input:e}));if(p(x),x.stopPropagation!==!0){let{snapshot:A}=m;a=A,p({state:a})}return f()}case M.STATE_DELTA:{let x=yield Be(n,o,a,(A,y,C)=>A.onStateDeltaEvent?.({event:m,messages:y,state:C,agent:r,input:e}));if(p(x),x.stopPropagation!==!0){let{delta:A}=m;try{a=Bo(a,A,!0,!1).newDocument,p({state:a})}catch(y){let C=y instanceof Error?y.message:String(y);console.warn(`Failed to apply state patch:
|
|
36
|
-
Current state: ${JSON.stringify(
|
|
35
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function El(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ec=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=no(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(b){t={error:b}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var g=this.initialTeardown;if(Ne(g))try{g()}catch(b){a=b instanceof Uf?b.errors:[b]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var C=no(v),h=C.next();!h.done;h=C.next()){var A=h.value;try{tE(A)}catch(b){a=a??[],b instanceof Uf?a=Js(Js([],Xs(a)),Xs(b.errors)):a.push(b)}}}catch(b){n={error:b}}finally{try{h&&!h.done&&(o=C.return)&&o.call(C)}finally{if(n)throw n.error}}}if(a)throw new Uf(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)tE(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&El(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&El(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var nx=ec.EMPTY;function Qf(e){return e instanceof ec||e&&"closed"in e&&Ne(e.remove)&&Ne(e.add)&&Ne(e.unsubscribe)}function tE(e){Ne(e)?e():e.unsubscribe()}d();c();l();u();var $r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var tc={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=tc.delegate;return o?.setTimeout?o.setTimeout.apply(o,Js([e,t],Xs(r))):setTimeout.apply(void 0,Js([e,t],Xs(r)))},clearTimeout:function(e){var t=tc.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Bf(e){tc.setTimeout(function(){var t=$r.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function Il(){}d();c();l();u();var rE=function(){return ox("C",void 0,void 0)}();function nE(e){return ox("E",void 0,e)}function oE(e){return ox("N",e,void 0)}function ox(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var ri=null;function rc(e){if($r.useDeprecatedSynchronousErrorHandling){var t=!ri;if(t&&(ri={errorThrown:!1,error:null}),e(),t){var r=ri,n=r.errorThrown,o=r.error;if(ri=null,n)throw o}}else e()}function aE(e){$r.useDeprecatedSynchronousErrorHandling&&ri&&(ri.errorThrown=!0,ri.error=e)}var Tl=function(e){mn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Qf(r)&&r.add(n)):n.destination=rQ,n}return t.create=function(r,n,o){return new $f(r,n,o)},t.prototype.next=function(r){this.isStopped?ix(oE(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?ix(nE(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?ix(rE,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(ec);var ZU=Function.prototype.bind;function ax(e,t){return ZU.call(e,t)}var eQ=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Gf(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Gf(n)}else Gf(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Gf(r)}},e}(),$f=function(e){mn(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(Ne(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&$r.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&ax(r.next,p),error:r.error&&ax(r.error,p),complete:r.complete&&ax(r.complete,p)}):i=r}return a.destination=new eQ(i),a}return t}(Tl);function Gf(e){$r.useDeprecatedSynchronousErrorHandling?aE(e):Bf(e)}function tQ(e){throw e}function ix(e,t){var r=$r.onStoppedNotification;r&&tc.setTimeout(function(){return r(e,t)})}var rQ={closed:!0,next:Il,error:tQ,complete:Il};d();c();l();u();var nc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function oc(e){return e}function Hf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return sx(e)}function sx(e){return e.length===0?oc:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ze=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=oQ(t)?t:new $f(t,r,n);return rc(function(){var i=o,p=i.operator,f=i.source;a.add(p?p.call(a,f):f?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=iE(r),new r(function(o,a){var i=new $f({next:function(p){try{t(p)}catch(f){a(f),i.unsubscribe()}},error:a,complete:o});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[nc]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return sx(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=iE(t),new t(function(n,o){var a;r.subscribe(function(i){return a=i},function(i){return o(i)},function(){return n(a)})})},e.create=function(t){return new e(t)},e}();function iE(e){var t;return(t=e??$r.Promise)!==null&&t!==void 0?t:Promise}function nQ(e){return e&&Ne(e.next)&&Ne(e.error)&&Ne(e.complete)}function oQ(e){return e&&e instanceof Tl||nQ(e)&&Qf(e)}d();c();l();u();function aQ(e){return Ne(e?.lift)}function mt(e){return function(t){if(aQ(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function At(e,t,r,n,o){return new iQ(e,t,r,n,o)}var iQ=function(e){mn(t,e);function t(r,n,o,a,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(g){r.error(g)}}:e.prototype._next,f._error=a?function(m){try{a(m)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(Tl);d();c();l();u();d();c();l();u();var sE=Zs(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var gn=function(e){mn(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new cE(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new sE},t.prototype.next=function(r){var n=this;rc(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=no(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;rc(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;rc(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,i=o.isStopped,p=o.observers;return a||i?nx:(this.currentObservers=null,p.push(r),new ec(function(){n.currentObservers=null,El(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,i=n.isStopped;o?r.error(a):i&&r.complete()},t.prototype.asObservable=function(){var r=new Ze;return r.source=this,r},t.create=function(r,n){return new cE(r,n)},t}(Ze);var cE=function(e){mn(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:nx},t}(gn);d();c();l();u();d();c();l();u();var cx={now:function(){return(cx.delegate||Date).now()},delegate:void 0};var zf=function(e){mn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=cx);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(a.push(r),!i&&a.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,i=o._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=a?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<a.length&&a.splice(0,a.length-p),!i){for(var f=o.now(),m=0,g=1;g<a.length&&a[g]<=f;g+=2)m=g;m&&a.splice(0,m+1)}},t}(gn);d();c();l();u();var Wf=new Ze(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function uE(e){return e&&Ne(e.schedule)}function sQ(e){return e[e.length-1]}function lE(e){return uE(sQ(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Kf=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function Yf(e){return Ne(e?.then)}d();c();l();u();function Xf(e){return Ne(e[nc])}d();c();l();u();function Jf(e){return Symbol.asyncIterator&&Ne(e?.[Symbol.asyncIterator])}d();c();l();u();function Zf(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function cQ(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var em=cQ();function tm(e){return Ne(e?.[em])}d();c();l();u();function rm(e){return ZF(this,arguments,function(){var r,n,o,a;return Lf(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,ti(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,ti(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,ti(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function nm(e){return Ne(e?.getReader)}function Ct(e){if(e instanceof Ze)return e;if(e!=null){if(Xf(e))return uQ(e);if(Kf(e))return lQ(e);if(Yf(e))return dQ(e);if(Jf(e))return dE(e);if(tm(e))return pQ(e);if(nm(e))return fQ(e)}throw Zf(e)}function uQ(e){return new Ze(function(t){var r=e[nc]();if(Ne(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function lQ(e){return new Ze(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function dQ(e){return new Ze(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Bf)})}function pQ(e){return new Ze(function(t){var r,n;try{for(var o=no(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function dE(e){return new Ze(function(t){mQ(e,t).catch(function(r){return t.error(r)})})}function fQ(e){return dE(rm(e))}function mQ(e,t){var r,n,o,a;return JF(this,void 0,void 0,function(){var i,p;return Lf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=eE(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function Ir(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function om(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(At(n,function(o){return Ir(n,e,function(){return n.next(o)},t)},function(){return Ir(n,e,function(){return n.complete()},t)},function(o){return Ir(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function am(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function pE(e,t){return Ct(e).pipe(am(t),om(t))}d();c();l();u();function fE(e,t){return Ct(e).pipe(am(t),om(t))}d();c();l();u();function mE(e,t){return new Ze(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function gE(e,t){return new Ze(function(r){var n;return Ir(r,t,function(){n=e[em](),Ir(r,t,function(){var o,a,i;try{o=n.next(),a=o.value,i=o.done}catch(p){r.error(p);return}i?r.complete():r.next(a)},0,!0)}),function(){return Ne(n?.return)&&n.return()}})}d();c();l();u();function im(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ze(function(r){Ir(r,t,function(){var n=e[Symbol.asyncIterator]();Ir(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function hE(e,t){return im(rm(e),t)}function yE(e,t){if(e!=null){if(Xf(e))return pE(e,t);if(Kf(e))return mE(e,t);if(Yf(e))return fE(e,t);if(Jf(e))return im(e,t);if(tm(e))return gE(e,t);if(nm(e))return hE(e,t)}throw Zf(e)}function ni(e,t){return t?yE(e,t):Ct(e)}function ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=lE(e);return ni(e,r)}d();c();l();u();function et(e,t){var r=Ne(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ze(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var SE=Zs(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function sm(e,t){var r=typeof t=="object";return new Promise(function(n,o){var a=!1,i;e.subscribe({next:function(p){i=p,a=!0},error:o,complete:function(){a?n(i):r?n(t.defaultValue):o(new SE)}})})}d();c();l();u();function oi(e,t){return mt(function(r,n){var o=0;r.subscribe(At(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function vE(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,v=!1,C=function(){v&&!f.length&&!m&&t.complete()},h=function(b){return m<n?A(b):f.push(b)},A=function(b){a&&t.next(b),m++;var w=!1;Ct(r(b,g++)).subscribe(At(t,function(R){o?.(R),a?h(R):t.next(R)},function(){w=!0},void 0,function(){if(w)try{m--;for(var R=function(){var E=f.shift();i?Ir(t,i,function(){return A(E)}):A(E)};f.length&&m<n;)R();C()}catch(E){t.error(E)}}))};return e.subscribe(At(t,h,function(){v=!0,C()})),function(){p?.()}}function rr(e,t,r){return r===void 0&&(r=1/0),Ne(t)?rr(function(n,o){return oi(function(a,i){return t(n,a,o,i)})(Ct(e(n,o)))},r):(typeof t=="number"&&(r=t),mt(function(n,o){return vE(n,o,e,r)}))}function ux(e){return e===void 0&&(e=1/0),rr(oc,e)}d();c();l();u();function cm(e){return new Ze(function(t){Ct(e()).subscribe(t)})}d();c();l();u();function Pl(e){return mt(function(t,r){var n=null,o=!1,a;n=t.subscribe(At(r,void 0,void 0,function(i){a=Ct(e(i,Pl(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();l();u();function um(e,t){return Ne(t)?rr(e,t,1):rr(e,1)}d();c();l();u();function lx(e){return mt(function(t,r){var n=!1;t.subscribe(At(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function ai(e){return mt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function dx(e,t){return mt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(At(n,function(f){o?.unsubscribe();var m=0,g=a++;Ct(e(f,g)).subscribe(o=At(n,function(v){return n.next(t?t(f,v,g,m++):v)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function lm(e){return mt(function(t,r){Ct(e).subscribe(At(r,function(){return r.complete()},Il)),!r.closed&&t.subscribe(r)})}d();c();l();u();function px(e,t,r){var n=Ne(e)||t||r?{next:e,error:t,complete:r}:e;return n?mt(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(At(a,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),a.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),a.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),a.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):oc}d();c();l();u();d();c();l();u();function xE(e){return` \r
|
|
36
|
+
`.indexOf(e)>=0}function dm(e){for(var t=["topLevel"],r=0,n,o,a,i=function(E){return t.push(E)},p=function(E){return t[t.length-1]=E},f=function(E){n==null&&(n=r,o=t.length,a=E)},m=function(E){E===a&&(n=void 0,o=void 0,a=void 0)},g=function(){return t.pop()},v=function(){return r--},C=function(E){if("0"<=E&&E<="9"){i("number");return}switch(E){case"\"":i("string");return;case"-":i("numberNeedsDigit");return;case"t":i("true");return;case"f":i("false");return;case"n":i("null");return;case"[":i("arrayNeedsValue");return;case"{":i("objectNeedsKey");return}},h=e.length;r<h;r++){var A=e[r];switch(t[t.length-1]){case"topLevel":C(A);break;case"string":switch(A){case"\"":g();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":A==="u"?i("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":A==="."?p("numberNeedsDigit"):A==="e"||A==="E"?p("numberNeedsExponent"):(A<"0"||A>"9")&&(v(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(A==="+"||A==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(A<"a"||A>"z")&&(v(),g());break;case"arrayNeedsValue":A==="]"?g():xE(A)||(m("collectionItem"),p("arrayNeedsComma"),C(A));break;case"arrayNeedsComma":A==="]"?g():A===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":A==="}"?g():A==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":A===":"&&p("objectNeedsValue");break;case"objectNeedsValue":xE(A)||(m("collectionItem"),p("objectNeedsComma"),C(A));break;case"objectNeedsComma":A==="}"?g():A===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var b=[n!=null?e.slice(0,n):e],w=function(E){return b.push(E.slice(e.length-e.lastIndexOf(E[0])))},R=t.length-1;R>=0;R--)switch(t[R]){case"string":b.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":b.push("0");break;case"true":w("true");break;case"false":w("false");break;case"null":w("null");break;case"arrayNeedsValue":case"arrayNeedsComma":b.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":b.push("}");break}return b.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function CE(){let e=0,t=0;for(let n=0;n<28;n+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function fm(e,t,r){for(let a=0;a<28;a=a+7){let i=e>>>a,p=!(!(i>>>7)&&t==0),f=(p?i|128:i)&255;if(r.push(f),!p)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let a=3;a<31;a=a+7){let i=t>>>a,p=!!(i>>>7),f=(p?i|128:i)&255;if(r.push(f),!p)return}r.push(t>>>31&1)}}var pm=4294967296;function fx(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function a(i,p){let f=Number(e.slice(i,p));o*=r,n=n*r+f,n>=pm&&(o=o+(n/pm|0),n=n%pm)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?wE(n,o):gx(n,o)}function bE(e,t){let r=gx(e,t),n=r.hi&2147483648;n&&(r=wE(r.lo,r.hi));let o=mx(r.lo,r.hi);return n?"-"+o:o}function mx(e,t){if({lo:e,hi:t}=gQ(e,t),t<=2097151)return String(pm*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,a=r+n*6777216+o*6710656,i=n+o*8147497,p=o*2,f=1e7;return a>=f&&(i+=Math.floor(a/f),a%=f),i>=f&&(p+=Math.floor(i/f),i%=f),p.toString()+AE(i)+AE(a)}function gQ(e,t){return{lo:e>>>0,hi:t>>>0}}function gx(e,t){return{lo:e|0,hi:t|0}}function wE(e,t){return t=~t,e?e=~e+1:t+=1,gx(e,t)}var AE=e=>{let t=String(e);return"0000000".slice(t.length)+t};function hx(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function RE(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var Hr=hQ();function hQ(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!y.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>n||p<r)throw new Error(`invalid int64: ${i}`);return p},uParse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>a||p<o)throw new Error(`invalid uint64: ${i}`);return p},enc(i){return e.setBigInt64(0,this.parse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(i){return e.setBigInt64(0,this.uParse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),FE(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),EE(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),FE(r),fx(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),EE(r),fx(r)},dec(r,n){return bE(r,n)},uDec(r,n){return mx(r,n)}}}function FE(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function EE(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var yx=Symbol.for("@bufbuild/protobuf/text-encoding");function Sx(){if(y[yx]==null){let e=new y.TextEncoder,t=new y.TextDecoder;y[yx]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return y[yx]}var $o;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})($o||($o={}));var yQ=34028234663852886e22,SQ=-34028234663852886e22,vQ=4294967295,xQ=2147483647,AQ=-2147483648,Oe=class{constructor(t=Sx().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let o=0;o<this.chunks.length;o++)t+=this.chunks[o].length;let r=new Uint8Array(t),n=0;for(let o=0;o<this.chunks.length;o++)r.set(this.chunks[o],n),n+=this.chunks[o].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(IE(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return vx(t),hx(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){CQ(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){IE(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){vx(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return vx(t),t=(t<<1^t>>31)>>>0,hx(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Hr.enc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Hr.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=Hr.enc(t);return fm(r.lo,r.hi,this.buf),this}sint64(t){let r=Hr.enc(t),n=r.hi>>31,o=r.lo<<1^n,a=(r.hi<<1|r.lo>>>31)^n;return fm(o,a,this.buf),this}uint64(t){let r=Hr.uEnc(t);return fm(r.lo,r.hi,this.buf),this}},se=class{constructor(t,r=Sx().decodeUtf8){this.decodeUtf8=r,this.varint64=CE,this.uint32=RE,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case $o.Varint:for(;this.buf[this.pos++]&128;);break;case $o.Bit64:this.pos+=4;case $o.Bit32:this.pos+=4;break;case $o.LengthDelimited:let o=this.uint32();this.pos+=o;break;case $o.StartGroup:for(;;){let[a,i]=this.tag();if(i===$o.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(i,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Hr.dec(...this.varint64())}uint64(){return Hr.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,Hr.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Hr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Hr.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}};function vx(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>xQ||e<AQ)throw new Error("invalid int32: "+e)}function IE(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>vQ||e<0)throw new Error("invalid uint32: "+e)}function CQ(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>yQ||e<SQ))throw new Error("invalid float32: "+e)}var bQ=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function xx(){return{fields:{}}}var kl={encode(e,t=new Oe){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&bx.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=xx();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=bx.decode(r,r.uint32());i.value!==void 0&&(o.fields[i.key]=i.value);continue}}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return kl.fromPartial(e??{})},fromPartial(e){let t=xx();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=xx();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function TE(){return{key:"",value:void 0}}var bx={encode(e,t=new Oe){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&we.encode(we.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=TE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.key=r.string();continue;case 2:if(a!==18)break;o.value=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return bx.fromPartial(e??{})},fromPartial(e){let t=TE();return t.key=e.key??"",t.value=e.value??void 0,t}};function Ax(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var we={encode(e,t=new Oe){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&kl.encode(kl.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Ol.encode(Ol.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=Ax();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.nullValue=r.int32();continue;case 2:if(a!==17)break;o.numberValue=r.double();continue;case 3:if(a!==26)break;o.stringValue=r.string();continue;case 4:if(a!==32)break;o.boolValue=r.bool();continue;case 5:if(a!==42)break;o.structValue=kl.unwrap(kl.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=Ol.unwrap(Ol.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return we.fromPartial(e??{})},fromPartial(e){let t=Ax();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=Ax();if(e===null)t.nullValue=bQ.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(y.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new y.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Cx(){return{values:[]}}var Ol={encode(e,t=new Oe){for(let r of e.values)we.encode(we.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=Cx();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.values.push(we.unwrap(we.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Ol.fromPartial(e??{})},fromPartial(e){let t=Cx();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=Cx();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},wQ=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function PE(){return{op:0,path:"",from:void 0,value:void 0}}var gm={encode(e,t=new Oe){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&we.encode(we.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=PE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.op=r.int32();continue;case 2:if(a!==18)break;o.path=r.string();continue;case 3:if(a!==26)break;o.from=r.string();continue;case 4:if(a!==34)break;o.value=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return gm.fromPartial(e??{})},fromPartial(e){let t=PE();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function kE(){return{id:"",type:"",function:void 0}}var hm={encode(e,t=new Oe){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&ym.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=kE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.type=r.string();continue;case 3:if(a!==26)break;o.function=ym.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return hm.fromPartial(e??{})},fromPartial(e){let t=kE();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?ym.fromPartial(e.function):void 0,t}};function OE(){return{name:"",arguments:""}}var ym={encode(e,t=new Oe){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=OE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.name=r.string();continue;case 2:if(a!==18)break;o.arguments=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ym.fromPartial(e??{})},fromPartial(e){let t=OE();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function _E(){return{value:"",mimeType:""}}var Sm={encode(e,t=new Oe){return e.value!==""&&t.uint32(10).string(e.value),e.mimeType!==""&&t.uint32(18).string(e.mimeType),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=_E();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.value=r.string();continue;case 2:if(a!==18)break;o.mimeType=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Sm.fromPartial(e??{})},fromPartial(e){let t=_E();return t.value=e.value??"",t.mimeType=e.mimeType??"",t}};function NE(){return{value:"",mimeType:void 0}}var vm={encode(e,t=new Oe){return e.value!==""&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=NE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.value=r.string();continue;case 2:if(a!==18)break;o.mimeType=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return vm.fromPartial(e??{})},fromPartial(e){let t=NE();return t.value=e.value??"",t.mimeType=e.mimeType??void 0,t}};function DE(){return{data:void 0,url:void 0}}var pr={encode(e,t=new Oe){return e.data!==void 0&&Sm.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&vm.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=DE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.data=Sm.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.url=vm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return pr.fromPartial(e??{})},fromPartial(e){let t=DE();return t.data=e.data!==void 0&&e.data!==null?Sm.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?vm.fromPartial(e.url):void 0,t}};function qE(){return{text:""}}var xm={encode(e,t=new Oe){return e.text!==""&&t.uint32(10).string(e.text),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=qE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.text=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return xm.fromPartial(e??{})},fromPartial(e){let t=qE();return t.text=e.text??"",t}};function ME(){return{source:void 0,metadata:void 0}}var Am={encode(e,t=new Oe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&we.encode(we.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=ME();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Am.fromPartial(e??{})},fromPartial(e){let t=ME();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function VE(){return{source:void 0,metadata:void 0}}var Cm={encode(e,t=new Oe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&we.encode(we.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=VE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Cm.fromPartial(e??{})},fromPartial(e){let t=VE();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function jE(){return{source:void 0,metadata:void 0}}var bm={encode(e,t=new Oe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&we.encode(we.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=jE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return bm.fromPartial(e??{})},fromPartial(e){let t=jE();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function LE(){return{source:void 0,metadata:void 0}}var wm={encode(e,t=new Oe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&we.encode(we.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=LE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return wm.fromPartial(e??{})},fromPartial(e){let t=LE();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function UE(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var Rm={encode(e,t=new Oe){return e.text!==void 0&&xm.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Am.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Cm.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&bm.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&wm.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=UE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.text=xm.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.image=Am.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.audio=Cm.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.video=bm.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.document=wm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Rm.fromPartial(e??{})},fromPartial(e){let t=UE();return t.text=e.text!==void 0&&e.text!==null?xm.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Am.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Cm.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?bm.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?wm.fromPartial(e.document):void 0,t}};function QE(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var Fm={encode(e,t=new Oe){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)hm.encode(r,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let r of e.contentParts)Rm.encode(r,t.uint32(66).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=QE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.role=r.string();continue;case 3:if(a!==26)break;o.content=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue;case 5:if(a!==42)break;o.toolCalls.push(hm.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.toolCallId=r.string();continue;case 7:if(a!==58)break;o.error=r.string();continue;case 8:if(a!==66)break;o.contentParts.push(Rm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Fm.fromPartial(e??{})},fromPartial(e){let t=QE();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>hm.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(r=>Rm.fromPartial(r))||[],t}},RQ=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function BE(){return{type:0,timestamp:void 0,rawEvent:void 0}}var xe={encode(e,t=new Oe){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&we.encode(we.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=BE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.type=r.int32();continue;case 2:if(a!==16)break;o.timestamp=FQ(r.int64());continue;case 3:if(a!==26)break;o.rawEvent=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return xe.fromPartial(e??{})},fromPartial(e){let t=BE();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function GE(){return{baseEvent:void 0,messageId:"",role:void 0,name:void 0}}var Em={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=GE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Em.fromPartial(e??{})},fromPartial(e){let t=GE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t.name=e.name??void 0,t}};function $E(){return{baseEvent:void 0,messageId:"",delta:""}}var Im={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=$E();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Im.fromPartial(e??{})},fromPartial(e){let t=$E();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function HE(){return{baseEvent:void 0,messageId:""}}var Tm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=HE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Tm.fromPartial(e??{})},fromPartial(e){let t=HE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function zE(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Pm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=zE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Pm.fromPartial(e??{})},fromPartial(e){let t=zE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function WE(){return{baseEvent:void 0,toolCallId:"",delta:""}}var km={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=WE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return km.fromPartial(e??{})},fromPartial(e){let t=WE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function KE(){return{baseEvent:void 0,toolCallId:""}}var Om={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=KE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Om.fromPartial(e??{})},fromPartial(e){let t=KE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function YE(){return{baseEvent:void 0,snapshot:void 0}}var _m={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&we.encode(we.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=YE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.snapshot=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return _m.fromPartial(e??{})},fromPartial(e){let t=YE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function XE(){return{baseEvent:void 0,delta:[]}}var Nm={encode(e,t=new Oe){e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)gm.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=XE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(gm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Nm.fromPartial(e??{})},fromPartial(e){let t=XE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>gm.fromPartial(r))||[],t}};function JE(){return{baseEvent:void 0,messages:[]}}var Dm={encode(e,t=new Oe){e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)Fm.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=JE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(Fm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Dm.fromPartial(e??{})},fromPartial(e){let t=JE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>Fm.fromPartial(r))||[],t}};function ZE(){return{baseEvent:void 0,event:void 0,source:void 0}}var qm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&we.encode(we.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=ZE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.event=we.unwrap(we.decode(r,r.uint32()));continue;case 3:if(a!==26)break;o.source=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qm.fromPartial(e??{})},fromPartial(e){let t=ZE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function eI(){return{baseEvent:void 0,name:"",value:void 0}}var Mm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&we.encode(we.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=eI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.name=r.string();continue;case 3:if(a!==26)break;o.value=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Mm.fromPartial(e??{})},fromPartial(e){let t=eI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function tI(){return{baseEvent:void 0,threadId:"",runId:""}}var Vm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=tI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Vm.fromPartial(e??{})},fromPartial(e){let t=tI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function rI(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var jm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&we.encode(we.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=rI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue;case 4:if(a!==34)break;o.result=we.unwrap(we.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return jm.fromPartial(e??{})},fromPartial(e){let t=rI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function nI(){return{baseEvent:void 0,code:void 0,message:""}}var Lm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=nI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.code=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Lm.fromPartial(e??{})},fromPartial(e){let t=nI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function oI(){return{baseEvent:void 0,stepName:""}}var Um={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=oI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Um.fromPartial(e??{})},fromPartial(e){let t=oI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function aI(){return{baseEvent:void 0,stepName:""}}var Qm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=aI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Qm.fromPartial(e??{})},fromPartial(e){let t=aI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function iI(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var Bm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=iI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.delta=r.string();continue;case 5:if(a!==42)break;o.name=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Bm.fromPartial(e??{})},fromPartial(e){let t=iI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t}};function sI(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Gm={encode(e,t=new Oe){return e.baseEvent!==void 0&&xe.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=sI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=xe.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue;case 5:if(a!==42)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Gm.fromPartial(e??{})},fromPartial(e){let t=sI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?xe.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function cI(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var uI={encode(e,t=new Oe){return e.textMessageStart!==void 0&&Em.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Im.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Tm.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Pm.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&km.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Om.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&_m.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Nm.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Dm.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&qm.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Mm.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Vm.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&jm.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Lm.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Um.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Qm.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Bm.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Gm.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=cI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.textMessageStart=Em.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.textMessageContent=Im.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=Tm.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=Pm.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=km.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=Om.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=_m.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=Nm.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=Dm.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=qm.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=Mm.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Vm.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=jm.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=Lm.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=Um.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=Qm.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=Bm.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=Gm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return uI.fromPartial(e??{})},fromPartial(e){let t=cI();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Em.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Im.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Tm.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Pm.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?km.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Om.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?_m.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Nm.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Dm.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?qm.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Mm.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Vm.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?jm.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Lm.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Um.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Qm.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Bm.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Gm.fromPartial(e.toolCallChunk):void 0,t}};function FQ(e){let t=y.Number(e.toString());if(t>y.Number.MAX_SAFE_INTEGER)throw new y.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<y.Number.MIN_SAFE_INTEGER)throw new y.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}var mm=e=>{if(!(!e||typeof e!="object")){if(e.data)return{type:"data",value:e.data.value,mimeType:e.data.mimeType};if(e.url)return{type:"url",value:e.url.value,mimeType:e.url.mimeType}}},EQ=e=>{if(!(!e||typeof e!="object")){if(e.text)return{type:"text",text:e.text.text};if(e.image)return{type:"image",source:mm(e.image.source),metadata:e.image.metadata};if(e.audio)return{type:"audio",source:mm(e.audio.source),metadata:e.audio.metadata};if(e.video)return{type:"video",source:mm(e.video.source),metadata:e.video.metadata};if(e.document)return{type:"document",source:mm(e.document.source),metadata:e.document.metadata}}};function lI(e){let t=uI.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=RQ[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===M.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;if(o.role==="user"&&Array.isArray(o.contentParts)){let a=o.contentParts.map(i=>EQ(i)).filter(i=>i!==void 0);a.length>0&&(o.content=a)}Array.isArray(o.contentParts)&&o.contentParts.length===0&&(o.contentParts=void 0),o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===M.STATE_DELTA)for(let n of r.delta)n.op=wQ[n.op].toLowerCase(),Object.keys(n).forEach(o=>{n[o]===void 0&&delete n[o]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),_f.parse(r)}var wx="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var TQ=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Rx=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(TQ);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},dI=e=>e==="*"||e==="x"||e==="X",pI=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},PQ=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],kQ=(e,t)=>{if(dI(e)||dI(t))return 0;let[r,n]=PQ(pI(e),pI(t));return r>n?1:r<n?-1:0},Fx=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=kQ(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var $m=(e,t)=>{let r=Rx(e),n=Rx(t),o=r.pop(),a=n.pop(),i=Fx(r,n);return i!==0?i:o&&a?Fx(o.split("."),a.split(".")):o||a?o?-1:1:0};var Le=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function _l(){return jo()}function Tx(e){if(Object.freeze(e),typeof e=="object"&&e)for(let t of Object.values(e))typeof t=="object"&&t&&!Object.isFrozen(t)&&Tx(t);return e}function Ge(_x140,_x141,_x142,_x143){return _Ge.apply(this,arguments)}function _Ge(){_Ge=_asyncToGenerator(function*(e,t,r,n){let o=typeof process<"u"&&process.env!==void 0,a=o&&!!process.env.VITEST_WORKER_ID,i=o&&!!process.env.VITEST_WORKER_ID,p=Le(t),f=Le(r),m=p,g=f,v;for(let C of e)try{i&&(Tx(m),Tx(g));let h=yield n(C,m,g);if(h===void 0)continue;if(h.messages!==void 0&&h.messages!==m&&(m=Le(h.messages)),h.state!==void 0&&h.state!==g&&(g=Le(h.state)),v=h.stopPropagation,v===!0)break}catch(h){if(i&&h instanceof TypeError){if(a)throw h;console.error("AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.",h)}else a||console.error("Subscriber error:",h);continue}return{...(m===p?{}:{messages:i&&Object.isFrozen(m)?Le(m):m}),...(g===f?{}:{state:i&&Object.isFrozen(g)?Le(g):g}),...(v===void 0?{}:{stopPropagation:v})}});return _Ge.apply(this,arguments)}function Hm(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,r=e.lifecycle??!0,n=e.verbose??!1;return{enabled:t||r,events:t,lifecycle:r,verbose:n}}function Nl(e){if(e instanceof Px)return e;if(e===!0)return new Px(Hm(!0))}var Px=class{constructor(e){this.config=e}event(e,t,r,n){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof r=="string"?r:JSON.stringify(r)):console.debug(`[${e}] ${t}`,n??r))}lifecycle(e,t,r){this.config.lifecycle&&(r?console.debug(`[${e}] ${t}`,r):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function Ex(e){return e.enabled?new Px(e):void 0}function OQ(e,t,r){if(t){let o=e.find(i=>i.id===t);if(o?.role==="assistant")return o;o&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${o.role}' message, not assistant \u2014 falling back to toolCallId`);let a={id:o?r:t,role:"assistant",toolCalls:[]};return e.push(a),a}let n={id:r,role:"assistant",toolCalls:[]};return e.push(n),n}var SI=(e,t,r,n,o)=>{let a=Nl(o),i=Le(r.messages),p=Le(e.state),f={},m=v=>{v.messages!==void 0&&(i=v.messages,f.messages=v.messages),v.state!==void 0&&(p=v.state,f.state=v.state)},g=()=>{let v=Le(f);return f={},v.messages!==void 0||v.state!==void 0?ot(v):Wf};return t.pipe(um(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(v){let C=yield Ge(n,i,p,(h,A,b)=>h.onEvent?.({event:v,agent:r,input:e,messages:A,state:b}));if(m(C),C.stopPropagation===!0?a?.event("APPLY","Event dropped:",v,{type:v.type,reason:"stopPropagation by subscriber"}):a?.event("APPLY","Event applied:",v,{type:v.type,subscribers:n.length}),C.stopPropagation===!0)return g();switch(v.type){case M.TEXT_MESSAGE_START:{let h=yield Ge(n,i,p,(A,b,w)=>A.onTextMessageStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:A,role:b="assistant",name:w}=v;if(!i.find(R=>R.id===A)){let R={id:A,role:b,content:"",...(w!==void 0&&{name:w})};i.push(R),m({messages:i})}}return g()}case M.TEXT_MESSAGE_CONTENT:{let{messageId:h,delta:A}=v,b=i.find(R=>R.id===h);if(!b)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${h}'`),g();let w=yield Ge(n,i,p,(R,E,I)=>R.onTextMessageContentEvent?.({event:v,messages:E,state:I,agent:r,input:e,textMessageBuffer:typeof b.content=="string"?b.content:""}));return m(w),w.stopPropagation!==!0&&(b.content=`${typeof b.content=="string"?b.content:""}${A}`,m({messages:i})),g()}case M.TEXT_MESSAGE_END:{let{messageId:h}=v,A=i.find(b=>b.id===h);return A?(m(yield Ge(n,i,p,(b,w,R)=>b.onTextMessageEndEvent?.({event:v,messages:w,state:R,agent:r,input:e,textMessageBuffer:typeof A.content=="string"?A.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:A,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${h}'`),g())}case M.TOOL_CALL_START:{let h=yield Ge(n,i,p,(A,b,w)=>A.onToolCallStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{toolCallId:A,toolCallName:b,parentMessageId:w}=v,R=OQ(i,w,A);R.toolCalls??(R.toolCalls=[]),R.toolCalls.push({id:A,type:"function",function:{name:b,arguments:""}}),m({messages:i})}return g()}case M.TOOL_CALL_ARGS:{let{toolCallId:h,delta:A}=v,b=i.find(E=>E.toolCalls?.some(I=>I.id===h));if(!b)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${h}'`),g();let w=b.toolCalls?.find(E=>E.id===h);if(!w)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${h}'`),g();let R=yield Ge(n,i,p,(E,I,k)=>{let T=w.function.arguments,D=w.function.name,B={};try{B=dm(T)}catch{}return E.onToolCallArgsEvent?.({event:v,messages:I,state:k,agent:r,input:e,toolCallBuffer:T,toolCallName:D,partialToolCallArgs:B})});return m(R),R.stopPropagation!==!0&&(w.function.arguments+=A,m({messages:i})),g()}case M.TOOL_CALL_END:{let{toolCallId:h}=v,A=i.find(w=>w.toolCalls?.some(R=>R.id===h));if(!A)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${h}'`),g();let b=A.toolCalls?.find(w=>w.id===h);return b?(m(yield Ge(n,i,p,(w,R,E)=>{let I=b.function.arguments,k=b.function.name,T={};try{T=JSON.parse(I)}catch{}return w.onToolCallEndEvent?.({event:v,messages:R,state:E,agent:r,input:e,toolCallName:k,toolCallArgs:T})})),yield Promise.all(n.map(w=>{w.onNewToolCall?.({toolCall:b,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${h}'`),g())}case M.TOOL_CALL_RESULT:{let h=yield Ge(n,i,p,(A,b,w)=>A.onToolCallResultEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:A,toolCallId:b,content:w,role:R}=v,E={id:A,toolCallId:b,role:R||"tool",content:w};i.push(E),yield Promise.all(n.map(I=>{I.onNewMessage?.({message:E,messages:i,state:p,agent:r,input:e})})),m({messages:i})}return g()}case M.STATE_SNAPSHOT:{let h=yield Ge(n,i,p,(A,b,w)=>A.onStateSnapshotEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{snapshot:A}=v;p=A,m({state:p})}return g()}case M.STATE_DELTA:{let h=yield Ge(n,i,p,(A,b,w)=>A.onStateDeltaEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{delta:A}=v;try{p=Go(p,A,!0,!1).newDocument,m({state:p})}catch(b){let w=b instanceof Error?b.message:String(b);console.warn(`Failed to apply state patch:
|
|
37
|
+
Current state: ${JSON.stringify(p,null,2)}
|
|
37
38
|
Patch operations: ${JSON.stringify(A,null,2)}
|
|
38
|
-
Error: ${C}`)}}return f()}case M.MESSAGES_SNAPSHOT:{let x=yield Be(n,o,a,(A,y,C)=>A.onMessagesSnapshotEvent?.({event:m,messages:y,state:C,agent:r,input:e}));if(p(x),x.stopPropagation!==!0){let{messages:A}=m;o=A,p({messages:o})}return f()}case M.ACTIVITY_SNAPSHOT:{let x=m,A=o.findIndex(w=>w.id===x.messageId),y=A>=0?o[A]:void 0,C=y?.role==="activity"?y:void 0,R=x.replace??!0,b=yield Be(n,o,a,(w,P,F)=>w.onActivitySnapshotEvent?.({event:x,messages:P,state:F,agent:r,input:e,activityMessage:C,existingMessage:y}));if(p(b),b.stopPropagation!==!0){let w={id:x.messageId,role:"activity",activityType:x.activityType,content:$e(x.content)},P;A===-1?(o.push(w),P=w):C?R&&(o[A]={...C,activityType:x.activityType,content:$e(x.content)}):R&&(o[A]=w,P=w),p({messages:o}),P&&(yield Promise.all(n.map(F=>F.onNewMessage?.({message:P,messages:o,state:a,agent:r,input:e}))))}return f()}case M.ACTIVITY_DELTA:{let x=m,A=o.findIndex(b=>b.id===x.messageId);if(A===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${x.messageId}' to apply patch`),f();let y=o[A];if(y.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${x.messageId}' is not an activity message`),f();let C=y,R=yield Be(n,o,a,(b,w,P)=>b.onActivityDeltaEvent?.({event:x,messages:w,state:P,agent:r,input:e,activityMessage:C}));if(p(R),R.stopPropagation!==!0)try{let b=$e(C.content??{}),w=Bo(b,x.patch??[],!0,!1).newDocument;o[A]={...C,content:$e(w),activityType:x.activityType},p({messages:o})}catch(b){let w=b instanceof Error?b.message:String(b);console.warn(`Failed to apply activity patch for '${x.messageId}': ${w}`)}return f()}case M.RAW:return p(yield Be(n,o,a,(x,A,y)=>x.onRawEvent?.({event:m,messages:A,state:y,agent:r,input:e}))),f();case M.CUSTOM:return p(yield Be(n,o,a,(x,A,y)=>x.onCustomEvent?.({event:m,messages:A,state:y,agent:r,input:e}))),f();case M.RUN_STARTED:{let x=yield Be(n,o,a,(A,y,C)=>A.onRunStartedEvent?.({event:m,messages:y,state:C,agent:r,input:e}));if(p(x),x.stopPropagation!==!0){let A=m;if(A.input?.messages){for(let y of A.input.messages)o.find(C=>C.id===y.id)||o.push(y);p({messages:o})}}return f()}case M.RUN_FINISHED:return p(yield Be(n,o,a,(x,A,y)=>x.onRunFinishedEvent?.({event:m,messages:A,state:y,agent:r,input:e,result:m.result}))),f();case M.RUN_ERROR:return p(yield Be(n,o,a,(x,A,y)=>x.onRunErrorEvent?.({event:m,messages:A,state:y,agent:r,input:e}))),f();case M.STEP_STARTED:return p(yield Be(n,o,a,(x,A,y)=>x.onStepStartedEvent?.({event:m,messages:A,state:y,agent:r,input:e}))),f();case M.STEP_FINISHED:return p(yield Be(n,o,a,(x,A,y)=>x.onStepFinishedEvent?.({event:m,messages:A,state:y,agent:r,input:e}))),f();case M.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case M.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case M.THINKING_START:return f();case M.THINKING_END:return f();case M.THINKING_TEXT_MESSAGE_START:return f();case M.THINKING_TEXT_MESSAGE_CONTENT:return f();case M.THINKING_TEXT_MESSAGE_END:return f();case M.REASONING_START:return p(yield Be(n,o,a,(x,A,y)=>x.onReasoningStartEvent?.({event:m,messages:A,state:y,agent:r,input:e}))),f();case M.REASONING_MESSAGE_START:{let x=yield Be(n,o,a,(A,y,C)=>A.onReasoningMessageStartEvent?.({event:m,messages:y,state:C,agent:r,input:e}));if(p(x),x.stopPropagation!==!0){let{messageId:A}=m;if(!o.find(y=>y.id===A)){let y={id:A,role:"reasoning",content:""};o.push(y),p({messages:o})}}return f()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:x,delta:A}=m,y=o.find(R=>R.id===x);if(!y)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${x}'`),f();let C=yield Be(n,o,a,(R,b,w)=>R.onReasoningMessageContentEvent?.({event:m,messages:b,state:w,agent:r,input:e,reasoningMessageBuffer:typeof y.content=="string"?y.content:""}));return p(C),C.stopPropagation!==!0&&(y.content=`${typeof y.content=="string"?y.content:""}${A}`,p({messages:o})),f()}case M.REASONING_MESSAGE_END:{let{messageId:x}=m,A=o.find(y=>y.id===x);return A?(p(yield Be(n,o,a,(y,C,R)=>y.onReasoningMessageEndEvent?.({event:m,messages:C,state:R,agent:r,input:e,reasoningMessageBuffer:typeof A.content=="string"?A.content:""}))),yield Promise.all(n.map(y=>{y.onNewMessage?.({message:A,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${x}'`),f())}case M.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case M.REASONING_END:return p(yield Be(n,o,a,(x,A,y)=>x.onReasoningEndEvent?.({event:m,messages:A,state:y,agent:r,input:e}))),f();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:x,entityId:A,encryptedValue:y}=m,C=yield Be(n,o,a,(R,b,w)=>R.onReasoningEncryptedValueEvent?.({event:m,messages:b,state:w,agent:r,input:e}));if(p(C),C.stopPropagation!==!0){let R=!1;if(x==="tool-call"){for(let b of o)if(b.role==="assistant"&&b.toolCalls){let w=b.toolCalls.find(P=>P.id===A);if(w){w.encryptedValue=y,R=!0;break}}}else{let b=o.find(w=>w.id===A);b?.role!=="activity"&&b&&(b.encryptedValue=y,R=!0)}R&&(i.messages=o)}return f()}}return m.type,f()});return function(_x145){return _ref57.apply(this,arguments)}}()),Kv(),n.length>0?Jv({}):m=>m)},fx=e=>t=>{let r=new Map,n=new Map,o=!1,a=!1,i=!1,p=new Map,f=!1,m=!1,h=!1,x=()=>{r.clear(),n.clear(),p.clear(),f=!1,m=!1,o=!1,a=!1,h=!0};return t.pipe(rr(A=>{let y=A.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(A)),a)return et(()=>new nt(`Cannot send event type '${y}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&y!==M.RUN_ERROR&&y!==M.RUN_STARTED)return et(()=>new nt(`Cannot send event type '${y}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(i){if(y===M.RUN_STARTED){if(h&&!o)return et(()=>new nt("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));o&&x()}}else if(i=!0,y!==M.RUN_STARTED&&y!==M.RUN_ERROR)return et(()=>new nt("First event must be 'RUN_STARTED'"));switch(y){case M.TEXT_MESSAGE_START:{let C=A.messageId;return r.has(C)?et(()=>new nt(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${C}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(C,!0),ot(A))}case M.TEXT_MESSAGE_CONTENT:{let C=A.messageId;return r.has(C)?ot(A):et(()=>new nt(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${C}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case M.TEXT_MESSAGE_END:{let C=A.messageId;return r.has(C)?(r.delete(C),ot(A)):et(()=>new nt(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${C}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case M.TOOL_CALL_START:{let C=A.toolCallId;return n.has(C)?et(()=>new nt(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${C}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(C,!0),ot(A))}case M.TOOL_CALL_ARGS:{let C=A.toolCallId;return n.has(C)?ot(A):et(()=>new nt(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${C}'. Start a tool call with 'TOOL_CALL_START' first.`))}case M.TOOL_CALL_END:{let C=A.toolCallId;return n.has(C)?(n.delete(C),ot(A)):et(()=>new nt(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${C}'. A 'TOOL_CALL_START' event must be sent first.`))}case M.STEP_STARTED:{let C=A.stepName;return p.has(C)?et(()=>new nt(`Step "${C}" is already active for 'STEP_STARTED'`)):(p.set(C,!0),ot(A))}case M.STEP_FINISHED:{let C=A.stepName;return p.has(C)?(p.delete(C),ot(A)):et(()=>new nt(`Cannot send 'STEP_FINISHED' for step "${C}" that was not started`))}case M.RUN_STARTED:return h=!0,ot(A);case M.RUN_FINISHED:if(p.size>0){let C=Array.from(p.keys()).join(", ");return et(()=>new nt(`Cannot send 'RUN_FINISHED' while steps are still active: ${C}`))}if(r.size>0){let C=Array.from(r.keys()).join(", ");return et(()=>new nt(`Cannot send 'RUN_FINISHED' while text messages are still active: ${C}`))}if(n.size>0){let C=Array.from(n.keys()).join(", ");return et(()=>new nt(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${C}`))}return o=!0,ot(A);case M.RUN_ERROR:return a=!0,ot(A);case M.CUSTOM:return ot(A);case M.THINKING_TEXT_MESSAGE_START:return f?m?et(()=>new nt("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(m=!0,ot(A)):et(()=>new nt("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case M.THINKING_TEXT_MESSAGE_CONTENT:return m?ot(A):et(()=>new nt("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case M.THINKING_TEXT_MESSAGE_END:return m?(m=!1,ot(A)):et(()=>new nt("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case M.THINKING_START:return f?et(()=>new nt("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(f=!0,ot(A));case M.THINKING_END:return f?(f=!1,ot(A)):et(()=>new nt("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return ot(A)}}))},ai=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),VU=(e,t)=>Yv(()=>ri(S(e,t))).pipe(Xv(r=>{if(!r.ok){let a=r.headers.get("content-type")||"";return ri(r.text()).pipe(rr(i=>{let p=i;if(a.includes("application/json"))try{p=JSON.parse(i)}catch{}let f=Error(`HTTP ${r.status}: ${typeof p=="string"?p:JSON.stringify(p)}`);return f.status=r.status,f.payload=p,et(()=>f)}))}let n={type:ai.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new Ze(a=>(a.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:p}=yield o.read();if(i)break;let f={type:ai.DATA,data:p};a.next(f)}a.complete()}catch(i){a.error(i)}})(),()=>{o.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):et(()=>Error("Failed to getReader() from response"))})),jU=e=>{let t=new mn,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:a=>{if(a.type!==ai.HEADERS&&a.type===ai.DATA&&a.data){let i=r.decode(a.data,{stream:!0});n+=i;let p=n.split(/\n\n/);n=p.pop()||"";for(let f of p)o(f)}},error:a=>t.error(a),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(a){let i=a.split(`
|
|
39
|
-
`),
|
|
40
|
-
`),
|
|
41
|
-
`)},eQ=(e,t,r)=>n=>{let o={},a=!0,i=!0,p="",f=null,m=null,h=[],x={},A=y=>{typeof y=="object"&&y&&("messages"in y&&delete y.messages,o=y)};return n.pipe(rr(y=>{switch(y.type){case M.TEXT_MESSAGE_START:{let C=y;return[{type:Ye.enum.TextMessageStart,messageId:C.messageId,role:C.role}]}case M.TEXT_MESSAGE_CONTENT:{let C=y;return[{type:Ye.enum.TextMessageContent,messageId:C.messageId,content:C.delta}]}case M.TEXT_MESSAGE_END:{let C=y;return[{type:Ye.enum.TextMessageEnd,messageId:C.messageId}]}case M.TOOL_CALL_START:{let C=y;return h.push({id:C.toolCallId,type:"function",function:{name:C.toolCallName,arguments:""}}),i=!0,x[C.toolCallId]=C.toolCallName,[{type:Ye.enum.ActionExecutionStart,actionExecutionId:C.toolCallId,actionName:C.toolCallName,parentMessageId:C.parentMessageId}]}case M.TOOL_CALL_ARGS:{let C=y,R=h.find(w=>w.id===C.toolCallId);if(!R)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${C.toolCallId}'`),[];R.function.arguments+=C.delta;let b=!1;if(m){let w=m.find(P=>P.tool==R.function.name);if(w)try{let P=JSON.parse(sm(R.function.arguments));w.tool_argument&&w.tool_argument in P?(A({...o,[w.state_key]:P[w.tool_argument]}),b=!0):w.tool_argument||(A({...o,[w.state_key]:P}),b=!0)}catch{}}return[{type:Ye.enum.ActionExecutionArgs,actionExecutionId:C.toolCallId,args:C.delta},...(b?[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]:[])]}case M.TOOL_CALL_END:{let C=y;return[{type:Ye.enum.ActionExecutionEnd,actionExecutionId:C.toolCallId}]}case M.TOOL_CALL_RESULT:{let C=y;return[{type:Ye.enum.ActionExecutionResult,actionExecutionId:C.toolCallId,result:C.content,actionName:x[C.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let C=y;switch(C.name){case"Exit":a=!1;break;case"PredictState":m=C.value;break}return[{type:Ye.enum.MetaEvent,name:C.name,value:C.value}]}case M.STATE_SNAPSHOT:return A(y.snapshot),[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}];case M.STATE_DELTA:{let C=y,R=Bo(o,C.delta,!0,!1);return R?(A(R.newDocument),[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]):[]}case M.MESSAGES_SNAPSHOT:return f=y.messages,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case M.RUN_STARTED:return[];case M.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:tQ(f)}:{})}),active:!1}];case M.RUN_ERROR:{let C=y;return[{type:Ye.enum.RunError,message:C.message,code:C.code}]}case M.STEP_STARTED:return p=y.stepName,h=[],m=null,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!0}];case M.STEP_FINISHED:return h=[],m=null,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function tQ(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=ZU(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let a={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(a)}}else if(r.role==="tool"){let n="unknown";for(let a of e)if(a.role==="assistant"&&a.toolCalls?.length){for(let i of a.toolCalls)if(i.id===r.toolCallId){n=i.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var Nm=e=>t=>{let r,n,o,a,i=()=>{if(!r||a!=="text")throw Error("No text message to close");let h={type:M.TEXT_MESSAGE_END,messageId:r.messageId};return a=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(h)),h},p=()=>{if(!n||a!=="tool")throw Error("No tool call to close");let h={type:M.TOOL_CALL_END,toolCallId:n.toolCallId};return a=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(h)),h},f=()=>{if(!o||a!=="reasoning")throw Error("No reasoning message to close");let h={type:M.REASONING_MESSAGE_END,messageId:o.messageId};return a=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(h)),h},m=()=>a==="text"?[i()]:a==="tool"?[p()]:a==="reasoning"?[f()]:[];return t.pipe(rr(h=>{switch(h.type){case M.TEXT_MESSAGE_START:case M.TEXT_MESSAGE_CONTENT:case M.TEXT_MESSAGE_END:case M.TOOL_CALL_START:case M.TOOL_CALL_ARGS:case M.TOOL_CALL_END:case M.TOOL_CALL_RESULT:case M.STATE_SNAPSHOT:case M.STATE_DELTA:case M.MESSAGES_SNAPSHOT:case M.CUSTOM:case M.RUN_STARTED:case M.RUN_FINISHED:case M.RUN_ERROR:case M.STEP_STARTED:case M.STEP_FINISHED:case M.THINKING_START:case M.THINKING_END:case M.THINKING_TEXT_MESSAGE_START:case M.THINKING_TEXT_MESSAGE_CONTENT:case M.THINKING_TEXT_MESSAGE_END:case M.REASONING_START:case M.REASONING_MESSAGE_START:case M.REASONING_MESSAGE_CONTENT:case M.REASONING_MESSAGE_END:case M.REASONING_END:return[...m(),h];case M.RAW:case M.ACTIVITY_SNAPSHOT:case M.ACTIVITY_DELTA:case M.REASONING_ENCRYPTED_VALUE:return[h];case M.TEXT_MESSAGE_CHUNK:let x=h,A=[];if((a!=="text"||x.messageId!==void 0&&x.messageId!==r?.messageId)&&A.push(...m()),a!=="text"){if(x.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:x.messageId},a="text";let w={type:M.TEXT_MESSAGE_START,messageId:x.messageId,role:x.role||"assistant"};A.push(w),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(w))}if(x.delta!==void 0){let w={type:M.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:x.delta};A.push(w),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(w))}return A;case M.TOOL_CALL_CHUNK:let y=h,C=[];if((a!=="tool"||y.toolCallId!==void 0&&y.toolCallId!==n?.toolCallId)&&C.push(...m()),a!=="tool"){if(y.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(y.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");n={toolCallId:y.toolCallId,toolCallName:y.toolCallName,parentMessageId:y.parentMessageId},a="tool";let w={type:M.TOOL_CALL_START,toolCallId:y.toolCallId,toolCallName:y.toolCallName,parentMessageId:y.parentMessageId};C.push(w),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(w))}if(y.delta!==void 0){let w={type:M.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:y.delta};C.push(w),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(w))}return C;case M.REASONING_MESSAGE_CHUNK:let R=h,b=[];if((a!=="reasoning"||R.messageId&&R.messageId!==o?.messageId)&&b.push(...m()),a!=="reasoning"){if(R.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:R.messageId},a="reasoning";let w={type:M.REASONING_MESSAGE_START,messageId:R.messageId};b.push(w),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(w))}if(R.delta!==void 0){let w={type:M.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:R.delta};b.push(w),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(w))}return b}return h.type,[]}),oi(()=>{m()}))},mx=class{runNext(e,t){return t.run(e).pipe(Nm(!1))}runNextWithState(e,t){let r=$e(e.messages||[]),n=$e(e.state||{}),o=new Gf;return GE(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(am(/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(a){return o.next(a),yield new Promise(i=>setTimeout(i,0)),{event:a,messages:$e(r),state:$e(n)}});return function(_x146){return _ref59.apply(this,arguments)}}()))}},rQ=class extends mx{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function nQ(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var oQ=class extends mx{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(nQ)};return this.runNext(o,t)}},jE="THINKING_START",LE="THINKING_END",UE="THINKING_TEXT_MESSAGE_START",QE="THINKING_TEXT_MESSAGE_CONTENT",BE="THINKING_TEXT_MESSAGE_END",aQ=class extends mx{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(ni(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case jE:{this.currentReasoningId=Ol();let{title:t,...r}=e;return this.warnAboutTransformation(jE,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case UE:return this.currentMessageId=Ol(),this.warnAboutTransformation(UE,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case QE:{let{delta:t,...r}=e;return this.warnAboutTransformation(QE,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Ol(),delta:t}}case BE:{let t=this.currentMessageId??Ol();return this.warnAboutTransformation(BE,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case LE:{let t=this.currentReasoningId??Ol();return this.warnAboutTransformation(LE,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}},iQ="0.0.45",sQ=class{get maxVersion(){return iQ}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:a}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Vo(),this.messages=$e(n??[]),this.state=$e(o??{}),this.debug=a??!1,Om(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new oQ),Om(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new aQ)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new rQ(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this28=this;return _asyncToGenerator(function*(){try{_this28.isRunning=!0,_this28.agentId=_this28.agentId??Vo();let r=_this28.prepareRunAgentInput(e),n,o=new Set(_this28.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this28.subscribers,t??{}];yield _this28.onInitialize(r,a),_this28.activeRunDetach$=new mn;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield om(Bf(()=>_this28.middlewares.length===0?_this28.run(r):_this28.middlewares.reduceRight((f,m)=>({run:h=>m.run(h,f)}),_this28).run(r),Nm(_this28.debug),fx(_this28.debug),f=>f.pipe(im(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),Tl(f=>(_this28.isRunning=!1,_this28.onError(r,f,a))),oi(()=>{_this28.isRunning=!1,_this28.onFinalize(r,a),i?.(),i=void 0,_this28.activeRunCompletionPromise=void 0,_this28.activeRunDetach$=void 0}))(ot(null)));let p=$e(_this28.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this28.isRunning=!1}})()}connect(e){throw new qv}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??Vo();let r=_this29.prepareRunAgentInput(e),n,o=new Set(_this29.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this29.subscribers,t??{}];yield _this29.onInitialize(r,a),_this29.activeRunDetach$=new mn;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield om(Bf(()=>_this29.connect(r),Nm(_this29.debug),fx(_this29.debug),f=>f.pipe(im(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),Tl(f=>(_this29.isRunning=!1,f instanceof qv?$f:_this29.onError(r,f,a))),oi(()=>{_this29.isRunning=!1,_this29.onFinalize(r,a),i?.(),i=void 0,_this29.activeRunCompletionPromise=void 0,_this29.activeRunDetach$=void 0}))(ot(null)));let p=$e(_this29.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this29.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this30=this;return _asyncToGenerator(function*(){if(!_this30.activeRunDetach$)return;let e=_this30.activeRunCompletionPromise??Promise.resolve();_this30.activeRunDetach$.next(),_this30.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return GE(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(Zv(n=>{n.messages&&(this.messages=n.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=$e(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Vo(),tools:$e(e?.tools??[]),context:$e(e?.context??[]),forwardedProps:$e(e?.forwardedProps??{}),state:$e(this.state),messages:t}}onInitialize(e,t){var _this31=this;return _asyncToGenerator(function*(){let r=yield Be(t,_this31.messages,_this31.state,(n,o,a)=>n.onRunInitialized?.({messages:o,state:a,agent:_this31,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this31.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this31.messages,state:_this31.state,agent:_this31,input:e})})),r.state&&(_this31.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this31.state,messages:_this31.messages,agent:_this31,input:e})})))})()}onError(e,t,r){return ri(Be(r,this.messages,this.state,(n,o,a)=>n.onRunFailed?.({error:t,messages:o,state:a,agent:this,input:e}))).pipe(ni(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this32=this;return _asyncToGenerator(function*(){let r=yield Be(t,_this32.messages,_this32.state,(n,o,a)=>n.onRunFinalized?.({messages:o,state:a,agent:_this32,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this32.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this32.messages,state:_this32.state,agent:_this32,input:e})})),r.state!==void 0&&(_this32.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this32.state,messages:_this32.messages,agent:_this32,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=$e(this.messages),e.state=$e(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this33=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this33.subscribers)yield t.onNewMessage?.({message:e,messages:_this33.messages,state:_this33.state,agent:_this33});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this33.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this33.messages,state:_this33.state,agent:_this33});for(let t of _this33.subscribers)yield t.onMessagesChanged?.({messages:_this33.messages,state:_this33.state,agent:_this33})})()}addMessages(e){var _this34=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this34.subscribers)yield r.onNewMessage?.({message:t,messages:_this34.messages,state:_this34.state,agent:_this34});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this34.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this34.messages,state:_this34.state,agent:_this34})}for(let t of _this34.subscribers)yield t.onMessagesChanged?.({messages:_this34.messages,state:_this34.state,agent:_this34})})()}setMessages(e){var _this35=this;this.messages=$e(e),_asyncToGenerator(function*(){for(let t of _this35.subscribers)yield t.onMessagesChanged?.({messages:_this35.messages,state:_this35.state,agent:_this35})})()}setState(e){var _this36=this;this.state=$e(e),_asyncToGenerator(function*(){for(let t of _this36.subscribers)yield t.onStateChanged?.({messages:_this36.messages,state:_this36.state,agent:_this36})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Vo();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r)}),this).run(t)).pipe(Nm(this.debug),fx(this.debug),eQ(this.threadId,t.runId,this.agentId),r=>r.pipe(ni(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},_m=class extends sQ{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=$e(e.headers??{})}run(e){return UU(VU(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=$e(this.headers??{});let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var Dm=(e,t,r)=>{let n=Pt(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let a=`/api/preview/organizations/${t}/agents`;return`${n}${a}/${o}`};var gx=class extends _m{requestInit(t){let{params:r,accessToken:n,recordDebugSession:o}=t.forwardedProps||{},a={...r,...(o&&{recordDebugSession:!0})};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify(a),signal:this.abortController.signal}}},$E=(e,t,r)=>new gx({url:`${Dm(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var cQ=new U({required:!0}),HE=new U({required:!0,constrainTo:nf}),zE=e=>({...e,name:of(e.name)}),qm=I("followUpAnswers/setIsEnabled",e=>O(e,new le({required:!0}))),Mm=I("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,W)),Vm=I("followUpAnswers/setFollowUpAnswersConversationToken",e=>O(e,W)),jm=I("followUpAnswers/clearFollowUpAnswersConversationToken"),Lm=I("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:W})),Nl=I("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,W)),Um=I("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:af,answerId:W})),Qm=I("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new le({required:!0}),answerId:W})),Bm=I("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new le({required:!0}),answerId:W})),Gm=I("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:cQ,answerId:W})),$m=I("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new ie({required:!0,each:new X({values:bv})}),answerId:W})),Hm=I("followUpAnswers/followUpCompleted",e=>O(e,{answerId:W,cannotAnswer:new le({required:!1})})),zm=I("followUpAnswers/followUpFailed",e=>O(e,{message:new U,code:new re({min:0}),answerId:W})),Wm=I("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new U})),Km=I("followUpAnswers/likeFollowUp",e=>O(e,{answerId:W})),Ym=I("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:W})),WE=I("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:W})),Jm=I("followUpAnswers/resetFollowUpAnswers"),Xm=I("followUpAnswers/stepStarted",e=>O(zE(e),{answerId:W,name:HE,startedAt:new re({min:0,required:!0})})),Zm=I("followUpAnswers/stepFinished",e=>O(zE(e),{answerId:W,name:HE,finishedAt:new re({min:0,required:!0})}));d();c();l();u();var uQ={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004,"KNOWLEDGE:SSE_TURN_LIMIT_REACHED":1005};function eg(e){return e?uQ[e]??1004:1004}function lQ(e){let t=r=>e.code===r;return Object.defineProperties(e,{isMaxDurationExceededError:{value:()=>t(1e3),enumerable:!1},isFollowupNotSupportedError:{value:()=>t(1001),enumerable:!1},isConversationNotFoundError:{value:()=>t(1002),enumerable:!1},isSseModelNotAvailableError:{value:()=>t(1003),enumerable:!1},isSseInternalError:{value:()=>t(1004),enumerable:!1},isSseTurnLimitReachedError:{value:()=>t(1005),enumerable:!1}}),e}function ii(e){if(e)return lQ({...e})}var KE=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Ms(n.runId)),e(cn(!1)),e(Pa(!0)),e(Mm(n.threadId)),e(jm())},onStepStartedEvent:({event:n})=>{e(yf({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n})=>{e(Sf({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(ka({textDelta:n.delta}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(_a(a.contentFormat)),typeof a?.followUpEnabled=="boolean"&&e(qm(a.followUpEnabled)),a?.conversationToken&&e(Vm(a.conversationToken));return}case"citations":{e(Oa({citations:a.citations}));return}}},onRunErrorEvent:({event:n})=>{let o=eg(n.code);e(Na({message:n.message,code:o}))},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(vl(o)),e(Da(!o)),e(Pa(!1)),e(Jn(o,t,a,n.threadId)),e(Mo())}}};var tg=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,o,a){t();let i=lp(n),p=cp(n),f=up(n),m=sp(n),h=nw(n),x=$E(i,p,f);e=x;let A=KE(o),y=YR(n,a());try{o(cn(!0)),yield x.runAgent({forwardedProps:{params:y,accessToken:m,recordDebugSession:h}},A)}catch(C){o(cn(!1)),o(Na({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",C)}});return function run(_x147,_x148,_x149){return _ref64.apply(this,arguments)}}(),abortRun:t}};var YE=e=>{let t=ab({extra:e}),r=tg();return t.startListening({actionCreator:z.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,o){let a=o.getState();if(!PS(a))return;r.abortRun(),o.dispatch(dr()),o.dispatch(Jm());let i=Ta(a)?.q;!i||i.trim()===""||r.run(a,o.dispatch,e.getNavigatorContext)});return function effect(_x150,_x151){return _ref65.apply(this,arguments)}}()}),t};d();c();l();u();var JE=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},XE=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var hx=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:a}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:a}};d();c();l();u();function ZE(e,t){let r={...e},n,o=a=>(i,p)=>{let f=a(i,p);return n?n(f,p):f};return{get combinedReducer(){let a=qA(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(Mi({...a,...r}))},containsAll(a){return Object.keys(a).every(p=>p in r)},add(a){Object.keys(a).filter(i=>!(i in r)).forEach(i=>{r[i]=a[i]})},addCrossReducer(a){n=a}}}d();c();l();u();d();c();l();u();function yx(e){if(!e||!dQ(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function eI(e,t=60){if(!e)return!1;let r=yx(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function dQ(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function rI(e,t){let r=0,n=null,o=dd(()=>{r=0},500),a=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(f,m=!1){let h=!n;h&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(A){if(!m)throw A;return null}})().finally(()=>{n=null}));let x=yield n;return h&&x&&f.dispatch(tn({accessToken:x})),x});return function a(_x152){return _ref66.apply(this,arguments)}}(),i=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(f){let m=f.getState(),h=fQ(m);if(!(!h||!eI(h))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield a(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(x){e.warn(x,"Access token renewal failed. A retry will occur if necessary.")}}});return function i(_x153){return _ref68.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(f,m,h){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),tI(f,m.error),m;!n&&(r++,o());try{yield a(f,!0)}catch(A){e.debug(A,"Token renewal failed in reactive path (piggybacked on a proactive renewal). The action will be re-dispatched.")}f.dispatch(h)});return function p(_x154,_x155,_x156){return _ref69.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref70=_asyncToGenerator(function*(h){let x=typeof h=="function",A=typeof t=="function";if(!x)return m(h);A&&(yield i(f));let y=yield m(h);return pQ(y)?A?yield p(f,y,h):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),tI(f,y.error),y):y});return function(_x157){return _ref70.apply(this,arguments)}}())}function pQ(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Di().name}function tI(e,t){e.dispatch(Is({status:401,statusCode:401,message:t.message,type:t.name}))}function fQ(e){return e.configuration.accessToken}d();c();l();u();function nI({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return $C({reducer:e,preloadedState:t,devTools:{stateSanitizer:a=>a.history?{...a,history:"<<OMIT>>"}:a,name:o,shouldHotReload:!1},middleware:a=>a({thunk:{extraArgument:n}}).prepend(...r).concat(XE(n.logger))})}function mQ(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},a={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return a.analyticsMode!=="next"&&DA()?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):a}function oI(e,t){let r={...e.reducers,configuration:pe,version:nF},n=gQ({...e,reducers:r},t,pe),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(tn({accessToken:o,environment:a,organizationId:i}));let p=mQ(e.configuration,n.logger);return p&&n.dispatch(wo(p)),n}function gQ(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=ZE({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return Wu(m.state,o)},get navigatorContext(){return hx(this.relay,o)}},f=hQ(e,p,a),m={addReducers(h){a.containsAll(h)||(a.add(h),f.replaceReducer(a.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(is())},disableAnalytics(){f.dispatch(as())},get state(){return f.getState()},get relay(){return Wu(this.state,o)},get navigatorContext(){return hx(this.relay,o)},logger:i,store:f};return m}function hQ(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=yQ(e,t.logger,()=>t.navigatorContext);return nI({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function yQ(e,t,r){let{renewAccessToken:n}=e.configuration,o=rI(t,n),a=YE({getNavigatorContext:r});return[pF,o,JE(t),aF].concat(qa.middleware,a.middleware,e.middlewares||[])}var SQ=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
|
|
39
|
+
Error: ${w}`)}}return g()}case M.MESSAGES_SNAPSHOT:{let h=yield Ge(n,i,p,(A,b,w)=>A.onMessagesSnapshotEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messages:A}=v,b=new Map(A.map(E=>[E.id,E])),w=E=>E==="activity"||E==="reasoning";i=i.filter(E=>w(E.role)||b.has(E.id)).map(E=>w(E.role)?E:b.get(E.id));let R=new Set(i.map(E=>E.id));for(let E of A)R.has(E.id)||i.push(E);m({messages:i})}return g()}case M.ACTIVITY_SNAPSHOT:{let h=v,A=i.findIndex(I=>I.id===h.messageId),b=A>=0?i[A]:void 0,w=b?.role==="activity"?b:void 0,R=h.replace??!0,E=yield Ge(n,i,p,(I,k,T)=>I.onActivitySnapshotEvent?.({event:h,messages:k,state:T,agent:r,input:e,activityMessage:w,existingMessage:b}));if(m(E),E.stopPropagation!==!0){let I={id:h.messageId,role:"activity",activityType:h.activityType,content:Le(h.content)},k;A===-1?(i.push(I),k=I):w?R&&(i[A]={...w,activityType:h.activityType,content:Le(h.content)}):R&&(i[A]=I,k=I),m({messages:i}),k&&(yield Promise.all(n.map(T=>T.onNewMessage?.({message:k,messages:i,state:p,agent:r,input:e}))))}return g()}case M.ACTIVITY_DELTA:{let h=v,A=i.findIndex(E=>E.id===h.messageId);if(A===-1)return g();let b=i[A];if(b.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${h.messageId}' is not an activity message`),g();let w=b,R=yield Ge(n,i,p,(E,I,k)=>E.onActivityDeltaEvent?.({event:h,messages:I,state:k,agent:r,input:e,activityMessage:w}));if(m(R),R.stopPropagation!==!0)try{let E=Le(w.content??{}),I=Go(E,h.patch??[],!0,!1).newDocument;i[A]={...w,content:Le(I),activityType:h.activityType},m({messages:i})}catch(E){let I=E instanceof Error?E.message:String(E);console.warn(`Failed to apply activity patch for '${h.messageId}': ${I}`)}return g()}case M.RAW:return m(yield Ge(n,i,p,(h,A,b)=>h.onRawEvent?.({event:v,messages:A,state:b,agent:r,input:e}))),g();case M.CUSTOM:return m(yield Ge(n,i,p,(h,A,b)=>h.onCustomEvent?.({event:v,messages:A,state:b,agent:r,input:e}))),g();case M.RUN_STARTED:{let h=yield Ge(n,i,p,(A,b,w)=>A.onRunStartedEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let A=v;if(A.input?.messages){for(let b of A.input.messages)i.find(w=>w.id===b.id)||i.push(b);m({messages:i})}}return g()}case M.RUN_FINISHED:return m(yield Ge(n,i,p,(h,A,b)=>h.onRunFinishedEvent?.({event:v,messages:A,state:b,agent:r,input:e,result:v.result}))),g();case M.RUN_ERROR:return m(yield Ge(n,i,p,(h,A,b)=>h.onRunErrorEvent?.({event:v,messages:A,state:b,agent:r,input:e}))),g();case M.STEP_STARTED:return m(yield Ge(n,i,p,(h,A,b)=>h.onStepStartedEvent?.({event:v,messages:A,state:b,agent:r,input:e}))),g();case M.STEP_FINISHED:return m(yield Ge(n,i,p,(h,A,b)=>h.onStepFinishedEvent?.({event:v,messages:A,state:b,agent:r,input:e}))),g();case M.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case M.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case M.THINKING_START:return g();case M.THINKING_END:return g();case M.THINKING_TEXT_MESSAGE_START:return g();case M.THINKING_TEXT_MESSAGE_CONTENT:return g();case M.THINKING_TEXT_MESSAGE_END:return g();case M.REASONING_START:return m(yield Ge(n,i,p,(h,A,b)=>h.onReasoningStartEvent?.({event:v,messages:A,state:b,agent:r,input:e}))),g();case M.REASONING_MESSAGE_START:{let h=yield Ge(n,i,p,(A,b,w)=>A.onReasoningMessageStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:A}=v;if(!i.find(b=>b.id===A)){let b={id:A,role:"reasoning",content:""};i.push(b),m({messages:i})}}return g()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:h,delta:A}=v,b=i.find(R=>R.id===h);if(!b)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${h}'`),g();let w=yield Ge(n,i,p,(R,E,I)=>R.onReasoningMessageContentEvent?.({event:v,messages:E,state:I,agent:r,input:e,reasoningMessageBuffer:typeof b.content=="string"?b.content:""}));return m(w),w.stopPropagation!==!0&&(b.content=`${typeof b.content=="string"?b.content:""}${A}`,m({messages:i})),g()}case M.REASONING_MESSAGE_END:{let{messageId:h}=v,A=i.find(b=>b.id===h);return A?(m(yield Ge(n,i,p,(b,w,R)=>b.onReasoningMessageEndEvent?.({event:v,messages:w,state:R,agent:r,input:e,reasoningMessageBuffer:typeof A.content=="string"?A.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:A,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${h}'`),g())}case M.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case M.REASONING_END:return m(yield Ge(n,i,p,(h,A,b)=>h.onReasoningEndEvent?.({event:v,messages:A,state:b,agent:r,input:e}))),g();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:h,entityId:A,encryptedValue:b}=v,w=yield Ge(n,i,p,(R,E,I)=>R.onReasoningEncryptedValueEvent?.({event:v,messages:E,state:I,agent:r,input:e}));if(m(w),w.stopPropagation!==!0){let R=!1;if(h==="tool-call"){for(let E of i)if(E.role==="assistant"&&E.toolCalls){let I=E.toolCalls.find(k=>k.id===A);if(I){I.encryptedValue=b,R=!0;break}}}else{let E=i.find(I=>I.id===A);E?.role!=="activity"&&E&&(E.encryptedValue=b,R=!0)}R&&(f.messages=i)}return g()}}return v.type,g()});return function(_x144){return _ref57.apply(this,arguments)}}()),ux(),n.length>0?lx({}):v=>v)},Ix=e=>t=>{let r=Nl(e),n=new Map,o=new Map,a=!1,i=!1,p=!1,f=new Map,m=!1,g=!1,v=!1,C=()=>{n.clear(),o.clear(),f.clear(),m=!1,g=!1,a=!1,i=!1,v=!0};return t.pipe(rr(h=>{let A=h.type;if(r?.event("VERIFY","Event:",h,{type:h.type}),i)return et(()=>new nt(`Cannot send event type '${A}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&A!==M.RUN_ERROR&&A!==M.RUN_STARTED)return et(()=>new nt(`Cannot send event type '${A}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(p){if(A===M.RUN_STARTED){if(v&&!a)return et(()=>new nt("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));a&&C()}}else if(p=!0,A!==M.RUN_STARTED&&A!==M.RUN_ERROR)return et(()=>new nt("First event must be 'RUN_STARTED'"));switch(A){case M.TEXT_MESSAGE_START:{let b=h.messageId;return n.has(b)?et(()=>new nt(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${b}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(n.set(b,!0),ot(h))}case M.TEXT_MESSAGE_CONTENT:{let b=h.messageId;return n.has(b)?ot(h):et(()=>new nt(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${b}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case M.TEXT_MESSAGE_END:{let b=h.messageId;return n.has(b)?(n.delete(b),ot(h)):et(()=>new nt(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${b}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case M.TOOL_CALL_START:{let b=h.toolCallId;return o.has(b)?et(()=>new nt(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${b}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(o.set(b,!0),ot(h))}case M.TOOL_CALL_ARGS:{let b=h.toolCallId;return o.has(b)?ot(h):et(()=>new nt(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${b}'. Start a tool call with 'TOOL_CALL_START' first.`))}case M.TOOL_CALL_END:{let b=h.toolCallId;return o.has(b)?(o.delete(b),ot(h)):et(()=>new nt(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${b}'. A 'TOOL_CALL_START' event must be sent first.`))}case M.STEP_STARTED:{let b=h.stepName;return f.has(b)?et(()=>new nt(`Step "${b}" is already active for 'STEP_STARTED'`)):(f.set(b,!0),ot(h))}case M.STEP_FINISHED:{let b=h.stepName;return f.has(b)?(f.delete(b),ot(h)):et(()=>new nt(`Cannot send 'STEP_FINISHED' for step "${b}" that was not started`))}case M.RUN_STARTED:return v=!0,ot(h);case M.RUN_FINISHED:if(f.size>0){let b=Array.from(f.keys()).join(", ");return et(()=>new nt(`Cannot send 'RUN_FINISHED' while steps are still active: ${b}`))}if(n.size>0){let b=Array.from(n.keys()).join(", ");return et(()=>new nt(`Cannot send 'RUN_FINISHED' while text messages are still active: ${b}`))}if(o.size>0){let b=Array.from(o.keys()).join(", ");return et(()=>new nt(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${b}`))}return a=!0,ot(h);case M.RUN_ERROR:return i=!0,ot(h);case M.CUSTOM:return ot(h);case M.THINKING_TEXT_MESSAGE_START:return m?g?et(()=>new nt("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(g=!0,ot(h)):et(()=>new nt("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case M.THINKING_TEXT_MESSAGE_CONTENT:return g?ot(h):et(()=>new nt("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case M.THINKING_TEXT_MESSAGE_END:return g?(g=!1,ot(h)):et(()=>new nt("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case M.THINKING_START:return m?et(()=>new nt("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(m=!0,ot(h));case M.THINKING_END:return m?(m=!1,ot(h)):et(()=>new nt("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return ot(h)}}))},ii=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),_Q=(e,t)=>cm(()=>ni(S(e,t))).pipe(dx(r=>{if(!r.ok){let a=r.headers.get("content-type")||"";return ni(r.text()).pipe(rr(i=>{let p=i;if(a.includes("application/json"))try{p=JSON.parse(i)}catch{}let f=Error(`HTTP ${r.status}: ${typeof p=="string"?p:JSON.stringify(p)}`);return f.status=r.status,f.payload=p,et(()=>f)}))}let n={type:ii.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new Ze(a=>(a.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:p}=yield o.read();if(i)break;let f={type:ii.DATA,data:p};a.next(f)}a.complete()}catch(i){a.error(i)}})(),()=>{o.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):et(()=>Error("Failed to getReader() from response"))})),NQ=(e,t)=>{let r=Nl(t),n=new gn,o=new TextDecoder("utf-8",{fatal:!1}),a="";e.subscribe({next:p=>{if(p.type!==ii.HEADERS&&p.type===ii.DATA&&p.data){let f=o.decode(p.data,{stream:!0});a+=f;let m=a.split(/\n\n/);a=m.pop()||"";for(let g of m)i(g)}},error:p=>n.error(p),complete:()=>{a&&(a+=o.decode(),i(a)),n.complete()}});function i(p){let f=p.split(`
|
|
40
|
+
`),m=[];for(let g of f)g.startsWith("data:")&&m.push(g.slice(5).replace(/^ /,""));if(m.length>0)try{let g=m.join(`
|
|
41
|
+
`),v=JSON.parse(g);r?.event("SSE","Event received:",v,{type:v.type}),n.next(v)}catch(g){n.error(g)}}return n.asObservable()},DQ=e=>{let t=new gn,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==ii.HEADERS&&o.type===ii.DATA&&o.data){let a=new Uint8Array(r.length+o.data.length);a.set(r,0),a.set(o.data,r.length),r=a,n()}},error:o=>t.error(o),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let o=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<o)break;try{let a=r.slice(4,o),i=lI(a);t.next(i),r=r.slice(o)}catch(a){let i=a instanceof Error?a.message:String(a);t.error(Error(`Failed to decode protocol buffer message: ${i}`));return}}}return t.asObservable()},qQ=(e,t)=>{let r=Nl(t),n=new gn,o=new zf,a=!1;return e.subscribe({next:i=>{if(o.next(i),i.type===ii.HEADERS&&!a){a=!0;let p=i.headers.get("content-type");r?.lifecycle("HTTP","Stream format detected:",{contentType:p,parser:p===wx?"protobuf":"sse"}),p===wx?DQ(o).subscribe({next:f=>n.next(f),error:f=>n.error(f),complete:()=>n.complete()}):NQ(o,r).subscribe({next:f=>{try{let m=_f.parse(f);r?.event("HTTP","Event validated:",m,{type:m.type,valid:!0}),n.next(m)}catch(m){r?.event("HTTP","Event invalid:",{json:f,error:String(m)}),n.error(m)}},error:f=>{if(f?.name==="AbortError"){n.next({type:M.RUN_ERROR,message:f.message||"Request aborted",code:"abort",rawEvent:f}),n.complete();return}return n.error(f)},complete:()=>n.complete()})}else a||n.error(Error("No headers event received before data events"))},error:i=>{o.error(i),n.error(i)},complete:()=>{o.complete()}}),n.asObservable()},Ye=F.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),MQ=F.enum(["LangGraphInterruptEvent","PredictState","Exit"]),VQ=F.object({type:F.literal(Ye.enum.TextMessageStart),messageId:F.string(),parentMessageId:F.string().optional(),role:F.string().optional()}),jQ=F.object({type:F.literal(Ye.enum.TextMessageContent),messageId:F.string(),content:F.string()}),LQ=F.object({type:F.literal(Ye.enum.TextMessageEnd),messageId:F.string()}),UQ=F.object({type:F.literal(Ye.enum.ActionExecutionStart),actionExecutionId:F.string(),actionName:F.string(),parentMessageId:F.string().optional()}),QQ=F.object({type:F.literal(Ye.enum.ActionExecutionArgs),actionExecutionId:F.string(),args:F.string()}),BQ=F.object({type:F.literal(Ye.enum.ActionExecutionEnd),actionExecutionId:F.string()}),GQ=F.object({type:F.literal(Ye.enum.ActionExecutionResult),actionName:F.string(),actionExecutionId:F.string(),result:F.string()}),$Q=F.object({type:F.literal(Ye.enum.AgentStateMessage),threadId:F.string(),agentName:F.string(),nodeName:F.string(),runId:F.string(),active:F.boolean(),role:F.string(),state:F.string(),running:F.boolean()}),HQ=F.object({type:F.literal(Ye.enum.MetaEvent),name:MQ,value:F.any()}),zQ=F.object({type:F.literal(Ye.enum.RunError),message:F.string(),code:F.string().optional()});F.discriminatedUnion("type",[VQ,jQ,LQ,UQ,QQ,BQ,GQ,$Q,HQ,zQ]),F.object({id:F.string(),role:F.string(),content:F.string(),parentMessageId:F.string().optional()}),F.object({id:F.string(),name:F.string(),arguments:F.any(),parentMessageId:F.string().optional()}),F.object({id:F.string(),result:F.any(),actionExecutionId:F.string(),actionName:F.string()});var WQ=e=>{if(typeof e=="string")return e;if(!Array.isArray(e))return;let t=e.filter(r=>r.type==="text").map(r=>r.text).filter(r=>r.length>0);if(t.length!==0)return t.join(`
|
|
42
|
+
`)},KQ=(e,t,r)=>n=>{let o={},a=!0,i=!0,p="",f=null,m=null,g=[],v={},C=h=>{typeof h=="object"&&h&&("messages"in h&&delete h.messages,o=h)};return n.pipe(rr(h=>{switch(h.type){case M.TEXT_MESSAGE_START:{let A=h;return[{type:Ye.enum.TextMessageStart,messageId:A.messageId,role:A.role}]}case M.TEXT_MESSAGE_CONTENT:{let A=h;return[{type:Ye.enum.TextMessageContent,messageId:A.messageId,content:A.delta}]}case M.TEXT_MESSAGE_END:{let A=h;return[{type:Ye.enum.TextMessageEnd,messageId:A.messageId}]}case M.TOOL_CALL_START:{let A=h;return g.push({id:A.toolCallId,type:"function",function:{name:A.toolCallName,arguments:""}}),i=!0,v[A.toolCallId]=A.toolCallName,[{type:Ye.enum.ActionExecutionStart,actionExecutionId:A.toolCallId,actionName:A.toolCallName,parentMessageId:A.parentMessageId}]}case M.TOOL_CALL_ARGS:{let A=h,b=g.find(R=>R.id===A.toolCallId);if(!b)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${A.toolCallId}'`),[];b.function.arguments+=A.delta;let w=!1;if(m){let R=m.find(E=>E.tool==b.function.name);if(R)try{let E=JSON.parse(dm(b.function.arguments));R.tool_argument&&R.tool_argument in E?(C({...o,[R.state_key]:E[R.tool_argument]}),w=!0):R.tool_argument||(C({...o,[R.state_key]:E}),w=!0)}catch{}}return[{type:Ye.enum.ActionExecutionArgs,actionExecutionId:A.toolCallId,args:A.delta},...(w?[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]:[])]}case M.TOOL_CALL_END:{let A=h;return[{type:Ye.enum.ActionExecutionEnd,actionExecutionId:A.toolCallId}]}case M.TOOL_CALL_RESULT:{let A=h;return[{type:Ye.enum.ActionExecutionResult,actionExecutionId:A.toolCallId,result:A.content,actionName:v[A.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let A=h;switch(A.name){case"Exit":a=!1;break;case"PredictState":m=A.value;break}return[{type:Ye.enum.MetaEvent,name:A.name,value:A.value}]}case M.STATE_SNAPSHOT:return C(h.snapshot),[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}];case M.STATE_DELTA:{let A=h,b=Go(o,A.delta,!0,!1);return b?(C(b.newDocument),[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]):[]}case M.MESSAGES_SNAPSHOT:return f=h.messages,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case M.RUN_STARTED:return[];case M.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:YQ(f)}:{})}),active:!1}];case M.RUN_ERROR:{let A=h;return[{type:Ye.enum.RunError,message:A.message,code:A.code}]}case M.STEP_STARTED:return p=h.stepName,g=[],m=null,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!0}];case M.STEP_FINISHED:return g=[],m=null,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function YQ(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=WQ(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let a={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(a)}}else if(r.role==="tool"){let n="unknown";for(let a of e)if(a.role==="assistant"&&a.toolCalls?.length){for(let i of a.toolCalls)if(i.id===r.toolCallId){n=i.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var zm=e=>t=>{let r=Nl(e),n,o,a,i,p=()=>{if(!n||i!=="text")throw Error("No text message to close");let v={type:M.TEXT_MESSAGE_END,messageId:n.messageId};return i=void 0,n=void 0,r?.event("TRANSFORM","TEXT_MESSAGE_END",v,{messageId:v.messageId}),v},f=()=>{if(!o||i!=="tool")throw Error("No tool call to close");let v={type:M.TOOL_CALL_END,toolCallId:o.toolCallId};return i=void 0,o=void 0,r?.event("TRANSFORM","TOOL_CALL_END",v,{toolCallId:v.toolCallId}),v},m=()=>{if(!a||i!=="reasoning")throw Error("No reasoning message to close");let v={type:M.REASONING_MESSAGE_END,messageId:a.messageId};return i=void 0,a=void 0,r?.event("TRANSFORM","REASONING_MESSAGE_END",v,{messageId:v.messageId}),v},g=()=>i==="text"?[p()]:i==="tool"?[f()]:i==="reasoning"?[m()]:[];return t.pipe(rr(v=>{switch(v.type){case M.TEXT_MESSAGE_START:case M.TEXT_MESSAGE_CONTENT:case M.TEXT_MESSAGE_END:case M.TOOL_CALL_START:case M.TOOL_CALL_ARGS:case M.TOOL_CALL_END:case M.TOOL_CALL_RESULT:case M.STATE_SNAPSHOT:case M.STATE_DELTA:case M.MESSAGES_SNAPSHOT:case M.CUSTOM:case M.RUN_STARTED:case M.RUN_FINISHED:case M.RUN_ERROR:case M.STEP_STARTED:case M.STEP_FINISHED:case M.THINKING_START:case M.THINKING_END:case M.THINKING_TEXT_MESSAGE_START:case M.THINKING_TEXT_MESSAGE_CONTENT:case M.THINKING_TEXT_MESSAGE_END:case M.REASONING_START:case M.REASONING_MESSAGE_START:case M.REASONING_MESSAGE_CONTENT:case M.REASONING_MESSAGE_END:case M.REASONING_END:return[...g(),v];case M.RAW:case M.ACTIVITY_SNAPSHOT:case M.ACTIVITY_DELTA:case M.REASONING_ENCRYPTED_VALUE:return[v];case M.TEXT_MESSAGE_CHUNK:let C=v,h=[];if((i!=="text"||C.messageId!==void 0&&C.messageId!==n?.messageId)&&h.push(...g()),i!=="text"){if(C.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");n={messageId:C.messageId,name:C.name},i="text";let E={type:M.TEXT_MESSAGE_START,messageId:C.messageId,role:C.role||"assistant",...(C.name!==void 0&&{name:C.name})};h.push(E),r?.event("TRANSFORM","TEXT_MESSAGE_START",E,{messageId:C.messageId})}if(C.delta!==void 0){let E={type:M.TEXT_MESSAGE_CONTENT,messageId:n.messageId,delta:C.delta};h.push(E),r?.event("TRANSFORM","TEXT_MESSAGE_CONTENT",E,{messageId:n.messageId})}return h;case M.TOOL_CALL_CHUNK:let A=v,b=[];if((i!=="tool"||A.toolCallId!==void 0&&A.toolCallId!==o?.toolCallId)&&b.push(...g()),i!=="tool"){if(A.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(A.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");o={toolCallId:A.toolCallId,toolCallName:A.toolCallName,parentMessageId:A.parentMessageId},i="tool";let E={type:M.TOOL_CALL_START,toolCallId:A.toolCallId,toolCallName:A.toolCallName,parentMessageId:A.parentMessageId};b.push(E),r?.event("TRANSFORM","TOOL_CALL_START",E,{toolCallId:A.toolCallId,toolCallName:A.toolCallName})}if(A.delta!==void 0){let E={type:M.TOOL_CALL_ARGS,toolCallId:o.toolCallId,delta:A.delta};b.push(E),r?.event("TRANSFORM","TOOL_CALL_ARGS",E,{toolCallId:o.toolCallId})}return b;case M.REASONING_MESSAGE_CHUNK:let w=v,R=[];if((i!=="reasoning"||w.messageId&&w.messageId!==a?.messageId)&&R.push(...g()),i!=="reasoning"){if(w.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");a={messageId:w.messageId},i="reasoning";let E={type:M.REASONING_MESSAGE_START,messageId:w.messageId};R.push(E),r?.event("TRANSFORM","REASONING_MESSAGE_START",E,{messageId:w.messageId})}if(w.delta!==void 0){let E={type:M.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:w.delta};R.push(E),r?.event("TRANSFORM","REASONING_MESSAGE_CONTENT",E,{messageId:a.messageId})}return R}return v.type,[]}),ai(()=>{g()}))},kx=class{runNext(e,t){return t.run(e).pipe(zm(!1))}runNextWithState(e,t){let r=Le(e.messages||[]),n=Le(e.state||{}),o=new zf;return SI(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(um(/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(a){return o.next(a),yield new Promise(i=>setTimeout(i,0)),{event:a,messages:Le(r),state:Le(n)}});return function(_x145){return _ref59.apply(this,arguments)}}()))}},XQ=class extends kx{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function JQ(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var ZQ=class extends kx{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(JQ)};return this.runNext(o,t)}},fI="THINKING_START",mI="THINKING_END",gI="THINKING_TEXT_MESSAGE_START",hI="THINKING_TEXT_MESSAGE_CONTENT",yI="THINKING_TEXT_MESSAGE_END",eB=class extends kx{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<"u"&&process.env!==void 0&&process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(oi(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case fI:{this.currentReasoningId=_l();let{title:t,...r}=e;return this.warnAboutTransformation(fI,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case gI:return this.currentMessageId=_l(),this.warnAboutTransformation(gI,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case hI:{let{delta:t,...r}=e;return this.warnAboutTransformation(hI,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??_l(),delta:t}}case yI:{let t=this.currentMessageId??_l();return this.warnAboutTransformation(yI,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case mI:{let t=this.currentReasoningId??_l();return this.warnAboutTransformation(mI,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}},tB="0.0.52",rB=class{get maxVersion(){return tB}get debug(){return this._debug}set debug(e){this._debug=Hm(e),this._debugLogger=Ex(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){typeof e=="boolean"?this._debugLogger=e?Ex(Hm(!0)):void 0:this._debugLogger=e}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??jo(),this.messages=Le(n??[]),this.state=Le(o??{}),this._debug=Hm(a),this._debugLogger=Ex(this._debug),$m(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new ZQ),$m(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new eB)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new XQ(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this28=this;return _asyncToGenerator(function*(){try{_this28.isRunning=!0,_this28.agentId=_this28.agentId??jo();let r=_this28.prepareRunAgentInput(e);_this28.debugLogger?.lifecycle("LIFECYCLE","Run started:",{agentId:_this28.agentId,threadId:_this28.threadId});let n,o=new Set(_this28.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this28.subscribers,t??{}];yield _this28.onInitialize(r,a),_this28.activeRunDetach$=new gn;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield sm(Hf(()=>_this28.middlewares.length===0?_this28.run(r):_this28.middlewares.reduceRight((f,m)=>({run:g=>m.run(g,f),get messages(){return f.messages},get state(){return f.state}}),_this28).run(r),zm(_this28.debugLogger),Ix(_this28.debugLogger),f=>f.pipe(lm(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),Pl(f=>(_this28.debugLogger?.lifecycle("LIFECYCLE","Run errored:",{agentId:_this28.agentId,error:f instanceof Error?f.message:String(f)}),_this28.isRunning=!1,_this28.onError(r,f,a))),ai(()=>{_this28.debugLogger?.lifecycle("LIFECYCLE","Run finished:",{agentId:_this28.agentId,threadId:_this28.threadId}),_this28.isRunning=!1,_this28.onFinalize(r,a),i?.(),i=void 0,_this28.activeRunCompletionPromise=void 0,_this28.activeRunDetach$=void 0}))(ot(null)));let p=Le(_this28.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this28.isRunning=!1}})()}connect(e){throw new Yv}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??jo();let r=_this29.prepareRunAgentInput(e),n,o=new Set(_this29.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this29.subscribers,t??{}];yield _this29.onInitialize(r,a),_this29.activeRunDetach$=new gn;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield sm(Hf(()=>cm(()=>_this29.connect(r)),zm(_this29.debugLogger),Ix(_this29.debugLogger),f=>f.pipe(lm(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),Pl(f=>(_this29.isRunning=!1,f instanceof Yv?Wf:_this29.onError(r,f,a))),ai(()=>{_this29.isRunning=!1,_this29.onFinalize(r,a),i?.(),i=void 0,_this29.activeRunCompletionPromise=void 0,_this29.activeRunDetach$=void 0}))(ot(null)),{defaultValue:void 0});let p=Le(_this29.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this29.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this30=this;return _asyncToGenerator(function*(){if(!_this30.activeRunDetach$)return;let e=_this30.activeRunCompletionPromise??Promise.resolve();_this30.activeRunDetach$.next(),_this30.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return SI(e,t,this,r,this.debugLogger)}processApplyEvents(e,t,r){return t.pipe(px(n=>{n.messages&&(this.messages=n.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=Le(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||jo(),tools:Le(e?.tools??[]),context:Le(e?.context??[]),forwardedProps:Le(e?.forwardedProps??{}),state:Le(this.state),messages:t}}onInitialize(e,t){var _this31=this;return _asyncToGenerator(function*(){let r=yield Ge(t,_this31.messages,_this31.state,(n,o,a)=>n.onRunInitialized?.({messages:o,state:a,agent:_this31,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this31.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this31.messages,state:_this31.state,agent:_this31,input:e})})),r.state&&(_this31.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this31.state,messages:_this31.messages,agent:_this31,input:e})})))})()}onError(e,t,r){return ni(Ge(r,this.messages,this.state,(n,o,a)=>n.onRunFailed?.({error:t,messages:o,state:a,agent:this,input:e}))).pipe(oi(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0){let a=String(t);if(!(t.name==="AbortError"||t.message==="Fetch is aborted"||t.message==="signal is aborted without reason"||t.message==="component unmounted"||a==="component unmounted"))throw console.error("Agent execution failed:",t),t}return{}}))}onFinalize(e,t){var _this32=this;return _asyncToGenerator(function*(){let r=yield Ge(t,_this32.messages,_this32.state,(n,o,a)=>n.onRunFinalized?.({messages:o,state:a,agent:_this32,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this32.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this32.messages,state:_this32.state,agent:_this32,input:e})})),r.state!==void 0&&(_this32.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this32.state,messages:_this32.messages,agent:_this32,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Le(this.messages),e.state=Le(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this33=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this33.subscribers)yield t.onNewMessage?.({message:e,messages:_this33.messages,state:_this33.state,agent:_this33});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this33.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this33.messages,state:_this33.state,agent:_this33});for(let t of _this33.subscribers)yield t.onMessagesChanged?.({messages:_this33.messages,state:_this33.state,agent:_this33})})()}addMessages(e){var _this34=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this34.subscribers)yield r.onNewMessage?.({message:t,messages:_this34.messages,state:_this34.state,agent:_this34});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this34.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this34.messages,state:_this34.state,agent:_this34})}for(let t of _this34.subscribers)yield t.onMessagesChanged?.({messages:_this34.messages,state:_this34.state,agent:_this34})})()}setMessages(e){var _this35=this;this.messages=Le(e),_asyncToGenerator(function*(){for(let t of _this35.subscribers)yield t.onMessagesChanged?.({messages:_this35.messages,state:_this35.state,agent:_this35})})()}setState(e){var _this36=this;this.state=Le(e),_asyncToGenerator(function*(){for(let t of _this36.subscribers)yield t.onStateChanged?.({messages:_this36.messages,state:_this36.state,agent:_this36})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??jo();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r),get messages(){return r.messages},get state(){return r.state}}),this).run(t)).pipe(zm(this.debugLogger),Ix(this.debugLogger),KQ(this.threadId,t.runId,this.agentId),r=>r.pipe(oi(n=>(this.debugLogger?.event("LEGACY","Event:",n,{type:n.type}),n))))}},Wm=class extends rB{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=Le(e.headers??{})}run(e){return qQ(_Q(this.url,this.requestInit(e)),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=Le(this.headers??{});let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var Km=(e,t,r)=>{let n=Pt(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let a=`/api/preview/organizations/${t}/agents`;return`${n}${a}/${o}`};var Ox=class extends Wm{requestInit(t){let{params:r,accessToken:n,recordDebugSession:o}=t.forwardedProps||{},a={...r,...(o&&{recordDebugSession:!0})};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify(a),signal:this.abortController.signal}}},vI=(e,t,r)=>new Ox({url:`${Km(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var nB=new U({required:!0}),xI=new U({required:!0,constrainTo:af}),AI=e=>({...e,name:sf(e.name)}),Ym=P("followUpAnswers/setIsEnabled",e=>O(e,new de({required:!0}))),Xm=P("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,W)),Jm=P("followUpAnswers/setFollowUpAnswersConversationToken",e=>O(e,W)),Zm=P("followUpAnswers/clearFollowUpAnswersConversationToken"),eg=P("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:W})),Dl=P("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,W)),tg=P("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:cf,answerId:W})),rg=P("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new de({required:!0}),answerId:W})),ng=P("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new de({required:!0}),answerId:W})),og=P("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:nB,answerId:W})),ag=P("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new ie({required:!0,each:new J({values:Mv})}),answerId:W})),ig=P("followUpAnswers/followUpCompleted",e=>O(e,{answerId:W,cannotAnswer:new de({required:!1})})),sg=P("followUpAnswers/followUpFailed",e=>O(e,{message:new U,code:new re({min:0}),answerId:W})),cg=P("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new U})),ug=P("followUpAnswers/likeFollowUp",e=>O(e,{answerId:W})),lg=P("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:W})),CI=P("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:W})),dg=P("followUpAnswers/resetFollowUpAnswers"),pg=P("followUpAnswers/stepStarted",e=>O(AI(e),{answerId:W,name:xI,startedAt:new re({min:0,required:!0})})),fg=P("followUpAnswers/stepFinished",e=>O(AI(e),{answerId:W,name:xI,finishedAt:new re({min:0,required:!0})}));d();c();l();u();var oB={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004,"KNOWLEDGE:SSE_TURN_LIMIT_REACHED":1005};function mg(e){return e?oB[e]??1004:1004}function aB(e){let t=r=>e.code===r;return Object.defineProperties(e,{isMaxDurationExceededError:{value:()=>t(1e3),enumerable:!1},isFollowupNotSupportedError:{value:()=>t(1001),enumerable:!1},isConversationNotFoundError:{value:()=>t(1002),enumerable:!1},isSseModelNotAvailableError:{value:()=>t(1003),enumerable:!1},isSseInternalError:{value:()=>t(1004),enumerable:!1},isSseTurnLimitReachedError:{value:()=>t(1005),enumerable:!1}}),e}function si(e){if(e)return aB({...e})}var bI=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Vs(n.runId)),e(un(!1)),e(ka(!0)),e(Xm(n.threadId)),e(Zm())},onStepStartedEvent:({event:n})=>{e(vf({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n})=>{e(xf({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(Oa({textDelta:n.delta}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(Da(a.contentFormat)),typeof a?.followUpEnabled=="boolean"&&e(Ym(a.followUpEnabled)),a?.conversationToken&&e(Jm(a.conversationToken));return}case"citations":{e(_a({citations:a.citations}));return}}},onRunErrorEvent:({event:n})=>{let o=mg(n.code);e(Na({message:n.message,code:o}))},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(xl(o)),e(qa(!o)),e(ka(!1)),e(Jn(o,t,a,n.threadId)),e(Vo())}}};var gg=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,o,a){t();let i=pp(n),p=lp(n),f=dp(n),m=up(n),g=Aw(n),v=vI(i,p,f);e=v;let C=bI(o),h=gF(n,a());try{o(un(!0)),yield v.runAgent({forwardedProps:{params:h,accessToken:m,recordDebugSession:g}},C)}catch(A){o(un(!1)),o(Na({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",A)}});return function run(_x146,_x147,_x148){return _ref64.apply(this,arguments)}}(),abortRun:t}};var wI=e=>{let t=bb({extra:e}),r=gg();return t.startListening({actionCreator:z.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,o){let a=o.getState();if(!GS(a))return;r.abortRun(),o.dispatch(dr()),o.dispatch(dg());let i=Pa(a)?.q;!i||i.trim()===""||r.run(a,o.dispatch,e.getNavigatorContext)});return function effect(_x149,_x150){return _ref65.apply(this,arguments)}}()}),t};d();c();l();u();var RI=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},FI=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var _x=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:a}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:a}};d();c();l();u();function EI(e,t){let r={...e},n,o=a=>(i,p)=>{let f=a(i,p);return n?n(f,p):f};return{get combinedReducer(){let a=eC(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(Vi({...a,...r}))},containsAll(a){return Object.keys(a).every(p=>p in r)},add(a){Object.keys(a).filter(i=>!(i in r)).forEach(i=>{r[i]=a[i]})},addCrossReducer(a){n=a}}}d();c();l();u();d();c();l();u();function Nx(e){if(!e||!iB(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function II(e,t=60){if(!e)return!1;let r=Nx(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function iB(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function PI(e,t){let r=0,n=null,o=fd(()=>{r=0},500),a=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(f,m=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(C){if(!m)throw C;return null}})().finally(()=>{n=null}));let v=yield n;return g&&v&&f.dispatch(rn({accessToken:v})),v});return function a(_x151){return _ref66.apply(this,arguments)}}(),i=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(f){let m=f.getState(),g=cB(m);if(!(!g||!II(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield a(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(v){e.warn(v,"Access token renewal failed. A retry will occur if necessary.")}}});return function i(_x152){return _ref68.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(f,m,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),TI(f,m.error),m;!n&&(r++,o());try{yield a(f,!0)}catch(C){e.debug(C,"Token renewal failed in reactive path (piggybacked on a proactive renewal). The action will be re-dispatched.")}f.dispatch(g)});return function p(_x153,_x154,_x155){return _ref69.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref70=_asyncToGenerator(function*(g){let v=typeof g=="function",C=typeof t=="function";if(!v)return m(g);C&&(yield i(f));let h=yield m(g);return sB(h)?C?yield p(f,h,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),TI(f,h.error),h):h});return function(_x156){return _ref70.apply(this,arguments)}}())}function sB(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Mi().name}function TI(e,t){e.dispatch(Ts({status:401,statusCode:401,message:t.message,type:t.name}))}function cB(e){return e.configuration.accessToken}d();c();l();u();function kI({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return ub({reducer:e,preloadedState:t,devTools:{stateSanitizer:a=>a.history?{...a,history:"<<OMIT>>"}:a,name:o,shouldHotReload:!1},middleware:a=>a({thunk:{extraArgument:n}}).prepend(...r).concat(FI(n.logger))})}function uB(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},a={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return a.analyticsMode!=="next"&&ZA()?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):a}function OI(e,t){let r={...e.reducers,configuration:fe,version:CF},n=lB({...e,reducers:r},t,fe),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(rn({accessToken:o,environment:a,organizationId:i}));let p=uB(e.configuration,n.logger);return p&&n.dispatch(Ro(p)),n}function lB(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=EI({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return Ku(m.state,o)},get navigatorContext(){return _x(this.relay,o)}},f=dB(e,p,a),m={addReducers(g){a.containsAll(g)||(a.add(g),f.replaceReducer(a.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(ss())},disableAnalytics(){f.dispatch(is())},get state(){return f.getState()},get relay(){return Ku(this.state,o)},get navigatorContext(){return _x(this.relay,o)},logger:i,store:f};return m}function dB(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=pB(e,t.logger,()=>t.navigatorContext);return kI({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function pB(e,t,r){let{renewAccessToken:n}=e.configuration,o=PI(t,n),a=wI({getNavigatorContext:r});return[kF,o,RI(t),wF].concat(Ma.middleware,a.middleware,e.middlewares||[])}var fB=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
|
|
42
43
|
However, this mode is not available for Coveo for Service features, and this configuration may not work as expected.
|
|
43
44
|
Please switch back to the "legacy" analytics mode to ensure proper functionality.
|
|
44
|
-
For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function $o(e){e==="next"&&console.warn(SQ)}d();c();l();u();var fI=Mr(pI(),1);function mI(e){return(0,fI.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function gI(e,t){let r=qQ(e),n=mr,o=MQ(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function qQ(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function MQ(e){return e.preprocessRequest||hd}d();c();l();u();var bx=(e,t,r,n,o,a)=>{let i=e[t];de(i)||de(o)||o!==i&&o!==n&&(a.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),a.warn(`To remove this warning, make sure that access token value [${i}] matches engine configuration value [${r}]`))},wx=(e,t)=>!(de(e)||t===e),Dl=e=>{let t=yx(e);return t||!1},SI=(e,t)=>(wx(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),hI=(e,t,r,n)=>(bx(e,"searchHub",t.searchHub,Ao(),r,n),SI(e,t)),vI=(e,t)=>(wx(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),yI=(e,t,r,n)=>(bx(e,"pipeline",t.pipeline,Wn(),r,n),vI(e,t)),xI=(e,t)=>(wx(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),VQ=(e,t,r,n)=>(bx(e,"userDisplayName",t.configuration.analytics.userDisplayName,Ls().analytics.userDisplayName,r,n),xI(e,t)),AI=e=>ae({},t=>{t.addCase(Ts,(r,n)=>{let o=Dl(r.configuration.accessToken);return o?hI(o,r,n.payload,e):r}).addCase(ls,(r,n)=>{let o=Dl(r.configuration.accessToken);return o?yI(o,r,n.payload,e):r}).addCase(tn,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:o}=n.payload;if(!o)return r;let a=Dl(o);return a?[vI,SI,xI].reduce((i,p)=>p(a,i),r):r}).addCase(Sr,(r,n)=>{let o=Dl(r.configuration.accessToken);if(!o)return r;let a=hI(o,r,n.payload.searchHub,e);return yI(o,a,n.payload?.pipeline,e)}).addCase(wo,(r,n)=>{let o=Dl(r.configuration.accessToken);return o?VQ(o,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var CI={organizationId:W,accessToken:W,name:new U({required:!1,emptyAllowed:!1}),analytics:new X({options:{required:!1},values:{enabled:new le({required:!1}),originContext:new U({required:!1}),originLevel2:new U({required:!1}),originLevel3:new U({required:!1}),analyticsMode:new U({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new U({required:!1,url:!0}),trackingId:new U({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new U({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function bI(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var wI=new ye({...CI,search:new X({options:{required:!1},values:{pipeline:new U({required:!1,emptyAllowed:!0}),searchHub:st,locale:st,timezone:st,authenticationProviders:new ie({required:!1,each:W}),proxyBaseUrl:new U({required:!1,url:!0})}})});function Rx(){return{...bI(),search:{searchHub:"default"}}}var jQ={debug:us,pipeline:ds,searchHub:Ps,search:me};function LQ(e){let{search:t,organizationId:r,environment:n}=e,o=t?.proxyBaseUrl?t.proxyBaseUrl:lt(r,n);return{...t,apiBaseUrl:o}}function RI(e){let t=mI(e.loggerOptions),{configuration:r}=e;UQ(r,t);let n=QQ(r,t),o=BQ(t),a={...gI(r,t),apiClient:n,streamingClient:o},i={...e,reducers:jQ,crossReducer:AI(t)},p=oI(i,a),f=LQ(r);return f&&p.dispatch(Sr(f)),{...p,get state(){return p.state},executeFirstSearch(m=Sp()){if(ll(p.state))return;let h=z({legacy:m,next:Aw()});p.dispatch(h)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:h,metadata:x}=m;if(ll(p.state))return;let A=x&&h==="omniboxFromLink",y=z({legacy:A?xp(x):vp(),next:A?bw():Cw()});p.dispatch(y)}}}function UQ(e,t){try{wI.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function QQ(e,t){let{search:r}=e;return new Sd({logger:t,preprocessRequest:e.preprocessRequest||hd,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||cC,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||uC,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||lC})}function BQ(e){return new fd({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var ci={value:W,numberOfResults:new re({min:0}),state:W};d();c();l();u();var Se=W;var zQ=new re({min:1,default:8,required:!1}),WQ=new re({min:1,max:20,default:5,required:!1}),KQ={desiredCount:WQ,numberOfValues:zQ},ac=I("automaticFacet/setOptions",e=>O(e,KQ)),ic=I("automaticFacet/deselectAll",e=>O(e,Se)),YQ=W,gn=I("automaticFacet/toggleSelectValue",e=>O(e,{field:YQ,selection:new X({values:ci})}));d();c();l();u();d();c();l();u();var JQ={state:new Ue({required:!0}),numberOfResults:new re({required:!0,min:0}),value:new U({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:W}),moreValuesAvailable:new le({required:!1})};function Fx(e){e.children.forEach(t=>{Fx(t)}),mr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},JQ)}var sc={facetId:Se,field:W,tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),activeTab:new U({required:!1}),delimitingCharacter:new U({required:!1,emptyAllowed:!0}),filterFacetCount:new le({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Ue({required:!1}),basePath:new ie({required:!1,each:W}),filterByBasePath:new le({required:!1})};var hn=I("categoryFacet/register",e=>O(e,sc)),zo=I("categoryFacet/toggleSelectValue",e=>{try{return mr(e.facetId,W),Fx(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:Qn(t)}}}),yn=I("categoryFacet/deselectAll",e=>O(e,sc.facetId)),ui=I("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:sc.facetId,numberOfValues:sc.numberOfValues})),cc=I("categoryFacet/updateSortCriterion",e=>O(e,{facetId:sc.facetId,criterion:new Ue})),og=I("categoryFacet/updateBasePath",e=>O(e,{facetId:sc.facetId,basePath:new ie({each:W})}));d();c();l();u();var XQ={categoryFacetId:Se,categoryFacetPath:new ie({required:!0,each:W})},ZQ=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},ag=e=>J("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,XQ),t.makeBreadcrumbFacet(ZQ(r,e)))),FI=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var we=I("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new le({required:!1})})),Qt=I("facetOptions/facet/enable",e=>O(e,Se)),tt=I("facetOptions/facet/disable",e=>O(e,Se));d();c();l();u();var nr=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var ql={facetId:Se,captions:new X({options:{required:!1}}),numberOfValues:new re({required:!1,min:1}),query:new U({required:!1,emptyAllowed:!0})};var eB={path:new ie({required:!0,each:W}),displayValue:Qe,rawValue:Qe,count:new re({required:!0,min:0})},uc=I("categoryFacet/selectSearchResult",e=>O(e,{facetId:Se,value:new X({values:eB})})),lc=I("categoryFacetSearch/register",e=>O(e,ql));d();c();l();u();function dc(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function pc(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function ig(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function Ml(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function sg(e,t,r){e.currentValues=tB(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function tB(e,t){if(!e.length)return[];let r=EI(e[0],t),n=r;for(let o of e.splice(1)){let a=EI(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function EI(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var Sn=ae(Ki(),e=>{e.addCase(hn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=nB(n),p=i.numberOfValues;t[o]={request:i,initialNumberOfValues:p,tabs:a}}).addCase(_e.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(a=>{let i=t[a],p=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!nr(i.tabs,o)){p.currentValues.length&&sg(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&sg(p,m,i.initialNumberOfValues)})}).addCase(cc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(og,(t,r)=>{let{facetId:n,basePath:o}=r.payload,a=t[n]?.request;a&&(a.basePath=[...o])}).addCase(zo,(t,r)=>{let{facetId:n,selection:o,retrieveCount:a}=r.payload,i=t[n]?.request;if(!i)return;let{path:p}=o,f=p.slice(0,p.length-1),m=rB(i,f,a);if(m.length){let x=m[0];x.retrieveChildren=!0,x.state="selected",x.previousState="idle",x.children=[];return}let h=TI(o.value,a);h.state="selected",h.previousState="idle",m.push(h),i.numberOfValues=1}).addCase(yn,(t,r)=>{let n=r.payload;Ml(t,n)}).addCase(mt,t=>{Object.keys(t).forEach(r=>Ml(t,r))}).addCase(rn,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(ui,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,a=t[n]?.request;if(a){if(!a.currentValues.length)return ig(a,o);oB(t,r.payload)}}).addCase(uc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];sg(a.request,i,a.initialNumberOfValues)}).addCase(br.fulfilled,(t,r)=>{II(t,r.payload.response.facets)}).addCase(z.fulfilled,(t,r)=>{II(t,r.payload.response.facets)}).addCase(tt,(t,r)=>{Ml(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!nr(a.tabs,n)&&Ml(t,o)})})}),Vl={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function rB(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=TI(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function nB(e){return{...Vl,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function TI(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function II(e,t){t.forEach(r=>{if(!aB(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=iB(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function oB(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function aB(e,t){return t.facetId in e}function iB(e,t){let r=cr(e.currentValues),n=cr(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var vn=new U({regex:/^[a-zA-Z0-9-_]+$/}),xn=new U({required:!0}),PI=new ie({each:new U}),kI=new U,OI=new le,An=new le,Cn=new re({min:0}),Hr=new re({min:1}),cg=new le({required:!0}),sB=new X,cB=new U,uB={captions:sB,numberOfValues:Hr,query:cB},fc=new X({values:uB}),ug=new X({options:{required:!1},values:{type:new U({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new U({emptyAllowed:!1,required:!0})})}}),NI=new le,lg=new ie({min:1,max:25,required:!1,each:new U({emptyAllowed:!1,required:!0})});var lB={facetId:Se,field:new U({required:!0,emptyAllowed:!0}),tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),activeTab:new U({required:!1}),filterFacetCount:new le({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Ue({required:!1}),resultsMustMatch:new Ue({required:!1}),allowedValues:ug,customSort:lg},bn=I("facet/register",e=>O(e,lB)),wn=I("facet/toggleSelectValue",e=>O(e,{facetId:Se,selection:new X({values:ci})})),Rn=I("facet/toggleExcludeValue",e=>O(e,{facetId:Se,selection:new X({values:ci})})),rt=I("facet/deselectAll",e=>O(e,Se)),mc=I("facet/updateSortCriterion",e=>O(e,{facetId:Se,criterion:new Ue({required:!0})})),li=I("facet/updateNumberOfValues",e=>O(e,{facetId:Se,numberOfValues:new re({required:!0,min:1})})),di=I("facet/updateIsFieldExpanded",e=>O(e,{facetId:Se,isFieldExpanded:new le({required:!0})})),oo=I("facet/updateFreezeCurrentValues",e=>O(e,{facetId:Se,freezeCurrentValues:new le({required:!0})}));d();c();l();u();var gc=e=>J("analytics/facet/showMore",(t,r)=>{O(e,Se);let n=Zi(e,ur(r));return t.makeFacetShowMore(n)}),hc=e=>J("analytics/facet/showLess",(t,r)=>{O(e,Se);let n=Zi(e,ur(r));return t.makeFacetShowLess(n)}),Fn=e=>J("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:Se,criterion:new Ue({required:!0})});let{facetId:n,criterion:o}=e,a=ur(r),p={...Zi(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),bt=e=>J("analytics/facet/reset",(t,r)=>{O(e,Se);let n=ur(r),o=Zi(e,n);return t.makeFacetClearAll(o)}),it=e=>J("analytics/facet/select",(t,r)=>{O(e,{facetId:Se,facetValue:W});let n=ur(r),o=es(e,n);return t.makeFacetSelect(o)}),pr=e=>J("analytics/facet/exclude",(t,r)=>{O(e,{facetId:Se,facetValue:W});let n=ur(r),o=es(e,n);return t.makeFacetExclude(o)}),zr=e=>J("analytics/facet/deselect",(t,r)=>{O(e,{facetId:Se,facetValue:W});let n=ur(r),o=es(e,n);return t.makeFacetDeselect(o)}),ao=e=>J("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:Se,facetValue:W});let n=ur(r),o=es(e,n);return t.makeFacetUnexclude(o)}),yc=e=>J("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:Se,facetValue:W});let n=es(e,ur(r));return t.makeBreadcrumbFacet(n)}),Bt=()=>({actionCause:"facetClearAll"}),ht=()=>({actionCause:"facetSelect"}),io=()=>({actionCause:"facetExclude"}),so=()=>({actionCause:"facetDeselect"}),_I=()=>({actionCause:"facetUnexclude"}),dg=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var DI={facetId:Se,value:new X({values:{displayValue:Qe,rawValue:Qe,count:new re({required:!0,min:0})}})},pg=I("facetSearch/register",e=>O(e,ql)),Wo=I("facetSearch/update",e=>O(e,ql)),pi=I("facetSearch/toggleSelectValue",e=>O(e,DI)),fi=I("facetSearch/toggleExcludeValue",e=>O(e,DI));var Ir=ae(Xi(),e=>{e.addCase(bn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=Yb(dB(r.payload),o))}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(De,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(i=>{let{request:p}=t[i],f=n[i]||[],m=o[i]||[],h=f.length+m.length,x=p.currentValues.filter(A=>!f.includes(A.value)&&!m.includes(A.value));p.currentValues=[...f.map(MI),...m.map(VI),...x.map(fB)],p.preventAutoSelect=h>0,p.numberOfValues=Math.max(h,p.numberOfValues)})}).addCase(wn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){fg(a,o);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",a.freezeCurrentValues=!0}).addCase(Rn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){fg(a,o);return}let p=i.state==="excluded";i.previousState=i.state,i.state=p?"idle":"excluded",a.freezeCurrentValues=!0}).addCase(oo,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,a=t[n]?.request;a&&(a.freezeCurrentValues=o)}).addCase(rt,(t,r)=>{pc(t[r.payload]?.request)}).addCase(mt,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>pc(r))}).addCase(ps,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>pc(r))}).addCase(rn,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(mc,(t,r)=>{dc(t,r.payload)}).addCase(li,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;ig(t[n]?.request,o)}).addCase(di,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,a=t[n]?.request;a&&(a.isFieldExpanded=o)}).addCase(z.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>qI(t[o.facetId]?.request,o))}).addCase(br.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>qI(t[o.facetId]?.request,o))}).addCase(pi,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(h=>h.value===i);if(f){f.state="selected";return}let m=MI(i);fg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(fi,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(h=>h.value===i);if(f){f.state="excluded";return}let m=VI(i);fg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(tt,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];pc(n)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!nr(a.tabs,n)&&pc(a.request)})})});function fg(e,t){let{currentValues:r}=e,n=r.findIndex(a=>a.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function qI(e,t){e&&(e.currentValues=t.values.map(pB),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var jl={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function dB(e){return{...jl,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function pB(e){let{value:t,state:r}=e;return{value:t,state:r}}function MI(e){return{value:e,state:"selected"}}function VI(e){return{value:e,state:"excluded"}}function fB(e){return{...e,state:"idle"}}d();c();l();u();var mg=()=>J("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function Ko(e){let t=jI(e.start,e),r=jI(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function jI(e,t){let{dateFormat:r}=t;return Vw(e)?(To(e),Dw(e)):typeof e=="string"&&an(e)?(To(e),e):(Tp(e,r),il(ba(e,r)))}d();c();l();u();var Sc=I("rangeFacet/updateSortCriterion",e=>O(e,{facetId:Se,criterion:new Ue({required:!0})}));d();c();l();u();var mi={state:W,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new le({required:!0}),numberOfResults:new re({required:!0,min:0})},gi={start:W,end:W,endInclusive:new le({required:!0}),state:W,numberOfResults:new re({required:!0,min:0})},hi=e=>({facetId:Se,selection:typeof e.start=="string"?new X({values:gi}):new X({values:mi})});var mB={start:W,end:W,endInclusive:new le({required:!0}),state:W},gB={facetId:Se,field:W,tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),activeTab:new U({required:!1}),currentValues:new ie({required:!1,each:new X({values:mB})}),generateAutomaticRanges:new le({required:!0}),filterFacetCount:new le({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Ue({required:!1}),rangeAlgorithm:new Ue({required:!1})};function LI(e){return an(e)?cl(e):e}function gg(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Ko(t);if(ba(LI(r)).isAfter(ba(LI(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var En=I("dateFacet/register",e=>{try{return mr(e,gB),gg(e),{payload:e,error:null}}catch(t){return{payload:e,error:Qn(t)}}}),In=I("dateFacet/toggleSelectValue",e=>O(e,{facetId:Se,selection:new X({values:gi})})),Tn=I("dateFacet/toggleExcludeValue",e=>O(e,{facetId:Se,selection:new X({values:gi})})),co=I("dateFacet/updateFacetValues",e=>{try{return mr(e,{facetId:Se,values:new ie({each:new X({values:gi})})}),gg({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Qn(t)}}}),hg=Sc,yg=rt;d();c();l();u();d();c();l();u();var Sg=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,a=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:a,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},vg=()=>({actionCause:"breadcrumbFacet"});var Ll=e=>J("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,hi(e.selection));let n=Sg(r,e);return t.makeBreadcrumbFacet(n)}),Ex=vg;d();c();l();u();function hB(e,t){return!!t&&t.facetId in e.dateFacetSet}var UI=(e,t)=>{let r=jr(e,t);if(hB(e,r))return r},QI=(e,t)=>(UI(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),BI=(e,t)=>(UI(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var Ag={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function Cg(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=GI(r);r.numberOfValues=o,e[n]=t}function bg(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=GI(n))}function wg(e,t,r){let n=e[t]?.request;if(!n)return;let o=xg(n.currentValues,r);if(!o)return;let a=o.state==="selected";o.previousState=o.state,o.state=a?"idle":"selected",n.preventAutoSelect=!0}function Rg(e,t,r){let n=e[t]?.request;if(!n)return;let o=xg(n.currentValues,r);if(!o)return;let a=o.state==="excluded";o.previousState=o.state,o.state=a?"idle":"excluded",n.preventAutoSelect=!0}function Pn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function Fg(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(xg(o,p)&&(p.state="selected"),p));let a=o.filter(p=>!xg(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function Eg(e,t,r){t.forEach(n=>{let o=n.facetId,a=e[o]?.request;if(!a)return;let i=r(n.values);a.currentValues=i,a.preventAutoSelect=!1})}function xg(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function GI(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var kn=ae(Yi(),e=>{e.addCase(En,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=yB(n);Cg(t,Wb(a,o))}).addCase(_e.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.df||{};Fg(t,n)}).addCase(In,(t,r)=>{let{facetId:n,selection:o}=r.payload;wg(t,n,o)}).addCase(Tn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Rg(t,n,o)}).addCase(co,(t,r)=>{let{facetId:n,values:o}=r.payload;bg(t,n,o)}).addCase(yg,(t,r)=>{Pn(t,r.payload)}).addCase(mt,t=>{Object.keys(t).forEach(r=>{Pn(t,r)})}).addCase(hg,(t,r)=>{dc(t,r.payload)}).addCase(z.fulfilled,(t,r)=>{let n=r.payload.response.facets;Eg(t,n,SB)}).addCase(tt,(t,r)=>{Pn(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!nr(a.tabs,n)&&Pn(t,o)})})});function yB(e){return{...Ag,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function SB(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var vB={state:W,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new le({required:!0})},xB={facetId:Se,field:W,tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),activeTab:new U({required:!1}),currentValues:new ie({required:!1,each:new X({values:vB})}),generateAutomaticRanges:new le({required:!0}),filterFacetCount:new le({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Ue({required:!1}),rangeAlgorithm:new Ue({required:!1})};function Ig(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 On=I("numericFacet/register",e=>{try{return O(e,xB),Ig(e),{payload:e,error:null}}catch(t){return{payload:e,error:Qn(t)}}}),Nn=I("numericFacet/toggleSelectValue",e=>O(e,{facetId:Se,selection:new X({values:mi})})),_n=I("numericFacet/toggleExcludeValue",e=>O(e,{facetId:Se,selection:new X({values:mi})})),uo=I("numericFacet/updateFacetValues",e=>{try{return mr(e,{facetId:Se,values:new ie({each:new X({values:mi})})}),Ig({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Qn(t)}}}),Tg=Sc,Pg=rt;d();c();l();u();var Ul=e=>J("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,hi(e.selection));let n=Sg(r,e);return t.makeBreadcrumbFacet(n)}),Ix=vg;d();c();l();u();function AB(e,t){return!!t&&t.facetId in e.numericFacetSet}var $I=(e,t)=>{let r=jr(e,t);if(AB(e,r))return r},HI=(e,t)=>($I(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),zI=(e,t)=>($I(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var Tr=ae(Ji(),e=>{e.addCase(On,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=CB(n);Cg(t,Kb(a,o))}).addCase(_e.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.nf||{};Fg(t,n)}).addCase(Nn,(t,r)=>{let{facetId:n,selection:o}=r.payload;wg(t,n,o)}).addCase(_n,(t,r)=>{let{facetId:n,selection:o}=r.payload;Rg(t,n,o)}).addCase(uo,(t,r)=>{let{facetId:n,values:o}=r.payload;bg(t,n,o)}).addCase(Pg,(t,r)=>{Pn(t,r.payload)}).addCase(mt,t=>{Object.keys(t).forEach(r=>{Pn(t,r)})}).addCase(Tg,(t,r)=>{dc(t,r.payload)}).addCase(z.fulfilled,(t,r)=>{let n=r.payload.response.facets;Eg(t,n,bB)}).addCase(tt,(t,r)=>{Pn(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!nr(a.tabs,n)&&Pn(t,o)})})});function CB(e){return{...Ag,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function bB(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var yi=W,kg=new X({options:{required:!0},values:{caption:Qe,expression:Qe,state:new U({constrainTo:["idle","selected","excluded"]})}}),Og=new ie({required:!0,each:kg});var vc=I("staticFilter/register",e=>O(e,{id:yi,values:Og})),lo=I("staticFilter/toggleSelect",e=>O(e,{id:yi,value:kg})),po=I("staticFilter/toggleExclude",e=>O(e,{id:yi,value:kg})),Yo=I("staticFilter/deselectAllFilterValues",e=>O(e,yi)),Ng=e=>J("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),xc=e=>J("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),_g=e=>J("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e));d();c();l();u();d();c();l();u();function oe(e){let t,r=new Map,n=()=>r.size===0,o=a=>{try{let i=JSON.stringify(a),p=t!==i;return t=i,p}catch(i){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",i),!0}};return{subscribe(a){a();let i=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(i,a),()=>{r.delete(i),n()&&p?.()}},get state(){return{}}}}var Dg=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function WI(e){let t=oe(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(mt())},deselectBreadcrumb(n){n.deselect()}}}function KI(e){if(!wB(e))throw K;let t=WI(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let b={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:w,selection:P})=>{r(wn({facetId:w,selection:P})),r(oo({facetId:w,freezeCurrentValues:!1})),r(z({legacy:yc({facetId:w,facetValue:P.value}),next:dg()}))},executeToggleExclude:({facetId:w,selection:P})=>{r(Rn({facetId:w,selection:P})),r(oo({facetId:w,freezeCurrentValues:!1})),r(z({legacy:yc({facetId:w,facetValue:P.value}),next:dg()}))},facetValuesSelector:$b};return Dg(b)},a=()=>{let b={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:w=>{r(Nn(w)),r(z({legacy:Ul(w),next:Ix()}))},executeToggleExclude:w=>{r(_n(w)),r(z({legacy:Ul(w),next:Ix()}))},facetValuesSelector:HI};return Dg(b)},i=()=>{let b={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:w=>{r(In(w)),r(z({legacy:Ll(w),next:Ex()}))},executeToggleExclude:w=>{r(Tn(w)),r(z({legacy:Ll(w),next:Ex()}))},facetValuesSelector:BI};return Dg(b)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(b=>b.path.length),f=b=>{let w=zb(n(),b);return{facetId:b,field:n().categoryFacetSet[b].request.field,path:w,deselect:()=>{r(yn(b)),r(z({legacy:ag({categoryFacetPath:w.map(P=>P.value),categoryFacetId:b}),next:FI()}))}}},m=()=>{let b=n().staticFilterSet??{};return Object.values(b).map(h)},h=b=>{let{id:w,values:P}=b,F=P.filter(k=>k.state!=="idle").map(k=>x(w,k));return{id:w,values:F}},x=(b,w)=>({value:w,deselect:()=>{let{caption:P,expression:F}=w;w.state==="selected"?r(lo({id:b,value:w})):w.state==="excluded"&&r(po({id:b,value:w})),r(z({legacy:xc({staticFilterId:b,staticFilterValue:{caption:P,expression:F}})}))}}),A=()=>{let b=n().automaticFacetSet?.set??{};return Object.values(b).map(w=>y(w.response)).filter(w=>w.values.length>0)},y=b=>{let{field:w,label:P}=b,F=b.values.filter(k=>k.state!=="idle").map(k=>C(w,k));return{facetId:w,field:w,label:P,values:F}},C=(b,w)=>({value:w,deselect:()=>{r(gn({field:b,selection:w})),r(z({legacy:yc({facetId:b,facetValue:w.value}),next:dg()}))}});function R(){return!![...o(),...a(),...i(),...p(),...m(),...A()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:a(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:A(),hasBreadcrumbs:R()}},deselectAll:()=>{t.deselectAll(),r(z({legacy:mg(),next:{actionCause:"breadcrumbResetAll"}}))}}}function wB(e){return e.addReducers({configuration:pe,search:me,facetSet:Ir,numericFacetSet:Tr,dateFacetSet:kn,categoryFacetSet:Sn}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var RB=new ie({each:W,required:!0}),YI=(e,t)=>(O(e,W),ki(t)?O(t,W):O(t,RB),{payload:{contextKey:e,contextValue:t}}),Si=I("context/set",e=>{for(let[t,r]of Object.entries(e))YI(t,r);return{payload:e}}),vi=I("context/add",e=>YI(e.contextKey,e.contextValue)),xi=I("context/remove",e=>O(e,W));d();c();l();u();var qg=ae(_p(),e=>{e.addCase(Si,(t,r)=>{t.contextValues=r.payload}).addCase(vi,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(xi,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();var FB=["caseId","caseNumber"],EB={caseId:"caseContext",caseNumber:"caseContext"},Ql=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${EB[t]} to set this value.}`)}};function Tx(e){return FB.includes(e)}var IB=new ye({values:new X({options:{required:!1}})});function JI(e,t={}){if(!kB(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=dt(e,IB,t.initialState,"buildContext");return a.values&&n(Si(a.values)),{...r,get state(){return{values:o().context.contextValues}},set(i){n(Si(i))},...(o().configuration.analytics.analyticsMode==="legacy"?TB(n):PB(n))}}var TB=e=>({add(t,r){e(vi({contextKey:t,contextValue:r}))},remove(t){e(xi(t))}}),PB=e=>({add(t,r){if(Tx(t))throw new Ql(t);e(vi({contextKey:t,contextValue:r}))},remove(t){if(Tx(t))throw new Ql(t);e(xi(t))}});function kB(e){return e.addReducers({context:qg}),!0}function XI(e,t){return JI(e,t)}d();c();l();u();d();c();l();u();var wt=ae(qp(),e=>{e.addCase(we,(t,r)=>({...t,...r.payload})).addCase(z.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(z.rejected,t=>{t.freezeFacetOrder=!1}).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(hn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Mg(o,t,n)}).addCase(bn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Mg(o,t,n)}).addCase(En,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Mg(o,t,n)}).addCase(On,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Mg(o,t,n)}).addCase(Qt,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(tt,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(De,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=ev()),t.facets[n].enabled=!0})})});function Mg(e,t,r){let n={...ev(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var Ac=ae(Lp(),e=>{e.addCase(js,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(yt,(t,r)=>{let n=r.payload;ZI(t,n)}).addCase(ss,(t,r)=>{let n=r.payload;ZI(t,n)}).addCase(_e.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(De,(t,r)=>{let n=r.payload.tab;de(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function ZI(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function Vg(e){if(!OB(e))throw K;let t=oe(e),r=Xe(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function OB(e){return e.addReducers({tabSet:Ac}),!0}function eT(e,t){if(!NB(e))throw K;let r=Vg(e),n=C=>e.state.facetOptions.facets[C]?.enabled??!1,o=C=>e.state.facetSet?.[C]?.request?.currentValues??e.state.categoryFacetSet?.[C]?.request?.currentValues??e.state.numericFacetSet?.[C]?.request?.currentValues??e.state.dateFacetSet?.[C]?.request?.currentValues??null,a=C=>C in e.state.facetOptions.facets,i=C=>e.state.facetOptions.facets[C]?.tabs,p=()=>Ni({isFacetRegistered:a(t.facetId),parentFacets:t.conditions.map(({parentFacetId:C})=>a(C)?{enabled:n(C),values:o(C)}:null),isTabEnabled:nr(i(t.facetId),r.state.activeTab)}),f=()=>{let C=p();return C===A?!1:(A=C,!0)},m=()=>t.conditions.length>0?t.conditions.some(C=>{if(!n(C.parentFacetId))return!1;let R=o(C.parentFacetId);return R===null?!1:C.condition(R)}):!0,h=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([C,R])=>R.request.freezeCurrentValues&&e.dispatch(oo({facetId:C,freezeCurrentValues:!1})))},x=()=>{if(!a(t.facetId))return;let C=n(t.facetId),R=m(),b=nr(i(t.facetId),r.state.activeTab),w=R&&b;C!==w&&(e.dispatch(w?Qt(t.facetId):tt(t.facetId)),h())},A=p(),y=e.subscribe(()=>{f()&&x()});return x(),{stopWatching(){y()}}}function NB(e){return e.addReducers({facetOptions:wt}),!0}d();c();l();u();d();c();l();u();var Cc=I("dictionaryFieldContext/set",e=>{let t=new X({options:{required:!0}}),r=O(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:Qe}),a=O(n,o).error;return a?{payload:e,error:a}:{payload:e}}),bc=I("dictionaryFieldContext/add",e=>{let t=new X({options:{required:!0},values:{field:Qe,key:Qe}});return O(e,t)}),wc=I("dictionaryFieldContext/remove",e=>O(e,Qe));d();c();l();u();var jg=ae(Dp(),e=>{e.addCase(Cc,(t,r)=>{t.contextValues=r.payload}).addCase(bc,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(wc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function tT(e){if(!_B(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Cc(o))},add(o,a){r(bc({field:o,key:a}))},remove(o){r(wc(o))}}}function _B(e){return e.addReducers({dictionaryFieldContext:jg}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var rT=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var Lg=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),nT=()=>({correctedQuery:"",corrections:[],originalQuery:""});function oT(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:Lg(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var aT=(e,t)=>{let r={...nT(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var Ug=ae(oT(),e=>{e.addCase(bs,t=>{t.enableDidYouMean=!0}).addCase(kp,t=>{t.enableDidYouMean=!1}).addCase(Op,t=>{t.automaticallyCorrectQuery=!0}).addCase(ws,t=>{t.automaticallyCorrectQuery=!1}).addCase(z.pending,t=>{t.queryCorrection=Lg(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(z.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let a=o?.[0]?o[0]:Lg();t.queryCorrection=a}t.queryCorrectionMode==="next"&&aT(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(vr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(wa,(t,r)=>{t.queryCorrectionMode=r.payload})});function iT(e,t={}){if(!DB(e))throw K;let r=oe(e),{dispatch:n}=e;n(bs()),t.options?.automaticallyCorrectQuery===!1&&n(ws()),n(wa(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>rT(o().didYouMean);return{...r,get state(){let i=o();return{originalQuery:i.didYouMean.originalQuery,wasCorrectedTo:i.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:i.didYouMean.wasAutomaticallyCorrected,queryCorrection:i.didYouMean.queryCorrection,hasQueryCorrection:a()}},applyCorrection(){n(vr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(wa(i))}}}function DB(e){return e.addReducers({configuration:pe,didYouMean:Ug}),!0}function sT(e,t={}){let r=iT(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(z({legacy:Np(),next:Bw()}))}}}d();c();l();u();d();c();l();u();function cT(e){if(!qB(e))throw K;let t=oe(e),r=()=>e.state;return{...t,sort(n){return ul(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function qB(e){return e.addReducers({search:me,facetOptions:wt}),!0}function uT(e){return cT(e)}d();c();l();u();d();c();l();u();var Qg=ae(zi(),e=>{e.addCase(z.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(ac,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(gn,(t,r)=>{let{field:n,selection:o}=r.payload,a=t.set[n]?.response;if(!a)return;let i=a.values.find(f=>f.value===o.value);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(ic,(t,r)=>{let n=r.payload,o=t.set[n]?.response;if(o)for(let a of o.values)a.state="idle"}).addCase(De,(t,r)=>{let n=r.payload.af??{},o=Object.keys(t.set);for(let a in n)if(!t.set[a]){let i=MB(a),p=n[a].map(f=>lT(f));i.values.push(...p),t.set[a]={response:i}}for(let a of o)if(!(a in n)){let i=t.set[a]?.response;for(let p of i.values)p.state="idle"}for(let a in n){let i=t.set[a]?.response;if(i){let p=i.values,f=new Set(n[a]);for(let m of p)f.has(m.value)?(m.state="selected",f.delete(m.value)):m.state="idle";for(let m of f)i.values.push(lT(m))}}}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.automaticFacetSet.set).length!==0)return r.payload.automaticFacetSet}).addCase(mt,t=>{Object.values(t.set).forEach(({response:r})=>{r.values.forEach(n=>{n.state="idle"})})})});function MB(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function lT(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var Bg=e=>e.state==="selected",Gg=e=>e.state==="excluded",$g=(e,t)=>{let r={facetId:e,facetValue:t.value};return Bg(t)?zr(r):it(r)},Hg=e=>Bg(e)?so():ht(),dT=(e,t)=>{let r={facetId:e,facetValue:t.value};return Gg(t)?ao(r):pr(r)},pT=e=>Gg(e)?_I():io();function fT(e,t){let{dispatch:r}=e,n=oe(e),{field:o}=t;return{...n,toggleSelect(a){r(gn({field:o,selection:a})),r(z({legacy:$g(o,a),next:Hg(a)}))},deselectAll(){r(ic(o)),r(z({legacy:bt(o),next:Bt()}))},get state(){let a=e.state.automaticFacetSet?.set[o]?.response;return a?{field:a.field,label:a.label,values:a.values}:{field:"",values:[],label:""}}}}d();c();l();u();function mT(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function gT(e,t){if(!VB(e))throw K;let{dispatch:r}=e,n=mT(t.options);return r(ac(n)),{...oe(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>fT(e,{field:i.field}))??[]}}}}function VB(e){return e.addReducers({automaticFacetSet:Qg,configuration:pe,search:me}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function zg(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,a={...Dn,...t},i=r();e[n]={options:a,isLoading:o,response:i,initialNumberOfValues:a.numberOfValues,requestId:""}}function Wg(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function Kg(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function Yg(e,t){let r=e[t];r&&(r.isLoading=!1)}function Jg(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function Bl(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=Dn.query)}function Xg(e,t){Object.keys(e).forEach(r=>Bl(e,{facetId:r},t))}var Dn={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var hT=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,a=t.categoryFacetSet[e].request,{captions:i,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:h,basePath:x,filterFacetCount:A}=a,y=jB(a),C=y.length?[y]:[],R=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??lt(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:x,captions:i,numberOfValues:f,query:R,field:m,delimitingCharacter:h,ignorePaths:C,filterFacetCount:A,type:"hierarchical",...(n?{}:{searchContext:(yield Ar(t,r)).request})}});return function hT(_x158,_x159,_x160,_x161){return _ref71.apply(this,arguments)}}(),jB=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var yT=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:a,numberOfValues:i}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,h=f.filter(A=>A.state!=="idle").map(A=>A.value),x=`*${a}*`;return{url:t.configuration.search.apiBaseUrl??lt(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:i,query:x,field:p,ignoreValues:h,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield Ar(t,r)).request})}});return function yT(_x162,_x163,_x164,_x165){return _ref72.apply(this,arguments)}}();var ST=e=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,W),LB(i,t)?p=yield yT(t,i,a,e):p=yield hT(t,i,a,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x166,_x167){return _ref73.apply(this,arguments)}}()),Rt=xe("facetSearch/executeSearch",ST(!1)),qn=xe("facetSearch/executeSearch",ST(!0)),Rc=I("facetSearch/clearResults",e=>O(e,{facetId:Se})),LB=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function vT(){return{}}var Fc=ae(vT(),e=>{e.addCase(lc,(t,r)=>{let n=r.payload;zg(t,n,Px)}).addCase(Wo,(t,r)=>{Wg(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;Kg(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;Yg(t,n)}).addCase(Rt.fulfilled,(t,r)=>{Jg(t,r.payload,r.meta.requestId)}).addCase(Rc,(t,{payload:{facetId:r}})=>{Bl(t,{facetId:r},Px)}).addCase(z.fulfilled,t=>{Xg(t,Px)})});function Px(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function xT(e,t){let{field:r,state:n}=e;if(!UB(e))return r;let o=`${r}_`,a=QB(o,n);return GB(r,t),`${o}${a}`}function UB(e){let{field:t,state:r}=e;return AT(r).some(o=>o&&t in o)}function QB(e,t){let n=AT(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return BB(n,e)+1}function AT(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function BB(e,t){return e.map(a=>{let i=a.split(t)[1],p=parseInt(i,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function GB(e,t){let r=`A facet with field "${e}" already exists.
|
|
45
|
-
To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function Gt(e,t){let{state:r,logger:n}=e,{field:o,facetId:a}=t;return a||xT({field:o,state:r},n)}d();c();l();u();d();c();l();u();var CT=["alphanumeric","occurrences"];var bT=new ye({field:xn,tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),basePath:PI,delimitingCharacter:kI,facetId:vn,facetSearch:fc,filterByBasePath:OI,filterFacetCount:An,injectionDepth:Cn,numberOfValues:Hr,sortCriteria:new U({constrainTo:CT})});function wT(e,t){if(!$B(e))throw K;let r=oe(e),{dispatch:n}=e,o=Gt(e,t.options),a=t.options.tabs??{},i=Yt(e.state.tabSet),p={...Vl,...ld("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...Dn,...t.options.facetSearch},...p};Ge(e,bT,f,"buildCategoryFacet");let m=()=>RS(e.state,o),h=()=>wS(e.state,o),x=()=>Zr(e.state),A=()=>sn(e.state,o);return n(hn(p)),{...r,toggleSelect(y){let C=f.numberOfValues;n(zo({facetId:o,selection:y,retrieveCount:C})),n(we())},deselectAll(){n(yn(o)),n(we())},sortBy(y){n(cc({facetId:o,criterion:y})),n(we())},isSortedBy(y){return m().sortCriteria===y},showMoreValues(){let{numberOfValues:y}=f,{activeValue:C,valuesAsTrees:R}=this.state,b=(C?.children.length??R.length)+y;n(ui({facetId:o,numberOfValues:b})),n(we())},showLessValues(){let{numberOfValues:y}=f;n(ui({facetId:o,numberOfValues:y})),n(we())},enable(){n(Qt(o))},disable(){n(tt(o))},get state(){let y=m(),C=h(),R=x(),b=A(),w=C?.values??[],P=w.some(Q=>Q.children.length>0)??!1,{parents:F,values:k}=Hb(C?.values),T=cr(w),D=T.length?T[T.length-1]:void 0,G=!!D,L=D?.moreValuesAvailable??C?.moreValuesAvailable??!1,V=D?D.children.length>f.numberOfValues:w.length>f.numberOfValues;return{facetId:o,parents:F,selectedValueAncestry:T,values:k,isHierarchical:P,valuesAsTrees:w,activeValue:D,isLoading:R,hasActiveValues:G,canShowMoreValues:L,canShowLessValues:V,sortCriteria:y.sortCriteria,enabled:b}}}}function $B(e){return e.addReducers({categoryFacetSet:Sn,categoryFacetSearchSet:Fc,facetOptions:wt,configuration:pe,search:me}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var HB="coveo-headless-internal-state",Zg=Symbol.for(HB);d();c();l();u();function Ec(e,t){let r=e.dispatch,{options:n,getFacetSearch:o,executeFacetSearchActionCreator:a,executeFieldSuggestActionCreator:i}=t,{facetId:p}=n;return{updateText(f){r(Wo({facetId:p,query:f,numberOfValues:o().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:f,options:m}=o();r(Wo({facetId:p,numberOfValues:m.numberOfValues+f})),r(t.isForFieldSuggestions?i(p):a(p))},search(){r(t.isForFieldSuggestions?i(p):a(p))},clear(){r(Rc({facetId:p}))},updateCaptions(f){r(Wo({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:h}=o(),{query:x}=h,A=f.values;return{...f,values:A,isLoading:m,query:x}}}}function RT(e,t){let{dispatch:r}=e,n={...Dn,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[Zg].categoryFacetSearchSet[o];r(lc(n));let i=Ec(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(uc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function eh(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a}=t,{dispatch:i}=e,p={...Dn,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],h=RT(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(lc(p));let x=Ec(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:qn});return{...x,...h,get state(){return{...x.state,...h.state}}}}function FT(e,t){if(!zB(e))throw K;let r=wT(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=eh(e,{options:{facetId:o(),...t.options.facetSearch},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:qn,select:f=>{n(we()),n(z({legacy:it({facetId:o(),facetValue:f.rawValue}),next:ht()}))},isForFieldSuggestions:!1}),{state:i,...p}=a;return{...r,facetSearch:p,toggleSelect(f){r.toggleSelect(f),n(z({legacy:WB(o(),f),next:KB(f)}))},deselectAll(){r.deselectAll(),n(z({legacy:bt(o()),next:Bt()}))},sortBy(f){r.sortBy(f),n(z({legacy:Fn({facetId:o(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(br({legacy:gc(o())}))},showLessValues(){r.showLessValues(),n(br({legacy:hc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function zB(e){return e.addReducers({categoryFacetSet:Sn,categoryFacetSearchSet:Fc,configuration:pe,search:me}),!0}function WB(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?zr(r):it(r)}function KB(e){return e.state==="selected"?so():ht()}d();c();l();u();d();c();l();u();d();c();l();u();function ET(){return{}}var Ic=ae(ET(),e=>{e.addCase(pg,(t,r)=>{let n=r.payload;zg(t,n,kx)}).addCase(Wo,(t,r)=>{Wg(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;Kg(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;Yg(t,n)}).addCase(Rt.fulfilled,(t,r)=>{Jg(t,r.payload,r.meta.requestId)}).addCase(Rc,(t,{payload:r})=>{Bl(t,r,kx)}).addCase(z.fulfilled,t=>{Xg(t,kx)})});function kx(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var IT={facetId:Se,selection:new X({values:ci})},TT=xe("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},IT),n(wn({facetId:e,selection:t})),n(we())}),PT=xe("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},IT),n(Rn({facetId:e,selection:t})),n(we())});d();c();l();u();d();c();l();u();var Tc=["allValues","atLeastOneValue"];d();c();l();u();var th=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var kT=new ye({facetId:vn,tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),field:xn,filterFacetCount:An,injectionDepth:Cn,numberOfValues:Hr,sortCriteria:new U({constrainTo:th}),resultsMustMatch:new U({constrainTo:Tc}),facetSearch:fc});function OT(e,t,r=kT){if(!YB(e))throw K;let{dispatch:n}=e,o=oe(e),a=Gt(e,t.options),i=t.options.tabs??{},p=Yt(e.state.tabSet),f={...jl,...ld("facetSearch",t.options),field:t.options.field,facetId:a,tabs:i,activeTab:p},m={facetSearch:{...Dn,...t.options.facetSearch},...f};Ge(e,r,m,"buildFacet");let h=()=>ip(e.state,a),x=()=>Wi(e.state,a),A=()=>Zr(e.state),y=()=>sn(e.state,a),C=()=>{let{currentValues:b}=h();return b.filter(w=>w.state!=="idle").length},R=()=>{let{currentValues:b}=h(),w=m.numberOfValues,P=!!b.find(F=>F.state==="idle");return w<b.length&&P};return n(bn(f)),{...o,toggleSelect:b=>n(TT({facetId:m.facetId,selection:b})),toggleExclude:b=>n(PT({facetId:m.facetId,selection:b})),toggleSingleSelect:function(b){b.state==="idle"&&n(rt(a)),this.toggleSelect(b)},toggleSingleExclude:function(b){b.state==="idle"&&n(rt(a)),this.toggleExclude(b)},isValueSelected:Bg,isValueExcluded:Gg,deselectAll(){n(rt(a)),n(we())},sortBy(b){n(mc({facetId:a,criterion:b})),n(we())},isSortedBy(b){return this.state.sortCriterion===b},showMoreValues(){let b=h().numberOfValues,w=m.numberOfValues,P=w-b%w,F=b+P;n(li({facetId:a,numberOfValues:F})),n(di({facetId:a,isFieldExpanded:!0})),n(we())},showLessValues(){let b=m.numberOfValues,w=Math.max(b,C());n(li({facetId:a,numberOfValues:w})),n(di({facetId:a,isFieldExpanded:!1})),n(we())},enable(){n(Qt(a))},disable(){n(tt(a))},get state(){let b=h(),w=x(),P=A(),F=y(),k;typeof b.sortCriteria=="object"?k=b.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":k=b.sortCriteria;let T=w?w.values:[],D=T.some(V=>V.state!=="idle"),G=w?w.moreValuesAvailable:!1,L=b.resultsMustMatch;return{label:w?.label,facetId:a,tabs:i,values:T,sortCriterion:k,resultsMustMatch:L,isLoading:P,hasActiveValues:D,canShowMoreValues:G,canShowLessValues:R(),enabled:F}}}}function YB(e){return e.addReducers({facetSet:Ir,facetOptions:wt,configuration:pe,facetSearchSet:Ic}),!0}d();c();l();u();function rh(e,t){let{dispatch:r}=e,{options:n,select:o,exclude:a,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f}=t,{facetId:m}=n,h=()=>"state"in e?e.state.facetSearchSet[m]:e[Zg].facetSearchSet[m];r(pg(n));let x=Ec(e,{options:n,getFacetSearch:h,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...x,select(A){r(pi({facetId:m,value:A})),o(A)},exclude(A){r(fi({facetId:m,value:A})),a(A)},singleSelect(A){r(rt(m)),r(pi({facetId:m,value:A})),o(A)},singleExclude(A){r(rt(m)),r(fi({facetId:m,value:A})),a(A)},get state(){let{values:A}=x.state;return{...x.state,values:A.map(({count:y,displayValue:C,rawValue:R})=>({count:y,displayValue:C,rawValue:R}))}}}}d();c();l();u();var NT=new ye({facetId:vn,field:xn,tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),filterFacetCount:An,injectionDepth:Cn,numberOfValues:Hr,sortCriteria:new U({constrainTo:th}),resultsMustMatch:new U({constrainTo:Tc}),facetSearch:fc,allowedValues:ug,hasBreadcrumbs:NI,customSort:lg});function _T(e,t){if(!JB(e))throw K;let{dispatch:r}=e,n=OT(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},NT),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return rh(e,{options:{facetId:o(),...m},select:h=>{r(we()),r(z({legacy:it({facetId:o(),facetValue:h.rawValue}),next:ht()}))},exclude:h=>{r(we()),r(z({legacy:pr({facetId:o(),facetValue:h.rawValue}),next:io()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:qn})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(z({legacy:$g(o(),m),next:Hg(m)}))},toggleExclude(m){n.toggleExclude(m),r(z({legacy:dT(o(),m),next:pT(m)}))},deselectAll(){n.deselectAll(),r(z({legacy:bt(o()),next:Bt()}))},sortBy(m){n.sortBy(m),r(z({legacy:Fn({facetId:o(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(br({legacy:gc(o())}))},showLessValues(){n.showLessValues(),r(br({legacy:hc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function JB(e){return e.addReducers({facetSet:Ir,configuration:pe,facetSearchSet:Ic,search:me}),!0}d();c();l();u();d();c();l();u();var nh=e=>e.state==="selected",Ox=e=>e.state==="excluded",oh=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return nh(t)?zr(n):it(n)},ah=e=>nh(e)?so():ht(),DT=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Ox(t)?ao(n):pr(n)};d();c();l();u();d();c();l();u();d();c();l();u();var ih=I("rangeFacet/executeToggleSelect",e=>O(e,hi(e.selection))),sh=I("rangeFacet/executeToggleExclude",e=>O(e,hi(e.selection)));var qT={facetId:Se,selection:new X({values:gi})},MT=xe("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,qT),t(In(e)),t(ih(e)),t(we())}),VT=xe("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,qT),t(Tn(e)),t(sh(e)),t(we())});d();c();l();u();function ch(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function uh(e,t){let{facetId:r,getRequest:n}=t,o=oe(e),a=e.dispatch,i=()=>sn(e.state,r);return{...o,isValueSelected:nh,isValueExcluded:Ox,deselectAll(){a(rt(r)),a(we())},sortBy(p){a(Sc({facetId:r,criterion:p})),a(we())},isSortedBy(p){return this.state.sortCriterion===p},enable(){a(Qt(r))},disable(){a(tt(r))},get state(){let p=n(),f=jr(e.state,r),m=p.sortCriteria,h=p.resultsMustMatch,x=f?f.values:[],A=Zr(e.state),y=i(),C=x.some(b=>b.state!=="idle"),R=f?.domain;return{facetId:r,values:x,sortCriterion:m,resultsMustMatch:h,hasActiveValues:C,isLoading:A,enabled:y,domain:R}}}}d();c();l();u();d();c();l();u();var lh=["idle","selected","excluded"];d();c();l();u();var dh=["ascending","descending"],ph=["even","equiprobable"];var XB={start:new U,end:new U,endInclusive:new le,state:new U({constrainTo:lh})},ZB=new ye({facetId:vn,field:xn,tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),generateAutomaticRanges:cg,filterFacetCount:An,injectionDepth:Cn,numberOfValues:Hr,currentValues:new ie({each:new X({values:XB})}),sortCriteria:new U({constrainTo:dh}),rangeAlgorithm:new U({constrainTo:ph})});function fh(e,t){Ge(e,ZB,t,"buildDateFacet"),gg(t)}function jT(e,t){if(!e1(e))throw K;ch(t.options,"buildDateFacet");let r=e.dispatch,n=Gt(e,t.options),o=t.options.tabs??{},a=Yt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};fh(e,i),r(En(i));let p=uh(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(MT({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(rt(n)),this.toggleSelect(f)},toggleExclude:f=>r(VT({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(rt(n)),this.toggleExclude(f)},get state(){return p.state}}}function e1(e){return e.addReducers({configuration:pe,search:me,dateFacetSet:kn,facetOptions:wt}),!0}function LT(e,t){let r=jT(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(z({legacy:bt(o()),next:Bt()}))},sortBy(a){r.sortBy(a),n(z({legacy:Fn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(z({legacy:oh(o(),a),next:ah(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(z({legacy:DT(o(),a)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function UT(e,t){if(!t1(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Gt(e,t.options),i=t.options.tabs??{},p=Yt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};fh(e,f),n(En(f));let m=()=>sn(e.state,a);return{...r,clear:()=>{n(co({facetId:a,values:[]})),n(we())},setRange:h=>{let x={...h,state:"selected",numberOfResults:0,endInclusive:!0},A=co({facetId:a,values:[x]});return A.error?!1:(n(A),n(we()),!0)},enable(){n(Qt(a))},disable(){n(tt(a))},get state(){let h=Zr(o()),x=m(),A=QI(o(),a),y=A.length?A[0]:void 0;return{facetId:a,isLoading:h,range:y,enabled:x}}}}function t1(e){return e.addReducers({dateFacetSet:kn,facetOptions:wt,configuration:pe,search:me}),!0}function QT(e,t){if(!r1(e))throw K;let r=UT(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(z({legacy:bt(o()),next:Bt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(z({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:ht()})),i},get state(){return{...r.state}}}}function r1(e){return e.addReducers({dateFacetSet:kn,configuration:pe,search:me}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var BT={facetId:Se,selection:new X({values:mi})},GT=xe("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,BT),t(Nn(e)),t(ih(e)),t(we())}),zLe=xe("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,BT),t(_n(e)),t(sh(e)),t(we())});d();c();l();u();var n1={start:new re,end:new re,endInclusive:new le,state:new U({constrainTo:lh})},o1=new ye({facetId:vn,tabs:new X({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),field:xn,generateAutomaticRanges:cg,filterFacetCount:An,injectionDepth:Cn,numberOfValues:Hr,currentValues:new ie({each:new X({values:n1})}),sortCriteria:new U({constrainTo:dh}),resultsMustMatch:new U({constrainTo:Tc}),rangeAlgorithm:new U({constrainTo:ph})});function mh(e,t){Ge(e,o1,t,"buildNumericFacet"),Ig(t)}d();c();l();u();function Pc(e){return{endInclusive:!1,state:"idle",...e}}function $T(e,t){if(!a1(e))throw K;ch(t.options,"buildNumericFacet");let r=e.dispatch,n=Gt(e,t.options),o=t.options.tabs??{},a=Yt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};mh(e,i),r(On(i));let p=uh(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(GT({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(rt(n)),this.toggleSelect(f)},get state(){return p.state}}}function a1(e){return e.addReducers({numericFacetSet:Tr,facetOptions:wt,configuration:pe,search:me}),!0}function HT(e,t){if(!i1(e))throw K;let r=$T(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(z({legacy:bt(o()),next:Bt()}))},sortBy(a){r.sortBy(a),n(z({legacy:Fn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(z({legacy:oh(o(),a),next:ah(a)}))},get state(){return{...r.state}}}}function i1(e){return e.addReducers({numericFacetSet:Tr,configuration:pe,search:me}),!0}d();c();l();u();d();c();l();u();function zT(e,t){if(!s1(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Gt(e,t.options),i=t.options.tabs??{},p=Yt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};mh(e,f),n(On(f));let m=()=>sn(e.state,a);return{...r,clear:()=>{n(uo({facetId:a,values:[]})),n(we())},setRange:h=>{let x={...h,state:"selected",numberOfResults:0,endInclusive:!0},A=uo({facetId:a,values:[x]});return A.error?!1:(n(A),n(we()),!0)},enable(){n(Qt(a))},disable(){n(tt(a))},get state(){let h=Zr(o()),x=m(),A=zI(o(),a),y=A.length?A[0]:void 0;return{facetId:a,isLoading:h,range:y,enabled:x}}}}function s1(e){return e.addReducers({numericFacetSet:Tr,facetOptions:wt,configuration:pe,search:me}),!0}function WT(e,t){if(!c1(e))throw K;let r=zT(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(z({legacy:bt(o()),next:Bt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(z({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:ht()})),i},get state(){return{...r.state}}}}function c1(e){return e.addReducers({numericFacetSet:Tr,configuration:pe,search:me}),!0}d();c();l();u();function KT(e,t){if(!u1(e))throw K;let{facetSearch:r,...n}=t.options.facet,o=Gt(e,n);e.dispatch(hn({...Vl,...n,facetId:o}));let a=eh(e,{options:{...r,facetId:o},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:qn,select:p=>{e.dispatch(we()),e.dispatch(z({legacy:it({facetId:o,facetValue:p.rawValue}),next:ht()}))},isForFieldSuggestions:!0});return{...oe(e),...a,updateText:p=>{a.updateText(p),a.search()},get state(){return a.state}}}function u1(e){return e.addReducers({categoryFacetSet:Sn,configuration:pe,categoryFacetSearchSet:Fc,search:me}),!0}d();c();l();u();function YT(e,t){if(!l1(e))throw K;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Gt(e,o);e.dispatch(bn({...jl,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=rh(e,{options:{...r,facetId:a},select:f=>{e.dispatch(we()),e.dispatch(z({legacy:it({facetId:a,facetValue:f.rawValue}),next:ht()}))},exclude:f=>{e.dispatch(we()),e.dispatch(z({legacy:pr({facetId:a,facetValue:f.rawValue}),next:io()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:qn});return{...oe(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function l1(e){return e.addReducers({facetSet:Ir,configuration:pe,facetSearchSet:Ic,search:me}),!0}d();c();l();u();d();c();l();u();var Nx={collectionField:new U({emptyAllowed:!1,required:!1}),parentField:new U({emptyAllowed:!1,required:!1}),childField:new U({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new re({min:0,required:!1})},Jo=I("folding/register",e=>O(e,Nx)),Xo=xe("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let a=t(),i=a.configuration.analytics.analyticsMode==="legacy"?yield Eo(a):xs(a,o),p=yield n.search({...i,q:d1(a),enableQuerySyntax:!0,cq:`@${a.folding.fields.collection}="${e}"`,filterField:a.folding.fields.collection,childField:a.folding.fields.parent,parentField:a.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return vt(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:a.folding.collections[e].result}});return function(_x168,_x169){return _ref74.apply(this,arguments)}}());function d1(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var p1=e=>J("analytics/folding/showMore",(t,r)=>(Xt(e),t.makeShowMoreFoldedResults(ft(e,r),Ke(e)))),f1=()=>J("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),JT={logShowMoreFoldedResults:p1,logShowLessFoldedResults:f1};d();c();l();u();d();c();l();u();d();c();l();u();var gh=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function m1(e,t){return e.raw[t.collection]}function _x(e,t){return e.raw[t.parent]}function Gl(e,t){let r=e.raw[t.child];return cd(r)?r[0]:r}function g1(e,t){return(e||t)!==void 0&&e===t}function ZT(e,t,r,n=[]){let o=Gl(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=Gl(a,r)===Gl(e,r);return _x(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:ZT(i,t,r,[...n,o])}}):[]}function h1(e,t){return e.find(r=>{let n=_x(r,t)===void 0,o=g1(_x(r,t),Gl(r,t));return n||o})}function eP(e){return e.parentResult?eP(e.parentResult):e}function y1(e,t,r,n){let o=hp(e),i={...(n??h1(o,t)??eP(e)),searchUid:r},p=ZT(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function hh(e,t,r,n){let o={};return e.forEach(a=>{let i=m1(a,t);i&&(!Gl(a,t)&&!a.parentResult||(o[i]=y1(a,t,r,n)))}),o}function XT(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var yh=ae(gh(),e=>e.addCase(z.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?hh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Lt.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?hh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Cr.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...hh(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Jo,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Xo.pending,(t,{meta:r})=>{let n=r.arg;XT(t,n).isLoadingMoreResults=!0}).addCase(Xo.rejected,(t,{meta:r})=>{let n=r.arg;XT(t,n).isLoadingMoreResults=!1}).addCase(Xo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=hh(n,t.fields,a,o);if(!i||!i[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=i[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var $l={id:W},kc=I("querySuggest/register",e=>O(e,{...$l,count:new re({min:0})})),tP=I("querySuggest/unregister",e=>O(e,$l)),Mn=I("querySuggest/selectSuggestion",e=>O(e,{...$l,expression:Qe})),Zo=I("querySuggest/clear",e=>O(e,$l)),ea=xe("querySuggest/fetch",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,$l);let i=e.id,p=yield S1(i,t(),a),f=yield n.querySuggest(p);return vt(f)?r(f.error):{id:i,q:p.q,...f.success}});return function(_x170,_x171){return _ref75.apply(this,arguments)}}()),S1=/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??lt(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Jt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield As(t.configuration.analytics):Lr(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function S1(_x172,_x173,_x174){return _ref76.apply(this,arguments)}}();var Ft=ae(pt(),e=>e.addCase(jt,(t,r)=>({...t,...r.payload})).addCase(vr,(t,r)=>{t.q=r.payload}).addCase(Mn,(t,r)=>{t.q=r.payload.expression}).addCase(_e.fulfilled,(t,r)=>r.payload?.query??t).addCase(De,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var ta=I("fields/registerFieldsToInclude",e=>O(e,xd)),Oc=I("fields/fetchall/enable"),Ai=I("fields/fetchall/disable"),Nc=xe("fields/fetchDescription",/*#__PURE__*/function(){var _ref77=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:a,environment:i,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:a,organizationId:p,url:f??lt(p,i)});return vt(m)?n(m.error):m.success.fields});return function(_x175,_x176){return _ref77.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Sh=["author","language","urihash","objecttype","collection","source","permanentid"],Dx=[...Sh,"date","filetype","parents"],rP=[...Dx,"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"],nP=()=>({fieldsToInclude:Sh,fetchAllFields:!1,fieldsDescription:[]});var ra=ae(nP(),e=>e.addCase(ta,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Oc,t=>{t.fetchAllFields=!0}).addCase(Ai,t=>{t.fetchAllFields=!1}).addCase(Nc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Jo,(t,{payload:r})=>{let n=gh().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function _c(e){if(!v1(e))throw K;let t=oe(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:ll(n)}}}}function v1(e){return e.addReducers({search:me}),!0}var x1=new ye({fieldsToInclude:new ie({required:!1,each:new U({required:!0,emptyAllowed:!1})})});function vh(e,t){if(!A1(e))throw K;let r=oe(e),n=_c(e),{dispatch:o}=e,a=()=>e.state,i=Ge(e,x1,t?.options,"buildCoreResultList");i.fieldsToInclude&&o(ta(i.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,h=5,x=200,A=!1;return{...r,get state(){let C=a();return{...n.state,results:C.search.results,moreResultsAvailable:p(),searchResponseId:C.search.searchResponseId}},fetchMoreResults:function(){var _ref78=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<x){if(m++,m>=h){f=Date.now(),!A&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${h} times, with little delay. Please verify the conditions under which the function is called.`),A=!0;return}}else m=0;A=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref78.apply(this,arguments)}}()}}function A1(e){return e.addReducers({search:me,configuration:pe,fields:ra}),!0}var C1=new ye(Nx);function oP(e,t,r){if(!b1(e))throw K;let n=vh(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?Ge(e,C1,t.options.folding,"buildFoldedResultList"):{};return o(Jo({...i})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return qx(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return qx(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=a();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function b1(e){return e.addReducers({search:me,configuration:bf,folding:yh,query:Ft}),!0}function qx(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=qx(n.children,t);if(o)return o}}return null}function aP(e,t={}){let r=oP(e,{...t,loadCollectionActionCreator:Xo,fetchMoreResultsActionCreator:Cr},JT);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Dc(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var qc=ae(Cv(),e=>e.addCase(qs,(t,{payload:r})=>{t.isVisible=r}).addCase(yl,(t,{payload:r})=>{t.isEnabled=r}).addCase(pf,(t,{payload:r})=>{t.id=r.id}).addCase(ka,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.answer||(t.answer=""),t.answer+=r.textDelta,delete t.error}).addCase(Oa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Dc([...t.citations,...r.citations]),delete t.error}).addCase(Na,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===by},t.citations=[],delete t.answer}).addCase(cf,t=>{t.liked=!0,t.disliked=!1}).addCase(uf,t=>{t.liked=!1,t.disliked=!0}).addCase(lf,t=>{t.feedbackModalOpen=!0}).addCase(ff,t=>{t.feedbackModalOpen=!1}).addCase(Vs,t=>{t.feedbackSubmitted=!0}).addCase(dr,t=>({...Cv(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase(cn,(t,{payload:r})=>{t.isLoading=r}).addCase(Pa,(t,{payload:r})=>{t.isStreaming=r}).addCase(_a,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(mf,(t,{payload:r})=>{t.responseFormat=r}).addCase(hf,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(vl,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(Sl,t=>{t.expanded=!0}).addCase(df,t=>{t.expanded=!1}).addCase(gf,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(Da,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(wv,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Ms,(t,{payload:r})=>{t.answerId=r}).addCase(sf,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(yf,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(Sf,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}));d();c();l();u();function Mc(e,t,r={}){if(!w1(e))throw K;let{dispatch:n}=e,o=oe(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(qs(i));let p=r.initialState?.responseFormat;p&&n(mf(p));let f=r.fieldsToIncludeInCitations;return f&&n(hf(f)),r.initialState?.expanded&&n(Sl()),{...o,get state(){let h=a().generatedAnswer;return{...h,error:ii(h.error)}},like(){this.state.liked||(n(cf()),n(t.logLikeGeneratedAnswer(this.state.answerId)))},dislike(){this.state.disliked||(n(uf()),n(t.logDislikeGeneratedAnswer(this.state.answerId)))},openFeedbackModal(){n(lf())},closeFeedbackModal(){n(ff())},sendFeedback(h){n(t.logGeneratedAnswerFeedback(h)),n(Vs())},logCitationClick(h,x){n(t.logOpenGeneratedAnswerSource(h,x))},logCitationHover(h,x,A){n(t.logHoverCitation(h,x,A))},show(){this.state.isVisible||(n(qs(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(qs(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(Sl()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(df()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(yl(!0))},disable(){this.state.isEnabled&&n(yl(!1))},logCopyToClipboard(h){n(t.logCopyGeneratedAnswer(h))},retry(){}}}function w1(e){return e.addReducers({generatedAnswer:qc}),!0}var $t={engines:{},setAbortControllerRef:(e,t)=>{$t.engines[t].abortController=e},getIsStreamInProgress:e=>!$t.engines[e].abortController||$t.engines[e].abortController?.signal.aborted?($t.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,a=r.generatedAnswer.id;if($t.engines[a].lastRequestId!==n){if($t.engines[a].lastRequestId=n,$t.engines[a].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(dr())}if(!$t.getIsStreamInProgress(a)&&o&&o!==$t.engines[a].lastStreamId){if($t.engines[a].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(rF({setAbortControllerRef:p=>$t.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function iP(e,t,r={}){if(!R1(e))throw K;let n=Mc(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!$t.engines[e.state.generatedAnswer.id]&&($t.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let i=mo("genQA-",12);e.dispatch(pf({id:i}))}$t.engines[e.state.generatedAnswer.id]||($t.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),$t.subscribeToSearchRequests(e);let a=i=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in i;return{...n,get state(){return o().generatedAnswer},retry(){a(e)&&e.dispatch(z({legacy:t.logRetryGeneratedAnswer()}))}}}function R1(e){return e.addReducers({generatedAnswer:qc}),!0}d();c();l();u();d();c();l();u();var sP=Af.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var xh=e=>e==="yes"?!0:e==="no"?!1:null,F1=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:xh(t.correctTopic),documented:xh(t.documented),hallucinationFree:xh(t.hallucinationFree),readable:xh(t.readable)},helpful:t.helpful,question:r}),E1=e=>{let t="",r=()=>{let n=e.state,o=LR(n),a=o.requestId;a!==t&&(t=a,e.dispatch(dr()),o.q?.length>0&&e.dispatch(vf()))};e.subscribe(r)};function cP(e,t,r={}){if(!I1(e))throw K;$o(e.state.configuration.analytics.analyticsMode);let{...n}=Mc(e,t,r),o=()=>e.state;return e.dispatch(gf(r.answerConfigurationId)),E1(e),{...n,get state(){let a=Rv(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:Dc(a?.citations??[]),error:ii({message:a?.error?.message,code:a?.error?.code}),isLoading:a?.isLoading??!1,isStreaming:a?.isStreaming??!1,answerContentFormat:a?.contentFormat??"text/plain",isAnswerGenerated:a?.generated??!1,cannotAnswer:i.cannotAnswer||a?.generated===!1&&!a?.isLoading&&!a?.isStreaming}},retry(){let a=tf(o());e.dispatch(xf(a??Ia))},reset(){e.dispatch(dr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=F1({query:o().query.q,feedback:a,answerApiState:Rv(e.state).data});e.dispatch(sP.endpoints.post.initiate(i)),e.dispatch(Vs())})()}}}function I1(e){return e.addReducers({[qa.reducerPath]:qa.reducer,query:Ft}),!0}d();c();l();u();d();c();l();u();var Mx=class extends _m{requestInit(t){let{q:r,analytics:n,conversationId:o,conversationToken:a,accessToken:i}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${i}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify({q:r,analytics:n,conversationId:o,conversationToken:a}),signal:this.abortController.signal}}},uP=(e,t,r)=>new Mx({url:`${Dm(e,t,r)}/follow-up`});d();c();l();u();var lP=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Nl(t)),e(Qm({answerId:t,isLoading:!1})),e(Bm({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:n})=>{e(Xm({name:n.stepName,startedAt:n.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:n})=>{e(Zm({name:n.stepName,finishedAt:n.timestamp??Date.now(),answerId:t}))},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(Gm({textDelta:n.delta,answerId:t}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(Um({contentFormat:a.contentFormat,answerId:t}));return}case"citations":{e($m({citations:a.citations,answerId:t}));return}}},onRunErrorEvent:({input:n,event:o})=>{t||(t=n.runId,e(Nl(n.runId)));let a=eg(o.code);e(zm({message:o.message,code:a,answerId:t})),t=""},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(Hm({cannotAnswer:!o,answerId:t})),e(Jn(o,t,a,n.threadId)),e(Mo(t)),t="",r=!1}}};d();c();l();u();d();c();l();u();function dP(){return{conversationId:"",conversationToken:"",isEnabled:!1,followUpAnswers:[]}}var pP=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function Vx(e){return e.followUpAnswers.find(t=>t.isActive)}function Pr(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var fP=ae(dP(),e=>e.addCase(qm,(t,{payload:r})=>{t.isEnabled=r}).addCase(Mm,(t,{payload:r})=>{t.conversationId=r}).addCase(Vm,(t,{payload:r})=>{t.conversationToken=r}).addCase(jm,t=>{t.conversationToken=""}).addCase(Lm,(t,{payload:r})=>{let n=Vx(t);n&&(n.isActive=!1),t.followUpAnswers.push(pP(r.question))}).addCase(Nl,(t,{payload:r})=>{let n=Vx(t);!n||n.answerId||(n.answerId=r)}).addCase(Um,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(Qm,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(Bm,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(Gm,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase($m,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.citations=Dc([...n.citations,...r.citations]),delete n.error)}).addCase(Hm,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(zm,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(Wm,(t,{payload:r})=>{let n=Vx(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(Km,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(Ym,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(WE,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(Xm,(t,{payload:r})=>{let n=Pr(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(Zm,(t,{payload:r})=>{let n=Pr(t,r.answerId);if(!n)return;let o=n.generationSteps.findLast(a=>a.name===r.name&&a.status==="active");o&&(o.status="completed",o.finishedAt=r.finishedAt)}).addCase(Jm,t=>{t.followUpAnswers=[],t.conversationId="",t.conversationToken="",t.isEnabled=!1}));function mP(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!T1(e))throw K;let n=Mc(e,t,r),o=()=>e.state;e.dispatch(bp(r.agentId));let a=cp(o()),i=sp(o()),p=up(o()),f=uP(r.agentId,a,p),m=lP(e.dispatch),h=tg();return{...n,get state(){let x=o().followUpAnswers,A=o().generatedAnswer;return{...A,error:ii(A.error),followUpAnswers:{...x,followUpAnswers:x.followUpAnswers.map(y=>({...y,error:ii(y.error)}))}}},retry(){h.run(e.state,e.dispatch,()=>e.navigatorContext)},like(x){if(!x||this.state.answerId===x){n.like();return}let A=this.state.followUpAnswers.followUpAnswers.find(y=>y.answerId===x);if(!A){console.warn(`No follow-up answer found with ID ${x}. Cannot like.`);return}A.liked||(e.dispatch(Km({answerId:x})),e.dispatch(t.logLikeGeneratedAnswer(x)))},dislike(x){if(!x||this.state.answerId===x){n.dislike();return}let A=this.state.followUpAnswers.followUpAnswers.find(y=>y.answerId===x);if(!A){console.warn(`No follow-up answer found with ID ${x}. Cannot dislike.`);return}A.disliked||(e.dispatch(Ym({answerId:x})),e.dispatch(t.logDislikeGeneratedAnswer(x)))},logCopyToClipboard(x){if(!x||this.state.answerId===x){n.logCopyToClipboard();return}e.dispatch(t.logCopyGeneratedAnswer(x))},logCitationClick(x,A){if(!A||this.state.answerId===A){n.logCitationClick(x);return}e.dispatch(t.logOpenGeneratedAnswerSource(x,A))},logCitationHover(x,A,y){if(!y||this.state.answerId===y){n.logCitationHover(x,A);return}e.dispatch(t.logHoverCitation(x,A,y))},askFollowUp(x){var _this37=this;return _asyncToGenerator(function*(){if(!x||x.trim()==="")return;let A=_this37.state.followUpAnswers.conversationId,y=_this37.state.followUpAnswers.conversationToken;if(!A){console.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}if(!y){console.warn("Missing conversationToken when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}f.abortRun(),e.dispatch(Lm({question:x}));let C=Lr(o().configuration.analytics,e.navigatorContext);try{yield f.runAgent({forwardedProps:{q:x,analytics:C.analytics,conversationId:A,conversationToken:y,accessToken:i}},m)}catch(R){e.dispatch(Wm({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",R)}})()}}}function T1(e){return e.addReducers({followUpAnswers:fP}),!0}function gP(e,t={}){$o(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=mP(e,Ns,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=cP(e,Ns,t):r=iP(e,Ns,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function or(e,t,r){if(!P1(e))throw K;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:dd(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function P1(e){return e.addReducers({configuration:pe}),!0}function hP(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id,r.options.answerId)))};return or(e,r,()=>{o()})}function yP(e,t){return hP(e,Ns,t)}d();c();l();u();d();c();l();u();var Vc=ae(Mp(),e=>{e.addCase(z.fulfilled,k1).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function k1(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var Ah=()=>J("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),Ch=()=>J("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),bh=()=>J("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var SP=e=>({past:[],present:e,future:[]}),O1=e=>{let{past:t,present:r,future:n}=e;if(!r||t.length===0)return e;let o=t[t.length-1];return{past:t.slice(0,t.length-1),present:o,future:[r,...n]}},N1=e=>{let{past:t,present:r,future:n}=e;if(!r||n.length===0)return e;let o=n[0],a=n.slice(1);return{past:[...t,r],present:o,future:a}},_1=e=>{let{action:t,state:r,reducer:n}=e,{past:o,present:a}=r,i=n(a,t);return a?a===i?r:{past:[...o,a].slice(-10),present:i,future:[]}:SP(i)},vP=e=>{let{actionTypes:t,reducer:r}=e,n=SP();return(o=n,a)=>{switch(a.type){case t.undo:return O1(o);case t.redo:return N1(o);case t.snapshot:return _1({state:o,reducer:r,action:a});default:return o}}};d();c();l();u();d();c();l();u();var{getOwnPropertyNames:D1,getOwnPropertySymbols:q1}=Object,{hasOwnProperty:M1}=Object.prototype;function jx(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function wh(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);let{cache:a}=o,i=a.get(r),p=a.get(n);if(i&&p)return i===n&&p===r;a.set(r,n),a.set(n,r);let f=e(r,n,o);return a.delete(r),a.delete(n),f}}function xP(e){return D1(e).concat(q1(e))}var V1=Object.hasOwn||((e,t)=>M1.call(e,t)),j1="__v",L1="__o",U1="_owner",{getOwnPropertyDescriptor:AP,keys:CP}=Object,Ci=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function Q1(e,t){return e===t}function B1(e,t){return e.byteLength===t.byteLength&&Rh(new Uint8Array(e),new Uint8Array(t))}function G1(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function $1(e,t){return e.byteLength===t.byteLength&&Rh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function H1(e,t){return Ci(e.getTime(),t.getTime())}function z1(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function bP(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.entries(),i,p,f=0;for(;(i=a.next())&&!i.done;){let m=t.entries(),h=!1,x=0;for(;(p=m.next())&&!p.done;){if(o[x]){x++;continue}let A=i.value,y=p.value;if(r.equals(A[0],y[0],f,x,e,t,r)&&r.equals(A[1],y[1],A[0],y[0],e,t,r)){h=o[x]=!0;break}x++}if(!h)return!1;f++}return!0}function W1(e,t,r){let n=CP(e),o=n.length;if(CP(t).length!==o)return!1;for(;o-->0;)if(!RP(e,t,r,n[o]))return!1;return!0}function Hl(e,t,r){let n=xP(e),o=n.length;if(xP(t).length!==o)return!1;let a,i,p;for(;o-->0;)if(a=n[o],!RP(e,t,r,a)||(i=AP(e,a),p=AP(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function K1(e,t){return Ci(e.valueOf(),t.valueOf())}function Y1(e,t){return e.source===t.source&&e.flags===t.flags}function wP(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.values(),i,p;for(;(i=a.next())&&!i.done;){let f=t.values(),m=!1,h=0;for(;(p=f.next())&&!p.done;){if(!o[h]&&r.equals(i.value,p.value,i.value,p.value,e,t,r)){m=o[h]=!0;break}h++}if(!m)return!1}return!0}function Rh(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function J1(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function RP(e,t,r,n){return(n===U1||n===L1||n===j1)&&(e.$$typeof||t.$$typeof)?!0:V1(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var X1=Object.prototype.toString;function Z1(e){let t=nG(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:o,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:p,areRegExpsEqual:f,areSetsEqual:m,getUnsupportedCustomComparator:h}=e;return function(A,y,C){if(A===y)return!0;if(A==null||y==null)return!1;let R=typeof A;if(R!==typeof y)return!1;if(R!=="object")return R==="number"||R==="bigint"?i(A,y,C):R==="function"?o(A,y,C):!1;let b=A.constructor;if(b!==y.constructor)return!1;if(b===Object)return p(A,y,C);if(b===Array)return r(A,y,C);if(b===Date)return n(A,y,C);if(b===RegExp)return f(A,y,C);if(b===Map)return a(A,y,C);if(b===Set)return m(A,y,C);if(b===Promise)return!1;if(Array.isArray(A))return r(A,y,C);let w=X1.call(A),P=t[w];if(P)return P(A,y,C);let F=h&&h(A,y,C,w);return F?F(A,y,C):!1}}function eG({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:B1,areArraysEqual:r?Hl:G1,areDataViewsEqual:$1,areDatesEqual:H1,areErrorsEqual:z1,areFunctionsEqual:Q1,areMapsEqual:r?jx(bP,Hl):bP,areNumbersEqual:Ci,areObjectsEqual:r?Hl:W1,arePrimitiveWrappersEqual:K1,areRegExpsEqual:Y1,areSetsEqual:r?jx(wP,Hl):wP,areTypedArraysEqual:r?jx(Rh,Hl):Rh,areUrlsEqual:J1,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=wh(n.areArraysEqual),a=wh(n.areMapsEqual),i=wh(n.areObjectsEqual),p=wh(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:p})}return n}function tG(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function rG({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(p,f){let{cache:m=e?new WeakMap:void 0,meta:h}=r();return t(p,f,{cache:m,equals:n,meta:h,strict:o})};if(e)return function(p,f){return t(p,f,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};let a={cache:void 0,equals:n,meta:void 0,strict:o};return function(p,f){return t(p,f,a)}}function nG({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:a,areMapsEqual:i,areNumbersEqual:p,areObjectsEqual:f,arePrimitiveWrappersEqual:m,areRegExpsEqual:h,areSetsEqual:x,areTypedArraysEqual:A,areUrlsEqual:y}){return{"[object Arguments]":f,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":p,"[object BigInt64Array]":A,"[object BigUint64Array]":A,"[object Boolean]":m,"[object DataView]":r,"[object Date]":n,"[object Error]":o,"[object Float16Array]":A,"[object Float32Array]":A,"[object Float64Array]":A,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":A,"[object Int16Array]":A,"[object Int32Array]":A,"[object Map]":i,"[object Number]":m,"[object Object]":(C,R,b)=>typeof C.then!="function"&&typeof R.then!="function"&&f(C,R,b),"[object RegExp]":h,"[object Set]":x,"[object String]":m,"[object URL]":y,"[object Uint8Array]":A,"[object Uint8ClampedArray]":A,"[object Uint16Array]":A,"[object Uint32Array]":A}}var vHe=Vn(),xHe=Vn({strict:!0}),AHe=Vn({circular:!0}),CHe=Vn({circular:!0,strict:!0}),bHe=Vn({createInternalComparator:()=>Ci}),wHe=Vn({strict:!0,createInternalComparator:()=>Ci}),RHe=Vn({circular:!0,createInternalComparator:()=>Ci}),FHe=Vn({circular:!0,createInternalComparator:()=>Ci,strict:!0});function Vn(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=eG(e),i=Z1(a),p=r?r(i):tG(i);return rG({circular:t,comparator:i,createState:n,equals:p,strict:o})}function bi(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function oG(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>zl(r,n))!==-1)}var zl=Vn({createCustomConfig:e=>({...e,areArraysEqual:oG})});var aG=ae($w(),e=>{e.addCase(lr,(t,r)=>iG(t,r.payload)?void 0:r.payload)}),iG=(e,t)=>sG(e.context,t.context)&&cG(e.dictionaryFieldContext,t.dictionaryFieldContext)&&gG(e.advancedSearchQueries,t.advancedSearchQueries)&&uG(e.tabSet,t.tabSet)&&lG(e.staticFilterSet,t.staticFilterSet)&&Lx(e.facetSet,t.facetSet)&&Lx(e.dateFacetSet,t.dateFacetSet)&&Lx(e.numericFacetSet,t.numericFacetSet)&&pG(e.automaticFacetSet,t.automaticFacetSet)&&dG(e.categoryFacetSet,t.categoryFacetSet)&&fG(e.pagination,t.pagination)&&mG(e.query,t.query)&&hG(e,t)&&yG(e.pipeline,t.pipeline)&&SG(e.searchHub,t.searchHub)&&vG(e.facetOrder,t.facetOrder)&&xG(e.debug,t.debug),sG=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),cG=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),uG=(e,t)=>{let r=FP(e),n=FP(t);return r?.id===n?.id},FP=e=>Object.values(e).find(t=>t.isActive),lG=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=EP(e[r]),a=EP(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},EP=e=>e.values.filter(t=>t.state!=="idle"),Lx=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=e[r].request.currentValues.filter(i=>i.state!=="idle"),a=n.request.currentValues.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},dG=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=cr(e[r]?.request.currentValues).map(({value:i})=>i),a=cr(n?.request.currentValues).map(({value:i})=>i);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},pG=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let o=e.set[r].response.values.filter(i=>i.state!=="idle"),a=n.response.values.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},fG=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,mG=(e,t)=>JSON.stringify(e)===JSON.stringify(t),gG=(e,t)=>JSON.stringify(e)===JSON.stringify(t),hG=(e,t)=>e.sortCriteria===t.sortCriteria,yG=(e,t)=>e===t,SG=(e,t)=>e===t,vG=(e,t)=>bi(e,t),xG=(e,t)=>e===t,Fh=vP({actionTypes:{redo:LS.type,undo:jS.type,snapshot:lr.type},reducer:aG});function IP(e){if(!AG(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=a=>a.past.length>0&&!de(a.present);return{...t,subscribe(a){a();let i=JSON.stringify(n().history.present),p=()=>{let f=JSON.stringify(n().history.present);i!==f&&(i=f,a())};return e.subscribe(()=>p())},get state(){return n().history},back(){var _this38=this;return _asyncToGenerator(function*(){o(_this38.state)&&(yield r(ol()),r(z({legacy:Ch()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(Rp()),r(z({legacy:Ah()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r(ol()),r(z({legacy:bh()})))})()}}}function AG(e){return e.addReducers({history:Fh,configuration:pe,facetOrder:Vc}),!0}d();c();l();u();d();c();l();u();var CG={results:new ie({required:!0,each:new X({values:yp})}),maxLength:new re({required:!0,min:1,default:10})},jc=I("recentResults/registerRecentResults",e=>O(e,CG)),kr=I("recentResults/pushRecentResult",e=>(Xt(e),{payload:e})),Lc=I("recentResults/clearRecentResults");function TP(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Rw(t.options.result)))};return or(e,t,()=>{n(),e.dispatch(kr(t.options.result))})}d();c();l();u();d();c();l();u();function Eh(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var PP=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},kP=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},OP=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{Eh(o)&&delete t[r].cache[n]})},NP=(e,t,r)=>{for(let o in t)for(let a in t[o].cache)t[o].cache[a].isActive=!1;if(!Ux(e,t)){bG(e,t,r);return}let n=Ux(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},_P=(e,t,r)=>{let{id:n,q:o,searchUid:a,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[o]={...Ux(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},DP=(e,t)=>{let{id:r,q:n,error:o}=e;t[r].cache[n].error=o||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1},Ux=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},bG=(e,t,r)=>{let{q:n,id:o}=e;t[o].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}};d();c();l();u();function qP(){return{}}var Ih=ae(qP(),e=>{e.addCase(fs,(t,r)=>{PP(r.payload,t)}),e.addCase(nn,(t,r)=>{kP(r.payload,t)}),e.addCase(ms,(t,r)=>{OP(r.payload,t)}),e.addCase(Es.pending,(t,r)=>{NP(r.meta.arg,t,{results:[]})}),e.addCase(Es.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));_P({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(Es.rejected,(t,r)=>{DP(r.meta.arg,t)})});d();c();l();u();var wG={searchBoxId:st,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re},MP=new ye(wG);function VP(e,t){if(!RG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={searchBoxId:t.options.searchBoxId||mo("instant-results-"),cacheTimeout:t.options.cacheTimeout||6e4,maxResultsPerQuery:t.options.maxResultsPerQuery};Ge(e,MP,a,"buildInstantResults");let i=a.searchBoxId;n(fs({id:i}));let p=()=>o().instantResults[i],f=x=>p().cache[x],m=()=>p().q,h=()=>{let x=f(m());return x?x.isLoading?[]:x.results:[]};return{...r,updateQuery(x){if(!x)return;let A=f(x);(!A||!A.isLoading&&(A.error||Eh(A)))&&n(Es({id:i,q:x,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(nn({id:i,q:x}))},clearExpired(){n(ms({id:i}))},get state(){let x=m(),A=f(x);return{q:x,isLoading:A?.isLoading||!1,error:A?.error||null,results:h()}}}}function RG(e){return e.addReducers({instantResults:Ih}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Or=ae(xr(),e=>{e.addCase(gs,(t,r)=>{let n=Qx(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Wl(n,o)}).addCase(hs,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(yt,t=>{t.firstResult=0}).addCase(ys,(t,r)=>{let n=r.payload;t.firstResult=Wl(n,t.numberOfResults)}).addCase(on,(t,r)=>{let n=r.payload;t.firstResult=Wl(n,t.numberOfResults)}).addCase(vs,t=>{let r=Qx(t),n=Math.max(r-1,1);t.firstResult=Wl(n,t.numberOfResults)}).addCase(Ss,t=>{let r=Qx(t),n=FG(t),o=Math.min(r+1,n);t.firstResult=Wl(o,t.numberOfResults)}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(De,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(z.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Lt.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(rt,t=>{Ht(t)}).addCase(Tn,t=>{Ht(t)}).addCase(Rn,t=>{Ht(t)}).addCase(_n,t=>{Ht(t)}).addCase(fi,t=>{Ht(t)}).addCase(wn,t=>{Ht(t)}).addCase(yn,t=>{Ht(t)}).addCase(zo,t=>{Ht(t)}).addCase(uc,t=>{Ht(t)}).addCase(In,t=>{Ht(t)}).addCase(Nn,t=>{Ht(t)}).addCase(mt,t=>{Ht(t)}).addCase(co,t=>{Ht(t)}).addCase(uo,t=>{Ht(t)}).addCase(pi,t=>{Ht(t)}).addCase(gn,t=>{Ht(t)})});function Ht(e){e.firstResult=xr().firstResult}function Qx(e){let{firstResult:t,numberOfResults:r}=e;return Bx(t,r)}function FG(e){let{totalCountFiltered:t,numberOfResults:r}=e;return Gx(t,r)}function Wl(e,t){return(e-1)*t}function Bx(e,t){return Math.round(e/t)+1}function Gx(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function EG(e){return e.pagination.firstResult}function jP(e){return e.pagination.numberOfResults}function IG(e){return e.pagination.totalCountFiltered}var fo=e=>{let t=EG(e),r=jP(e);return Bx(t,r)},Kl=e=>{let t=IG(e),r=jP(e);return Gx(t,r)},Th=(e,t)=>{let r=fo(e),n=Kl(e),o=TG(r,t);return o=PG(o),o=kG(o,n),OG(o)};function TG(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,a=e-n,i=e+o;return{start:a,end:i}}function PG(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function kG(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function OG(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Qc=()=>J("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||xr().numberOfResults})),Bc=()=>J("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:fo(t)})),Ph=()=>J("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:fo(t)})),kh=()=>J("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:fo(t)})),Gc=()=>({actionCause:"browseResults"});d();c();l();u();var NG=new ye({numberOfPages:new re({default:5,min:0})}),_G=new ye({page:new re({min:1})});function LP(e,t={}){if(!DG(e))throw K;let r=oe(e),{dispatch:n}=e,o=Ge(e,NG,t.options,"buildPager"),i=dt(e,_G,t.initialState,"buildPager").page;i&&n(ys(i));let p=()=>fo(e.state),f=()=>{let{numberOfPages:h}=o;return Th(e.state,h)},m=()=>Kl(e.state);return{...r,get state(){let h=p(),x=m(),A=h>1&&x>0,y=h<x;return{currentPage:h,currentPages:f(),maxPage:x,hasPreviousPage:A,hasNextPage:y}},selectPage(h){n(on(h))},nextPage(){n(Ss())},previousPage(){n(vs())},isCurrentPage(h){return h===this.state.currentPage}}}function DG(e){return e.addReducers({configuration:pe,pagination:Or}),!0}function UP(e,t={}){let{dispatch:r}=e,n=LP(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(Lt({legacy:Bc(),next:Gc()}))},nextPage(){n.nextPage(),r(Lt({legacy:Ph(),next:Gc()}))},previousPage(){n.previousPage(),r(Lt({legacy:kh(),next:Gc()}))}}}d();c();l();u();d();c();l();u();function QP(e){if(!qG(e))throw K;let t=oe(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function qG(e){return e.addReducers({search:me}),!0}function BP(e){return QP(e)}d();c();l();u();d();c();l();u();function GP(e){if(!MG(e))throw K;let t=oe(e),r=_c(e),n=()=>e.state,o=()=>{let a=n().search.duration/1e3;return Math.round((a+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function MG(e){return e.addReducers({search:me,pagination:Or}),!0}function $P(e){return GP(e)}d();c();l();u();d();c();l();u();d();c();l();u();function Oh(_x177,_x178){return _Oh.apply(this,arguments)}function _Oh(){_Oh=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??lt(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Oh.apply(this,arguments)}var wi=xe("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield Oh(o,e),i=yield t.apiClient.html(a);return vt(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x179,_x180){return _ref79.apply(this,arguments)}}()),$c=I("resultPreview/next"),Hc=I("resultPreview/previous"),zc=I("resultPreview/prepare",e=>O(e,{results:new ie({required:!0})})),HP=2048,Wc=xe("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=oC(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>HP&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${HP} characters.`),{contentURL:o}});return function(_x181,_x182){return _ref80.apply(this,arguments)}}());d();c();l();u();var zP=e=>J({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Xt(e);let n=ft(e,r),o=Ke(e);return t.makeDocumentQuickview(n,o)},analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=ft(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});d();c();l();u();d();c();l();u();d();c();l();u();function $x(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var Hx=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=$x();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},zx=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),Nh=ae($x(),e=>{e.addCase(wi.pending,t=>{t.isLoading=!0}).addCase(wi.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(z.fulfilled,(t,r)=>{Hx(t),t.resultsWithPreview=zx(r.payload.response.results)}).addCase(Cr.fulfilled,(t,r)=>{Hx(t),t.resultsWithPreview=t.resultsWithPreview.concat(zx(r.payload.response.results))}).addCase(Lt.fulfilled,Hx).addCase(zc,(t,r)=>{t.resultsWithPreview=zx(r.payload.results)}).addCase($c,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(Hc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Wc.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function WP(e,t,r,n,o){if(!VG(e))throw K;let{dispatch:a}=e,i=()=>e.state,p=oe(e),{result:f,maximumPreviewSize:m}=t.options,h=()=>{let{resultsWithPreview:A,position:y}=i().resultPreview;return A[y]},x=A=>{a(Wc({uniqueId:A,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(wi({uniqueId:A,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){x(f.uniqueId)},next(){a($c()),x(h())},previous(){a(Hc()),x(h())},get state(){let A=i(),y=f.hasHtmlVersion,C=A.resultPreview,R=f.uniqueId===C.uniqueId?C.content:"",b=C.isLoading,w=C.contentURL,P=h();return{content:R,resultHasPreview:y,isLoading:b,contentURL:w,currentResultUniqueId:P}}}}function VG(e){return e.addReducers({configuration:pe,resultPreview:Nh}),!0}function KP(e,t){if(!jG(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=WP(e,t,Oh,"/html",()=>{e.dispatch(zP(t.options.result))});return r(zc({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function jG(e){return e.addReducers({search:me}),!0}d();c();l();u();d();c();l();u();var YP=()=>J("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),JP=()=>J("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var LG={queries:new ie({required:!0,each:new U({emptyAllowed:!1})}),maxLength:new re({required:!0,min:1,default:10})},Ri=I("recentQueries/registerRecentQueries",e=>O(e,LG)),Kc=I("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function XP(){return{queries:[],maxLength:10}}var _h=ae(XP(),e=>{e.addCase(Ri,UG).addCase(Kc,QG).addCase(z.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||BG(n,t)})});function UG(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function QG(e){e.queries=[]}function BG(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var GG={queries:[]},$G={maxLength:10,clearFilters:!0},HG=new ye({queries:new ie({required:!0})}),zG=new ye({maxLength:new re({required:!0,min:1}),clearFilters:new le});function WG(e,t){Ge(e,zG,t?.options,"buildRecentQueriesList"),dt(e,HG,t?.initialState,"buildRecentQueriesList")}function ZP(e,t){if(!KG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...$G,...t?.options},i={...GG,...t?.initialState};WG(e,{options:a,initialState:i});let p={queries:i.queries,maxLength:a.maxLength};return n(Ri(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(Kc())},updateRecentQueries(f){let m=new ie({required:!0,each:new U({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(Ri({queries:f,maxLength:a.maxLength}))},executeRecentQuery(f){let m=new re({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let h={q:this.state.queries[f],clearFilters:a.clearFilters};sd(e.state.query?.enableQuerySyntax)&&(h.enableQuerySyntax=e.state.query.enableQuerySyntax),n(Fs(h))}}}function KG(e){return e.addReducers({search:me,recentQueries:_h,query:Ft}),!0}function ek(e,t){let r=ZP(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(YP()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(z({legacy:JP(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var tk=e=>J("analytics/recentResults/click",(t,r)=>(Xt(e),t.makeRecentResultClick(ft(e,r),Ke(e)))),rk=()=>J("analytics/recentResults/clear",e=>e.makeClearRecentResults());function nk(e,t){return or(e,t,()=>e.dispatch(tk(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function ok(){return{results:[],maxLength:10}}var Dh=ae(ok(),e=>{e.addCase(jc,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Lc,t=>{t.results=[]}).addCase(kr,(t,r)=>{let n=r.payload;t.results=t.results.filter(a=>a.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});var YG={initialState:{results:[]},options:{maxLength:10}},JG=new ye({results:new ie({required:!0})}),XG=new ye({maxLength:new re({required:!0,min:1})});function ZG(e,t){Ge(e,XG,t?.options,"buildRecentResultsList"),dt(e,JG,t?.initialState,"buildRecentResultsList")}function ak(e,t){if(!e$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...YG,...t};ZG(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n(jc(i)),{...r,get state(){return o().recentResults},clear(){n(rk()),n(Lc())}}}function e$(e){return e.addReducers({recentResults:Dh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var sk=e=>{let t=/Document weights:\n((?:.)*?)\n+/g,r=/Terms weights:\n((?:.|\n)*)\n+/g,n=/Total weight: ([0-9]+)/g;if(!e)return null;let o=t.exec(e),a=r.exec(e),i=n.exec(e),p=r$(e),f=ck(o?o[1]:null),m=t$(a),h=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:h,qreWeights:p}},ck=e=>{let t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,r=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(!e)return null;let n=e.match(t);if(!n)return null;let o={};for(let a of n){let i=a.match(r);if(i){let p=i[1],f=i[2];o[p]=Number(f)}}return o},ik=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},t$=e=>{let t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,r=/([^:]+): ([0-9]+), ([0-9]+); /g;if(!e||!e[1])return null;let n=ik(e[1],t);if(!n)return null;let o={};for(let a of n){let i=ik(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=ck(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},r$=e=>{let t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,r=t.exec(e),n=[];for(;r;)n.push({expression:r[1],score:parseInt(r[2],10)}),r=t.exec(e);return n};function uk(e){return e.search.response.results.map(r=>{let n=sk(r.rankingInfo);return{result:r,ranking:n}})}var n$=new ye({enabled:new le({default:!1})});function lk(e,t={}){if(!o$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;dt(e,n$,t.initialState,"buildRelevanceInspector").enabled&&n(Ro());let i=p=>{e.logger.warn(`Flag [ ${p} ] is now activated. This should *not* be used in any production environment as it negatively impact performance.`)};return{...r,get state(){let p=o(),f=p.debug;if(!p.debug)return{isEnabled:f};let{executionReport:m,basicExpression:h,advancedExpression:x,constantExpression:A,userIdentities:y,rankingExpressions:C}=p.search.response,{fieldsDescription:R,fetchAllFields:b}=p.fields;return{isEnabled:f,rankingInformation:uk(p),executionReport:m,expressions:{basicExpression:h,advancedExpression:x,constantExpression:A},userIdentities:y,rankingExpressions:C,fieldsDescription:R,fetchAllFields:b}},enable(){n(Ro()),i("debug")},disable(){n(cs()),n(Ai())},enableFetchAllFields(){n(Oc()),i("fetchAllFields")},disableFetchAllFields(){n(Ai())},fetchFieldsDescription(){!this.state.isEnabled&&n(Ro()),n(Nc()),i("fieldsDescription"),e.logger.warn(`For production environment, please specify the necessary fields either when instantiating a ResultList controller, or by dispatching a registerFieldsToInclude action.
|
|
45
|
+
For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function Ho(e){e==="next"&&console.warn(fB)}d();c();l();u();var QI=Vr(UI(),1);function BI(e){return(0,QI.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function GI(e,t){let r=kB(e),n=gr,o=OB(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function kB(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function OB(e){return e.preprocessRequest||hd}d();c();l();u();var Lx=(e,t,r,n,o,a)=>{let i=e[t];pe(i)||pe(o)||o!==i&&o!==n&&(a.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),a.warn(`To remove this warning, make sure that access token value [${i}] matches engine configuration value [${r}]`))},Ux=(e,t)=>!(pe(e)||t===e),Ml=e=>{let t=Nx(e);return t||!1},zI=(e,t)=>(Ux(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),$I=(e,t,r,n)=>(Lx(e,"searchHub",t.searchHub,Co(),r,n),zI(e,t)),WI=(e,t)=>(Ux(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),HI=(e,t,r,n)=>(Lx(e,"pipeline",t.pipeline,Kn(),r,n),WI(e,t)),KI=(e,t)=>(Ux(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),_B=(e,t,r,n)=>(Lx(e,"userDisplayName",t.configuration.analytics.userDisplayName,Us().analytics.userDisplayName,r,n),KI(e,t)),YI=e=>ae({},t=>{t.addCase(Ps,(r,n)=>{let o=Ml(r.configuration.accessToken);return o?$I(o,r,n.payload,e):r}).addCase(ds,(r,n)=>{let o=Ml(r.configuration.accessToken);return o?HI(o,r,n.payload,e):r}).addCase(rn,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:o}=n.payload;if(!o)return r;let a=Ml(o);return a?[WI,zI,KI].reduce((i,p)=>p(a,i),r):r}).addCase(vr,(r,n)=>{let o=Ml(r.configuration.accessToken);if(!o)return r;let a=$I(o,r,n.payload.searchHub,e);return HI(o,a,n.payload?.pipeline,e)}).addCase(Ro,(r,n)=>{let o=Ml(r.configuration.accessToken);return o?_B(o,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var XI={organizationId:W,accessToken:W,name:new U({required:!1,emptyAllowed:!1}),analytics:new J({options:{required:!1},values:{enabled:new de({required:!1}),originContext:new U({required:!1}),originLevel2:new U({required:!1}),originLevel3:new U({required:!1}),analyticsMode:new U({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new U({required:!1,url:!0}),trackingId:new U({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new U({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function JI(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var ZI=new Se({...XI,search:new J({options:{required:!1},values:{pipeline:new U({required:!1,emptyAllowed:!0}),searchHub:st,locale:st,timezone:st,authenticationProviders:new ie({required:!1,each:W}),proxyBaseUrl:new U({required:!1,url:!0})}})});function Qx(){return{...JI(),search:{searchHub:"default"}}}var NB={debug:ls,pipeline:ps,searchHub:ks,search:ge};function DB(e){let{search:t}=e,{proxyBaseUrl:r,pipeline:n,searchHub:o,timezone:a,locale:i,authenticationProviders:p}=t??{};return{proxyBaseUrl:r,pipeline:n,searchHub:o,timezone:a,locale:i,authenticationProviders:p}}function eT(e){let t=BI(e.loggerOptions),{configuration:r}=e;qB(r,t);let n=MB(r,t),o=VB(t),a={...GI(r,t),apiClient:n,streamingClient:o},i={...e,reducers:NB,crossReducer:YI(t)},p=OI(i,a),f=DB(r);return f&&p.dispatch(vr(f)),{...p,get state(){return p.state},executeFirstSearch(m=xp()){if(dl(p.state))return;let g=z({legacy:m,next:Lw()});p.dispatch(g)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:g,metadata:v}=m;if(dl(p.state))return;let C=v&&g==="omniboxFromLink",h=z({legacy:C?Cp(v):Ap(),next:C?Qw():Uw()});p.dispatch(h)}}}function qB(e,t){try{ZI.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function MB(e,t){let{search:r}=e;return new xd({logger:t,preprocessRequest:e.preprocessRequest||hd,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||FC,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||EC,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||IC})}function VB(e){return new gd({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var ui={value:W,numberOfResults:new re({min:0}),state:W};d();c();l();u();var ve=W;var QB=new re({min:1,default:8,required:!1}),BB=new re({min:1,max:20,default:5,required:!1}),GB={desiredCount:BB,numberOfValues:QB},ic=P("automaticFacet/setOptions",e=>O(e,GB)),sc=P("automaticFacet/deselectAll",e=>O(e,ve)),$B=W,hn=P("automaticFacet/toggleSelectValue",e=>O(e,{field:$B,selection:new J({values:ui})}));d();c();l();u();d();c();l();u();var HB={state:new Qe({required:!0}),numberOfResults:new re({required:!0,min:0}),value:new U({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:W}),moreValuesAvailable:new de({required:!1})};function Bx(e){e.children.forEach(t=>{Bx(t)}),gr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},HB)}var cc={facetId:ve,field:W,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),activeTab:new U({required:!1}),delimitingCharacter:new U({required:!1,emptyAllowed:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Qe({required:!1}),basePath:new ie({required:!1,each:W}),filterByBasePath:new de({required:!1})};var yn=P("categoryFacet/register",e=>O(e,cc)),Wo=P("categoryFacet/toggleSelectValue",e=>{try{return gr(e.facetId,W),Bx(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:Bn(t)}}}),Sn=P("categoryFacet/deselectAll",e=>O(e,cc.facetId)),li=P("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:cc.facetId,numberOfValues:cc.numberOfValues})),uc=P("categoryFacet/updateSortCriterion",e=>O(e,{facetId:cc.facetId,criterion:new Qe})),Sg=P("categoryFacet/updateBasePath",e=>O(e,{facetId:cc.facetId,basePath:new ie({each:W})}));d();c();l();u();var zB={categoryFacetId:ve,categoryFacetPath:new ie({required:!0,each:W})},WB=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},vg=e=>X("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,zB),t.makeBreadcrumbFacet(WB(r,e)))),tT=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var Fe=P("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new de({required:!1})})),Qt=P("facetOptions/facet/enable",e=>O(e,ve)),tt=P("facetOptions/facet/disable",e=>O(e,ve));d();c();l();u();var nr=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var Vl={facetId:ve,captions:new J({options:{required:!1}}),numberOfValues:new re({required:!1,min:1}),query:new U({required:!1,emptyAllowed:!0})};var KB={path:new ie({required:!0,each:W}),displayValue:Be,rawValue:Be,count:new re({required:!0,min:0})},lc=P("categoryFacet/selectSearchResult",e=>O(e,{facetId:ve,value:new J({values:KB})})),dc=P("categoryFacetSearch/register",e=>O(e,Vl));d();c();l();u();function pc(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function fc(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function xg(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function jl(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Ag(e,t,r){e.currentValues=YB(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function YB(e,t){if(!e.length)return[];let r=rT(e[0],t),n=r;for(let o of e.splice(1)){let a=rT(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function rT(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var vn=ae(Yi(),e=>{e.addCase(yn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=JB(n),p=i.numberOfValues;t[o]={request:i,initialNumberOfValues:p,tabs:a}}).addCase(qe.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(a=>{let i=t[a],p=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!nr(i.tabs,o)){p.currentValues.length&&Ag(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&Ag(p,m,i.initialNumberOfValues)})}).addCase(uc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(Sg,(t,r)=>{let{facetId:n,basePath:o}=r.payload,a=t[n]?.request;a&&(a.basePath=[...o])}).addCase(Wo,(t,r)=>{let{facetId:n,selection:o,retrieveCount:a}=r.payload,i=t[n]?.request;if(!i)return;let{path:p}=o,f=p.slice(0,p.length-1),m=XB(i,f,a);if(m.length){let v=m[0];v.retrieveChildren=!0,v.state="selected",v.previousState="idle",v.children=[];return}let g=oT(o.value,a);g.state="selected",g.previousState="idle",m.push(g),i.numberOfValues=1}).addCase(Sn,(t,r)=>{let n=r.payload;jl(t,n)}).addCase(ft,t=>{Object.keys(t).forEach(r=>jl(t,r))}).addCase(nn,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(li,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,a=t[n]?.request;if(a){if(!a.currentValues.length)return xg(a,o);ZB(t,r.payload)}}).addCase(lc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];Ag(a.request,i,a.initialNumberOfValues)}).addCase(wr.fulfilled,(t,r)=>{nT(t,r.payload.response.facets)}).addCase(z.fulfilled,(t,r)=>{nT(t,r.payload.response.facets)}).addCase(tt,(t,r)=>{jl(t,r.payload)}).addCase(ht,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!nr(a.tabs,n)&&jl(t,o)})})}),Ll={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function XB(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=oT(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function JB(e){return{...Ll,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function oT(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function nT(e,t){t.forEach(r=>{if(!e1(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=t1(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function ZB(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function e1(e,t){return t.facetId in e}function t1(e,t){let r=cr(e.currentValues),n=cr(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var xn=new U({regex:/^[a-zA-Z0-9-_]+$/}),An=new U({required:!0}),aT=new ie({each:new U}),iT=new U,sT=new de,Cn=new de,bn=new re({min:0}),zr=new re({min:1}),Cg=new de({required:!0}),r1=new J,n1=new U,o1={captions:r1,numberOfValues:zr,query:n1},mc=new J({values:o1}),bg=new J({options:{required:!1},values:{type:new U({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new U({emptyAllowed:!1,required:!0})})}}),cT=new de,wg=new ie({min:1,max:25,required:!1,each:new U({emptyAllowed:!1,required:!0})});var a1={facetId:ve,field:new U({required:!0,emptyAllowed:!0}),tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),activeTab:new U({required:!1}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Qe({required:!1}),resultsMustMatch:new Qe({required:!1}),allowedValues:bg,customSort:wg},wn=P("facet/register",e=>O(e,a1)),Rn=P("facet/toggleSelectValue",e=>O(e,{facetId:ve,selection:new J({values:ui})})),Fn=P("facet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new J({values:ui})})),rt=P("facet/deselectAll",e=>O(e,ve)),gc=P("facet/updateSortCriterion",e=>O(e,{facetId:ve,criterion:new Qe({required:!0})})),di=P("facet/updateNumberOfValues",e=>O(e,{facetId:ve,numberOfValues:new re({required:!0,min:1})})),pi=P("facet/updateIsFieldExpanded",e=>O(e,{facetId:ve,isFieldExpanded:new de({required:!0})})),ao=P("facet/updateFreezeCurrentValues",e=>O(e,{facetId:ve,freezeCurrentValues:new de({required:!0})}));d();c();l();u();var hc=e=>X("analytics/facet/showMore",(t,r)=>{O(e,ve);let n=es(e,ur(r));return t.makeFacetShowMore(n)}),yc=e=>X("analytics/facet/showLess",(t,r)=>{O(e,ve);let n=es(e,ur(r));return t.makeFacetShowLess(n)}),En=e=>X("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:ve,criterion:new Qe({required:!0})});let{facetId:n,criterion:o}=e,a=ur(r),p={...es(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),bt=e=>X("analytics/facet/reset",(t,r)=>{O(e,ve);let n=ur(r),o=es(e,n);return t.makeFacetClearAll(o)}),it=e=>X("analytics/facet/select",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=ur(r),o=ts(e,n);return t.makeFacetSelect(o)}),fr=e=>X("analytics/facet/exclude",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=ur(r),o=ts(e,n);return t.makeFacetExclude(o)}),Wr=e=>X("analytics/facet/deselect",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=ur(r),o=ts(e,n);return t.makeFacetDeselect(o)}),io=e=>X("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=ur(r),o=ts(e,n);return t.makeFacetUnexclude(o)}),Sc=e=>X("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=ts(e,ur(r));return t.makeBreadcrumbFacet(n)}),Bt=()=>({actionCause:"facetClearAll"}),gt=()=>({actionCause:"facetSelect"}),so=()=>({actionCause:"facetExclude"}),co=()=>({actionCause:"facetDeselect"}),uT=()=>({actionCause:"facetUnexclude"}),Rg=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var lT={facetId:ve,value:new J({values:{displayValue:Be,rawValue:Be,count:new re({required:!0,min:0})}})},Fg=P("facetSearch/register",e=>O(e,Vl)),Ko=P("facetSearch/update",e=>O(e,Vl)),fi=P("facetSearch/toggleSelectValue",e=>O(e,lT)),mi=P("facetSearch/toggleExcludeValue",e=>O(e,lT));var Tr=ae(Zi(),e=>{e.addCase(wn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=mw(i1(r.payload),o))}).addCase(qe.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(Me,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(i=>{let{request:p}=t[i],f=n[i]||[],m=o[i]||[],g=f.length+m.length,v=p.currentValues.filter(C=>!f.includes(C.value)&&!m.includes(C.value));p.currentValues=[...f.map(pT),...m.map(fT),...v.map(c1)],p.preventAutoSelect=g>0,p.numberOfValues=Math.max(g,p.numberOfValues)})}).addCase(Rn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){Eg(a,o);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",a.freezeCurrentValues=!0}).addCase(Fn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){Eg(a,o);return}let p=i.state==="excluded";i.previousState=i.state,i.state=p?"idle":"excluded",a.freezeCurrentValues=!0}).addCase(ao,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,a=t[n]?.request;a&&(a.freezeCurrentValues=o)}).addCase(rt,(t,r)=>{fc(t[r.payload]?.request)}).addCase(ft,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>fc(r))}).addCase(fs,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>fc(r))}).addCase(nn,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(gc,(t,r)=>{pc(t,r.payload)}).addCase(di,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;xg(t[n]?.request,o)}).addCase(pi,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,a=t[n]?.request;a&&(a.isFieldExpanded=o)}).addCase(z.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>dT(t[o.facetId]?.request,o))}).addCase(wr.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>dT(t[o.facetId]?.request,o))}).addCase(fi,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="selected";return}let m=pT(i);Eg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(mi,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="excluded";return}let m=fT(i);Eg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(tt,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];fc(n)}).addCase(ht,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!nr(a.tabs,n)&&fc(a.request)})})});function Eg(e,t){let{currentValues:r}=e,n=r.findIndex(a=>a.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function dT(e,t){e&&(e.currentValues=t.values.map(s1),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var Ul={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function i1(e){return{...Ul,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function s1(e){let{value:t,state:r}=e;return{value:t,state:r}}function pT(e){return{value:e,state:"selected"}}function fT(e){return{value:e,state:"excluded"}}function c1(e){return{...e,state:"idle"}}d();c();l();u();var Ig=()=>X("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function Yo(e){let t=mT(e.start,e),r=mT(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function mT(e,t){let{dateFormat:r}=t;return nR(e)?(Po(e),eR(e)):typeof e=="string"&&sn(e)?(Po(e),e):(kp(e,r),sl(wa(e,r)))}d();c();l();u();var vc=P("rangeFacet/updateSortCriterion",e=>O(e,{facetId:ve,criterion:new Qe({required:!0})}));d();c();l();u();var gi={state:W,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new de({required:!0}),numberOfResults:new re({required:!0,min:0})},hi={start:W,end:W,endInclusive:new de({required:!0}),state:W,numberOfResults:new re({required:!0,min:0})},yi=e=>({facetId:ve,selection:typeof e.start=="string"?new J({values:hi}):new J({values:gi})});var u1={start:W,end:W,endInclusive:new de({required:!0}),state:W},l1={facetId:ve,field:W,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),activeTab:new U({required:!1}),currentValues:new ie({required:!1,each:new J({values:u1})}),generateAutomaticRanges:new de({required:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Qe({required:!1}),rangeAlgorithm:new Qe({required:!1})};function gT(e){return sn(e)?ul(e):e}function Tg(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Yo(t);if(wa(gT(r)).isAfter(wa(gT(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var In=P("dateFacet/register",e=>{try{return gr(e,l1),Tg(e),{payload:e,error:null}}catch(t){return{payload:e,error:Bn(t)}}}),Tn=P("dateFacet/toggleSelectValue",e=>O(e,{facetId:ve,selection:new J({values:hi})})),Pn=P("dateFacet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new J({values:hi})})),uo=P("dateFacet/updateFacetValues",e=>{try{return gr(e,{facetId:ve,values:new ie({each:new J({values:hi})})}),Tg({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Bn(t)}}}),Pg=vc,kg=rt;d();c();l();u();d();c();l();u();var Og=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,a=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:a,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},_g=()=>({actionCause:"breadcrumbFacet"});var Ql=e=>X("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,yi(e.selection));let n=Og(r,e);return t.makeBreadcrumbFacet(n)}),Gx=_g;d();c();l();u();function d1(e,t){return!!t&&t.facetId in e.dateFacetSet}var hT=(e,t)=>{let r=Lr(e,t);if(d1(e,r))return r},yT=(e,t)=>(hT(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),ST=(e,t)=>(hT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var Dg={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function qg(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=vT(r);r.numberOfValues=o,e[n]=t}function Mg(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=vT(n))}function Vg(e,t,r){let n=e[t]?.request;if(!n)return;let o=Ng(n.currentValues,r);if(!o)return;let a=o.state==="selected";o.previousState=o.state,o.state=a?"idle":"selected",n.preventAutoSelect=!0}function jg(e,t,r){let n=e[t]?.request;if(!n)return;let o=Ng(n.currentValues,r);if(!o)return;let a=o.state==="excluded";o.previousState=o.state,o.state=a?"idle":"excluded",n.preventAutoSelect=!0}function kn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function Lg(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(Ng(o,p)&&(p.state="selected"),p));let a=o.filter(p=>!Ng(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function Ug(e,t,r){t.forEach(n=>{let o=n.facetId,a=e[o]?.request;if(!a)return;let i=r(n.values);a.currentValues=i,a.preventAutoSelect=!1})}function Ng(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function vT(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var On=ae(Xi(),e=>{e.addCase(In,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=p1(n);qg(t,pw(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.df||{};Lg(t,n)}).addCase(Tn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Vg(t,n,o)}).addCase(Pn,(t,r)=>{let{facetId:n,selection:o}=r.payload;jg(t,n,o)}).addCase(uo,(t,r)=>{let{facetId:n,values:o}=r.payload;Mg(t,n,o)}).addCase(kg,(t,r)=>{kn(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{kn(t,r)})}).addCase(Pg,(t,r)=>{pc(t,r.payload)}).addCase(z.fulfilled,(t,r)=>{let n=r.payload.response.facets;Ug(t,n,f1)}).addCase(tt,(t,r)=>{kn(t,r.payload)}).addCase(ht,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!nr(a.tabs,n)&&kn(t,o)})})});function p1(e){return{...Dg,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function f1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var m1={state:W,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new de({required:!0})},g1={facetId:ve,field:W,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),activeTab:new U({required:!1}),currentValues:new ie({required:!1,each:new J({values:m1})}),generateAutomaticRanges:new de({required:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Qe({required:!1}),rangeAlgorithm:new Qe({required:!1})};function Qg(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 _n=P("numericFacet/register",e=>{try{return O(e,g1),Qg(e),{payload:e,error:null}}catch(t){return{payload:e,error:Bn(t)}}}),Nn=P("numericFacet/toggleSelectValue",e=>O(e,{facetId:ve,selection:new J({values:gi})})),Dn=P("numericFacet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new J({values:gi})})),lo=P("numericFacet/updateFacetValues",e=>{try{return gr(e,{facetId:ve,values:new ie({each:new J({values:gi})})}),Qg({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Bn(t)}}}),Bg=vc,Gg=rt;d();c();l();u();var Bl=e=>X("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,yi(e.selection));let n=Og(r,e);return t.makeBreadcrumbFacet(n)}),$x=_g;d();c();l();u();function h1(e,t){return!!t&&t.facetId in e.numericFacetSet}var xT=(e,t)=>{let r=Lr(e,t);if(h1(e,r))return r},AT=(e,t)=>(xT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),CT=(e,t)=>(xT(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var Pr=ae(Ji(),e=>{e.addCase(_n,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=y1(n);qg(t,fw(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.nf||{};Lg(t,n)}).addCase(Nn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Vg(t,n,o)}).addCase(Dn,(t,r)=>{let{facetId:n,selection:o}=r.payload;jg(t,n,o)}).addCase(lo,(t,r)=>{let{facetId:n,values:o}=r.payload;Mg(t,n,o)}).addCase(Gg,(t,r)=>{kn(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{kn(t,r)})}).addCase(Bg,(t,r)=>{pc(t,r.payload)}).addCase(z.fulfilled,(t,r)=>{let n=r.payload.response.facets;Ug(t,n,S1)}).addCase(tt,(t,r)=>{kn(t,r.payload)}).addCase(ht,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!nr(a.tabs,n)&&kn(t,o)})})});function y1(e){return{...Dg,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function S1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var Si=W,$g=new J({options:{required:!0},values:{caption:Be,expression:Be,state:new U({constrainTo:["idle","selected","excluded"]})}}),Hg=new ie({required:!0,each:$g});var xc=P("staticFilter/register",e=>O(e,{id:Si,values:Hg})),po=P("staticFilter/toggleSelect",e=>O(e,{id:Si,value:$g})),fo=P("staticFilter/toggleExclude",e=>O(e,{id:Si,value:$g})),Xo=P("staticFilter/deselectAllFilterValues",e=>O(e,Si)),zg=e=>X("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),Ac=e=>X("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),Wg=e=>X("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e));d();c();l();u();d();c();l();u();function oe(e){let t,r=new Map,n=()=>r.size===0,o=a=>{try{let i=JSON.stringify(a),p=t!==i;return t=i,p}catch(i){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",i),!0}};return{subscribe(a){a();let i=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(i,a),()=>{r.delete(i),n()&&p?.()}},get state(){return{}}}}var Kg=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function bT(e){let t=oe(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(ft())},deselectBreadcrumb(n){n.deselect()}}}function wT(e){if(!v1(e))throw K;let t=bT(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let w={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:R,selection:E})=>{r(Rn({facetId:R,selection:E})),r(ao({facetId:R,freezeCurrentValues:!1})),r(z({legacy:Sc({facetId:R,facetValue:E.value}),next:Rg()}))},executeToggleExclude:({facetId:R,selection:E})=>{r(Fn({facetId:R,selection:E})),r(ao({facetId:R,freezeCurrentValues:!1})),r(z({legacy:Sc({facetId:R,facetValue:E.value}),next:Rg()}))},facetValuesSelector:uw};return Kg(w)},a=()=>{let w={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:R=>{r(Nn(R)),r(z({legacy:Bl(R),next:$x()}))},executeToggleExclude:R=>{r(Dn(R)),r(z({legacy:Bl(R),next:$x()}))},facetValuesSelector:AT};return Kg(w)},i=()=>{let w={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:R=>{r(Tn(R)),r(z({legacy:Ql(R),next:Gx()}))},executeToggleExclude:R=>{r(Pn(R)),r(z({legacy:Ql(R),next:Gx()}))},facetValuesSelector:ST};return Kg(w)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(w=>w.path.length),f=w=>{let R=dw(n(),w);return{facetId:w,field:n().categoryFacetSet[w].request.field,path:R,deselect:()=>{r(Sn(w)),r(z({legacy:vg({categoryFacetPath:R.map(E=>E.value),categoryFacetId:w}),next:tT()}))}}},m=()=>{let w=n().staticFilterSet??{};return Object.values(w).map(g)},g=w=>{let{id:R,values:E}=w,I=E.filter(k=>k.state!=="idle").map(k=>v(R,k));return{id:R,values:I}},v=(w,R)=>({value:R,deselect:()=>{let{caption:E,expression:I}=R;R.state==="selected"?r(po({id:w,value:R})):R.state==="excluded"&&r(fo({id:w,value:R})),r(z({legacy:Ac({staticFilterId:w,staticFilterValue:{caption:E,expression:I}})}))}}),C=()=>{let w=n().automaticFacetSet?.set??{};return Object.values(w).map(R=>h(R.response)).filter(R=>R.values.length>0)},h=w=>{let{field:R,label:E}=w,I=w.values.filter(k=>k.state!=="idle").map(k=>A(R,k));return{facetId:R,field:R,label:E,values:I}},A=(w,R)=>({value:R,deselect:()=>{r(hn({field:w,selection:R})),r(z({legacy:Sc({facetId:w,facetValue:R.value}),next:Rg()}))}});function b(){return!![...o(),...a(),...i(),...p(),...m(),...C()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:a(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:C(),hasBreadcrumbs:b()}},deselectAll:()=>{t.deselectAll(),r(z({legacy:Ig(),next:{actionCause:"breadcrumbResetAll"}}))}}}function v1(e){return e.addReducers({configuration:fe,search:ge,facetSet:Tr,numericFacetSet:Pr,dateFacetSet:On,categoryFacetSet:vn}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var x1=new ie({each:W,required:!0}),RT=(e,t)=>(O(e,W),Oi(t)?O(t,W):O(t,x1),{payload:{contextKey:e,contextValue:t}}),vi=P("context/set",e=>{for(let[t,r]of Object.entries(e))RT(t,r);return{payload:e}}),xi=P("context/add",e=>RT(e.contextKey,e.contextValue)),Ai=P("context/remove",e=>O(e,W));d();c();l();u();var Yg=ae(qp(),e=>{e.addCase(vi,(t,r)=>{t.contextValues=r.payload}).addCase(xi,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Ai,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();var A1=["caseId","caseNumber"],C1={caseId:"caseContext",caseNumber:"caseContext"},Gl=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${C1[t]} to set this value.}`)}};function Hx(e){return A1.includes(e)}var b1=new Se({values:new J({options:{required:!1}})});function FT(e,t={}){if(!F1(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=lt(e,b1,t.initialState,"buildContext");return a.values&&n(vi(a.values)),{...r,get state(){return{values:o().context.contextValues}},set(i){n(vi(i))},...(o().configuration.analytics.analyticsMode==="legacy"?w1(n):R1(n))}}var w1=e=>({add(t,r){e(xi({contextKey:t,contextValue:r}))},remove(t){e(Ai(t))}}),R1=e=>({add(t,r){if(Hx(t))throw new Gl(t);e(xi({contextKey:t,contextValue:r}))},remove(t){if(Hx(t))throw new Gl(t);e(Ai(t))}});function F1(e){return e.addReducers({context:Yg}),!0}function ET(e,t){return FT(e,t)}d();c();l();u();d();c();l();u();var wt=ae(Vp(),e=>{e.addCase(Fe,(t,r)=>({...t,...r.payload})).addCase(z.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(z.rejected,t=>{t.freezeFacetOrder=!1}).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(yn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Xg(o,t,n)}).addCase(wn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Xg(o,t,n)}).addCase(In,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Xg(o,t,n)}).addCase(_n,(t,r)=>{let{facetId:n,tabs:o}=r.payload;Xg(o,t,n)}).addCase(Qt,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(tt,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(Me,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=mv()),t.facets[n].enabled=!0})})});function Xg(e,t,r){let n={...mv(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var Cc=ae(Qp(),e=>{e.addCase(Ls,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(ht,(t,r)=>{let n=r.payload;IT(t,n)}).addCase(cs,(t,r)=>{let n=r.payload;IT(t,n)}).addCase(qe.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(Me,(t,r)=>{let n=r.payload.tab;pe(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function IT(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function Jg(e){if(!E1(e))throw K;let t=oe(e),r=Je(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function E1(e){return e.addReducers({tabSet:Cc}),!0}function TT(e,t){if(!I1(e))throw K;let r=Jg(e),n=A=>e.state.facetOptions.facets[A]?.enabled??!1,o=A=>e.state.facetSet?.[A]?.request?.currentValues??e.state.categoryFacetSet?.[A]?.request?.currentValues??e.state.numericFacetSet?.[A]?.request?.currentValues??e.state.dateFacetSet?.[A]?.request?.currentValues??null,a=A=>A in e.state.facetOptions.facets,i=A=>e.state.facetOptions.facets[A]?.tabs,p=()=>Ni({isFacetRegistered:a(t.facetId),parentFacets:t.conditions.map(({parentFacetId:A})=>a(A)?{enabled:n(A),values:o(A)}:null),isTabEnabled:nr(i(t.facetId),r.state.activeTab)}),f=()=>{let A=p();return A===C?!1:(C=A,!0)},m=()=>t.conditions.length>0?t.conditions.some(A=>{if(!n(A.parentFacetId))return!1;let b=o(A.parentFacetId);return b===null?!1:A.condition(b)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([A,b])=>b.request.freezeCurrentValues&&e.dispatch(ao({facetId:A,freezeCurrentValues:!1})))},v=()=>{if(!a(t.facetId))return;let A=n(t.facetId),b=m(),w=nr(i(t.facetId),r.state.activeTab),R=b&&w;A!==R&&(e.dispatch(R?Qt(t.facetId):tt(t.facetId)),g())},C=p(),h=e.subscribe(()=>{f()&&v()});return v(),{stopWatching(){h()}}}function I1(e){return e.addReducers({facetOptions:wt}),!0}d();c();l();u();d();c();l();u();var bc=P("dictionaryFieldContext/set",e=>{let t=new J({options:{required:!0}}),r=O(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:Be}),a=O(n,o).error;return a?{payload:e,error:a}:{payload:e}}),wc=P("dictionaryFieldContext/add",e=>{let t=new J({options:{required:!0},values:{field:Be,key:Be}});return O(e,t)}),Rc=P("dictionaryFieldContext/remove",e=>O(e,Be));d();c();l();u();var Zg=ae(Mp(),e=>{e.addCase(bc,(t,r)=>{t.contextValues=r.payload}).addCase(wc,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Rc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function PT(e){if(!T1(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(bc(o))},add(o,a){r(wc({field:o,key:a}))},remove(o){r(Rc(o))}}}function T1(e){return e.addReducers({dictionaryFieldContext:Zg}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var kT=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var eh=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),OT=()=>({correctedQuery:"",corrections:[],originalQuery:""});function _T(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:eh(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var NT=(e,t)=>{let r={...OT(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var th=ae(_T(),e=>{e.addCase(ws,t=>{t.enableDidYouMean=!0}).addCase(_p,t=>{t.enableDidYouMean=!1}).addCase(Np,t=>{t.automaticallyCorrectQuery=!0}).addCase(Rs,t=>{t.automaticallyCorrectQuery=!1}).addCase(z.pending,t=>{t.queryCorrection=eh(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(z.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let a=o?.[0]?o[0]:eh();t.queryCorrection=a}t.queryCorrectionMode==="next"&&NT(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(xr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(Ra,(t,r)=>{t.queryCorrectionMode=r.payload})});function DT(e,t={}){if(!P1(e))throw K;let r=oe(e),{dispatch:n}=e;n(ws()),t.options?.automaticallyCorrectQuery===!1&&n(Rs()),n(Ra(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>kT(o().didYouMean);return{...r,get state(){let i=o();return{originalQuery:i.didYouMean.originalQuery,wasCorrectedTo:i.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:i.didYouMean.wasAutomaticallyCorrected,queryCorrection:i.didYouMean.queryCorrection,hasQueryCorrection:a()}},applyCorrection(){n(xr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(Ra(i))}}}function P1(e){return e.addReducers({configuration:fe,didYouMean:th}),!0}function qT(e,t={}){let r=DT(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(z({legacy:Dp(),next:cR()}))}}}d();c();l();u();d();c();l();u();function MT(e){if(!k1(e))throw K;let t=oe(e),r=()=>e.state;return{...t,sort(n){return ll(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function k1(e){return e.addReducers({search:ge,facetOptions:wt}),!0}function VT(e){return MT(e)}d();c();l();u();d();c();l();u();var rh=ae(Wi(),e=>{e.addCase(z.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(ic,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(hn,(t,r)=>{let{field:n,selection:o}=r.payload,a=t.set[n]?.response;if(!a)return;let i=a.values.find(f=>f.value===o.value);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(sc,(t,r)=>{let n=r.payload,o=t.set[n]?.response;if(o)for(let a of o.values)a.state="idle"}).addCase(Me,(t,r)=>{let n=r.payload.af??{},o=Object.keys(t.set);for(let a in n)if(!t.set[a]){let i=O1(a),p=n[a].map(f=>jT(f));i.values.push(...p),t.set[a]={response:i}}for(let a of o)if(!(a in n)){let i=t.set[a]?.response;for(let p of i.values)p.state="idle"}for(let a in n){let i=t.set[a]?.response;if(i){let p=i.values,f=new Set(n[a]);for(let m of p)f.has(m.value)?(m.state="selected",f.delete(m.value)):m.state="idle";for(let m of f)i.values.push(jT(m))}}}).addCase(qe.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.automaticFacetSet.set).length!==0)return r.payload.automaticFacetSet}).addCase(ft,t=>{Object.values(t.set).forEach(({response:r})=>{r.values.forEach(n=>{n.state="idle"})})})});function O1(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function jT(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var nh=e=>e.state==="selected",oh=e=>e.state==="excluded",ah=(e,t)=>{let r={facetId:e,facetValue:t.value};return nh(t)?Wr(r):it(r)},ih=e=>nh(e)?co():gt(),LT=(e,t)=>{let r={facetId:e,facetValue:t.value};return oh(t)?io(r):fr(r)},UT=e=>oh(e)?uT():so();function QT(e,t){let{dispatch:r}=e,n=oe(e),{field:o}=t;return{...n,toggleSelect(a){r(hn({field:o,selection:a})),r(z({legacy:ah(o,a),next:ih(a)}))},deselectAll(){r(sc(o)),r(z({legacy:bt(o),next:Bt()}))},get state(){let a=e.state.automaticFacetSet?.set[o]?.response;return a?{field:a.field,label:a.label,values:a.values}:{field:"",values:[],label:""}}}}d();c();l();u();function BT(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function GT(e,t){if(!_1(e))throw K;let{dispatch:r}=e,n=BT(t.options);return r(ic(n)),{...oe(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>QT(e,{field:i.field}))??[]}}}}function _1(e){return e.addReducers({automaticFacetSet:rh,configuration:fe,search:ge}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function sh(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,a={...qn,...t},i=r();e[n]={options:a,isLoading:o,response:i,initialNumberOfValues:a.numberOfValues,requestId:""}}function ch(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function uh(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function lh(e,t){let r=e[t];r&&(r.isLoading=!1)}function dh(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function $l(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=qn.query)}function ph(e,t){Object.keys(e).forEach(r=>$l(e,{facetId:r},t))}var qn={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var $T=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,a=t.categoryFacetSet[e].request,{captions:i,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:g,basePath:v,filterFacetCount:C}=a,h=N1(a),A=h.length?[h]:[],b=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??St(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:v,captions:i,numberOfValues:f,query:b,field:m,delimitingCharacter:g,ignorePaths:A,filterFacetCount:C,type:"hierarchical",...(n?{}:{searchContext:(yield Cr(t,r)).request})}});return function $T(_x157,_x158,_x159,_x160){return _ref71.apply(this,arguments)}}(),N1=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var HT=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:a,numberOfValues:i}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,g=f.filter(C=>C.state!=="idle").map(C=>C.value),v=`*${a}*`;return{url:t.configuration.search.apiBaseUrl??St(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:i,query:v,field:p,ignoreValues:g,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield Cr(t,r)).request})}});return function HT(_x161,_x162,_x163,_x164){return _ref72.apply(this,arguments)}}();var zT=e=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,W),D1(i,t)?p=yield HT(t,i,a,e):p=yield $T(t,i,a,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x165,_x166){return _ref73.apply(this,arguments)}}()),Rt=Ae("facetSearch/executeSearch",zT(!1)),Mn=Ae("facetSearch/executeSearch",zT(!0)),Fc=P("facetSearch/clearResults",e=>O(e,{facetId:ve})),D1=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function WT(){return{}}var Ec=ae(WT(),e=>{e.addCase(dc,(t,r)=>{let n=r.payload;sh(t,n,zx)}).addCase(Ko,(t,r)=>{ch(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;uh(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;lh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{dh(t,r.payload,r.meta.requestId)}).addCase(Fc,(t,{payload:{facetId:r}})=>{$l(t,{facetId:r},zx)}).addCase(z.fulfilled,t=>{ph(t,zx)})});function zx(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function KT(e,t){let{field:r,state:n}=e;if(!q1(e))return r;let o=`${r}_`,a=M1(o,n);return j1(r,t),`${o}${a}`}function q1(e){let{field:t,state:r}=e;return YT(r).some(o=>o&&t in o)}function M1(e,t){let n=YT(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return V1(n,e)+1}function YT(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function V1(e,t){return e.map(a=>{let i=a.split(t)[1],p=parseInt(i,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function j1(e,t){let r=`A facet with field "${e}" already exists.
|
|
46
|
+
To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function Gt(e,t){let{state:r,logger:n}=e,{field:o,facetId:a}=t;return a||KT({field:o,state:r},n)}d();c();l();u();d();c();l();u();var XT=["alphanumeric","occurrences"];var JT=new Se({field:An,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),basePath:aT,delimitingCharacter:iT,facetId:xn,facetSearch:mc,filterByBasePath:sT,filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,sortCriteria:new U({constrainTo:XT})});function ZT(e,t){if(!L1(e))throw K;let r=oe(e),{dispatch:n}=e,o=Gt(e,t.options),a=t.options.tabs??{},i=Yt(e.state.tabSet),p={...Ll,...pd("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...qn,...t.options.facetSearch},...p};$e(e,JT,f,"buildCategoryFacet");let m=()=>jS(e.state,o),g=()=>VS(e.state,o),v=()=>en(e.state),C=()=>cn(e.state,o);return n(yn(p)),{...r,toggleSelect(h){let A=f.numberOfValues;n(Wo({facetId:o,selection:h,retrieveCount:A})),n(Fe())},deselectAll(){n(Sn(o)),n(Fe())},sortBy(h){n(uc({facetId:o,criterion:h})),n(Fe())},isSortedBy(h){return m().sortCriteria===h},showMoreValues(){let{numberOfValues:h}=f,{activeValue:A,valuesAsTrees:b}=this.state,w=(A?.children.length??b.length)+h;n(li({facetId:o,numberOfValues:w})),n(Fe())},showLessValues(){let{numberOfValues:h}=f;n(li({facetId:o,numberOfValues:h})),n(Fe())},enable(){n(Qt(o))},disable(){n(tt(o))},get state(){let h=m(),A=g(),b=v(),w=C(),R=A?.values??[],E=R.some(Q=>Q.children.length>0)??!1,{parents:I,values:k}=lw(A?.values),T=cr(R),D=T.length?T[T.length-1]:void 0,B=!!D,L=D?.moreValuesAvailable??A?.moreValuesAvailable??!1,V=D?D.children.length>f.numberOfValues:R.length>f.numberOfValues;return{facetId:o,parents:I,selectedValueAncestry:T,values:k,isHierarchical:E,valuesAsTrees:R,activeValue:D,isLoading:b,hasActiveValues:B,canShowMoreValues:L,canShowLessValues:V,sortCriteria:h.sortCriteria,enabled:w}}}}function L1(e){return e.addReducers({categoryFacetSet:vn,categoryFacetSearchSet:Ec,facetOptions:wt,configuration:fe,search:ge}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var U1="coveo-headless-internal-state",fh=Symbol.for(U1);d();c();l();u();function Ic(e,t){let r=e.dispatch,{options:n,getFacetSearch:o,executeFacetSearchActionCreator:a,executeFieldSuggestActionCreator:i}=t,{facetId:p}=n;return{updateText(f){r(Ko({facetId:p,query:f,numberOfValues:o().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:f,options:m}=o();r(Ko({facetId:p,numberOfValues:m.numberOfValues+f})),r(t.isForFieldSuggestions?i(p):a(p))},search(){r(t.isForFieldSuggestions?i(p):a(p))},clear(){r(Fc({facetId:p}))},updateCaptions(f){r(Ko({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:g}=o(),{query:v}=g,C=f.values;return{...f,values:C,isLoading:m,query:v}}}}function eP(e,t){let{dispatch:r}=e,n={...qn,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[fh].categoryFacetSearchSet[o];r(dc(n));let i=Ic(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(lc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function mh(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a}=t,{dispatch:i}=e,p={...qn,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],g=eP(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(dc(p));let v=Ic(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Mn});return{...v,...g,get state(){return{...v.state,...g.state}}}}function tP(e,t){if(!Q1(e))throw K;let r=ZT(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=mh(e,{options:{facetId:o(),...t.options.facetSearch},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Mn,select:f=>{n(Fe()),n(z({legacy:it({facetId:o(),facetValue:f.rawValue}),next:gt()}))},isForFieldSuggestions:!1}),{state:i,...p}=a;return{...r,facetSearch:p,toggleSelect(f){r.toggleSelect(f),n(z({legacy:B1(o(),f),next:G1(f)}))},deselectAll(){r.deselectAll(),n(z({legacy:bt(o()),next:Bt()}))},sortBy(f){r.sortBy(f),n(z({legacy:En({facetId:o(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(wr({legacy:hc(o())}))},showLessValues(){r.showLessValues(),n(wr({legacy:yc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function Q1(e){return e.addReducers({categoryFacetSet:vn,categoryFacetSearchSet:Ec,configuration:fe,search:ge}),!0}function B1(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Wr(r):it(r)}function G1(e){return e.state==="selected"?co():gt()}d();c();l();u();d();c();l();u();d();c();l();u();function rP(){return{}}var Tc=ae(rP(),e=>{e.addCase(Fg,(t,r)=>{let n=r.payload;sh(t,n,Wx)}).addCase(Ko,(t,r)=>{ch(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;uh(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;lh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{dh(t,r.payload,r.meta.requestId)}).addCase(Fc,(t,{payload:r})=>{$l(t,r,Wx)}).addCase(z.fulfilled,t=>{ph(t,Wx)})});function Wx(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var nP={facetId:ve,selection:new J({values:ui})},oP=Ae("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},nP),n(Rn({facetId:e,selection:t})),n(Fe())}),aP=Ae("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},nP),n(Fn({facetId:e,selection:t})),n(Fe())});d();c();l();u();d();c();l();u();var Pc=["allValues","atLeastOneValue"];d();c();l();u();var gh=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var iP=new Se({facetId:xn,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),field:An,filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,sortCriteria:new U({constrainTo:gh}),resultsMustMatch:new U({constrainTo:Pc}),facetSearch:mc});function sP(e,t,r=iP){if(!$1(e))throw K;let{dispatch:n}=e,o=oe(e),a=Gt(e,t.options),i=t.options.tabs??{},p=Yt(e.state.tabSet),f={...Ul,...pd("facetSearch",t.options),field:t.options.field,facetId:a,tabs:i,activeTab:p},m={facetSearch:{...qn,...t.options.facetSearch},...f};$e(e,r,m,"buildFacet");let g=()=>cp(e.state,a),v=()=>Ki(e.state,a),C=()=>en(e.state),h=()=>cn(e.state,a),A=()=>{let{currentValues:w}=g();return w.filter(R=>R.state!=="idle").length},b=()=>{let{currentValues:w}=g(),R=m.numberOfValues,E=!!w.find(I=>I.state==="idle");return R<w.length&&E};return n(wn(f)),{...o,toggleSelect:w=>n(oP({facetId:m.facetId,selection:w})),toggleExclude:w=>n(aP({facetId:m.facetId,selection:w})),toggleSingleSelect:function(w){w.state==="idle"&&n(rt(a)),this.toggleSelect(w)},toggleSingleExclude:function(w){w.state==="idle"&&n(rt(a)),this.toggleExclude(w)},isValueSelected:nh,isValueExcluded:oh,deselectAll(){n(rt(a)),n(Fe())},sortBy(w){n(gc({facetId:a,criterion:w})),n(Fe())},isSortedBy(w){return this.state.sortCriterion===w},showMoreValues(){let w=g().numberOfValues,R=m.numberOfValues,E=R-w%R,I=w+E;n(di({facetId:a,numberOfValues:I})),n(pi({facetId:a,isFieldExpanded:!0})),n(Fe())},showLessValues(){let w=m.numberOfValues,R=Math.max(w,A());n(di({facetId:a,numberOfValues:R})),n(pi({facetId:a,isFieldExpanded:!1})),n(Fe())},enable(){n(Qt(a))},disable(){n(tt(a))},get state(){let w=g(),R=v(),E=C(),I=h(),k;typeof w.sortCriteria=="object"?k=w.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":k=w.sortCriteria;let T=R?R.values:[],D=T.some(V=>V.state!=="idle"),B=R?R.moreValuesAvailable:!1,L=w.resultsMustMatch;return{label:R?.label,facetId:a,tabs:i,values:T,sortCriterion:k,resultsMustMatch:L,isLoading:E,hasActiveValues:D,canShowMoreValues:B,canShowLessValues:b(),enabled:I}}}}function $1(e){return e.addReducers({facetSet:Tr,facetOptions:wt,configuration:fe,facetSearchSet:Tc}),!0}d();c();l();u();function hh(e,t){let{dispatch:r}=e,{options:n,select:o,exclude:a,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f}=t,{facetId:m}=n,g=()=>"state"in e?e.state.facetSearchSet[m]:e[fh].facetSearchSet[m];r(Fg(n));let v=Ic(e,{options:n,getFacetSearch:g,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...v,select(C){r(fi({facetId:m,value:C})),o(C)},exclude(C){r(mi({facetId:m,value:C})),a(C)},singleSelect(C){r(rt(m)),r(fi({facetId:m,value:C})),o(C)},singleExclude(C){r(rt(m)),r(mi({facetId:m,value:C})),a(C)},get state(){let{values:C}=v.state;return{...v.state,values:C.map(({count:h,displayValue:A,rawValue:b})=>({count:h,displayValue:A,rawValue:b}))}}}}d();c();l();u();var cP=new Se({facetId:xn,field:An,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,sortCriteria:new U({constrainTo:gh}),resultsMustMatch:new U({constrainTo:Pc}),facetSearch:mc,allowedValues:bg,hasBreadcrumbs:cT,customSort:wg});function uP(e,t){if(!H1(e))throw K;let{dispatch:r}=e,n=sP(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},cP),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return hh(e,{options:{facetId:o(),...m},select:g=>{r(Fe()),r(z({legacy:it({facetId:o(),facetValue:g.rawValue}),next:gt()}))},exclude:g=>{r(Fe()),r(z({legacy:fr({facetId:o(),facetValue:g.rawValue}),next:so()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Mn})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(z({legacy:ah(o(),m),next:ih(m)}))},toggleExclude(m){n.toggleExclude(m),r(z({legacy:LT(o(),m),next:UT(m)}))},deselectAll(){n.deselectAll(),r(z({legacy:bt(o()),next:Bt()}))},sortBy(m){n.sortBy(m),r(z({legacy:En({facetId:o(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(wr({legacy:hc(o())}))},showLessValues(){n.showLessValues(),r(wr({legacy:yc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function H1(e){return e.addReducers({facetSet:Tr,configuration:fe,facetSearchSet:Tc,search:ge}),!0}d();c();l();u();d();c();l();u();var yh=e=>e.state==="selected",Kx=e=>e.state==="excluded",Sh=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return yh(t)?Wr(n):it(n)},vh=e=>yh(e)?co():gt(),lP=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Kx(t)?io(n):fr(n)};d();c();l();u();d();c();l();u();d();c();l();u();var xh=P("rangeFacet/executeToggleSelect",e=>O(e,yi(e.selection))),Ah=P("rangeFacet/executeToggleExclude",e=>O(e,yi(e.selection)));var dP={facetId:ve,selection:new J({values:hi})},pP=Ae("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,dP),t(Tn(e)),t(xh(e)),t(Fe())}),fP=Ae("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,dP),t(Pn(e)),t(Ah(e)),t(Fe())});d();c();l();u();function Ch(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function bh(e,t){let{facetId:r,getRequest:n}=t,o=oe(e),a=e.dispatch,i=()=>cn(e.state,r);return{...o,isValueSelected:yh,isValueExcluded:Kx,deselectAll(){a(rt(r)),a(Fe())},sortBy(p){a(vc({facetId:r,criterion:p})),a(Fe())},isSortedBy(p){return this.state.sortCriterion===p},enable(){a(Qt(r))},disable(){a(tt(r))},get state(){let p=n(),f=Lr(e.state,r),m=p.sortCriteria,g=p.resultsMustMatch,v=f?f.values:[],C=en(e.state),h=i(),A=v.some(w=>w.state!=="idle"),b=f?.domain;return{facetId:r,values:v,sortCriterion:m,resultsMustMatch:g,hasActiveValues:A,isLoading:C,enabled:h,domain:b}}}}d();c();l();u();d();c();l();u();var wh=["idle","selected","excluded"];d();c();l();u();var Rh=["ascending","descending"],Fh=["even","equiprobable"];var z1={start:new U,end:new U,endInclusive:new de,state:new U({constrainTo:wh})},W1=new Se({facetId:xn,field:An,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),generateAutomaticRanges:Cg,filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,currentValues:new ie({each:new J({values:z1})}),sortCriteria:new U({constrainTo:Rh}),rangeAlgorithm:new U({constrainTo:Fh})});function Eh(e,t){$e(e,W1,t,"buildDateFacet"),Tg(t)}function mP(e,t){if(!K1(e))throw K;Ch(t.options,"buildDateFacet");let r=e.dispatch,n=Gt(e,t.options),o=t.options.tabs??{},a=Yt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Eh(e,i),r(In(i));let p=bh(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(pP({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(rt(n)),this.toggleSelect(f)},toggleExclude:f=>r(fP({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(rt(n)),this.toggleExclude(f)},get state(){return p.state}}}function K1(e){return e.addReducers({configuration:fe,search:ge,dateFacetSet:On,facetOptions:wt}),!0}function gP(e,t){let r=mP(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(z({legacy:bt(o()),next:Bt()}))},sortBy(a){r.sortBy(a),n(z({legacy:En({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(z({legacy:Sh(o(),a),next:vh(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(z({legacy:lP(o(),a)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function hP(e,t){if(!Y1(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Gt(e,t.options),i=t.options.tabs??{},p=Yt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Eh(e,f),n(In(f));let m=()=>cn(e.state,a);return{...r,clear:()=>{n(uo({facetId:a,values:[]})),n(Fe())},setRange:g=>{let v={...g,state:"selected",numberOfResults:0,endInclusive:!0},C=uo({facetId:a,values:[v]});return C.error?!1:(n(C),n(Fe()),!0)},enable(){n(Qt(a))},disable(){n(tt(a))},get state(){let g=en(o()),v=m(),C=yT(o(),a),h=C.length?C[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:v}}}}function Y1(e){return e.addReducers({dateFacetSet:On,facetOptions:wt,configuration:fe,search:ge}),!0}function yP(e,t){if(!X1(e))throw K;let r=hP(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(z({legacy:bt(o()),next:Bt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(z({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function X1(e){return e.addReducers({dateFacetSet:On,configuration:fe,search:ge}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var SP={facetId:ve,selection:new J({values:gi})},vP=Ae("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,SP),t(Nn(e)),t(xh(e)),t(Fe())}),HUe=Ae("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,SP),t(Dn(e)),t(Ah(e)),t(Fe())});d();c();l();u();var J1={start:new re,end:new re,endInclusive:new de,state:new U({constrainTo:wh})},Z1=new Se({facetId:xn,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),field:An,generateAutomaticRanges:Cg,filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,currentValues:new ie({each:new J({values:J1})}),sortCriteria:new U({constrainTo:Rh}),resultsMustMatch:new U({constrainTo:Pc}),rangeAlgorithm:new U({constrainTo:Fh})});function Ih(e,t){$e(e,Z1,t,"buildNumericFacet"),Qg(t)}d();c();l();u();function kc(e){return{endInclusive:!1,state:"idle",...e}}function xP(e,t){if(!eG(e))throw K;Ch(t.options,"buildNumericFacet");let r=e.dispatch,n=Gt(e,t.options),o=t.options.tabs??{},a=Yt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Ih(e,i),r(_n(i));let p=bh(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(vP({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(rt(n)),this.toggleSelect(f)},get state(){return p.state}}}function eG(e){return e.addReducers({numericFacetSet:Pr,facetOptions:wt,configuration:fe,search:ge}),!0}function AP(e,t){if(!tG(e))throw K;let r=xP(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(z({legacy:bt(o()),next:Bt()}))},sortBy(a){r.sortBy(a),n(z({legacy:En({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(z({legacy:Sh(o(),a),next:vh(a)}))},get state(){return{...r.state}}}}function tG(e){return e.addReducers({numericFacetSet:Pr,configuration:fe,search:ge}),!0}d();c();l();u();d();c();l();u();function CP(e,t){if(!rG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Gt(e,t.options),i=t.options.tabs??{},p=Yt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Ih(e,f),n(_n(f));let m=()=>cn(e.state,a);return{...r,clear:()=>{n(lo({facetId:a,values:[]})),n(Fe())},setRange:g=>{let v={...g,state:"selected",numberOfResults:0,endInclusive:!0},C=lo({facetId:a,values:[v]});return C.error?!1:(n(C),n(Fe()),!0)},enable(){n(Qt(a))},disable(){n(tt(a))},get state(){let g=en(o()),v=m(),C=CT(o(),a),h=C.length?C[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:v}}}}function rG(e){return e.addReducers({numericFacetSet:Pr,facetOptions:wt,configuration:fe,search:ge}),!0}function bP(e,t){if(!nG(e))throw K;let r=CP(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(z({legacy:bt(o()),next:Bt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(z({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function nG(e){return e.addReducers({numericFacetSet:Pr,configuration:fe,search:ge}),!0}d();c();l();u();function wP(e,t){if(!oG(e))throw K;let{facetSearch:r,...n}=t.options.facet,o=Gt(e,n);e.dispatch(yn({...Ll,...n,facetId:o}));let a=mh(e,{options:{...r,facetId:o},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Mn,select:p=>{e.dispatch(Fe()),e.dispatch(z({legacy:it({facetId:o,facetValue:p.rawValue}),next:gt()}))},isForFieldSuggestions:!0});return{...oe(e),...a,updateText:p=>{a.updateText(p),a.search()},get state(){return a.state}}}function oG(e){return e.addReducers({categoryFacetSet:vn,configuration:fe,categoryFacetSearchSet:Ec,search:ge}),!0}d();c();l();u();function RP(e,t){if(!aG(e))throw K;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Gt(e,o);e.dispatch(wn({...Ul,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=hh(e,{options:{...r,facetId:a},select:f=>{e.dispatch(Fe()),e.dispatch(z({legacy:it({facetId:a,facetValue:f.rawValue}),next:gt()}))},exclude:f=>{e.dispatch(Fe()),e.dispatch(z({legacy:fr({facetId:a,facetValue:f.rawValue}),next:so()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Mn});return{...oe(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function aG(e){return e.addReducers({facetSet:Tr,configuration:fe,facetSearchSet:Tc,search:ge}),!0}d();c();l();u();d();c();l();u();var Yx={collectionField:new U({emptyAllowed:!1,required:!1}),parentField:new U({emptyAllowed:!1,required:!1}),childField:new U({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new re({min:0,required:!1})},Jo=P("folding/register",e=>O(e,Yx)),Zo=Ae("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let a=t(),i=a.configuration.analytics.analyticsMode==="legacy"?yield Io(a):As(a,o),p=yield n.search({...i,q:iG(a),enableQuerySyntax:!0,cq:`@${a.folding.fields.collection}="${e}"`,filterField:a.folding.fields.collection,childField:a.folding.fields.parent,parentField:a.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return vt(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:a.folding.collections[e].result}});return function(_x167,_x168){return _ref74.apply(this,arguments)}}());function iG(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var sG=e=>X("analytics/folding/showMore",(t,r)=>(Jt(e),t.makeShowMoreFoldedResults(pt(e,r),Ke(e)))),cG=()=>X("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),FP={logShowMoreFoldedResults:sG,logShowLessFoldedResults:cG};d();c();l();u();d();c();l();u();d();c();l();u();var Th=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function uG(e,t){return e.raw[t.collection]}function Xx(e,t){return e.raw[t.parent]}function Hl(e,t){let r=e.raw[t.child];return ld(r)?r[0]:r}function lG(e,t){return(e||t)!==void 0&&e===t}function IP(e,t,r,n=[]){let o=Hl(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=Hl(a,r)===Hl(e,r);return Xx(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:IP(i,t,r,[...n,o])}}):[]}function dG(e,t){return e.find(r=>{let n=Xx(r,t)===void 0,o=lG(Xx(r,t),Hl(r,t));return n||o})}function TP(e){return e.parentResult?TP(e.parentResult):e}function pG(e,t,r,n){let o=Sp(e),i={...(n??dG(o,t)??TP(e)),searchUid:r},p=IP(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function Ph(e,t,r,n){let o={};return e.forEach(a=>{let i=uG(a,t);i&&(!Hl(a,t)&&!a.parentResult||(o[i]=pG(a,t,r,n)))}),o}function EP(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var kh=ae(Th(),e=>e.addCase(z.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Ph(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Lt.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Ph(r.response.results,t.fields,r.response.searchUid):{}}).addCase(br.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...Ph(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Jo,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Zo.pending,(t,{meta:r})=>{let n=r.arg;EP(t,n).isLoadingMoreResults=!0}).addCase(Zo.rejected,(t,{meta:r})=>{let n=r.arg;EP(t,n).isLoadingMoreResults=!1}).addCase(Zo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=Ph(n,t.fields,a,o);if(!i||!i[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=i[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var zl={id:W},Oc=P("querySuggest/register",e=>O(e,{...zl,count:new re({min:0})})),PP=P("querySuggest/unregister",e=>O(e,zl)),Vn=P("querySuggest/selectSuggestion",e=>O(e,{...zl,expression:Be})),ea=P("querySuggest/clear",e=>O(e,zl)),ta=Ae("querySuggest/fetch",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,zl);let i=e.id,p=yield fG(i,t(),a),f=yield n.querySuggest(p);return vt(f)?r(f.error):{id:i,q:p.q,...f.success}});return function(_x169,_x170){return _ref75.apply(this,arguments)}}()),fG=/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??St(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Xt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield Cs(t.configuration.analytics):Ur(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function fG(_x171,_x172,_x173){return _ref76.apply(this,arguments)}}();var Ft=ae(dt(),e=>e.addCase(jt,(t,r)=>({...t,...r.payload})).addCase(xr,(t,r)=>{t.q=r.payload}).addCase(Vn,(t,r)=>{t.q=r.payload.expression}).addCase(qe.fulfilled,(t,r)=>r.payload?.query??t).addCase(Me,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var ra=P("fields/registerFieldsToInclude",e=>O(e,Cd)),_c=P("fields/fetchall/enable"),Ci=P("fields/fetchall/disable"),Nc=Ae("fields/fetchDescription",/*#__PURE__*/function(){var _ref77=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:a,environment:i,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:a,organizationId:p,url:f??St(p,i)});return vt(m)?n(m.error):m.success.fields});return function(_x174,_x175){return _ref77.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Oh=["author","language","urihash","objecttype","collection","source","permanentid"],Jx=[...Oh,"date","filetype","parents"],kP=[...Jx,"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"],OP=()=>({fieldsToInclude:Oh,fetchAllFields:!1,fieldsDescription:[]});var na=ae(OP(),e=>e.addCase(ra,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(_c,t=>{t.fetchAllFields=!0}).addCase(Ci,t=>{t.fetchAllFields=!1}).addCase(Nc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Jo,(t,{payload:r})=>{let n=Th().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function Dc(e){if(!mG(e))throw K;let t=oe(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:dl(n)}}}}function mG(e){return e.addReducers({search:ge}),!0}var gG=new Se({fieldsToInclude:new ie({required:!1,each:new U({required:!0,emptyAllowed:!1})})});function _h(e,t){if(!hG(e))throw K;let r=oe(e),n=Dc(e),{dispatch:o}=e,a=()=>e.state,i=$e(e,gG,t?.options,"buildCoreResultList");i.fieldsToInclude&&o(ra(i.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,g=5,v=200,C=!1;return{...r,get state(){let A=a();return{...n.state,results:A.search.results,moreResultsAvailable:p(),searchResponseId:A.search.searchResponseId}},fetchMoreResults:function(){var _ref78=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<v){if(m++,m>=g){f=Date.now(),!C&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${g} times, with little delay. Please verify the conditions under which the function is called.`),C=!0;return}}else m=0;C=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref78.apply(this,arguments)}}()}}function hG(e){return e.addReducers({search:ge,configuration:fe,fields:na}),!0}var yG=new Se(Yx);function _P(e,t,r){if(!SG(e))throw K;let n=_h(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?$e(e,yG,t.options.folding,"buildFoldedResultList"):{};return o(Jo({...i})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return Zx(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return Zx(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=a();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function SG(e){return e.addReducers({search:ge,configuration:Rf,folding:kh,query:Ft}),!0}function Zx(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=Zx(n.children,t);if(o)return o}}return null}function NP(e,t={}){let r=_P(e,{...t,loadCollectionActionCreator:Zo,fetchMoreResultsActionCreator:br},FP);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function qc(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var Mc=ae(qv(),e=>e.addCase(Ms,(t,{payload:r})=>{t.isVisible=r}).addCase(Sl,(t,{payload:r})=>{t.isEnabled=r}).addCase(mf,(t,{payload:r})=>{t.id=r.id}).addCase(Oa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.answer||(t.answer=""),t.answer+=r.textDelta,delete t.error}).addCase(_a,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=qc([...t.citations,...r.citations]),delete t.error}).addCase(Na,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===My},t.citations=[],delete t.answer}).addCase(lf,t=>{t.liked=!0,t.disliked=!1}).addCase(df,t=>{t.liked=!1,t.disliked=!0}).addCase(pf,t=>{t.feedbackModalOpen=!0}).addCase(gf,t=>{t.feedbackModalOpen=!1}).addCase(js,t=>{t.feedbackSubmitted=!0}).addCase(dr,t=>({...qv(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase(un,(t,{payload:r})=>{t.isLoading=r}).addCase(ka,(t,{payload:r})=>{t.isStreaming=r}).addCase(Da,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(hf,(t,{payload:r})=>{t.responseFormat=r}).addCase(Sf,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(xl,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(vl,t=>{t.expanded=!0}).addCase(ff,t=>{t.expanded=!1}).addCase(yf,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(qa,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(Vv,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Vs,(t,{payload:r})=>{t.answerId=r}).addCase(uf,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(vf,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(xf,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}));d();c();l();u();function Vc(e,t,r={}){if(!vG(e))throw K;let{dispatch:n}=e,o=oe(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(Ms(i));let p=r.initialState?.responseFormat;p&&n(hf(p));let f=r.fieldsToIncludeInCitations;return f&&n(Sf(f)),r.initialState?.expanded&&n(vl()),{...o,get state(){let g=a().generatedAnswer;return{...g,error:si(g.error)}},like(){this.state.liked||(n(lf()),n(t.logLikeGeneratedAnswer(this.state.answerId)))},dislike(){this.state.disliked||(n(df()),n(t.logDislikeGeneratedAnswer(this.state.answerId)))},openFeedbackModal(){n(pf())},closeFeedbackModal(){n(gf())},sendFeedback(g){n(t.logGeneratedAnswerFeedback(g)),n(js())},logCitationClick(g,v){n(t.logOpenGeneratedAnswerSource(g,v))},logCitationHover(g,v,C){n(t.logHoverCitation(g,v,C))},show(){this.state.isVisible||(n(Ms(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(Ms(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(vl()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(ff()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(Sl(!0))},disable(){this.state.isEnabled&&n(Sl(!1))},logCopyToClipboard(g){n(t.logCopyGeneratedAnswer(g))},retry(){}}}function vG(e){return e.addReducers({generatedAnswer:Mc}),!0}var $t={engines:{},setAbortControllerRef:(e,t)=>{$t.engines[t].abortController=e},getIsStreamInProgress:e=>!$t.engines[e].abortController||$t.engines[e].abortController?.signal.aborted?($t.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,a=r.generatedAnswer.id;if($t.engines[a].lastRequestId!==n){if($t.engines[a].lastRequestId=n,$t.engines[a].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(dr())}if(!$t.getIsStreamInProgress(a)&&o&&o!==$t.engines[a].lastStreamId){if($t.engines[a].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(AF({setAbortControllerRef:p=>$t.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function DP(e,t,r={}){if(!xG(e))throw K;let n=Vc(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!$t.engines[e.state.generatedAnswer.id]&&($t.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let i=go("genQA-",12);e.dispatch(mf({id:i}))}$t.engines[e.state.generatedAnswer.id]||($t.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),$t.subscribeToSearchRequests(e);let a=i=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in i;return{...n,get state(){return o().generatedAnswer},retry(){a(e)&&e.dispatch(z({legacy:t.logRetryGeneratedAnswer()}))}}}function xG(e){return e.addReducers({generatedAnswer:Mc}),!0}d();c();l();u();d();c();l();u();var qP=bf.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Nh=e=>e==="yes"?!0:e==="no"?!1:null,AG=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:Nh(t.correctTopic),documented:Nh(t.documented),hallucinationFree:Nh(t.hallucinationFree),readable:Nh(t.readable)},helpful:t.helpful,question:r}),CG=e=>{let t="",r=()=>{let n=e.state,o=aF(n),a=o.requestId;a!==t&&(t=a,e.dispatch(dr()),o.q?.length>0&&e.dispatch(Af()))};e.subscribe(r)};function MP(e,t,r={}){if(!bG(e))throw K;Ho(e.state.configuration.analytics.analyticsMode);let{...n}=Vc(e,t,r),o=()=>e.state;return e.dispatch(yf(r.answerConfigurationId)),CG(e),{...n,get state(){let a=jv(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:qc(a?.citations??[]),error:si({message:a?.error?.message,code:a?.error?.code}),isLoading:a?.isLoading??!1,isStreaming:a?.isStreaming??!1,answerContentFormat:a?.contentFormat??"text/plain",isAnswerGenerated:a?.generated??!1,cannotAnswer:i.cannotAnswer||a?.generated===!1&&!a?.isLoading&&!a?.isStreaming}},retry(){let a=nf(o());e.dispatch(Cf(a??Ta))},reset(){e.dispatch(dr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=AG({query:o().query.q,feedback:a,answerApiState:jv(e.state).data});e.dispatch(qP.endpoints.post.initiate(i)),e.dispatch(js())})()}}}function bG(e){return e.addReducers({[Ma.reducerPath]:Ma.reducer,query:Ft}),!0}d();c();l();u();d();c();l();u();var eA=class extends Wm{requestInit(t){let{q:r,analytics:n,conversationId:o,conversationToken:a,accessToken:i}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${i}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify({q:r,analytics:n,conversationId:o,conversationToken:a}),signal:this.abortController.signal}}},VP=(e,t,r)=>new eA({url:`${Km(e,t,r)}/follow-up`});d();c();l();u();var jP=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Dl(t)),e(rg({answerId:t,isLoading:!1})),e(ng({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:n})=>{e(pg({name:n.stepName,startedAt:n.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:n})=>{e(fg({name:n.stepName,finishedAt:n.timestamp??Date.now(),answerId:t}))},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(og({textDelta:n.delta,answerId:t}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(tg({contentFormat:a.contentFormat,answerId:t}));return}case"citations":{e(ag({citations:a.citations,answerId:t}));return}}},onRunErrorEvent:({input:n,event:o})=>{t||(t=n.runId,e(Dl(n.runId)));let a=mg(o.code);e(sg({message:o.message,code:a,answerId:t})),t=""},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(ig({cannotAnswer:!o,answerId:t})),e(Jn(o,t,a,n.threadId)),e(Vo(t)),t="",r=!1}}};d();c();l();u();d();c();l();u();function LP(){return{conversationId:"",conversationToken:"",isEnabled:!1,followUpAnswers:[]}}var UP=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function tA(e){return e.followUpAnswers.find(t=>t.isActive)}function kr(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var QP=ae(LP(),e=>e.addCase(Ym,(t,{payload:r})=>{t.isEnabled=r}).addCase(Xm,(t,{payload:r})=>{t.conversationId=r}).addCase(Jm,(t,{payload:r})=>{t.conversationToken=r}).addCase(Zm,t=>{t.conversationToken=""}).addCase(eg,(t,{payload:r})=>{let n=tA(t);n&&(n.isActive=!1),t.followUpAnswers.push(UP(r.question))}).addCase(Dl,(t,{payload:r})=>{let n=tA(t);!n||n.answerId||(n.answerId=r)}).addCase(tg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(rg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(ng,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(og,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(ag,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.citations=qc([...n.citations,...r.citations]),delete n.error)}).addCase(ig,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(sg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(cg,(t,{payload:r})=>{let n=tA(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(ug,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(lg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(CI,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(pg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(fg,(t,{payload:r})=>{let n=kr(t,r.answerId);if(!n)return;let o=n.generationSteps.findLast(a=>a.name===r.name&&a.status==="active");o&&(o.status="completed",o.finishedAt=r.finishedAt)}).addCase(dg,t=>{t.followUpAnswers=[],t.conversationId="",t.conversationToken="",t.isEnabled=!1}));function BP(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!wG(e))throw K;let n=Vc(e,t,r),o=()=>e.state;e.dispatch(Rp(r.agentId));let a=lp(o()),i=up(o()),p=dp(o()),f=VP(r.agentId,a,p),m=jP(e.dispatch),g=gg();return{...n,get state(){let v=o().followUpAnswers,C=o().generatedAnswer;return{...C,error:si(C.error),followUpAnswers:{...v,followUpAnswers:v.followUpAnswers.map(h=>({...h,error:si(h.error)}))}}},retry(){g.run(e.state,e.dispatch,()=>e.navigatorContext)},like(v){if(!v||this.state.answerId===v){n.like();return}let C=this.state.followUpAnswers.followUpAnswers.find(h=>h.answerId===v);if(!C){console.warn(`No follow-up answer found with ID ${v}. Cannot like.`);return}C.liked||(e.dispatch(ug({answerId:v})),e.dispatch(t.logLikeGeneratedAnswer(v)))},dislike(v){if(!v||this.state.answerId===v){n.dislike();return}let C=this.state.followUpAnswers.followUpAnswers.find(h=>h.answerId===v);if(!C){console.warn(`No follow-up answer found with ID ${v}. Cannot dislike.`);return}C.disliked||(e.dispatch(lg({answerId:v})),e.dispatch(t.logDislikeGeneratedAnswer(v)))},logCopyToClipboard(v){if(!v||this.state.answerId===v){n.logCopyToClipboard();return}e.dispatch(t.logCopyGeneratedAnswer(v))},logCitationClick(v,C){if(!C||this.state.answerId===C){n.logCitationClick(v);return}e.dispatch(t.logOpenGeneratedAnswerSource(v,C))},logCitationHover(v,C,h){if(!h||this.state.answerId===h){n.logCitationHover(v,C);return}e.dispatch(t.logHoverCitation(v,C,h))},askFollowUp(v){var _this37=this;return _asyncToGenerator(function*(){if(!v||v.trim()==="")return;let C=_this37.state.followUpAnswers.conversationId,h=_this37.state.followUpAnswers.conversationToken;if(!C){console.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}if(!h){console.warn("Missing conversationToken when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}f.abortRun(),e.dispatch(eg({question:v}));let A=Ur(o().configuration.analytics,e.navigatorContext);try{yield f.runAgent({forwardedProps:{q:v,analytics:A.analytics,conversationId:C,conversationToken:h,accessToken:i}},m)}catch(b){e.dispatch(cg({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",b)}})()}}}function wG(e){return e.addReducers({followUpAnswers:QP}),!0}function GP(e,t={}){Ho(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=BP(e,Ns,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=MP(e,Ns,t):r=DP(e,Ns,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function or(e,t,r){if(!RG(e))throw K;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:fd(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function RG(e){return e.addReducers({configuration:fe}),!0}function $P(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id,r.options.answerId)))};return or(e,r,()=>{o()})}function HP(e,t){return $P(e,Ns,t)}d();c();l();u();d();c();l();u();var jc=ae(jp(),e=>{e.addCase(z.fulfilled,FG).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function FG(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var Dh=()=>X("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),qh=()=>X("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Mh=()=>X("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var zP=e=>({past:[],present:e,future:[]}),EG=e=>{let{past:t,present:r,future:n}=e;if(!r||t.length===0)return e;let o=t[t.length-1];return{past:t.slice(0,t.length-1),present:o,future:[r,...n]}},IG=e=>{let{past:t,present:r,future:n}=e;if(!r||n.length===0)return e;let o=n[0],a=n.slice(1);return{past:[...t,r],present:o,future:a}},TG=e=>{let{action:t,state:r,reducer:n}=e,{past:o,present:a}=r,i=n(a,t);return a?a===i?r:{past:[...o,a].slice(-10),present:i,future:[]}:zP(i)},WP=e=>{let{actionTypes:t,reducer:r}=e,n=zP();return(o=n,a)=>{switch(a.type){case t.undo:return EG(o);case t.redo:return IG(o);case t.snapshot:return TG({state:o,reducer:r,action:a});default:return o}}};d();c();l();u();d();c();l();u();var{getOwnPropertyNames:PG,getOwnPropertySymbols:kG}=Object,{hasOwnProperty:OG}=Object.prototype;function rA(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function Vh(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);let{cache:a}=o,i=a.get(r),p=a.get(n);if(i&&p)return i===n&&p===r;a.set(r,n),a.set(n,r);let f=e(r,n,o);return a.delete(r),a.delete(n),f}}function KP(e){return PG(e).concat(kG(e))}var _G=Object.hasOwn||((e,t)=>OG.call(e,t)),NG="__v",DG="__o",qG="_owner",{getOwnPropertyDescriptor:YP,keys:XP}=Object,bi=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function MG(e,t){return e===t}function VG(e,t){return e.byteLength===t.byteLength&&jh(new Uint8Array(e),new Uint8Array(t))}function jG(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function LG(e,t){return e.byteLength===t.byteLength&&jh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function UG(e,t){return bi(e.getTime(),t.getTime())}function QG(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function JP(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.entries(),i,p,f=0;for(;(i=a.next())&&!i.done;){let m=t.entries(),g=!1,v=0;for(;(p=m.next())&&!p.done;){if(o[v]){v++;continue}let C=i.value,h=p.value;if(r.equals(C[0],h[0],f,v,e,t,r)&&r.equals(C[1],h[1],C[0],h[0],e,t,r)){g=o[v]=!0;break}v++}if(!g)return!1;f++}return!0}function BG(e,t,r){let n=XP(e),o=n.length;if(XP(t).length!==o)return!1;for(;o-->0;)if(!ek(e,t,r,n[o]))return!1;return!0}function Wl(e,t,r){let n=KP(e),o=n.length;if(KP(t).length!==o)return!1;let a,i,p;for(;o-->0;)if(a=n[o],!ek(e,t,r,a)||(i=YP(e,a),p=YP(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function GG(e,t){return bi(e.valueOf(),t.valueOf())}function $G(e,t){return e.source===t.source&&e.flags===t.flags}function ZP(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.values(),i,p;for(;(i=a.next())&&!i.done;){let f=t.values(),m=!1,g=0;for(;(p=f.next())&&!p.done;){if(!o[g]&&r.equals(i.value,p.value,i.value,p.value,e,t,r)){m=o[g]=!0;break}g++}if(!m)return!1}return!0}function jh(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function HG(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function ek(e,t,r,n){return(n===qG||n===DG||n===NG)&&(e.$$typeof||t.$$typeof)?!0:_G(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var zG=Object.prototype.toString;function WG(e){let t=JG(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:o,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:p,areRegExpsEqual:f,areSetsEqual:m,getUnsupportedCustomComparator:g}=e;return function(C,h,A){if(C===h)return!0;if(C==null||h==null)return!1;let b=typeof C;if(b!==typeof h)return!1;if(b!=="object")return b==="number"||b==="bigint"?i(C,h,A):b==="function"?o(C,h,A):!1;let w=C.constructor;if(w!==h.constructor)return!1;if(w===Object)return p(C,h,A);if(w===Array)return r(C,h,A);if(w===Date)return n(C,h,A);if(w===RegExp)return f(C,h,A);if(w===Map)return a(C,h,A);if(w===Set)return m(C,h,A);if(w===Promise)return!1;if(Array.isArray(C))return r(C,h,A);let R=zG.call(C),E=t[R];if(E)return E(C,h,A);let I=g&&g(C,h,A,R);return I?I(C,h,A):!1}}function KG({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:VG,areArraysEqual:r?Wl:jG,areDataViewsEqual:LG,areDatesEqual:UG,areErrorsEqual:QG,areFunctionsEqual:MG,areMapsEqual:r?rA(JP,Wl):JP,areNumbersEqual:bi,areObjectsEqual:r?Wl:BG,arePrimitiveWrappersEqual:GG,areRegExpsEqual:$G,areSetsEqual:r?rA(ZP,Wl):ZP,areTypedArraysEqual:r?rA(jh,Wl):jh,areUrlsEqual:HG,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=Vh(n.areArraysEqual),a=Vh(n.areMapsEqual),i=Vh(n.areObjectsEqual),p=Vh(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:p})}return n}function YG(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function XG({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(p,f){let{cache:m=e?new WeakMap:void 0,meta:g}=r();return t(p,f,{cache:m,equals:n,meta:g,strict:o})};if(e)return function(p,f){return t(p,f,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};let a={cache:void 0,equals:n,meta:void 0,strict:o};return function(p,f){return t(p,f,a)}}function JG({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:a,areMapsEqual:i,areNumbersEqual:p,areObjectsEqual:f,arePrimitiveWrappersEqual:m,areRegExpsEqual:g,areSetsEqual:v,areTypedArraysEqual:C,areUrlsEqual:h}){return{"[object Arguments]":f,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":p,"[object BigInt64Array]":C,"[object BigUint64Array]":C,"[object Boolean]":m,"[object DataView]":r,"[object Date]":n,"[object Error]":o,"[object Float16Array]":C,"[object Float32Array]":C,"[object Float64Array]":C,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":C,"[object Int16Array]":C,"[object Int32Array]":C,"[object Map]":i,"[object Number]":m,"[object Object]":(A,b,w)=>typeof A.then!="function"&&typeof b.then!="function"&&f(A,b,w),"[object RegExp]":g,"[object Set]":v,"[object String]":m,"[object URL]":h,"[object Uint8Array]":C,"[object Uint8ClampedArray]":C,"[object Uint16Array]":C,"[object Uint32Array]":C}}var nA=jn(),S3e=jn({strict:!0}),v3e=jn({circular:!0}),x3e=jn({circular:!0,strict:!0}),A3e=jn({createInternalComparator:()=>bi}),C3e=jn({strict:!0,createInternalComparator:()=>bi}),b3e=jn({circular:!0,createInternalComparator:()=>bi}),w3e=jn({circular:!0,createInternalComparator:()=>bi,strict:!0});function jn(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=KG(e),i=WG(a),p=r?r(i):YG(i);return XG({circular:t,comparator:i,createState:n,equals:p,strict:o})}function wi(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function ZG(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>Kl(r,n))!==-1)}var Kl=jn({createCustomConfig:e=>({...e,areArraysEqual:ZG})});var e2=ae(lR(),e=>{e.addCase(lr,(t,r)=>t2(t,r.payload)?void 0:r.payload)}),t2=(e,t)=>r2(e.context,t.context)&&n2(e.dictionaryFieldContext,t.dictionaryFieldContext)&&l2(e.advancedSearchQueries,t.advancedSearchQueries)&&o2(e.tabSet,t.tabSet)&&a2(e.staticFilterSet,t.staticFilterSet)&&oA(e.facetSet,t.facetSet)&&oA(e.dateFacetSet,t.dateFacetSet)&&oA(e.numericFacetSet,t.numericFacetSet)&&s2(e.automaticFacetSet,t.automaticFacetSet)&&i2(e.categoryFacetSet,t.categoryFacetSet)&&c2(e.pagination,t.pagination)&&u2(e.query,t.query)&&d2(e,t)&&p2(e.pipeline,t.pipeline)&&f2(e.searchHub,t.searchHub)&&m2(e.facetOrder,t.facetOrder)&&g2(e.debug,t.debug),r2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),n2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),o2=(e,t)=>{let r=tk(e),n=tk(t);return r?.id===n?.id},tk=e=>Object.values(e).find(t=>t.isActive),a2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=rk(e[r]),a=rk(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},rk=e=>e.values.filter(t=>t.state!=="idle"),oA=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=e[r].request.currentValues.filter(i=>i.state!=="idle"),a=n.request.currentValues.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},i2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=cr(e[r]?.request.currentValues).map(({value:i})=>i),a=cr(n?.request.currentValues).map(({value:i})=>i);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},s2=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let o=e.set[r].response.values.filter(i=>i.state!=="idle"),a=n.response.values.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},c2=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,u2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),l2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),d2=(e,t)=>e.sortCriteria===t.sortCriteria,p2=(e,t)=>e===t,f2=(e,t)=>e===t,m2=(e,t)=>wi(e,t),g2=(e,t)=>e===t,Lh=WP({actionTypes:{redo:ev.type,undo:ZS.type,snapshot:lr.type},reducer:e2});function nk(e){if(!h2(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=a=>a.past.length>0&&!pe(a.present);return{...t,subscribe(a){a();let i=JSON.stringify(n().history.present),p=()=>{let f=JSON.stringify(n().history.present);i!==f&&(i=f,a())};return e.subscribe(()=>p())},get state(){return n().history},back(){var _this38=this;return _asyncToGenerator(function*(){o(_this38.state)&&(yield r(al()),r(z({legacy:qh()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(Ep()),r(z({legacy:Dh()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r(al()),r(z({legacy:Mh()})))})()}}}function h2(e){return e.addReducers({history:Lh,configuration:fe,facetOrder:jc}),!0}d();c();l();u();d();c();l();u();var y2={results:new ie({required:!0,each:new J({values:vp})}),maxLength:new re({required:!0,min:1,default:10})},Lc=P("recentResults/registerRecentResults",e=>O(e,y2)),Or=P("recentResults/pushRecentResult",e=>(Jt(e),{payload:e})),Uc=P("recentResults/clearRecentResults");function ok(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Gw(t.options.result)))};return or(e,t,()=>{n(),e.dispatch(Or(t.options.result))})}d();c();l();u();d();c();l();u();function Uh(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var ak=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},ik=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},sk=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{Uh(o)&&delete t[r].cache[n]})},ck=(e,t,r)=>{for(let o in t)for(let a in t[o].cache)t[o].cache[a].isActive=!1;if(!aA(e,t)){S2(e,t,r);return}let n=aA(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},uk=(e,t,r)=>{let{id:n,q:o,searchUid:a,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[o]={...aA(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},lk=(e,t)=>{let{id:r,q:n,error:o}=e;t[r].cache[n].error=o||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1},aA=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},S2=(e,t,r)=>{let{q:n,id:o}=e;t[o].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}};d();c();l();u();function dk(){return{}}var Qh=ae(dk(),e=>{e.addCase(ms,(t,r)=>{ak(r.payload,t)}),e.addCase(on,(t,r)=>{ik(r.payload,t)}),e.addCase(gs,(t,r)=>{sk(r.payload,t)}),e.addCase(Is.pending,(t,r)=>{ck(r.meta.arg,t,{results:[]})}),e.addCase(Is.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));uk({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(Is.rejected,(t,r)=>{lk(r.meta.arg,t)})});d();c();l();u();var v2={searchBoxId:st,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re},pk=new Se(v2);function fk(e,t){if(!x2(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={searchBoxId:t.options.searchBoxId||go("instant-results-"),cacheTimeout:t.options.cacheTimeout||6e4,maxResultsPerQuery:t.options.maxResultsPerQuery};$e(e,pk,a,"buildInstantResults");let i=a.searchBoxId;n(ms({id:i}));let p=()=>o().instantResults[i],f=v=>p().cache[v],m=()=>p().q,g=()=>{let v=f(m());return v?v.isLoading?[]:v.results:[]};return{...r,updateQuery(v){if(!v)return;let C=f(v);(!C||!C.isLoading&&(C.error||Uh(C)))&&n(Is({id:i,q:v,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(on({id:i,q:v}))},clearExpired(){n(gs({id:i}))},get state(){let v=m(),C=f(v);return{q:v,isLoading:C?.isLoading||!1,error:C?.error||null,results:g()}}}}function x2(e){return e.addReducers({instantResults:Qh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var _r=ae(Ar(),e=>{e.addCase(hs,(t,r)=>{let n=iA(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Yl(n,o)}).addCase(ys,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(ht,t=>{t.firstResult=0}).addCase(Ss,(t,r)=>{let n=r.payload;t.firstResult=Yl(n,t.numberOfResults)}).addCase(an,(t,r)=>{let n=r.payload;t.firstResult=Yl(n,t.numberOfResults)}).addCase(xs,t=>{let r=iA(t),n=Math.max(r-1,1);t.firstResult=Yl(n,t.numberOfResults)}).addCase(vs,t=>{let r=iA(t),n=A2(t),o=Math.min(r+1,n);t.firstResult=Yl(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Me,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(z.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Lt.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(rt,t=>{Ht(t)}).addCase(Pn,t=>{Ht(t)}).addCase(Fn,t=>{Ht(t)}).addCase(Dn,t=>{Ht(t)}).addCase(mi,t=>{Ht(t)}).addCase(Rn,t=>{Ht(t)}).addCase(Sn,t=>{Ht(t)}).addCase(Wo,t=>{Ht(t)}).addCase(lc,t=>{Ht(t)}).addCase(Tn,t=>{Ht(t)}).addCase(Nn,t=>{Ht(t)}).addCase(ft,t=>{Ht(t)}).addCase(uo,t=>{Ht(t)}).addCase(lo,t=>{Ht(t)}).addCase(fi,t=>{Ht(t)}).addCase(hn,t=>{Ht(t)})});function Ht(e){e.firstResult=Ar().firstResult}function iA(e){let{firstResult:t,numberOfResults:r}=e;return sA(t,r)}function A2(e){let{totalCountFiltered:t,numberOfResults:r}=e;return cA(t,r)}function Yl(e,t){return(e-1)*t}function sA(e,t){return Math.round(e/t)+1}function cA(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function C2(e){return e.pagination.firstResult}function mk(e){return e.pagination.numberOfResults}function b2(e){return e.pagination.totalCountFiltered}var mo=e=>{let t=C2(e),r=mk(e);return sA(t,r)},Xl=e=>{let t=b2(e),r=mk(e);return cA(t,r)},Bh=(e,t)=>{let r=mo(e),n=Xl(e),o=w2(r,t);return o=R2(o),o=F2(o,n),E2(o)};function w2(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,a=e-n,i=e+o;return{start:a,end:i}}function R2(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function F2(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function E2(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Bc=()=>X("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||Ar().numberOfResults})),Gc=()=>X("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:mo(t)})),Gh=()=>X("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:mo(t)})),$h=()=>X("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:mo(t)})),$c=()=>({actionCause:"browseResults"});d();c();l();u();var I2=new Se({numberOfPages:new re({default:5,min:0})}),T2=new Se({page:new re({min:1})});function gk(e,t={}){if(!P2(e))throw K;let r=oe(e),{dispatch:n}=e,o=$e(e,I2,t.options,"buildPager"),i=lt(e,T2,t.initialState,"buildPager").page;i&&n(Ss(i));let p=()=>mo(e.state),f=()=>{let{numberOfPages:g}=o;return Bh(e.state,g)},m=()=>Xl(e.state);return{...r,get state(){let g=p(),v=m(),C=g>1&&v>0,h=g<v;return{currentPage:g,currentPages:f(),maxPage:v,hasPreviousPage:C,hasNextPage:h}},selectPage(g){n(an(g))},nextPage(){n(vs())},previousPage(){n(xs())},isCurrentPage(g){return g===this.state.currentPage}}}function P2(e){return e.addReducers({configuration:fe,pagination:_r}),!0}function hk(e,t={}){let{dispatch:r}=e,n=gk(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(Lt({legacy:Gc(),next:$c()}))},nextPage(){n.nextPage(),r(Lt({legacy:Gh(),next:$c()}))},previousPage(){n.previousPage(),r(Lt({legacy:$h(),next:$c()}))}}}d();c();l();u();d();c();l();u();function yk(e){if(!k2(e))throw K;let t=oe(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function k2(e){return e.addReducers({search:ge}),!0}function Sk(e){return yk(e)}d();c();l();u();d();c();l();u();function vk(e){if(!O2(e))throw K;let t=oe(e),r=Dc(e),n=()=>e.state,o=()=>{let a=n().search.duration/1e3;return Math.round((a+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function O2(e){return e.addReducers({search:ge,pagination:_r}),!0}function xk(e){return vk(e)}d();c();l();u();d();c();l();u();d();c();l();u();function Hh(_x176,_x177){return _Hh.apply(this,arguments)}function _Hh(){_Hh=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Hh.apply(this,arguments)}var Ri=Ae("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield Hh(o,e),i=yield t.apiClient.html(a);return vt(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x178,_x179){return _ref79.apply(this,arguments)}}()),Hc=P("resultPreview/next"),zc=P("resultPreview/previous"),Wc=P("resultPreview/prepare",e=>O(e,{results:new ie({required:!0})})),Ak=2048,Kc=Ae("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=CC(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>Ak&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${Ak} characters.`),{contentURL:o}});return function(_x180,_x181){return _ref80.apply(this,arguments)}}());d();c();l();u();var Ck=e=>X({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Jt(e);let n=pt(e,r),o=Ke(e);return t.makeDocumentQuickview(n,o)},analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});d();c();l();u();d();c();l();u();d();c();l();u();function uA(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var lA=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=uA();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},dA=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),zh=ae(uA(),e=>{e.addCase(Ri.pending,t=>{t.isLoading=!0}).addCase(Ri.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(z.fulfilled,(t,r)=>{lA(t),t.resultsWithPreview=dA(r.payload.response.results)}).addCase(br.fulfilled,(t,r)=>{lA(t),t.resultsWithPreview=t.resultsWithPreview.concat(dA(r.payload.response.results))}).addCase(Lt.fulfilled,lA).addCase(Wc,(t,r)=>{t.resultsWithPreview=dA(r.payload.results)}).addCase(Hc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(zc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Kc.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function bk(e,t,r,n,o){if(!_2(e))throw K;let{dispatch:a}=e,i=()=>e.state,p=oe(e),{result:f,maximumPreviewSize:m}=t.options,g=()=>{let{resultsWithPreview:C,position:h}=i().resultPreview;return C[h]},v=C=>{a(Kc({uniqueId:C,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(Ri({uniqueId:C,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){v(f.uniqueId)},next(){a(Hc()),v(g())},previous(){a(zc()),v(g())},get state(){let C=i(),h=f.hasHtmlVersion,A=C.resultPreview,b=f.uniqueId===A.uniqueId?A.content:"",w=A.isLoading,R=A.contentURL,E=g();return{content:b,resultHasPreview:h,isLoading:w,contentURL:R,currentResultUniqueId:E}}}}function _2(e){return e.addReducers({configuration:fe,resultPreview:zh}),!0}function wk(e,t){if(!N2(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=bk(e,t,Hh,"/html",()=>{e.dispatch(Ck(t.options.result))});return r(Wc({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function N2(e){return e.addReducers({search:ge}),!0}d();c();l();u();d();c();l();u();var Rk=()=>X("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),Fk=()=>X("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var D2={queries:new ie({required:!0,each:new U({emptyAllowed:!1})}),maxLength:new re({required:!0,min:1,default:10})},Fi=P("recentQueries/registerRecentQueries",e=>O(e,D2)),Yc=P("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function Ek(){return{queries:[],maxLength:10}}var Wh=ae(Ek(),e=>{e.addCase(Fi,q2).addCase(Yc,M2).addCase(z.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||V2(n,t)})});function q2(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function M2(e){e.queries=[]}function V2(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var j2={queries:[]},L2={maxLength:10,clearFilters:!0},U2=new Se({queries:new ie({required:!0})}),Q2=new Se({maxLength:new re({required:!0,min:1}),clearFilters:new de});function B2(e,t){$e(e,Q2,t?.options,"buildRecentQueriesList"),lt(e,U2,t?.initialState,"buildRecentQueriesList")}function Ik(e,t){if(!G2(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...L2,...t?.options},i={...j2,...t?.initialState};B2(e,{options:a,initialState:i});let p={queries:i.queries,maxLength:a.maxLength};return n(Fi(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(Yc())},updateRecentQueries(f){let m=new ie({required:!0,each:new U({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(Fi({queries:f,maxLength:a.maxLength}))},executeRecentQuery(f){let m=new re({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let g={q:this.state.queries[f],clearFilters:a.clearFilters};ud(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(Es(g))}}}function G2(e){return e.addReducers({search:ge,recentQueries:Wh,query:Ft}),!0}function Tk(e,t){let r=Ik(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(Rk()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(z({legacy:Fk(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var Pk=e=>X("analytics/recentResults/click",(t,r)=>(Jt(e),t.makeRecentResultClick(pt(e,r),Ke(e)))),kk=()=>X("analytics/recentResults/clear",e=>e.makeClearRecentResults());function Ok(e,t){return or(e,t,()=>e.dispatch(Pk(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function _k(){return{results:[],maxLength:10}}var Kh=ae(_k(),e=>{e.addCase(Lc,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Uc,t=>{t.results=[]}).addCase(Or,(t,r)=>{let n=r.payload;t.results=t.results.filter(a=>a.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});var $2={initialState:{results:[]},options:{maxLength:10}},H2=new Se({results:new ie({required:!0})}),z2=new Se({maxLength:new re({required:!0,min:1})});function W2(e,t){$e(e,z2,t?.options,"buildRecentResultsList"),lt(e,H2,t?.initialState,"buildRecentResultsList")}function Nk(e,t){if(!K2(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...$2,...t};W2(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n(Lc(i)),{...r,get state(){return o().recentResults},clear(){n(kk()),n(Uc())}}}function K2(e){return e.addReducers({recentResults:Kh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var qk=e=>{let t=/Document weights:\n((?:.)*?)\n+/g,r=/Terms weights:\n((?:.|\n)*)\n+/g,n=/Total weight: ([0-9]+)/g;if(!e)return null;let o=t.exec(e),a=r.exec(e),i=n.exec(e),p=X2(e),f=Mk(o?o[1]:null),m=Y2(a),g=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:g,qreWeights:p}},Mk=e=>{let t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,r=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(!e)return null;let n=e.match(t);if(!n)return null;let o={};for(let a of n){let i=a.match(r);if(i){let p=i[1],f=i[2];o[p]=Number(f)}}return o},Dk=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},Y2=e=>{let t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,r=/([^:]+): ([0-9]+), ([0-9]+); /g;if(!e||!e[1])return null;let n=Dk(e[1],t);if(!n)return null;let o={};for(let a of n){let i=Dk(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=Mk(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},X2=e=>{let t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,r=t.exec(e),n=[];for(;r;)n.push({expression:r[1],score:parseInt(r[2],10)}),r=t.exec(e);return n};function Vk(e){return e.search.response.results.map(r=>{let n=qk(r.rankingInfo);return{result:r,ranking:n}})}var J2=new Se({enabled:new de({default:!1})});function jk(e,t={}){if(!Z2(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;lt(e,J2,t.initialState,"buildRelevanceInspector").enabled&&n(Fo());let i=p=>{e.logger.warn(`Flag [ ${p} ] is now activated. This should *not* be used in any production environment as it negatively impact performance.`)};return{...r,get state(){let p=o(),f=p.debug;if(!p.debug)return{isEnabled:f};let{executionReport:m,basicExpression:g,advancedExpression:v,constantExpression:C,userIdentities:h,rankingExpressions:A}=p.search.response,{fieldsDescription:b,fetchAllFields:w}=p.fields;return{isEnabled:f,rankingInformation:Vk(p),executionReport:m,expressions:{basicExpression:g,advancedExpression:v,constantExpression:C},userIdentities:h,rankingExpressions:A,fieldsDescription:b,fetchAllFields:w}},enable(){n(Fo()),i("debug")},disable(){n(us()),n(Ci())},enableFetchAllFields(){n(_c()),i("fetchAllFields")},disableFetchAllFields(){n(Ci())},fetchFieldsDescription(){!this.state.isEnabled&&n(Fo()),n(Nc()),i("fieldsDescription"),e.logger.warn(`For production environment, please specify the necessary fields either when instantiating a ResultList controller, or by dispatching a registerFieldsToInclude action.
|
|
46
47
|
|
|
47
48
|
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.ResultListOptions.html
|
|
48
|
-
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function o$(e){return e.addReducers({debug:us,search:me,configuration:pe,fields:ra}),!0}d();c();l();u();d();c();l();u();var qh=e=>J({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Xt(e),t.makeDocumentOpen(ft(e,r),Ke(e))),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=ft(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});function dk(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(qh(t.options.result)))};return or(e,t,()=>{n(),e.dispatch(kr(t.options.result))})}d();c();l();u();function pk(e,t){return vh(e,{...t,fetchMoreResultsActionCreator:Cr})}d();c();l();u();d();c();l();u();var a$=new ye({numberOfResults:new re({min:0})});function fk(e,t={}){if(!i$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,i=dt(e,a$,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(gs(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(hs(p))},isSetTo(p){return p===this.state.numberOfResults}}}function i$(e){return e.addReducers({pagination:Or,configuration:pe}),!0}function mk(e,t={}){if(!s$(e))throw K;let r=fk(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(Lt({legacy:Qc(),next:Gc()}))}}}function s$(e){return e.addReducers({pagination:Or,configuration:pe}),!0}d();c();l();u();d();c();l();u();var na=()=>J("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),Mh=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var gk={id:W,query:Qe},Yc=I("querySet/register",e=>O(e,gk)),Fi=I("querySet/update",e=>O(e,gk));d();c();l();u();var oa=ae(Vp(),e=>{e.addCase(Yc,(t,r)=>u$(t,r.payload)).addCase(Fi,(t,r)=>{let{id:n,query:o}=r.payload;Wx(t,n,o)}).addCase(Mn,(t,r)=>{let{id:n,expression:o}=r.payload;Wx(t,n,o)}).addCase(z.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;hk(t,n)}).addCase(De,c$).addCase(_e.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))Wx(t,n,o)})});function c$(e,t){de(t.payload.q)||hk(e,t.payload.q)}function hk(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var Wx=(e,t,r)=>{t in e&&(e[t]=r)},u$=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var Vh=e=>J("analytics/querySuggest",(t,r)=>{let n=Kx(r,e);return t.makeOmniboxAnalytics(n)}),yk=()=>({actionCause:"omniboxAnalytics"});function Kx(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:a,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function Sk(e,t){let r=t.id;r in e||(e[r]=l$(t))}function vk(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function xk(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function Ak(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function l$(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var Ck=()=>({});var Jc=ae(Ck(),e=>e.addCase(kc,(t,r)=>{Sk(t,r.payload)}).addCase(tP,(t,r)=>{delete t[r.payload.id]}).addCase(ea.pending,vk).addCase(ea.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(ea.rejected,xk).addCase(Zo,(t,r)=>{Ak(t,r.payload)}).addCase(Is,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var jh={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},Yx={open:new U,close:new U},Jx={id:W,numberOfSuggestions:new re({min:0}),enableQuerySyntax:new le,highlightOptions:new X({values:{notMatchDelimiters:new X({values:Yx}),exactMatchDelimiters:new X({values:Yx}),correctionDelimiters:new X({values:Yx})}}),clearFilters:new le},bk=new ye(Jx);function wk(e,t){if(!p$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=t.options?.id||mo("search_box"),i={id:a,highlightOptions:{...t.options?.highlightOptions},...jh,...t.options};Ge(e,bk,i,"buildSearchBox"),n(Yc({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(kc({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(jt({enableQuerySyntax:i.enableQuerySyntax}));let p=()=>e.state.querySet[i.id],f=/*#__PURE__*/function(){var _ref81=_asyncToGenerator(function*(m){let{enableQuerySyntax:h,clearFilters:x}=i;n(Fs({q:p(),enableQuerySyntax:h,clearFilters:x})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x183){return _ref81.apply(this,arguments)}}();return{...r,updateText(m){n(Fi({id:a,query:m})),this.showSuggestions()},clear(){n(Fi({id:a,query:""})),n(Zo({id:a}))},showSuggestions(){i.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:a}))},selectSuggestion(m){n(Mn({id:a,expression:m})),f({legacy:Vh({id:a,suggestion:m}),next:yk()}).then(()=>{n(Zo({id:a}))})},submit(m=na(),h){f({legacy:m,next:h}),n(Zo({id:a}))},get state(){let m=o(),h=m.querySuggest[i.id],x=d$(h,i.highlightOptions),A=h?h.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:x,isLoading:m.search.isLoading,isLoadingSuggestions:A}}}}function d$(e,t){return e?e.completions.map(r=>({highlightedValue:Sy(r.highlighted,t),rawValue:r.expression})):[]}function p$(e){return e.addReducers({query:Ft,querySuggest:Jc,configuration:pe,querySet:oa,search:me}),!0}function Lh(e,t={}){let r=wk(e,{...t,executeSearchActionCreator:z,fetchQuerySuggestionsActionCreator:ea,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(na(),Mh())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var Xc=()=>J("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||yr()})),Uh=()=>({actionCause:"resultsSort"});function Fk(e,t){return e.q!==t.q?na():e.sortCriteria!==t.sortCriteria?Xc():e.firstResult!==t.firstResult?Bc():e.numberOfResults!==t.numberOfResults?Qc():Nr(e.f,t.f)?Yl(e.f,t.f):Nr(e.fExcluded,t.fExcluded)?Yl(e.fExcluded,t.fExcluded,!0):Nr(e.cf,t.cf)?Yl(e.cf,t.cf):Nr(e.af,t.af)?Yl(e.af,t.af):Nr(e.nf,t.nf)?Rk(e.nf,t.nf):Nr(e.df,t.df)?Rk(e.df,t.df):bo()}function Yl(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(A=>!o.includes(A));if(a.length){let A=a[0];switch(!0){case e[A].length>1:return bt(A);case r:return ao({facetId:A,facetValue:e[A][0]});default:return zr({facetId:A,facetValue:e[A][0]})}}let i=o.filter(A=>!n.includes(A));if(i.length){let A=i[0];return r?pr({facetId:A,facetValue:t[A][0]}):it({facetId:A,facetValue:t[A][0]})}let p=o.find(A=>t[A].filter(y=>e[A].includes(y)));if(!p)return bo();let f=e[p],m=t[p],h=m.filter(A=>!f.includes(A));if(h.length)return r?pr({facetId:p,facetValue:h[0]}):it({facetId:p,facetValue:h[0]});let x=f.filter(A=>!m.includes(A));return x.length?r?ao({facetId:p,facetValue:x[0]}):zr({facetId:p,facetValue:x[0]}):bo()}function Rk(e={},t={}){return Yl(eu(e),eu(t))}function Ek(e,t){return e.q!==t.q?Mh():e.sortCriteria!==t.sortCriteria?Uh():Nr(e.f,t.f)?Zc(e.f,t.f):Nr(e.fExcluded,t.fExcluded)?Zc(e.fExcluded,t.fExcluded,!0):Nr(e.cf,t.cf)?Zc(e.cf,t.cf):Nr(e.af,t.af)?Zc(e.af,t.af):Nr(e.nf,t.nf)?Zc(eu(e.nf),eu(t.nf)):Nr(e.df,t.df)?Zc(eu(e.df),eu(t.df)):os()}function Nr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function Zc(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(A=>!o.includes(A));if(a.length){let A=a[0];return e[A].length>1?Bt():so()}if(o.filter(A=>!n.includes(A)).length)return r?io():ht();let p=o.find(A=>t[A].filter(y=>e[A].includes(y)));if(!p)return os();let f=e[p],m=t[p];return m.filter(A=>!f.includes(A)).length?r?io():ht():f.filter(A=>!m.includes(A)).length?so():os()}function eu(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();function Ik(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function Tk(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{sortCriteria:n}:{}}function Qh(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([a])=>t(a)).map(([a,{request:i}])=>{let p=r(i);return p.length?{[a]:p}:{}}).reduce((a,i)=>({...a,...i}),{});return Object.keys(o).length?{[n]:o}:{}}function Pk(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function kk(e){return{q:pt().q,enableQuerySyntax:pt().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??Ur().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??Ur().defaultFilters.cq,firstResult:xr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??xr().defaultNumberOfResults,sortCriteria:yr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:Fo(),sf:{},tab:"",af:{},mnf:{}}}var f$=new ye({parameters:new X({options:{required:!0},values:wp})});function _k(e,t){let{dispatch:r}=e,n=oe(e);dt(e,f$,t.initialState,"buildSearchParameterManager");let o=Ok(e.state.tabSet,t.initialState.parameters);return r(De(o)),{...n,synchronize(a){let i=Ok(e.state.tabSet,Bh(e,a));r(De(i))},get state(){return{parameters:Xx(e)}}}}function Bh(e,t){return{...kk(e.state),...t}}function Ok(e,t){if(de(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:Nk(e)};if(!Object.values(e).some(n=>n.id===t.tab)){let n=Object.values(e).find(o=>o.isActive);return{...t,tab:n?.id??Nk(e)}}return t}function Nk(e){return Object.keys(e)[0]??""}function Xx(e){let t=e.state;return{...Ik(t.query,r=>r.q,pt().q),...Pk(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...Tk(t.sortCriteria,r=>r,yr()),...g$(t),...h$(t),...y$(t),...S$(t),...v$(t)}}function m$(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function Gh(e){let t=m$(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=nr(n?.tabs,t);return o&&a}}function Dk(e){return e.currentValues.filter(t=>t.state==="selected")}function g$(e){let t=e.facetSet;if(t===void 0)return{};let r=Gh(e),n={},o={};for(let[a,{request:i}]of Object.entries(t)){if(!r(a))continue;let p=i.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=i.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[a]=p),f.length&&(o[a]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function h$(e){return Qh(e.categoryFacetSet,Gh(e),t=>cr(t.currentValues).map(r=>r.value),"cf")}function y$(e){return Qh(e.numericFacetSet,Gh(e),Dk,"nf")}function S$(e){return Qh(e.dateFacetSet,Gh(e),Dk,"df")}function v$(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=x$(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function x$(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function $h(e,t){let{dispatch:r}=e,n=_k(e,t);return{...n,synchronize(o){let a=qk(e),i=Bh(e,a),p=Bh(e,o);zl(i,p)||(n.synchronize(o),r(z({legacy:Fk(i,p),next:Ek(i,p)})))},get state(){return{parameters:qk(e)}}}}function qk(e){let t=e.state;return{...Xx(e),...A$(t),...C$(t),...b$(t),...w$(t),...R$(t),...I$(t),...F$(t)}}function A$(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==pt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function C$(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function b$(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function w$(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==xr().firstResult?{firstResult:t}:{}}function R$(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function F$(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=E$(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function E$(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function I$(e){if(e.debug===void 0)return{};let t=e.debug;return t!==Fo()?{debug:t}:{}}d();c();l();u();function Mk(e){return _c(e)}d();c();l();u();d();c();l();u();d();c();l();u();var Hh=()=>new X({values:{questionAnswerId:W},options:{required:!0}}),Zx=()=>new X({values:{linkText:Qe,linkURL:Qe},options:{required:!0}});function tu(e){return O(e,Hh())}d();c();l();u();function ct(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&iR(e,r.contentIdKey,r.contentIdValue)}function Wr(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var eA=()=>J({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),tA=()=>J({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),rA=()=>J({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),nA=()=>J({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),oA=()=>J({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=ct(t);return e.makeOpenSmartSnippetSource(ft(r,t),Ke(r))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Jl=e=>J({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,Zx());let n=ct(r);return n?t.makeOpenSmartSnippetInlineLink(ft(n,r),{...Ke(n),...e}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),aA=()=>J("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),iA=()=>J("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),T$={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},sA=e=>J({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:T$[e]}}}),cA=e=>J({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),uA=e=>J({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{tu(e);let n=Wr(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Wr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),lA=e=>J({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{tu(e);let n=Wr(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Wr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),Xl=e=>J({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,Hh());let n=Wr(r,e.questionAnswerId);if(!n)return null;let o=ct(r,n.documentId);return o?t.makeOpenSmartSnippetSuggestionSource(ft(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Wr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),zh=(e,t)=>J({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,Hh()),O(t,Zx());let o=Wr(n,e.questionAnswerId);if(!o)return null;let a=ct(n,o.documentId);return a?r.makeOpenSmartSnippetSuggestionInlineLink(ft(a,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Wr(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let a=ct(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),Wh={logExpandSmartSnippet:eA,logCollapseSmartSnippet:tA,logLikeSmartSnippet:rA,logDislikeSmartSnippet:nA,logOpenSmartSnippetSource:oA,logOpenSmartSnippetInlineLink:Jl,logOpenSmartSnippetFeedbackModal:aA,logCloseSmartSnippetFeedbackModal:iA,logSmartSnippetFeedback:sA,logSmartSnippetDetailedFeedback:cA,logExpandSmartSnippetSuggestion:uA,logCollapseSmartSnippetSuggestion:lA,logOpenSmartSnippetSuggestionSource:Xl};d();c();l();u();d();c();l();u();var ru=I("smartSnippet/expand"),nu=I("smartSnippet/collapse"),ou=I("smartSnippet/like"),au=I("smartSnippet/dislike"),iu=I("smartSnippet/feedbackModal/open"),aa=I("smartSnippet/feedbackModal/close"),su=I("smartSnippet/related/expand",e=>tu(e)),cu=I("smartSnippet/related/collapse",e=>tu(e));d();c();l();u();d();c();l();u();var dA=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var Vk=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function jk({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return Ni({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function P$(e,t){let r=jk(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var jn=ae(dA(),e=>e.addCase(ru,t=>{t.expanded=!0}).addCase(nu,t=>{t.expanded=!1}).addCase(ou,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(au,t=>{t.liked=!1,t.disliked=!0}).addCase(iu,t=>{t.feedbackModalOpen=!0}).addCase(aa,t=>{t.feedbackModalOpen=!1}).addCase(z.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((a,i)=>P$(a,t.relatedQuestions[i])),o=jk(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...dA(),relatedQuestions:n,questionAnswerId:o}}).addCase(su,(t,r)=>{let n=Vk(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(cu,(t,r)=>{let n=Vk(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function Lk(e,t,r){if(!k$(e))throw K;let n=oe(e),o=()=>e.state,a=()=>ct(o()),i=null,p=or(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=a();if(!f){i=null;return}let{searchResponseId:m}=o().search;i!==m&&(i=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(kr(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:a()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(ru())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(nu())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(ou())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(au())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(iu())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(aa())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(aa())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(aa())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function k$(e){return e.addReducers({search:me,questionAnswering:jn}),!0}d();c();l();u();function Kh(e,t){if(!O$(e))throw K;let r=()=>e.state,n=new Set,o=h=>n.has(h)?!0:(n.add(h),!1),a=null,i=h=>{a!==h&&(a=h,f={},n.clear())},p=(h,x,A)=>or(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(x)||e.dispatch(A?zh({questionAnswerId:A},h):Jl(h))}),f={},m=(h,x)=>{let{searchResponseId:A}=r().search;i(A);let y=Ni({...h,questionAnswerId:x});return y in f||(f[y]=p(h,y,x)),f[y]};return{selectInlineLink(h,x){m(h,x)?.select()},beginDelayedSelectInlineLink(h,x){m(h,x)?.beginDelayedSelect()},cancelPendingSelectInlineLink(h,x){m(h,x)?.cancelPendingSelect()}}}function O$(e){return e.addReducers({search:me,questionAnswering:jn}),!0}function Uk(e,t){$o(e.state.configuration.analytics.analyticsMode);let r=Lk(e,Wh,t),n=Kh(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();l();u();d();c();l();u();function Qk(e,t){if(!N$(e))throw K;let r=oe(e),n=()=>e.state,o=a=>{let{contentIdKey:i,contentIdValue:p}=a;return e.state.search.results.find(f=>qo(f,i)===p)};return{...r,get state(){let a=n();return{questions:a.search.questionAnswer.relatedQuestions.map((i,p)=>({question:i.question,answer:i.answerSnippet,documentId:i.documentId,questionAnswerId:a.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:a.questionAnswering.relatedQuestions[p].expanded,source:o(i.documentId)}))}},expand(a){let i={questionAnswerId:a};e.dispatch(t.logExpandSmartSnippetSuggestion(i)),e.dispatch(su(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(cu(i))}}}function N$(e){return e.addReducers({search:me,questionAnswering:jn}),!0}d();c();l();u();function Bk(e,t){if(!_$(e))throw K;let r=()=>e.state,n=x=>{let A=r(),y=Wr(A,x);return y?ct(A,y.documentId):null},o=new Set,a=x=>o.has(x)?!0:(o.add(x),!1),i=null,p=x=>{i!==x&&(i=x,m={},o.clear())},f=(x,A)=>or(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(A)||(e.dispatch(Xl({questionAnswerId:A})),e.dispatch(kr(x)))}),m={},h=x=>{let{searchResponseId:A}=r().search;p(A);let y=n(x);return y?(x in m||(m[x]=f(y,x)),m[x]):null};return{selectSource(x){h(x)?.select()},beginDelayedSelectSource(x){h(x)?.beginDelayedSelect()},cancelPendingSelectSource(x){h(x)?.cancelPendingSelect()}}}function _$(e){return e.addReducers({search:me,questionAnswering:jn}),!0}function Gk(e,t){$o(e.state.configuration.analytics.analyticsMode);let r=Qk(e,Wh),n=Kh(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=Bk(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(a){o.selectSource(a)},beginDelayedSelectSource(a){o.beginDelayedSelectSource(a)},cancelPendingSelectSource(a){o.cancelPendingSelectSource(a)},selectInlineLink(a,i){n.selectInlineLink(i,a)},beginDelayedSelectInlineLink(a,i){n.beginDelayedSelectInlineLink(i,a)},cancelPendingSelectInlineLink(a,i){n.cancelPendingSelectInlineLink(i,a)}}}d();c();l();u();d();c();l();u();d();c();l();u();var $k={by:new bu({enum:Aa,required:!0})},uu=I("sortCriteria/register",e=>Hk(e)),lu=I("sortCriteria/update",e=>Hk(e)),Hk=e=>Oi(e)?(e.forEach(t=>O(t,$k)),{payload:e}):O(e,$k);d();c();l();u();var Yh=ae(yr(),e=>{e.addCase(uu,(t,r)=>en(r.payload)).addCase(lu,(t,r)=>en(r.payload)).addCase(_e.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(De,(t,r)=>r.payload.sortCriteria??t)});function D$(e,t){if(!t)return;let r=new ye({criterion:new ie({each:ow})}),n=q$(t),o={...t,criterion:n};dt(e,r,o,"buildSort")}function q$(e){return e.criterion?Oi(e.criterion)?e.criterion:[e.criterion]:[]}function zk(e,t){if(!M$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;D$(e,t.initialState);let a=t.initialState?.criterion;return a&&n(uu(a)),{...r,sortBy(i){n(lu(i)),n(on(1))},isSortedBy(i){return this.state.sortCriteria===en(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function M$(e){return e.addReducers({configuration:pe,sortCriteria:Yh}),!0}function Wk(e,t={}){let{dispatch:r}=e,n=zk(e,t),o=()=>r(z({legacy:Xc(),next:Uh()}));return{...n,get state(){return n.state},sortBy(a){n.sortBy(a),o()}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Kk(e){return e.type==="redirect"}var Jh=class{constructor(t){this.response=t}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let t=this.response.preprocessingOutput.triggers.filter(Kk);return t.length?t[0].content:null}};var du=I("standaloneSearchBox/register",e=>O(e,{id:W,redirectionUrl:W,overwrite:new le({required:!1})})),pu=I("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:W,redirectionUrl:W})),fu=I("standaloneSearchBox/reset",e=>O(e,{id:W})),mu=I("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:W})),gu=I("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),ia=xe("standaloneSearchBox/fetchRedirect",/*#__PURE__*/function(){var _ref82=_asyncToGenerator(function*(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:o,validatePayload:a,navigatorContext:i}}){a(e,{id:new U({emptyAllowed:!1})});let p=yield j$(r(),i),f=yield o.plan(p);if(vt(f))return n(f.error);let{redirectionUrl:m}=new Jh(f.success);return m&&t(V$(m)),m||""});return function(_x184,_x185){return _ref82.apply(this,arguments)}}()),V$=e=>J("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),j$=/*#__PURE__*/function(){var _ref83=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??lt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...(e.context&&{context:e.context.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.query.enableQuerySyntax&&{enableQuerySyntax:e.query.enableQuerySyntax}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield As(e.configuration.analytics):Lr(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function j$(_x186,_x187){return _ref83.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function Yk(){return{}}var Xh=ae(Yk(),e=>e.addCase(du,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=pA(o))}).addCase(fu,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=pA(o.defaultRedirectionUrl);return}}).addCase(pu,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=pA(o))}).addCase(ia.pending,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!0)}).addCase(ia.fulfilled,(t,r)=>{let n=r.payload,o=t[r.meta.arg.id];o&&(o.redirectTo=n||o.defaultRedirectionUrl,o.isLoading=!1)}).addCase(ia.rejected,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!1)}).addCase(mu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(gu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function pA(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var Jk=new ye({...Jx,redirectionUrl:new U({required:!0,emptyAllowed:!1}),overwrite:new le({required:!1})});function Xk(e,t){if(!L$(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=t.options.id||mo("standalone_search_box"),a={id:o,highlightOptions:{...t.options.highlightOptions},...jh,overwrite:!1,...t.options};Ge(e,Jk,a,"buildStandaloneSearchBox");let i=Lh(e,{options:a});return r(du({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(mu({id:o}))},selectSuggestion(p){let f=Kx(n(),{id:o,suggestion:p});r(Mn({id:o,expression:p})),r(gu({id:o,metadata:f})),this.submit()},afterRedirection(){r(fu({id:o}))},updateRedirectUrl(p){r(pu({id:o,redirectionUrl:p}))},submit(){r(jt({q:this.state.value,enableQuerySyntax:a.enableQuerySyntax})),r(ia({id:o}))},get state(){let f=n().standaloneSearchBoxSet[o];return{...i.state,isLoading:f.isLoading,redirectTo:f.redirectTo,analytics:f.analytics}}}}function L$(e){return e.addReducers({standaloneSearchBoxSet:Xh,configuration:pe,query:Ft,querySuggest:Jc}),!0}d();c();l();u();d();c();l();u();var Zh=ae(jp(),e=>e.addCase(vc,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]=n)}).addCase(lo,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(po,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="excluded";i.state=p?"idle":"excluded"}).addCase(Yo,(t,r)=>{let n=r.payload,o=t[n];o&&o.values.forEach(a=>{a.state="idle"})}).addCase(mt,t=>{Object.values(t).forEach(r=>{r.values.forEach(n=>{n.state="idle"})})}).addCase(De,(t,r)=>{let n=r.payload.sf||{};Object.entries(t).forEach(([o,a])=>{let i=n[o]||[];a.values.forEach(p=>{p.state=i.includes(p.caption)?"selected":"idle"})})}));d();c();l();u();function fA(e){return{state:"idle",...e}}var U$=new ye({id:yi,values:Og});function Zk(e,t){if(!Q$(e))throw K;Ge(e,U$,t.options,"buildStaticFilter");let r=oe(e),{dispatch:n}=e,o=()=>e.state,{id:a}=t.options;return n(vc(t.options)),{...r,toggleSelect(i){n(lo({id:a,value:i})),n(z({legacy:ey(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Yo(a)),n(lo({id:a,value:i})),n(z({legacy:ey(a,i)}))},toggleExclude(i){n(po({id:a,value:i})),n(z({legacy:ey(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Yo(a)),n(po({id:a,value:i})),n(z({legacy:ey(a,i)}))},deselectAll(){n(Yo(a)),n(z({legacy:_g({staticFilterId:a})}))},isValueSelected(i){return i.state==="selected"},isValueExcluded(i){return i.state==="excluded"},get state(){let i=o().staticFilterSet[a]?.values||[],p=i.some(f=>f.state!=="idle");return{id:a,values:i,hasActiveValues:p}}}}function Q$(e){return e.addReducers({staticFilterSet:Zh}),!0}function ey(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?Ng:xc)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var B$=new ye({expression:Qe,id:W,clearFiltersOnTabChange:new le}),G$=new ye({isActive:new le});function eO(e,t){if(H$(t.options.id),!$$(e))throw K;let r=oe(e),{dispatch:n}=e;Ge(e,B$,t.options,"buildTab");let o=dt(e,G$,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n(js({id:a,expression:i})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(yt(a)),{...r,select(){t.options.clearFiltersOnTabChange&&n(Fs({q:"",clearFilters:!0})),n(yt(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function $$(e){return e.addReducers({configuration:pe,tabSet:Ac}),!0}function H$(e){let t=Ls().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function tO(e,t){let{dispatch:r}=e,n=eO(e,t),o=()=>r(z({legacy:bo(),next:os()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();function rO(e){let t=Vg(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function nO(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function oO(e,t){let r=[],n=[],o=[],a=[];return t.forEach(i=>{switch(i.type){case"redirect":r.push(i.content);break;case"query":n.push(i.content);break;case"execute":o.push({functionName:i.content.name,params:i.content.params});break;case"notify":a.push(i.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=a,e}function aO(e,t){return e.queryModification={...t,queryToIgnore:""},e}function iO(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var sO=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var sa=ae(sO(),e=>e.addCase(z.pending,nO).addCase(z.fulfilled,(t,r)=>oO(t,r.payload.response.triggers)).addCase(Rs,(t,r)=>aO(t,r.payload)).addCase(ko,(t,r)=>iO(t,r.payload)));function cO(e){if(!z$(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.executions;return{...t,subscribe(a){let i=()=>{let p=!bi(this.state.executions,o,(f,m)=>f.functionName===m.functionName&&bi(f.params,m.params));o=this.state.executions,p&&this.state.executions.length&&(a(),r($p()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function z$(e){return e.addReducers({triggers:sa}),!0}d();c();l();u();d();c();l();u();function uO(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!W$(e))throw K;let n=oe(e),{dispatch:o}=e,a=()=>e.state,i=a().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!bi(i,this.state.notifications);i=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:a().triggers.notifications}}}}function W$(e){return e.addReducers({triggers:sa}),!0}function lO(e){return uO(e,{options:{logNotifyTriggerActionCreator:Bp}})}d();c();l();u();function dO(e){if(!K$(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=()=>n().triggers.queryModification.newQuery,a=()=>n().triggers.queryModification.originalQuery;return{...t,get state(){return{newQuery:o(),originalQuery:a(),wasQueryModified:o()!==""}},undo(){r(ko(o())),r(jt({q:a()})),r(z({legacy:Qp({undoneQuery:o()})}))}}}function K$(e){return e.addReducers({triggers:sa,query:Ft}),!0}d();c();l();u();function pO(e){if(!Y$(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.redirectTo;return{...t,subscribe(a){let i=()=>{let p=o!==this.state.redirectTo;o=this.state.redirectTo,p&&this.state.redirectTo&&(a(),r(Gp()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function Y$(e){return e.addReducers({triggers:sa}),!0}d();c();l();u();d();c();l();u();var mO="..",mA="...",J$=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,X$={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},ty="&",Zl="=";function ed(){return{serialize:t2(r2),deserialize:c2}}function td(e){return e in X$}function Z$(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function e2(e){let r=e in{nf:!0,df:!0,mnf:!0};return td(e)&&r}function gO(e){return Z$(e)||td(e)}var t2=e=>t=>Object.entries(t).map(e).filter(r=>r).join(ty);function r2(e){let[t,r]=e;return gO(t)?td(t)&&!e2(t)?o2(r)?i2(t,r):"":t==="nf"||t==="df"?a2(r)?s2(t,r):"":n2(t,r):""}function n2(e,t){return`${e}${Zl}${encodeURIComponent(t)}`}function o2(e){return gA(e)?hO(e,r=>typeof r=="string"):!1}function a2(e){return gA(e)?hO(e,r=>gA(r)&&"start"in r&&"end"in r):!1}function gA(e){return!!(e&&typeof e=="object")}function hO(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function i2(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${Zl}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(ty)}function s2(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?mA:mO}${i}`).join(",");return`${e}-${r}${Zl}${o}`}).join(ty)}function c2(e){return e.split(ty).map(n=>u2(n)).map(n=>l2(n)).filter(m2).map(n=>g2(n)).reduce((n,o)=>{let[a,i]=o;if(td(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function u2(e){let[t,...r]=e.split(Zl),n=r.join(Zl);return[t,n]}function l2(e,t=J$){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=d2(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function d2(e,t){return e==="nf"||e==="mnf"?p2(t,"selected"):e==="df"?f2(t,"selected"):t}function p2(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=yO(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(Pc({start:p,end:f,state:t,endInclusive:i}))}return r}function fO(e){try{return kw(e)?(Tp(e,Cs),!0):an(e)?(To(e),!0):!1}catch{return!1}}function f2(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=yO(n);!fO(a)||!fO(i)||r.push(Ko({start:a,end:i,state:t,endInclusive:o}))}return r}function m2(e){let t=gO(e[0]),r=e.length===2;return t&&r}function g2(e,t=!0){let[r,n]=e;return r==="enableQuerySyntax"?[r,n==="true"]:r==="debug"?[r,n==="true"]:r==="firstResult"?[r,parseInt(n,10)]:r==="numberOfResults"?[r,parseInt(n,10)]:td(r)?[r,h2(n)]:[r,t?decodeURIComponent(n):n]}function h2(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[o,a]=n;r[o]=a.map(i=>ki(i)?decodeURIComponent(i):i)}),r}function yO(e){let t=e.indexOf(mA)!==-1,[r,n]=e.split(t?mA:mO);return{isEndInclusive:t,startAsString:r,endAsString:n}}var y2=new ye({fragment:new U});function SO(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!v2(e))throw K;dt(e,y2,t.initialState,"buildUrlManager");let a=oe(e),i=t.initialState.fragment;n();let p=$h(e,{initialState:{parameters:ry(i)}});return{...a,subscribe(f){let m=()=>{let h=this.state.fragment;!S2(i,h)&&o()&&(i=h,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:ed().serialize(p.state.parameters)}},synchronize(f){i=f;let m=ry(f);p.synchronize(m)}}}function S2(e,t){if(e===t)return!0;let r=ry(e),n=ry(t);return zl(r,n)}function ry(e){return ed().deserialize(e)}function v2(e){return e.addReducers({configuration:pe}),!0}d();c();l();u();d();c();l();u();var vO=xe("analytics/addPageViewEntry",/*#__PURE__*/function(){var _ref84=_asyncToGenerator(function*(e,{getState:t}){t().configuration.analytics.enabled&&Jt.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});return function(_x188,_x189){return _ref84.apply(this,arguments)}}());function x2(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:vO}}d();c();l();u();d();c();l();u();d();c();l();u();var ca=()=>new U({required:!1,emptyAllowed:!0}),ny=I("advancedSearchQueries/update",e=>O(e,{aq:ca(),cq:ca(),lq:ca(),dq:ca()})),oy=I("advancedSearchQueries/register",e=>O(e,{aq:ca(),cq:ca(),lq:ca(),dq:ca()}));var xO=ae(Ur(),e=>{e.addCase(ny,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;Tt(n)||(t.aq=n,t.aqWasSet=!0),Tt(o)||(t.cq=o,t.cqWasSet=!0),Tt(a)||(t.lq=a,t.lqWasSet=!0),Tt(i)||(t.dq=i,t.dqWasSet=!0)}).addCase(oy,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;Tt(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Tt(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),Tt(a)||(t.defaultFilters.lq=a,t.lqWasSet||(t.lq=a)),Tt(i)||(t.defaultFilters.dq=i,t.dqWasSet||(t.dq=i))}).addCase(_e.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(De,(t,r)=>{let{aq:n,cq:o}=r.payload;Tt(n)||(t.aq=n,t.aqWasSet=!0),Tt(o)||(t.cq=o,t.cqWasSet=!0)})});function A2(e){return e.addReducers({advancedSearchQueries:xO}),{updateAdvancedSearchQueries:ny,registerAdvancedSearchQueries:oy}}d();c();l();u();function C2(e){return e.addReducers({}),{logDocumentOpen:qh,logOpenSmartSnippetSource:oA,logOpenSmartSnippetSuggestionSource:Xl,logOpenSmartSnippetInlineLink:Jl,logOpenSmartSnippetSuggestionInlineLink:zh}}d();c();l();u();function b2(e){return e.addReducers({}),{logSearchEvent:Sw,logClickEvent:vw,logCustomEvent:xw}}d();c();l();u();function w2(e){return e.addReducers({}),{logClearBreadcrumbs:mg,logInterfaceLoad:Sp,logSearchFromLink:vp,logOmniboxFromLink:xp,logInterfaceChange:bo,logDidYouMeanClick:Np,logCategoryFacetBreadcrumb:ag,logFacetBreadcrumb:yc,logFacetClearAll:bt,logFacetUnexclude:ao,logFacetExclude:pr,logFacetDeselect:zr,logFacetSelect:it,logFacetShowLess:hc,logFacetShowMore:gc,logFacetUpdateSort:Fn,logDateFacetBreadcrumb:Ll,logNumericFacetBreadcrumb:Ul,logNavigateBackward:Ch,logNavigateForward:Ah,logPageNext:Ph,logPageNumber:Bc,logPagePrevious:kh,logPagerResize:Qc,logSearchboxSubmit:na,logQuerySuggestionClick:Vh,logResultsSort:Xc,logDislikeSmartSnippet:nA,logLikeSmartSnippet:rA,logOpenSmartSnippetFeedbackModal:aA,logCloseSmartSnippetFeedbackModal:iA,logSmartSnippetFeedback:sA,logSmartSnippetDetailedFeedback:cA,logExpandSmartSnippet:eA,logCollapseSmartSnippet:tA,logExpandSmartSnippetSuggestion:uA,logCollapseSmartSnippetSuggestion:lA,logNoResultsBack:bh,logStaticFilterSelect:Ng,logStaticFilterDeselect:xc,logStaticFilterClearAll:_g,logTriggerQuery:Up,logUndoTriggerQuery:Qp,logNotifyTrigger:Bp,logTriggerRedirect:Gp,logTriggerExecute:$p}}d();c();l();u();function R2(e){return e.addReducers({}),{deselectAllBreadcrumbs:mt,deselectAllNonBreadcrumbs:ps}}d();c();l();u();function F2(e){return e.addReducers({configuration:pe}),{disableAnalytics:as,enableAnalytics:is,setOriginLevel2:Ap,setOriginLevel3:Cp,updateAnalyticsConfiguration:wo,updateBasicConfiguration:tn}}d();c();l();u();function E2(e){return e.addReducers({configuration:pe,pipeline:ds,searchHub:Ps}),{updateSearchConfiguration:Sr}}d();c();l();u();function I2(e){return e.addReducers({context:qg}),{addContext:vi,removeContext:xi,setContext:Si}}d();c();l();u();function T2(e){return e.addReducers({debug:us}),{disableDebug:cs,enableDebug:Ro}}d();c();l();u();function P2(e){return e.addReducers({dictionaryFieldContext:jg}),{addContext:bc,removeContext:wc,setContext:Cc}}d();c();l();u();function k2(e){return e.addReducers({didYouMean:Ug,query:Ft}),{applyDidYouMeanCorrection:vr,disableDidYouMean:kp,enableDidYouMean:bs,enableAutomaticQueryCorrection:Op,disableAutomaticQueryCorrection:ws,setCorrectionMode:wa}}d();c();l();u();d();c();l();u();d();c();l();u();var ay=I("excerptLength/set",e=>O(e,new re({min:0,required:!0})));d();c();l();u();function AO(){return{length:void 0}}var CO=ae(AO(),e=>{e.addCase(ay,(t,r)=>{t.length=r.payload})});function O2(e){return e.addReducers({excerptLength:CO}),{setExcerptLength:ay}}d();c();l();u();function N2(e){return e.addReducers({facetOptions:wt}),{updateFacetOptions:we,enableFacet:Qt,disableFacet:tt}}d();c();l();u();function _2(e){return e.addReducers({automaticFacetSet:Qg}),{setOptions:ac,deselectAllAutomaticFacetValues:ic,toggleSelectAutomaticFacetValue:gn}}d();c();l();u();function D2(e){return e.addReducers({categoryFacetSet:Sn}),{deselectAllCategoryFacetValues:yn,registerCategoryFacet:hn,toggleSelectCategoryFacetValue:zo,updateCategoryFacetNumberOfValues:ui,updateCategoryFacetSortCriterion:cc,updateFacetAutoSelection:rn,updateCategoryFacetBasePath:og}}d();c();l();u();function q2(e){return e.addReducers({facetSet:Ir}),{deselectAllFacetValues:rt,registerFacet:bn,toggleSelectFacetValue:wn,toggleExcludeFacetValue:Rn,updateFacetIsFieldExpanded:di,updateFacetNumberOfValues:li,updateFacetSortCriterion:mc,updateFreezeCurrentValues:oo,updateFacetAutoSelection:rn}}d();c();l();u();function M2(e){return e.addReducers({dateFacetSet:kn}),{deselectAllDateFacetValues:yg,registerDateFacet:En,toggleSelectDateFacetValue:In,toggleExcludeDateFacetValue:Tn,updateDateFacetSortCriterion:hg,updateDateFacetValues:co}}d();c();l();u();function V2(e){return e.addReducers({numericFacetSet:Tr}),{deselectAllNumericFacetValues:Pg,registerNumericFacet:On,toggleSelectNumericFacetValue:Nn,toggleExcludeNumericFacetValue:_n,updateNumericFacetSortCriterion:Tg,updateNumericFacetValues:uo}}d();c();l();u();function j2(e){return e.addReducers({fields:ra}),{registerFieldsToInclude:ta,enableFetchAllFields:Oc,disableFetchAllFields:Ai,fetchFieldsDescription:Nc}}d();c();l();u();function L2(e){return e.addReducers({folding:yh}),{registerFolding:Jo,loadCollection:Xo}}d();c();l();u();function U2(e){return e.addReducers({generatedAnswer:qc}),{generateAnswer:vf,resetAnswer:dr,setAnswerGenerationMode:sf}}d();c();l();u();function Q2(e){return e.addReducers({history:Fh,facetOrder:Vc}),{back:ol,forward:Rp}}d();c();l();u();function B2(e){return e.addReducers({instantResults:Ih}),{registerInstantResults:fs,updateInstantResultsQuery:nn,clearExpiredResults:ms}}d();c();l();u();function G2(e){return e.addReducers({pagination:Or}),{nextPage:Ss,previousPage:vs,registerNumberOfResults:gs,registerPage:ys,updateNumberOfResults:hs,updatePage:on}}d();c();l();u();function $2(e){return e.addReducers({pipeline:ds}),{setPipeline:ls}}d();c();l();u();function H2(e){return e.addReducers({query:Ft}),{updateQuery:jt}}d();c();l();u();function z2(e){return e.addReducers({querySet:oa}),{registerQuerySetQuery:Yc,updateQuerySetQuery:Fi}}d();c();l();u();function W2(e){return e.addReducers({querySuggest:Jc,querySet:oa}),{clearQuerySuggest:Zo,fetchQuerySuggestions:ea,registerQuerySuggest:kc,selectQuerySuggestion:Mn}}d();c();l();u();function K2(e){return e.addReducers({questionAnswering:jn}),{collapseSmartSnippet:nu,expandSmartSnippet:ru,dislikeSmartSnippet:au,likeSmartSnippet:ou,openFeedbackModal:iu,closeFeedbackModal:aa,expandSmartSnippetRelatedQuestion:su,collapseSmartSnippetRelatedQuestion:cu}}d();c();l();u();function Y2(e){return e.addReducers({recentQueries:_h}),{registerRecentQueries:Ri,clearRecentQueries:Kc}}d();c();l();u();function J2(e){return e.addReducers({recentResults:Dh}),{registerRecentResults:jc,clearRecentResults:Lc,pushRecentResult:kr}}d();c();l();u();function X2(e){return e.addReducers({resultPreview:Nh}),{fetchResultContent:wi,updateContentURL:Wc,nextPreview:$c,previousPreview:Hc,preparePreviewPagination:zc}}d();c();l();u();d();c();l();u();var Z2=new ye({content:new Ue({required:!0}),conditions:new Ue({required:!0}),priority:new re({required:!1,default:0,min:0}),fields:new ie({required:!1,each:W})});function bO(){let e=[],t=r=>{let n=Z2.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new Cu("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(a=>a(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.linkContent:null}}}function wO(e){if(!eH(e))throw K;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=bO();return{registerTemplates:(...o)=>{t(...o);let a=[];o.forEach(i=>{i.fields&&a.push(...i.fields)}),e.dispatch(ta(a))},selectTemplate:r,selectLinkTemplate:n}}function eH(e){return e.addReducers({fields:ra}),!0}d();c();l();u();function tH(e){return e.addReducers({search:me}),{executeSearch:zw,fetchMoreResults:Kw,fetchFacetValues:Yw,fetchPage:Ww,fetchInstantResults:Jw}}d();c();l();u();function rH(e){return e.addReducers({searchHub:Ps}),{setSearchHub:Ts}}d();c();l();u();function nH(e){return e.addReducers({facetOrder:Vc,facetSet:Ir,pagination:Or,query:Ft,querySet:oa}),{restoreSearchParameters:De,restoreTab:ss}}d();c();l();u();function oH(e){let{by:t,order:r}=e;switch(t){case"relevancy":return ts();case"qre":return fp();case"nosort":return mp();case"date":if(!r)throw new Error("An order (i.e., ascending or descending) should be specified for a sort criterion sorted by \"date\"");return dp(r);default:if(!r)throw new Error(`An order (i.e., ascending or descending) should be specified for a sort criterion sorted by a field, such as "${t}"`);return pp(t,r)}}function aH(e){return e===void 0||e==="ascending"||e==="descending"}function RO(e){let t=e.split(","),r=new Error(`Wrong criterion expression format for "${e}"`);if(!t.length)throw r;return t.map(n=>{let o=n.trim().split(" "),a=o[0].toLowerCase(),i=o[1]?.toLowerCase();if(o.length>2||a==="")throw r;if(!aH(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return oH({by:a,order:i})})}d();c();l();u();function iH(e){return e.addReducers({sortCriteria:Yh}),{registerSortCriterion:uu,updateSortCriterion:lu}}d();c();l();u();function sH(e){return e.addReducers({standaloneSearchBoxSet:Xh}),{registerStandaloneSearchBox:du,fetchRedirectUrl:ia,updateStandaloneSearchBoxRedirectionUrl:pu,updateAnalyticsToSearchFromLink:mu,updateAnalyticsToOmniboxFromLink:gu,resetStandaloneSearchBox:fu}}d();c();l();u();function cH(e){return e.addReducers({staticFilterSet:Zh}),{registerStaticFilter:vc,toggleSelectStaticFilterValue:lo,toggleExcludeStaticFilterValue:po,deselectAllStaticFilterValues:Yo}}d();c();l();u();function uH(e){return e.addReducers({tabSet:Ac}),{registerTab:js,updateActiveTab:yt}}d();c();l();u();d();c();l();u();d();c();l();u();function Et(e){return e.negate?"NOT ":""}d();c();l();u();function _r(e){return{contains:"=",differentThan:"<>",fuzzyMatch:"~=",greaterThan:">",greaterThanOrEqual:">=",isExactly:"==",lowerThan:"<",lowerThanOrEqual:"<=",phoneticMatch:"%=",regexMatch:"/=",wildcardMatch:"*="}[e]}function FO(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=_r(e.operator);return`${Et(e)}@${t}${n}${r}`}}}d();c();l();u();function EO(e){return{toQuerySyntax(){let t=Et(e),{field:r,from:n,to:o}=e,a=_r("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function IO(e){return{toQuerySyntax(){let t=Et(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function TO(e){return{toQuerySyntax(){let t=Et(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function PO(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function kO(e){return{toQuerySyntax(){let t=Et(e),{startTerm:r,otherTerms:n}=e,o=lH(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function lH(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function OO(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Et(e),o=_r(e.operator);return`${n}@${t}${o}${r}`}}}d();c();l();u();function NO(e){return{toQuerySyntax(){let t=Et(e),{field:r,from:n,to:o}=e,a=_r("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function _O(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=dH(r);return`$${t}(${n})`}}}function dH(e){return Object.entries(e).map(t=>{let[r,n]=t,o=typeof n=="string"?n:n.toQuerySyntax();return`${r}: ${o}`}).join(", ")}d();c();l();u();function DO(e){return{toQuerySyntax(){let t=Et(e),{field:r,operator:n,value:o}=e,a=_r(n),i=n==="fuzzyMatch"?` $quoteVar(value: ${o})`:`("${o}")`;return`${t}@${r}${a}${i}`}}}d();c();l();u();function qO(e){return{toQuerySyntax(){let{field:t}=e,r=Et(e),n=_r(e.operator),o=e.values.map(i=>`"${i}"`),a=o.length===1?o[0]:`(${o.join(",")})`;return`${r}@${t}${n}${a}`}}}function pH(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(PO(r)),this},addNear(r){return e.push(kO(r)),this},addExactMatch(r){return e.push(IO(r)),this},addFieldExists(r){return e.push(TO(r)),this},addStringField(r){return e.push(qO(r)),this},addStringFacetField(r){return e.push(DO(r)),this},addNumericField(r){return e.push(OO(r)),this},addNumericRangeField(r){return e.push(NO(r)),this},addDateField(r){return e.push(FO(r)),this},addDateRangeField(r){return e.push(EO(r)),this},addQueryExtension(r){return e.push(_O(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=fH(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function fH(e){return e==="and"?"AND":"OR"}/**
|
|
49
|
+
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function Z2(e){return e.addReducers({debug:ls,search:ge,configuration:fe,fields:na}),!0}d();c();l();u();d();c();l();u();var Yh=e=>X({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Jt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});function Lk(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Yh(t.options.result)))};return or(e,t,()=>{n(),e.dispatch(Or(t.options.result))})}d();c();l();u();function Uk(e,t){return _h(e,{...t,fetchMoreResultsActionCreator:br})}d();c();l();u();d();c();l();u();var e$=new Se({numberOfResults:new re({min:0})});function Qk(e,t={}){if(!t$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,i=lt(e,e$,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(hs(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(ys(p))},isSetTo(p){return p===this.state.numberOfResults}}}function t$(e){return e.addReducers({pagination:_r,configuration:fe}),!0}function Bk(e,t={}){if(!r$(e))throw K;let r=Qk(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(Lt({legacy:Bc(),next:$c()}))}}}function r$(e){return e.addReducers({pagination:_r,configuration:fe}),!0}d();c();l();u();d();c();l();u();var oa=()=>X("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),Xh=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var Gk={id:W,query:Be},Xc=P("querySet/register",e=>O(e,Gk)),Ei=P("querySet/update",e=>O(e,Gk));d();c();l();u();var aa=ae(Lp(),e=>{e.addCase(Xc,(t,r)=>o$(t,r.payload)).addCase(Ei,(t,r)=>{let{id:n,query:o}=r.payload;pA(t,n,o)}).addCase(Vn,(t,r)=>{let{id:n,expression:o}=r.payload;pA(t,n,o)}).addCase(z.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;$k(t,n)}).addCase(Me,n$).addCase(qe.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))pA(t,n,o)})});function n$(e,t){pe(t.payload.q)||$k(e,t.payload.q)}function $k(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var pA=(e,t,r)=>{t in e&&(e[t]=r)},o$=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var Jh=e=>X("analytics/querySuggest",(t,r)=>{let n=fA(r,e);return t.makeOmniboxAnalytics(n)}),Hk=()=>({actionCause:"omniboxAnalytics"});function fA(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:a,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function zk(e,t){let r=t.id;r in e||(e[r]=a$(t))}function Wk(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function Kk(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function Yk(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function a$(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var Xk=()=>({});var Jc=ae(Xk(),e=>e.addCase(Oc,(t,r)=>{zk(t,r.payload)}).addCase(PP,(t,r)=>{delete t[r.payload.id]}).addCase(ta.pending,Wk).addCase(ta.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(ta.rejected,Kk).addCase(ea,(t,r)=>{Yk(t,r.payload)}).addCase(Ts,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var Zh={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},mA={open:new U,close:new U},gA={id:W,numberOfSuggestions:new re({min:0}),enableQuerySyntax:new de,highlightOptions:new J({values:{notMatchDelimiters:new J({values:mA}),exactMatchDelimiters:new J({values:mA}),correctionDelimiters:new J({values:mA})}}),clearFilters:new de},Jk=new Se(gA);function Zk(e,t){if(!s$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=t.options?.id||go("search_box"),i={id:a,highlightOptions:{...t.options?.highlightOptions},...Zh,...t.options};$e(e,Jk,i,"buildSearchBox"),n(Xc({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(Oc({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(jt({enableQuerySyntax:i.enableQuerySyntax}));let p=()=>e.state.querySet[i.id],f=/*#__PURE__*/function(){var _ref81=_asyncToGenerator(function*(m){let{enableQuerySyntax:g,clearFilters:v}=i;n(Es({q:p(),enableQuerySyntax:g,clearFilters:v})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x182){return _ref81.apply(this,arguments)}}();return{...r,updateText(m){n(Ei({id:a,query:m})),this.showSuggestions()},clear(){n(Ei({id:a,query:""})),n(ea({id:a}))},showSuggestions(){i.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:a}))},selectSuggestion(m){n(Vn({id:a,expression:m})),f({legacy:Jh({id:a,suggestion:m}),next:Hk()}).then(()=>{n(ea({id:a}))})},submit(m=oa(),g){f({legacy:m,next:g}),n(ea({id:a}))},get state(){let m=o(),g=m.querySuggest[i.id],v=i$(g,i.highlightOptions),C=g?g.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:v,isLoading:m.search.isLoading,isLoadingSuggestions:C}}}}function i$(e,t){return e?e.completions.map(r=>({highlightedValue:Oy(r.highlighted,t),rawValue:r.expression})):[]}function s$(e){return e.addReducers({query:Ft,querySuggest:Jc,configuration:fe,querySet:aa,search:ge}),!0}function ey(e,t={}){let r=Zk(e,{...t,executeSearchActionCreator:z,fetchQuerySuggestionsActionCreator:ta,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(oa(),Xh())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var Zc=()=>X("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||Sr()})),ty=()=>({actionCause:"resultsSort"});function tO(e,t){return e.q!==t.q?oa():e.sortCriteria!==t.sortCriteria?Zc():e.firstResult!==t.firstResult?Gc():e.numberOfResults!==t.numberOfResults?Bc():Nr(e.f,t.f)?Jl(e.f,t.f):Nr(e.fExcluded,t.fExcluded)?Jl(e.fExcluded,t.fExcluded,!0):Nr(e.cf,t.cf)?Jl(e.cf,t.cf):Nr(e.af,t.af)?Jl(e.af,t.af):Nr(e.nf,t.nf)?eO(e.nf,t.nf):Nr(e.df,t.df)?eO(e.df,t.df):wo()}function Jl(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(C=>!o.includes(C));if(a.length){let C=a[0];switch(!0){case e[C].length>1:return bt(C);case r:return io({facetId:C,facetValue:e[C][0]});default:return Wr({facetId:C,facetValue:e[C][0]})}}let i=o.filter(C=>!n.includes(C));if(i.length){let C=i[0];return r?fr({facetId:C,facetValue:t[C][0]}):it({facetId:C,facetValue:t[C][0]})}let p=o.find(C=>t[C].filter(h=>e[C].includes(h)));if(!p)return wo();let f=e[p],m=t[p],g=m.filter(C=>!f.includes(C));if(g.length)return r?fr({facetId:p,facetValue:g[0]}):it({facetId:p,facetValue:g[0]});let v=f.filter(C=>!m.includes(C));return v.length?r?io({facetId:p,facetValue:v[0]}):Wr({facetId:p,facetValue:v[0]}):wo()}function eO(e={},t={}){return Jl(tu(e),tu(t))}function rO(e,t){return e.q!==t.q?Xh():e.sortCriteria!==t.sortCriteria?ty():Nr(e.f,t.f)?eu(e.f,t.f):Nr(e.fExcluded,t.fExcluded)?eu(e.fExcluded,t.fExcluded,!0):Nr(e.cf,t.cf)?eu(e.cf,t.cf):Nr(e.af,t.af)?eu(e.af,t.af):Nr(e.nf,t.nf)?eu(tu(e.nf),tu(t.nf)):Nr(e.df,t.df)?eu(tu(e.df),tu(t.df)):as()}function Nr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function eu(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(C=>!o.includes(C));if(a.length){let C=a[0];return e[C].length>1?Bt():co()}if(o.filter(C=>!n.includes(C)).length)return r?so():gt();let p=o.find(C=>t[C].filter(h=>e[C].includes(h)));if(!p)return as();let f=e[p],m=t[p];return m.filter(C=>!f.includes(C)).length?r?so():gt():f.filter(C=>!m.includes(C)).length?co():as()}function tu(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();function nO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function oO(e,t,r){if(e===void 0)return{};let n=t(e);return!nA(n,r)?{sortCriteria:n}:{}}function ry(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([a])=>t(a)).map(([a,{request:i}])=>{let p=r(i);return p.length?{[a]:p}:{}}).reduce((a,i)=>({...a,...i}),{});return Object.keys(o).length?{[n]:o}:{}}function aO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function iO(e){return{q:dt().q,enableQuerySyntax:dt().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??Qr().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??Qr().defaultFilters.cq,firstResult:Ar().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??Ar().defaultNumberOfResults,sortCriteria:Sr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:Eo(),sf:{},tab:"",af:{},mnf:{}}}var c$=new Se({parameters:new J({options:{required:!0},values:Fp})});function uO(e,t){let{dispatch:r}=e,n=oe(e);lt(e,c$,t.initialState,"buildSearchParameterManager");let o=sO(e.state.tabSet,t.initialState.parameters);return r(Me(o)),{...n,synchronize(a){let i=sO(e.state.tabSet,ny(e,a));r(Me(i))},get state(){return{parameters:hA(e)}}}}function ny(e,t){return{...iO(e.state),...t}}function sO(e,t){if(pe(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:cO(e)};if(!Object.values(e).some(n=>n.id===t.tab)){let n=Object.values(e).find(o=>o.isActive);return{...t,tab:n?.id??cO(e)}}return t}function cO(e){return Object.keys(e)[0]??""}function hA(e){let t=e.state;return{...nO(t.query,r=>r.q,dt().q),...aO(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...oO(t.sortCriteria,r=>r,Sr()),...l$(t),...d$(t),...p$(t),...f$(t),...m$(t)}}function u$(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function oy(e){let t=u$(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=nr(n?.tabs,t);return o&&a}}function lO(e){return e.currentValues.filter(t=>t.state==="selected")}function l$(e){let t=e.facetSet;if(t===void 0)return{};let r=oy(e),n={},o={};for(let[a,{request:i}]of Object.entries(t)){if(!r(a))continue;let p=i.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=i.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[a]=p),f.length&&(o[a]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function d$(e){return ry(e.categoryFacetSet,oy(e),t=>cr(t.currentValues).map(r=>r.value),"cf")}function p$(e){return ry(e.numericFacetSet,oy(e),lO,"nf")}function f$(e){return ry(e.dateFacetSet,oy(e),lO,"df")}function m$(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=g$(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function g$(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function ay(e,t){let{dispatch:r}=e,n=uO(e,t);return{...n,synchronize(o){let a=dO(e),i=ny(e,a),p=ny(e,o);Kl(i,p)||(n.synchronize(o),r(z({legacy:tO(i,p),next:rO(i,p)})))},get state(){return{parameters:dO(e)}}}}function dO(e){let t=e.state;return{...hA(e),...h$(t),...y$(t),...S$(t),...v$(t),...x$(t),...b$(t),...A$(t)}}function h$(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==dt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function y$(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function S$(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function v$(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==Ar().firstResult?{firstResult:t}:{}}function x$(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function A$(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=C$(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function C$(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function b$(e){if(e.debug===void 0)return{};let t=e.debug;return t!==Eo()?{debug:t}:{}}d();c();l();u();function pO(e){return Dc(e)}d();c();l();u();d();c();l();u();d();c();l();u();var iy=()=>new J({values:{questionAnswerId:W},options:{required:!0}}),yA=()=>new J({values:{linkText:Be,linkURL:Be},options:{required:!0}});function ru(e){return O(e,iy())}d();c();l();u();function ct(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&RR(e,r.contentIdKey,r.contentIdValue)}function Kr(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var SA=()=>X({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),vA=()=>X({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),xA=()=>X({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),AA=()=>X({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),CA=()=>X({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=ct(t);return e.makeOpenSmartSnippetSource(pt(r,t),Ke(r))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Zl=e=>X({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,yA());let n=ct(r);return n?t.makeOpenSmartSnippetInlineLink(pt(n,r),{...Ke(n),...e}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),bA=()=>X("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),wA=()=>X("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),w$={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},RA=e=>X({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:w$[e]}}}),FA=e=>X({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),EA=e=>X({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{ru(e);let n=Kr(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Kr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),IA=e=>X({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{ru(e);let n=Kr(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Kr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),ed=e=>X({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,iy());let n=Kr(r,e.questionAnswerId);if(!n)return null;let o=ct(r,n.documentId);return o?t.makeOpenSmartSnippetSuggestionSource(pt(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Kr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),sy=(e,t)=>X({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,iy()),O(t,yA());let o=Kr(n,e.questionAnswerId);if(!o)return null;let a=ct(n,o.documentId);return a?r.makeOpenSmartSnippetSuggestionInlineLink(pt(a,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Kr(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let a=ct(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),cy={logExpandSmartSnippet:SA,logCollapseSmartSnippet:vA,logLikeSmartSnippet:xA,logDislikeSmartSnippet:AA,logOpenSmartSnippetSource:CA,logOpenSmartSnippetInlineLink:Zl,logOpenSmartSnippetFeedbackModal:bA,logCloseSmartSnippetFeedbackModal:wA,logSmartSnippetFeedback:RA,logSmartSnippetDetailedFeedback:FA,logExpandSmartSnippetSuggestion:EA,logCollapseSmartSnippetSuggestion:IA,logOpenSmartSnippetSuggestionSource:ed};d();c();l();u();d();c();l();u();var nu=P("smartSnippet/expand"),ou=P("smartSnippet/collapse"),au=P("smartSnippet/like"),iu=P("smartSnippet/dislike"),su=P("smartSnippet/feedbackModal/open"),ia=P("smartSnippet/feedbackModal/close"),cu=P("smartSnippet/related/expand",e=>ru(e)),uu=P("smartSnippet/related/collapse",e=>ru(e));d();c();l();u();d();c();l();u();var TA=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var fO=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function mO({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return Ni({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function R$(e,t){let r=mO(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var Ln=ae(TA(),e=>e.addCase(nu,t=>{t.expanded=!0}).addCase(ou,t=>{t.expanded=!1}).addCase(au,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(iu,t=>{t.liked=!1,t.disliked=!0}).addCase(su,t=>{t.feedbackModalOpen=!0}).addCase(ia,t=>{t.feedbackModalOpen=!1}).addCase(z.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((a,i)=>R$(a,t.relatedQuestions[i])),o=mO(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...TA(),relatedQuestions:n,questionAnswerId:o}}).addCase(cu,(t,r)=>{let n=fO(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(uu,(t,r)=>{let n=fO(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function gO(e,t,r){if(!F$(e))throw K;let n=oe(e),o=()=>e.state,a=()=>ct(o()),i=null,p=or(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=a();if(!f){i=null;return}let{searchResponseId:m}=o().search;i!==m&&(i=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(Or(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:a()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(nu())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(ou())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(au())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(iu())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(su())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(ia())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(ia())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(ia())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function F$(e){return e.addReducers({search:ge,questionAnswering:Ln}),!0}d();c();l();u();function uy(e,t){if(!E$(e))throw K;let r=()=>e.state,n=new Set,o=g=>n.has(g)?!0:(n.add(g),!1),a=null,i=g=>{a!==g&&(a=g,f={},n.clear())},p=(g,v,C)=>or(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(v)||e.dispatch(C?sy({questionAnswerId:C},g):Zl(g))}),f={},m=(g,v)=>{let{searchResponseId:C}=r().search;i(C);let h=Ni({...g,questionAnswerId:v});return h in f||(f[h]=p(g,h,v)),f[h]};return{selectInlineLink(g,v){m(g,v)?.select()},beginDelayedSelectInlineLink(g,v){m(g,v)?.beginDelayedSelect()},cancelPendingSelectInlineLink(g,v){m(g,v)?.cancelPendingSelect()}}}function E$(e){return e.addReducers({search:ge,questionAnswering:Ln}),!0}function hO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=gO(e,cy,t),n=uy(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();l();u();d();c();l();u();function yO(e,t){if(!I$(e))throw K;let r=oe(e),n=()=>e.state,o=a=>{let{contentIdKey:i,contentIdValue:p}=a;return e.state.search.results.find(f=>Mo(f,i)===p)};return{...r,get state(){let a=n();return{questions:a.search.questionAnswer.relatedQuestions.map((i,p)=>({question:i.question,answer:i.answerSnippet,documentId:i.documentId,questionAnswerId:a.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:a.questionAnswering.relatedQuestions[p].expanded,source:o(i.documentId)}))}},expand(a){let i={questionAnswerId:a};e.dispatch(t.logExpandSmartSnippetSuggestion(i)),e.dispatch(cu(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(uu(i))}}}function I$(e){return e.addReducers({search:ge,questionAnswering:Ln}),!0}d();c();l();u();function SO(e,t){if(!T$(e))throw K;let r=()=>e.state,n=v=>{let C=r(),h=Kr(C,v);return h?ct(C,h.documentId):null},o=new Set,a=v=>o.has(v)?!0:(o.add(v),!1),i=null,p=v=>{i!==v&&(i=v,m={},o.clear())},f=(v,C)=>or(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(C)||(e.dispatch(ed({questionAnswerId:C})),e.dispatch(Or(v)))}),m={},g=v=>{let{searchResponseId:C}=r().search;p(C);let h=n(v);return h?(v in m||(m[v]=f(h,v)),m[v]):null};return{selectSource(v){g(v)?.select()},beginDelayedSelectSource(v){g(v)?.beginDelayedSelect()},cancelPendingSelectSource(v){g(v)?.cancelPendingSelect()}}}function T$(e){return e.addReducers({search:ge,questionAnswering:Ln}),!0}function vO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=yO(e,cy),n=uy(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=SO(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(a){o.selectSource(a)},beginDelayedSelectSource(a){o.beginDelayedSelectSource(a)},cancelPendingSelectSource(a){o.cancelPendingSelectSource(a)},selectInlineLink(a,i){n.selectInlineLink(i,a)},beginDelayedSelectInlineLink(a,i){n.beginDelayedSelectInlineLink(i,a)},cancelPendingSelectInlineLink(a,i){n.cancelPendingSelectInlineLink(i,a)}}}d();c();l();u();d();c();l();u();d();c();l();u();var xO={by:new wu({enum:Ca,required:!0})},lu=P("sortCriteria/register",e=>AO(e)),du=P("sortCriteria/update",e=>AO(e)),AO=e=>_i(e)?(e.forEach(t=>O(t,xO)),{payload:e}):O(e,xO);d();c();l();u();var ly=ae(Sr(),e=>{e.addCase(lu,(t,r)=>tn(r.payload)).addCase(du,(t,r)=>tn(r.payload)).addCase(qe.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(Me,(t,r)=>r.payload.sortCriteria??t)});function P$(e,t){if(!t)return;let r=new Se({criterion:new ie({each:Cw})}),n=k$(t),o={...t,criterion:n};lt(e,r,o,"buildSort")}function k$(e){return e.criterion?_i(e.criterion)?e.criterion:[e.criterion]:[]}function CO(e,t){if(!O$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;P$(e,t.initialState);let a=t.initialState?.criterion;return a&&n(lu(a)),{...r,sortBy(i){n(du(i)),n(an(1))},isSortedBy(i){return this.state.sortCriteria===tn(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function O$(e){return e.addReducers({configuration:fe,sortCriteria:ly}),!0}function bO(e,t={}){let{dispatch:r}=e,n=CO(e,t),o=()=>r(z({legacy:Zc(),next:ty()}));return{...n,get state(){return n.state},sortBy(a){n.sortBy(a),o()}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function wO(e){return e.type==="redirect"}var dy=class{constructor(t){ye(this,"response",t)}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let t=this.response.preprocessingOutput.triggers.filter(wO);return t.length?t[0].content:null}};var pu=P("standaloneSearchBox/register",e=>O(e,{id:W,redirectionUrl:W,overwrite:new de({required:!1})})),fu=P("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:W,redirectionUrl:W})),mu=P("standaloneSearchBox/reset",e=>O(e,{id:W})),gu=P("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:W})),hu=P("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),sa=Ae("standaloneSearchBox/fetchRedirect",/*#__PURE__*/function(){var _ref82=_asyncToGenerator(function*(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:o,validatePayload:a,navigatorContext:i}}){a(e,{id:new U({emptyAllowed:!1})});let p=yield N$(r(),i),f=yield o.plan(p);if(vt(f))return n(f.error);let{redirectionUrl:m}=new dy(f.success);return m&&t(_$(m)),m||""});return function(_x183,_x184){return _ref82.apply(this,arguments)}}()),_$=e=>X("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),N$=/*#__PURE__*/function(){var _ref83=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...(e.context&&{context:e.context.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.query.enableQuerySyntax&&{enableQuerySyntax:e.query.enableQuerySyntax}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield Cs(e.configuration.analytics):Ur(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function N$(_x185,_x186){return _ref83.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function RO(){return{}}var py=ae(RO(),e=>e.addCase(pu,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=PA(o))}).addCase(mu,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=PA(o.defaultRedirectionUrl);return}}).addCase(fu,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=PA(o))}).addCase(sa.pending,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!0)}).addCase(sa.fulfilled,(t,r)=>{let n=r.payload,o=t[r.meta.arg.id];o&&(o.redirectTo=n||o.defaultRedirectionUrl,o.isLoading=!1)}).addCase(sa.rejected,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!1)}).addCase(gu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(hu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function PA(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var FO=new Se({...gA,redirectionUrl:new U({required:!0,emptyAllowed:!1}),overwrite:new de({required:!1})});function EO(e,t){if(!D$(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=t.options.id||go("standalone_search_box"),a={id:o,highlightOptions:{...t.options.highlightOptions},...Zh,overwrite:!1,...t.options};$e(e,FO,a,"buildStandaloneSearchBox");let i=ey(e,{options:a});return r(pu({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(gu({id:o}))},selectSuggestion(p){let f=fA(n(),{id:o,suggestion:p});r(Vn({id:o,expression:p})),r(hu({id:o,metadata:f})),this.submit()},afterRedirection(){r(mu({id:o}))},updateRedirectUrl(p){r(fu({id:o,redirectionUrl:p}))},submit(){r(jt({q:this.state.value,enableQuerySyntax:a.enableQuerySyntax})),r(sa({id:o}))},get state(){let f=n().standaloneSearchBoxSet[o];return{...i.state,isLoading:f.isLoading,redirectTo:f.redirectTo,analytics:f.analytics}}}}function D$(e){return e.addReducers({standaloneSearchBoxSet:py,configuration:fe,query:Ft,querySuggest:Jc}),!0}d();c();l();u();d();c();l();u();var fy=ae(Up(),e=>e.addCase(xc,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]=n)}).addCase(po,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(fo,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="excluded";i.state=p?"idle":"excluded"}).addCase(Xo,(t,r)=>{let n=r.payload,o=t[n];o&&o.values.forEach(a=>{a.state="idle"})}).addCase(ft,t=>{Object.values(t).forEach(r=>{r.values.forEach(n=>{n.state="idle"})})}).addCase(Me,(t,r)=>{let n=r.payload.sf||{};Object.entries(t).forEach(([o,a])=>{let i=n[o]||[];a.values.forEach(p=>{p.state=i.includes(p.caption)?"selected":"idle"})})}));d();c();l();u();function kA(e){return{state:"idle",...e}}var q$=new Se({id:Si,values:Hg});function IO(e,t){if(!M$(e))throw K;$e(e,q$,t.options,"buildStaticFilter");let r=oe(e),{dispatch:n}=e,o=()=>e.state,{id:a}=t.options;return n(xc(t.options)),{...r,toggleSelect(i){n(po({id:a,value:i})),n(z({legacy:my(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Xo(a)),n(po({id:a,value:i})),n(z({legacy:my(a,i)}))},toggleExclude(i){n(fo({id:a,value:i})),n(z({legacy:my(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Xo(a)),n(fo({id:a,value:i})),n(z({legacy:my(a,i)}))},deselectAll(){n(Xo(a)),n(z({legacy:Wg({staticFilterId:a})}))},isValueSelected(i){return i.state==="selected"},isValueExcluded(i){return i.state==="excluded"},get state(){let i=o().staticFilterSet[a]?.values||[],p=i.some(f=>f.state!=="idle");return{id:a,values:i,hasActiveValues:p}}}}function M$(e){return e.addReducers({staticFilterSet:fy}),!0}function my(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?zg:Ac)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var V$=new Se({expression:Be,id:W,clearFiltersOnTabChange:new de}),j$=new Se({isActive:new de});function TO(e,t){if(U$(t.options.id),!L$(e))throw K;let r=oe(e),{dispatch:n}=e;$e(e,V$,t.options,"buildTab");let o=lt(e,j$,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n(Ls({id:a,expression:i})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(ht(a)),{...r,select(){t.options.clearFiltersOnTabChange&&n(Es({q:"",clearFilters:!0})),n(ht(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function L$(e){return e.addReducers({configuration:fe,tabSet:Cc}),!0}function U$(e){let t=Us().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function PO(e,t){let{dispatch:r}=e,n=TO(e,t),o=()=>r(z({legacy:wo(),next:as()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();function kO(e){let t=Jg(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function OO(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function _O(e,t){let r=[],n=[],o=[],a=[];return t.forEach(i=>{switch(i.type){case"redirect":r.push(i.content);break;case"query":n.push(i.content);break;case"execute":o.push({functionName:i.content.name,params:i.content.params});break;case"notify":a.push(i.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=a,e}function NO(e,t){return e.queryModification={...t,queryToIgnore:""},e}function DO(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var qO=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var ca=ae(qO(),e=>e.addCase(z.pending,OO).addCase(z.fulfilled,(t,r)=>_O(t,r.payload.response.triggers)).addCase(Fs,(t,r)=>NO(t,r.payload)).addCase(Oo,(t,r)=>DO(t,r.payload)));function MO(e){if(!Q$(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.executions;return{...t,subscribe(a){let i=()=>{let p=!wi(this.state.executions,o,(f,m)=>f.functionName===m.functionName&&wi(f.params,m.params));o=this.state.executions,p&&this.state.executions.length&&(a(),r(zp()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function Q$(e){return e.addReducers({triggers:ca}),!0}d();c();l();u();d();c();l();u();function VO(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!B$(e))throw K;let n=oe(e),{dispatch:o}=e,a=()=>e.state,i=a().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!wi(i,this.state.notifications);i=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:a().triggers.notifications}}}}function B$(e){return e.addReducers({triggers:ca}),!0}function jO(e){return VO(e,{options:{logNotifyTriggerActionCreator:$p}})}d();c();l();u();function LO(e){if(!G$(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=()=>n().triggers.queryModification.newQuery,a=()=>n().triggers.queryModification.originalQuery;return{...t,get state(){return{newQuery:o(),originalQuery:a(),wasQueryModified:o()!==""}},undo(){r(Oo(o())),r(jt({q:a()})),r(z({legacy:Gp({undoneQuery:o()})}))}}}function G$(e){return e.addReducers({triggers:ca,query:Ft}),!0}d();c();l();u();function UO(e){if(!$$(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.redirectTo;return{...t,subscribe(a){let i=()=>{let p=o!==this.state.redirectTo;o=this.state.redirectTo,p&&this.state.redirectTo&&(a(),r(Hp()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function $$(e){return e.addReducers({triggers:ca}),!0}d();c();l();u();d();c();l();u();var BO="..",OA="...",H$=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,z$={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},gy="&",td="=";function rd(){return{serialize:Y$(X$),deserialize:nH}}function nd(e){return e in z$}function W$(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function K$(e){let r=e in{nf:!0,df:!0,mnf:!0};return nd(e)&&r}function GO(e){return W$(e)||nd(e)}var Y$=e=>t=>Object.entries(t).map(e).filter(r=>r).join(gy);function X$(e){let[t,r]=e;return GO(t)?nd(t)&&!K$(t)?Z$(r)?tH(t,r):"":t==="nf"||t==="df"?eH(r)?rH(t,r):"":J$(t,r):""}function J$(e,t){return`${e}${td}${encodeURIComponent(t)}`}function Z$(e){return _A(e)?$O(e,r=>typeof r=="string"):!1}function eH(e){return _A(e)?$O(e,r=>_A(r)&&"start"in r&&"end"in r):!1}function _A(e){return!!(e&&typeof e=="object")}function $O(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function tH(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${td}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(gy)}function rH(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?OA:BO}${i}`).join(",");return`${e}-${r}${td}${o}`}).join(gy)}function nH(e){return e.split(gy).map(n=>oH(n)).map(n=>aH(n)).filter(uH).map(n=>lH(n)).reduce((n,o)=>{let[a,i]=o;if(nd(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function oH(e){let[t,...r]=e.split(td),n=r.join(td);return[t,n]}function aH(e,t=H$){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=iH(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function iH(e,t){return e==="nf"||e==="mnf"?sH(t,"selected"):e==="df"?cH(t,"selected"):t}function sH(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=HO(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(kc({start:p,end:f,state:t,endInclusive:i}))}return r}function QO(e){try{return Yw(e)?(kp(e,bs),!0):sn(e)?(Po(e),!0):!1}catch{return!1}}function cH(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=HO(n);!QO(a)||!QO(i)||r.push(Yo({start:a,end:i,state:t,endInclusive:o}))}return r}function uH(e){let t=GO(e[0]),r=e.length===2;return t&&r}function lH(e,t=!0){let[r,n]=e;return r==="enableQuerySyntax"?[r,n==="true"]:r==="debug"?[r,n==="true"]:r==="firstResult"?[r,parseInt(n,10)]:r==="numberOfResults"?[r,parseInt(n,10)]:nd(r)?[r,dH(n)]:[r,t?decodeURIComponent(n):n]}function dH(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[o,a]=n;r[o]=a.map(i=>Oi(i)?decodeURIComponent(i):i)}),r}function HO(e){let t=e.indexOf(OA)!==-1,[r,n]=e.split(t?OA:BO);return{isEndInclusive:t,startAsString:r,endAsString:n}}var pH=new Se({fragment:new U});function zO(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!mH(e))throw K;lt(e,pH,t.initialState,"buildUrlManager");let a=oe(e),i=t.initialState.fragment;n();let p=ay(e,{initialState:{parameters:hy(i)}});return{...a,subscribe(f){let m=()=>{let g=this.state.fragment;!fH(i,g)&&o()&&(i=g,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:rd().serialize(p.state.parameters)}},synchronize(f){i=f;let m=hy(f);p.synchronize(m)}}}function fH(e,t){if(e===t)return!0;let r=hy(e),n=hy(t);return Kl(r,n)}function hy(e){return rd().deserialize(e)}function mH(e){return e.addReducers({configuration:fe}),!0}d();c();l();u();d();c();l();u();var WO=Ae("analytics/addPageViewEntry",/*#__PURE__*/function(){var _ref84=_asyncToGenerator(function*(e,{getState:t}){t().configuration.analytics.enabled&&Xt.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});return function(_x187,_x188){return _ref84.apply(this,arguments)}}());function gH(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:WO}}d();c();l();u();d();c();l();u();d();c();l();u();var ua=()=>new U({required:!1,emptyAllowed:!0}),yy=P("advancedSearchQueries/update",e=>O(e,{aq:ua(),cq:ua(),lq:ua(),dq:ua()})),Sy=P("advancedSearchQueries/register",e=>O(e,{aq:ua(),cq:ua(),lq:ua(),dq:ua()}));var KO=ae(Qr(),e=>{e.addCase(yy,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;Tt(n)||(t.aq=n,t.aqWasSet=!0),Tt(o)||(t.cq=o,t.cqWasSet=!0),Tt(a)||(t.lq=a,t.lqWasSet=!0),Tt(i)||(t.dq=i,t.dqWasSet=!0)}).addCase(Sy,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;Tt(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Tt(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),Tt(a)||(t.defaultFilters.lq=a,t.lqWasSet||(t.lq=a)),Tt(i)||(t.defaultFilters.dq=i,t.dqWasSet||(t.dq=i))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Me,(t,r)=>{let{aq:n,cq:o}=r.payload;Tt(n)||(t.aq=n,t.aqWasSet=!0),Tt(o)||(t.cq=o,t.cqWasSet=!0)})});function hH(e){return e.addReducers({advancedSearchQueries:KO}),{updateAdvancedSearchQueries:yy,registerAdvancedSearchQueries:Sy}}d();c();l();u();function yH(e){return e.addReducers({}),{logDocumentOpen:Yh,logOpenSmartSnippetSource:CA,logOpenSmartSnippetSuggestionSource:ed,logOpenSmartSnippetInlineLink:Zl,logOpenSmartSnippetSuggestionInlineLink:sy}}d();c();l();u();function SH(e){return e.addReducers({}),{logSearchEvent:Mw,logClickEvent:Vw,logCustomEvent:jw}}d();c();l();u();function vH(e){return e.addReducers({}),{logClearBreadcrumbs:Ig,logInterfaceLoad:xp,logSearchFromLink:Ap,logOmniboxFromLink:Cp,logInterfaceChange:wo,logDidYouMeanClick:Dp,logCategoryFacetBreadcrumb:vg,logFacetBreadcrumb:Sc,logFacetClearAll:bt,logFacetUnexclude:io,logFacetExclude:fr,logFacetDeselect:Wr,logFacetSelect:it,logFacetShowLess:yc,logFacetShowMore:hc,logFacetUpdateSort:En,logDateFacetBreadcrumb:Ql,logNumericFacetBreadcrumb:Bl,logNavigateBackward:qh,logNavigateForward:Dh,logPageNext:Gh,logPageNumber:Gc,logPagePrevious:$h,logPagerResize:Bc,logSearchboxSubmit:oa,logQuerySuggestionClick:Jh,logResultsSort:Zc,logDislikeSmartSnippet:AA,logLikeSmartSnippet:xA,logOpenSmartSnippetFeedbackModal:bA,logCloseSmartSnippetFeedbackModal:wA,logSmartSnippetFeedback:RA,logSmartSnippetDetailedFeedback:FA,logExpandSmartSnippet:SA,logCollapseSmartSnippet:vA,logExpandSmartSnippetSuggestion:EA,logCollapseSmartSnippetSuggestion:IA,logNoResultsBack:Mh,logStaticFilterSelect:zg,logStaticFilterDeselect:Ac,logStaticFilterClearAll:Wg,logTriggerQuery:Bp,logUndoTriggerQuery:Gp,logNotifyTrigger:$p,logTriggerRedirect:Hp,logTriggerExecute:zp}}d();c();l();u();function xH(e){return e.addReducers({}),{deselectAllBreadcrumbs:ft,deselectAllNonBreadcrumbs:fs}}d();c();l();u();function AH(e){return e.addReducers({configuration:fe}),{disableAnalytics:is,enableAnalytics:ss,setOriginLevel2:bp,setOriginLevel3:wp,updateAnalyticsConfiguration:Ro,updateBasicConfiguration:rn}}d();c();l();u();function CH(e){return e.addReducers({configuration:fe,pipeline:ps,searchHub:ks}),{updateSearchConfiguration:vr}}d();c();l();u();function bH(e){return e.addReducers({context:Yg}),{addContext:xi,removeContext:Ai,setContext:vi}}d();c();l();u();function wH(e){return e.addReducers({debug:ls}),{disableDebug:us,enableDebug:Fo}}d();c();l();u();function RH(e){return e.addReducers({dictionaryFieldContext:Zg}),{addContext:wc,removeContext:Rc,setContext:bc}}d();c();l();u();function FH(e){return e.addReducers({didYouMean:th,query:Ft}),{applyDidYouMeanCorrection:xr,disableDidYouMean:_p,enableDidYouMean:ws,enableAutomaticQueryCorrection:Np,disableAutomaticQueryCorrection:Rs,setCorrectionMode:Ra}}d();c();l();u();d();c();l();u();d();c();l();u();var vy=P("excerptLength/set",e=>O(e,new re({min:0,required:!0})));d();c();l();u();function YO(){return{length:void 0}}var XO=ae(YO(),e=>{e.addCase(vy,(t,r)=>{t.length=r.payload})});function EH(e){return e.addReducers({excerptLength:XO}),{setExcerptLength:vy}}d();c();l();u();function IH(e){return e.addReducers({facetOptions:wt}),{updateFacetOptions:Fe,enableFacet:Qt,disableFacet:tt}}d();c();l();u();function TH(e){return e.addReducers({automaticFacetSet:rh}),{setOptions:ic,deselectAllAutomaticFacetValues:sc,toggleSelectAutomaticFacetValue:hn}}d();c();l();u();function PH(e){return e.addReducers({categoryFacetSet:vn}),{deselectAllCategoryFacetValues:Sn,registerCategoryFacet:yn,toggleSelectCategoryFacetValue:Wo,updateCategoryFacetNumberOfValues:li,updateCategoryFacetSortCriterion:uc,updateFacetAutoSelection:nn,updateCategoryFacetBasePath:Sg}}d();c();l();u();function kH(e){return e.addReducers({facetSet:Tr}),{deselectAllFacetValues:rt,registerFacet:wn,toggleSelectFacetValue:Rn,toggleExcludeFacetValue:Fn,updateFacetIsFieldExpanded:pi,updateFacetNumberOfValues:di,updateFacetSortCriterion:gc,updateFreezeCurrentValues:ao,updateFacetAutoSelection:nn}}d();c();l();u();function OH(e){return e.addReducers({dateFacetSet:On}),{deselectAllDateFacetValues:kg,registerDateFacet:In,toggleSelectDateFacetValue:Tn,toggleExcludeDateFacetValue:Pn,updateDateFacetSortCriterion:Pg,updateDateFacetValues:uo}}d();c();l();u();function _H(e){return e.addReducers({numericFacetSet:Pr}),{deselectAllNumericFacetValues:Gg,registerNumericFacet:_n,toggleSelectNumericFacetValue:Nn,toggleExcludeNumericFacetValue:Dn,updateNumericFacetSortCriterion:Bg,updateNumericFacetValues:lo}}d();c();l();u();function NH(e){return e.addReducers({fields:na}),{registerFieldsToInclude:ra,enableFetchAllFields:_c,disableFetchAllFields:Ci,fetchFieldsDescription:Nc}}d();c();l();u();function DH(e){return e.addReducers({folding:kh}),{registerFolding:Jo,loadCollection:Zo}}d();c();l();u();function qH(e){return e.addReducers({generatedAnswer:Mc}),{generateAnswer:Af,resetAnswer:dr,setAnswerGenerationMode:uf}}d();c();l();u();function MH(e){return e.addReducers({history:Lh,facetOrder:jc}),{back:al,forward:Ep}}d();c();l();u();function VH(e){return e.addReducers({instantResults:Qh}),{registerInstantResults:ms,updateInstantResultsQuery:on,clearExpiredResults:gs}}d();c();l();u();function jH(e){return e.addReducers({pagination:_r}),{nextPage:vs,previousPage:xs,registerNumberOfResults:hs,registerPage:Ss,updateNumberOfResults:ys,updatePage:an}}d();c();l();u();function LH(e){return e.addReducers({pipeline:ps}),{setPipeline:ds}}d();c();l();u();function UH(e){return e.addReducers({query:Ft}),{updateQuery:jt}}d();c();l();u();function QH(e){return e.addReducers({querySet:aa}),{registerQuerySetQuery:Xc,updateQuerySetQuery:Ei}}d();c();l();u();function BH(e){return e.addReducers({querySuggest:Jc,querySet:aa}),{clearQuerySuggest:ea,fetchQuerySuggestions:ta,registerQuerySuggest:Oc,selectQuerySuggestion:Vn}}d();c();l();u();function GH(e){return e.addReducers({questionAnswering:Ln}),{collapseSmartSnippet:ou,expandSmartSnippet:nu,dislikeSmartSnippet:iu,likeSmartSnippet:au,openFeedbackModal:su,closeFeedbackModal:ia,expandSmartSnippetRelatedQuestion:cu,collapseSmartSnippetRelatedQuestion:uu}}d();c();l();u();function $H(e){return e.addReducers({recentQueries:Wh}),{registerRecentQueries:Fi,clearRecentQueries:Yc}}d();c();l();u();function HH(e){return e.addReducers({recentResults:Kh}),{registerRecentResults:Lc,clearRecentResults:Uc,pushRecentResult:Or}}d();c();l();u();function zH(e){return e.addReducers({resultPreview:zh}),{fetchResultContent:Ri,updateContentURL:Kc,nextPreview:Hc,previousPreview:zc,preparePreviewPagination:Wc}}d();c();l();u();d();c();l();u();var WH=new Se({content:new Qe({required:!0}),conditions:new Qe({required:!0}),priority:new re({required:!1,default:0,min:0}),fields:new ie({required:!1,each:W})});function JO(){let e=[],t=r=>{let n=WH.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new bu("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(a=>a(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.linkContent:null}}}function ZO(e){if(!KH(e))throw K;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=JO();return{registerTemplates:(...o)=>{t(...o);let a=[];o.forEach(i=>{i.fields&&a.push(...i.fields)}),e.dispatch(ra(a))},selectTemplate:r,selectLinkTemplate:n}}function KH(e){return e.addReducers({fields:na}),!0}d();c();l();u();function YH(e){return e.addReducers({search:ge}),{executeSearch:pR,fetchMoreResults:mR,fetchFacetValues:gR,fetchPage:fR,fetchInstantResults:hR}}d();c();l();u();function XH(e){return e.addReducers({searchHub:ks}),{setSearchHub:Ps}}d();c();l();u();function JH(e){return e.addReducers({facetOrder:jc,facetSet:Tr,pagination:_r,query:Ft,querySet:aa}),{restoreSearchParameters:Me,restoreTab:cs}}d();c();l();u();function ZH(e){let{by:t,order:r}=e;switch(t){case"relevancy":return rs();case"qre":return gp();case"nosort":return hp();case"date":if(!r)throw new Error("An order (i.e., ascending or descending) should be specified for a sort criterion sorted by \"date\"");return fp(r);default:if(!r)throw new Error(`An order (i.e., ascending or descending) should be specified for a sort criterion sorted by a field, such as "${t}"`);return mp(t,r)}}function e3(e){return e===void 0||e==="ascending"||e==="descending"}function e_(e){let t=e.split(","),r=new Error(`Wrong criterion expression format for "${e}"`);if(!t.length)throw r;return t.map(n=>{let o=n.trim().split(" "),a=o[0].toLowerCase(),i=o[1]?.toLowerCase();if(o.length>2||a==="")throw r;if(!e3(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return ZH({by:a,order:i})})}d();c();l();u();function t3(e){return e.addReducers({sortCriteria:ly}),{registerSortCriterion:lu,updateSortCriterion:du}}d();c();l();u();function r3(e){return e.addReducers({standaloneSearchBoxSet:py}),{registerStandaloneSearchBox:pu,fetchRedirectUrl:sa,updateStandaloneSearchBoxRedirectionUrl:fu,updateAnalyticsToSearchFromLink:gu,updateAnalyticsToOmniboxFromLink:hu,resetStandaloneSearchBox:mu}}d();c();l();u();function n3(e){return e.addReducers({staticFilterSet:fy}),{registerStaticFilter:xc,toggleSelectStaticFilterValue:po,toggleExcludeStaticFilterValue:fo,deselectAllStaticFilterValues:Xo}}d();c();l();u();function o3(e){return e.addReducers({tabSet:Cc}),{registerTab:Ls,updateActiveTab:ht}}d();c();l();u();d();c();l();u();d();c();l();u();function Et(e){return e.negate?"NOT ":""}d();c();l();u();function Dr(e){return{contains:"=",differentThan:"<>",fuzzyMatch:"~=",greaterThan:">",greaterThanOrEqual:">=",isExactly:"==",lowerThan:"<",lowerThanOrEqual:"<=",phoneticMatch:"%=",regexMatch:"/=",wildcardMatch:"*="}[e]}function t_(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Dr(e.operator);return`${Et(e)}@${t}${n}${r}`}}}d();c();l();u();function r_(e){return{toQuerySyntax(){let t=Et(e),{field:r,from:n,to:o}=e,a=Dr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function n_(e){return{toQuerySyntax(){let t=Et(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function o_(e){return{toQuerySyntax(){let t=Et(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function a_(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function i_(e){return{toQuerySyntax(){let t=Et(e),{startTerm:r,otherTerms:n}=e,o=a3(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function a3(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function s_(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Et(e),o=Dr(e.operator);return`${n}@${t}${o}${r}`}}}d();c();l();u();function c_(e){return{toQuerySyntax(){let t=Et(e),{field:r,from:n,to:o}=e,a=Dr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function u_(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=i3(r);return`$${t}(${n})`}}}function i3(e){return Object.entries(e).map(t=>{let[r,n]=t,o=typeof n=="string"?n:n.toQuerySyntax();return`${r}: ${o}`}).join(", ")}d();c();l();u();function l_(e){return{toQuerySyntax(){let t=Et(e),{field:r,operator:n,value:o}=e,a=Dr(n),i=n==="fuzzyMatch"?` $quoteVar(value: ${o})`:`("${o}")`;return`${t}@${r}${a}${i}`}}}d();c();l();u();function d_(e){return{toQuerySyntax(){let{field:t}=e,r=Et(e),n=Dr(e.operator),o=e.values.map(i=>`"${i}"`),a=o.length===1?o[0]:`(${o.join(",")})`;return`${r}@${t}${n}${a}`}}}function s3(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(a_(r)),this},addNear(r){return e.push(i_(r)),this},addExactMatch(r){return e.push(n_(r)),this},addFieldExists(r){return e.push(o_(r)),this},addStringField(r){return e.push(d_(r)),this},addStringFacetField(r){return e.push(l_(r)),this},addNumericField(r){return e.push(s_(r)),this},addNumericRangeField(r){return e.push(c_(r)),this},addDateField(r){return e.push(t_(r)),this},addDateRangeField(r){return e.push(r_(r)),this},addQueryExtension(r){return e.push(u_(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=c3(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function c3(e){return e==="and"?"AND":"OR"}/**
|
|
49
50
|
* @license
|
|
50
51
|
*
|
|
51
52
|
* Copyright 2026 Coveo Solutions Inc.
|
|
@@ -78,4 +79,4 @@ fast-json-patch/module/duplex.mjs:
|
|
|
78
79
|
*)
|
|
79
80
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
80
81
|
|
|
81
|
-
window.coveoQuanticVersion = '3.37.
|
|
82
|
+
window.coveoQuanticVersion = '3.37.7';
|