@coveo/quantic 3.40.0 → 3.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/docs/out/quantic-docs.json +9 -0
  2. package/force-app/main/default/labels/CustomLabels.labels-meta.xml +91 -0
  3. package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +271 -22
  4. package/force-app/main/default/lwc/quanticGeneratedAnswer/quanticGeneratedAnswer.js +92 -31
  5. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/conversation.css +7 -0
  6. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/conversation.html +63 -0
  7. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.css +0 -11
  8. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +2 -2
  9. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +379 -0
  10. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/quanticGeneratedAnswerBody.js +152 -0
  11. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/quanticGeneratedAnswerBody.js-meta.xml +5 -0
  12. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/templates/answer.css +3 -0
  13. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/templates/answer.html +59 -0
  14. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/templates/cannotAnswer.html +7 -0
  15. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/templates/error.html +7 -0
  16. package/force-app/main/default/lwc/quanticGeneratedAnswerCopyToClipboard/__tests__/quanticGeneratedAnswerCopyToClipboard.test.js +5 -1
  17. package/force-app/main/default/lwc/quanticGeneratedAnswerCopyToClipboard/quanticGeneratedAnswerCopyToClipboard.js +9 -2
  18. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/__tests__/quanticGeneratedAnswerFollowUpInput.test.js +109 -55
  19. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/quanticGeneratedAnswerFollowUpInput.css +59 -11
  20. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/quanticGeneratedAnswerFollowUpInput.html +14 -13
  21. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/quanticGeneratedAnswerFollowUpInput.js +40 -2
  22. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/quanticGeneratedAnswerStreamOfThought.test.js +348 -0
  23. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/quanticGeneratedAnswerStreamOfThought.css +17 -0
  24. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/quanticGeneratedAnswerStreamOfThought.js +163 -0
  25. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/quanticGeneratedAnswerStreamOfThought.js-meta.xml +5 -0
  26. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/templates/collapsedSummary.css +1 -0
  27. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/templates/collapsedSummary.html +32 -0
  28. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/templates/streamOfThought.css +1 -0
  29. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/templates/streamOfThought.html +65 -0
  30. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/__tests__/quanticGeneratedAnswerThread.test.js +285 -0
  31. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.css +47 -0
  32. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.html +67 -0
  33. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.js +93 -0
  34. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.js-meta.xml +5 -0
  35. package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +22 -2
  36. package/force-app/main/default/lwc/quanticSourceCitations/quanticSourceCitations.js +7 -0
  37. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.css +0 -4
  38. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.html +1 -1
  39. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +15 -15
  40. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/pagination.d.ts +1 -1
  41. package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +1 -1
  42. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sub-controller/headless-sub-controller.d.ts +3 -1
  43. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recent-queries-list/headless-recent-queries-list.d.ts +13 -2
  44. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/did-you-mean/headless-did-you-mean.d.ts +10 -1
  45. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-core-generated-answer.d.ts +1 -0
  46. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-core-interactive-citation.d.ts +3 -3
  47. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-generated-answer.d.ts +2 -2
  48. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/interactive-citation-analytics-client.d.ts +3 -0
  49. package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/analytics-utils.d.ts +3 -2
  50. package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-actions.d.ts +32 -1
  51. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +26 -1
  52. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-analytics-actions.d.ts +2 -0
  53. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +19 -0
  54. package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +1 -1
  55. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/did-you-mean/headless-did-you-mean.ssr.d.ts +4 -3
  56. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +1 -1
  57. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +1 -1
  58. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/did-you-mean/headless-did-you-mean.ssr.d.ts +4 -3
  59. package/force-app/main/default/staticresources/coveoheadless/headless.js +18 -18
  60. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  61. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +14 -14
  62. package/package.json +2 -2
@@ -14,39 +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 x_=Object.create;var vu=Object.defineProperty;var C_=Object.getOwnPropertyDescriptor;var b_=Object.getOwnPropertyNames;var w_=Object.getPrototypeOf,R_=Object.prototype.hasOwnProperty;var F_=(e,t,r)=>t in e?vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ti=(e,t)=>()=>(e&&(t=e(e=0)),t);var It=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Au=(e,t)=>{for(var r in t)vu(e,r,{get:t[r],enumerable:!0})},jx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of b_(t))!R_.call(e,o)&&o!==r&&vu(e,o,{get:()=>t[o],enumerable:!(n=C_(t,o))||n.enumerable});return e};var Vr=(e,t,r)=>(r=e!=null?x_(w_(e)):{},jx(t||!e||!e.__esModule?vu(r,"default",{value:e,enumerable:!0}):r,e)),E_=e=>jx(vu({},"__esModule",{value:!0}),e);var de=(e,t,r)=>F_(e,typeof t!="symbol"?t+"":t,r);var y,c=Ti(()=>{"use strict";y=typeof globalThis<"u"?globalThis:window});function sd(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?sd=function(t){return typeof t}:sd=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sd(e)}function P_(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=k_.bind(this))}function k_(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","*/*"),I_(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):T_(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var I_,T_,u=Ti(()=>{"use strict";I_=function(t){return typeof t=="string"},T_=function(t){return t instanceof Blob};P_.call((typeof window>"u"?"undefined":sd(window))==="object"?window:{})});var Ty=It(xu=>{"use strict";d();c();l();u();Object.defineProperty(xu,"__esModule",{value:!0});function Lx(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 O_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function __(e,t,r){return t=Pi(t),D_(e,Gx()?Reflect.construct(t,r||[],Pi(e).constructor):t.apply(e,r))}function Fy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ux(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,j_(n.key),n)}}function Ey(e,t,r){return t&&Ux(e.prototype,t),r&&Ux(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qx(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=L_(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 wy(){return wy=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=q_(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},wy.apply(null,arguments)}function Pi(e){return Pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pi(e)}function N_(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&&Ry(e,t)}function Gx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gx=function(){return!!e})()}function D_(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 O_(e)}function Ry(e,t){return Ry=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ry(e,t)}function q_(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Pi(e))!==null;);return e}function M_(e,t,r,n){var o=wy(Pi(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function V_(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 j_(e){var t=V_(e,"string");return typeof t=="symbol"?t:t+""}function L_(e,t){if(e){if(typeof e=="string")return Lx(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)?Lx(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function U_(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 Q_(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 Bx=function(){function e(){Fy(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Ey(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}}}])}(),Iy=function(e){function t(){var r;return Fy(this,t),r=__(this,t),r.listeners||Bx.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 N_(t,e),Ey(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)),M_(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 cd;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 cd;function a(){o.abort(this.reason),i()}function i(){var g=Qx(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=Qx(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}}])}(Bx),cd=function(){function e(){Fy(this,e),Object.defineProperty(this,"signal",{value:new Iy,writable:!0,configurable:!0})}return Ey(e,[{key:"abort",value:function(r){var n=Q_(r),o=U_(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(cd.prototype[Symbol.toStringTag]="AbortController",Iy.prototype[Symbol.toStringTag]="AbortSignal");function B_(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 G_(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(!B_({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 x;h&&h.signal&&(x=h.signal,delete h.signal);var b=new o(C,h);return x&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:x}),b},f.prototype=o.prototype);var m=r,g=function(C,h){var x=f&&f.prototype.isPrototypeOf(C)?C.signal:h?h.signal:void 0;if(x){var b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(x.aborted)return Promise.reject(b);var w=new Promise(function(R,E){x.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=cd;xu.AbortSignal=Iy;xu.abortableFetch=G_});var $x,s,S,l=Ti(()=>{"use strict";$x=Vr(Ty(),1),s=Vr(Ty(),1),{fetch:S}=(0,$x.abortableFetch)({fetch})});function Py(e){return typeof e!="string"||e in{}}function ky(){return Object.create(null)}function Hx(e){return typeof e=="string"&&!!e.trim()}function Oy(e,t){var r=e.split(";").filter(Hx),n=r.shift(),o=$_(n),a=o.name,i=o.value;if(t=t?Object.assign({},ud,t):ud,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=ky();return p.name=a,p.value=i,r.forEach(function(f){var m=f.split("="),g=m.shift().trimLeft().toLowerCase();if(!Py(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 $_(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function ki(e,t){if(t=t?Object.assign({},ud,t):ud,!e)return t.map?ky():[];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(Hx),n&&(e=e.map(ld).flat()),t.map){var a=ky();return e.reduce(function(i,p){var f=Oy(p,t);return f&&!Py(f.name)&&(i[f.name]=f),i},a)}else return e.map(function(i){return Oy(i,t)}).filter(Boolean)}function ld(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 ud,zx=Ti(()=>{"use strict";d();c();l();u();ud={decodeValues:!0,map:!1,silent:!1,split:"auto"};ki.parseSetCookie=ki;ki.parse=ki;ki.parseString=Oy;ki.splitCookiesString=ld});function Cu(e){if(H_.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function _y(e){return e.replace(z_,"")}function bu(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||!W_(r))return!1}return!0}function W_(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function Kx(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 H_,Wx,z_,Yx,Oi,Ny,Xx,A,Zx=Ti(()=>{"use strict";d();c();l();u();zx();H_=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Wx=[`
19
- `,"\r","\t"," "],z_=new RegExp(`(^[${Wx.join("")}]|$[${Wx.join("")}])`,"g");Oi=Symbol("normalizedHeaders"),Ny=Symbol("rawHeaderNames"),Xx=", ",A=class Jx{constructor(t){this[Oi]={},this[Ny]=new Map,this[Yx]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof Jx||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(Xx):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(Xx):n)})}[(Yx=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[Oi]).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(!bu(t))throw new TypeError(`Invalid header name "${t}"`);return this[Oi].hasOwnProperty(Cu(t))}get(t){if(!bu(t))throw TypeError(`Invalid header name "${t}"`);return this[Oi][Cu(t)]??null}set(t,r){if(!bu(t)||!Kx(r))return;let n=Cu(t),o=_y(r);this[Oi][n]=_y(o),this[Ny].set(n,t)}append(t,r){if(!bu(t)||!Kx(r))return;let n=Cu(t),o=_y(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!bu(t)||!this.has(t))return;let r=Cu(t);delete this[Oi][r],this[Ny].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===""?[""]:ld(t)}}});var d=Ti(()=>{"use strict";Zx()});var fC=It(Iu=>{"use strict";d();c();l();u();var vd=Iu&&Iu.__assign||function(){return vd=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},vd.apply(this,arguments)};Object.defineProperty(Iu,"__esModule",{value:!0});var gN={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function hN(e){var t=vd(vd({},gN),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Iu.getSanitizedOptions=hN});var mC=It(Qy=>{"use strict";d();c();l();u();Object.defineProperty(Qy,"__esModule",{value:!0});function yN(e){var t=Math.random()*e;return Math.round(t)}Qy.fullJitter=yN});var gC=It(By=>{"use strict";d();c();l();u();Object.defineProperty(By,"__esModule",{value:!0});function SN(e){return e}By.noJitter=SN});var hC=It(Gy=>{"use strict";d();c();l();u();Object.defineProperty(Gy,"__esModule",{value:!0});var vN=mC(),AN=gC();function xN(e){return e.jitter==="full"?vN.fullJitter:AN.noJitter}Gy.JitterFactory=xN});var Hy=It($y=>{"use strict";d();c();l();u();Object.defineProperty($y,"__esModule",{value:!0});var CN=hC(),bN=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=CN.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}();$y.Delay=bN});var yC=It(Un=>{"use strict";d();c();l();u();var wN=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)}}(),RN=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())})},FN=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 EN=Hy(),IN=function(e){wN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return RN(this,void 0,void 0,function(){return FN(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}(EN.Delay);Un.SkipFirstDelay=IN});var SC=It(Tu=>{"use strict";d();c();l();u();var TN=Tu&&Tu.__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(Tu,"__esModule",{value:!0});var PN=Hy(),kN=function(e){TN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(PN.Delay);Tu.AlwaysDelay=kN});var vC=It(zy=>{"use strict";d();c();l();u();Object.defineProperty(zy,"__esModule",{value:!0});var ON=yC(),_N=SC();function NN(e,t){var r=DN(e);return r.setAttemptNumber(t),r}zy.DelayFactory=NN;function DN(e){return e.delayFirstAttempt?new _N.AlwaysDelay(e):new ON.SkipFirstDelay(e)}});var AC=It(la=>{"use strict";d();c();l();u();var Wy=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())})},Ky=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 qN=fC(),MN=vC();function VN(e,t){return t===void 0&&(t={}),Wy(this,void 0,void 0,function(){var r,n;return Ky(this,function(o){switch(o.label){case 0:return r=qN.getSanitizedOptions(t),n=new jN(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}la.backOff=VN;var jN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Wy(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 Wy(this,void 0,void 0,function(){var t;return Ky(this,function(r){switch(r.label){case 0:return t=MN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var kp=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=t()})(sv,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",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|YYYY|YY|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 B||!(!_||!_[T])},G=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 B(q)},V=E;V.l=G,V.i=D,V.w=function(_,N){return L(_,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var B=function(){function _(q){this.$L=G(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(x);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)},ye=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=(ye<He?ye+7:ye)-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 ye=this.clone().set(C,1);ye.$d[Z](ue),ye.init(),this.$d=ye.set(C,Math.min(this.$D,ye.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,ye=this.$d.getTime()+q*ue;return V.w(ye,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,ye=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 ye+1;case"MM":return V.s(ye+1,2,"0");case"MMM":return He(H.monthsShort,ye,Xe,3);case"MMMM":return He(Xe,ye);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),ye=(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-ye)/6048e5;break;case p:ne=(Ve-ye)/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=G(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=B.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,B,L),_.$i=!0),L},L.locale=G,L.isDayjs=D,L.unix=function(_){return L(1e3*_)},L.en=k[I],L.Ls=k,L.p={},L})});var Jw=It((uv,lv)=>{"use strict";d();c();l();u();(function(e,t){typeof uv=="object"&&typeof lv<"u"?lv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(uv,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 Zw=It((dv,pv)=>{"use strict";d();c();l();u();(function(e,t){typeof dv=="object"&&typeof pv<"u"?pv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(dv,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(x){return(x=+x)+(x>68?1900:2e3)},f=function(x){return function(b){this[x]=+b}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(x){(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}(x)}],g=function(x){var b=i[x];return b&&(b.indexOf?b:b.s.concat(b.f))},v=function(x,b){var w,R=i.meridiem;if(R){for(var E=1;E<=24;E+=1)if(x.indexOf(R(E,0,b))>-1){w=E>12;break}}else w=x===(b?"pm":"PM");return w},C={A:[a,function(x){this.afternoon=v(x,!1)}],a:[a,function(x){this.afternoon=v(x,!0)}],Q:[r,function(x){this.month=3*(x-1)+1}],S:[r,function(x){this.milliseconds=100*+x}],SS:[n,function(x){this.milliseconds=10*+x}],SSS:[/\d{3}/,function(x){this.milliseconds=+x}],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(x){var b=i.ordinal,w=x.match(/\d+/);if(this.day=w[0],b)for(var R=1;R<=31;R+=1)b(R).replace(/\[|\]/g,"")===x&&(this.day=R)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(x){var b=g("months"),w=(g("monthsShort")||b.map(function(R){return R.slice(0,3)})).indexOf(x)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[a,function(x){var b=g("months").indexOf(x)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(x){this.year=p(x)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function h(x){var b,w;b=x,w=i&&i.formats;for(var R=(x=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(L,V,B){var j=B&&B.toUpperCase();return V||w[B]||e[B]||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],G=T&&T[1];R[I]=G?{regex:D,parser:G}:k.replace(/^\[|\]$/g,"")}return function(L){for(var V={},B=0,j=0;B<E;B+=1){var _=R[B];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(x,b,w){w.p.customParseFormat=!0,x&&x.parseTwoDigitYear&&(p=x.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 G=D[1];if(typeof G=="string"){var L=D[2]===!0,V=D[3]===!0,B=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,ye=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||ye?1:Pe.getDate()),ut=ue||Pe.getFullYear(),yt=0;ue&&!ye||(yt=ye>0?ye-1:Pe.getMonth());var qr,or=Xe||0,Yr=Ue||0,fr=He||0,Mr=ze||0;return Ee?new Date(Date.UTC(ut,yt,Ie,or,Yr,fr,Mr+60*Ee.offset*1e3)):ne?new Date(Date.UTC(ut,yt,Ie,or,Yr,fr,Mr)):(qr=new Date(ut,yt,Ie,or,Yr,fr,Mr),Re&&(qr=te(qr).week(Re).toDate()),qr)}catch{return new Date("")}}(k,G,T,w),this.init(),j&&j!==!0&&(this.$L=this.locale(j).$L),B&&k!=this.format(G)&&(this.$d=new Date("")),i={}}else if(G instanceof Array)for(var _=G.length,N=1;N<=_;N+=1){D[1]=G[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 PF=It(($v,Hv)=>{"use strict";d();c();l();u();(function(e,t){typeof $v=="object"&&typeof Hv<"u"?Hv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})($v,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),x=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 x.formatToParts(h)},p=function(g,v){for(var C=i(g,v),h=[],x=0;x<C.length;x+=1){var b=C[x],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(),x=this.toDate(),b=x.toLocaleString("en-US",{timeZone:g}),w=Math.round((x-new Date(b))/1e3/60),R=15*-Math.round(x.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,x=C||v||a,b=p(+o(),x);if(typeof g!="string")return o(g).tz(x);var w=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(g,h).valueOf(),b,x),R=w[0],E=w[1],I=o(R).utcOffset(E);return I.$x.$timezone=x,I},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){a=g}}})});var kF=It((zv,Wv)=>{"use strict";d();c();l();u();(function(e,t){typeof zv=="object"&&typeof Wv<"u"?Wv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(zv,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 x={date:h,utc:!0,args:arguments};return new o(x)},i.utc=function(h){var x=a(this.toDate(),{locale:this.$L,utc:!0});return h?x.add(this.utcOffset(),e):x},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,x){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],G=60*+T[1]+ +T[2];return G===0?0:D==="+"?G:-G}(h),h===null))return this;var w=Math.abs(h)<=16?60*h:h;if(w===0)return this.utc(x);var R=this.clone();if(x)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 x=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,x)},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,x,b){if(h&&this.$u===h.$u)return C.call(this,h,x,b);var w=this.local(),R=a(h).local();return C.call(w,R,x,b)}}})});var jI=It((owe,VI)=>{"use strict";d();c();l();u();function RB(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}VI.exports=FB;function FB(e,t,r){var n=r&&r.stringify||RB,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 x=typeof t[g];if(x==="string"){m+="'"+t[g]+"'",v=h+2,h++;break}if(x==="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 HI=It((uwe,xg)=>{"use strict";d();c();l();u();var LI=jI();xg.exports=oo;var Vl=UB().console||{},EB={mapHttpRequest:Ag,mapHttpResponse:Ag,wrapRequestSerializer:jA,wrapResponseSerializer:jA,wrapErrorSerializer:jA,req:Ag,res:Ag,err:QI,errWithCause:QI};function zo(e,t){return e==="silent"?1/0:t.levels.values[e]}var QA=Symbol("pino.logFuncs"),LA=Symbol("pino.hierarchy"),IB={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function UI(e,t){let r={logger:t,parent:e[LA]};t[LA]=r}function TB(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Vl[o]||Vl[IB[o]||"log"]||ic}),e[QA]=n}function PB(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||Vl;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=PB(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=ic),TB(m,p,r),UI({},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:VB(e),messageKey:e.messageKey||"msg",onChild:e.onChild||ic};m.levels=kB(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=ic,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...b){return x.call(this,g,...b)},t&&(m._logEvent=UA());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,ui(this,g,m,"error"),ui(this,g,m,"fatal"),ui(this,g,m,"warn"),ui(this,g,m,"info"),ui(this,g,m,"debug"),ui(this,g,m,"trace"),i.forEach(w=>{ui(this,g,m,w)})}function x(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,BA([w],k,I,this._stdErrSerialize)}function T(G){this._childLevel=(G._childLevel|0)+1,this.bindings=w,I&&(this.serializers=I,this._serialize=k),t&&(this._logEvent=UA([].concat(G._logEvent.bindings,w)))}T.prototype=this;let D=new T(this);return UI(this,D),D.child=function(...G){return x.call(this,b,...G)},D.level=R.level||this.level,b.onChild(D),D}return m}function kB(e){let t=e.customLevels||{},r=Object.assign({},oo.levels.values,t),n=Object.assign({},oo.levels.labels,OB(t));return{values:r,labels:n}}function OB(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=EB;oo.stdTimeFunctions=Object.assign({},{nullTime:GI,epochTime:$I,unixTime:jB,isoTime:LB});function _B(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[LA];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function ui(e,t,r,n){if(Object.defineProperty(e,n,{value:zo(e.level,r)>zo(n,r)?ic:r[QA][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===ic){if(!t.transmit)return;let a=t.transmit.level||e.level,i=zo(a,r);if(zo(n,r)<i)return}e[n]=DB(e,t,r,n);let o=_B(e);o.length!==0&&(e[n]=NB(o,e[n]))}function NB(e,t){return function(){return t.apply(this,[...e,...arguments])}}function DB(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Vl?Vl:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&(BA(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters){let v=qB(this,n,p,i,t);if(t.reportCaller&&v&&v.length>0&&v[0]&&typeof v[0]=="object")try{let C=BI();C&&(v[0].caller=C)}catch{}o.call(f,...v)}else{if(t.reportCaller)try{let v=BI();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;MB(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[QA][n])}function qB(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?LI(p.shift(),p):void 0}else typeof f=="string"&&(f=LI(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function BA(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 MB(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||BA(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=UA(m)}function UA(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function QI(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 VB(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?GI:$I}function Ag(){return{}}function jA(e){return e}function ic(){}function GI(){return!1}function $I(){return Date.now()}function jB(){return Math.round(Date.now()/1e3)}function LB(){return new Date(Date.now()).toISOString()}function UB(){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)||{}}}xg.exports.default=oo;xg.exports.pino=oo;function BI(){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 A3={};Au(A3,{API_DATE_FORMAT:()=>Rs,DefaultFieldsToInclude:()=>rx,EcommerceDefaultFieldsToInclude:()=>qP,HighlightUtils:()=>My,MinimumFieldsToInclude:()=>qh,ResultTemplatesHelpers:()=>TR,SortBy:()=>ba,SortOrder:()=>ol,VERSION:()=>Ao,baseFacetResponseSelector:()=>Lr,buildAutomaticFacetGenerator:()=>KT,buildBreadcrumbManager:()=>TT,buildCategoryFacet:()=>iP,buildCategoryFieldSuggestions:()=>TP,buildContext:()=>OT,buildController:()=>oe,buildCriterionExpression:()=>tn,buildDateFacet:()=>AP,buildDateFilter:()=>CP,buildDateRange:()=>Yo,buildDateSortCriterion:()=>gp,buildDictionaryFieldContext:()=>DT,buildDidYouMean:()=>UT,buildExecuteTrigger:()=>GO,buildFacet:()=>mP,buildFacetConditionsManager:()=>NT,buildFacetManager:()=>BT,buildFieldSortCriterion:()=>hp,buildFieldSuggestions:()=>PP,buildFoldedResultList:()=>jP,buildGeneratedAnswer:()=>KP,buildHistoryManager:()=>lk,buildInstantResults:()=>Ak,buildInteractiveCitation:()=>XP,buildInteractiveGeneratedAnswerInlineLink:()=>ZP,buildInteractiveInstantResult:()=>dk,buildInteractiveRecentResult:()=>jk,buildInteractiveResult:()=>zk,buildNoSortCriterion:()=>Sp,buildNotifyTrigger:()=>HO,buildNumericFacet:()=>FP,buildNumericFilter:()=>IP,buildNumericRange:()=>Oc,buildPager:()=>bk,buildQueryError:()=>Rk,buildQueryExpression:()=>S3,buildQueryRankingExpressionSortCriterion:()=>yp,buildQuerySummary:()=>Ek,buildQueryTrigger:()=>zO,buildQuickview:()=>kk,buildRecentQueriesList:()=>qk,buildRecentResultsList:()=>Uk,buildRedirectionTrigger:()=>WO,buildRelevanceInspector:()=>Hk,buildRelevanceSortCriterion:()=>os,buildResultList:()=>Wk,buildResultTemplatesManager:()=>i_,buildResultsPerPage:()=>Yk,buildSearchBox:()=>oy,buildSearchEngine:()=>aT,buildSearchParameterManager:()=>uy,buildSearchParameterSerializer:()=>od,buildSearchStatus:()=>vO,buildSmartSnippet:()=>bO,buildSmartSnippetQuestionsList:()=>FO,buildSort:()=>PO,buildStandaloneSearchBox:()=>NO,buildStaticFilter:()=>DO,buildStaticFilterValue:()=>Dx,buildTab:()=>MO,buildTabManager:()=>VO,buildUrlManager:()=>e_,currentPageSelector:()=>mo,currentPagesSelector:()=>zh,deserializeRelativeDate:()=>uR,facetRequestSelector:()=>lp,facetResponseSelectedValuesSelector:()=>fw,facetResponseSelector:()=>Xi,getAnalyticsNextApiBaseUrl:()=>Ad,getOrganizationEndpoint:()=>mr,getSampleSearchEngineConfiguration:()=>HA,getSearchApiBaseUrl:()=>St,loadAdvancedSearchQueryActions:()=>EH,loadAutomaticFacetSetActions:()=>LH,loadBreadcrumbActions:()=>kH,loadCategoryFacetSetActions:()=>UH,loadClickAnalyticsActions:()=>IH,loadConfigurationActions:()=>OH,loadContextActions:()=>NH,loadDateFacetSetActions:()=>BH,loadDebugActions:()=>DH,loadDictionaryFieldContextActions:()=>qH,loadDidYouMeanActions:()=>MH,loadExcerptLengthActions:()=>VH,loadFacetOptionsActions:()=>jH,loadFacetSetActions:()=>QH,loadFieldActions:()=>$H,loadFoldingActions:()=>HH,loadGeneratedAnswerActions:()=>zH,loadGenericAnalyticsActions:()=>TH,loadHistoryActions:()=>WH,loadIPXActionsHistoryActions:()=>FH,loadInstantResultsActions:()=>KH,loadNumericFacetSetActions:()=>GH,loadPaginationActions:()=>YH,loadPipelineActions:()=>XH,loadQueryActions:()=>JH,loadQuerySetActions:()=>ZH,loadQuerySuggestActions:()=>e3,loadQuestionAnsweringActions:()=>t3,loadRecentQueriesActions:()=>r3,loadRecentResultsActions:()=>n3,loadResultPreviewActions:()=>o3,loadSearchActions:()=>s3,loadSearchAnalyticsActions:()=>PH,loadSearchConfigurationActions:()=>_H,loadSearchHubActions:()=>c3,loadSearchParameterActions:()=>u3,loadSortCriteriaActions:()=>p3,loadStandaloneSearchBoxSetActions:()=>f3,loadStaticFilterSetActions:()=>m3,loadTabSetActions:()=>g3,maxPageSelector:()=>Zl,parseCriterionExpression:()=>s_,validateRelativeDate:()=>Po});module.exports=E_(A3);d();c();l();u();var My={};Au(My,{escapeHtml:()=>qi,getHighlightedSuggestion:()=>qy,highlightString:()=>rN});d();c();l();u();d();c();l();u();function K_(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 __=Object.create;var xu=Object.defineProperty;var N_=Object.getOwnPropertyDescriptor;var D_=Object.getOwnPropertyNames;var q_=Object.getPrototypeOf,M_=Object.prototype.hasOwnProperty;var V_=(e,t,r)=>t in e?xu(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),bu=(e,t)=>{for(var r in t)xu(e,r,{get:t[r],enumerable:!0})},WC=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of D_(t))!M_.call(e,o)&&o!==r&&xu(e,o,{get:()=>t[o],enumerable:!(n=N_(t,o))||n.enumerable});return e};var Vr=(e,t,r)=>(r=e!=null?__(q_(e)):{},WC(t||!e||!e.__esModule?xu(r,"default",{value:e,enumerable:!0}):r,e)),j_=e=>WC(xu({},"__esModule",{value:!0}),e);var pe=(e,t,r)=>V_(e,typeof t!="symbol"?t+"":t,r);var y,c=Ii(()=>{"use strict";y=typeof globalThis<"u"?globalThis:window});function ud(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ud=function(t){return typeof t}:ud=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ud(e)}function Q_(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=B_.bind(this))}function B_(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","*/*"),L_(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):U_(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var L_,U_,u=Ii(()=>{"use strict";L_=function(t){return typeof t=="string"},U_=function(t){return t instanceof Blob};Q_.call((typeof window>"u"?"undefined":ud(window))==="object"?window:{})});var My=It(wu=>{"use strict";d();c();l();u();Object.defineProperty(wu,"__esModule",{value:!0});function KC(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 G_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $_(e,t,r){return t=Ti(t),z_(e,ZC()?Reflect.construct(t,r||[],Ti(e).constructor):t.apply(e,r))}function Ny(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YC(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,J_(n.key),n)}}function Dy(e,t,r){return t&&YC(e.prototype,t),r&&YC(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function JC(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=X_(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 Oy(){return Oy=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=W_(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},Oy.apply(null,arguments)}function Ti(e){return Ti=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ti(e)}function H_(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&&_y(e,t)}function ZC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZC=function(){return!!e})()}function z_(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 G_(e)}function _y(e,t){return _y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},_y(e,t)}function W_(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ti(e))!==null;);return e}function K_(e,t,r,n){var o=Oy(Ti(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function Y_(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 J_(e){var t=Y_(e,"string");return typeof t=="symbol"?t:t+""}function X_(e,t){if(e){if(typeof e=="string")return KC(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)?KC(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Z_(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 eN(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 XC=function(){function e(){Ny(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Dy(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}}}])}(),qy=function(e){function t(){var r;return Ny(this,t),r=$_(this,t),r.listeners||XC.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 H_(t,e),Dy(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)),K_(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 ld;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 ld;function a(){o.abort(this.reason),i()}function i(){var g=JC(n),v;try{for(g.s();!(v=g.n()).done;){var x=v.value;x.removeEventListener("abort",a)}}catch(h){g.e(h)}finally{g.f()}}var p=JC(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}}])}(XC),ld=function(){function e(){Ny(this,e),Object.defineProperty(this,"signal",{value:new qy,writable:!0,configurable:!0})}return Dy(e,[{key:"abort",value:function(r){var n=eN(r),o=Z_(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(ld.prototype[Symbol.toStringTag]="AbortController",qy.prototype[Symbol.toStringTag]="AbortSignal");function tN(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 rN(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(!tN({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(x,h){var C;h&&h.signal&&(C=h.signal,delete h.signal);var b=new o(x,h);return C&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:C}),b},f.prototype=o.prototype);var m=r,g=function(x,h){var C=f&&f.prototype.isPrototypeOf(x)?x.signal:h?h.signal:void 0;if(C){var b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(C.aborted)return Promise.reject(b);var w=new Promise(function(R,E){C.addEventListener("abort",function(){return E(b)},{once:!0})});return h&&h.signal&&delete h.signal,Promise.race([w,m(x,h)])}return m(x,h)};return{fetch:g,Request:f}}wu.AbortController=ld;wu.AbortSignal=qy;wu.abortableFetch=rN});var ex,s,S,l=Ii(()=>{"use strict";ex=Vr(My(),1),s=Vr(My(),1),{fetch:S}=(0,ex.abortableFetch)({fetch})});function Vy(e){return typeof e!="string"||e in{}}function jy(){return Object.create(null)}function tx(e){return typeof e=="string"&&!!e.trim()}function Ly(e,t){var r=e.split(";").filter(tx),n=r.shift(),o=nN(n),a=o.name,i=o.value;if(t=t?Object.assign({},dd,t):dd,Vy(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=jy();return p.name=a,p.value=i,r.forEach(function(f){var m=f.split("="),g=m.shift().trimLeft().toLowerCase();if(!Vy(g)){var v=m.join("=");if(g==="expires")p.expires=new Date(v);else if(g==="max-age"){var x=parseInt(v,10);Number.isNaN(x)||(p.maxAge=x)}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 nN(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({},dd,t):dd,!e)return t.map?jy():[];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(tx),n&&(e=e.map(pd).flat()),t.map){var a=jy();return e.reduce(function(i,p){var f=Ly(p,t);return f&&!Vy(f.name)&&(i[f.name]=f),i},a)}else return e.map(function(i){return Ly(i,t)}).filter(Boolean)}function pd(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 dd,rx=Ii(()=>{"use strict";d();c();l();u();dd={decodeValues:!0,map:!1,silent:!1,split:"auto"};Pi.parseSetCookie=Pi;Pi.parse=Pi;Pi.parseString=Ly;Pi.splitCookiesString=pd});function Ru(e){if(oN.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Uy(e){return e.replace(aN,"")}function Fu(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||!iN(r))return!1}return!0}function iN(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function ox(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 oN,nx,aN,ax,ki,Qy,ix,A,cx=Ii(()=>{"use strict";d();c();l();u();rx();oN=/[^a-z0-9\-#$%&'*+.^_`|~]/i;nx=[`
19
+ `,"\r","\t"," "],aN=new RegExp(`(^[${nx.join("")}]|$[${nx.join("")}])`,"g");ki=Symbol("normalizedHeaders"),Qy=Symbol("rawHeaderNames"),ix=", ",A=class sx{constructor(t){this[ki]={},this[Qy]=new Map,this[ax]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof sx||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(ix):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(ix):n)})}[(ax=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(!Fu(t))throw new TypeError(`Invalid header name "${t}"`);return this[ki].hasOwnProperty(Ru(t))}get(t){if(!Fu(t))throw TypeError(`Invalid header name "${t}"`);return this[ki][Ru(t)]??null}set(t,r){if(!Fu(t)||!ox(r))return;let n=Ru(t),o=Uy(r);this[ki][n]=Uy(o),this[Qy].set(n,t)}append(t,r){if(!Fu(t)||!ox(r))return;let n=Ru(t),o=Uy(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!Fu(t)||!this.has(t))return;let r=Ru(t);delete this[ki][r],this[Qy].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===""?[""]:pd(t)}}});var d=Ii(()=>{"use strict";cx()});var xx=It(ku=>{"use strict";d();c();l();u();var Cd=ku&&ku.__assign||function(){return Cd=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},Cd.apply(this,arguments)};Object.defineProperty(ku,"__esModule",{value:!0});var EN={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function IN(e){var t=Cd(Cd({},EN),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}ku.getSanitizedOptions=IN});var bx=It(Yy=>{"use strict";d();c();l();u();Object.defineProperty(Yy,"__esModule",{value:!0});function TN(e){var t=Math.random()*e;return Math.round(t)}Yy.fullJitter=TN});var wx=It(Jy=>{"use strict";d();c();l();u();Object.defineProperty(Jy,"__esModule",{value:!0});function PN(e){return e}Jy.noJitter=PN});var Rx=It(Xy=>{"use strict";d();c();l();u();Object.defineProperty(Xy,"__esModule",{value:!0});var kN=bx(),ON=wx();function _N(e){return e.jitter==="full"?kN.fullJitter:ON.noJitter}Xy.JitterFactory=_N});var eS=It(Zy=>{"use strict";d();c();l();u();Object.defineProperty(Zy,"__esModule",{value:!0});var NN=Rx(),DN=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=NN.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}();Zy.Delay=DN});var Fx=It(Qn=>{"use strict";d();c();l();u();var qN=Qn&&Qn.__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)}}(),MN=Qn&&Qn.__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=Qn&&Qn.__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(Qn,"__esModule",{value:!0});var jN=eS(),LN=function(e){qN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return MN(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}(jN.Delay);Qn.SkipFirstDelay=LN});var Ex=It(Ou=>{"use strict";d();c();l();u();var UN=Ou&&Ou.__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(Ou,"__esModule",{value:!0});var QN=eS(),BN=function(e){UN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(QN.Delay);Ou.AlwaysDelay=BN});var Ix=It(tS=>{"use strict";d();c();l();u();Object.defineProperty(tS,"__esModule",{value:!0});var GN=Fx(),$N=Ex();function HN(e,t){var r=zN(e);return r.setAttemptNumber(t),r}tS.DelayFactory=HN;function zN(e){return e.delayFirstAttempt?new $N.AlwaysDelay(e):new GN.SkipFirstDelay(e)}});var Tx=It(la=>{"use strict";d();c();l();u();var rS=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())})},nS=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 WN=xx(),KN=Ix();function YN(e,t){return t===void 0&&(t={}),rS(this,void 0,void 0,function(){var r,n;return nS(this,function(o){switch(o.label){case 0:return r=WN.getSanitizedOptions(t),n=new JN(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}la.backOff=YN;var JN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return rS(this,void 0,void 0,function(){var t,r;return nS(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 rS(this,void 0,void 0,function(){var t;return nS(this,function(r){switch(r.label){case 0:return t=KN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var _p=It((gv,hv)=>{"use strict";d();c();l();u();(function(e,t){typeof gv=="object"&&typeof hv<"u"?hv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(gv,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",x="date",h="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|YYYY|YY|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:x,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 B||!(!_||!_[T])},G=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},U=function(_,N){if(D(_))return _.clone();var q=typeof N=="object"?N:{};return q.date=_,q.args=arguments,new B(q)},V=E;V.l=G,V.i=D,V.w=function(_,N){return U(_,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var B=function(){function _(q){this.$L=G(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(C);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=U(q);return this.startOf(Y)<=H&&H<=this.endOf(Y)},N.isAfter=function(q,Y){return U(q)<this.startOf(Y)},N.isBefore=function(q,Y){return this.endOf(Y)<U(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)},ye=this.$W,Ve=this.$M,Je=this.$D,Qe="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 ze=this.$locale().weekStart||0,We=(ye<ze?ye+7:ye)-ze;return Z(ne?Je-We:Je+(6-We),Ve);case p:case x:return ue(Qe+"Hours",0);case i:return ue(Qe+"Minutes",1);case a:return ue(Qe+"Seconds",2);case o:return ue(Qe+"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[x]=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 ye=this.clone().set(x,1);ye.$d[Z](ue),ye.init(),this.$d=ye.set(x,Math.min(this.$D,ye.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 Je=U(ne);return V.w(Je.date(Je.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,ye=this.$d.getTime()+q*ue;return V.w(ye,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,ye=this.$M,Ve=H.weekdays,Je=H.months,Qe=H.meridiem,ze=function(Re,Pe,Ie,ut){return Re&&(Re[Pe]||Re(Y,ne))||Ie[Pe].slice(0,ut)},We=function(Re){return V.s(Z%12||12,Re,"0")},Ee=Qe||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 ye+1;case"MM":return V.s(ye+1,2,"0");case"MMM":return ze(H.monthsShort,ye,Je,3);case"MMMM":return ze(Je,ye);case"D":return Y.$D;case"DD":return V.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return ze(H.weekdaysMin,Y.$W,Ve,2);case"ddd":return ze(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 We(1);case"hh":return We(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=U(q),ye=(ue.utcOffset()-this.utcOffset())*t,Ve=this-ue,Je=function(){return V.m(te,ue)};switch(Z){case v:ne=Je()/12;break;case m:ne=Je();break;case g:ne=Je()/3;break;case f:ne=(Ve-ye)/6048e5;break;case p:ne=(Ve-ye)/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=G(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=B.prototype;return U.prototype=j,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",p],["$M",m],["$y",v],["$D",x]].forEach(function(_){j[_[1]]=function(N){return this.$g(N,_[0],_[1])}}),U.extend=function(_,N){return _.$i||(_(N,B,U),_.$i=!0),U},U.locale=G,U.isDayjs=D,U.unix=function(_){return U(1e3*_)},U.en=k[I],U.Ls=k,U.p={},U})});var uR=It((yv,Sv)=>{"use strict";d();c();l();u();(function(e,t){typeof yv=="object"&&typeof Sv<"u"?Sv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(yv,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 lR=It((vv,Av)=>{"use strict";d();c();l();u();(function(e,t){typeof vv=="object"&&typeof Av<"u"?Av.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(vv,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(b){this[C]=+b}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(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}(C)}],g=function(C){var b=i[C];return b&&(b.indexOf?b:b.s.concat(b.f))},v=function(C,b){var w,R=i.meridiem;if(R){for(var E=1;E<=24;E+=1)if(C.indexOf(R(E,0,b))>-1){w=E>12;break}}else w=C===(b?"pm":"PM");return w},x={A:[a,function(C){this.afternoon=v(C,!1)}],a:[a,function(C){this.afternoon=v(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 b=i.ordinal,w=C.match(/\d+/);if(this.day=w[0],b)for(var R=1;R<=31;R+=1)b(R).replace(/\[|\]/g,"")===C&&(this.day=R)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(C){var b=g("months"),w=(g("monthsShort")||b.map(function(R){return R.slice(0,3)})).indexOf(C)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[a,function(C){var b=g("months").indexOf(C)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(C){this.year=p(C)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function h(C){var b,w;b=C,w=i&&i.formats;for(var R=(C=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(U,V,B){var j=B&&B.toUpperCase();return V||w[B]||e[B]||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=x[k],D=T&&T[0],G=T&&T[1];R[I]=G?{regex:D,parser:G}:k.replace(/^\[|\]$/g,"")}return function(U){for(var V={},B=0,j=0;B<E;B+=1){var _=R[B];if(typeof _=="string")j+=_.length;else{var N=_.regex,q=_.parser,Y=U.slice(j),H=N.exec(Y)[0];q.call(V,H),U=U.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,b,w){w.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(p=C.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 G=D[1];if(typeof G=="string"){var U=D[2]===!0,V=D[3]===!0,B=U||V,j=D[2];V&&(j=D[2]),i=this.$locale(),!U&&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,ye=Z.month,Ve=Z.day,Je=Z.hours,Qe=Z.minutes,ze=Z.seconds,We=Z.milliseconds,Ee=Z.zone,Re=Z.week,Pe=new Date,Ie=Ve||(ue||ye?1:Pe.getDate()),ut=ue||Pe.getFullYear(),yt=0;ue&&!ye||(yt=ye>0?ye-1:Pe.getMonth());var qr,ar=Je||0,Yr=Qe||0,mr=ze||0,Mr=We||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,G,T,w),this.init(),j&&j!==!0&&(this.$L=this.locale(j).$L),B&&k!=this.format(G)&&(this.$d=new Date("")),i={}}else if(G instanceof Array)for(var _=G.length,N=1;N<=_;N+=1){D[1]=G[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 UF=It((eA,tA)=>{"use strict";d();c();l();u();(function(e,t){typeof eA=="object"&&typeof tA<"u"?tA.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(eA,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,x){x===void 0&&(x={});var h=new Date(g),C=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,x);return C.formatToParts(h)},p=function(g,v){for(var x=i(g,v),h=[],C=0;C<x.length;C+=1){var b=x[C],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 x,h=this.utcOffset(),C=this.toDate(),b=C.toLocaleString("en-US",{timeZone:g}),w=Math.round((C-new Date(b))/1e3/60),R=15*-Math.round(C.getTimezoneOffset()/15)-w;if(!Number(R))x=this.utcOffset(0,v);else if(x=o(b,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(R,!0),v){var E=x.utcOffset();x=x.add(h-E,"minute")}return x.$x.$timezone=g,x},f.offsetName=function(g){var v=this.$x.$timezone||o.tz.guess(),x=i(this.valueOf(),v,{timeZoneName:g}).find(function(h){return h.type.toLowerCase()==="timezonename"});return x&&x.value};var m=f.startOf;f.startOf=function(g,v){if(!this.$x||!this.$x.$timezone)return m.call(this,g,v);var x=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(x,g,v).tz(this.$x.$timezone,!0)},o.tz=function(g,v,x){var h=x&&v,C=x||v||a,b=p(+o(),C);if(typeof g!="string")return o(g).tz(C);var w=function(k,T,D){var G=k-60*T*1e3,U=p(G,D);if(T===U)return[G,T];var V=p(G-=60*(U-T)*1e3,D);return U===V?[G,U]:[k-60*Math.min(U,V)*1e3,Math.max(U,V)]}(o.utc(g,h).valueOf(),b,C),R=w[0],E=w[1],I=o(R).utcOffset(E);return I.$x.$timezone=C,I},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){a=g}}})});var QF=It((rA,nA)=>{"use strict";d();c();l();u();(function(e,t){typeof rA=="object"&&typeof nA<"u"?nA.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(rA,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 C={date:h,utc:!0,args:arguments};return new o(C)},i.utc=function(h){var C=a(this.toDate(),{locale:this.$L,utc:!0});return h?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(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,C){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],G=60*+T[1]+ +T[2];return G===0?0:D==="+"?G:-G}(h),h===null))return this;var w=Math.abs(h)<=16?60*h:h;if(w===0)return this.utc(C);var R=this.clone();if(C)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 C=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,C)},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 x=i.diff;i.diff=function(h,C,b){if(h&&this.$u===h.$u)return x.call(this,h,C,b);var w=this.local(),R=a(h).local();return x.call(w,R,C,b)}}})});var YI=It((mwe,KI)=>{"use strict";d();c();l();u();function DB(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}KI.exports=qB;function qB(e,t,r){var n=r&&r.stringify||DB,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,x=e&&e.length||0,h=0;h<x;){if(e.charCodeAt(h)===37&&h+1<x){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 C=typeof t[g];if(C==="string"){m+="'"+t[g]+"'",v=h+2,h++;break}if(C==="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<x&&(m+=e.slice(v)),m)}});var nT=It((vwe,Tg)=>{"use strict";d();c();l();u();var JI=YI();Tg.exports=oo;var Ll=JB().console||{},MB={mapHttpRequest:Ig,mapHttpResponse:Ig,wrapRequestSerializer:WA,wrapResponseSerializer:WA,wrapErrorSerializer:WA,req:Ig,res:Ig,err:ZI,errWithCause:ZI};function zo(e,t){return e==="silent"?1/0:t.levels.values[e]}var JA=Symbol("pino.logFuncs"),KA=Symbol("pino.hierarchy"),VB={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function XI(e,t){let r={logger:t,parent:e[KA]};t[KA]=r}function jB(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Ll[o]||Ll[VB[o]||"log"]||uc}),e[JA]=n}function LB(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||Ll;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=LB(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=uc),jB(m,p,r),XI({},m),Object.defineProperty(m,"levelVal",{get:v}),Object.defineProperty(m,"level",{get:x,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:WB(e),messageKey:e.messageKey||"msg",onChild:e.onChild||uc};m.levels=UB(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=uc,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...b){return C.call(this,g,...b)},t&&(m._logEvent=YA());function v(){return zo(this.level,this)}function x(){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 C(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,XA([w],k,I,this._stdErrSerialize)}function T(G){this._childLevel=(G._childLevel|0)+1,this.bindings=w,I&&(this.serializers=I,this._serialize=k),t&&(this._logEvent=YA([].concat(G._logEvent.bindings,w)))}T.prototype=this;let D=new T(this);return XI(this,D),D.child=function(...G){return C.call(this,b,...G)},D.level=R.level||this.level,b.onChild(D),D}return m}function UB(e){let t=e.customLevels||{},r=Object.assign({},oo.levels.values,t),n=Object.assign({},oo.levels.labels,QB(t));return{values:r,labels:n}}function QB(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=MB;oo.stdTimeFunctions=Object.assign({},{nullTime:tT,epochTime:rT,unixTime:KB,isoTime:YB});function BB(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[KA];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)?uc:r[JA][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===uc){if(!t.transmit)return;let a=t.transmit.level||e.level,i=zo(a,r);if(zo(n,r)<i)return}e[n]=$B(e,t,r,n);let o=BB(e);o.length!==0&&(e[n]=GB(o,e[n]))}function GB(e,t){return function(){return t.apply(this,[...e,...arguments])}}function $B(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ll?Ll:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&(XA(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters){let v=HB(this,n,p,i,t);if(t.reportCaller&&v&&v.length>0&&v[0]&&typeof v[0]=="object")try{let x=eT();x&&(v[0].caller=x)}catch{}o.call(f,...v)}else{if(t.reportCaller)try{let v=eT();v&&p.push(v)}catch{}o.apply(f,p)}if(t.transmit){let v=t.transmit.level||e._level,x=zo(v,r),h=zo(n,r);if(h<x)return;zB(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[JA][n])}function HB(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?JI(p.shift(),p):void 0}else typeof f=="string"&&(f=JI(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function XA(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 zB(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||XA(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=YA(m)}function YA(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function ZI(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 WB(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?tT:rT}function Ig(){return{}}function WA(e){return e}function uc(){}function tT(){return!1}function rT(){return Date.now()}function KB(){return Math.round(Date.now()/1e3)}function YB(){return new Date(Date.now()).toISOString()}function JB(){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)||{}}}Tg.exports.default=oo;Tg.exports.pino=oo;function eT(){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 P3={};bu(P3,{API_DATE_FORMAT:()=>Rs,DefaultFieldsToInclude:()=>dC,EcommerceDefaultFieldsToInclude:()=>zP,HighlightUtils:()=>$y,MinimumFieldsToInclude:()=>Gh,ResultTemplatesHelpers:()=>LR,SortBy:()=>xa,SortOrder:()=>il,VERSION:()=>Ao,baseFacetResponseSelector:()=>Lr,buildAutomaticFacetGenerator:()=>iP,buildBreadcrumbManager:()=>LT,buildCategoryFacet:()=>yP,buildCategoryFieldSuggestions:()=>LP,buildContext:()=>BT,buildController:()=>oe,buildCriterionExpression:()=>tn,buildDateFacet:()=>kP,buildDateFilter:()=>_P,buildDateRange:()=>Yo,buildDateSortCriterion:()=>yp,buildDictionaryFieldContext:()=>HT,buildDidYouMean:()=>XT,buildExecuteTrigger:()=>r_,buildFacet:()=>RP,buildFacetConditionsManager:()=>$T,buildFacetManager:()=>eP,buildFieldSortCriterion:()=>Sp,buildFieldSuggestions:()=>UP,buildFoldedResultList:()=>YP,buildGeneratedAnswer:()=>ik,buildHistoryManager:()=>xk,buildInstantResults:()=>Ok,buildInteractiveCitation:()=>uk,buildInteractiveGeneratedAnswerInlineLink:()=>dk,buildInteractiveInstantResult:()=>bk,buildInteractiveRecentResult:()=>Jk,buildInteractiveResult:()=>aO,buildNoSortCriterion:()=>Ap,buildNotifyTrigger:()=>o_,buildNumericFacet:()=>MP,buildNumericFilter:()=>jP,buildNumericRange:()=>Dc,buildPager:()=>Dk,buildQueryError:()=>Mk,buildQueryExpression:()=>I3,buildQueryRankingExpressionSortCriterion:()=>vp,buildQuerySummary:()=>jk,buildQueryTrigger:()=>a_,buildQuickview:()=>Bk,buildRecentQueriesList:()=>Wk,buildRecentResultsList:()=>Zk,buildRedirectionTrigger:()=>i_,buildRelevanceInspector:()=>oO,buildRelevanceSortCriterion:()=>os,buildResultList:()=>iO,buildResultTemplatesManager:()=>S_,buildResultsPerPage:()=>cO,buildSearchBox:()=>py,buildSearchEngine:()=>hT,buildSearchParameterManager:()=>yy,buildSearchParameterSerializer:()=>id,buildSearchStatus:()=>kO,buildSmartSnippet:()=>DO,buildSmartSnippetQuestionsList:()=>VO,buildSort:()=>QO,buildStandaloneSearchBox:()=>HO,buildStaticFilter:()=>zO,buildStaticFilterValue:()=>GC,buildTab:()=>KO,buildTabManager:()=>YO,buildUrlManager:()=>p_,currentPageSelector:()=>mo,currentPagesSelector:()=>ty,deserializeRelativeDate:()=>AR,facetRequestSelector:()=>pp,facetResponseSelectedValuesSelector:()=>xw,facetResponseSelector:()=>Yi,getAnalyticsNextApiBaseUrl:()=>xd,getOrganizationEndpoint:()=>gr,getSampleSearchEngineConfiguration:()=>tC,getSearchApiBaseUrl:()=>St,loadAdvancedSearchQueryActions:()=>MH,loadAutomaticFacetSetActions:()=>YH,loadBreadcrumbActions:()=>UH,loadCategoryFacetSetActions:()=>JH,loadClickAnalyticsActions:()=>VH,loadConfigurationActions:()=>QH,loadContextActions:()=>GH,loadDateFacetSetActions:()=>ZH,loadDebugActions:()=>$H,loadDictionaryFieldContextActions:()=>HH,loadDidYouMeanActions:()=>zH,loadExcerptLengthActions:()=>WH,loadFacetOptionsActions:()=>KH,loadFacetSetActions:()=>XH,loadFieldActions:()=>t3,loadFoldingActions:()=>r3,loadGeneratedAnswerActions:()=>n3,loadGenericAnalyticsActions:()=>jH,loadHistoryActions:()=>o3,loadIPXActionsHistoryActions:()=>qH,loadInstantResultsActions:()=>a3,loadNumericFacetSetActions:()=>e3,loadPaginationActions:()=>i3,loadPipelineActions:()=>s3,loadQueryActions:()=>c3,loadQuerySetActions:()=>u3,loadQuerySuggestActions:()=>l3,loadQuestionAnsweringActions:()=>d3,loadRecentQueriesActions:()=>p3,loadRecentResultsActions:()=>f3,loadResultPreviewActions:()=>m3,loadSearchActions:()=>y3,loadSearchAnalyticsActions:()=>LH,loadSearchConfigurationActions:()=>BH,loadSearchHubActions:()=>S3,loadSearchParameterActions:()=>v3,loadSortCriteriaActions:()=>x3,loadStandaloneSearchBoxSetActions:()=>b3,loadStaticFilterSetActions:()=>w3,loadTabSetActions:()=>R3,maxPageSelector:()=>td,parseCriterionExpression:()=>v_,validateRelativeDate:()=>ko});module.exports=j_(P3);d();c();l();u();var $y={};bu($y,{escapeHtml:()=>Di,getHighlightedSuggestion:()=>Gy,highlightString:()=>mN});d();c();l();u();d();c();l();u();function sN(e,t){let r=`
21
21
  The following properties are invalid:
22
22
 
23
23
  ${e.join(`
24
24
  `)}
25
25
 
26
26
  ${t}
27
- `;return new wu(r)}var wu=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Se=class{constructor(e){de(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 K_(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={}){de(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&fe(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 Y_(e){return e===null}function fe(e){return Tt(e)||Y_(e)}var pe=class{constructor(e={}){de(this,"value");this.value=new Qe(e)}validate(e){let t=this.value.validate(e);return t||(X_(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function X_(e){return Tt(e)||dd(e)}function dd(e){return typeof e=="boolean"}var re=class{constructor(e={}){de(this,"config");de(this,"value");this.config=e,this.value=new Qe(e)}validate(e){let t=this.value.validate(e);return t||(J_(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 J_(e){return Tt(e)||eC(e)}function eC(e){return typeof e=="number"&&!Number.isNaN(e)}var Z_=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,U=class{constructor(e={}){de(this,"value");de(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(!_i(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&&!(Z_.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 _i(e){return Object.prototype.toString.call(e)==="[object String]"}var J=class{constructor(e={}){de(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(!tC(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&fe(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 tC(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){de(this,"config");de(this,"value");this.config=e,this.value=new Qe(this.config)}validate(e){if(!fe(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(fe(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&&fe(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 dd(e)||_i(e)||eC(e)||tC(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ni(e){return Array.isArray(e)}var Ru=class{constructor(e){de(this,"config");de(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 pd(e){return Array.isArray(e)}function fd(e){return e.trim()===""}function rC(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function eN(e){return btoa(encodeURI(e))}function md(e,t){let{[e]:r,...n}=t;return n}function Di(e){return eN(JSON.stringify(e))}var tN=new Set(["1",1,"yes",!0]);function nC(){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=>tN.has(r))}function oC(e){let t={};for(let[r,n]of e)t[r]=n;return t}function aC(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Fu(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function gd(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 rN(e){if(fd(e.openingDelimiter)||fd(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(fe(e.content)||fd(e.content))return e.content;if(e.highlights.length===0)return qi(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+=qi(e.content.slice(n,i)),r+=e.openingDelimiter,r+=qi(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=qi(e.content.slice(n))),r}function qy(e,t){return e=qi(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?Dy(n,t.notMatchDelimiters):o?Dy(o,t.exactMatchDelimiters):a?Dy(a,t.correctionDelimiters):r)}function Dy(e,t){return t?t.open+e+t.close:e}function qi(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function sC(_x2,_x3){return _sC.apply(this,arguments)}function _sC(){_sC=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _sC.apply(this,arguments)}function cC(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=oN(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 uC(e,t,r){let n=iC(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=iC();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":nN(g,n,t);break}}}}function nN(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function oN(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function iC(){return{data:"",event:"",id:"",retry:void 0}}var Vy="text/event-stream",aN=1e3,lC="last-event-id";function dC(){return typeof window<"u"}function hd(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=Vy);let h;function x(){h?.abort(),document.hidden||k()}!p&&dC()&&document.addEventListener("visibilitychange",x);let b=aN,w;function R(){dC()&&document.removeEventListener("visibilitychange",x),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{R(),g()});let E=f??S,I=n??iN;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 sC(T.body,cC(uC(D=>{D?C[lC]=D:delete C[lC]},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 iN(e){let t=e.headers.get("content-type");if(!t?.startsWith(Vy))throw new Error(`Expected content-type to be ${Vy}, Actual: ${t}`)}d();c();l();u();var ho=class{constructor(t){de(this,"_basePath");de(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var sN=(e,t,r)=>new ho(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,pC=3,cN=5e3,uN="text/event-stream",Uy=1,jy=class extends Error{},Eu=class extends Error{constructor(r){super(r.message);de(this,"payload",r)}},Ly=class{constructor(){de(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)}},yd=class{constructor(t){de(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 Ly;if(!a){this.logger.error("No stream ID found");return}let C=0,h,x=()=>{h&&!v.isActive(h)&&(w?.abort(),g(),R())},b=()=>{v.remove(h),h=aC(x,h,cN),v.add(h)},w=new s.AbortController,R=()=>hd(sN(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")===uN)return;throw E.status>=400&&E.status<500&&E.status!==429?new Eu({message:"Error opening stream",code:E.status}):new jy})()},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 Eu)throw w?.abort(),f(E),E;if(++C>pC){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Uy};throw w?.abort(),f(I),new Eu(I)}this.logger.info(`Retrying...(${C}/${pC})`),g()}}});return R(),w}};d();c();l();u();var Sd=e=>e;d();c();l();u();d();c();l();u();function Mi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function ar(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Mi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Mi(),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?lN(e):dN(t)},lN=e=>fN(e)?mN(e):pN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},dN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function pN(e){return e.body.statusCode!==void 0}function fN(e){return e.body.exception!==void 0}var mN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var wC=Vr(AC(),1);d();c();l();u();var K=new Error("Failed to load reducers."),Vi=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();de(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function xC(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function CC(e){return typeof e!="object"||!e?!1:Object.values(e).every(LN)}function LN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function bC(e){return e===429}var jr=class e{static call(t){return _asyncToGenerator(function*(){let r=UN(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(bC(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,wC.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&bC(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 Vi;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=Fu(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 mr(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ji(e,t,r="prod"){return e??mr(t,r)}function St(e,t="prod"){return`${mr(e,t)}/rest/search/v2`}function Ad(e,t="prod"){return`${mr(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function UN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=QN(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function QN(e,t){return t==="application/x-www-form-urlencoded"?CC(e)?xC(e):"":JSON.stringify(e)}d();c();l();u();var vo=class{constructor(){de(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();function RC(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 FC=(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},EC=/*#__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=RC(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return BN(i)?{success:i}:{error:So({response:r,body:i})}});return function EC(_x5,_x6){return _ref3.apply(this,arguments)}}();function BN(e){return typeof e=="string"}d();c();l();u();function GN(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function $N(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function xd(e,t){if(t&&e.name==="AbortError")return{error:$N(e)};if(e instanceof da)return{error:GN(e)};throw e}var Cd=class{constructor(t){de(this,"options",t);de(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 xd(r);let n=yield r.json();return zN(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 xd(r);let n=yield r.json(),o={response:r,body:n};return HN(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 xd(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return IC(a)?(i.body=TC(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(IC(n)){let o={response:r,body:n};return o.body=TC(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:So({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return EC(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 WN(n)?{success:n}:{error:So({response:r,body:n})}})()}},bd=e=>e.success!==void 0,vt=e=>e.error!==void 0;function IC(e){return e.results!==void 0}function TC(e){let t=Mi();return fe(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function HN(e){return e.completions!==void 0}function zN(e){return e.preprocessingOutput!==void 0}function WN(e){return e.fields!==void 0}d();c();l();u();var PC=e=>e,kC=e=>e,OC=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}),lK=new U({required:!1,emptyAllowed:!0}),wd=new ie({each:W,required:!0}),_C=new U({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),NC=new U({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),dK=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 wu(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 DC(e,t,r,o,"Controller initialization error")},$e=(e,t,r,n)=>{let o=`Check the options of ${n}`;return DC(e,t,r,o,"Controller initialization error")},DC=(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 Pt(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 KN=typeof Symbol=="function"&&Symbol.observable||"@@observable",qC=KN,Yy=()=>Math.random().toString(36).substring(7).split("").join("."),YN={INIT:`@@redux/INIT${Yy()}`,REPLACE:`@@redux/REPLACE${Yy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Yy()}`},Rd=YN;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 Xy(e,t,r){if(typeof e!="function")throw new Error(Pt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Pt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Pt(1));return r(Xy)(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(Pt(3));return o}function v(w){if(typeof w!="function")throw new Error(Pt(4));if(f)throw new Error(Pt(5));let R=!0;m();let E=p++;return i.set(E,w),function(){if(R){if(f)throw new Error(Pt(6));R=!1,m(),i.delete(E),a=null}}}function C(w){if(!Xr(w))throw new Error(Pt(7));if(typeof w.type>"u")throw new Error(Pt(8));if(typeof w.type!="string")throw new Error(Pt(17));if(f)throw new Error(Pt(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(Pt(10));n=w,C({type:Rd.REPLACE})}function x(){let w=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Pt(11));function E(){let k=R;k.next&&k.next(g())}return E(),{unsubscribe:w(E)}},[qC](){return this}}}return C({type:Rd.INIT}),{dispatch:C,subscribe:v,getState:g,replaceReducer:h,[qC]:x}}function XN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Rd.INIT})>"u")throw new Error(Pt(12));if(typeof r(void 0,{type:Rd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pt(13))})}function Li(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{XN(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],x=p[C],b=h(x,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(Pt(14))}g[C]=b,m=m||b!==x}return m=m||n.length!==Object.keys(p).length,m?g:p}}function Pu(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function MC(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Pt(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=Pu(...p)(o.dispatch),{...o,dispatch:a}}}function ku(e){return Xr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var iS=Symbol.for("immer-nothing"),Ou=Symbol.for("immer-draftable"),At=Symbol.for("immer-state");function kt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ir=Object,fa=ir.getPrototypeOf,Nu="constructor",ju="prototype",eS="configurable",Td="enumerable",Ed="writable",Du="value",Wt=e=>!!e&&!!e[At];function Kt(e){return e?$C(e)||Uu(e)||!!e[Ou]||!!e[Nu]?.[Ou]||Qu(e)||Bu(e):!1}var JN=ir[ju][Nu].toString(),VC=new WeakMap;function $C(e){if(!e||!Ui(e))return!1;let t=fa(e);if(t===null||t===ir[ju])return!0;let r=ir.hasOwnProperty.call(t,Nu)&&t[Nu];if(r===Object)return!0;if(!pa(r))return!1;let n=VC.get(r);return n===void 0&&(n=Function.toString.call(r),VC.set(r,n)),n===JN}function HC(e){return Wt(e)||kt(15,e),e[At].base_}function Lu(e,t,r=!0){ma(e)===0?(r?Reflect.ownKeys(e):ir.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ma(e){let t=e[At];return t?t.type_:Uu(e)?1:Qu(e)?2:Bu(e)?3:0}var _u=(e,t,r=ma(e))=>r===2?e.has(t):ir[ju].hasOwnProperty.call(e,t),Gn=(e,t,r=ma(e))=>r===2?e.get(t):e[t],Pd=(e,t,r,n=ma(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function ZN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Uu=Array.isArray,Qu=e=>e instanceof Map,Bu=e=>e instanceof Set,Ui=e=>typeof e=="object",pa=e=>typeof e=="function",Jy=e=>typeof e=="boolean";function e0(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var t0=e=>Ui(e)?e?.[At]:null,$n=e=>e.copy_||e.base_;var sS=e=>e.modified_?e.copy_:e.base_;function tS(e,t){if(Qu(e))return new Map(e);if(Bu(e))return new Set(e);if(Uu(e))return Array[ju].slice.call(e);let r=$C(e);if(t===!0||t==="class_only"&&!r){let n=ir.getOwnPropertyDescriptors(e);delete n[At];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Ed]===!1&&(p[Ed]=!0,p[eS]=!0),(p.get||p.set)&&(n[i]={[eS]:!0,[Ed]:!0,[Td]:p[Td],[Du]:e[i]})}return ir.create(fa(e),n)}else{let n=fa(e);if(n!==null&&r)return{...e};let o=ir.create(n);return ir.assign(o,e)}}function cS(e,t=!1){return qd(e)||Wt(e)||!Kt(e)||(ma(e)>1&&ir.defineProperties(e,{set:Fd,add:Fd,clear:Fd,delete:Fd}),ir.freeze(e),t&&Lu(e,(r,n)=>{cS(n,!0)},!1)),e}function r0(){kt(2)}var Fd={[Du]:r0};function qd(e){return e===null||!Ui(e)?!0:ir.isFrozen(e)}var kd="MapSet",Od="Patches",jC="ArrayMethods",_d={};function ga(e){let t=_d[e];return t||kt(0,e),t}var LC=e=>!!_d[e];function n0(e,t){_d[e]||(_d[e]=t)}var qu,zC=()=>qu,o0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:LC(kd)?ga(kd):void 0,arrayMethodsPlugin_:LC(jC)?ga(jC):void 0});function UC(e,t){t&&(e.patchPlugin_=ga(Od),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function rS(e){nS(e),e.drafts_.forEach(a0),e.drafts_=null}function nS(e){e===qu&&(qu=e.parent_)}var QC=e=>qu=o0(qu,e);function a0(e){let t=e[At];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function BC(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[At].modified_&&(rS(t),kt(4)),Kt(e)&&(e=GC(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[At].base_,e,t)}else e=GC(t,r);return i0(t,e,!0),rS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==iS?e:void 0}function GC(e,t){if(qd(t))return t;let r=t[At];if(!r)return Nd(t,e.handledSet_,e);if(!Md(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);YC(r,e)}return r.copy_}function i0(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cS(t,r)}function WC(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Md=(e,t)=>e.scope_===t,s0=[];function KC(e,t,r,n){let o=$n(e),a=e.type_;if(n!==void 0&&Gn(o,n,a)===t){Pd(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;Lu(o,(f,m)=>{if(Wt(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??s0;for(let p of i)Pd(o,p,r,a)}function c0(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Md(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=sS(a);KC(e,a.draft_??a,i,r),YC(a,o)})}function YC(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)}WC(e)}}function u0(e,t,r){let{scope_:n}=e;if(Wt(r)){let o=r[At];Md(o,n)&&o.callbacks_.push(function(){Id(e);let i=sS(o);KC(e,r,i,t)})}else Kt(r)&&e.callbacks_.push(function(){let a=$n(e);e.type_===3?a.has(r)&&Nd(r,n.handledSet_,n):Gn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Nd(Gn(e.copy_,t,e.type_),n.handledSet_,n)})}function Nd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Wt(e)||t.has(e)||!Kt(e)||qd(e)||(t.add(e),Lu(e,(n,o)=>{if(Wt(o)){let a=o[At];if(Md(a,r)){let i=sS(a);Pd(e,n,i,e.type_),WC(a)}}else Kt(o)&&Nd(o,t,r)})),e}function l0(e,t){let r=Uu(e),n={type_:r?1:0,scope_:t?t.scope_:zC(),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=Dd;r&&(o=[n],a=Mu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var Dd={get(e,t){if(t===At)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(!_u(o,t,e.type_))return d0(e,o,t);let a=o[t];if(e.finalized_||!Kt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&e0(t))return a;if(a===Zy(e.base_,t)){Id(e);let i=e.type_===1?+t:t,p=aS(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=XC($n(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Zy($n(e),t),a=o?.[At];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(ZN(r,o)&&(r!==void 0||_u(e.base_,t,e.type_)))return!0;Id(e),oS(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),u0(e,t,r)),!0},deleteProperty(e,t){return Id(e),Zy(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),oS(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&&{[Ed]:!0,[eS]:e.type_!==1||t!=="length",[Td]:n[Td],[Du]:r[t]}},defineProperty(){kt(11)},getPrototypeOf(e){return fa(e.base_)},setPrototypeOf(){kt(12)}},Mu={};for(let e in Dd){let t=Dd[e];Mu[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Mu.deleteProperty=function(e,t){return Mu.set.call(this,e,t,void 0)};Mu.set=function(e,t,r){return Dd.set.call(this,e[0],t,r,e[0])};function Zy(e,t){let r=e[At];return(r?$n(r):e)[t]}function d0(e,t,r){let n=XC(t,r);return n?Du in n?n[Du]:n.get?.call(e.draft_):void 0}function XC(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 oS(e){e.modified_||(e.modified_=!0,e.parent_&&oS(e.parent_))}function Id(e){e.copy_||(e.assigned_=new Map,e.copy_=tS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var p0=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)||kt(6),n!==void 0&&!pa(n)&&kt(7);let o;if(Kt(t)){let a=QC(this),i=aS(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?rS(a):nS(a)}return UC(a,n),BC(o,a)}else if(!t||!Ui(t)){if(o=r(t),o===void 0&&(o=t),o===iS&&(o=void 0),this.autoFreeze_&&cS(o,!0),n){let a=[],i=[];ga(Od).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else kt(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]},Jy(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Jy(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Jy(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Kt(e)||kt(8),Wt(e)&&(e=Vd(e));let t=QC(this),r=aS(t,e,void 0);return r[At].isManual_=!0,nS(t),r}finishDraft(e,t){let r=e&&e[At];(!r||!r.isManual_)&&kt(9);let{scope_:n}=r;return UC(n,t),BC(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(Od).applyPatches_;return Wt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function aS(e,t,r,n){let[o,a]=Qu(t)?ga(kd).proxyMap_(t,r):Bu(t)?ga(kd).proxySet_(t,r):l0(t,r);return(r?.scope_??zC()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?c0(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 Vd(e){return Wt(e)||kt(10,e),JC(e)}function JC(e){if(!Kt(e)||qd(e))return e;let t=e[At],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=tS(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=tS(e,!0);return Lu(r,(o,a)=>{Pd(r,o,JC(a))},n),t&&(t.finalized_=!1),r}function ZC(){function t(x,b=[]){if(x.key_!==void 0){let w=x.parent_.copy_??x.parent_.base_,R=t0(Gn(w,x.key_)),E=Gn(w,x.key_);if(E===void 0||E!==x.draft_&&E!==x.base_&&E!==x.copy_||R!=null&&R.base_!==x.base_)return null;let I=x.parent_.type_===3,k;if(I){let T=x.parent_;k=Array.from(T.drafts_.keys()).indexOf(x.key_)}else k=x.key_;if(!(I&&w.size>k||_u(w,k)))return null;b.push(k)}if(x.parent_)return t(x.parent_,b);b.reverse();try{r(x.copy_,b)}catch{return null}return b}function r(x,b){let w=x;for(let R=0;R<b.length-1;R++){let E=b[R];if(w=Gn(w,E),!Ui(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(x,b,w){if(x.scope_.processedForPatches_.has(x))return;x.scope_.processedForPatches_.add(x);let{patches_:R,inversePatches_:E}=w;switch(x.type_){case 0:case 2:return f(x,b,R,E);case 1:return p(x,b,R,E);case 3:return m(x,b,R,E)}}function p(x,b,w,R){let{base_:E,assigned_:I}=x,k=x.copy_;k.length<E.length&&([E,k]=[k,E],[w,R]=[R,w]);let T=x.allIndicesReassigned_===!0;for(let D=0;D<E.length;D++){let G=k[D],L=E[D];if((T||I?.get(D.toString()))&&G!==L){let B=G?.[At];if(B&&B.modified_)continue;let j=b.concat([D]);w.push({op:n,path:j,value:h(G)}),R.push({op:n,path:j,value:h(L)})}}for(let D=E.length;D<k.length;D++){let G=b.concat([D]);w.push({op:o,path:G,value:h(k[D])})}for(let D=k.length-1;E.length<=D;--D){let G=b.concat([D]);R.push({op:a,path:G})}}function f(x,b,w,R){let{base_:E,copy_:I,type_:k}=x;Lu(x.assigned_,(T,D)=>{let G=Gn(E,T,k),L=Gn(I,T,k),V=D?_u(E,T)?n:o:a;if(G===L&&V===n)return;let B=b.concat(T);w.push(V===a?{op:V,path:B}:{op:V,path:B,value:h(L)}),R.push(V===o?{op:a,path:B}:V===a?{op:o,path:B,value:h(G)}:{op:n,path:B,value:h(G)})})}function m(x,b,w,R){let{base_:E,copy_:I}=x,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(x,b,w){let{patches_:R,inversePatches_:E}=w;R.push({op:n,path:[],value:b===iS?void 0:b}),E.push({op:n,path:[],value:x})}function v(x,b){return b.forEach(w=>{let{path:R,op:E}=w,I=x;for(let G=0;G<R.length-1;G++){let L=ma(I),V=R[G];typeof V!="string"&&typeof V!="number"&&(V=""+V),(L===0||L===1)&&(V==="__proto__"||V===Nu)&&kt(19),pa(I)&&V===ju&&kt(19),I=Gn(I,V),Ui(I)||kt(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:kt(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:kt(17,E)}}),x}function C(x){if(!Kt(x))return x;if(Uu(x))return x.map(C);if(Qu(x))return new Map(Array.from(x.entries()).map(([w,R])=>[w,C(R)]));if(Bu(x))return new Set(Array.from(x).map(C));let b=Object.create(fa(x));for(let w in x)b[w]=C(x[w]);return _u(x,Ou)&&(b[Ou]=x[Ou]),b}function h(x){return Wt(x)?C(x):x}n0(Od,{applyPatches_:v,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var Vu=new p0,ha=Vu.produce,uS=Vu.produceWithPatches.bind(Vu);var lS=Vu.applyPatches.bind(Vu);d();c();l();u();function f0(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function m0(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 eb=e=>Array.isArray(e)?e:[e];function g0(e){let t=Array.isArray(e[0])?e[0]:e;return m0(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function h0(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var y0=class{constructor(e){this.value=e}deref(){return this.value}},S0=()=>typeof WeakRef>"u"?y0:WeakRef,rb=S0(),v0=0,tb=1;function jd(){return{s:v0,v:void 0,o:null,p:null}}function A0(e){return e instanceof rb?e.deref():e}function Gu(e,t={}){let r=jd(),{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 x=p.o;x===null&&(p.o=x=new WeakMap);let b=x.get(h);b===void 0?(p=jd(),x.set(h,p)):p=b}else{let x=p.p;x===null&&(p.p=x=new Map);let b=x.get(h);b===void 0?(p=jd(),x.set(h,p)):p=b}}let m=p,g;if(p.s===tb)g=p.v;else if(g=e.apply(null,arguments),a++,n){let v=A0(o);v!=null&&n(v,g)&&(g=v,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new rb(g):g}return m.s=tb,m.v=g,g}return i.clearCache=()=>{r=jd(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function x0(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()),f0(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:v,memoizeOptions:C=[],argsMemoize:h=Gu,argsMemoizeOptions:x=[]}=g,b=eb(C),w=eb(x),R=g0(o),E=v(function(){return a++,m.apply(null,arguments)},...b),I=!0,k=h(function(){i++;let D=h0(R,arguments);return p=E.apply(null,D),p},...w);return Object.assign(k,{resultFunc:m,memoizedResultFunc:E,dependencies:R,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var et=x0(Gu);d();c();l();u();function nb(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var ob=nb(),ab=nb;var C0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pu:Pu.apply(null,arguments)},$K=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},b0=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Yt(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=>ku(n)&&n.type===e,r}var fb=class $u extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,$u.prototype)}static get[Symbol.species](){return $u}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new $u(...t[0].concat(this)):new $u(...t.concat(this))}};function ib(e){return Kt(e)?ha(e,()=>{}):e}function Ld(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function w0(e){return typeof e=="boolean"}var R0=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new fb;return r&&(w0(r)?i.push(ob):i.push(ab(r.extraArgument))),i},Hu="RTK_autoBatch",Gi=()=>e=>({payload:e,meta:{[Hu]:!0}}),sb=e=>t=>{setTimeout(t,e)},F0=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},E0=(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?F0(window.requestAnimationFrame,100):sb(10):e.type==="callback"?e.queueNotification:sb(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?.[Hu],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},I0=e=>function(r){let{autoBatch:n=!0}=r??{},o=new fb(e);return n&&o.push(E0(typeof n=="object"?n:void 0)),o};function mb(e){let t=R0(),{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=Li(r);else throw new Error(Yt(1));let m;typeof n=="function"?m=n(t):m=t();let g=Pu;o&&(g=C0({trace:!1,...(typeof o=="object"&&o)}));let v=MC(...m),C=I0(v),h=typeof p=="function"?p(C):C(),x=g(...h);return Xy(f,i,x)}function gb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Yt(28));if(p in t)throw new Error(Yt(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 T0(e){return typeof e=="function"}function ae(e,t){let[r,n,o]=gb(t),a;if(T0(e))a=()=>ib(e());else{let p=ib(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(Wt(g)){let h=v(g,f);return h===void 0?g:h}else{if(Kt(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 hb=(e,t)=>b0(e)?e.match(t):e(t);function Jr(...e){return t=>e.some(r=>hb(r,t))}function Bi(...e){return t=>e.every(r=>hb(r,t))}function Gd(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 zu(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function $d(...e){return e.length===0?t=>Gd(t,["pending"]):zu(e)?Jr(...e.map(t=>t.pending)):$d()(e[0])}function Sa(...e){return e.length===0?t=>Gd(t,["rejected"]):zu(e)?Jr(...e.map(t=>t.rejected)):Sa()(e[0])}function Wu(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Bi(Sa(...e),t):zu(e)?Bi(Sa(...e),t):Wu()(e[0])}function Hn(...e){return e.length===0?t=>Gd(t,["fulfilled"]):zu(e)?Jr(...e.map(t=>t.fulfilled)):Hn()(e[0])}function Hd(...e){return e.length===0?t=>Gd(t,["pending","fulfilled","rejected"]):zu(e)?Jr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Hd()(e[0])}var P0="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ku=(e=21)=>{let t="",r=e;for(;r--;)t+=P0[Math.random()*64|0];return t},k0=["name","message","stack","code"],dS=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},cb=class{constructor(e,t){de(this,"payload");de(this,"meta");de(this,"_type");this.payload=e,this.meta=t}},O0=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of k0)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ub="External signal was aborted",xe=(()=>{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||O0)(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):Ku(),x=new s.AbortController,b,w;function R(I){w=I,x.abort()}m&&(m.aborted?R(ub):m.addEventListener("abort",()=>R(ub),{once:!0}));let E=_asyncToGenerator(function*(){let I;try{let T=n?.condition?.(f,{getState:v,extra:C});if(N0(T)&&(T=yield T),T===!1||x.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,L)=>{b=()=>{L({name:"AbortError",message:w||"Aborted"})},x.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:x.signal,abort:R,rejectWithValue:(G,L)=>new dS(G,L),fulfillWithValue:(G,L)=>new cb(G,L)})).then(G=>{if(G instanceof dS)throw G;return G instanceof cb?o(G.payload,h,f,G.meta):o(G,h,f)})])}catch(T){I=T instanceof dS?i(null,h,f,T.payload,T.meta):i(T,h,f)}finally{b&&x.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(_0)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Jr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function _0(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function N0(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var yb=Symbol.for("rtk-slice-createasyncthunk"),zK={[yb]:xe};function D0(e,t){return`${e}/${t}`}function q0({creators:e}={}){let t=e?.asyncThunk?.[yb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Yt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(V0()):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(Yt(12));if(T in f.sliceCaseReducersByType)throw new Error(Yt(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:D0(o,I),createNotation:typeof n.reducers=="function"};L0(k)?Q0(T,k,m,t):j0(T,k,m)});function g(){let[I={},k=[],T=void 0]=typeof n.extraReducers=="function"?gb(n.extraReducers):[n.extraReducers],D={...I,...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 v=I=>I,C=new Map,h=new WeakMap,x;function b(I,k){return x||(x=g()),x(I,k)}function w(){return x||(x=g()),x.getInitialState()}function R(I,k=!1){function T(G){let L=G[I];return typeof L>"u"&&k&&(L=Ld(h,T,w)),L}function D(G=v){let L=Ld(C,k,()=>new WeakMap);return Ld(L,G,()=>{let V={};for(let[B,j]of Object.entries(n.selectors??{}))V[B]=M0(j,G,()=>Ld(h,G,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 M0(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=q0();function V0(){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 j0({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!U0(n))throw new Error(Yt(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 L0(e){return e._reducerDefinitionType==="asyncThunk"}function U0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Q0({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Yt(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||Ud,pending:p||Ud,rejected:f||Ud,settled:m||Ud})}function Ud(){}var B0="task",Sb="listener",vb="completed",mS="cancelled",G0=`task-${mS}`,$0=`task-${vb}`,pS=`${Sb}-${mS}`,H0=`${Sb}-${vb}`,zd=class{constructor(e){de(this,"code");de(this,"name","TaskAbortError");de(this,"message");this.code=e,this.message=`${B0} ${mS} (reason: ${e})`}},gS=(e,t)=>{if(typeof e!="function")throw new TypeError(Yt(32))},Qd=()=>{},Ab=(e,t=Qd)=>(e.catch(t),e),xb=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ya=e=>{if(e.aborted)throw new zd(e.reason)};function Cb(e,t){let r=Qd;return new Promise((n,o)=>{let a=()=>o(new zd(e.reason));if(e.aborted){a();return}r=xb(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Qd})}var z0=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof zd?"cancelled":"rejected",error:r}}finally{t?.()}});return function z0(_x7,_x8){return _ref5.apply(this,arguments)}}(),Bd=e=>t=>Ab(Cb(e,t).then(r=>(ya(e),r))),bb=e=>{let t=Bd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Qi}=Object,lb={},Wd="listenerMiddleware",W0=(e,t)=>{let r=n=>xb(e,()=>n.abort(e.reason));return(n,o)=>{gS(n,"taskExecutor");let a=new s.AbortController;r(a);let i=z0(/*#__PURE__*/_asyncToGenerator(function*(){ya(e),ya(a.signal);let p=yield n({pause:Bd(a.signal),delay:bb(a.signal),signal:a.signal});return ya(a.signal),p}),()=>a.abort($0));return o?.autoJoin&&t.push(i.catch(Qd)),{result:Bd(e)(i),cancel(){a.abort(G0)}}}},K0=(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 Cb(t,Promise.race(p));return ya(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>Ab(r(n,o))},wb=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(Yt(21));return gS(a,"options.listener"),{predicate:o,type:t,effect:a}},Rb=Qi(e=>{let{type:t,predicate:r,effect:n}=wb(e);return{id:Ku(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Yt(22))}}},{withTypes:()=>Rb}),db=(e,t)=>{let{type:r,effect:n,predicate:o}=wb(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},fS=e=>{e.pending.forEach(t=>{t.abort(pS)})},Y0=(e,t)=>()=>{for(let r of t.keys())fS(r);e.clear()},pb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Fb=Qi(P(`${Wd}/add`),{withTypes:()=>Fb}),X0=P(`${Wd}/removeAll`),Eb=Qi(P(`${Wd}/remove`),{withTypes:()=>Eb}),J0=(...e)=>{console.error(`${Wd}/error`,...e)},Ib=(e={})=>{let t=new Map,r=new Map,n=h=>{let x=r.get(h)??0;r.set(h,x+1)},o=h=>{let x=r.get(h)??1;x===1?r.delete(h):r.set(h,x-1)},{extra:a,onError:i=J0}=e;gS(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),x=>{h.unsubscribe(),x?.cancelActive&&fS(h)}),f=h=>{let x=db(t,h)??Rb(h);return p(x)};Qi(f,{withTypes:()=>f});let m=h=>{let x=db(t,h);return x&&(x.unsubscribe(),h.cancelActive&&fS(x)),!!x};Qi(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,x,b,w){let R=new s.AbortController,E=K0(f,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(x,Qi({},b,{getOriginalState:w,condition:(k,T)=>E(k,T).then(Boolean),take:E,delay:bb(R.signal),pause:Bd(R.signal),extra:a,signal:R.signal,fork:W0(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,T,D)=>{k!==R&&(k.abort(pS),D.delete(k))})},cancel:()=>{R.abort(pS),h.pending.delete(R)},throwIfCancelled:()=>{ya(R.signal)}})))}catch(k){k instanceof zd||pb(i,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(H0),o(h),h.pending.delete(R)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),v=Y0(t,r);return{middleware:h=>x=>b=>{if(!ku(b))return x(b);if(Fb.match(b))return f(b.payload);if(X0.match(b)){v();return}if(Eb.match(b))return m(b.payload);let w=h.getState(),R=()=>{if(w===lb)throw new Error(Yt(23));return w},E;try{if(E=x(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(G){D=!1,pb(i,G,{raisedBy:"predicate"})}D&&g(T,b,h,R)}}}finally{w=lb}return E},startListening:f,stopListening:m,clearListeners:v}};function Yt(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 Tb(){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 Pb=/^(?:[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 Z0(e){return typeof e=="string"&&Pb.test(e)}var hS=Z0;d();c();l();u();var Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function kb(e,t=0){return(Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]).toLowerCase()}d();c();l();u();var yS,eD=new Uint8Array(16);function SS(){if(!yS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yS=crypto.getRandomValues.bind(crypto)}return yS(eD)}d();c();l();u();d();c();l();u();var tD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vS={randomUUID:tD};function rD(e,t,r){e=e||{};let n=e.random??e.rng?.()??SS();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 kb(n)}function nD(e,t,r){return vS.randomUUID&&!t&&!e?vS.randomUUID():rD(e,t,r)}var AS=nD;function oD(_x13){return _oD.apply(this,arguments)}function _oD(){_oD=_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 _oD.apply(this,arguments)}var Mb="2.1.1",xS=128,Vb=192,Ob=224,_b=240,aD=248;function iD(e){return(e&aD)===_b?4:(e&_b)===Ob?3:(e&Ob)===Vb?2:1}function sD(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&xS)!=xS)break;if(r-=3,(n&Vb)!=xS){t-r>=iD(n)*3&&(r=t);break}}return e.substring(0,r)}function cD(e){let{trackingId:t}=e;return{trackingId:t}}function uD(e){return(e.source||[]).concat([`relay@${Mb}`])}function jb(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=cD(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:uD(t),clientId:p,userAgent:a(),referrer:Nb(n()),location:Nb(o())})}function Nb(e){return e!==null?sD(e,1024):null}function lD(e,t,r,n){return{...t,meta:jb(e,r,n)}}var dD="*";function pD(){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===dD)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 Db({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 fD(e){let t=Db(e);return{get:()=>t,update:r=>{t=Db({...t,...r})}}}var CS=mD();function mD(){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 gD(){return{getItem(e){return CS.getItem(e)||localStorage.getItem(e)},removeItem(e){CS.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),CS.setItem(e,t,31556952e3)}}}var qb="visitorId";function hD(){let e=document.referrer;return e===""?null:e}function bS(){let e=gD();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}`}});Tb().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:()=>hD(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(qb);if(t&&hS(t))return t;let r=AS();return e.setItem(qb,r),r}}}function yD(){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 SD(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function vD(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=SD();return t&&r?{...r,runtime:"custom"}:t&&AD()&&yD()?bS():n}function AD(){try{return typeof window=="object"}catch{return!1}}function xD(e){return{get:()=>Object.freeze(vD(e))}}function Lb(e){let t=fD(e),r=pD(),n=xD(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=lD(o,a,i,p);return oD({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>jb(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 Ub(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Ao="3.51.4",Qb=["@coveo/atomic","@coveo/quantic"];var $i=et(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Ao}`));var Yu=et(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>$i(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=bD(p);return Lb({mode:a?"emit":"disabled",url:o??Ad(e,t),token:r,trackingId:n??null,source:i,environment:f})}),CD={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},bD=e=>{if(!e)return;let t=e();return{...(Ub()?bS():CD),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 Q(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 FS(){return typeof window<"u"}function jS(){return typeof navigator<"u"}function Hi(){return typeof document<"u"}function ES(){try{return typeof localStorage<"u"}catch{return!1}}function wD(){try{return typeof sessionStorage<"u"}catch{return!1}}function rw(){return jS()&&navigator.cookieEnabled}var RD=[_e.click,_e.custom,_e.search,_e.view],FD=(e,t)=>RD.indexOf(e)!==-1?Object.assign({language:Hi()?document.documentElement.lang:"unknown",userAgent:jS()?navigator.userAgent:"unknown"},t):t,Ju=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?Bb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Bb(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 Bb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function ED(){return ES()?localStorage:rw()?new Zu:wD()?sessionStorage:new Wi}var Zu=class e{getItem(t){return Ju.get(`${e.prefix}${t}`)}removeItem(t){Ju.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ju.set(`${e.prefix}${t}`,r,n)}};Zu.prefix="coveo_";var IS=class{constructor(){this.cookieStorage=new Zu}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)}},Wi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Kd="__coveo.analytics.history",ID=20,TD=1e3*60,PD=75,Jd=class{constructor(t){this.store=t||ED()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return Q(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return Q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Kd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return Q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Kd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Kd,JSON.stringify(t.slice(0,ID)))}catch{}}clear(){try{this.store.removeItem(Kd)}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,PD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>TD:!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 kD=(e,t)=>Q(void 0,void 0,void 0,function*(){return e===_e.view?(yield OD(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),OD=e=>Q(void 0,void 0,void 0,function*(){let t=new Jd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Yd,_D=new Uint8Array(16);function ND(){if(!Yd&&(Yd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Yd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Yd(_D)}var DD=/^(?:[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 Zd(e){return typeof e=="string"&&DD.test(e)}var _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function nw(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 qD(e){if(!Zd(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 MD(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var VD="6ba7b810-9dad-11d1-80b4-00c04fd430c8",jD="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function LD(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=MD(o)),typeof a=="string"&&(a=qD(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 nw(m)}try{n.name=e}catch{}return n.DNS=VD,n.URL=jD,n}var UD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gb={randomUUID:UD};function Aa(e,t,r){if(Gb.randomUUID&&!t&&!e)return Gb.randomUUID();e=e||{};let n=e.random||(e.rng||ND)();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 nw(n)}function QD(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 wS(e,t){return e<<t|e>>>32-t}function BD(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]=wS(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 x=Math.floor(h/20),b=wS(f,5)+QD(x,m,g,v)+C+t[x]+p[h]>>>0;C=v,v=g,g=wS(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 GD=LD("v5",80,BD),$b=GD,ow="2.30.56",Hb=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Xu={pageview:"pageview",event:"event"},ep=class{constructor({client:t,uuidGenerator:r=Aa}){this.client=t,this.uuidGenerator=r}},TS=class extends ep{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Hb(window.location),this.lastReferrer=Hi()?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:Hi()?document.title:"",encoding:Hi()?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===Xu.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Xu.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Xu.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Xu.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 Hb(window.location)}},xo=class e{constructor(t,r){if(!Zd(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 Zd(a)?new e(a,Number.parseInt(o)*1e3):null}};xo.cvo_cid="cvo_cid";xo.expirationTime=120;var PS=class extends ep{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return Q(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(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 yr=Object.keys;function Xd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var RS=128,aw=192,zb=224,Wb=240;function $D(e){return(e&248)===Wb?4:(e&Wb)===zb?3:(e&zb)===aw?2:1}function HD(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&RS)!=RS)break;if(r-=3,(n&aw)!=RS){t-r>=$D(n)*3&&(r=t);break}}return e.substring(0,r)}var kS={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"},zD=yr(kS).map(e=>kS[e]),WD=[...zD].join("|"),KD=new RegExp(`^(${WD}$)`),YD={svcAction:"svc_action",svcActionData:"svc_action_data"},XD=e=>yr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=kS[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),JD=e=>KD.test(e),ZD=[JD],Kb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Yb={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Mt={action:"pa",list:"pal",listSource:"pls"},tp={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},eq=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],OS={id:"quoteId",affiliation:"quoteAffiliation"},_S={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},tq={add:Mt,bookmark_add:Mt,bookmark_remove:Mt,click:Mt,checkout:Mt,checkout_option:Mt,detail:Mt,impression:Mt,remove:Mt,refund:Object.assign(Object.assign({},Mt),tp),purchase:Object.assign(Object.assign({},Mt),tp),quickview:Mt,quote:Object.assign(Object.assign({},Mt),OS),review:Object.assign(Object.assign({},Mt),_S)},rq=yr(Kb).map(e=>Kb[e]),nq=yr(Yb).map(e=>Yb[e]),oq=yr(Mt).map(e=>Mt[e]),aq=yr(tp).map(e=>tp[e]),iq=yr(_S).map(e=>_S[e]),sq=yr(OS).map(e=>OS[e]),cq=[...rq,"custom"].join("|"),uq=[...nq,"custom"].join("|"),iw="(pr[0-9]+)",sw="(il[0-9]+pi[0-9]+)",lq=new RegExp(`^${iw}(${cq})$`),dq=new RegExp(`^(${sw}(${uq}))|(il[0-9]+nm)$`),pq=new RegExp(`^(${oq.join("|")})$`),fq=new RegExp(`^(${aq.join("|")})$`),mq=new RegExp(`^${iw}custom$`),gq=new RegExp(`^${sw}custom$`),hq=new RegExp(`^(${[...eq,...iq,...sq].join("|")})$`),yq=e=>lq.test(e),Sq=e=>dq.test(e),vq=e=>pq.test(e),Aq=e=>fq.test(e),xq=e=>hq.test(e),Cq=[Sq,yq,vq,Aq,xq],bq=[mq,gq],wq={anonymizeIp:"aip"},Rq={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Fq={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Eq=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Iq=Object.assign(Object.assign(Object.assign(Object.assign({},wq),Rq),Fq),Eq.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),NS=Object.assign(Object.assign({},Iq),YD),Tq=e=>{let t=!!e.action&&tq[e.action]||{};return yr(e).reduce((r,n)=>{let o=t[n]||NS[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Pq=yr(NS).map(e=>NS[e]),kq=e=>Pq.indexOf(e)!==-1,Oq=e=>e==="custom",_q=e=>[...Cq,...ZD,kq,Oq].some(t=>t(e)),Nq=e=>yr(e).reduce((t,r)=>{let n=Dq(r);return n?Object.assign(Object.assign({},t),qq(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Dq=e=>{let t;return[...bq].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},qq=(e,t)=>yr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),DS=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,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 Q(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 Q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(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}},qS=class{sendEvent(t,r){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}},Xb=y.fetch,rp=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(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 Xb(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 Q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Xb(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[_e.click,_e.custom,_e.search,_e.view].indexOf(t)!==-1}getVisitorIdParam(){return Q(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},MS=class{constructor(t,r){ES()&&rw()?this.storage=new IS:ES()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Wi),this.client=new rp(t),this.beaconClient=new DS(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}},VS=class{constructor(t,r){this.storage=r||new Wi,this.client=new rp(t)}getClientDependingOnEventType(t){return this.client}},np=class{constructor(){this.storage=new Wi,this.client=new qS}getClientDependingOnEventType(t){return this.client}},Mq="xx",Vq=e=>e?.startsWith(Mq)||!1,jq=`
27
+ `;return new Eu(r)}var Eu=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},Se=class{constructor(e){pe(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 sN(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}},Be=class{constructor(e={}){pe(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&de(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 cN(e){return e===null}function de(e){return Tt(e)||cN(e)}var fe=class{constructor(e={}){pe(this,"value");this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t||(uN(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function uN(e){return Tt(e)||fd(e)}function fd(e){return typeof e=="boolean"}var re=class{constructor(e={}){pe(this,"config");pe(this,"value");this.config=e,this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t||(lN(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 lN(e){return Tt(e)||ux(e)}function ux(e){return typeof e=="number"&&!Number.isNaN(e)}var dN=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,L=class{constructor(e={}){pe(this,"value");pe(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Be(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&&!(dN.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 X=class{constructor(e={}){pe(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(!lx(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&de(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 lx(e){return e!==void 0&&typeof e=="object"}var ie=class{constructor(e={}){pe(this,"config");pe(this,"value");this.config=e,this.value=new Be(this.config)}validate(e){if(!de(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(de(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&&de(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 fd(e)||Oi(e)||ux(e)||lx(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 Iu=class{constructor(e){pe(this,"config");pe(this,"value");this.config=e,this.value=new Be(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 md(e){return Array.isArray(e)}function gd(e){return e.trim()===""}function dx(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function pN(e){return btoa(encodeURI(e))}function hd(e,t){let{[e]:r,...n}=t;return n}function Ni(e){return pN(JSON.stringify(e))}var fN=new Set(["1",1,"yes",!0]);function px(){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=>fN.has(r))}function fx(e){let t={};for(let[r,n]of e)t[r]=n;return t}function mx(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Tu(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function yd(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 mN(e){if(gd(e.openingDelimiter)||gd(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(de(e.content)||gd(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 Gy(e,t){return e=Di(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?By(n,t.notMatchDelimiters):o?By(o,t.exactMatchDelimiters):a?By(a,t.correctionDelimiters):r)}function By(e,t){return t?t.open+e+t.close:e}function Di(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function hx(_x2,_x3){return _hx.apply(this,arguments)}function _hx(){_hx=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _hx.apply(this,arguments)}function yx(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=hN(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 Sx(e,t,r){let n=gx(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=gx();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":gN(g,n,t);break}}}}function gN(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function hN(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function gx(){return{data:"",event:"",id:"",retry:void 0}}var Hy="text/event-stream",yN=1e3,vx="last-event-id";function Ax(){return typeof window<"u"}function Sd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,v)=>{let x={...r};x.accept||(x.accept=Hy);let h;function C(){h?.abort(),document.hidden||k()}!p&&Ax()&&document.addEventListener("visibilitychange",C);let b=yN,w;function R(){Ax()&&document.removeEventListener("visibilitychange",C),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{R(),g()});let E=f??S,I=n??SN;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:x,signal:h?.signal});yield I(T),yield hx(T.body,yx(Sx(D=>{D?x[vx]=D:delete x[vx]},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 SN(e){let t=e.headers.get("content-type");if(!t?.startsWith(Hy))throw new Error(`Expected content-type to be ${Hy}, Actual: ${t}`)}d();c();l();u();var ho=class{constructor(t){pe(this,"_basePath");pe(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 vN=(e,t,r)=>new ho(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Cx=3,AN=5e3,CN="text/event-stream",Ky=1,zy=class extends Error{},Pu=class extends Error{constructor(r){super(r.message);pe(this,"payload",r)}},Wy=class{constructor(){pe(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)}},vd=class{constructor(t){pe(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 Wy;if(!a){this.logger.error("No stream ID found");return}let x=0,h,C=()=>{h&&!v.isActive(h)&&(w?.abort(),g(),R())},b=()=>{v.remove(h),h=mx(C,h,AN),v.add(h)},w=new s.AbortController,R=()=>Sd(vN(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")===CN)return;throw E.status>=400&&E.status<500&&E.status!==429?new Pu({message:"Error opening stream",code:E.status}):new zy})()},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),x=0,I.finishReason==="COMPLETED"?(v.remove(h),m()):b()},onerror:E=>{if(!w?.signal.aborted){if(v.remove(h),E instanceof Pu)throw w?.abort(),f(E),E;if(++x>Cx){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Ky};throw w?.abort(),f(I),new Pu(I)}this.logger.info(`Retrying...(${x}/${Cx})`),g()}}});return R(),w}};d();c();l();u();var Ad=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?xN(e):bN(t)},xN=e=>RN(e)?FN(e):wN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},bN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function wN(e){return e.body.statusCode!==void 0}function RN(e){return e.body.exception!==void 0}var FN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var _x=Vr(Tx(),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();pe(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 Px(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function kx(e){return typeof e!="object"||!e?!1:Object.values(e).every(XN)}function XN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Ox(e){return e===429}var jr=class e{static call(t){return _asyncToGenerator(function*(){let r=ZN(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(Ox(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,_x.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&Ox(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=Tu(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 gr(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Vi(e,t,r="prod"){return e??gr(t,r)}function St(e,t="prod"){return`${gr(e,t)}/rest/search/v2`}function xd(e,t="prod"){return`${gr(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function ZN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=e0(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function e0(e,t){return t==="application/x-www-form-urlencoded"?kx(e)?Px(e):"":JSON.stringify(e)}d();c();l();u();var vo=class{constructor(){pe(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 Nx(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Bn=(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 Dx=(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},qx=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jr.call({...Bn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:yo(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Nx(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return t0(i)?{success:i}:{error:So({response:r,body:i})}});return function qx(_x5,_x6){return _ref3.apply(this,arguments)}}();function t0(e){return typeof e=="string"}d();c();l();u();function r0(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function n0(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function bd(e,t){if(t&&e.name==="AbortError")return{error:n0(e)};if(e instanceof da)return{error:r0(e)};throw e}var wd=class{constructor(t){pe(this,"options",t);pe(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({...Bn(t,"POST","application/json","/plan"),requestParams:yo(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return bd(r);let n=yield r.json();return a0(n)?{success:n}:{error:So({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Bn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:yo(t),..._this3.options});if(r instanceof Error)return bd(r);let n=yield r.json(),o={response:r,body:n};return o0(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({...Bn(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 bd(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return Mx(a)?(i.body=Vx(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:So(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Bn(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({...Bn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Mx(n)){let o={response:r,body:n};return o.body=Vx(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:So({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return qx(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield jr.call({...Bn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return i0(n)?{success:n}:{error:So({response:r,body:n})}})()}},Rd=e=>e.success!==void 0,vt=e=>e.error!==void 0;function Mx(e){return e.results!==void 0}function Vx(e){let t=qi();return de(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function o0(e){return e.completions!==void 0}function a0(e){return e.preprocessingOutput!==void 0}function i0(e){return e.fields!==void 0}d();c();l();u();var jx=e=>e,Lx=e=>e,Ux=e=>e;d();c();l();u();d();c();l();u();var z=new L({required:!0,emptyAllowed:!1}),st=new L({required:!1,emptyAllowed:!1}),Ge=new L({required:!0,emptyAllowed:!0}),AK=new L({required:!1,emptyAllowed:!0}),Fd=new ie({each:z,required:!0}),Qx=new L({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Bx=new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),CK=new L({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Gn=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),hr=(e,t)=>{if("required"in t)return{payload:new Se({value:t}).validate({value:e}).value};let o=new X({options:{required:!0},values:t}).validate(e);if(o)throw new Eu(o);return{payload:e}},O=(e,t)=>{try{return hr(e,t)}catch(r){return{payload:e,error:Gn(r)}}},lt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Gx(e,t,r,o,"Controller initialization error")},He=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Gx(e,t,r,o,"Controller initialization error")},Gx=(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 Pt(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 s0=typeof Symbol=="function"&&Symbol.observable||"@@observable",$x=s0,oS=()=>Math.random().toString(36).substring(7).split("").join("."),c0={INIT:`@@redux/INIT${oS()}`,REPLACE:`@@redux/REPLACE${oS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${oS()}`},Ed=c0;function Jr(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 aS(e,t,r){if(typeof e!="function")throw new Error(Pt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Pt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Pt(1));return r(aS)(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(Pt(3));return o}function v(w){if(typeof w!="function")throw new Error(Pt(4));if(f)throw new Error(Pt(5));let R=!0;m();let E=p++;return i.set(E,w),function(){if(R){if(f)throw new Error(Pt(6));R=!1,m(),i.delete(E),a=null}}}function x(w){if(!Jr(w))throw new Error(Pt(7));if(typeof w.type>"u")throw new Error(Pt(8));if(typeof w.type!="string")throw new Error(Pt(17));if(f)throw new Error(Pt(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(Pt(10));n=w,x({type:Ed.REPLACE})}function C(){let w=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Pt(11));function E(){let k=R;k.next&&k.next(g())}return E(),{unsubscribe:w(E)}},[$x](){return this}}}return x({type:Ed.INIT}),{dispatch:x,subscribe:v,getState:g,replaceReducer:h,[$x]:C}}function u0(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ed.INIT})>"u")throw new Error(Pt(12));if(typeof r(void 0,{type:Ed.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pt(13))})}function ji(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{u0(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 x=n[v],h=r[x],C=p[x],b=h(C,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(Pt(14))}g[x]=b,m=m||b!==C}return m=m||n.length!==Object.keys(p).length,m?g:p}}function _u(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Hx(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Pt(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=_u(...p)(o.dispatch),{...o,dispatch:a}}}function Nu(e){return Jr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var mS=Symbol.for("immer-nothing"),Du=Symbol.for("immer-draftable"),At=Symbol.for("immer-state");function kt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,fa=sr.getPrototypeOf,Mu="constructor",Qu="prototype",cS="configurable",kd="enumerable",Td="writable",Vu="value",Wt=e=>!!e&&!!e[At];function Kt(e){return e?eb(e)||Gu(e)||!!e[Du]||!!e[Mu]?.[Du]||$u(e)||Hu(e):!1}var l0=sr[Qu][Mu].toString(),zx=new WeakMap;function eb(e){if(!e||!Li(e))return!1;let t=fa(e);if(t===null||t===sr[Qu])return!0;let r=sr.hasOwnProperty.call(t,Mu)&&t[Mu];if(r===Object)return!0;if(!pa(r))return!1;let n=zx.get(r);return n===void 0&&(n=Function.toString.call(r),zx.set(r,n)),n===l0}function tb(e){return Wt(e)||kt(15,e),e[At].base_}function Bu(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[At];return t?t.type_:Gu(e)?1:$u(e)?2:Hu(e)?3:0}var qu=(e,t,r=ma(e))=>r===2?e.has(t):sr[Qu].hasOwnProperty.call(e,t),$n=(e,t,r=ma(e))=>r===2?e.get(t):e[t],Od=(e,t,r,n=ma(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function d0(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Gu=Array.isArray,$u=e=>e instanceof Map,Hu=e=>e instanceof Set,Li=e=>typeof e=="object",pa=e=>typeof e=="function",iS=e=>typeof e=="boolean";function p0(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var f0=e=>Li(e)?e?.[At]:null,Hn=e=>e.copy_||e.base_;var gS=e=>e.modified_?e.copy_:e.base_;function uS(e,t){if($u(e))return new Map(e);if(Hu(e))return new Set(e);if(Gu(e))return Array[Qu].slice.call(e);let r=eb(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[At];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Td]===!1&&(p[Td]=!0,p[cS]=!0),(p.get||p.set)&&(n[i]={[cS]:!0,[Td]:!0,[kd]:p[kd],[Vu]: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 hS(e,t=!1){return Vd(e)||Wt(e)||!Kt(e)||(ma(e)>1&&sr.defineProperties(e,{set:Id,add:Id,clear:Id,delete:Id}),sr.freeze(e),t&&Bu(e,(r,n)=>{hS(n,!0)},!1)),e}function m0(){kt(2)}var Id={[Vu]:m0};function Vd(e){return e===null||!Li(e)?!0:sr.isFrozen(e)}var _d="MapSet",Nd="Patches",Wx="ArrayMethods",Dd={};function ga(e){let t=Dd[e];return t||kt(0,e),t}var Kx=e=>!!Dd[e];function g0(e,t){Dd[e]||(Dd[e]=t)}var ju,rb=()=>ju,h0=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Kx(_d)?ga(_d):void 0,arrayMethodsPlugin_:Kx(Wx)?ga(Wx):void 0});function Yx(e,t){t&&(e.patchPlugin_=ga(Nd),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lS(e){dS(e),e.drafts_.forEach(y0),e.drafts_=null}function dS(e){e===ju&&(ju=e.parent_)}var Jx=e=>ju=h0(ju,e);function y0(e){let t=e[At];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Xx(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[At].modified_&&(lS(t),kt(4)),Kt(e)&&(e=Zx(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[At].base_,e,t)}else e=Zx(t,r);return S0(t,e,!0),lS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==mS?e:void 0}function Zx(e,t){if(Vd(t))return t;let r=t[At];if(!r)return qd(t,e.handledSet_,e);if(!jd(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);ab(r,e)}return r.copy_}function S0(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hS(t,r)}function nb(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var jd=(e,t)=>e.scope_===t,v0=[];function ob(e,t,r,n){let o=Hn(e),a=e.type_;if(n!==void 0&&$n(o,n,a)===t){Od(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;Bu(o,(f,m)=>{if(Wt(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??v0;for(let p of i)Od(o,p,r,a)}function A0(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!jd(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=gS(a);ob(e,a.draft_??a,i,r),ab(a,o)})}function ab(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)}nb(e)}}function C0(e,t,r){let{scope_:n}=e;if(Wt(r)){let o=r[At];jd(o,n)&&o.callbacks_.push(function(){Pd(e);let i=gS(o);ob(e,r,i,t)})}else Kt(r)&&e.callbacks_.push(function(){let a=Hn(e);e.type_===3?a.has(r)&&qd(r,n.handledSet_,n):$n(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&qd($n(e.copy_,t,e.type_),n.handledSet_,n)})}function qd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Wt(e)||t.has(e)||!Kt(e)||Vd(e)||(t.add(e),Bu(e,(n,o)=>{if(Wt(o)){let a=o[At];if(jd(a,r)){let i=gS(a);Od(e,n,i,e.type_),nb(a)}}else Kt(o)&&qd(o,t,r)})),e}function x0(e,t){let r=Gu(e),n={type_:r?1:0,scope_:t?t.scope_:rb(),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=Md;r&&(o=[n],a=Lu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var Md={get(e,t){if(t===At)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=Hn(e);if(!qu(o,t,e.type_))return b0(e,o,t);let a=o[t];if(e.finalized_||!Kt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&p0(t))return a;if(a===sS(e.base_,t)){Pd(e);let i=e.type_===1?+t:t,p=fS(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in Hn(e)},ownKeys(e){return Reflect.ownKeys(Hn(e))},set(e,t,r){let n=ib(Hn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=sS(Hn(e),t),a=o?.[At];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(d0(r,o)&&(r!==void 0||qu(e.base_,t,e.type_)))return!0;Pd(e),pS(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),C0(e,t,r)),!0},deleteProperty(e,t){return Pd(e),sS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),pS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Hn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Td]:!0,[cS]:e.type_!==1||t!=="length",[kd]:n[kd],[Vu]:r[t]}},defineProperty(){kt(11)},getPrototypeOf(e){return fa(e.base_)},setPrototypeOf(){kt(12)}},Lu={};for(let e in Md){let t=Md[e];Lu[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Lu.deleteProperty=function(e,t){return Lu.set.call(this,e,t,void 0)};Lu.set=function(e,t,r){return Md.set.call(this,e[0],t,r,e[0])};function sS(e,t){let r=e[At];return(r?Hn(r):e)[t]}function b0(e,t,r){let n=ib(t,r);return n?Vu in n?n[Vu]:n.get?.call(e.draft_):void 0}function ib(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 pS(e){e.modified_||(e.modified_=!0,e.parent_&&pS(e.parent_))}function Pd(e){e.copy_||(e.assigned_=new Map,e.copy_=uS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var w0=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)||kt(6),n!==void 0&&!pa(n)&&kt(7);let o;if(Kt(t)){let a=Jx(this),i=fS(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?lS(a):dS(a)}return Yx(a,n),Xx(o,a)}else if(!t||!Li(t)){if(o=r(t),o===void 0&&(o=t),o===mS&&(o=void 0),this.autoFreeze_&&hS(o,!0),n){let a=[],i=[];ga(Nd).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else kt(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]},iS(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),iS(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),iS(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Kt(e)||kt(8),Wt(e)&&(e=Ld(e));let t=Jx(this),r=fS(t,e,void 0);return r[At].isManual_=!0,dS(t),r}finishDraft(e,t){let r=e&&e[At];(!r||!r.isManual_)&&kt(9);let{scope_:n}=r;return Yx(n,t),Xx(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(Nd).applyPatches_;return Wt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function fS(e,t,r,n){let[o,a]=$u(t)?ga(_d).proxyMap_(t,r):Hu(t)?ga(_d).proxySet_(t,r):x0(t,r);return(r?.scope_??rb()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?A0(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 Ld(e){return Wt(e)||kt(10,e),sb(e)}function sb(e){if(!Kt(e)||Vd(e))return e;let t=e[At],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=uS(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=uS(e,!0);return Bu(r,(o,a)=>{Od(r,o,sb(a))},n),t&&(t.finalized_=!1),r}function cb(){function t(C,b=[]){if(C.key_!==void 0){let w=C.parent_.copy_??C.parent_.base_,R=f0($n(w,C.key_)),E=$n(w,C.key_);if(E===void 0||E!==C.draft_&&E!==C.base_&&E!==C.copy_||R!=null&&R.base_!==C.base_)return null;let I=C.parent_.type_===3,k;if(I){let T=C.parent_;k=Array.from(T.drafts_.keys()).indexOf(C.key_)}else k=C.key_;if(!(I&&w.size>k||qu(w,k)))return null;b.push(k)}if(C.parent_)return t(C.parent_,b);b.reverse();try{r(C.copy_,b)}catch{return null}return b}function r(C,b){let w=C;for(let R=0;R<b.length-1;R++){let E=b[R];if(w=$n(w,E),!Li(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(C,b,w){if(C.scope_.processedForPatches_.has(C))return;C.scope_.processedForPatches_.add(C);let{patches_:R,inversePatches_:E}=w;switch(C.type_){case 0:case 2:return f(C,b,R,E);case 1:return p(C,b,R,E);case 3:return m(C,b,R,E)}}function p(C,b,w,R){let{base_:E,assigned_:I}=C,k=C.copy_;k.length<E.length&&([E,k]=[k,E],[w,R]=[R,w]);let T=C.allIndicesReassigned_===!0;for(let D=0;D<E.length;D++){let G=k[D],U=E[D];if((T||I?.get(D.toString()))&&G!==U){let B=G?.[At];if(B&&B.modified_)continue;let j=b.concat([D]);w.push({op:n,path:j,value:h(G)}),R.push({op:n,path:j,value:h(U)})}}for(let D=E.length;D<k.length;D++){let G=b.concat([D]);w.push({op:o,path:G,value:h(k[D])})}for(let D=k.length-1;E.length<=D;--D){let G=b.concat([D]);R.push({op:a,path:G})}}function f(C,b,w,R){let{base_:E,copy_:I,type_:k}=C;Bu(C.assigned_,(T,D)=>{let G=$n(E,T,k),U=$n(I,T,k),V=D?qu(E,T)?n:o:a;if(G===U&&V===n)return;let B=b.concat(T);w.push(V===a?{op:V,path:B}:{op:V,path:B,value:h(U)}),R.push(V===o?{op:a,path:B}:V===a?{op:o,path:B,value:h(G)}:{op:n,path:B,value:h(G)})})}function m(C,b,w,R){let{base_:E,copy_:I}=C,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(C,b,w){let{patches_:R,inversePatches_:E}=w;R.push({op:n,path:[],value:b===mS?void 0:b}),E.push({op:n,path:[],value:C})}function v(C,b){return b.forEach(w=>{let{path:R,op:E}=w,I=C;for(let G=0;G<R.length-1;G++){let U=ma(I),V=R[G];typeof V!="string"&&typeof V!="number"&&(V=""+V),(U===0||U===1)&&(V==="__proto__"||V===Mu)&&kt(19),pa(I)&&V===Qu&&kt(19),I=$n(I,V),Li(I)||kt(18,R.join("/"))}let k=ma(I),T=x(w.value),D=R[R.length-1];switch(E){case n:switch(k){case 2:return I.set(D,T);case 3:kt(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:kt(17,E)}}),C}function x(C){if(!Kt(C))return C;if(Gu(C))return C.map(x);if($u(C))return new Map(Array.from(C.entries()).map(([w,R])=>[w,x(R)]));if(Hu(C))return new Set(Array.from(C).map(x));let b=Object.create(fa(C));for(let w in C)b[w]=x(C[w]);return qu(C,Du)&&(b[Du]=C[Du]),b}function h(C){return Wt(C)?x(C):C}g0(Nd,{applyPatches_:v,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var Uu=new w0,ha=Uu.produce,yS=Uu.produceWithPatches.bind(Uu);var SS=Uu.applyPatches.bind(Uu);d();c();l();u();function R0(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function F0(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 ub=e=>Array.isArray(e)?e:[e];function E0(e){let t=Array.isArray(e[0])?e[0]:e;return F0(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function I0(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var T0=class{constructor(e){this.value=e}deref(){return this.value}},P0=()=>typeof WeakRef>"u"?T0:WeakRef,db=P0(),k0=0,lb=1;function Ud(){return{s:k0,v:void 0,o:null,p:null}}function O0(e){return e instanceof db?e.deref():e}function zu(e,t={}){let r=Ud(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let v=0,x=f;v<x;v++){let h=arguments[v];if(typeof h=="function"||typeof h=="object"&&h!==null){let C=p.o;C===null&&(p.o=C=new WeakMap);let b=C.get(h);b===void 0?(p=Ud(),C.set(h,p)):p=b}else{let C=p.p;C===null&&(p.p=C=new Map);let b=C.get(h);b===void 0?(p=Ud(),C.set(h,p)):p=b}}let m=p,g;if(p.s===lb)g=p.v;else if(g=e.apply(null,arguments),a++,n){let v=O0(o);v!=null&&n(v,g)&&(g=v,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new db(g):g}return m.s=lb,m.v=g,g}return i.clearCache=()=>{r=Ud(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function _0(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()),R0(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:v,memoizeOptions:x=[],argsMemoize:h=zu,argsMemoizeOptions:C=[]}=g,b=ub(x),w=ub(C),R=E0(o),E=v(function(){return a++,m.apply(null,arguments)},...b),I=!0,k=h(function(){i++;let D=I0(R,arguments);return p=E.apply(null,D),p},...w);return Object.assign(k,{resultFunc:m,memoizedResultFunc:E,dependencies:R,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var et=_0(zu);d();c();l();u();function pb(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var fb=pb(),mb=pb;var N0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?_u:_u.apply(null,arguments)},tY=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},D0=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Yt(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=>Nu(n)&&n.type===e,r}var xb=class Wu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Wu.prototype)}static get[Symbol.species](){return Wu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Wu(...t[0].concat(this)):new Wu(...t.concat(this))}};function gb(e){return Kt(e)?ha(e,()=>{}):e}function Qd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function q0(e){return typeof e=="boolean"}var M0=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new xb;return r&&(q0(r)?i.push(fb):i.push(mb(r.extraArgument))),i},Ku="RTK_autoBatch",Bi=()=>e=>({payload:e,meta:{[Ku]:!0}}),hb=e=>t=>{setTimeout(t,e)},V0=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},j0=(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?V0(window.requestAnimationFrame,100):hb(10):e.type==="callback"?e.queueNotification:hb(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),x=n.subscribe(v);return p.add(g),()=>{x(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ku],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},L0=e=>function(r){let{autoBatch:n=!0}=r??{},o=new xb(e);return n&&o.push(j0(typeof n=="object"?n:void 0)),o};function bb(e){let t=M0(),{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(Jr(r))f=ji(r);else throw new Error(Yt(1));let m;typeof n=="function"?m=n(t):m=t();let g=_u;o&&(g=N0({trace:!1,...(typeof o=="object"&&o)}));let v=Hx(...m),x=L0(v),h=typeof p=="function"?p(x):x(),C=g(...h);return aS(f,i,C)}function wb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Yt(28));if(p in t)throw new Error(Yt(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 U0(e){return typeof e=="function"}function ae(e,t){let[r,n,o]=wb(t),a;if(U0(e))a=()=>gb(e());else{let p=gb(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(Wt(g)){let h=v(g,f);return h===void 0?g:h}else{if(Kt(g))return ha(g,x=>v(x,f));{let x=v(g,f);if(x===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return g},p)}return i.getInitialState=a,i}var Rb=(e,t)=>D0(e)?e.match(t):e(t);function Xr(...e){return t=>e.some(r=>Rb(r,t))}function Qi(...e){return t=>e.every(r=>Rb(r,t))}function Hd(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 Yu(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function zd(...e){return e.length===0?t=>Hd(t,["pending"]):Yu(e)?Xr(...e.map(t=>t.pending)):zd()(e[0])}function Sa(...e){return e.length===0?t=>Hd(t,["rejected"]):Yu(e)?Xr(...e.map(t=>t.rejected)):Sa()(e[0])}function Ju(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Qi(Sa(...e),t):Yu(e)?Qi(Sa(...e),t):Ju()(e[0])}function zn(...e){return e.length===0?t=>Hd(t,["fulfilled"]):Yu(e)?Xr(...e.map(t=>t.fulfilled)):zn()(e[0])}function Wd(...e){return e.length===0?t=>Hd(t,["pending","fulfilled","rejected"]):Yu(e)?Xr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Wd()(e[0])}var Q0="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Xu=(e=21)=>{let t="",r=e;for(;r--;)t+=Q0[Math.random()*64|0];return t},B0=["name","message","stack","code"],vS=class{constructor(e,t){pe(this,"payload");pe(this,"meta");pe(this,"_type");this.payload=e,this.meta=t}},yb=class{constructor(e,t){pe(this,"payload");pe(this,"meta");pe(this,"_type");this.payload=e,this.meta=t}},G0=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of B0)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Sb="External signal was aborted",Ce=(()=>{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,x)=>({payload:v,error:(n&&n.serializeError||G0)(f||"Rejected"),meta:{...(x||{}),arg:g,requestId:m,rejectedWithValue:!!v,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(g,v,x)=>{let h=n?.idGenerator?n.idGenerator(f):Xu(),C=new s.AbortController,b,w;function R(I){w=I,C.abort()}m&&(m.aborted?R(Sb):m.addEventListener("abort",()=>R(Sb),{once:!0}));let E=_asyncToGenerator(function*(){let I;try{let T=n?.condition?.(f,{getState:v,extra:x});if(H0(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,U)=>{b=()=>{U({name:"AbortError",message:w||"Aborted"})},C.signal.addEventListener("abort",b,{once:!0})});g(a(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:v,extra:x}))),I=yield Promise.race([D,Promise.resolve(r(f,{dispatch:g,getState:v,extra:x,requestId:h,signal:C.signal,abort:R,rejectWithValue:(G,U)=>new vS(G,U),fulfillWithValue:(G,U)=>new yb(G,U)})).then(G=>{if(G instanceof vS)throw G;return G instanceof yb?o(G.payload,h,f,G.meta):o(G,h,f)})])}catch(T){I=T instanceof vS?i(null,h,f,T.payload,T.meta):i(T,h,f)}finally{b&&C.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($0)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Xr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function $0(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function H0(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Fb=Symbol.for("rtk-slice-createasyncthunk"),nY={[Fb]:Ce};function z0(e,t){return`${e}/${t}`}function W0({creators:e}={}){let t=e?.asyncThunk?.[Fb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Yt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(Y0()):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(Yt(12));if(T in f.sliceCaseReducersByType)throw new Error(Yt(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:z0(o,I),createNotation:typeof n.reducers=="function"};X0(k)?eD(T,k,m,t):J0(T,k,m)});function g(){let[I={},k=[],T=void 0]=typeof n.extraReducers=="function"?wb(n.extraReducers):[n.extraReducers],D={...I,...f.sliceCaseReducersByType};return ae(n.initialState,G=>{for(let U in D)G.addCase(U,D[U]);for(let U of f.sliceMatchers)G.addMatcher(U.matcher,U.reducer);for(let U of k)G.addMatcher(U.matcher,U.reducer);T&&G.addDefaultCase(T)})}let v=I=>I,x=new Map,h=new WeakMap,C;function b(I,k){return C||(C=g()),C(I,k)}function w(){return C||(C=g()),C.getInitialState()}function R(I,k=!1){function T(G){let U=G[I];return typeof U>"u"&&k&&(U=Qd(h,T,w)),U}function D(G=v){let U=Qd(x,k,()=>new WeakMap);return Qd(U,G,()=>{let V={};for(let[B,j]of Object.entries(n.selectors??{}))V[B]=K0(j,G,()=>Qd(h,G,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 K0(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=W0();function Y0(){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 J0({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!Z0(n))throw new Error(Yt(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 X0(e){return e._reducerDefinitionType==="asyncThunk"}function Z0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function eD({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Yt(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||Bd,pending:p||Bd,rejected:f||Bd,settled:m||Bd})}function Bd(){}var tD="task",Eb="listener",Ib="completed",xS="cancelled",rD=`task-${xS}`,nD=`task-${Ib}`,AS=`${Eb}-${xS}`,oD=`${Eb}-${Ib}`,Kd=class{constructor(e){pe(this,"code");pe(this,"name","TaskAbortError");pe(this,"message");this.code=e,this.message=`${tD} ${xS} (reason: ${e})`}},bS=(e,t)=>{if(typeof e!="function")throw new TypeError(Yt(32))},Gd=()=>{},Tb=(e,t=Gd)=>(e.catch(t),e),Pb=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ya=e=>{if(e.aborted)throw new Kd(e.reason)};function kb(e,t){let r=Gd;return new Promise((n,o)=>{let a=()=>o(new Kd(e.reason));if(e.aborted){a();return}r=Pb(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Gd})}var aD=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Kd?"cancelled":"rejected",error:r}}finally{t?.()}});return function aD(_x7,_x8){return _ref5.apply(this,arguments)}}(),$d=e=>t=>Tb(kb(e,t).then(r=>(ya(e),r))),Ob=e=>{let t=$d(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Ui}=Object,vb={},Yd="listenerMiddleware",iD=(e,t)=>{let r=n=>Pb(e,()=>n.abort(e.reason));return(n,o)=>{bS(n,"taskExecutor");let a=new s.AbortController;r(a);let i=aD(/*#__PURE__*/_asyncToGenerator(function*(){ya(e),ya(a.signal);let p=yield n({pause:$d(a.signal),delay:Ob(a.signal),signal:a.signal});return ya(a.signal),p}),()=>a.abort(nD));return o?.autoJoin&&t.push(i.catch(Gd)),{result:$d(e)(i),cancel(){a.abort(rD)}}}},sD=(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,x)=>{x.unsubscribe(),f([v,x.getState(),x.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield kb(t,Promise.race(p));return ya(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>Tb(r(n,o))},_b=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(Yt(21));return bS(a,"options.listener"),{predicate:o,type:t,effect:a}},Nb=Ui(e=>{let{type:t,predicate:r,effect:n}=_b(e);return{id:Xu(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Yt(22))}}},{withTypes:()=>Nb}),Ab=(e,t)=>{let{type:r,effect:n,predicate:o}=_b(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},CS=e=>{e.pending.forEach(t=>{t.abort(AS)})},cD=(e,t)=>()=>{for(let r of t.keys())CS(r);e.clear()},Cb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Db=Ui(P(`${Yd}/add`),{withTypes:()=>Db}),uD=P(`${Yd}/removeAll`),qb=Ui(P(`${Yd}/remove`),{withTypes:()=>qb}),lD=(...e)=>{console.error(`${Yd}/error`,...e)},Mb=(e={})=>{let t=new Map,r=new Map,n=h=>{let C=r.get(h)??0;r.set(h,C+1)},o=h=>{let C=r.get(h)??1;C===1?r.delete(h):r.set(h,C-1)},{extra:a,onError:i=lD}=e;bS(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),C=>{h.unsubscribe(),C?.cancelActive&&CS(h)}),f=h=>{let C=Ab(t,h)??Nb(h);return p(C)};Ui(f,{withTypes:()=>f});let m=h=>{let C=Ab(t,h);return C&&(C.unsubscribe(),h.cancelActive&&CS(C)),!!C};Ui(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,C,b,w){let R=new s.AbortController,E=sD(f,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(C,Ui({},b,{getOriginalState:w,condition:(k,T)=>E(k,T).then(Boolean),take:E,delay:Ob(R.signal),pause:$d(R.signal),extra:a,signal:R.signal,fork:iD(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,T,D)=>{k!==R&&(k.abort(AS),D.delete(k))})},cancel:()=>{R.abort(AS),h.pending.delete(R)},throwIfCancelled:()=>{ya(R.signal)}})))}catch(k){k instanceof Kd||Cb(i,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(oD),o(h),h.pending.delete(R)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),v=cD(t,r);return{middleware:h=>C=>b=>{if(!Nu(b))return C(b);if(Db.match(b))return f(b.payload);if(uD.match(b)){v();return}if(qb.match(b))return m(b.payload);let w=h.getState(),R=()=>{if(w===vb)throw new Error(Yt(23));return w},E;try{if(E=C(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(G){D=!1,Cb(i,G,{raisedBy:"predicate"})}D&&g(T,b,h,R)}}}finally{w=vb}return E},startListening:f,stopListening:m,clearListeners:v}};function Yt(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 Vb(){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 jb=/^(?:[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 dD(e){return typeof e=="string"&&jb.test(e)}var wS=dD;d();c();l();u();var Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function Lb(e,t=0){return(Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]).toLowerCase()}d();c();l();u();var RS,pD=new Uint8Array(16);function FS(){if(!RS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");RS=crypto.getRandomValues.bind(crypto)}return RS(pD)}d();c();l();u();d();c();l();u();var fD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ES={randomUUID:fD};function mD(e,t,r){e=e||{};let n=e.random??e.rng?.()??FS();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 Lb(n)}function gD(e,t,r){return ES.randomUUID&&!t&&!e?ES.randomUUID():mD(e,t,r)}var IS=gD;function hD(_x13){return _hD.apply(this,arguments)}function _hD(){_hD=_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 _hD.apply(this,arguments)}var Hb="2.1.1",TS=128,zb=192,Ub=224,Qb=240,yD=248;function SD(e){return(e&yD)===Qb?4:(e&Qb)===Ub?3:(e&Ub)===zb?2:1}function vD(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&TS)!=TS)break;if(r-=3,(n&zb)!=TS){t-r>=SD(n)*3&&(r=t);break}}return e.substring(0,r)}function AD(e){let{trackingId:t}=e;return{trackingId:t}}function CD(e){return(e.source||[]).concat([`relay@${Hb}`])}function Wb(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=AD(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:CD(t),clientId:p,userAgent:a(),referrer:Bb(n()),location:Bb(o())})}function Bb(e){return e!==null?vD(e,1024):null}function xD(e,t,r,n){return{...t,meta:Wb(e,r,n)}}var bD="*";function wD(){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===bD)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 Gb({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 RD(e){let t=Gb(e);return{get:()=>t,update:r=>{t=Gb({...t,...r})}}}var PS=FD();function FD(){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 ED(){return{getItem(e){return PS.getItem(e)||localStorage.getItem(e)},removeItem(e){PS.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),PS.setItem(e,t,31556952e3)}}}var $b="visitorId";function ID(){let e=document.referrer;return e===""?null:e}function kS(){let e=ED();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}`}});Vb().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:()=>ID(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem($b);if(t&&wS(t))return t;let r=IS();return e.setItem($b,r),r}}}function TD(){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 PD(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function kD(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=PD();return t&&r?{...r,runtime:"custom"}:t&&OD()&&TD()?kS():n}function OD(){try{return typeof window=="object"}catch{return!1}}function _D(e){return{get:()=>Object.freeze(kD(e))}}function Kb(e){let t=RD(e),r=wD(),n=_D(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=xD(o,a,i,p);return hD({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>Wb(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:Hb}}d();c();l();u();function Yb(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Ao="3.52.0",Jb=["@coveo/atomic","@coveo/quantic"];var Gi=et(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Ao}`));var Zu=et(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Gi(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=DD(p);return Kb({mode:a?"emit":"disabled",url:o??xd(e,t),token:r,trackingId:n??null,source:i,environment:f})}),ND={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},DD=e=>{if(!e)return;let t=e();return{...(Yb()?kS():ND),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Wn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Q(e,t,r,n){function o(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 NS(){return typeof window<"u"}function zS(){return typeof navigator<"u"}function $i(){return typeof document<"u"}function DS(){try{return typeof localStorage<"u"}catch{return!1}}function qD(){try{return typeof sessionStorage<"u"}catch{return!1}}function dw(){return zS()&&navigator.cookieEnabled}var MD=[_e.click,_e.custom,_e.search,_e.view],VD=(e,t)=>MD.indexOf(e)!==-1?Object.assign({language:$i()?document.documentElement.lang:"unknown",userAgent:zS()?navigator.userAgent:"unknown"},t):t,tl=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 jD(){return DS()?localStorage:dw()?new rl:qD()?sessionStorage:new zi}var rl=class e{getItem(t){return tl.get(`${e.prefix}${t}`)}removeItem(t){tl.erase(`${e.prefix}${t}`)}setItem(t,r,n){tl.set(`${e.prefix}${t}`,r,n)}};rl.prefix="coveo_";var qS=class{constructor(){this.cookieStorage=new rl}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)}},zi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Jd="__coveo.analytics.history",LD=20,UD=1e3*60,QD=75,ep=class{constructor(t){this.store=t||jD()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return Q(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return Q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Jd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return Q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Jd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Jd,JSON.stringify(t.slice(0,LD)))}catch{}}clear(){try{this.store.removeItem(Jd)}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,QD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>UD:!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 BD=(e,t)=>Q(void 0,void 0,void 0,function*(){return e===_e.view?(yield GD(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),GD=e=>Q(void 0,void 0,void 0,function*(){let t=new ep,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Xd,$D=new Uint8Array(16);function HD(){if(!Xd&&(Xd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xd($D)}var zD=/^(?:[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 tp(e){return typeof e=="string"&&zD.test(e)}var _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function pw(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 WD(e){if(!tp(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 KD(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var YD="6ba7b810-9dad-11d1-80b4-00c04fd430c8",JD="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function XD(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=KD(o)),typeof a=="string"&&(a=WD(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 pw(m)}try{n.name=e}catch{}return n.DNS=YD,n.URL=JD,n}var ZD=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Zb={randomUUID:ZD};function Aa(e,t,r){if(Zb.randomUUID&&!t&&!e)return Zb.randomUUID();e=e||{};let n=e.random||(e.rng||HD)();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 pw(n)}function eq(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 OS(e,t){return e<<t|e>>>32-t}function tq(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]=OS(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],x=r[4];for(let h=0;h<80;++h){let C=Math.floor(h/20),b=OS(f,5)+eq(C,m,g,v)+x+t[C]+p[h]>>>0;x=v,v=g,g=OS(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]+x>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var rq=XD("v5",80,tq),ew=rq,fw="2.30.56",tw=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,el={pageview:"pageview",event:"event"},rp=class{constructor({client:t,uuidGenerator:r=Aa}){this.client=t,this.uuidGenerator=r}},MS=class extends rp{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=tw(window.location),this.lastReferrer=$i()?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:$i()?document.title:"",encoding:$i()?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===el.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===el.pageview?this.nextPageViewId:this.pageViewId,referrer:t===el.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===el.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 tw(window.location)}},Co=class e{constructor(t,r){if(!tp(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 tp(a)?new e(a,Number.parseInt(o)*1e3):null}};Co.cvo_cid="cvo_cid";Co.expirationTime=120;var VS=class extends rp{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return Q(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Co.cvo_cid,new Co(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};VS.Id="link";var Sr=Object.keys;function Zd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var _S=128,mw=192,rw=224,nw=240;function nq(e){return(e&248)===nw?4:(e&nw)===rw?3:(e&rw)===mw?2:1}function oq(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&_S)!=_S)break;if(r-=3,(n&mw)!=_S){t-r>=nq(n)*3&&(r=t);break}}return e.substring(0,r)}var jS={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"},aq=Sr(jS).map(e=>jS[e]),iq=[...aq].join("|"),sq=new RegExp(`^(${iq}$)`),cq={svcAction:"svc_action",svcActionData:"svc_action_data"},uq=e=>Sr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=jS[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),lq=e=>sq.test(e),dq=[lq],ow={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},aw={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Mt={action:"pa",list:"pal",listSource:"pls"},np={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},pq=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],LS={id:"quoteId",affiliation:"quoteAffiliation"},US={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},fq={add:Mt,bookmark_add:Mt,bookmark_remove:Mt,click:Mt,checkout:Mt,checkout_option:Mt,detail:Mt,impression:Mt,remove:Mt,refund:Object.assign(Object.assign({},Mt),np),purchase:Object.assign(Object.assign({},Mt),np),quickview:Mt,quote:Object.assign(Object.assign({},Mt),LS),review:Object.assign(Object.assign({},Mt),US)},mq=Sr(ow).map(e=>ow[e]),gq=Sr(aw).map(e=>aw[e]),hq=Sr(Mt).map(e=>Mt[e]),yq=Sr(np).map(e=>np[e]),Sq=Sr(US).map(e=>US[e]),vq=Sr(LS).map(e=>LS[e]),Aq=[...mq,"custom"].join("|"),Cq=[...gq,"custom"].join("|"),gw="(pr[0-9]+)",hw="(il[0-9]+pi[0-9]+)",xq=new RegExp(`^${gw}(${Aq})$`),bq=new RegExp(`^(${hw}(${Cq}))|(il[0-9]+nm)$`),wq=new RegExp(`^(${hq.join("|")})$`),Rq=new RegExp(`^(${yq.join("|")})$`),Fq=new RegExp(`^${gw}custom$`),Eq=new RegExp(`^${hw}custom$`),Iq=new RegExp(`^(${[...pq,...Sq,...vq].join("|")})$`),Tq=e=>xq.test(e),Pq=e=>bq.test(e),kq=e=>wq.test(e),Oq=e=>Rq.test(e),_q=e=>Iq.test(e),Nq=[Pq,Tq,kq,Oq,_q],Dq=[Fq,Eq],qq={anonymizeIp:"aip"},Mq={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"},jq=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Lq=Object.assign(Object.assign(Object.assign(Object.assign({},qq),Mq),Vq),jq.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),QS=Object.assign(Object.assign({},Lq),cq),Uq=e=>{let t=!!e.action&&fq[e.action]||{};return Sr(e).reduce((r,n)=>{let o=t[n]||QS[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Qq=Sr(QS).map(e=>QS[e]),Bq=e=>Qq.indexOf(e)!==-1,Gq=e=>e==="custom",$q=e=>[...Nq,...dq,Bq,Gq].some(t=>t(e)),Hq=e=>Sr(e).reduce((t,r)=>{let n=zq(r);return n?Object.assign(Object.assign({},t),Wq(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),zq=e=>{let t;return[...Dq].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Wq=(e,t)=>Sr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),BS=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,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 Q(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 Q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(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}},GS=class{sendEvent(t,r){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}},iw=y.fetch,op=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(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=Wn(f,["url"]),v;try{v=yield iw(m,g)}catch(x){console.error("An error has occured when sending the event.",x);return}if(v.ok){let x=yield v.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}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 Q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield iw(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[_e.click,_e.custom,_e.search,_e.view].indexOf(t)!==-1}getVisitorIdParam(){return Q(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},$S=class{constructor(t,r){DS()&&dw()?this.storage=new qS:DS()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new zi),this.client=new op(t),this.beaconClient=new BS(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}},HS=class{constructor(t,r){this.storage=r||new zi,this.client=new op(t)}getClientDependingOnEventType(t){return this.client}},ap=class{constructor(){this.storage=new zi,this.client=new GS}getClientDependingOnEventType(t){return this.client}},Kq="xx",Yq=e=>e?.startsWith(Kq)||!1,Jq=`
29
29
  We've detected you're using React Native but have not provided the corresponding runtime,
30
30
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
31
31
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
32
- `;function Lq(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Uq=["1",1,"yes",!0];function op(){let e=[];return FS()&&e.push(window.doNotTrack),jS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Uq.indexOf(t)!==-1)}var cw="v15",uw={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 Qq(e=uw.default,t=cw,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 Bq="38824e1f-37f5-42d3-8372-a4b8fa9df946",Zr=class{get defaultOptions(){return{endpoint:uw.default,isCustomEndpoint:!1,token:"",version:cw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return ow}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=[kD,FD].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};op()?this.runtime=new np: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 FS()&&Hi()?new MS(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Lq()&&console.warn(jq),new VS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return Q(this,void 0,void 0,function*(){try{return FS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Aa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Aa()}})}getCurrentVisitorId(){return Q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return Q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return Q(this,void 0,void 0,function*(){if(Zd(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId($b(t,$b(r,Bq)))}})}getParameters(t,...r){return Q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return Q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Aa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(op())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||!Hi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return Q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>Q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>Q(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((x,b)=>Q(this,void 0,void 0,function*(){let w=yield x;return yield b(t,w)}),h)].reduce((h,x)=>Q(this,void 0,void 0,function*(){let b=yield h;return yield x(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return Q(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?Tq(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,C)=>Q(this,void 0,void 0,function*(){let h=yield v;return yield C(h)}),Promise.resolve(r))})}makeEvent(t,...r){return Q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return Q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new Jd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.search,t)})}sendSearchEvent(t){return Q(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 Q(this,void 0,void 0,function*(){return this.makeEvent(_e.click,t)})}sendClickEvent(t){return Q(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 Q(this,void 0,void 0,function*(){return this.makeEvent(_e.custom,t)})}sendCustomEvent(t){return Q(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 Q(this,void 0,void 0,function*(){return this.makeEvent(_e.view,t)})}sendViewEvent(t){return Q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return Q(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return Q(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(_q(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&&Xd(r)&&(o=this.lowercaseKeys(r));let a=Nq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=zn(t,["custom"]);if(r&&Xd(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 Vq(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")&&Xd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Xd(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"?HD(t,r):t}get baseUrl(){return Qq(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.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",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.generatedAnswerFollowupOpenSource="generatedAnswerFollowupOpenSource",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})($||($={}));var Jb={[$.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",[$.generatedAnswerOpenInlineLink]:"generatedAnswer",[$.generatedAnswerFollowupOpenSource]:"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"},Ki=class{constructor(){this.runtime=new np,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 ow}};function Gq(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function $q(e){return e.map(t=>t.replace(/;/g,""))}function lw(e){let r=e.join(";");return r.length<=256?r:lw(e.slice(1))}var Zb=e=>{let t=$q(e),r=Gq(t);return lw(r)};function ew(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Zb(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Zb(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var ap=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||op();this.coveoAnalyticsClient=n?new Ki:new Zr(t)}disable(){this.coveoAnalyticsClient=new Ki}enable(){this.coveoAnalyticsClient=new Zr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,ew(t))}logOmniboxAnalytics(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,ew(t))}logOmniboxFromLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=Jb[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 Q(this,arguments,void 0,function*(n,o,a=Jb[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),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 Q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return Q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return Q(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 Q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof 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 Q(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 Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent($.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(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 Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent($.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},ip=Object.assign({},Xu),tw=Object.keys(ip).map(e=>ip[e]),zi=class extends TS{constructor({client:t,uuidGenerator:r=Aa}){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])=>tw.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(tw.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(ip.pageview,{newEventType:_e.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(ip.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 XD(this.ticket)}};zi.Id="svc";var sp;(function(e){e.click="click",e.flowStart="flowStart"})(sp||(sp={}));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 cp;(function(e){e.quit="Quit",e.solved="Solved"})(cp||(cp={}));var up=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!op();this.coveoAnalyticsClient=o?new Zr(t):new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Zr(this.options),this.svc=new zi({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:cp.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(hr.caseSolved,{reason:cp.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",sp.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",sp.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return Q(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 Q(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 Hq=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},xa=class{constructor(t){de(this,"getState",t);de(this,"state");this.state=t()}getLanguage(){return Hq(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=Ao),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 dw=e=>new Zr(e).getCurrentVisitorId(),el=(e,t)=>typeof t=="function"?(...r)=>{let n=Fu(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,tl=(e,t)=>(...r)=>{let n=Fu(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var rl=class extends xa{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},pw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new rl(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new up({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:el(e,n),beforeSendHooks:[tl(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 Yi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function zq(e,t){return!!t&&t.facetId in e.facetSet}var Lr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),lp=(e,t)=>e.facetSet[t]?.request,Xi=(e,t)=>{let r=Lr(e,t);return zq(e,r)?r:void 0},fw=(e,t)=>Xi(e,t)?.values.filter(r=>r.state==="selected")||[],mw=(e,t)=>Xi(e,t)?.values.filter(r=>r.state!=="idle")||[],en=e=>e.search.isLoading;d();c();l();u();function gw(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 sr(e){let{activeValue:t,ancestryMap:r}=Wq(e);return t?Kq(t,r):[]}function Wq(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 Kq(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function Yq(e,t){return!!t&&t.facetId in e.categoryFacetSet}var QS=(e,t)=>{let r=Lr(e,t);if(Yq(e,r))return r},BS=(e,t)=>e.categoryFacetSet[t]?.request,hw=(e,t)=>{let r=QS(e,t);return sr(r?.values??[])},GS=(e,t)=>{let r=BS(e,t);return sr(r?.currentValues??[])};d();c();l();u();function Ji(){return{}}d();c();l();u();function yw(e,t){return{request:e,tabs:t}}function Zi(){return{}}d();c();l();u();function Sw(e,t){return{request:e,tabs:t}}function es(){return{}}d();c();l();u();function vw(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function ts(){return{}}var rs=(e,t)=>{let r=bw(t,e),n=r?r.field:"",o=HS(n,e);return{facetId:e,facetField:n,facetTitle:o}};function ns(e,t){let{facetId:r,facetValue:n}=e,o=rs(r,t),a=ww(t,r);return{...o,facetValue:a==="hierarchical"?Cw(t,r):n}}function cr(e){return{facetSet:e.facetSet??ts(),categoryFacetSet:e.categoryFacetSet??Ji(),dateFacetSet:e.dateFacetSet??Zi(),numericFacetSet:e.numericFacetSet??es(),automaticFacetSet:e.automaticFacetSet??Yi()}}var $S=e=>{let t=[];return Zq(e).forEach((r,n)=>{let o=ww(e,r.facetId),a=oM(r,n+1);if(Jq(r)){if(!!!GS(e,r.facetId).length)return;t.push({...a,...rM(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Aw(i,p+1,o),m=Xq(r)?xw(i):tM(i);t.push({...a,...f,...m})})}),eM(e).forEach((r,n)=>{let o=nM(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Aw(a,i+1,"specific"),f=xw(a);t.push({...o,...p,...f})})}),t},Xq=e=>e.type==="specific",Jq=e=>e.type==="hierarchical",Zq=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),eM=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Aw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),tM=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),xw=e=>({displayValue:e.value,value:e.value}),Cw=(e,t)=>GS(e,t).map(n=>n.value).join(";"),rM=(e,t)=>{let n=Cw(e,t);return{value:n,valuePosition:1,displayValue:n}},nM=(e,t)=>({title:HS(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),oM=(e,t)=>({title:HS(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),HS=(e,t)=>`${e}_${t}`,bw=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,ww=(e,t)=>{let r=bw(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var zS=e=>e.configuration.search.locale,Rw=e=>e.configuration.search.timezone,dp=e=>e.configuration.accessToken,pp=e=>e.configuration.organizationId,fp=e=>e.configuration.environment,mp=e=>e.configuration?.knowledge?.agentId,Fw=e=>e.configuration.knowledge.debugAgentSession;var We=e=>{if(aM(e)||WS(e))return e.generatedAnswer?.answerId;if(iM(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},aM=e=>"answer"in e&&"generatedAnswer"in e&&!fe(e.generatedAnswer?.answerConfigurationId),WS=e=>{let t=mp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},iM=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",KS=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Ca=e=>e.followUpAnswers?.conversationId,sM=e=>e.generatedAnswer?.citations,cM=e=>e.followUpAnswers?.followUpAnswers,uM=et(cM,e=>e?.flatMap(t=>t.citations)),lM=(e,t)=>t,nl=et(sM,uM,lM,(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 ol=(r=>(r.Ascending="ascending",r.Descending="descending",r))(ol||{}),ba=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(ba||{}),tn=e=>{if(Ni(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""}},os=()=>({by:"relevancy"}),gp=e=>({by:"date",order:e}),hp=(e,t)=>({by:"field",order:t,field:e}),yp=()=>({by:"qre"}),Sp=()=>({by:"nosort"}),Ew=new J({values:{by:new Ru({enum:ba,required:!0}),order:new Ru({enum:ol}),field:new U}});function Sr(){return tn(os())}d();c();l();u();d();c();l();u();d();c();l();u();var as=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?YS(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],YS(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 YS(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 dM(){return typeof navigator<"u"}function Iw(){try{return typeof localStorage<"u"}catch{return!1}}function Tw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Pw(){return!!(dM()&&navigator.cookieEnabled)}var kw=null;function Ow(){return kw||(Iw()?localStorage:Pw()?new XS:Tw()?sessionStorage:new JS)}var is=class is{getItem(t){return as.get(`${is.prefix}${t}`)}removeItem(t){as.erase(`${is.prefix}${t}`)}setItem(t,r,n){as.set(`${is.prefix}${t}`,r,n)}};de(is,"prefix","coveo_");var XS=is;var JS=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var vp="__coveo.analytics.history",pM=20,fM=1e3*60,mM=75,wa=class wa{constructor(t){de(this,"store");this.store=t||Ow()}static getInstance(t){return wa.instance||(wa.instance=new wa(t)),wa.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(vp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(vp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(vp,JSON.stringify(t.slice(0,pM)))}catch{}}clear(){try{this.store.removeItem(vp)}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,mM)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>fM:!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))}};de(wa,"instance",null);var ZS=wa,Xt=ZS;var al=class al extends xa{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return $S(cr(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||al.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||ar().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||al.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||ar().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ar().response.totalCountFiltered}};de(al,"fallbackPipelineName","default");var bo=al,_w=({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??mr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new ap({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:el(e,n),beforeSendHooks:[tl(e,r),(v,C)=>(e.info({...C,type:v,endpoint:p,token:i},"Analytics request"),C)]},o);return m||g.disable(),g},ev=()=>{let t=Xt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Ap(e){let t=Nw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return rC([e,...t,...r],o=>o.uniqueId)}function Nw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Nw(t)]):[]}d();c();l();u();var Kn=()=>"";function qw(e,t){return{...new bo(t).getBaseMetadata(),actionCause:e,type:e}}function gM(e){return Object.assign(e,{instantlyCallable:!0})}function hM(e,t){let r=a=>{let i=xe(e,a);return gM(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 Mw=(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 vM(a)}return n},yM=e=>e.configuration.analytics.analyticsMode==="legacy",SM=e=>e.configuration.analytics.analyticsMode==="next",vM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),hM(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(),x=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(x,p());C.description=b?.description,v.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(R){yM(R)&&(yield AM(b,r,R,g,x.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=Yu(h);return v.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(R){if(SM(R)&&o&&n){let E=n(R);yield TM(w,o,E)}});return function(_x27){return _ref16.apply(this,arguments)}}()),C});return function(_x24){return _ref13.apply(this,arguments)}}()));function AM(_x28,_x29,_x30,_x31,_x32){return _AM.apply(this,arguments)}function _AM(){_AM=_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 _AM.apply(this,arguments)}var xM=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=Mw(e=>_w({...e,provider:e.provider||new bo(e.getState)}),e=>e,bo),m5=Mw(pw,xM("caseAssist"),rl);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Uw(e,o),n<0&&(n=IM(e,o)),n<0&&(n=0),bM(e,r(n),t)};var Vw=(e,t)=>({sourceName:CM(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Kn()});function CM(e){let t=e.source;return fe(t)?"unknown":t}var jw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function bM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:FM(e),...(Dw(e)?{documentCategory:Dw(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:EM(e),queryPipeline:r.pipeline||Kn()}}function Dw(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||""}),Lw={urihash:new U,sourcetype:new U,permanentid:new U},xp={uniqueId:W,raw:new J({values:Lw}),title:W,uri:W,clickUri:W,rankingModifier:new U({required:!1,emptyAllowed:!0})};function wM(e){return Object.assign({},...Object.keys(Lw).map(t=>({[t]:e[t]})))}function RM(e){return Object.assign({},...Object.keys(xp).map(t=>({[t]:e[t]})),{raw:wM(e.raw)})}function FM(e){let t=e.raw.author;return fe(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function EM(e){let t=e.raw.source;return fe(t)?"unknown":t}var Jt=e=>new Se(xp).validate(RM(e));function IM(e,t){for(let[r,n]of t.entries()){let o=Ap(n);if(Uw(e,o)!==-1)return r}return-1}function Uw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function TM(_x34,_x35,_x36){return _TM.apply(this,arguments)}function _TM(){_TM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _TM.apply(this,arguments)}d();c();l();u();var tv=e=>O(e,{evt:W,type:st}),Qw=e=>X("analytics/generic/search",t=>{tv(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),Bw=e=>X("analytics/generic/click",(t,r)=>(Jt(e.result),tv(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),Gw=e=>X("analytics/generic/custom",t=>(tv(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Cp=()=>X("analytics/interface/load",e=>e.makeInterfaceLoad()),wo=()=>X("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),bp=()=>X("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),wp=e=>X("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),$w=()=>({actionCause:"interfaceLoad"}),ss=()=>({actionCause:"interfaceChange"}),Hw=()=>({actionCause:"searchFromLink"}),zw=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var rv=()=>st,Ww=()=>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})})),PM={enabled:new pe({default:!0}),originContext:rv(),originLevel2:rv(),originLevel3:rv(),proxyBaseUrl:new U({required:!1,url:!0}),runtimeEnvironment:new Qe,anonymous:new pe({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:NC,analyticsMode:new U({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new J({options:{required:!1},values:Qb.reduce((e,t)=>(e[t]=_C,e),{})})},Ro=P("configuration/updateAnalyticsConfiguration",e=>O(e,PM)),cs=P("configuration/analytics/disable"),us=P("configuration/analytics/enable"),Rp=P("configuration/analytics/originlevel2",e=>O(e,{originLevel2:Ww()})),Fp=P("configuration/analytics/originlevel3",e=>O(e,{originLevel3:Ww()})),Ep=P("knowledge/setAgentId",e=>O(e,new U({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Ip={q:new U,enableQuerySyntax:new pe,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 pe,sf:new J,tab:new U,af:new J};var Me=P("searchParameters/restore",e=>O(e,Ip)),ls=P("searchParameters/restoreTab",e=>O(e,W));d();c();l();u();var Fo=P("debug/enable"),ds=P("debug/disable");d();c();l();u();var Eo=()=>!1;var ps=ae(Eo(),e=>{e.addCase(Fo,()=>!0).addCase(ds,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var nv=P("history/undo"),ov=P("history/redo"),ur=P("history/snapshot"),il=xe("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(nv()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),Tp=xe("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(ov()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=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 fs=P("pipeline/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var ms=ae(Kn(),e=>{e.addCase(fs,(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"),gs=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var nn=P("facet/updateFacetAutoSelection",e=>O(e,{allow:new pe({required:!0})}));d();c();l();u();d();c();l();u();var sl=class extends bo{constructor(r){super(r);de(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??ar().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ar().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Kw=e=>X({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Jt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new sl(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}}}}),Yw=()=>X("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new sl(e)),Xw=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var av={id:W},kM={...av,q:Be},hs=P("instantResults/register",e=>O(e,av)),on=P("instantResults/updateQuery",e=>O(e,kM)),ys=P("instantResults/clearExpired",e=>O(e,av));d();c();l();u();var Pp=new re({required:!0,min:0}),Ss=P("pagination/registerNumberOfResults",e=>O(e,Pp)),vs=P("pagination/updateNumberOfResults",e=>O(e,Pp)),As=P("pagination/registerPage",e=>O(e,Pp)),an=P("pagination/updatePage",e=>O(e,Pp)),xs=P("pagination/nextPage"),Cs=P("pagination/previousPage");d();c();l();u();var Vt=P("query/updateQuery",e=>O(e,{q:new U,enableQuerySyntax:new pe}));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:$i(e)}});var bs=(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&&!fe(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 ws=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield dw(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}),...(ev()&&{pageId:ev()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:$i(e)})}}});return function ws(_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 ws(e.configuration.analytics,t))),...(e.excerptLength&&!fe(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 iv=()=>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 ul=Vr(kp(),1),rR=Vr(Jw(),1);d();c();l();u();var Op=Vr(kp(),1),eR=Vr(Zw(),1);Op.default.extend(eR.default);var Rs="YYYY/MM/DD@HH:mm:ss",OM="1401-01-01";function Ra(e,t){let r=(0,Op.default)(e,t);return!r.isValid()&&!t?(0,Op.default)(e,Rs):r}function cl(e){return e.format(Rs)}function tR(e){return cl(Ra(e))===e}function _p(e,t){let r=Ra(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}`)}fv(r)}function fv(e){if(e.isBefore(OM))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}ul.default.extend(rR.default);var nR=["past","now","next"],oR=["minute","hour","day","week","month","quarter","year"],_M=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new U({required:!t,constrainTo:oR}),period:new U({required:!0,constrainTo:nR})}};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"?mv(e):e;new Se(_M(t.period)).validate(t);let r=iR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);fv(r)}function aR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function iR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,ul.default)().subtract(r,n);case"next":return(0,ul.default)().add(r,n);case"now":return(0,ul.default)()}}function ll(e){return cl(iR(mv(e)))}function sR(e){return e.toLocaleLowerCase().split("-")}function sn(e){let[t,r,n]=sR(e);if(t==="now")return!0;if(!nR.includes(t)||!oR.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function cR(e){return!!e&&typeof e=="object"&&"period"in e}function mv(e){let[t,r,n]=sR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function uR(e){return Po(e),mv(e)}d();c();l();u();function lR(e){return e.type==="dateRange"}function dR(e){return`start${e}`}function pR(e){return`end${e}`}var gv=()=>({dateFacetValueMap:{}});function NM(e,t,r){let n=e.start,o=e.end;return sn(n)&&(n=ll(n),r.dateFacetValueMap[t][dR(n)]=e.start),sn(o)&&(o=ll(o),r.dateFacetValueMap[t][pR(o)]=e.end),{...e,start:n,end:o}}function hv(e,t){if(lR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>NM(o,r,t))}}return e}function ko(e){let t=gv();return{request:{...e,facets:e.facets?.map(n=>hv(n,t))},mappings:t}}function DM(e,t,r){return{...e,start:r.dateFacetValueMap[t][dR(e.start)]||e.start,end:r.dateFacetValueMap[t][pR(e.end)]||e.end}}function qM(e,t){return e.facetId in t.dateFacetValueMap}function MM(e,t){return qM(e,t)?{...e,values:e.values.map(r=>DM(r,e.facetId,t))}:e}function Np(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>MM(n,t))}}:e}d();c();l();u();d();c();l();u();var Fs=P("didYouMean/enable"),Dp=P("didYouMean/disable"),Es=P("didYouMean/automaticCorrections/disable"),qp=P("didYouMean/automaticCorrections/enable"),Ar=P("didYouMean/correction",e=>O(e,W)),Fa=P("didYouMean/automaticCorrections/mode",e=>O(e,new U({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Mp=()=>X("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),yv=()=>X("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),fR=()=>({actionCause:"didYouMeanClick"}),mR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Vp(){return{contextValues:{}}}d();c();l();u();function jp(){return{contextValues:{}}}d();c();l();u();function Sv(){return{enabled:!0,tabs:{}}}function Lp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Up(){return[]}d();c();l();u();function xr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Qp(){return{}}d();c();l();u();function Bp(){return{}}d();c();l();u();function Gp(){return{}}function gR(){return Br({})}function Br(e){return{context:e.context||Vp(),dictionaryFieldContext:e.dictionaryFieldContext||jp(),facetSet:e.facetSet||ts(),numericFacetSet:e.numericFacetSet||es(),dateFacetSet:e.dateFacetSet||Zi(),categoryFacetSet:e.categoryFacetSet||Ji(),automaticFacetSet:e.automaticFacetSet??Yi(),pagination:e.pagination||xr(),query:e.query||dt(),tabSet:e.tabSet||Gp(),advancedSearchQueries:e.advancedSearchQueries||Qr(),staticFilterSet:e.staticFilterSet||Bp(),querySet:e.querySet||Qp(),sortCriteria:e.sortCriteria||Sr(),pipeline:e.pipeline||Kn(),searchHub:e.searchHub||Co(),facetOptions:e.facetOptions||Lp(),facetOrder:e.facetOrder??Up(),debug:e.debug??Eo()}}d();c();l();u();var VM=new J({values:{undoneQuery:Be},options:{required:!0}}),$p=()=>X("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Hp=e=>X("analytics/trigger/query/undo",t=>(O(e,VM),t.makeUndoTriggerQuery(e))),zp=()=>X("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Wp=()=>X("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),Kp=()=>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}))),Is=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 dl(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 hR(e){return _o(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var vv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function jM(e){return _o(e).map(t=>{let r=vv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function LM(e){return[...jM(e.facetSet??{}),...hR(e.numericFacetSet??{}),...hR(e.dateFacetSet??{}),..._o(e.categoryFacetSet??{})]}function UM(e){return LM(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Yp(e){return dl(UM(e),e.facetOrder??[])}d();c();l();u();var No=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=GM(e),n=Yp(e),o=QM(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 QM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(BM).filter(r=>r.currentValues.length>0):void 0}function BM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function GM(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=$M(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function $M(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(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Np(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=!fe(f)&&!fe(f.correctedQuery);if(!m&&!g)return null;let C=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(ur(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(ur(Br(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:yv()})})()}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:yv()}}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(ur(Br(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:$p()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...ar(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(ur(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return bd(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(Ar(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Is({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 yR=xe("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Xp(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),SR=xe("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield xv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),vR=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Cv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),AR=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield KM(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),xR=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return Av(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),HM=/*#__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 HM(_x61,_x62){return _ref29.apply(this,arguments)}}(),zM=/*#__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 zM(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),WM=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield No(e,t);return r.request.numberOfResults=0,r});return function WM(_x66,_x67){return _ref31.apply(this,arguments)}}(),CR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Av(_x68,_x69){return _Av.apply(this,arguments)}function _Av(){_Av=_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:Yw()},m=>{t.dispatch(on({q:m,id:e.id}))}),i=yield zM(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 _Av.apply(this,arguments)}function xv(_x70,_x71,_x72){return _xv.apply(this,arguments)}function _xv(){_xv=_asyncToGenerator(function*(e,t,r){CR(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 _xv.apply(this,arguments)}function Cv(_x73,_x74){return _Cv.apply(this,arguments)}function _Cv(){_Cv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield iv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new Do({...e,analyticsAction:iv()}),p=yield HM(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _Cv.apply(this,arguments)}function KM(_x75,_x76,_x77){return _KM.apply(this,arguments)}function _KM(){_KM=_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 WM(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _KM.apply(this,arguments)}function Xp(_x78,_x79,_x80){return _Xp.apply(this,arguments)}function _Xp(){_Xp=_asyncToGenerator(function*(e,t,r){CR(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 _Xp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var bR=et(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=wv(e),o=YM(e),a=XM(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield Io(e,r):bs(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:bv(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 bv(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function YM(e){return dl(ZM(e),e.facetOrder??[])}function XM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(JM).filter(r=>r.currentValues.length>0):void 0}function JM(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function ZM(e){return eV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function eV(e){return[...tV(e.facetSet??{}),...wR(e.numericFacetSet??{}),...wR(e.dateFacetSet??{}),..._o(e.categoryFacetSet??{})]}function tV(e){return _o(e).map(t=>{let r=vv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function wR(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 wv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=bR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var qo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Np(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=!fe(f)&&!fe(f.correctedQuery);if(!m&&!g)return null;let C=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(ur(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(ur(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(ur(Br(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(ur(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return bd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=mR(),o=yield _this22.fetchFromAPI(yield Cr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Ar(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Is({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 Ts=xe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new U,enableQuerySyntax:new pe,clearFilters:new pe}),e.clearFilters&&(r(ft()),r(gs())),r(nn({allow:!0})),r(Vt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(an(1))}),RR=P("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 Xp(r,t,e.legacy);FR(r);let n=e.next?ER(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)}}()),jt=xe("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(FR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return xv(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=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Cv(t,r);let n=qw("browseResults",t.getState),o=new qo({...t,analyticsAction:n}),a=yield rV(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=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Xp(r,t,e.legacy);let n=new qo({...t,analyticsAction:{}}),o=yield oV(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)}}()),Ps=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Av(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=ER(Xw()),i=yield nV(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)}}()),rV=/*#__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 rV(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),nV=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=bs(e,t,o);return ko({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function nV(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),oV=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request.numberOfResults=0,n});return function oV(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),FR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},ER=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Mo=(e,t)=>{let r=e;return fe(r[t])?fe(e.raw[t])?null:e.raw[t]:r[t]},aV=e=>t=>e.every(r=>!fe(Mo(t,r))),iV=e=>t=>e.every(r=>fe(Mo(t,r))),sV=(e,t)=>r=>{let n=IR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},cV=(e,t)=>r=>{let n=IR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},IR=(e,t)=>{let r=Mo(t,e);return pd(r)?r:[r]},TR={getResultProperty:Mo,fieldsMustBeDefined:aV,fieldsMustNotBeDefined:iV,fieldMustMatch:sV,fieldMustNotMatch:cV};function pl(e){return e.search.response.searchUid!==""}function PR(e,t,r){return e.search.results.find(n=>Mo(n,t)===r)}var Rv=et(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var ks=P("app/setError");function Fv(e,t){let r=t.payload??null;r&&(e.response=ar().response,e.results=[],e.questionAnswer=Mi()),e.error=r,e.isLoading=!1}function Ev(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function uV(e,t){Ev(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 kR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function lV(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var he=ae(ar(),e=>{e.addCase(z.rejected,(t,r)=>Fv(t,r)),e.addCase(br.rejected,(t,r)=>Fv(t,r)),e.addCase(jt.rejected,(t,r)=>Fv(t,r)),e.addCase(z.fulfilled,(t,r)=>{uV(t,r)}),e.addCase(br.fulfilled,(t,r)=>{Ev(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(jt.fulfilled,(t,r)=>{Ev(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,kR),e.addCase(br.pending,lV),e.addCase(jt.pending,kR),e.addCase(RR,(t,r)=>{t.searchAction=r.payload}),e.addCase(ks,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var Os=P("searchHub/set",e=>O(e,new U({required:!0,emptyAllowed:!0})));var _s=ae(Co(),e=>{e.addCase(Os,(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 OR=class extends Error{constructor(t){super(t[0].message);de(this,"issues");this.name="SchemaError",this.issues=t}};var Xn="uninitialized",Tv="pending",ml="fulfilled",gl="rejected";function _R(e){return{status:e,isUninitialized:e===Xn,isLoading:e===Tv,isSuccess:e===ml,isError:e===gl}}var NR=Xr;function WR(e,t){if(e===t||!(NR(e)&&NR(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 dV(e){return new RegExp("(^|:)//").test(e)}function pV(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Nv(e){return e!=null}function DR(e){return[...(e?.values()??[])].filter(Nv)}function fV(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var mV=e=>e.replace(/\/$/,""),gV=e=>e.replace(/^\//,"");function hV(e,t){if(!e)return t;if(!t)return e;if(dV(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=mV(e),t=gV(t),`${e}${r}${t}`}function ef(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var kv=()=>new Map,yV=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},SV=(...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},qR=(...e)=>S(...e),vV=e=>e.status>=200&&e.status<=299,AV=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function MR(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 xV=e=>typeof e=="object"&&(Xr(e)||Array.isArray(e)||typeof e.toJSON=="function");function KR({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=qR,paramsSerializer:n,isJsonContentType:o=AV,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===qR&&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,x){let{getState:b,extra:w,endpoint:R,forced:E,type:I}=h,k,{url:T,headers:D=new A(g.headers),params:G=void 0,responseHandler:L=f??"json",validateStatus:V=m??vV,timeout:B=p,...j}=typeof C=="string"?{url:C}:C,_={...g,signal:B?SV(h.signal,yV(B)):h.signal,...j};D=new A(MR(D)),_.headers=(yield t(D,{getState:b,arg:C,extra:w,endpoint:R,forced:E,type:I,extraOptions:x}))||D;let N=xV(_.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, */*")),G){let ue=~T.indexOf("?")?"&":"?",ye=n?n(G):new URLSearchParams(MR(G));T+=ue+ye}T=hV(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(ye=>te=ye,ye=>ue=ye),ne.text().then(ye=>Z=ye,()=>{})]),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 x=yield C.text();return x.length?JSON.parse(x):null}return C.text()});return _v2.apply(this,arguments)}}var Ns=class{constructor(e,t=void 0){de(this,"value");de(this,"meta");this.value=e,this.meta=t}};function CV(){return _CV.apply(this,arguments)}function _CV(){_CV=_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 _CV.apply(this,arguments)}function YR(e,t){throw Object.assign(new Ns({error:e,meta:t}),{throwImmediately:!0})}function Iv(e){e.aborted&&YR({status:"CUSTOM_ERROR",error:"Aborted"})}var VR={},bV=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||VR).maxRetries,(o||VR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:CV,retryCondition:(g,v,{attempt:C})=>C<=i,...t,...o},m=0;for(;;){Iv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Ns(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Ns)return g.value;throw g}if(g instanceof Ns){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Iv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(v){throw Iv(n.signal),v}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),XR=Object.assign(bV,{fail:YR}),rf="__rtkq/",wV="online",RV="offline";var JR="focused";var Dv=P(`${rf}${JR}`),ZR=P(`${rf}un${JR}`),qv=P(`${rf}${wV}`),eF=P(`${rf}${RV}`);var Sl="query",tF="mutation",rF="infinitequery";function nf(e){return e.type===Sl}function FV(e){return e.type===tF}function of(e){return e.type===rF}function tf(e){return nf(e)||of(e)}function Mv(e,t,r,n,o,a){let i=EV(e)?e(t,r,n,o):e;return i?Pv(i,Nv,p=>a(nF(p))):[]}function EV(e){return typeof e=="function"}function nF(e){return typeof e=="string"?{type:e}:e}function IV(e,t){return e.catch(t)}var Ds=(e,t)=>e.endpointDefinitions[t],hl=Symbol("forceQueryFn"),Ov=e=>typeof e[hl]=="function";function TV({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:x,getRunningMutationsThunk:b};function C(T,D){return G=>{let L=Ds(a,T),V=e({queryArgs:D,endpointDefinition:L,endpointName:T});return p(G)?.get(V)}}function h(T,D){return G=>f(G)?.get(D)}function x(){return T=>DR(p(T))}function b(){return T=>DR(f(T))}function w(T){}function R(T,D){let G=(L,{subscribe:V=!0,forceRefetch:B,subscriptionOptions:j,[hl]:_,...N}={})=>(q,Y)=>{let H=e({queryArgs:L,endpointDefinition:D,endpointName:T}),ne,te={...N,type:Sl,subscribe:V,forceRefetch:B,subscriptionOptions:j,endpointName:T,originalArgs:L,queryCacheKey:H,[hl]:_};if(nf(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),ye=Z(Y());let{requestId:Ve,abort:Xe}=ue,Ue=ye.requestId!==Ve,He=p(q)?.get(H),ze=()=>Z(Y()),Ee=Object.assign(_?ue.then(ze):Ue&&!He?Promise.resolve(ye):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(G(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 G}function E(T,D){return R(T,D)}function I(T,D){return R(T,D)}function k(T){return(D,{track:G=!0,fixedCacheKey:L}={})=>(V,B)=>{let j=n({type:"mutation",endpointName:T,originalArgs:D,track:G,fixedCacheKey:L}),_=V(j);let{requestId:N,abort:q,unwrap:Y}=_,H=IV(_.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 oF=class extends OR{constructor(t,r,n,o){super(t);de(this,"value");de(this,"schemaName");de(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Ia=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ta(_x115,_x116,_x117,_x118){return _Ta.apply(this,arguments)}function _Ta(){_Ta=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new oF(o.issues,t,r,n);return o.value});return _Ta.apply(this,arguments)}function jR(e){return e}var fl=(e={})=>({...e,[Hu]:!0});function PV({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=Mv(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(Kt(te.data)){let[ye,Ve,Xe]=uS(te.data,N);Z.patches.push(...Ve),Z.inversePatches.push(...Xe),ue=ye}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},x=(j,_,N)=>q=>q(o.endpoints[j].initiate(_,{subscribe:!1,forceRefetch:!0,[hl]:()=>({data:N})})),b=(j,_)=>j.query&&j[_]?j[_]:jR,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:ye=m}=Z,Ve=j.type===Sl;try{let Xe=jR,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[hl]: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},or=yield Re(qr),Yr=yt?v:C;return{data:{pages:Yr(Pe.pages,or.data,ut),pageParams:Yr(Pe.pageParams,Ie,ut)},meta:or.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:or}=Z;if(yt&&!Ia(ye,"arg")&&(Pe=yield Ta(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 Ns(Ie.error,Ie.meta);let{data:Yr}=Ie;qr&&!Ia(ye,"rawResponse")&&(Yr=yield Ta(qr,Ie.data,"rawResponseSchema",Ie.meta));let fr=yield Xe(Yr,Ie.meta,Pe);return or&&!Ia(ye,"response")&&(fr=yield Ta(or,fr,"responseSchema",Ie.meta)),{...Ie,data:fr}});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:[]},or=i.selectQueryEntry(ne(),j.queryCacheKey)?.data,fr=R(j,ne())&&!j.direction||!or?qr:or;if("direction"in j&&j.direction&&fr.pages.length){let Mr=j.direction==="backward",id=(Mr?aF:_v)(Pe,fr,j.originalArgs);yt=yield Ee(fr,id,Ie,Mr)}else{let{initialPageParam:Mr=Pe.initialPageParam}=j,Su=or?.pageParams??[],id=Su[0]??Mr,v_=Su.length;if(yt=yield Ee(fr,id,Ie),He&&(yt={data:yt.data.pages[0]}),ut)for(let Vx=1;Vx<v_;Vx++){let A_=_v(Pe,yt.data,j.originalArgs);yt=yield Ee(yt.data,A_,Ie)}}ze=yt}else ze=yield Re(j.originalArgs);return ue&&!Ia(ye,"meta")&&ze.meta&&(ze.meta=yield Ta(ue,ze.meta,"metaSchema",ze.meta)),Y(ze.data,fl({fulfilledTimeStamp:Date.now(),baseQueryMeta:ze.meta}))}catch(Xe){let Ue=Xe;if(Ue instanceof Ns){let He=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:ze,errorResponseSchema:Ee}=Z,{value:Re,meta:Pe}=Ue;try{ze&&!Ia(ye,"rawErrorResponse")&&(Re=yield Ta(ze,Re,"rawErrorResponseSchema",Pe)),ue&&!Ia(ye,"meta")&&(Pe=yield Ta(ue,Pe,"metaSchema",Pe));let Ie=yield He(Re,Pe,j.originalArgs);return Ee&&!Ia(ye,"errorResponse")&&(Ie=yield Ta(Ee,Ie,"errorResponseSchema",Pe)),q(Ie,fl({baseQueryMeta:Pe}))}catch(Ie){Ue=Ie}}try{if(Ue instanceof oF){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),fl({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=()=>xe(`${e}/executeQuery`,w,{getPendingMeta({arg:_}){let N=r[_.endpointName];return fl({startedTimeStamp:Date.now(),...(of(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 Ov(_)?!0:Y?.status==="pending"?!1:R(_,q)||nf(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ue)},dispatchConditionRejection:!0}),I=E(),k=E(),T=xe(`${e}/executeMutation`,w,{getPendingMeta(){return fl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,G=j=>"ifOlderThan"in j,L=(j,_,N={})=>(q,Y)=>{let H=D(N)&&N.force,ne=G(N)&&N.ifOlderThan,te=(ue=!0)=>{let ye={forceRefetch:ue,subscribe:!1};return o.endpoints[j].initiate(_,ye)},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 B(j,_){return{matchPending:Bi($d(j),V(_)),matchFulfilled:Bi(Hn(j),V(_)),matchRejected:Bi(Sa(j),V(_))}}return{queryThunk:I,mutationThunk:T,infiniteQueryThunk:k,prefetch:L,updateQueryData:h,upsertQueryData:x,patchQueryData:g,buildMatchThunkActions:B}}function _v(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function aF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function iF(e,t,r,n){return Mv(r[e.meta.arg.endpointName][t],Hn(e)?e.payload:void 0,Wu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function LR(e){return Wt(e)?Vd(e):e}function Jp(e,t,r){let n=e[t];n&&r(n)}function yl(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function UR(e,t,r){let n=e[yl(t)];n&&r(n)}var Zp={};function kV({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,B,j,_){var N;V[N=B.queryCacheKey]??(V[N]={status:Xn,endpointName:B.endpointName}),Jp(V,B.queryCacheKey,q=>{q.status=Tv,q.requestId=j&&q.requestId?q.requestId:_.requestId,B.originalArgs!==void 0&&(q.originalArgs=B.originalArgs),q.startedTimeStamp=_.startedTimeStamp;let Y=o[_.arg.endpointName];of(Y)&&"direction"in B&&(q.direction=B.direction)})}function C(V,B,j,_){Jp(V,B.arg.queryCacheKey,N=>{if(N.requestId!==B.requestId&&!_)return;let{merge:q}=o[B.arg.endpointName];if(N.status=ml,q){if(N.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=B,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[B.arg.endpointName].structuralSharing??!0?WR(Wt(N.data)?HC(N.data):N.data,j):j;delete N.error,N.fulfilledTimeStamp=B.fulfilledTimeStamp})}let h=va({name:`${e}/queries`,initialState:Zp,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:B}}){delete V[B]},prepare:Gi()},cacheEntriesUpserted:{reducer(V,B){for(let j of B.payload){let{queryDescription:_,value:N}=j;v(V,_,!0,{arg:_,requestId:B.meta.requestId,startedTimeStamp:B.meta.timestamp}),C(V,{arg:_,requestId:B.meta.requestId,fulfilledTimeStamp:B.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:V=>({payload:V.map(_=>{let{endpointName:N,arg:q,value:Y}=_,H=o[N];return{queryDescription:{type:Sl,endpointName:N,originalArgs:_.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:N})},value:Y}}),meta:{[Hu]:!0,requestId:Ku(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:B,patches:j}}){Jp(V,B,_=>{_.data=lS(_.data,j.concat())})},prepare:Gi()}},extraReducers(V){V.addCase(t.pending,(B,{meta:j,meta:{arg:_}})=>{let N=Ov(_);v(B,_,N,j)}).addCase(t.fulfilled,(B,{meta:j,payload:_})=>{let N=Ov(j.arg);C(B,j,_,N)}).addCase(t.rejected,(B,{meta:{condition:j,arg:_,requestId:N},error:q,payload:Y})=>{Jp(B,_.queryCacheKey,H=>{if(!j){if(H.requestId!==N)return;H.status=gl,H.error=Y??q}})}).addMatcher(p,(B,j)=>{let{queries:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===ml||q?.status===gl)&&(B[N]=q)})}}),x=va({name:`${e}/mutations`,initialState:Zp,reducers:{removeMutationResult:{reducer(V,{payload:B}){let j=yl(B);j in V&&delete V[j]},prepare:Gi()}},extraReducers(V){V.addCase(r.pending,(B,{meta:j,meta:{requestId:_,arg:N,startedTimeStamp:q}})=>{N.track&&(B[yl(j)]={requestId:_,status:Tv,endpointName:N.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(B,{payload:j,meta:_})=>{_.arg.track&&UR(B,_,N=>{N.requestId===_.requestId&&(N.status=ml,N.data=j,N.fulfilledTimeStamp=_.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:j,error:_,meta:N})=>{N.arg.track&&UR(B,N,q=>{q.requestId===N.requestId&&(q.status=gl,q.error=j??_)})}).addMatcher(p,(B,j)=>{let{mutations:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===ml||q?.status===gl)&&N!==q?.requestId&&(B[N]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(V,B){var j,_,N;for(let{queryCacheKey:q,providedTags:Y}of B.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:Gi()}},extraReducers(V){V.addCase(h.actions.removeQueryResult,(B,{payload:{queryCacheKey:j}})=>{R(B,j)}).addMatcher(p,(B,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=B.tags)[H]??(N[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let ye of Z)ue.includes(ye)||ue.push(ye),B.keys[ye]=_.keys[ye]}}).addMatcher(Jr(Hn(t),Wu(t)),(B,j)=>{E(B,[j])}).addMatcher(h.actions.cacheEntriesUpserted.match,(B,j)=>{let _=j.payload.map(({queryDescription:N,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));E(B,_)})}});function R(V,B){let j=LR(V.keys[B]??[]);for(let _ of j){let N=_.type,q=_.id??"__internal_without_id",Y=V.tags[N]?.[q];Y&&(V.tags[N][q]=LR(Y).filter(H=>H!==B))}delete V.keys[B]}function E(V,B){let j=B.map(_=>{let N=iF(_,"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:Zp,reducers:{updateSubscriptionOptions(V,B){},unsubscribeQueryResult(V,B){},internal_getRTKQSubscriptions(){}}}),k=va({name:`${e}/internalSubscriptions`,initialState:Zp,reducers:{subscriptionsUpdated:{reducer(V,B){return lS(V,B.payload)},prepare:Gi()}}}),T=va({name:`${e}/config`,initialState:{online:fV(),focused:pV(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:B}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:V=>{V.addCase(qv,B=>{B.online=!0}).addCase(eF,B=>{B.online=!1}).addCase(Dv,B=>{B.focused=!0}).addCase(ZR,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),D=Li({queries:h.reducer,mutations:x.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(V,B)=>D(g.match(B)?void 0:V,B),L={...T.actions,...h.actions,...I.actions,...k.actions,...x.actions,...w.actions,resetApiState:g};return{reducer:G,actions:L}}var Pa=Symbol.for("RTKQ/skipToken"),sF={status:Xn},QR=ha(sF,()=>{}),BR=ha(sF,()=>{});function OV({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>QR,o=I=>BR;return{buildQuerySelector:C,buildInfiniteQuerySelector:h,buildMutationSelector:x,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(I){return{...I,..._R(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===Pa)return r(n,T);let G=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(V=>f(V,G)??QR,T)}}function C(I,k){return v(I,k,a)}function h(I,k){let{infiniteQueryOptions:T}=k;function D(G){let L={...G,..._R(G.status)},{isLoading:V,isError:B,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:B&&_,isFetchPreviousPageError:B&&N}}return v(I,k,D)}function x(){return I=>{let k;return typeof I=="object"?k=yl(I)??Pa:k=I,r(k===Pa?o:G=>i(G)?.mutations?.[k]??BR,a)}}function b(I,k){let T=I[t],D=new Set,G=Pv(k,Nv,nF);for(let L of G){let V=T.provided.tags[L.type];if(!V)continue;let B=(L.id!==void 0?V[L.id]:Object.values(V).flat())??[];for(let j of B)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 Pv(Object.values(p(I)),T=>T?.endpointName===k&&T.status!==Xn,T=>T.originalArgs)}function R(I,k,T){return k?_v(I,k,T)!=null:!1}function E(I,k,T){return!k||!I.getPreviousPageParam?!1:aF(I,k,T)!=null}}var GR=WeakMap?new WeakMap:void 0,$R=({endpointName:e,queryArgs:t})=>{let r="",n=GR?.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)&&GR?.set(t,o),r=o}return`${e}(${r})`};function _V(...e){return function(r){let n=Gu(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=$R;if("serializeQueryArgs"in m.endpointDefinition){let v=m.endpointDefinition.serializeQueryArgs;g=C=>{let h=v(C);return typeof h=="string"?h:$R({...C,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Ku(),extractRehydrationInfo:n,hasRehydrationInfo:Gu(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(Ds(a,v)):Object.assign(Ds(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:Sl}),mutation:v=>({...v,type:tF}),infiniteQuery:v=>({...v,type:rF})});for(let[v,C]of Object.entries(g)){if(m.overrideExisting!==!0&&v in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Yt(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 NV=({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=ef(b,E.queryCacheKey,kv);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=ef(b,I.queryCacheKey,kv);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 x(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,R])=>[w,Object.fromEntries(R)]))))}return(b,w)=>{if(a||(a=x(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=x(r.currentSubscriptions),[,D]=uS(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]}},DV=2147483647/1e3-1,qV=({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 x={};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 G;if(v.match(I))G=I.payload.map(L=>L.queryDescription.queryCacheKey);else{let{queryCacheKey:L}=g.match(I)?I.payload:I.meta.arg;G=[L]}R(G,k,D)}if(t.util.resetApiState.match(I)){for(let[G,L]of Object.entries(x))L&&clearTimeout(L),delete x[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:G}=n.extractRehydrationInfo(I);R(Object.keys(G),k,D)}};function R(I,k,T){let D=k.getState();for(let G of I){let L=a(D,G);L?.endpointName&&E(G,L.endpointName,k,T)}}function E(I,k,T,D){let L=Ds(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let V=Math.max(0,Math.min(L,DV));if(!h(I)){let B=x[I];B&&clearTimeout(B),x[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 x[I]},V*1e3)}}return w},HR=new Error("Promise never resolved before cacheEntryRemoved."),MV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Hd(n),m=Hd(o),g=Hn(n,o),v={},{removeQueryResult:C,removeMutationResult:h,cacheEntriesUpserted:x}=e.internalActions;function b(T,D,G){let L=v[T];L?.valueResolved&&(L.valueResolved({data:D,meta:G}),delete L.valueResolved)}function w(T){let D=v[T];D&&(delete v[T],D.cacheEntryRemoved())}function R(T){let{arg:D,requestId:G}=T.meta,{endpointName:L,originalArgs:V}=D;return[L,V,G]}let E=(T,D,G)=>{let L=I(T);function V(B,j,_,N){let q=i(G,j),Y=i(D.getState(),j);!q&&Y&&k(B,N,j,D,_)}if(n.pending.match(T)){let[B,j,_]=R(T);V(B,L,_,j)}else if(x.match(T))for(let{queryDescription:B,value:j}of T.payload){let{endpointName:_,originalArgs:N,queryCacheKey:q}=B;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 B of Object.keys(v))w(B)};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)?yl(T.payload):""}function k(T,D,G,L,V){let B=Ds(r,T),j=B?.onCacheEntryAdded;if(!j)return;let _={},N=new Promise(Z=>{_.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{_.valueResolved=Z}),N.then(()=>{throw HR})]);q.catch(()=>{}),v[G]=_;let Y=e.endpoints[T].select(tf(B)?D:G),H=L.dispatch((Z,ue,ye)=>ye),ne={...L,getCacheEntry:()=>Y(L.getState()),requestId:V,extra:H,updateCachedData:tf(B)?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!==HR)throw Z})}return E},VV=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},jV=({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),Wu(n)),v=Jr(Hn(o,n),Sa(o,n)),C=[],h=0,x=(R,E)=>{(o.pending.match(R)||n.pending.match(R))&&h++,v(R)&&(h=Math.max(0,h-1)),g(R)?w(iF(R,"invalidatesTags",r,i),E):v(R)?w([],E):a.util.invalidateTags.match(R)&&w(Mv(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 G=Array.from(D.values());for(let{queryCacheKey:L}of G){let V=k.queries[L],B=ef(f.currentSubscriptions,L,kv);V&&(B.size===0?E.dispatch(m({queryCacheKey:L})):V.status!==Xn&&E.dispatch(p(V)))}})}return x},LV=({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)&&(x(),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 G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.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),G=Date.now()+T;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:w},R)}function h(w){let R=a.get(w);R?.timeout&&clearTimeout(R.timeout),a.delete(w)}function x(){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},UV=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=$d(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,x=Ds(t,C),b=x?.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(tf(x)?h:v),I=g.dispatch((T,D,G)=>G),k={...g,getCacheEntry:()=>E(g.getState()),requestId:v,extra:I,updateCachedData:tf(x)?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]}}},QV=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{Dv.match(f)&&p(m,"refetchOnFocus"),qv.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 x=v[h],b=C.get(h);if(!b||!x)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})):x.status!==Xn&&f.dispatch(n(x)))}})}return i};function BV(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=[VV,qV,jV,LV,MV,UV];return{middleware:C=>{let h=!1,x=a(C.dispatch),b={...e,internalState:x,refetchQuery:v,isThisApiSliceAction:f,mwApi:C},w=m.map(I=>I(b)),R=NV(b),E=QV(b);return I=>k=>{if(!ku(k))return I(k);h||(h=!0,C.dispatch(n.internalActions.middlewareRegistered(i)));let T={...C,next:I},D=C.getState(),[G,L]=R(k,T,D),V;if(G?V=I(k):V=L,C.getState()[t]&&(E(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,D);return V}},actions:p};function v(C){return e.api.endpoints[C.endpointName].initiate(C.originalArgs,{subscribe:!1,forceRefetch:!0})}}var zR=Symbol(),GV=({createSelector:e=et}={})=>({name:zR,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},x){ZC();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:qv,onOffline:eF,onFocus:Dv,onFocusLost:ZR},util:{}});let w=OV({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:G,mutationThunk:L,patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,buildMatchThunkActions:N}=PV({baseQuery:r,reducerPath:o,context:x,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:h}),{reducer:q,actions:Y}=kV({context:x,queryThunk:D,infiniteQueryThunk:G,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:B,upsertQueryData:j,prefetch:_,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Yn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>ef(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ue,getRunningMutationThunk:ye,getRunningMutationsThunk:Ve,getRunningQueriesThunk:Xe,getRunningQueryThunk:Ue}=TV({queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:x,getInternalState:ne});Yn(t.util,{getRunningMutationThunk:ye,getRunningMutationsThunk:Ve,getRunningQueryThunk:Ue,getRunningQueriesThunk:Xe});let{middleware:He,actions:ze}=BV({reducerPath:o,context:x,queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Ue,getInternalState:ne});return Yn(t.util,ze),Yn(t,{reducer:q,middleware:He}),{name:zR,injectEndpoint(Ee,Re){var ut;let Ie=(ut=t.endpoints)[Ee]??(ut[Ee]={});nf(Re)&&Yn(Ie,{name:Ee,select:I(Ee,Re),initiate:te(Ee,Re)},N(D,Ee)),FV(Re)&&Yn(Ie,{name:Ee,select:T(),initiate:ue(Ee)},N(L,Ee)),of(Re)&&Yn(Ie,{name:Ee,select:k(Ee,Re),initiate:Z(Ee,Re)},N(D,Ee))}}}}),cF=_V(GV());d();c();l();u();d();c();l();u();var ka=e=>e.query,uF=e=>e.query?.enableQuerySyntax;var lF=et(e=>ka(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})),af=et(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var sf=e=>{if(e==="yes")return!0;if(e==="no")return!1},$V=()=>X("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function HV(e,t){return X({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??We(n),a=nl(n,e);if(!o||!a)return null;let i=Ca(n);return r.makeGeneratedAnswerCitationClick(Vw(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:jw(a),...(i&&{conversationId:i})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=nl(r,e);return{answerId:t??We(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function zV(e,t,r){return X({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??We(o),i=nl(o,e);if(!a||!i)return null;let p=Ca(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t,...(p&&{conversationId:p})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=nl(n,e);return{answerId:r??We(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function WV(e,t){return X({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function KV(e){return X({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"like"})})}function YV(e){return X({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"dislike"})})}var XV=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:sf(o),documented:sf(a),correctTopic:sf(p),hallucinationFree:sf(i)},additionalNotes:m,correctAnswerUrl:f}}}),Jn=(e,t,r)=>X({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??We(o);if(!a)return null;let i=Ca(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:r,...(i&&{conversationId:i})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??We(n)??"",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||""})}),JV=()=>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"})}),ZV=()=>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"})}),ej=()=>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"})}),tj=()=>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 rj(e){return X({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??We(r);if(!n)return null;let o=Ca(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??We(t)??"",action:"copyToClipboard"})})}var jo={logCopyGeneratedAnswer:rj,logGeneratedAnswerHideAnswers:ZV,logGeneratedAnswerShowAnswers:JV,logGeneratedAnswerStreamEnd:Jn,logGeneratedAnswerFeedback:XV,logDislikeGeneratedAnswer:YV,logLikeGeneratedAnswer:KV,logGeneratedAnswerOpenInlineLink:WV,logHoverCitation:zV,logOpenGeneratedAnswerSource:HV,logRetryGeneratedAnswer:$V,logGeneratedAnswerExpand:ej,logGeneratedAnswerCollapse:tj};d();c();l();u();d();c();l();u();var dF=et(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 Vv=e=>e.context;d();c();l();u();var jv=e=>e.pipeline;d();c();l();u();var Lv=e=>e.searchHub;d();c();l();u();var Lt=et(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),vie=et(e=>e,e=>{let t=Lt(e);return t&&e?e[t].expression:""});d();c();l();u();var pF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var fF=e=>e.excerptLength?.length;d();c();l();u();var cn=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,mF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var gF=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 hF=e=>e.sortCriteria;var yF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ji(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function yF(_x126){return _ref45.apply(this,arguments)}}(),SF=(e,t)=>{let r=ka(e)?.q,{aq:n,cq:o,dq:a,lq:i}=xF(e),p=Vv(e),f=Ur(e.configuration.analytics,t,{actionCause:Rv(e)}),m=Lv(e),g=jv(e),v=KS(e)??[],C=AF(e),h=Lt(e.tabSet)||"default",x=zS(e),b=Rw(e),w=t.referrer||"",R=mF(e),E=hF(e),I=nj(e),k=fF(e),T=gF(e),D=pF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:uF(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:bv(e),firstResult:e.pagination.firstResult}),tab:h,locale:x,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})}},vF=(e,t)=>{let r=ka(e)?.q,n=AF(e),o=Ur(e.configuration.analytics,t,{actionCause:Rv(e)}),a=zS(e),i=Lt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=xF(e),g=Lv(e),v=jv(e),C=Vv(e),h=KS(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(C?.contextValues&&{context:C.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},AF=e=>Yp(e)?.map(t=>hv(t,gv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),nj=e=>({actionsHistory:e.configuration.analytics.enabled?Xt.getInstance().getHistory():[]}),xF=e=>{let t=dF(e),r=wv(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var cf=["searching","thinking","answering"];function uf(e){return e.toLowerCase()}function Uv(){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 CF=["text/plain","text/markdown"];var qs=new U({required:!0}),bF=new U,Ms=new pe({required:!0}),Qv={id:qs,title:qs,uri:qs,permanentid:qs,clickUri:bF},lf=new U({required:!0,constrainTo:CF}),wF=new U({required:!0,constrainTo:cf}),RF=e=>({...e,name:uf(e.name)}),Vs=P("generatedAnswer/setIsVisible",e=>O(e,Ms)),js=P("generatedAnswer/setAnswerId",e=>O(e,W)),df=P("generatedAnswer/setAnswerGenerationMode",e=>O(e,new U({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),vl=P("generatedAnswer/setIsEnabled",e=>O(e,Ms)),_a=P("generatedAnswer/updateMessage",e=>O(e,{textDelta:qs})),Na=P("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new J({values:Qv})})})),Da=P("generatedAnswer/updateError",e=>O(e,{message:bF,code:new re({min:0})})),lr=P("generatedAnswer/resetAnswer"),pf=P("generatedAnswer/like"),ff=P("generatedAnswer/dislike"),mf=P("generatedAnswer/feedbackModal/open"),Al=P("generatedAnswer/expand"),gf=P("generatedAnswer/collapse"),hf=P("generatedAnswer/setId",e=>O(e,{id:new U({required:!0})})),yf=P("generatedAnswer/feedbackModal/close"),Ls=P("generatedAnswer/sendFeedback"),un=P("generatedAnswer/setIsLoading",e=>O(e,Ms)),Oa=P("generatedAnswer/setIsStreaming",e=>O(e,Ms)),qa=P("generatedAnswer/setAnswerContentFormat",e=>O(e,lf)),Sf=P("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:lf,default:["text/plain"]})})),vf=P("knowledge/updateAnswerConfigurationId",e=>O(e,qs)),Af=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,wd)),xl=P("generatedAnswer/setIsAnswerGenerated",e=>O(e,Ms)),Ma=P("generatedAnswer/setCannotAnswer",e=>O(e,Ms)),Bv=P("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new J({}))),xf=P("generatedAnswer/startStep",e=>O(RF(e),{name:wF,startedAt:new re({min:0,required:!0})})),Cf=P("generatedAnswer/finishStep",e=>O(RF(e),{name:wF,finishedAt:new re({min:0,required:!0})})),FF=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 yF(r),g=(h,x)=>{switch(h){case"genqa.headerMessageType":{let b=JSON.parse(x);n(qa(b.contentFormat));break}case"genqa.messageType":n(_a(JSON.parse(x)));break;case"genqa.citationsType":n(Na(JSON.parse(x)));break;case"genqa.endOfStreamType":{let b=JSON.parse(x).answerGenerated,{answerId:w,answer:R}=a().generatedAnswer,I=p.length!==0&&!b,k=!R?.trim();n(Ma(I)),n(Oa(!1)),n(xl(b)),n(Jn(b,w,b?k:void 0)),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(Da(h))},close:()=>{v(m)&&n(Oa(!1))},resetAnswer:()=>{v(m)&&n(lr())}});C?f(C):n(un(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),bf=xe("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(lr());let a=t();if(a.generatedAnswer.answerConfigurationId){let i=SF(a,n);r(Bv(i)),yield r(wf(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 oj=/*#__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=ji(n.configuration.search?.apiBaseUrl,i,a);return KR({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,C={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(h=>{C[h]=g[h]}),C.duplex="half",C.body=yield g.text(),S(v,C)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function oj(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),Rf=cF({reducerPath:"answer",baseQuery:XR(oj,{maxRetries:3}),endpoints:()=>({})});var aj=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},ij=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(e.answer=n?.trim()?n.concat(r):r)},sj=(e,t)=>{e.citations=t.citations},cj=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},uj=(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})`)},lj=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&uj(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(aj(t,o),r(qa(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(ij(t,o),r(_a({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(sj(t,o),r(Na({citations:o.citations})));break;case"genqa.endOfStreamType":{cj(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.trim():void 0;r(Jn(i,a,p)),r(Vo());break}}},dj=(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`},Va=Rf.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=ji(i.search.apiBaseUrl,m,g),h=dj(C,m,p.answerConfigurationId,f?.insightId);yield hd(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*(x){let b=x.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(js(b))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:x=>{o(b=>{lj(x,b,a)})},onerror:x=>{throw x},onclose:()=>{o(x=>{a(Ma(!x.generated))})}})}).apply(this,arguments)}})})}),wf=e=>Va.endpoints.getAnswer.initiate(e),Gv=e=>{let t=af(e);return Va.endpoints.getAnswer.select(t??Pa)(e)};d();c();l();u();var EF=ae(Ao,e=>e);d();c();l();u();function pj(e){let t=e.payload?.analyticsAction;return IF(e)&&!fe(t)}function IF(e){return"type"in e}var TF=e=>t=>r=>{let n;pj(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return IF(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 Us=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 Ff=Vr(kp(),1),OF=Vr(PF(),1),_F=Vr(kF(),1);Ff.default.extend(_F.default);Ff.default.extend(OF.default);var Qs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Ff.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 fj=/(^|; )Coveo-Pendragon=([^;]*)/,mj=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function NF(){return typeof window>"u"?!1:fj.exec(document.cookie)?.pop()||null}function DF(){return typeof window>"u"?!1:mj.test(document.cookie)}var Ef=ae(Qs(),e=>e.addCase(rn,(t,r)=>{gj(t,r.payload)}).addCase(vr,(t,r)=>{hj(t,r.payload)}).addCase(Ro,(t,r)=>{yj(t,r.payload)}).addCase(cs,t=>{t.analytics.enabled=!1}).addCase(us,t=>{t.analytics.enabled=!0}).addCase(Rp,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Fp,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(ht,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ls,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{fe(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Ep,(t,{payload:r})=>{Sj(t,r)}));function gj(e,t){fe(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",fe(t.organizationId)||(e.organizationId=t.organizationId)}function hj(e,t){fe(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),fe(t.locale)||(e.search.locale=t.locale),fe(t.timezone)||(e.search.timezone=t.timezone),fe(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function yj(e,t){fe(t.enabled)||(e.analytics.enabled=t.enabled),fe(t.originContext)||(e.analytics.originContext=t.originContext),fe(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),fe(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),fe(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),fe(t.trackingId)||(e.analytics.trackingId=t.trackingId),fe(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),fe(t.source)||(e.analytics.source=t.source);try{let r=NF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}fe(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),fe(t.anonymous)||(e.analytics.anonymous=t.anonymous),fe(t.deviceId)||(e.analytics.deviceId=t.deviceId),fe(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),fe(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function Sj(e,t){e.knowledge.agentId=t;try{let r=DF();fe(r)||(e.knowledge.debugAgentSession=!0)}catch{}}var me=Ef;d();c();l();u();function vj(e){return e.instantlyCallable}var qF=()=>e=>t=>e(vj(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 Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function MF(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 Kv,Aj=new Uint8Array(16);function Yv(){if(!Kv){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Kv=crypto.getRandomValues.bind(crypto)}return Kv(Aj)}d();c();l();u();d();c();l();u();var xj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xv={randomUUID:xj};function Cj(e,t,r){if(Xv.randomUUID&&!t&&!e)return Xv.randomUUID();e=e||{};let n=e.random??e.rng?.()??Yv();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 MF(n)}var Lo=Cj;d();c();l();u();d();c();l();u();var F={};Au(F,{BRAND:()=>Wj,DIRTY:()=>ja,EMPTY_PATH:()=>Fj,INVALID:()=>Ce,NEVER:()=>OL,OK:()=>Ut,ParseStatus:()=>Dt,Schema:()=>ke,ZodAny:()=>Bo,ZodArray:()=>ro,ZodBigInt:()=>Ua,ZodBoolean:()=>Qa,ZodBranded:()=>bl,ZodCatch:()=>Za,ZodDate:()=>Ba,ZodDefault:()=>Ja,ZodDiscriminatedUnion:()=>Pf,ZodEffects:()=>Er,ZodEnum:()=>Ya,ZodError:()=>er,ZodFirstPartyTypeKind:()=>be,ZodFunction:()=>Of,ZodIntersection:()=>za,ZodIssueCode:()=>ee,ZodLazy:()=>Wa,ZodLiteral:()=>Ka,ZodMap:()=>Ws,ZodNaN:()=>Ys,ZodNativeEnum:()=>Xa,ZodNever:()=>Gr,ZodNull:()=>$a,ZodNullable:()=>pn,ZodNumber:()=>La,ZodObject:()=>tr,ZodOptional:()=>Rr,ZodParsedType:()=>le,ZodPipeline:()=>wl,ZodPromise:()=>Go,ZodReadonly:()=>ei,ZodRecord:()=>kf,ZodSchema:()=>ke,ZodSet:()=>Ks,ZodString:()=>Qo,ZodSymbol:()=>Hs,ZodTransformer:()=>Er,ZodTuple:()=>dn,ZodType:()=>ke,ZodUndefined:()=>Ga,ZodUnion:()=>Ha,ZodUnknown:()=>to,ZodVoid:()=>zs,addIssueToContext:()=>ce,any:()=>nL,array:()=>sL,bigint:()=>Jj,boolean:()=>WF,coerce:()=>kL,custom:()=>$F,date:()=>Zj,datetimeRegex:()=>BF,defaultErrorMap:()=>Zn,discriminatedUnion:()=>dL,effect:()=>bL,enum:()=>AL,function:()=>yL,getErrorMap:()=>Bs,getParsedType:()=>ln,instanceof:()=>Yj,intersection:()=>pL,isAborted:()=>If,isAsync:()=>Gs,isDirty:()=>Tf,isValid:()=>Uo,late:()=>Kj,lazy:()=>SL,literal:()=>vL,makeIssue:()=>Cl,map:()=>gL,nan:()=>Xj,nativeEnum:()=>xL,never:()=>aL,null:()=>rL,nullable:()=>RL,number:()=>zF,object:()=>cL,objectUtil:()=>Jv,oboolean:()=>PL,onumber:()=>TL,optional:()=>wL,ostring:()=>IL,pipeline:()=>EL,preprocess:()=>FL,promise:()=>CL,quotelessJson:()=>bj,record:()=>mL,set:()=>hL,setErrorMap:()=>Rj,strictObject:()=>uL,string:()=>HF,symbol:()=>eL,transformer:()=>bL,tuple:()=>fL,undefined:()=>tL,union:()=>lL,unknown:()=>oL,util:()=>De,void:()=>iL});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 Jv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Jv||(Jv={}));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"]),bj=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 wj=(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=wj;var VF=Zn;function Rj(e){VF=e}function Bs(){return VF}d();c();l();u();var Cl=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}},Fj=[];function ce(e,t){let r=Bs(),n=Cl({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 Dt=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"}),ja=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),If=e=>e.status==="aborted",Tf=e=>e.status==="dirty",Uo=e=>e.status==="valid",Gs=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ge||(ge={}));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}},jF=(e,t)=>{if(Uo(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 Dt,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(Gs(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 jF(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 Uo(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=>Uo(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 Gs(o)?o:Promise.resolve(o);return jF(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 Go.create(this,this._def)}or(t){return Ha.create([this,t],this._def)}and(t){return za.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 Ja({...Te(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new bl({typeName:be.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Za({...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 wl.create(this,t)}readonly(){return ei.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ej=/^c[^\s-]{8,}$/i,Ij=/^[0-9a-z]+$/,Tj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Pj=/^[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,kj=/^[a-z0-9_-]{21}$/i,Oj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_j=/^[-+]?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)?)??$/,Nj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Zv,qj=/^(?:(?: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])$/,Mj=/^(?:(?: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])$/,Vj=/^(([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]))$/,jj=/^(([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])$/,Lj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,UF="((\\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])))",Qj=new RegExp(`^${UF}$`);function QF(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 Bj(e){return new RegExp(`^${QF(e)}$`)}function BF(e){let t=`${UF}T${QF(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 Gj(e,t){return!!((t==="v4"||!t)&&qj.test(e)||(t==="v6"||!t)&&Vj.test(e))}function $j(e,t){if(!Oj.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 Hj(e,t){return!!((t==="v4"||!t)&&Mj.test(e)||(t==="v6"||!t)&&jj.test(e))}var Qo=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 Dt,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")Nj.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")Zv||(Zv=new RegExp(Dj,"u")),Zv.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")Pj.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")kj.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")Ej.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")Ij.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")Tj.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"?BF(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"?Qj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Bj(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"?_j.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Gj(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"?$j(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"?Hj(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"?Lj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Uj.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,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.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,...ge.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,...ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ge.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ge.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ge.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ge.errToObj(r)})}nonempty(t){return this.min(1,ge.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}};Qo.create=e=>new Qo({checks:[],typeName:be.ZodString,coerce:e?.coerce??!1,...Te(e)});function zj(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 La=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 Dt;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"?zj(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,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.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)}};La.create=e=>new La({checks:[],typeName:be.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var Ua=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 Dt;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,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.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:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.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}};Ua.create=e=>new Ua({checks:[],typeName:be.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var Qa=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)}};Qa.create=e=>new Qa({typeName:be.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var Ba=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 Dt,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:ge.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ge.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}};Ba.create=e=>new Ba({checks:[],coerce:e?.coerce||!1,typeName:be.ZodDate,...Te(e)});var Hs=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)}};Hs.create=e=>new Hs({typeName:be.ZodSymbol,...Te(e)});var Ga=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)}};Ga.create=e=>new Ga({typeName:be.ZodUndefined,...Te(e)});var $a=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)}};$a.create=e=>new $a({typeName:be.ZodNull,...Te(e)});var Bo=class extends ke{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}};Bo.create=e=>new Bo({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 zs=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)}};zs.create=e=>new zs({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=>Dt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Fr(r,i,r.path,p)));return Dt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ge.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ge.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 $s(e){if(e instanceof tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Rr.create($s(n))}return new tr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:$s(e.element)}):e instanceof Rr?Rr.create($s(e.unwrap())):e instanceof pn?pn.create($s(e.unwrap())):e instanceof dn?dn.create(e.items.map(t=>$s(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=>Dt.mergeObjectSync(n,m)):Dt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return ge.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:ge.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 $s(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 GF(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 Ha=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}};Ha.create=(e,t)=>new Ha({options:e,typeName:be.ZodUnion,...Te(t)});var eo=e=>e instanceof Wa?eo(e.schema):e instanceof Er?eo(e.innerType()):e instanceof Ka?[e.value]:e instanceof Ya?e.options:e instanceof Xa?De.objectValues(e.enum):e instanceof Ja?eo(e._def.innerType):e instanceof Ga?[void 0]:e instanceof $a?[null]:e instanceof Rr?[void 0,...eo(e.unwrap())]:e instanceof pn?[null,...eo(e.unwrap())]:e instanceof bl||e instanceof ei?eo(e.unwrap()):e instanceof Za?eo(e._def.innerType):[],Pf=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 eA(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=eA(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=eA(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 za=class extends ke{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(If(a)||If(i))return Ce;let p=eA(a.value,i.value);return p.valid?((Tf(a)||Tf(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}))}};za.create=(e,t,r)=>new za({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=>Dt.mergeArray(r,i)):Dt.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 kf=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?Dt.mergeObjectAsync(r,o):Dt.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:Qo.create(),valueType:t,typeName:be.ZodRecord,...Te(r)})}},Ws=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}}}};Ws.create=(e,t,r)=>new Ws({valueType:t,keyType:e,typeName:be.ZodMap,...Te(r)});var Ks=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:ge.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ge.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ks.create=(e,t)=>new Ks({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...Te(t)});var Of=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 Cl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return Cl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),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 Go){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)})}},Wa=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})}};Wa.create=(e,t)=>new Wa({getter:e,typeName:be.ZodLazy,...Te(t)});var Ka=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}};Ka.create=(e,t)=>new Ka({value:e,typeName:be.ZodLiteral,...Te(t)});function GF(e,t){return new Ya({values:e,typeName:be.ZodEnum,...Te(t)})}var Ya=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})}};Ya.create=GF;var Xa=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}};Xa.create=(e,t)=>new Xa({values:e,typeName:be.ZodNativeEnum,...Te(t)});var Go=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})))}};Go.create=(e,t)=>new Go({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"?ja(f.value):r.value==="dirty"?ja(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"?ja(p.value):r.value==="dirty"?ja(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(!Uo(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=>Uo(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 Ja=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}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:be.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Za=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 Gs(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}};Za.create=(e,t)=>new Za({innerType:e,typeName:be.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var Ys=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}}};Ys.create=e=>new Ys({typeName:be.ZodNaN,...Te(e)});var Wj=Symbol("zod_brand"),bl=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}},wl=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(),ja(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})}},ei=class extends ke{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Uo(o)&&(o.value=Object.freeze(o.value)),o);return Gs(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};ei.create=(e,t)=>new ei({innerType:e,typeName:be.ZodReadonly,...Te(t)});function LF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function $F(e,t={},r){return e?Bo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=LF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=LF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Bo.create()}var Kj={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 Yj=(e,t={message:`Input not instance of ${e.name}`})=>$F(r=>r instanceof e,t),HF=Qo.create,zF=La.create,Xj=Ys.create,Jj=Ua.create,WF=Qa.create,Zj=Ba.create,eL=Hs.create,tL=Ga.create,rL=$a.create,nL=Bo.create,oL=to.create,aL=Gr.create,iL=zs.create,sL=ro.create,cL=tr.create,uL=tr.strictCreate,lL=Ha.create,dL=Pf.create,pL=za.create,fL=dn.create,mL=kf.create,gL=Ws.create,hL=Ks.create,yL=Of.create,SL=Wa.create,vL=Ka.create,AL=Ya.create,xL=Xa.create,CL=Go.create,bL=Er.create,wL=Rr.create,RL=pn.create,FL=Er.createWithPreprocess,EL=wl.create,IL=()=>HF().optional(),TL=()=>zF().optional(),PL=()=>WF().optional(),kL={string:e=>Qo.create({...e,coerce:!0}),number:e=>La.create({...e,coerce:!0}),boolean:e=>Qa.create({...e,coerce:!0}),bigint:e=>Ua.create({...e,coerce:!0}),date:e=>Ba.create({...e,coerce:!0})};var OL=Ce;var _L=F.object({name:F.string(),arguments:F.string()}),NL=F.object({id:F.string(),type:F.literal("function"),function:_L,encryptedValue:F.string().optional()}),_f=F.object({id:F.string(),role:F.string(),content:F.string().optional(),name:F.string().optional(),encryptedValue:F.string().optional()}),DL=F.object({type:F.literal("text"),text:F.string()}),qL=F.object({type:F.literal("data"),value:F.string(),mimeType:F.string()}),ML=F.object({type:F.literal("url"),value:F.string(),mimeType:F.string().optional()}),Nf=F.discriminatedUnion("type",[qL,ML]),VL=F.object({type:F.literal("image"),source:Nf,metadata:F.unknown().optional()}),jL=F.object({type:F.literal("audio"),source:Nf,metadata:F.unknown().optional()}),LL=F.object({type:F.literal("video"),source:Nf,metadata:F.unknown().optional()}),UL=F.object({type:F.literal("document"),source:Nf,metadata:F.unknown().optional()});var KF=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()}),YF=(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"]})},tde=KF.superRefine((e,t)=>{YF(e,t)}),QL=F.discriminatedUnion("type",[DL,VL,jL,LL,UL,KF]),BL=QL.superRefine((e,t)=>{e.type==="binary"&&YF(e,t)}),GL=_f.extend({role:F.literal("developer"),content:F.string()}),$L=_f.extend({role:F.literal("system"),content:F.string()}),HL=_f.extend({role:F.literal("assistant"),content:F.string().optional(),toolCalls:F.array(NL).optional()}),zL=_f.extend({role:F.literal("user"),content:F.union([F.string(),F.array(BL)])}),WL=F.object({id:F.string(),content:F.string(),role:F.literal("tool"),toolCallId:F.string(),error:F.string().optional(),encryptedValue:F.string().optional()}),KL=F.object({id:F.string(),role:F.literal("activity"),activityType:F.string(),content:F.record(F.any())}),YL=F.object({id:F.string(),role:F.literal("reasoning"),content:F.string(),encryptedValue:F.string().optional()}),XF=F.discriminatedUnion("role",[GL,$L,HL,zL,WL,KL,YL]),rde=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user"),F.literal("tool"),F.literal("activity"),F.literal("reasoning")]),XL=F.object({description:F.string(),value:F.string()}),JF=F.object({name:F.string(),description:F.string(),parameters:F.any(),metadata:F.record(F.any()).optional()}),JL=F.object({threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),state:F.any(),messages:F.array(XF),tools:F.array(JF),context:F.array(XL),forwardedProps:F.any()}),ZL=F.any(),nt=class extends Error{constructor(e){super(e)}},tA=class extends nt{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},eU=F.object({name:F.string(),description:F.string().optional()}),tU=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()}),rU=F.object({streaming:F.boolean().optional(),websocket:F.boolean().optional(),httpBinary:F.boolean().optional(),pushNotifications:F.boolean().optional(),resumable:F.boolean().optional()}),nU=F.object({supported:F.boolean().optional(),items:F.array(JF).optional(),parallelCalls:F.boolean().optional(),clientProvided:F.boolean().optional()}),oU=F.object({structuredOutput:F.boolean().optional(),supportedMimeTypes:F.array(F.string()).optional()}),aU=F.object({snapshots:F.boolean().optional(),deltas:F.boolean().optional(),memory:F.boolean().optional(),persistentState:F.boolean().optional()}),iU=F.object({supported:F.boolean().optional(),delegation:F.boolean().optional(),handoffs:F.boolean().optional(),subAgents:F.array(eU).optional()}),sU=F.object({supported:F.boolean().optional(),streaming:F.boolean().optional(),encrypted:F.boolean().optional()}),cU=F.object({image:F.boolean().optional(),audio:F.boolean().optional(),video:F.boolean().optional(),pdf:F.boolean().optional(),file:F.boolean().optional()}),uU=F.object({image:F.boolean().optional(),audio:F.boolean().optional()}),lU=F.object({input:cU.optional(),output:uU.optional()}),dU=F.object({codeExecution:F.boolean().optional(),sandboxed:F.boolean().optional(),maxIterations:F.number().optional(),maxExecutionTime:F.number().optional()}),pU=F.object({supported:F.boolean().optional(),approvals:F.boolean().optional(),interventions:F.boolean().optional(),feedback:F.boolean().optional()}),nde=F.object({identity:tU.optional(),transport:rU.optional(),tools:nU.optional(),output:oU.optional(),state:aU.optional(),multiAgent:iU.optional(),reasoning:sU.optional(),multimodal:lU.optional(),execution:dU.optional(),humanInTheLoop:pU.optional(),custom:F.record(F.unknown()).optional()}),ZF=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(),fU=je.extend({type:F.literal(M.TEXT_MESSAGE_START),messageId:F.string(),role:ZF.default("assistant"),name:F.string().optional()}),eE=je.extend({type:F.literal(M.TEXT_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),mU=je.extend({type:F.literal(M.TEXT_MESSAGE_END),messageId:F.string()}),gU=je.extend({type:F.literal(M.TEXT_MESSAGE_CHUNK),messageId:F.string().optional(),role:ZF.optional(),delta:F.string().optional(),name:F.string().optional()}),hU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_START)}),yU=eE.omit({messageId:!0,type:!0}).extend({type:F.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),SU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_END)}),vU=je.extend({type:F.literal(M.TOOL_CALL_START),toolCallId:F.string(),toolCallName:F.string(),parentMessageId:F.string().optional()}),AU=je.extend({type:F.literal(M.TOOL_CALL_ARGS),toolCallId:F.string(),delta:F.string()}),xU=je.extend({type:F.literal(M.TOOL_CALL_END),toolCallId:F.string()}),CU=je.extend({messageId:F.string(),type:F.literal(M.TOOL_CALL_RESULT),toolCallId:F.string(),content:F.string(),role:F.literal("tool").optional()}),bU=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()}),wU=je.extend({type:F.literal(M.THINKING_START),title:F.string().optional()}),RU=je.extend({type:F.literal(M.THINKING_END)}),FU=je.extend({type:F.literal(M.STATE_SNAPSHOT),snapshot:ZL}),EU=je.extend({type:F.literal(M.STATE_DELTA),delta:F.array(F.any())}),IU=je.extend({type:F.literal(M.MESSAGES_SNAPSHOT),messages:F.array(XF)}),TU=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)}),PU=je.extend({type:F.literal(M.ACTIVITY_DELTA),messageId:F.string(),activityType:F.string(),patch:F.array(F.any())}),kU=je.extend({type:F.literal(M.RAW),event:F.any(),source:F.string().optional()}),OU=je.extend({type:F.literal(M.CUSTOM),name:F.string(),value:F.any()}),_U=je.extend({type:F.literal(M.RUN_STARTED),threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),input:JL.optional()}),NU=je.extend({type:F.literal(M.RUN_FINISHED),threadId:F.string(),runId:F.string(),result:F.any().optional()}),DU=je.extend({type:F.literal(M.RUN_ERROR),message:F.string(),code:F.string().optional()}),qU=je.extend({type:F.literal(M.STEP_STARTED),stepName:F.string()}),MU=je.extend({type:F.literal(M.STEP_FINISHED),stepName:F.string()}),VU=F.union([F.literal("tool-call"),F.literal("message")]),jU=je.extend({type:F.literal(M.REASONING_START),messageId:F.string()}),LU=je.extend({type:F.literal(M.REASONING_MESSAGE_START),messageId:F.string(),role:F.literal("reasoning")}),UU=je.extend({type:F.literal(M.REASONING_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),QU=je.extend({type:F.literal(M.REASONING_MESSAGE_END),messageId:F.string()}),BU=je.extend({type:F.literal(M.REASONING_MESSAGE_CHUNK),messageId:F.string().optional(),delta:F.string().optional()}),GU=je.extend({type:F.literal(M.REASONING_END),messageId:F.string()}),$U=je.extend({type:F.literal(M.REASONING_ENCRYPTED_VALUE),subtype:VU,entityId:F.string(),encryptedValue:F.string()}),Df=F.discriminatedUnion("type",[fU,eE,mU,gU,wU,RU,hU,yU,SU,vU,AU,xU,bU,CU,FU,EU,IU,TU,PU,kU,OU,_U,NU,DU,qU,MU,jU,LU,UU,QU,BU,GU,$U]);d();c();l();u();var rA={};Au(rA,{JsonPatchError:()=>at,_areEquals:()=>El,applyOperation:()=>ti,applyPatch:()=>Qf,applyReducer:()=>YU,deepClone:()=>WU,getValueByPointer:()=>Lf,validate:()=>rE,validator:()=>Uf});d();c();l();u();d();c();l();u();var HU=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)}}(),zU=Object.prototype.hasOwnProperty;function Mf(e,t){return zU.call(e,t)}function Vf(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)Mf(e,o)&&n.push(o);return n}function qt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function jf(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 Rl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function qf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(qf(e[t]))return!0}else if(typeof e=="object"){for(var n=Vf(e),o=n.length,a=0;a<o;a++)if(qf(e[n[a]]))return!0}}return!1}function tE(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 Fl=function(e){HU(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,tE(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=tE(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var at=Fl,WU=qt,Xs={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=Lf(r,this.path);n&&(n=qt(n));var o=ti(r,{op:"remove",path:this.from}).removed;return ti(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Lf(r,this.from);return ti(r,{op:"add",path:this.path,value:qt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:El(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},KU={add:function(e,t,r){return jf(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:Xs.move,copy:Xs.copy,test:Xs.test,_get:Xs._get};function Lf(e,t){if(t=="")return e;var r={op:"_get",path:t};return ti(e,r),r.value}function ti(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):Uf(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=Lf(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=El(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=qt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,v=f.length,C=void 0,h=void 0,x=void 0;for(typeof r=="function"?x=r:x=Uf;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=Rl(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&&x(t,0,e,C)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!jf(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);jf(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=KU[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=Xs[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 Qf(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=qt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=ti(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function YU(e,t,r){var n=ti(e,t);if(n.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Uf(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(Xs[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")&&qf(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=rE([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 rE(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Qf(qt(t),qt(e),r||!0);else{r=r||Uf;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 El(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(!El(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],!El(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var iA={};Au(iA,{compare:()=>oQ,generate:()=>nA,observe:()=>nQ,unobserve:()=>rQ});d();c();l();u();var oA=new WeakMap,XU=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),JU=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function ZU(e){return oA.get(e)}function eQ(e,t){return e.observers.get(t)}function tQ(e,t){e.observers.delete(t.callback)}function rQ(e,t){t.unobserve()}function nQ(e,t){var r=[],n,o=ZU(e);if(!o)o=new XU(e),oA.set(e,o);else{var a=eQ(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=qt(e),t){n.callback=t,n.next=null;var i=function(){nA(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(){nA(n),clearTimeout(n.next),tQ(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 JU(t,n)),n}function nA(e,t){t===void 0&&(t=!1);var r=oA.get(e.object);aA(r.value,e.object,e.patches,"",t),e.patches.length&&Qf(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function aA(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Vf(t),i=Vf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],v=e[g];if(Mf(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)?aA(v,C,r,n+"/"+fn(g),o):v!==C&&(p=!0,o&&r.push({op:"test",path:n+"/"+fn(g),value:qt(v)}),r.push({op:"replace",path:n+"/"+fn(g),value:qt(C)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+fn(g),value:qt(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];!Mf(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+fn(g),value:qt(t[g])})}}}function oQ(e,t,r){r===void 0&&(r=!1);var n=[];return aA(e,t,n,"",r),n}var Bf=Object.assign({},rA,iA,{JsonPatchError:Fl,deepClone:qt,escapePathComponent:fn,unescapePathComponent:Rl});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var sA=function(e,t){return sA=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])},sA(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");sA(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function nE(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 Gf(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 Js(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 Zs(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 ri(e){return this instanceof ri?(this.v=e,this):new ri(e)}function oE(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(x){return Promise.resolve(x).then(h,v)}}function p(h,x){n[h]&&(o[h]=function(b){return new Promise(function(w,R){a.push([h,b,w,R])>1||f(h,b)})},x&&(o[h]=x(o[h])))}function f(h,x){try{m(n[h](x))}catch(b){C(a[0][3],b)}}function m(h){h.value instanceof ri?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,x){h(x),a.shift(),a.length&&f(a[0][0],a[0][1])}}function aE(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 ec(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 $f=ec(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
32
+ `;function Xq(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Zq=["1",1,"yes",!0];function ip(){let e=[];return NS()&&e.push(window.doNotTrack),zS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Zq.indexOf(t)!==-1)}var yw="v15",Sw={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 eM(e=Sw.default,t=yw,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 tM="38824e1f-37f5-42d3-8372-a4b8fa9df946",Zr=class{get defaultOptions(){return{endpoint:Sw.default,isCustomEndpoint:!1,token:"",version:yw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return fw}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=[BD,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};ip()?this.runtime=new ap: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 NS()&&$i()?new $S(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Xq()&&console.warn(Jq),new HS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return Q(this,void 0,void 0,function*(){try{return NS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Aa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Aa()}})}getCurrentVisitorId(){return Q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return Q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return Q(this,void 0,void 0,function*(){if(tp(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(ew(t,ew(r,tM)))}})}getParameters(t,...r){return Q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return Q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Aa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(ip())return null;try{let r=new URL(t).searchParams.get(Co.cvo_cid);if(r==null)return null;let n=Co.fromString(r);return!n||!$i()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return Q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>Q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>Q(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((C,b)=>Q(this,void 0,void 0,function*(){let w=yield C;return yield b(t,w)}),h)].reduce((h,C)=>Q(this,void 0,void 0,function*(){let b=yield h;return yield C(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return Q(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?Uq(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,x)=>Q(this,void 0,void 0,function*(){let h=yield v;return yield x(h)}),Promise.resolve(r))})}makeEvent(t,...r){return Q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return Q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new ep().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.search,t)})}sendSearchEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Wn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.click,t)})}sendClickEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Wn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.custom,t)})}sendCustomEvent(t){return Q(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Wn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.view,t)})}sendViewEvent(t){return Q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return Q(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return Q(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($q(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=Wn(t,["custom"]),o={};r&&Zd(r)&&(o=this.lowercaseKeys(r));let a=Hq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Wn(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=Wn(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=Wn(t,["userId"]);return Yq(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Wn(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"?oq(t,r):t}get baseUrl(){return eM(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Kn;(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"})(Kn||(Kn={}));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.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",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.generatedAnswerFollowupOpenSource="generatedAnswerFollowupOpenSource",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})($||($={}));var sw={[$.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",[$.generatedAnswerOpenInlineLink]:"generatedAnswer",[$.generatedAnswerFollowupOpenSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Kn.expandToFullUI]:"interface",[Kn.openUserActions]:"User Actions",[Kn.showPrecedingSessions]:"User Actions",[Kn.showFollowingSessions]:"User Actions",[Kn.clickViewedDocument]:"User Actions",[Kn.clickPageView]:"User Actions",[Kn.createArticle]:"createArticle"},Wi=class{constructor(){this.runtime=new ap,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 fw}};function rM(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function nM(e){return e.map(t=>t.replace(/;/g,""))}function vw(e){let r=e.join(";");return r.length<=256?r:vw(e.slice(1))}var cw=e=>{let t=nM(e),r=rM(t);return vw(r)};function uw(e){let t=typeof e.partialQueries=="string"?e.partialQueries:cw(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:cw(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var sp=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||ip();this.coveoAnalyticsClient=n?new Wi:new Zr(t)}disable(){this.coveoAnalyticsClient=new Wi}enable(){this.coveoAnalyticsClient=new Zr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,uw(t))}logOmniboxAnalytics(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,uw(t))}logOmniboxFromLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=sw[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 Q(this,arguments,void 0,function*(n,o,a=sw[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),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 Q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return Q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return Q(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 Q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof 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 Q(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 Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent($.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(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 Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent($.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},cp=Object.assign({},el),lw=Object.keys(cp).map(e=>cp[e]),Hi=class extends MS{constructor({client:t,uuidGenerator:r=Aa}){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])=>lw.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(lw.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(cp.pageview,{newEventType:_e.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(cp.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 uq(this.ticket)}};Hi.Id="svc";var up;(function(e){e.click="click",e.flowStart="flowStart"})(up||(up={}));var yr;(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"})(yr||(yr={}));var lp;(function(e){e.quit="Quit",e.solved="Solved"})(lp||(lp={}));var dp=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!ip();this.coveoAnalyticsClient=o?new Zr(t):new Wi,this.svc=new Hi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Wi,this.svc=new Hi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Zr(this.options),this.svc=new Hi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(yr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(yr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(yr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(yr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(yr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(yr.caseCancelled,{reason:lp.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(yr.caseSolved,{reason:lp.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(yr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",up.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",up.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return Q(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 Q(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 xo=()=>"default";var oM=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Ca=class{constructor(t){pe(this,"getState",t);pe(this,"state");this.state=t()}getLanguage(){return oM(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=Ao),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||xo()}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 Aw=e=>new Zr(e).getCurrentVisitorId(),nl=(e,t)=>typeof t=="function"?(...r)=>{let n=Tu(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,ol=(e,t)=>(...r)=>{let n=Tu(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var al=class extends Ca{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Cw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new al(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??gr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new dp({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:nl(e,n),beforeSendHooks:[ol(e,r),(v,x)=>(e.info({...x,type:v,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Ki(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function aM(e,t){return!!t&&t.facetId in e.facetSet}var Lr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),pp=(e,t)=>e.facetSet[t]?.request,Yi=(e,t)=>{let r=Lr(e,t);return aM(e,r)?r:void 0},xw=(e,t)=>Yi(e,t)?.values.filter(r=>r.state==="selected")||[],bw=(e,t)=>Yi(e,t)?.values.filter(r=>r.state!=="idle")||[],en=e=>e.search.isLoading;d();c();l();u();function ww(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}=iM(e);return t?sM(t,r):[]}function iM(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 sM(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function cM(e,t){return!!t&&t.facetId in e.categoryFacetSet}var YS=(e,t)=>{let r=Lr(e,t);if(cM(e,r))return r},JS=(e,t)=>e.categoryFacetSet[t]?.request,Rw=(e,t)=>{let r=YS(e,t);return cr(r?.values??[])},XS=(e,t)=>{let r=JS(e,t);return cr(r?.currentValues??[])};d();c();l();u();function Ji(){return{}}d();c();l();u();function Fw(e,t){return{request:e,tabs:t}}function Xi(){return{}}d();c();l();u();function Ew(e,t){return{request:e,tabs:t}}function Zi(){return{}}d();c();l();u();function Iw(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function es(){return{}}var ts=(e,t)=>{let r=Ow(t,e),n=r?r.field:"",o=ev(n,e);return{facetId:e,facetField:n,facetTitle:o}};function rs(e,t){let{facetId:r,facetValue:n}=e,o=ts(r,t),a=_w(t,r);return{...o,facetValue:a==="hierarchical"?kw(t,r):n}}function ur(e){return{facetSet:e.facetSet??es(),categoryFacetSet:e.categoryFacetSet??Ji(),dateFacetSet:e.dateFacetSet??Xi(),numericFacetSet:e.numericFacetSet??Zi(),automaticFacetSet:e.automaticFacetSet??Ki()}}var ZS=e=>{let t=[];return dM(e).forEach((r,n)=>{let o=_w(e,r.facetId),a=hM(r,n+1);if(lM(r)){if(!!!XS(e,r.facetId).length)return;t.push({...a,...mM(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Tw(i,p+1,o),m=uM(r)?Pw(i):fM(i);t.push({...a,...f,...m})})}),pM(e).forEach((r,n)=>{let o=gM(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Tw(a,i+1,"specific"),f=Pw(a);t.push({...o,...p,...f})})}),t},uM=e=>e.type==="specific",lM=e=>e.type==="hierarchical",dM=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),pM=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Tw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),fM=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Pw=e=>({displayValue:e.value,value:e.value}),kw=(e,t)=>XS(e,t).map(n=>n.value).join(";"),mM=(e,t)=>{let n=kw(e,t);return{value:n,valuePosition:1,displayValue:n}},gM=(e,t)=>({title:ev(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),hM=(e,t)=>({title:ev(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),ev=(e,t)=>`${e}_${t}`,Ow=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,_w=(e,t)=>{let r=Ow(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var tv=e=>e.configuration.search.locale,Nw=e=>e.configuration.search.timezone,fp=e=>e.configuration.accessToken,mp=e=>e.configuration.organizationId,gp=e=>e.configuration.environment,hp=e=>e.configuration?.knowledge?.agentId,Dw=e=>e.configuration.knowledge.debugAgentSession;var Ue=e=>{if(yM(e)||rv(e))return e.generatedAnswer?.answerId;if(SM(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},yM=e=>"answer"in e&&"generatedAnswer"in e&&!de(e.generatedAnswer?.answerConfigurationId),rv=e=>{let t=hp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},SM=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",nv=e=>e.generatedAnswer?.fieldsToIncludeInCitations,bo=e=>e.followUpAnswers?.conversationId,vM=e=>e.generatedAnswer?.citations,AM=e=>e.followUpAnswers?.followUpAnswers,CM=et(AM,e=>e?.flatMap(t=>t.citations)),xM=(e,t)=>t,ns=et(vM,CM,xM,(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 il=(r=>(r.Ascending="ascending",r.Descending="descending",r))(il||{}),xa=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(xa||{}),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""}},os=()=>({by:"relevancy"}),yp=e=>({by:"date",order:e}),Sp=(e,t)=>({by:"field",order:t,field:e}),vp=()=>({by:"qre"}),Ap=()=>({by:"nosort"}),qw=new X({values:{by:new Iu({enum:xa,required:!0}),order:new Iu({enum:il}),field:new L}});function vr(){return tn(os())}d();c();l();u();d();c();l();u();d();c();l();u();var as=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?ov(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],ov(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 ov(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 bM(){return typeof navigator<"u"}function Mw(){try{return typeof localStorage<"u"}catch{return!1}}function Vw(){try{return typeof sessionStorage<"u"}catch{return!1}}function jw(){return!!(bM()&&navigator.cookieEnabled)}var Lw=null;function Uw(){return Lw||(Mw()?localStorage:jw()?new av:Vw()?sessionStorage:new iv)}var is=class is{getItem(t){return as.get(`${is.prefix}${t}`)}removeItem(t){as.erase(`${is.prefix}${t}`)}setItem(t,r,n){as.set(`${is.prefix}${t}`,r,n)}};pe(is,"prefix","coveo_");var av=is;var iv=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Cp="__coveo.analytics.history",wM=20,RM=1e3*60,FM=75,ba=class ba{constructor(t){pe(this,"store");this.store=t||Uw()}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(Cp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Cp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Cp,JSON.stringify(t.slice(0,wM)))}catch{}}clear(){try{this.store.removeItem(Cp)}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,FM)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>RM:!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))}};pe(ba,"instance",null);var sv=ba,Xt=sv;var sl=class sl extends Ca{constructor(){super(...arguments);pe(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 ZS(ur(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||sl.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||sl.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ue(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??vr()}}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}};pe(sl,"fallbackPipelineName","default");var wo=sl,Qw=({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??gr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new sp({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:nl(e,n),beforeSendHooks:[ol(e,r),(v,x)=>(e.info({...x,type:v,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g},cv=()=>{let t=Xt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function xp(e){let t=Bw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return dx([e,...t,...r],o=>o.uniqueId)}function Bw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Bw(t)]):[]}d();c();l();u();var rn=()=>"";function $w(e,t){return{...new wo(t).getBaseMetadata(),actionCause:e,type:e}}function EM(e){return Object.assign(e,{instantlyCallable:!0})}function IM(e,t){let r=a=>{let i=Ce(e,a);return EM(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:x,extra:h}){return yield g({state:x(),extra:h})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var Hw=(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 kM(a)}return n},TM=e=>e.configuration.analytics.analyticsMode==="legacy",PM=e=>e.configuration.analytics.analyticsMode==="next",kM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),IM(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let v=[],x={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(),C=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(C,p());x.description=b?.description,v.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(R){TM(R)&&(yield OM(b,r,R,g,C.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=Zu(h);return v.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(R){if(PM(R)&&o&&n){let E=n(R);yield LM(w,o,E)}});return function(_x27){return _ref16.apply(this,arguments)}}()),x});return function(_x24){return _ref13.apply(this,arguments)}}()));function OM(_x28,_x29,_x30,_x31,_x32){return _OM.apply(this,arguments)}function _OM(){_OM=_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 _OM.apply(this,arguments)}var _M=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=Hw(e=>Qw({...e,provider:e.provider||new wo(e.getState)}),e=>e,wo),w5=Hw(Cw,_M("caseAssist"),al);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Xw(e,o),n<0&&(n=jM(e,o)),n<0&&(n=0),NM(e,r(n),t)};var zw=(e,t)=>({sourceName:Kw(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||rn()}),Ww=(e,t)=>({sourceName:Kw(e),documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||rn()});function Kw(e){let t=e.source;return de(t)?"unknown":t}var Yw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function NM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:MM(e),...(Gw(e)?{documentCategory:Gw(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:VM(e),queryPipeline:r.pipeline||rn()}}function Gw(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||""}),Jw={urihash:new L,sourcetype:new L,permanentid:new L},bp={uniqueId:z,raw:new X({values:Jw}),title:z,uri:z,clickUri:z,rankingModifier:new L({required:!1,emptyAllowed:!0})};function DM(e){return Object.assign({},...Object.keys(Jw).map(t=>({[t]:e[t]})))}function qM(e){return Object.assign({},...Object.keys(bp).map(t=>({[t]:e[t]})),{raw:DM(e.raw)})}function MM(e){let t=e.raw.author;return de(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function VM(e){let t=e.raw.source;return de(t)?"unknown":t}var Zt=e=>new Se(bp).validate(qM(e));function jM(e,t){for(let[r,n]of t.entries()){let o=xp(n);if(Xw(e,o)!==-1)return r}return-1}function Xw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function LM(_x34,_x35,_x36){return _LM.apply(this,arguments)}function _LM(){_LM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _LM.apply(this,arguments)}d();c();l();u();var uv=e=>O(e,{evt:z,type:st}),Zw=e=>J("analytics/generic/search",t=>{uv(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),eR=e=>J("analytics/generic/click",(t,r)=>(Zt(e.result),uv(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),tR=e=>J("analytics/generic/custom",t=>(uv(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),wp=()=>J("analytics/interface/load",e=>e.makeInterfaceLoad()),Ro=()=>J("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),Rp=()=>J("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),Fp=e=>J("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),rR=()=>({actionCause:"interfaceLoad"}),ss=()=>({actionCause:"interfaceChange"}),nR=()=>({actionCause:"searchFromLink"}),oR=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var lv=()=>st,aR=()=>z,nn=P("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new L({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),Ar=P("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new L({required:!1,url:!0}),pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new ie({required:!1,each:z})})),UM={enabled:new fe({default:!0}),originContext:lv(),originLevel2:lv(),originLevel3:lv(),proxyBaseUrl:new L({required:!1,url:!0}),runtimeEnvironment:new Be,anonymous:new fe({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:Bx,analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new X({options:{required:!1},values:Jb.reduce((e,t)=>(e[t]=Qx,e),{})})},Fo=P("configuration/updateAnalyticsConfiguration",e=>O(e,UM)),cs=P("configuration/analytics/disable"),us=P("configuration/analytics/enable"),Ep=P("configuration/analytics/originlevel2",e=>O(e,{originLevel2:aR()})),Ip=P("configuration/analytics/originlevel3",e=>O(e,{originLevel3:aR()})),Tp=P("knowledge/setAgentId",e=>O(e,new L({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Pp={q:new L,enableQuerySyntax:new fe,aq:new L,cq:new L,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new L,f:new X,fExcluded:new X,cf:new X,nf:new X,mnf:new X,df:new X,debug:new fe,sf:new X,tab:new L,af:new X};var Me=P("searchParameters/restore",e=>O(e,Pp)),ls=P("searchParameters/restoreTab",e=>O(e,z));d();c();l();u();var Eo=P("debug/enable"),ds=P("debug/disable");d();c();l();u();var Io=()=>!1;var ps=ae(Io(),e=>{e.addCase(Eo,()=>!0).addCase(ds,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var dv=P("history/undo"),pv=P("history/redo"),lr=P("history/snapshot"),cl=Ce("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(dv()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),kp=Ce("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(pv()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=Ce("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 fs=P("pipeline/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var ms=ae(rn(),e=>{e.addCase(fs,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ar,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var ft=P("breadcrumb/deselectAll"),gs=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var on=P("facet/updateFacetAutoSelection",e=>O(e,{allow:new fe({required:!0})}));d();c();l();u();d();c();l();u();var ul=class extends wo{constructor(r){super(r);pe(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 iR=e=>J({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Zt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new ul(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}}}}),sR=()=>J("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new ul(e)),cR=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var fv={id:z},QM={...fv,q:Ge},hs=P("instantResults/register",e=>O(e,fv)),an=P("instantResults/updateQuery",e=>O(e,QM)),ys=P("instantResults/clearExpired",e=>O(e,fv));d();c();l();u();var Op=new re({required:!0,min:0}),Ss=P("pagination/registerNumberOfResults",e=>O(e,Op)),vs=P("pagination/updateNumberOfResults",e=>O(e,Op)),As=P("pagination/registerPage",e=>O(e,Op)),sn=P("pagination/updatePage",e=>O(e,Op)),Cs=P("pagination/nextPage"),xs=P("pagination/previousPage");d();c();l();u();var Vt=P("query/updateQuery",e=>O(e,{q:new L,enableQuerySyntax:new fe}));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:Gi(e)}});var bs=(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&&!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 ws=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Aw(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}),...(cv()&&{pageId:cv()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Gi(e)})}}});return function ws(_x43,_x44){return _ref21.apply(this,arguments)}}();var To=/*#__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 ws(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 To(_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 mv=()=>J("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Po=e=>J("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 dl=Vr(_p(),1),fR=Vr(uR(),1);d();c();l();u();var Np=Vr(_p(),1),dR=Vr(lR(),1);Np.default.extend(dR.default);var Rs="YYYY/MM/DD@HH:mm:ss",BM="1401-01-01";function wa(e,t){let r=(0,Np.default)(e,t);return!r.isValid()&&!t?(0,Np.default)(e,Rs):r}function ll(e){return e.format(Rs)}function pR(e){return ll(wa(e))===e}function Dp(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}`)}Cv(r)}function Cv(e){if(e.isBefore(BM))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}dl.default.extend(fR.default);var mR=["past","now","next"],gR=["minute","hour","day","week","month","quarter","year"],GM=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new L({required:!t,constrainTo:gR}),period:new L({required:!0,constrainTo:mR})}};function ko(e){if(typeof e=="string"&&!cn(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?xv(e):e;new Se(GM(t.period)).validate(t);let r=yR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);Cv(r)}function hR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function yR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,dl.default)().subtract(r,n);case"next":return(0,dl.default)().add(r,n);case"now":return(0,dl.default)()}}function pl(e){return ll(yR(xv(e)))}function SR(e){return e.toLocaleLowerCase().split("-")}function cn(e){let[t,r,n]=SR(e);if(t==="now")return!0;if(!mR.includes(t)||!gR.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function vR(e){return!!e&&typeof e=="object"&&"period"in e}function xv(e){let[t,r,n]=SR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function AR(e){return ko(e),xv(e)}d();c();l();u();function CR(e){return e.type==="dateRange"}function xR(e){return`start${e}`}function bR(e){return`end${e}`}var bv=()=>({dateFacetValueMap:{}});function $M(e,t,r){let n=e.start,o=e.end;return cn(n)&&(n=pl(n),r.dateFacetValueMap[t][xR(n)]=e.start),cn(o)&&(o=pl(o),r.dateFacetValueMap[t][bR(o)]=e.end),{...e,start:n,end:o}}function wv(e,t){if(CR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>$M(o,r,t))}}return e}function Oo(e){let t=bv();return{request:{...e,facets:e.facets?.map(n=>wv(n,t))},mappings:t}}function HM(e,t,r){return{...e,start:r.dateFacetValueMap[t][xR(e.start)]||e.start,end:r.dateFacetValueMap[t][bR(e.end)]||e.end}}function zM(e,t){return e.facetId in t.dateFacetValueMap}function WM(e,t){return zM(e,t)?{...e,values:e.values.map(r=>HM(r,e.facetId,t))}:e}function qp(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>WM(n,t))}}:e}d();c();l();u();d();c();l();u();var Fs=P("didYouMean/enable"),Mp=P("didYouMean/disable"),Es=P("didYouMean/automaticCorrections/disable"),Vp=P("didYouMean/automaticCorrections/enable"),Cr=P("didYouMean/correction",e=>O(e,z)),Ra=P("didYouMean/automaticCorrections/mode",e=>O(e,new L({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var jp=()=>J("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),Rv=()=>J("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),wR=()=>({actionCause:"didYouMeanClick"}),RR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Lp(){return{contextValues:{}}}d();c();l();u();function Up(){return{contextValues:{}}}d();c();l();u();function Fv(){return{enabled:!0,tabs:{}}}function Qp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Bp(){return[]}d();c();l();u();function xr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Gp(){return{}}d();c();l();u();function $p(){return{}}d();c();l();u();function Hp(){return{}}function FR(){return Br({})}function Br(e){return{context:e.context||Lp(),dictionaryFieldContext:e.dictionaryFieldContext||Up(),facetSet:e.facetSet||es(),numericFacetSet:e.numericFacetSet||Zi(),dateFacetSet:e.dateFacetSet||Xi(),categoryFacetSet:e.categoryFacetSet||Ji(),automaticFacetSet:e.automaticFacetSet??Ki(),pagination:e.pagination||xr(),query:e.query||dt(),tabSet:e.tabSet||Hp(),advancedSearchQueries:e.advancedSearchQueries||Qr(),staticFilterSet:e.staticFilterSet||$p(),querySet:e.querySet||Gp(),sortCriteria:e.sortCriteria||vr(),pipeline:e.pipeline||rn(),searchHub:e.searchHub||xo(),facetOptions:e.facetOptions||Qp(),facetOrder:e.facetOrder??Bp(),debug:e.debug??Io()}}d();c();l();u();var KM=new X({values:{undoneQuery:Ge},options:{required:!0}}),zp=()=>J("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Wp=e=>J("analytics/trigger/query/undo",t=>(O(e,KM),t.makeUndoTriggerQuery(e))),Kp=()=>J("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Yp=()=>J("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),Jp=()=>J("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var _o=P("trigger/query/ignore",e=>O(e,new L({emptyAllowed:!0,required:!0}))),Is=P("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 No(e){return Object.values(e).map(t=>t.request)}function fl(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 ER(e){return No(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Ev={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function YM(e){return No(e).map(t=>{let r=Ev[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function JM(e){return[...YM(e.facetSet??{}),...ER(e.numericFacetSet??{}),...ER(e.dateFacetSet??{}),...No(e.categoryFacetSet??{})]}function XM(e){return JM(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Xp(e){return fl(XM(e),e.facetOrder??[])}d();c();l();u();var Do=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=tV(e),n=Xp(e),o=ZM(e),a=yield To(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Oo({...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 Do(_x47,_x48){return _ref23.apply(this,arguments)}}();function ZM(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(eV).filter(r=>r.currentValues.length>0):void 0}function eV(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function tV(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=rV(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function rV(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 qo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){pe(this,"config",t);pe(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=qp(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(Po(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=!de(f)&&!de(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(lr(Br(_this12.getState()))),x})()}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(Po(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:Rv()})})()}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:Rv()}}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(_o("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this14.dispatch(Po(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(lr(Br(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:zp()})})()}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 Rd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Do(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Cr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Is({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Do(_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 IR=Ce("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)}}()),TR=Ce("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Tv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),PR=Ce("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Pv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),kR=Ce("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield iV(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),OR=Ce("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return Iv(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),nV=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield Do(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function nV(_x61,_x62){return _ref29.apply(this,arguments)}}(),oV=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield To(e);return Oo({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function oV(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),aV=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield Do(e,t);return r.request.numberOfResults=0,r});return function aV(_x66,_x67){return _ref31.apply(this,arguments)}}(),_R=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Iv(_x68,_x69){return _Iv.apply(this,arguments)}function _Iv(){_Iv=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new qo({...t,analyticsAction:sR()},m=>{t.dispatch(an({q:m,id:e.id}))}),i=yield oV(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 _Iv.apply(this,arguments)}function Tv(_x70,_x71,_x72){return _Tv.apply(this,arguments)}function _Tv(){_Tv=_asyncToGenerator(function*(e,t,r){_R(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 qo({...t,analyticsAction:r}),f=yield Do(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _Tv.apply(this,arguments)}function Pv(_x73,_x74){return _Pv.apply(this,arguments)}function _Pv(){_Pv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield mv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new qo({...e,analyticsAction:mv()}),p=yield nV(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _Pv.apply(this,arguments)}function iV(_x75,_x76,_x77){return _iV.apply(this,arguments)}function _iV(){_iV=_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 qo({...e,analyticsAction:t}),f=yield aV(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _iV.apply(this,arguments)}function Zp(_x78,_x79,_x80){return _Zp.apply(this,arguments)}function _Zp(){_Zp=_asyncToGenerator(function*(e,t,r){_R(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 Do(e,i),f=new qo({...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 NR=et(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 br=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=Ov(e),o=sV(e),a=cV(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield To(e,r):bs(e,t,r);return Oo({...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:kv(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 br(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function kv(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function sV(e){return fl(lV(e),e.facetOrder??[])}function cV(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(uV).filter(r=>r.currentValues.length>0):void 0}function uV(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function lV(e){return dV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function dV(e){return[...pV(e.facetSet??{}),...DR(e.numericFacetSet??{}),...DR(e.dateFacetSet??{}),...No(e.categoryFacetSet??{})]}function pV(e){return No(e).map(t=>{let r=Ev[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function DR(e){return No(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 Ov(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=NR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var Mo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){pe(this,"config",t);pe(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=qp(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(Po(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)return null;if(!a)return!de(f)&&!de(f.correctedQuery)?_this19.processModernDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!de(f)&&!de(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(lr(Br(_this19.getState()))),x})()}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(Po(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(_o("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this21.dispatch(Po(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 Rd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=RR(),o=yield _this22.fetchFromAPI(yield br(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Cr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Is({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield br(_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 Ts=Ce("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new L,enableQuerySyntax:new fe,clearFilters:new fe}),e.clearFilters&&(r(ft()),r(gs())),r(on({allow:!0})),r(Vt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(sn(1))}),qR=P("search/updateSearchAction"),W=Ce("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);MR(r);let n=e.next?VR(e.next):void 0,o=yield br(r,t.extra.navigatorContext,n),a=new Mo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),jt=Ce("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(MR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Tv(r,t,e.legacy);let n=new Mo({...t,analyticsAction:e.next}),o=yield br(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)}}()),wr=Ce("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Pv(t,r);let n=$w("browseResults",t.getState),o=new Mo({...t,analyticsAction:n}),a=yield fV(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)}}()),Rr=Ce("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 Mo({...t,analyticsAction:{}}),o=yield gV(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)}}()),Ps=Ce("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Iv(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=VR(cR()),i=yield mV(r,t.extra.navigatorContext,n,o,a),p=new Mo({...t,analyticsAction:a},g=>{t.dispatch(an({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)}}()),fV=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield br(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function fV(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),mV=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=bs(e,t,o);return Oo({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function mV(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),gV=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield br(e,t,r);return n.request.numberOfResults=0,n});return function gV(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),MR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},VR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Vo=(e,t)=>{let r=e;return de(r[t])?de(e.raw[t])?null:e.raw[t]:r[t]},hV=e=>t=>e.every(r=>!de(Vo(t,r))),yV=e=>t=>e.every(r=>de(Vo(t,r))),SV=(e,t)=>r=>{let n=jR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},vV=(e,t)=>r=>{let n=jR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},jR=(e,t)=>{let r=Vo(t,e);return md(r)?r:[r]},LR={getResultProperty:Vo,fieldsMustBeDefined:hV,fieldsMustNotBeDefined:yV,fieldMustMatch:SV,fieldMustNotMatch:vV};function ml(e){return e.search.response.searchUid!==""}function UR(e,t,r){return e.search.results.find(n=>Vo(n,t)===r)}var _v=et(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var ks=P("app/setError");function Nv(e,t){let r=t.payload??null;r&&(e.response=ir().response,e.results=[],e.questionAnswer=qi()),e.error=r,e.isLoading=!1}function Dv(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function AV(e,t){Dv(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 QR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function CV(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var he=ae(ir(),e=>{e.addCase(W.rejected,(t,r)=>Nv(t,r)),e.addCase(wr.rejected,(t,r)=>Nv(t,r)),e.addCase(jt.rejected,(t,r)=>Nv(t,r)),e.addCase(W.fulfilled,(t,r)=>{AV(t,r)}),e.addCase(wr.fulfilled,(t,r)=>{Dv(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(jt.fulfilled,(t,r)=>{Dv(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Rr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(W.pending,QR),e.addCase(wr.pending,CV),e.addCase(jt.pending,QR),e.addCase(qR,(t,r)=>{t.searchAction=r.payload}),e.addCase(ks,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var Os=P("searchHub/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var _s=ae(xo(),e=>{e.addCase(Os,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ar,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var BR=class extends Error{constructor(t){super(t[0].message);pe(this,"issues");this.name="SchemaError",this.issues=t}};var Jn="uninitialized",Mv="pending",hl="fulfilled",yl="rejected";function GR(e){return{status:e,isUninitialized:e===Jn,isLoading:e===Mv,isSuccess:e===hl,isError:e===yl}}var $R=Jr;function aF(e,t){if(e===t||!($R(e)&&$R(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]=aF(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function Vv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function xV(e){return new RegExp("(^|:)//").test(e)}function bV(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Qv(e){return e!=null}function HR(e){return[...(e?.values()??[])].filter(Qv)}function wV(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var RV=e=>e.replace(/\/$/,""),FV=e=>e.replace(/^\//,"");function EV(e,t){if(!e)return t;if(!t)return e;if(xV(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=RV(e),t=FV(t),`${e}${r}${t}`}function rf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var jv=()=>new Map,IV=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},TV=(...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},zR=(...e)=>S(...e),PV=e=>e.status>=200&&e.status<=299,kV=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function WR(e){if(!Jr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var OV=e=>typeof e=="object"&&(Jr(e)||Array.isArray(e)||typeof e.toJSON=="function");function iF({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=zR,paramsSerializer:n,isJsonContentType:o=kV,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===zR&&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*(x,h,C){let{getState:b,extra:w,endpoint:R,forced:E,type:I}=h,k,{url:T,headers:D=new A(g.headers),params:G=void 0,responseHandler:U=f??"json",validateStatus:V=m??PV,timeout:B=p,...j}=typeof x=="string"?{url:x}:x,_={...g,signal:B?TV(h.signal,IV(B)):h.signal,...j};D=new A(WR(D)),_.headers=(yield t(D,{getState:b,arg:x,extra:w,endpoint:R,forced:E,type:I,extraOptions:C}))||D;let N=OV(_.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")||(U==="json"?_.headers.set("accept","application/json"):U==="text"&&_.headers.set("accept","text/plain, text/html, */*")),G){let ue=~T.indexOf("?")?"&":"?",ye=n?n(G):new URLSearchParams(WR(G));T+=ue+ye}T=EV(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,U).then(ye=>te=ye,ye=>ue=ye),ne.text().then(ye=>Z=ye,()=>{})]),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*(x,h){if(typeof h=="function")return h(x);if(h==="content-type"&&(h=o(x.headers)?"json":"text"),h==="json"){let C=yield x.text();return C.length?JSON.parse(C):null}return x.text()});return _v2.apply(this,arguments)}}var Ns=class{constructor(e,t=void 0){pe(this,"value");pe(this,"meta");this.value=e,this.meta=t}};function _V(){return _V2.apply(this,arguments)}function _V2(){_V2=_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 _V2.apply(this,arguments)}function sF(e,t){throw Object.assign(new Ns({error:e,meta:t}),{throwImmediately:!0})}function qv(e){e.aborted&&sF({status:"CUSTOM_ERROR",error:"Aborted"})}var KR={},NV=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||KR).maxRetries,(o||KR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:_V,retryCondition:(g,v,{attempt:x})=>x<=i,...t,...o},m=0;for(;;){qv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Ns(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Ns)return g.value;throw g}if(g instanceof Ns){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};qv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(v){throw qv(n.signal),v}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),cF=Object.assign(NV,{fail:sF}),of="__rtkq/",DV="online",qV="offline";var uF="focused";var Bv=P(`${of}${uF}`),lF=P(`${of}un${uF}`),Gv=P(`${of}${DV}`),dF=P(`${of}${qV}`);var Al="query",pF="mutation",fF="infinitequery";function af(e){return e.type===Al}function MV(e){return e.type===pF}function sf(e){return e.type===fF}function nf(e){return af(e)||sf(e)}function $v(e,t,r,n,o,a){let i=VV(e)?e(t,r,n,o):e;return i?Vv(i,Qv,p=>a(mF(p))):[]}function VV(e){return typeof e=="function"}function mF(e){return typeof e=="string"?{type:e}:e}function jV(e,t){return e.catch(t)}var Ds=(e,t)=>e.endpointDefinitions[t],Sl=Symbol("forceQueryFn"),Lv=e=>typeof e[Sl]=="function";function LV({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:x,getRunningMutationThunk:h,getRunningQueriesThunk:C,getRunningMutationsThunk:b};function x(T,D){return G=>{let U=Ds(a,T),V=e({queryArgs:D,endpointDefinition:U,endpointName:T});return p(G)?.get(V)}}function h(T,D){return G=>f(G)?.get(D)}function C(){return T=>HR(p(T))}function b(){return T=>HR(f(T))}function w(T){}function R(T,D){let G=(U,{subscribe:V=!0,forceRefetch:B,subscriptionOptions:j,[Sl]:_,...N}={})=>(q,Y)=>{let H=e({queryArgs:U,endpointDefinition:D,endpointName:T}),ne,te={...N,type:Al,subscribe:V,forceRefetch:B,subscriptionOptions:j,endpointName:T,originalArgs:U,queryCacheKey:H,[Sl]:_};if(af(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(U),ue=q(ne),ye=Z(Y());let{requestId:Ve,abort:Je}=ue,Qe=ye.requestId!==Ve,ze=p(q)?.get(H),We=()=>Z(Y()),Ee=Object.assign(_?ue.then(We):Qe&&!ze?Promise.resolve(ye):Promise.all([ze,ue]).then(We),{arg:U,requestId:Ve,subscriptionOptions:j,queryCacheKey:H,abort:Je,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>q(G(U,{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(!ze&&!Qe&&!_){let Re=p(q);Re.set(H,Ee),Ee.then(()=>{Re.delete(H)})}return Ee};return G}function E(T,D){return R(T,D)}function I(T,D){return R(T,D)}function k(T){return(D,{track:G=!0,fixedCacheKey:U}={})=>(V,B)=>{let j=n({type:"mutation",endpointName:T,originalArgs:D,track:G,fixedCacheKey:U}),_=V(j);let{requestId:N,abort:q,unwrap:Y}=_,H=jV(_.unwrap().then(ue=>({data:ue})),ue=>({error:ue})),ne=()=>{V(g({requestId:N,fixedCacheKey:U}))},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)}),U&&(Z.set(U,te),te.then(()=>{Z.get(U)===te&&Z.delete(U)})),te}}}var gF=class extends BR{constructor(t,r,n,o){super(t);pe(this,"value");pe(this,"schemaName");pe(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},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 gF(o.issues,t,r,n);return o.value});return _Ia.apply(this,arguments)}function YR(e){return e}var gl=(e={})=>({...e,[Ku]:!0});function UV({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 x(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===Jn)return Z;let ue;if("data"in te)if(Kt(te.data)){let[ye,Ve,Je]=yS(te.data,N);Z.patches.push(...Ve),Z.inversePatches.push(...Je),ue=ye}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},C=(j,_,N)=>q=>q(o.endpoints[j].initiate(_,{subscribe:!1,forceRefetch:!0,[Sl]:()=>({data:N})})),b=(j,_)=>j.query&&j[_]?j[_]:YR,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:ye=m}=Z,Ve=j.type===Al;try{let Je=YR,Qe={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},ze=Ve?j[Sl]:void 0,We,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:x;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(ye,"arg")&&(Pe=yield Ia(yt,Pe,"argSchema",{})),ze?Ie=ze():Z.query?(Je=b(Z,"transformResponse"),Ie=yield t(Z.query(Pe),Qe,ut)):Ie=yield Z.queryFn(Pe,Qe,ut,Mr=>t(Mr,Qe,ut)),typeof process<"u",Ie.error)throw new Ns(Ie.error,Ie.meta);let{data:Yr}=Ie;qr&&!Ea(ye,"rawResponse")&&(Yr=yield Ia(qr,Ie.data,"rawResponseSchema",Ie.meta));let mr=yield Je(Yr,Ie.meta,Pe);return ar&&!Ea(ye,"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",cd=(Mr?hF:Uv)(Pe,mr,j.originalArgs);yt=yield Ee(mr,cd,Ie,Mr)}else{let{initialPageParam:Mr=Pe.initialPageParam}=j,Cu=ar?.pageParams??[],cd=Cu[0]??Mr,k_=Cu.length;if(yt=yield Ee(mr,cd,Ie),ze&&(yt={data:yt.data.pages[0]}),ut)for(let zC=1;zC<k_;zC++){let O_=Uv(Pe,yt.data,j.originalArgs);yt=yield Ee(yt.data,O_,Ie)}}We=yt}else We=yield Re(j.originalArgs);return ue&&!Ea(ye,"meta")&&We.meta&&(We.meta=yield Ia(ue,We.meta,"metaSchema",We.meta)),Y(We.data,gl({fulfilledTimeStamp:Date.now(),baseQueryMeta:We.meta}))}catch(Je){let Qe=Je;if(Qe instanceof Ns){let ze=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:We,errorResponseSchema:Ee}=Z,{value:Re,meta:Pe}=Qe;try{We&&!Ea(ye,"rawErrorResponse")&&(Re=yield Ia(We,Re,"rawErrorResponseSchema",Pe)),ue&&!Ea(ye,"meta")&&(Pe=yield Ia(ue,Pe,"metaSchema",Pe));let Ie=yield ze(Re,Pe,j.originalArgs);return Ee&&!Ea(ye,"errorResponse")&&(Ie=yield Ia(Ee,Ie,"errorResponseSchema",Pe)),q(Ie,gl({baseQueryMeta:Pe}))}catch(Ie){Qe=Ie}}try{if(Qe instanceof gF){let ze={endpoint:j.endpointName,arg:j.originalArgs,type:j.type,queryCacheKey:Ve?j.queryCacheKey:void 0};Z.onSchemaFailure?.(Qe,ze),p?.(Qe,ze);let{catchSchemaFailure:We=f}=Z;if(We)return q(We(Qe,ze),gl({baseQueryMeta:Qe._bqMeta}))}}catch(ze){Qe=ze}throw typeof process<"u",console.error(Qe),Qe}});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=()=>Ce(`${e}/executeQuery`,w,{getPendingMeta({arg:_}){let N=r[_.endpointName];return gl({startedTimeStamp:Date.now(),...(sf(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 Lv(_)?!0:Y?.status==="pending"?!1:R(_,q)||af(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ue)},dispatchConditionRejection:!0}),I=E(),k=E(),T=Ce(`${e}/executeMutation`,w,{getPendingMeta(){return gl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,G=j=>"ifOlderThan"in j,U=(j,_,N={})=>(q,Y)=>{let H=D(N)&&N.force,ne=G(N)&&N.ifOlderThan,te=(ue=!0)=>{let ye={forceRefetch:ue,subscribe:!1};return o.endpoints[j].initiate(_,ye)},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 B(j,_){return{matchPending:Qi(zd(j),V(_)),matchFulfilled:Qi(zn(j),V(_)),matchRejected:Qi(Sa(j),V(_))}}return{queryThunk:I,mutationThunk:T,infiniteQueryThunk:k,prefetch:U,updateQueryData:h,upsertQueryData:C,patchQueryData:g,buildMatchThunkActions:B}}function Uv(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function hF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function yF(e,t,r,n){return $v(r[e.meta.arg.endpointName][t],zn(e)?e.payload:void 0,Ju(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function JR(e){return Wt(e)?Ld(e):e}function ef(e,t,r){let n=e[t];n&&r(n)}function vl(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function XR(e,t,r){let n=e[vl(t)];n&&r(n)}var tf={};function QV({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,B,j,_){var N;V[N=B.queryCacheKey]??(V[N]={status:Jn,endpointName:B.endpointName}),ef(V,B.queryCacheKey,q=>{q.status=Mv,q.requestId=j&&q.requestId?q.requestId:_.requestId,B.originalArgs!==void 0&&(q.originalArgs=B.originalArgs),q.startedTimeStamp=_.startedTimeStamp;let Y=o[_.arg.endpointName];sf(Y)&&"direction"in B&&(q.direction=B.direction)})}function x(V,B,j,_){ef(V,B.arg.queryCacheKey,N=>{if(N.requestId!==B.requestId&&!_)return;let{merge:q}=o[B.arg.endpointName];if(N.status=hl,q){if(N.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=B,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[B.arg.endpointName].structuralSharing??!0?aF(Wt(N.data)?tb(N.data):N.data,j):j;delete N.error,N.fulfilledTimeStamp=B.fulfilledTimeStamp})}let h=va({name:`${e}/queries`,initialState:tf,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:B}}){delete V[B]},prepare:Bi()},cacheEntriesUpserted:{reducer(V,B){for(let j of B.payload){let{queryDescription:_,value:N}=j;v(V,_,!0,{arg:_,requestId:B.meta.requestId,startedTimeStamp:B.meta.timestamp}),x(V,{arg:_,requestId:B.meta.requestId,fulfilledTimeStamp:B.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:V=>({payload:V.map(_=>{let{endpointName:N,arg:q,value:Y}=_,H=o[N];return{queryDescription:{type:Al,endpointName:N,originalArgs:_.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:N})},value:Y}}),meta:{[Ku]:!0,requestId:Xu(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:B,patches:j}}){ef(V,B,_=>{_.data=SS(_.data,j.concat())})},prepare:Bi()}},extraReducers(V){V.addCase(t.pending,(B,{meta:j,meta:{arg:_}})=>{let N=Lv(_);v(B,_,N,j)}).addCase(t.fulfilled,(B,{meta:j,payload:_})=>{let N=Lv(j.arg);x(B,j,_,N)}).addCase(t.rejected,(B,{meta:{condition:j,arg:_,requestId:N},error:q,payload:Y})=>{ef(B,_.queryCacheKey,H=>{if(!j){if(H.requestId!==N)return;H.status=yl,H.error=Y??q}})}).addMatcher(p,(B,j)=>{let{queries:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===hl||q?.status===yl)&&(B[N]=q)})}}),C=va({name:`${e}/mutations`,initialState:tf,reducers:{removeMutationResult:{reducer(V,{payload:B}){let j=vl(B);j in V&&delete V[j]},prepare:Bi()}},extraReducers(V){V.addCase(r.pending,(B,{meta:j,meta:{requestId:_,arg:N,startedTimeStamp:q}})=>{N.track&&(B[vl(j)]={requestId:_,status:Mv,endpointName:N.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(B,{payload:j,meta:_})=>{_.arg.track&&XR(B,_,N=>{N.requestId===_.requestId&&(N.status=hl,N.data=j,N.fulfilledTimeStamp=_.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:j,error:_,meta:N})=>{N.arg.track&&XR(B,N,q=>{q.requestId===N.requestId&&(q.status=yl,q.error=j??_)})}).addMatcher(p,(B,j)=>{let{mutations:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===hl||q?.status===yl)&&N!==q?.requestId&&(B[N]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(V,B){var j,_,N;for(let{queryCacheKey:q,providedTags:Y}of B.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:Bi()}},extraReducers(V){V.addCase(h.actions.removeQueryResult,(B,{payload:{queryCacheKey:j}})=>{R(B,j)}).addMatcher(p,(B,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=B.tags)[H]??(N[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let ye of Z)ue.includes(ye)||ue.push(ye),B.keys[ye]=_.keys[ye]}}).addMatcher(Xr(zn(t),Ju(t)),(B,j)=>{E(B,[j])}).addMatcher(h.actions.cacheEntriesUpserted.match,(B,j)=>{let _=j.payload.map(({queryDescription:N,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));E(B,_)})}});function R(V,B){let j=JR(V.keys[B]??[]);for(let _ of j){let N=_.type,q=_.id??"__internal_without_id",Y=V.tags[N]?.[q];Y&&(V.tags[N][q]=JR(Y).filter(H=>H!==B))}delete V.keys[B]}function E(V,B){let j=B.map(_=>{let N=yF(_,"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:tf,reducers:{updateSubscriptionOptions(V,B){},unsubscribeQueryResult(V,B){},internal_getRTKQSubscriptions(){}}}),k=va({name:`${e}/internalSubscriptions`,initialState:tf,reducers:{subscriptionsUpdated:{reducer(V,B){return SS(V,B.payload)},prepare:Bi()}}}),T=va({name:`${e}/config`,initialState:{online:wV(),focused:bV(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:B}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:V=>{V.addCase(Gv,B=>{B.online=!0}).addCase(dF,B=>{B.online=!1}).addCase(Bv,B=>{B.focused=!0}).addCase(lF,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),D=ji({queries:h.reducer,mutations:C.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(V,B)=>D(g.match(B)?void 0:V,B),U={...T.actions,...h.actions,...I.actions,...k.actions,...C.actions,...w.actions,resetApiState:g};return{reducer:G,actions:U}}var Ta=Symbol.for("RTKQ/skipToken"),SF={status:Jn},ZR=ha(SF,()=>{}),eF=ha(SF,()=>{});function BV({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>ZR,o=I=>eF;return{buildQuerySelector:x,buildInfiniteQuerySelector:h,buildMutationSelector:C,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(I){return{...I,...GR(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 G=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(V=>f(V,G)??ZR,T)}}function x(I,k){return v(I,k,a)}function h(I,k){let{infiniteQueryOptions:T}=k;function D(G){let U={...G,...GR(G.status)},{isLoading:V,isError:B,direction:j}=U,_=j==="forward",N=j==="backward";return{...U,hasNextPage:R(T,U.data,U.originalArgs),hasPreviousPage:E(T,U.data,U.originalArgs),isFetchingNextPage:V&&_,isFetchingPreviousPage:V&&N,isFetchNextPageError:B&&_,isFetchPreviousPageError:B&&N}}return v(I,k,D)}function C(){return I=>{let k;return typeof I=="object"?k=vl(I)??Ta:k=I,r(k===Ta?o:G=>i(G)?.mutations?.[k]??eF,a)}}function b(I,k){let T=I[t],D=new Set,G=Vv(k,Qv,mF);for(let U of G){let V=T.provided.tags[U.type];if(!V)continue;let B=(U.id!==void 0?V[U.id]:Object.values(V).flat())??[];for(let j of B)D.add(j)}return Array.from(D.values()).flatMap(U=>{let V=T.queries[U];return V?{queryCacheKey:U,endpointName:V.endpointName,originalArgs:V.originalArgs}:[]})}function w(I,k){return Vv(Object.values(p(I)),T=>T?.endpointName===k&&T.status!==Jn,T=>T.originalArgs)}function R(I,k,T){return k?Uv(I,k,T)!=null:!1}function E(I,k,T){return!k||!I.getPreviousPageParam?!1:hF(I,k,T)!=null}}var tF=WeakMap?new WeakMap:void 0,rF=({endpointName:e,queryArgs:t})=>{let r="",n=tF?.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=Jr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Jr(t)&&tF?.set(t,o),r=o}return`${e}(${r})`};function GV(...e){return function(r){let n=zu(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=rF;if("serializeQueryArgs"in m.endpointDefinition){let v=m.endpointDefinition.serializeQueryArgs;g=x=>{let h=v(x);return typeof h=="string"?h:rF({...x,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Xu(),extractRehydrationInfo:n,hasRehydrationInfo:zu(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,x]of Object.entries(g))typeof x=="function"?x(Ds(a,v)):Object.assign(Ds(a,v)||{},x);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:v=>({...v,type:Al}),mutation:v=>({...v,type:pF}),infiniteQuery:v=>({...v,type:fF})});for(let[v,x]of Object.entries(g)){if(m.overrideExisting!==!0&&v in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Yt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[v]=x;for(let h of p)h.injectEndpoint(v,x)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Yn(e,...t){return Object.assign(e,...t)}var $V=({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=rf(b,E.queryCacheKey,jv);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=rf(b,I.queryCacheKey,jv);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 C(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,R])=>[w,Object.fromEntries(R)]))))}return(b,w)=>{if(a||(a=C(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=C(r.currentSubscriptions),[,D]=yS(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]}},HV=2147483647/1e3-1,zV=({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,x=Xr(g.match,r.fulfilled,r.rejected,v.match);function h(I){let k=o.currentSubscriptions.get(I);return k?k.size>0:!1}let C={};function b(I){for(let k of I.values())k?.abort?.()}let w=(I,k)=>{let T=k.getState(),D=i(T);if(x(I)){let G;if(v.match(I))G=I.payload.map(U=>U.queryDescription.queryCacheKey);else{let{queryCacheKey:U}=g.match(I)?I.payload:I.meta.arg;G=[U]}R(G,k,D)}if(t.util.resetApiState.match(I)){for(let[G,U]of Object.entries(C))U&&clearTimeout(U),delete C[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:G}=n.extractRehydrationInfo(I);R(Object.keys(G),k,D)}};function R(I,k,T){let D=k.getState();for(let G of I){let U=a(D,G);U?.endpointName&&E(G,U.endpointName,k,T)}}function E(I,k,T,D){let U=Ds(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(U===1/0)return;let V=Math.max(0,Math.min(U,HV));if(!h(I)){let B=C[I];B&&clearTimeout(B),C[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 C[I]},V*1e3)}}return w},nF=new Error("Promise never resolved before cacheEntryRemoved."),WV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Wd(n),m=Wd(o),g=zn(n,o),v={},{removeQueryResult:x,removeMutationResult:h,cacheEntriesUpserted:C}=e.internalActions;function b(T,D,G){let U=v[T];U?.valueResolved&&(U.valueResolved({data:D,meta:G}),delete U.valueResolved)}function w(T){let D=v[T];D&&(delete v[T],D.cacheEntryRemoved())}function R(T){let{arg:D,requestId:G}=T.meta,{endpointName:U,originalArgs:V}=D;return[U,V,G]}let E=(T,D,G)=>{let U=I(T);function V(B,j,_,N){let q=i(G,j),Y=i(D.getState(),j);!q&&Y&&k(B,N,j,D,_)}if(n.pending.match(T)){let[B,j,_]=R(T);V(B,U,_,j)}else if(C.match(T))for(let{queryDescription:B,value:j}of T.payload){let{endpointName:_,originalArgs:N,queryCacheKey:q}=B;V(_,q,T.meta.requestId,N),b(q,j,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[U]){let[j,_,N]=R(T);k(j,_,U,D,N)}}else if(g(T))b(U,T.payload,T.meta.baseQueryMeta);else if(x.match(T)||h.match(T))w(U);else if(e.util.resetApiState.match(T))for(let B of Object.keys(v))w(B)};function I(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:x.match(T)?T.payload.queryCacheKey:h.match(T)?vl(T.payload):""}function k(T,D,G,U,V){let B=Ds(r,T),j=B?.onCacheEntryAdded;if(!j)return;let _={},N=new Promise(Z=>{_.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{_.valueResolved=Z}),N.then(()=>{throw nF})]);q.catch(()=>{}),v[G]=_;let Y=e.endpoints[T].select(nf(B)?D:G),H=U.dispatch((Z,ue,ye)=>ye),ne={...U,getCacheEntry:()=>Y(U.getState()),requestId:V,extra:H,updateCachedData:nf(B)?Z=>U.dispatch(e.util.updateQueryData(T,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:N},te=j(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==nF)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"},YV=({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=Xr(zn(n),Ju(n)),v=Xr(zn(o,n),Sa(o,n)),x=[],h=0,C=(R,E)=>{(o.pending.match(R)||n.pending.match(R))&&h++,v(R)&&(h=Math.max(0,h-1)),g(R)?w(yF(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(x.push(...R),k.config.invalidationBehavior==="delayed"&&b())return;let T=x;if(x=[],T.length===0)return;let D=a.util.selectInvalidatedBy(I,T);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:U}of G){let V=k.queries[U],B=rf(f.currentSubscriptions,U,jv);V&&(B.size===0?E.dispatch(m({queryCacheKey:U})):V.status!==Jn&&E.dispatch(p(V)))}})}return C},JV=({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)&&(C(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,R){p.add(w),f||(f=setTimeout(()=>{for(let E of p)x({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===Jn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=b(k);if(!Number.isFinite(T))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let U=Date.now()+T;a.set(w,{nextPollTimestamp:U,pollingInterval:T,timeout:setTimeout(()=>{(E.config.focused||!D)&&R.dispatch(n(I)),v({queryCacheKey:w},R)},T)})}function x({queryCacheKey:w},R){let I=R.getState()[e].queries[w],k=i.get(w);if(!I||I.status===Jn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){h(w);return}let D=a.get(w),G=Date.now()+T;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:w},R)}function h(w){let R=a.get(w);R?.timeout&&clearTimeout(R.timeout),a.delete(w)}function C(){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},XV=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=zd(r,n),a=Sa(r,n),i=zn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:v,arg:{endpointName:x,originalArgs:h}}=m.meta,C=Ds(t,x),b=C?.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[x].select(nf(C)?h:v),I=g.dispatch((T,D,G)=>G),k={...g,getCacheEntry:()=>E(g.getState()),requestId:v,extra:I,updateCachedData:nf(C)?T=>g.dispatch(e.util.updateQueryData(x,h,T)):void 0,queryFulfilled:R};b(h,k)}}else if(i(m)){let{requestId:v,baseQueryMeta:x}=m.meta;p[v]?.resolve({data:m.payload,meta:x}),delete p[v]}else if(a(m)){let{requestId:v,rejectedWithValue:x,baseQueryMeta:h}=m.meta;p[v]?.reject({error:m.payload??m.error,isUnhandledError:!x,meta:h}),delete p[v]}}},ZV=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{Bv.match(f)&&p(m,"refetchOnFocus"),Gv.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],v=g.queries,x=o.currentSubscriptions;t.batch(()=>{for(let h of x.keys()){let C=v[h],b=x.get(h);if(!b||!C)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})):C.status!==Jn&&f.dispatch(n(C)))}})}return i};function ej(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:P(`${t}/invalidateTags`)},f=x=>x.type.startsWith(`${t}/`),m=[KV,zV,YV,JV,WV,XV];return{middleware:x=>{let h=!1,C=a(x.dispatch),b={...e,internalState:C,refetchQuery:v,isThisApiSliceAction:f,mwApi:x},w=m.map(I=>I(b)),R=$V(b),E=ZV(b);return I=>k=>{if(!Nu(k))return I(k);h||(h=!0,x.dispatch(n.internalActions.middlewareRegistered(i)));let T={...x,next:I},D=x.getState(),[G,U]=R(k,T,D),V;if(G?V=I(k):V=U,x.getState()[t]&&(E(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,D);return V}},actions:p};function v(x){return e.api.endpoints[x.endpointName].initiate(x.originalArgs,{subscribe:!1,forceRefetch:!0})}}var oF=Symbol(),tj=({createSelector:e=et}={})=>({name:oF,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:x,skipSchemaValidation:h},C){cb();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Gv,onOffline:dF,onFocus:Bv,onFocusLost:lF},util:{}});let w=BV({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:G,mutationThunk:U,patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,buildMatchThunkActions:N}=UV({baseQuery:r,reducerPath:o,context:C,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:v,catchSchemaFailure:x,skipSchemaValidation:h}),{reducer:q,actions:Y}=QV({context:C,queryThunk:D,infiniteQueryThunk:G,mutationThunk:U,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:B,upsertQueryData:j,prefetch:_,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Yn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>rf(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ue,getRunningMutationThunk:ye,getRunningMutationsThunk:Ve,getRunningQueriesThunk:Je,getRunningQueryThunk:Qe}=LV({queryThunk:D,mutationThunk:U,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:C,getInternalState:ne});Yn(t.util,{getRunningMutationThunk:ye,getRunningMutationsThunk:Ve,getRunningQueryThunk:Qe,getRunningQueriesThunk:Je});let{middleware:ze,actions:We}=ej({reducerPath:o,context:C,queryThunk:D,mutationThunk:U,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Qe,getInternalState:ne});return Yn(t.util,We),Yn(t,{reducer:q,middleware:ze}),{name:oF,injectEndpoint(Ee,Re){var ut;let Ie=(ut=t.endpoints)[Ee]??(ut[Ee]={});af(Re)&&Yn(Ie,{name:Ee,select:I(Ee,Re),initiate:te(Ee,Re)},N(D,Ee)),MV(Re)&&Yn(Ie,{name:Ee,select:T(),initiate:ue(Ee)},N(U,Ee)),sf(Re)&&Yn(Ie,{name:Ee,select:k(Ee,Re),initiate:Z(Ee,Re)},N(D,Ee))}}}}),vF=GV(tj());d();c();l();u();d();c();l();u();var Pa=e=>e.query,AF=e=>e.query?.enableQuerySyntax;var CF=et(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})),cf=et(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var uf=e=>{if(e==="yes")return!0;if(e==="no")return!1},rj=()=>J("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function lf(e,t){return J({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??Ue(n),a=ns(n,e);if(!o||!a)return null;let i=bo(n);return r.makeGeneratedAnswerCitationClick(zw(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:Yw(a),...(i&&{conversationId:i})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=ns(r,e);return{answerId:t??Ue(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function nj(e,t,r){return J({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??Ue(o),i=ns(o,e);if(!a||!i)return null;let p=bo(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t,...(p&&{conversationId:p})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=ns(n,e);return{answerId:r??Ue(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function oj(e,t){return J({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function aj(e){return J({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"like"})})}function ij(e){return J({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"dislike"})})}var sj=e=>J({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Ue(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Ue(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:uf(o),documented:uf(a),correctTopic:uf(p),hallucinationFree:uf(i)},additionalNotes:m,correctAnswerUrl:f}}}),Xn=(e,t,r)=>J({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??Ue(o);if(!a)return null;let i=bo(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:r,...(i&&{conversationId:i})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??Ue(n)??"",answerGenerated:e??!1})}),jo=e=>J({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),cj=()=>J({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"show"})}),uj=()=>J({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"hide"})}),lj=()=>J({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"expand"})}),dj=()=>J({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"collapse"})});function pj(e){return J({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"copyToClipboard"})})}function Hv(e,t){return J({prefix:"analytics/generatedAnswer/openFollowUpAnswerSource",__legacy__getBuilder:(r,n)=>{let o=ns(n,e);if(!o)return null;let a=bo(n);return a?r.makeGeneratedAnswerFollowupOpenSource({...Ww(o,n),generativeQuestionAnsweringId:t,citationId:o.id,permanentId:o.permanentid,conversationId:a}):null}})}var qs={logCopyGeneratedAnswer:pj,logGeneratedAnswerHideAnswers:uj,logGeneratedAnswerShowAnswers:cj,logGeneratedAnswerStreamEnd:Xn,logGeneratedAnswerFeedback:sj,logDislikeGeneratedAnswer:ij,logLikeGeneratedAnswer:aj,logGeneratedAnswerOpenInlineLink:oj,logHoverCitation:nj,logOpenGeneratedAnswerSource:lf,logOpenGeneratedAnswerFollowUpSource:Hv,logRetryGeneratedAnswer:rj,logGeneratedAnswerExpand:lj,logGeneratedAnswerCollapse:dj};d();c();l();u();d();c();l();u();var xF=et(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 zv=e=>e.context;d();c();l();u();var Wv=e=>e.pipeline;d();c();l();u();var Kv=e=>e.searchHub;d();c();l();u();var Lt=et(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),Tie=et(e=>e,e=>{let t=Lt(e);return t&&e?e[t].expression:""});d();c();l();u();var bF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var wF=e=>e.excerptLength?.length;d();c();l();u();var un=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,RF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var FF=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 EF=e=>e.sortCriteria;var IF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Vi(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function IF(_x126){return _ref45.apply(this,arguments)}}(),TF=(e,t)=>{let r=Pa(e)?.q,{aq:n,cq:o,dq:a,lq:i}=OF(e),p=zv(e),f=Ur(e.configuration.analytics,t,{actionCause:_v(e)}),m=Kv(e),g=Wv(e),v=nv(e)??[],x=kF(e),h=Lt(e.tabSet)||"default",C=tv(e),b=Nw(e),w=t.referrer||"",R=RF(e),E=EF(e),I=fj(e),k=wF(e),T=FF(e),D=bF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:AF(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(x.length&&{facets:x}),...(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:kv(e),firstResult:e.pagination.firstResult}),tab:h,locale:C,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})}},PF=(e,t)=>{let r=Pa(e)?.q,n=kF(e),o=Ur(e.configuration.analytics,t,{actionCause:_v(e)}),a=tv(e),i=Lt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=OF(e),g=Kv(e),v=Wv(e),x=zv(e),h=nv(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(x?.contextValues&&{context:x.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},kF=e=>Xp(e)?.map(t=>wv(t,bv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),fj=e=>({actionsHistory:e.configuration.analytics.enabled?Xt.getInstance().getHistory():[]}),OF=e=>{let t=xF(e),r=Ov(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var df=["searching","thinking","answering"];function pf(e){return e.toLowerCase()}var ff=["search","generic"];function Yv(){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 _F=["text/plain","text/markdown"];var Ms=new L({required:!0}),NF=new L,Vs=new fe({required:!0}),Jv={id:Ms,title:Ms,uri:Ms,permanentid:Ms,clickUri:NF},mf=new L({required:!0,constrainTo:_F}),DF=new L({required:!0,constrainTo:df}),qF=e=>({...e,name:pf(e.name)}),js=P("generatedAnswer/setIsVisible",e=>O(e,Vs)),Ls=P("generatedAnswer/setAnswerId",e=>O(e,z)),gf=P("generatedAnswer/setAnswerGenerationMode",e=>O(e,new L({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Cl=P("generatedAnswer/setIsEnabled",e=>O(e,Vs)),Oa=P("generatedAnswer/updateMessage",e=>O(e,{textDelta:Ms})),_a=P("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new X({values:Jv})})})),Na=P("generatedAnswer/updateError",e=>O(e,{message:NF,code:new re({min:0})})),dr=P("generatedAnswer/resetAnswer"),hf=P("generatedAnswer/like"),yf=P("generatedAnswer/dislike"),Sf=P("generatedAnswer/feedbackModal/open"),xl=P("generatedAnswer/expand"),vf=P("generatedAnswer/collapse"),Af=P("generatedAnswer/setId",e=>O(e,{id:new L({required:!0})})),Cf=P("generatedAnswer/feedbackModal/close"),Us=P("generatedAnswer/sendFeedback"),ln=P("generatedAnswer/setIsLoading",e=>O(e,Vs)),ka=P("generatedAnswer/setIsStreaming",e=>O(e,Vs)),Da=P("generatedAnswer/setAnswerContentFormat",e=>O(e,mf)),xf=P("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:mf,default:["text/plain"]})})),bf=P("knowledge/updateAnswerConfigurationId",e=>O(e,Ms)),wf=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,Fd)),bl=P("generatedAnswer/setIsAnswerGenerated",e=>O(e,Vs)),qa=P("generatedAnswer/setCannotAnswer",e=>O(e,Vs)),Xv=P("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new X({}))),Rf=P("generatedAnswer/startStep",e=>O(qF(e),{name:DF,startedAt:new re({min:0,required:!0})})),Ff=P("generatedAnswer/finishStep",e=>O(qF(e),{name:DF,finishedAt:new re({min:0,required:!0})})),Ef=P("generatedAnswer/startToolCall",e=>O(e,{toolCallName:z,startedAt:new re({min:0,required:!0}),toolCallId:z})),If=P("generatedAnswer/finishToolCall",e=>O(e,{finishedAt:new re({min:0,required:!0}),toolCallId:z})),Qs=P("generatedAnswer/toolCallArgs",e=>O(e,{toolCallId:z,args:new X({options:{required:!0}}),type:new L({required:!0,constrainTo:ff})})),MF=Ce("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 IF(r),g=(h,C)=>{switch(h){case"genqa.headerMessageType":{let b=JSON.parse(C);n(Da(b.contentFormat));break}case"genqa.messageType":n(Oa(JSON.parse(C)));break;case"genqa.citationsType":n(_a(JSON.parse(C)));break;case"genqa.endOfStreamType":{let b=JSON.parse(C).answerGenerated,{answerId:w,answer:R}=a().generatedAnswer,I=p.length!==0&&!b,k=!R?.trim();n(qa(I)),n(ka(!1)),n(bl(b)),n(Xn(b,w,b?k:void 0)),n(jo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(ln(!0));let v=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,x=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{v(m)&&(n(ln(!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())}});x?f(x):n(ln(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),Tf=Ce("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=TF(a,n);r(Xv(i)),yield r(Pf(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 mj=/*#__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=Vi(n.configuration.search?.apiBaseUrl,i,a);return iF({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,x={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(h=>{x[h]=g[h]}),x.duplex="half",x.body=yield g.text(),S(v,x)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function mj(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),kf=vF({reducerPath:"answer",baseQuery:cF(mj,{maxRetries:3}),endpoints:()=>({})});var gj=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},hj=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(e.answer=n?.trim()?n.concat(r):r)},yj=(e,t)=>{e.citations=t.citations},Sj=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},vj=(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})`)},Aj=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&vj(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(gj(t,o),r(Da(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(hj(t,o),r(Oa({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(yj(t,o),r(_a({citations:o.citations})));break;case"genqa.endOfStreamType":{Sj(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.trim():void 0;r(Xn(i,a,p)),r(jo());break}}},Cj=(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=kf.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,x=Vi(i.search.apiBaseUrl,m,g),h=Cj(x,m,p.answerConfigurationId,f?.insightId);yield Sd(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*(C){let b=C.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(Ls(b))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:C=>{o(b=>{Aj(C,b,a)})},onerror:C=>{throw C},onclose:()=>{o(C=>{a(qa(!C.generated))})}})}).apply(this,arguments)}})})}),Pf=e=>Ma.endpoints.getAnswer.initiate(e),Zv=e=>{let t=cf(e);return Ma.endpoints.getAnswer.select(t??Ta)(e)};d();c();l();u();var VF=ae(Ao,e=>e);d();c();l();u();function xj(e){let t=e.payload?.analyticsAction;return jF(e)&&!de(t)}function jF(e){return"type"in e}var LF=e=>t=>r=>{let n;xj(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return jF(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 Bs=P("tab/register",e=>{let t=new X({values:{id:z,expression:Ge}});return O(e,t)}),ht=P("tab/updateActiveTab",e=>O(e,z));d();c();l();u();var Of=Vr(_p(),1),BF=Vr(UF(),1),GF=Vr(QF(),1);Of.default.extend(GF.default);Of.default.extend(BF.default);var Gs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Of.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 bj=/(^|; )Coveo-Pendragon=([^;]*)/,wj=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function $F(){return typeof window>"u"?!1:bj.exec(document.cookie)?.pop()||null}function HF(){return typeof window>"u"?!1:wj.test(document.cookie)}var _f=ae(Gs(),e=>e.addCase(nn,(t,r)=>{Rj(t,r.payload)}).addCase(Ar,(t,r)=>{Fj(t,r.payload)}).addCase(Fo,(t,r)=>{Ej(t,r.payload)}).addCase(cs,t=>{t.analytics.enabled=!1}).addCase(us,t=>{t.analytics.enabled=!0}).addCase(Ep,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Ip,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(ht,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ls,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{de(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Tp,(t,{payload:r})=>{Ij(t,r)}));function Rj(e,t){de(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",de(t.organizationId)||(e.organizationId=t.organizationId)}function Fj(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 Ej(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=$F();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 Ij(e,t){e.knowledge.agentId=t;try{let r=HF();de(r)||(e.knowledge.debugAgentSession=!0)}catch{}}var me=_f;d();c();l();u();function Tj(e){return e.instantlyCallable}var zF=()=>e=>t=>e(Tj(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 Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function WF(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 oA,Pj=new Uint8Array(16);function aA(){if(!oA){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");oA=crypto.getRandomValues.bind(crypto)}return oA(Pj)}d();c();l();u();d();c();l();u();var kj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),iA={randomUUID:kj};function Oj(e,t,r){if(iA.randomUUID&&!t&&!e)return iA.randomUUID();e=e||{};let n=e.random??e.rng?.()??aA();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 WF(n)}var Lo=Oj;d();c();l();u();d();c();l();u();var F={};bu(F,{BRAND:()=>oL,DIRTY:()=>Va,EMPTY_PATH:()=>qj,INVALID:()=>xe,NEVER:()=>QL,OK:()=>Ut,ParseStatus:()=>Dt,Schema:()=>ke,ZodAny:()=>Bo,ZodArray:()=>ro,ZodBigInt:()=>La,ZodBoolean:()=>Ua,ZodBranded:()=>Rl,ZodCatch:()=>Xa,ZodDate:()=>Qa,ZodDefault:()=>Ja,ZodDiscriminatedUnion:()=>qf,ZodEffects:()=>Ir,ZodEnum:()=>Ka,ZodError:()=>tr,ZodFirstPartyTypeKind:()=>be,ZodFunction:()=>Vf,ZodIntersection:()=>Ha,ZodIssueCode:()=>ee,ZodLazy:()=>za,ZodLiteral:()=>Wa,ZodMap:()=>Ys,ZodNaN:()=>Xs,ZodNativeEnum:()=>Ya,ZodNever:()=>Gr,ZodNull:()=>Ga,ZodNullable:()=>fn,ZodNumber:()=>ja,ZodObject:()=>rr,ZodOptional:()=>Fr,ZodParsedType:()=>le,ZodPipeline:()=>Fl,ZodPromise:()=>Go,ZodReadonly:()=>Za,ZodRecord:()=>Mf,ZodSchema:()=>ke,ZodSet:()=>Js,ZodString:()=>Qo,ZodSymbol:()=>Ws,ZodTransformer:()=>Ir,ZodTuple:()=>pn,ZodType:()=>ke,ZodUndefined:()=>Ba,ZodUnion:()=>$a,ZodUnknown:()=>to,ZodVoid:()=>Ks,addIssueToContext:()=>ce,any:()=>fL,array:()=>yL,bigint:()=>cL,boolean:()=>aE,coerce:()=>UL,custom:()=>rE,date:()=>uL,datetimeRegex:()=>eE,defaultErrorMap:()=>Zn,discriminatedUnion:()=>CL,effect:()=>_L,enum:()=>PL,function:()=>EL,getErrorMap:()=>$s,getParsedType:()=>dn,instanceof:()=>iL,intersection:()=>xL,isAborted:()=>Nf,isAsync:()=>Hs,isDirty:()=>Df,isValid:()=>Uo,late:()=>aL,lazy:()=>IL,literal:()=>TL,makeIssue:()=>wl,map:()=>RL,nan:()=>sL,nativeEnum:()=>kL,never:()=>gL,null:()=>pL,nullable:()=>DL,number:()=>oE,object:()=>SL,objectUtil:()=>sA,oboolean:()=>LL,onumber:()=>jL,optional:()=>NL,ostring:()=>VL,pipeline:()=>ML,preprocess:()=>qL,promise:()=>OL,quotelessJson:()=>_j,record:()=>wL,set:()=>FL,setErrorMap:()=>Dj,strictObject:()=>vL,string:()=>nE,symbol:()=>lL,transformer:()=>_L,tuple:()=>bL,undefined:()=>dL,union:()=>AL,unknown:()=>mL,util:()=>De,void:()=>hL});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 sA;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(sA||(sA={}));var le=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dn=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"]),_j=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),tr=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()}};tr.create=e=>new tr(e);var Nj=(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=Nj;var KF=Zn;function Dj(e){KF=e}function $s(){return KF}d();c();l();u();var wl=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}},qj=[];function ce(e,t){let r=$s(),n=wl({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 Dt=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 xe;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 xe;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}}},xe=Object.freeze({status:"aborted"}),Va=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),Nf=e=>e.status==="aborted",Df=e=>e.status==="dirty",Uo=e=>e.status==="valid",Hs=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ge||(ge={}));var Er=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}},YF=(e,t)=>{if(Uo(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 tr(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 dn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:dn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:dn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Hs(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:dn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return YF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:dn(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Uo(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=>Uo(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:dn(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Hs(o)?o:Promise.resolve(o);return YF(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 Ir({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 Fr.create(this,this._def)}nullable(){return fn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return Go.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 Ir({...Te(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Te(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new Rl({typeName:be.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Xa({...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 Fl.create(this,t)}readonly(){return Za.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Mj=/^c[^\s-]{8,}$/i,Vj=/^[0-9a-z]+$/,jj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Lj=/^[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,Uj=/^[a-z0-9_-]{21}$/i,Qj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Bj=/^[-+]?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)?)??$/,Gj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$j="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",cA,Hj=/^(?:(?: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])$/,zj=/^(?:(?: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])$/,Wj=/^(([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]))$/,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]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Jj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,XF="((\\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])))",Xj=new RegExp(`^${XF}$`);function ZF(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 Zj(e){return new RegExp(`^${ZF(e)}$`)}function eE(e){let t=`${XF}T${ZF(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 eL(e,t){return!!((t==="v4"||!t)&&Hj.test(e)||(t==="v6"||!t)&&Wj.test(e))}function tL(e,t){if(!Qj.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 rL(e,t){return!!((t==="v4"||!t)&&zj.test(e)||(t==="v6"||!t)&&Kj.test(e))}var Qo=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}),xe}let n=new Dt,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")Gj.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")cA||(cA=new RegExp($j,"u")),cA.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")Lj.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")Uj.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")Mj.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")Vj.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")jj.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"?eE(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"?Xj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Zj(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"?Bj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?eL(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"?tL(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"?rL(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"?Yj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Jj.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,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.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,...ge.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,...ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ge.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ge.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ge.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ge.errToObj(r)})}nonempty(t){return this.min(1,ge.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}};Qo.create=e=>new Qo({checks:[],typeName:be.ZodString,coerce:e?.coerce??!1,...Te(e)});function nL(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}),xe}let n,o=new Dt;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"?nL(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,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.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 Dt;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}),xe}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.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:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.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}),xe}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}),xe}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_date}),xe}let n=new Dt,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:ge.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ge.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 Ws=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}),xe}return Ut(t.data)}};Ws.create=e=>new Ws({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}),xe}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}),xe}return Ut(t.data)}};Ga.create=e=>new Ga({typeName:be.ZodNull,...Te(e)});var Bo=class extends ke{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}};Bo.create=e=>new Bo({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}),xe}};Gr.create=e=>new Gr({typeName:be.ZodNever,...Te(e)});var Ks=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}),xe}return Ut(t.data)}};Ks.create=e=>new Ks({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}),xe;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 Er(r,i,r.path,p)))).then(i=>Dt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Er(r,i,r.path,p)));return Dt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ge.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ge.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 zs(e){if(e instanceof rr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Fr.create(zs(n))}return new rr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:zs(e.element)}):e instanceof Fr?Fr.create(zs(e.unwrap())):e instanceof fn?fn.create(zs(e.unwrap())):e instanceof pn?pn.create(e.items.map(t=>zs(t))):e}var rr=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}),xe}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 Er(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 Er(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,x=yield g.value;m.push({key:v,value:x,alwaysSet:g.alwaysSet})}return m})).then(m=>Dt.mergeObjectSync(n,m)):Dt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return ge.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:ge.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 zs(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 Fr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return tE(De.objectKeys(this.shape))}};rr.create=(e,t)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});rr.strictCreate=(e,t)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:Gr.create(),typeName:be.ZodObject,...Te(t)});rr.lazycreate=(e,t)=>new rr({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 tr(p.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:i}),xe}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 tr(f));return ce(r,{code:ee.invalid_union,unionErrors:p}),xe}}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 Ir?eo(e.innerType()):e instanceof Wa?[e.value]:e instanceof Ka?e.options:e instanceof Ya?De.objectValues(e.enum):e instanceof Ja?eo(e._def.innerType):e instanceof Ba?[void 0]:e instanceof Ga?[null]:e instanceof Fr?[void 0,...eo(e.unwrap())]:e instanceof fn?[null,...eo(e.unwrap())]:e instanceof Rl||e instanceof Za?eo(e.unwrap()):e instanceof Xa?eo(e._def.innerType):[],qf=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}),xe;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]}),xe)}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 uA(e,t){let r=dn(e),n=dn(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=uA(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=uA(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(Nf(a)||Nf(i))return xe;let p=uA(a.value,i.value);return p.valid?((Df(a)||Df(i))&&r.dirty(),{status:r.value,value:p.data}):(ce(n,{code:ee.invalid_intersection_types}),xe)};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 pn=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}),xe;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"}),xe;!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 Er(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Dt.mergeArray(r,i)):Dt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};pn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pn({items:e,typeName:be.ZodTuple,rest:null,...Te(t)})};var Mf=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}),xe;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Er(n,p,n.path,p)),value:i._parse(new Er(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Dt.mergeObjectAsync(r,o):Dt.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:Qo.create(),valueType:t,typeName:be.ZodRecord,...Te(r)})}},Ys=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}),xe;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Er(n,p,n.path,[m,"key"])),value:a._parse(new Er(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 xe;(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 xe;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Ys.create=(e,t,r)=>new Ys({valueType:t,keyType:e,typeName:be.ZodMap,...Te(r)});var Js=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}),xe;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 xe;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 Er(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:ge.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ge.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Js.create=(e,t)=>new Js({valueType:e,minSize:null,maxSize:null,typeName:be.ZodSet,...Te(t)});var Vf=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}),xe;function n(p,f){return wl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,$s(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return wl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,$s(),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 Go){let p=this;return Ut(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new tr([]),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 tr([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),v=p._def.returns.safeParse(g,a);if(!v.success)throw new tr([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:pn.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||pn.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}),xe}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 tE(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}),xe}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}),xe}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=tE;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}),xe}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}),xe}return Ut(t.data)}get enum(){return this._def.values}};Ya.create=(e,t)=>new Ya({values:e,typeName:be.ZodNativeEnum,...Te(t)});var Go=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}),xe;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})))}};Go.create=(e,t)=>new Go({type:e,typeName:be.ZodPromise,...Te(t)});var Ir=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 xe;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?xe: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 xe;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?xe: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"?xe:(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"?xe:(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(!Uo(i))return xe;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=>Uo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):xe);De.assertNever(o)}};Ir.create=(e,t,r)=>new Ir({schema:e,typeName:be.ZodEffects,effect:t,...Te(r)});Ir.createWithPreprocess=(e,t,r)=>new Ir({schema:t,effect:{type:"preprocess",transform:e},typeName:be.ZodEffects,...Te(r)});var Fr=class extends ke{_parse(t){return this._getType(t)===le.undefined?Ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Fr.create=(e,t)=>new Fr({innerType:e,typeName:be.ZodOptional,...Te(t)});var fn=class extends ke{_parse(t){return this._getType(t)===le.null?Ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};fn.create=(e,t)=>new fn({innerType:e,typeName:be.ZodNullable,...Te(t)});var Ja=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}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:be.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Xa=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 Hs(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Xa.create=(e,t)=>new Xa({innerType:e,typeName:be.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var Xs=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}),xe}return{status:"valid",value:t.data}}};Xs.create=e=>new Xs({typeName:be.ZodNaN,...Te(e)});var oL=Symbol("zod_brand"),Rl=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}},Fl=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"?xe: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"?xe: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=>(Uo(o)&&(o.value=Object.freeze(o.value)),o);return Hs(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 JF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function rE(e,t={},r){return e?Bo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=JF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=JF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Bo.create()}var aL={object:rr.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 iL=(e,t={message:`Input not instance of ${e.name}`})=>rE(r=>r instanceof e,t),nE=Qo.create,oE=ja.create,sL=Xs.create,cL=La.create,aE=Ua.create,uL=Qa.create,lL=Ws.create,dL=Ba.create,pL=Ga.create,fL=Bo.create,mL=to.create,gL=Gr.create,hL=Ks.create,yL=ro.create,SL=rr.create,vL=rr.strictCreate,AL=$a.create,CL=qf.create,xL=Ha.create,bL=pn.create,wL=Mf.create,RL=Ys.create,FL=Js.create,EL=Vf.create,IL=za.create,TL=Wa.create,PL=Ka.create,kL=Ya.create,OL=Go.create,_L=Ir.create,NL=Fr.create,DL=fn.create,qL=Ir.createWithPreprocess,ML=Fl.create,VL=()=>nE().optional(),jL=()=>oE().optional(),LL=()=>aE().optional(),UL={string:e=>Qo.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 QL=xe;var BL=F.object({name:F.string(),arguments:F.string()}),GL=F.object({id:F.string(),type:F.literal("function"),function:BL,encryptedValue:F.string().optional()}),jf=F.object({id:F.string(),role:F.string(),content:F.string().optional(),name:F.string().optional(),encryptedValue:F.string().optional()}),$L=F.object({type:F.literal("text"),text:F.string()}),HL=F.object({type:F.literal("data"),value:F.string(),mimeType:F.string()}),zL=F.object({type:F.literal("url"),value:F.string(),mimeType:F.string().optional()}),Lf=F.discriminatedUnion("type",[HL,zL]),WL=F.object({type:F.literal("image"),source:Lf,metadata:F.unknown().optional()}),KL=F.object({type:F.literal("audio"),source:Lf,metadata:F.unknown().optional()}),YL=F.object({type:F.literal("video"),source:Lf,metadata:F.unknown().optional()}),JL=F.object({type:F.literal("document"),source:Lf,metadata:F.unknown().optional()});var iE=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()}),sE=(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"]})},dde=iE.superRefine((e,t)=>{sE(e,t)}),XL=F.discriminatedUnion("type",[$L,WL,KL,YL,JL,iE]),ZL=XL.superRefine((e,t)=>{e.type==="binary"&&sE(e,t)}),eU=jf.extend({role:F.literal("developer"),content:F.string()}),tU=jf.extend({role:F.literal("system"),content:F.string()}),rU=jf.extend({role:F.literal("assistant"),content:F.string().optional(),toolCalls:F.array(GL).optional()}),nU=jf.extend({role:F.literal("user"),content:F.union([F.string(),F.array(ZL)])}),oU=F.object({id:F.string(),content:F.string(),role:F.literal("tool"),toolCallId:F.string(),error:F.string().optional(),encryptedValue:F.string().optional()}),aU=F.object({id:F.string(),role:F.literal("activity"),activityType:F.string(),content:F.record(F.any())}),iU=F.object({id:F.string(),role:F.literal("reasoning"),content:F.string(),encryptedValue:F.string().optional()}),cE=F.discriminatedUnion("role",[eU,tU,rU,nU,oU,aU,iU]),pde=F.union([F.literal("developer"),F.literal("system"),F.literal("assistant"),F.literal("user"),F.literal("tool"),F.literal("activity"),F.literal("reasoning")]),sU=F.object({description:F.string(),value:F.string()}),uE=F.object({name:F.string(),description:F.string(),parameters:F.any(),metadata:F.record(F.any()).optional()}),cU=F.object({threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),state:F.any(),messages:F.array(cE),tools:F.array(uE),context:F.array(sU),forwardedProps:F.any()}),uU=F.any(),nt=class extends Error{constructor(e){super(e)}},lA=class extends nt{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},lU=F.object({name:F.string(),description:F.string().optional()}),dU=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()}),pU=F.object({streaming:F.boolean().optional(),websocket:F.boolean().optional(),httpBinary:F.boolean().optional(),pushNotifications:F.boolean().optional(),resumable:F.boolean().optional()}),fU=F.object({supported:F.boolean().optional(),items:F.array(uE).optional(),parallelCalls:F.boolean().optional(),clientProvided:F.boolean().optional()}),mU=F.object({structuredOutput:F.boolean().optional(),supportedMimeTypes:F.array(F.string()).optional()}),gU=F.object({snapshots:F.boolean().optional(),deltas:F.boolean().optional(),memory:F.boolean().optional(),persistentState:F.boolean().optional()}),hU=F.object({supported:F.boolean().optional(),delegation:F.boolean().optional(),handoffs:F.boolean().optional(),subAgents:F.array(lU).optional()}),yU=F.object({supported:F.boolean().optional(),streaming:F.boolean().optional(),encrypted:F.boolean().optional()}),SU=F.object({image:F.boolean().optional(),audio:F.boolean().optional(),video:F.boolean().optional(),pdf:F.boolean().optional(),file:F.boolean().optional()}),vU=F.object({image:F.boolean().optional(),audio:F.boolean().optional()}),AU=F.object({input:SU.optional(),output:vU.optional()}),CU=F.object({codeExecution:F.boolean().optional(),sandboxed:F.boolean().optional(),maxIterations:F.number().optional(),maxExecutionTime:F.number().optional()}),xU=F.object({supported:F.boolean().optional(),approvals:F.boolean().optional(),interventions:F.boolean().optional(),feedback:F.boolean().optional()}),fde=F.object({identity:dU.optional(),transport:pU.optional(),tools:fU.optional(),output:mU.optional(),state:gU.optional(),multiAgent:hU.optional(),reasoning:yU.optional(),multimodal:AU.optional(),execution:CU.optional(),humanInTheLoop:xU.optional(),custom:F.record(F.unknown()).optional()}),lE=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(),bU=je.extend({type:F.literal(M.TEXT_MESSAGE_START),messageId:F.string(),role:lE.default("assistant"),name:F.string().optional()}),dE=je.extend({type:F.literal(M.TEXT_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),wU=je.extend({type:F.literal(M.TEXT_MESSAGE_END),messageId:F.string()}),RU=je.extend({type:F.literal(M.TEXT_MESSAGE_CHUNK),messageId:F.string().optional(),role:lE.optional(),delta:F.string().optional(),name:F.string().optional()}),FU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_START)}),EU=dE.omit({messageId:!0,type:!0}).extend({type:F.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),IU=je.extend({type:F.literal(M.THINKING_TEXT_MESSAGE_END)}),TU=je.extend({type:F.literal(M.TOOL_CALL_START),toolCallId:F.string(),toolCallName:F.string(),parentMessageId:F.string().optional()}),PU=je.extend({type:F.literal(M.TOOL_CALL_ARGS),toolCallId:F.string(),delta:F.string()}),kU=je.extend({type:F.literal(M.TOOL_CALL_END),toolCallId:F.string()}),OU=je.extend({messageId:F.string(),type:F.literal(M.TOOL_CALL_RESULT),toolCallId:F.string(),content:F.string(),role:F.literal("tool").optional()}),_U=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()}),NU=je.extend({type:F.literal(M.THINKING_START),title:F.string().optional()}),DU=je.extend({type:F.literal(M.THINKING_END)}),qU=je.extend({type:F.literal(M.STATE_SNAPSHOT),snapshot:uU}),MU=je.extend({type:F.literal(M.STATE_DELTA),delta:F.array(F.any())}),VU=je.extend({type:F.literal(M.MESSAGES_SNAPSHOT),messages:F.array(cE)}),jU=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)}),LU=je.extend({type:F.literal(M.ACTIVITY_DELTA),messageId:F.string(),activityType:F.string(),patch:F.array(F.any())}),UU=je.extend({type:F.literal(M.RAW),event:F.any(),source:F.string().optional()}),QU=je.extend({type:F.literal(M.CUSTOM),name:F.string(),value:F.any()}),BU=je.extend({type:F.literal(M.RUN_STARTED),threadId:F.string(),runId:F.string(),parentRunId:F.string().optional(),input:cU.optional()}),GU=je.extend({type:F.literal(M.RUN_FINISHED),threadId:F.string(),runId:F.string(),result:F.any().optional()}),$U=je.extend({type:F.literal(M.RUN_ERROR),message:F.string(),code:F.string().optional()}),HU=je.extend({type:F.literal(M.STEP_STARTED),stepName:F.string()}),zU=je.extend({type:F.literal(M.STEP_FINISHED),stepName:F.string()}),WU=F.union([F.literal("tool-call"),F.literal("message")]),KU=je.extend({type:F.literal(M.REASONING_START),messageId:F.string()}),YU=je.extend({type:F.literal(M.REASONING_MESSAGE_START),messageId:F.string(),role:F.literal("reasoning")}),JU=je.extend({type:F.literal(M.REASONING_MESSAGE_CONTENT),messageId:F.string(),delta:F.string()}),XU=je.extend({type:F.literal(M.REASONING_MESSAGE_END),messageId:F.string()}),ZU=je.extend({type:F.literal(M.REASONING_MESSAGE_CHUNK),messageId:F.string().optional(),delta:F.string().optional()}),eQ=je.extend({type:F.literal(M.REASONING_END),messageId:F.string()}),tQ=je.extend({type:F.literal(M.REASONING_ENCRYPTED_VALUE),subtype:WU,entityId:F.string(),encryptedValue:F.string()}),Uf=F.discriminatedUnion("type",[bU,dE,wU,RU,NU,DU,FU,EU,IU,TU,PU,kU,_U,OU,qU,MU,VU,jU,LU,UU,QU,BU,GU,$U,HU,zU,KU,YU,JU,XU,ZU,eQ,tQ]);d();c();l();u();var dA={};bu(dA,{JsonPatchError:()=>at,_areEquals:()=>Tl,applyOperation:()=>ei,applyPatch:()=>Wf,applyReducer:()=>iQ,deepClone:()=>oQ,getValueByPointer:()=>Hf,validate:()=>fE,validator:()=>zf});d();c();l();u();d();c();l();u();var rQ=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)}}(),nQ=Object.prototype.hasOwnProperty;function Bf(e,t){return nQ.call(e,t)}function Gf(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)Bf(e,o)&&n.push(o);return n}function qt(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 mn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function El(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Qf(e[t]))return!0}else if(typeof e=="object"){for(var n=Gf(e),o=n.length,a=0;a<o;a++)if(Qf(e[n[a]]))return!0}}return!1}function pE(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 Il=function(e){rQ(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,pE(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=pE(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var at=Il,oQ=qt,Zs={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=Hf(r,this.path);n&&(n=qt(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=Hf(r,this.from);return ei(r,{op:"add",path:this.path,value:qt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Tl(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},aQ={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:Zs.move,copy:Zs.copy,test:Zs.test,_get:Zs._get};function Hf(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):zf(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=Hf(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=Tl(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=qt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,v=f.length,x=void 0,h=void 0,C=void 0;for(typeof r=="function"?C=r:C=zf;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=El(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&&x===void 0&&(m[h]===void 0?x=f.slice(0,g).join("/"):g==v-1&&(x=t.path),x!==void 0&&C(t,0,e,x)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!$f(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);$f(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=aQ[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=Zs[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 Wf(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=qt(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 iQ(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 zf(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(Zs[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")&&Qf(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=fE([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 fE(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Wf(qt(t),qt(e),r||!0);else{r=r||zf;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 Tl(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(!Tl(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],!Tl(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var gA={};bu(gA,{compare:()=>mQ,generate:()=>pA,observe:()=>fQ,unobserve:()=>pQ});d();c();l();u();var fA=new WeakMap,sQ=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),cQ=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function uQ(e){return fA.get(e)}function lQ(e,t){return e.observers.get(t)}function dQ(e,t){e.observers.delete(t.callback)}function pQ(e,t){t.unobserve()}function fQ(e,t){var r=[],n,o=uQ(e);if(!o)o=new sQ(e),fA.set(e,o);else{var a=lQ(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=qt(e),t){n.callback=t,n.next=null;var i=function(){pA(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(){pA(n),clearTimeout(n.next),dQ(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 cQ(t,n)),n}function pA(e,t){t===void 0&&(t=!1);var r=fA.get(e.object);mA(r.value,e.object,e.patches,"",t),e.patches.length&&Wf(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function mA(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Gf(t),i=Gf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],v=e[g];if(Bf(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var x=t[g];typeof v=="object"&&v!=null&&typeof x=="object"&&x!=null&&Array.isArray(v)===Array.isArray(x)?mA(v,x,r,n+"/"+mn(g),o):v!==x&&(p=!0,o&&r.push({op:"test",path:n+"/"+mn(g),value:qt(v)}),r.push({op:"replace",path:n+"/"+mn(g),value:qt(x)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+mn(g),value:qt(v)}),r.push({op:"remove",path:n+"/"+mn(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];!Bf(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+mn(g),value:qt(t[g])})}}}function mQ(e,t,r){r===void 0&&(r=!1);var n=[];return mA(e,t,n,"",r),n}var Kf=Object.assign({},dA,gA,{JsonPatchError:Il,deepClone:qt,escapePathComponent:mn,unescapePathComponent:El});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var hA=function(e,t){return hA=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])},hA(e,t)};function gn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");hA(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function mE(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 Yf(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 ec(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 tc(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 gE(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(C){return Promise.resolve(C).then(h,v)}}function p(h,C){n[h]&&(o[h]=function(b){return new Promise(function(w,R){a.push([h,b,w,R])>1||f(h,b)})},C&&(o[h]=C(o[h])))}function f(h,C){try{m(n[h](C))}catch(b){x(a[0][3],b)}}function m(h){h.value instanceof ti?Promise.resolve(h.value.v).then(g,v):x(a[0][2],h)}function g(h){f("next",h)}function v(h){f("throw",h)}function x(h,C){h(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function hE(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 rc(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 Jf=rc(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
34
34
  `+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
35
- `):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Il(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var tc=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 $f?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 x=h.value;try{iE(x)}catch(b){a=a??[],b instanceof $f?a=Zs(Zs([],Js(a)),Js(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 $f(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)iE(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)&&Il(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Il(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var cA=tc.EMPTY;function Hf(e){return e instanceof tc||e&&"closed"in e&&Ne(e.remove)&&Ne(e.add)&&Ne(e.unsubscribe)}function iE(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 rc={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=rc.delegate;return o?.setTimeout?o.setTimeout.apply(o,Zs([e,t],Js(r))):setTimeout.apply(void 0,Zs([e,t],Js(r)))},clearTimeout:function(e){var t=rc.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function zf(e){rc.setTimeout(function(){var t=$r.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function Tl(){}d();c();l();u();var sE=function(){return uA("C",void 0,void 0)}();function cE(e){return uA("E",void 0,e)}function uE(e){return uA("N",e,void 0)}function uA(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var ni=null;function nc(e){if($r.useDeprecatedSynchronousErrorHandling){var t=!ni;if(t&&(ni={errorThrown:!1,error:null}),e(),t){var r=ni,n=r.errorThrown,o=r.error;if(ni=null,n)throw o}}else e()}function lE(e){$r.useDeprecatedSynchronousErrorHandling&&ni&&(ni.errorThrown=!0,ni.error=e)}var Pl=function(e){mn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Hf(r)&&r.add(n)):n.destination=cQ,n}return t.create=function(r,n,o){return new Kf(r,n,o)},t.prototype.next=function(r){this.isStopped?dA(uE(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?dA(cE(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?dA(sE,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}(tc);var aQ=Function.prototype.bind;function lA(e,t){return aQ.call(e,t)}var iQ=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){Wf(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Wf(n)}else Wf(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Wf(r)}},e}(),Kf=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&&lA(r.next,p),error:r.error&&lA(r.error,p),complete:r.complete&&lA(r.complete,p)}):i=r}return a.destination=new iQ(i),a}return t}(Pl);function Wf(e){$r.useDeprecatedSynchronousErrorHandling?lE(e):zf(e)}function sQ(e){throw e}function dA(e,t){var r=$r.onStoppedNotification;r&&rc.setTimeout(function(){return r(e,t)})}var cQ={closed:!0,next:Tl,error:sQ,complete:Tl};d();c();l();u();var oc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function ac(e){return e}function Yf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pA(e)}function pA(e){return e.length===0?ac:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Je=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=lQ(t)?t:new Kf(t,r,n);return nc(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=dE(r),new r(function(o,a){var i=new Kf({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[oc]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return pA(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=dE(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 dE(e){var t;return(t=e??$r.Promise)!==null&&t!==void 0?t:Promise}function uQ(e){return e&&Ne(e.next)&&Ne(e.error)&&Ne(e.complete)}function lQ(e){return e&&e instanceof Pl||uQ(e)&&Hf(e)}d();c();l();u();function dQ(e){return Ne(e?.lift)}function mt(e){return function(t){if(dQ(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 xt(e,t,r,n,o){return new pQ(e,t,r,n,o)}var pQ=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}(Pl);d();c();l();u();d();c();l();u();var pE=ec(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 fE(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new pE},t.prototype.next=function(r){var n=this;nc(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;nc(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;nc(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?cA:(this.currentObservers=null,p.push(r),new tc(function(){n.currentObservers=null,Il(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 Je;return r.source=this,r},t.create=function(r,n){return new fE(r,n)},t}(Je);var fE=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:cA},t}(gn);d();c();l();u();d();c();l();u();var fA={now:function(){return(fA.delegate||Date).now()},delegate:void 0};var Xf=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=fA);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 Jf=new Je(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function mE(e){return e&&Ne(e.schedule)}function fQ(e){return e[e.length-1]}function gE(e){return mE(fQ(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 Zf=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function em(e){return Ne(e?.then)}d();c();l();u();function tm(e){return Ne(e[oc])}d();c();l();u();function rm(e){return Symbol.asyncIterator&&Ne(e?.[Symbol.asyncIterator])}d();c();l();u();function nm(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 mQ(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var om=mQ();function am(e){return Ne(e?.[om])}d();c();l();u();function im(e){return oE(this,arguments,function(){var r,n,o,a;return Gf(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,ri(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,ri(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,ri(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 sm(e){return Ne(e?.getReader)}function Ct(e){if(e instanceof Je)return e;if(e!=null){if(tm(e))return gQ(e);if(Zf(e))return hQ(e);if(em(e))return yQ(e);if(rm(e))return hE(e);if(am(e))return SQ(e);if(sm(e))return vQ(e)}throw nm(e)}function gQ(e){return new Je(function(t){var r=e[oc]();if(Ne(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function hQ(e){return new Je(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function yQ(e){return new Je(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,zf)})}function SQ(e){return new Je(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 hE(e){return new Je(function(t){AQ(e,t).catch(function(r){return t.error(r)})})}function vQ(e){return hE(im(e))}function AQ(e,t){var r,n,o,a;return nE(this,void 0,void 0,function(){var i,p;return Gf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=aE(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 cm(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(xt(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 um(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function yE(e,t){return Ct(e).pipe(um(t),cm(t))}d();c();l();u();function SE(e,t){return Ct(e).pipe(um(t),cm(t))}d();c();l();u();function vE(e,t){return new Je(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 AE(e,t){return new Je(function(r){var n;return Ir(r,t,function(){n=e[om](),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 lm(e,t){if(!e)throw new Error("Iterable cannot be null");return new Je(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 xE(e,t){return lm(im(e),t)}function CE(e,t){if(e!=null){if(tm(e))return yE(e,t);if(Zf(e))return vE(e,t);if(em(e))return SE(e,t);if(rm(e))return lm(e,t);if(am(e))return AE(e,t);if(sm(e))return xE(e,t)}throw nm(e)}function oi(e,t){return t?CE(e,t):Ct(e)}function ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=gE(e);return oi(e,r)}d();c();l();u();function Ze(e,t){var r=Ne(e)?e:function(){return e},n=function(o){return o.error(r())};return new Je(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var bE=ec(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function dm(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 bE)}})})}d();c();l();u();function ai(e,t){return mt(function(r,n){var o=0;r.subscribe(xt(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function wE(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?x(b):f.push(b)},x=function(b){a&&t.next(b),m++;var w=!1;Ct(r(b,g++)).subscribe(xt(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 x(E)}):x(E)};f.length&&m<n;)R();C()}catch(E){t.error(E)}}))};return e.subscribe(xt(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 ai(function(a,i){return t(n,a,o,i)})(Ct(e(n,o)))},r):(typeof t=="number"&&(r=t),mt(function(n,o){return wE(n,o,e,r)}))}function mA(e){return e===void 0&&(e=1/0),rr(ac,e)}d();c();l();u();function pm(e){return new Je(function(t){Ct(e()).subscribe(t)})}d();c();l();u();function kl(e){return mt(function(t,r){var n=null,o=!1,a;n=t.subscribe(xt(r,void 0,void 0,function(i){a=Ct(e(i,kl(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 fm(e,t){return Ne(t)?rr(e,t,1):rr(e,1)}d();c();l();u();function gA(e){return mt(function(t,r){var n=!1;t.subscribe(xt(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function ii(e){return mt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function hA(e,t){return mt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(xt(n,function(f){o?.unsubscribe();var m=0,g=a++;Ct(e(f,g)).subscribe(o=xt(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 mm(e){return mt(function(t,r){Ct(e).subscribe(xt(r,function(){return r.complete()},Tl)),!r.closed&&t.subscribe(r)})}d();c();l();u();function yA(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(xt(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)}))}):ac}d();c();l();u();d();c();l();u();function RE(e){return` \r
36
- `.indexOf(e)>=0}function gm(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 x=e[r];switch(t[t.length-1]){case"topLevel":C(x);break;case"string":switch(x){case"\"":g();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":x==="u"?i("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":x==="."?p("numberNeedsDigit"):x==="e"||x==="E"?p("numberNeedsExponent"):(x<"0"||x>"9")&&(v(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(x==="+"||x==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(x<"a"||x>"z")&&(v(),g());break;case"arrayNeedsValue":x==="]"?g():RE(x)||(m("collectionItem"),p("arrayNeedsComma"),C(x));break;case"arrayNeedsComma":x==="]"?g():x===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":x==="}"?g():x==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":x===":"&&p("objectNeedsValue");break;case"objectNeedsValue":RE(x)||(m("collectionItem"),p("objectNeedsComma"),C(x));break;case"objectNeedsComma":x==="}"?g():x===","&&(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 EE(){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 ym(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 hm=4294967296;function SA(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>=hm&&(o=o+(n/hm|0),n=n%hm)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?TE(n,o):AA(n,o)}function IE(e,t){let r=AA(e,t),n=r.hi&2147483648;n&&(r=TE(r.lo,r.hi));let o=vA(r.lo,r.hi);return n?"-"+o:o}function vA(e,t){if({lo:e,hi:t}=xQ(e,t),t<=2097151)return String(hm*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()+FE(i)+FE(a)}function xQ(e,t){return{lo:e>>>0,hi:t>>>0}}function AA(e,t){return{lo:e|0,hi:t|0}}function TE(e,t){return t=~t,e?e=~e+1:t+=1,AA(e,t)}var FE=e=>{let t=String(e);return"0000000".slice(t.length)+t};function xA(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 PE(){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=CQ();function CQ(){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()),kE(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),OE(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),kE(r),SA(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),OE(r),SA(r)},dec(r,n){return IE(r,n)},uDec(r,n){return vA(r,n)}}}function kE(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function OE(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var CA=Symbol.for("@bufbuild/protobuf/text-encoding");function bA(){if(y[CA]==null){let e=new y.TextEncoder,t=new y.TextDecoder,r;y[CA]={encodeUtf8(n){return e.encode(n)},decodeUtf8(n,o){return o?(r===void 0&&(r=new y.TextDecoder("utf-8",{fatal:!0})),r.decode(n)):t.decode(n)},checkUtf8(n){try{return encodeURIComponent(n),!0}catch{return!1}}}}return y[CA]}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 bQ=34028234663852886e22,wQ=-34028234663852886e22,RQ=4294967295,FQ=2147483647,EQ=-2147483648,Oe=class{constructor(t=bA().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(_E(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return wA(t),xA(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){IQ(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){_E(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){wA(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return wA(t),t=(t<<1^t>>31)>>>0,xA(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 ym(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 ym(o,a,this.buf),this}uint64(t){let r=Hr.uEnc(t);return ym(r.lo,r.hi,this.buf),this}},se=class{constructor(t,r=bA().decodeUtf8){this.decodeUtf8=r,this.varint64=EE,this.uint32=PE,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.pos,r=this.uint32(),n=this.pos-t;if(n>5||n==5&&this.buf[this.pos-1]>15)throw new Error("illegal tag: varint overflows uint32");let o=r>>>3,a=r&7;if(o<=0||a>5)throw new Error("illegal tag: field no "+o+" wire type "+a);return[o,a]}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(t){return this.decodeUtf8(this.bytes(),t)}};function wA(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>FQ||e<EQ)throw new Error("invalid int32: "+e)}function _E(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>RQ||e<0)throw new Error("invalid uint32: "+e)}function IQ(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>bQ||e<wQ))throw new Error("invalid float32: "+e)}var TQ=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function RA(){return{fields:{}}}var Ol={encode(e,t=new Oe){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&IA.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=RA();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=IA.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 Ol.fromPartial(e??{})},fromPartial(e){let t=RA();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=RA();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 NE(){return{key:"",value:void 0}}var IA={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=NE();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 IA.fromPartial(e??{})},fromPartial(e){let t=NE();return t.key=e.key??"",t.value=e.value??void 0,t}};function FA(){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&&Ol.encode(Ol.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&_l.encode(_l.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=FA();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=Ol.unwrap(Ol.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=_l.unwrap(_l.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=FA();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=FA();if(e===null)t.nullValue=TQ.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 EA(){return{values:[]}}var _l={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=EA();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 _l.fromPartial(e??{})},fromPartial(e){let t=EA();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=EA();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},PQ=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 DE(){return{op:0,path:"",from:void 0,value:void 0}}var vm={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=DE();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 vm.fromPartial(e??{})},fromPartial(e){let t=DE();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function qE(){return{id:"",type:"",function:void 0}}var Am={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&&xm.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=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.type=r.string();continue;case 3:if(a!==26)break;o.function=xm.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=qE();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?xm.fromPartial(e.function):void 0,t}};function ME(){return{name:"",arguments:""}}var xm={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=ME();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 xm.fromPartial(e??{})},fromPartial(e){let t=ME();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function VE(){return{value:"",mimeType:""}}var Cm={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=VE();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 Cm.fromPartial(e??{})},fromPartial(e){let t=VE();return t.value=e.value??"",t.mimeType=e.mimeType??"",t}};function jE(){return{value:"",mimeType:void 0}}var bm={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=jE();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 bm.fromPartial(e??{})},fromPartial(e){let t=jE();return t.value=e.value??"",t.mimeType=e.mimeType??void 0,t}};function LE(){return{data:void 0,url:void 0}}var dr={encode(e,t=new Oe){return e.data!==void 0&&Cm.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&bm.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=LE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.data=Cm.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.url=bm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return dr.fromPartial(e??{})},fromPartial(e){let t=LE();return t.data=e.data!==void 0&&e.data!==null?Cm.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?bm.fromPartial(e.url):void 0,t}};function UE(){return{text:""}}var wm={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=UE();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 wm.fromPartial(e??{})},fromPartial(e){let t=UE();return t.text=e.text??"",t}};function QE(){return{source:void 0,metadata:void 0}}var Rm={encode(e,t=new Oe){return e.source!==void 0&&dr.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=QE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=dr.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 Rm.fromPartial(e??{})},fromPartial(e){let t=QE();return t.source=e.source!==void 0&&e.source!==null?dr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function BE(){return{source:void 0,metadata:void 0}}var Fm={encode(e,t=new Oe){return e.source!==void 0&&dr.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=BE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=dr.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 Fm.fromPartial(e??{})},fromPartial(e){let t=BE();return t.source=e.source!==void 0&&e.source!==null?dr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function GE(){return{source:void 0,metadata:void 0}}var Em={encode(e,t=new Oe){return e.source!==void 0&&dr.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=GE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=dr.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 Em.fromPartial(e??{})},fromPartial(e){let t=GE();return t.source=e.source!==void 0&&e.source!==null?dr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function $E(){return{source:void 0,metadata:void 0}}var Im={encode(e,t=new Oe){return e.source!==void 0&&dr.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=$E();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=dr.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 Im.fromPartial(e??{})},fromPartial(e){let t=$E();return t.source=e.source!==void 0&&e.source!==null?dr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function HE(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var Tm={encode(e,t=new Oe){return e.text!==void 0&&wm.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Rm.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Fm.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&Em.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&Im.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=HE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.text=wm.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.image=Rm.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.audio=Fm.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.video=Em.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.document=Im.decode(r,r.uint32());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.text=e.text!==void 0&&e.text!==null?wm.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Rm.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Fm.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?Em.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?Im.fromPartial(e.document):void 0,t}};function zE(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var Pm={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)Am.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)Tm.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=zE();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(Am.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(Tm.decode(r,r.uint32()));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.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=>Am.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(r=>Tm.fromPartial(r))||[],t}},kQ=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 WE(){return{type:0,timestamp:void 0,rawEvent:void 0}}var Ae={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=WE();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=OQ(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 Ae.fromPartial(e??{})},fromPartial(e){let t=WE();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function KE(){return{baseEvent:void 0,messageId:"",role:void 0,name:void 0}}var km={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=KE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 km.fromPartial(e??{})},fromPartial(e){let t=KE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t.name=e.name??void 0,t}};function YE(){return{baseEvent:void 0,messageId:"",delta:""}}var Om={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=YE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Om.fromPartial(e??{})},fromPartial(e){let t=YE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function XE(){return{baseEvent:void 0,messageId:""}}var _m={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=XE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 _m.fromPartial(e??{})},fromPartial(e){let t=XE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function JE(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Nm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=JE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Nm.fromPartial(e??{})},fromPartial(e){let t=JE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function ZE(){return{baseEvent:void 0,toolCallId:"",delta:""}}var Dm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=ZE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Dm.fromPartial(e??{})},fromPartial(e){let t=ZE();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function eI(){return{baseEvent:void 0,toolCallId:""}}var qm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=eI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 qm.fromPartial(e??{})},fromPartial(e){let t=eI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function tI(){return{baseEvent:void 0,snapshot:void 0}}var Mm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=tI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Mm.fromPartial(e??{})},fromPartial(e){let t=tI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function rI(){return{baseEvent:void 0,delta:[]}}var Vm={encode(e,t=new Oe){e.baseEvent!==void 0&&Ae.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)vm.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=rI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(vm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Vm.fromPartial(e??{})},fromPartial(e){let t=rI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>vm.fromPartial(r))||[],t}};function nI(){return{baseEvent:void 0,messages:[]}}var jm={encode(e,t=new Oe){e.baseEvent!==void 0&&Ae.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)Pm.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=nI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(Pm.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=nI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>Pm.fromPartial(r))||[],t}};function oI(){return{baseEvent:void 0,event:void 0,source:void 0}}var Lm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=oI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Lm.fromPartial(e??{})},fromPartial(e){let t=oI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function aI(){return{baseEvent:void 0,name:"",value:void 0}}var Um={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=aI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Um.fromPartial(e??{})},fromPartial(e){let t=aI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function iI(){return{baseEvent:void 0,threadId:"",runId:""}}var Qm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=iI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Qm.fromPartial(e??{})},fromPartial(e){let t=iI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function sI(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var Bm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=sI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Bm.fromPartial(e??{})},fromPartial(e){let t=sI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function cI(){return{baseEvent:void 0,code:void 0,message:""}}var Gm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=cI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Gm.fromPartial(e??{})},fromPartial(e){let t=cI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function uI(){return{baseEvent:void 0,stepName:""}}var $m={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=uI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 $m.fromPartial(e??{})},fromPartial(e){let t=uI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function lI(){return{baseEvent:void 0,stepName:""}}var Hm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=lI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Hm.fromPartial(e??{})},fromPartial(e){let t=lI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function dI(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var zm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=dI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 zm.fromPartial(e??{})},fromPartial(e){let t=dI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.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 pI(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Wm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=pI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Wm.fromPartial(e??{})},fromPartial(e){let t=pI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.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 fI(){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 mI={encode(e,t=new Oe){return e.textMessageStart!==void 0&&km.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Om.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&_m.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Nm.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Dm.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&qm.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Mm.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Vm.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&jm.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Lm.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Um.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Qm.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Bm.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Gm.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&$m.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Hm.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&zm.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Wm.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=fI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.textMessageStart=km.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.textMessageContent=Om.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=_m.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=Nm.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=Dm.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=qm.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=Mm.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=Vm.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=jm.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=Lm.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=Um.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Qm.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=Bm.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=Gm.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=$m.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=Hm.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=zm.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=Wm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return mI.fromPartial(e??{})},fromPartial(e){let t=fI();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?km.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Om.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?_m.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Nm.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Dm.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?qm.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Mm.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Vm.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?jm.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Lm.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Um.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Qm.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Bm.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Gm.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?$m.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Hm.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?zm.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Wm.fromPartial(e.toolCallChunk):void 0,t}};function OQ(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 Sm=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}}},_Q=e=>{if(!(!e||typeof e!="object")){if(e.text)return{type:"text",text:e.text.text};if(e.image)return{type:"image",source:Sm(e.image.source),metadata:e.image.metadata};if(e.audio)return{type:"audio",source:Sm(e.audio.source),metadata:e.audio.metadata};if(e.video)return{type:"video",source:Sm(e.video.source),metadata:e.video.metadata};if(e.document)return{type:"document",source:Sm(e.document.source),metadata:e.document.metadata}}};function gI(e){let t=mI.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=kQ[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=>_Q(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=PQ[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]}),Df.parse(r)}var TA="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var DQ=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,PA=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(DQ);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},hI=e=>e==="*"||e==="x"||e==="X",yI=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},qQ=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],MQ=(e,t)=>{if(hI(e)||hI(t))return 0;let[r,n]=qQ(yI(e),yI(t));return r>n?1:r<n?-1:0},kA=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=MQ(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var Nl=(e,t)=>{let r=PA(e),n=PA(t),o=r.pop(),a=n.pop(),i=kA(r,n);return i!==0?i:o&&a?kA(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 Dl(){return Lo()}function NA(e){if(Object.freeze(e),typeof e=="object"&&e)for(let t of Object.values(e))typeof t=="object"&&t&&!Object.isFrozen(t)&&NA(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&&(NA(m),NA(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 Km(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 ql(e){if(e instanceof DA)return e;if(e===!0)return new DA(Km(!0))}var DA=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 OA(e){return e.enabled?new DA(e):void 0}function VQ(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 bI=(e,t,r,n,o)=>{let a=ql(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):Jf};return t.pipe(fm(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(v){let C=yield Ge(n,i,p,(h,x,b)=>h.onEvent?.({event:v,agent:r,input:e,messages:x,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,(x,b,w)=>x.onTextMessageStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:x,role:b="assistant",name:w}=v;if(!i.find(R=>R.id===x)){let R={id:x,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:x}=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:""}${x}`,m({messages:i})),g()}case M.TEXT_MESSAGE_END:{let{messageId:h}=v,x=i.find(b=>b.id===h);return x?(m(yield Ge(n,i,p,(b,w,R)=>b.onTextMessageEndEvent?.({event:v,messages:w,state:R,agent:r,input:e,textMessageBuffer:typeof x.content=="string"?x.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:x,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,(x,b,w)=>x.onToolCallStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{toolCallId:x,toolCallName:b,parentMessageId:w}=v,R=VQ(i,w,x);R.toolCalls??(R.toolCalls=[]),R.toolCalls.push({id:x,type:"function",function:{name:b,arguments:""}}),m({messages:i})}return g()}case M.TOOL_CALL_ARGS:{let{toolCallId:h,delta:x}=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,G={};try{G=gm(T)}catch{}return E.onToolCallArgsEvent?.({event:v,messages:I,state:k,agent:r,input:e,toolCallBuffer:T,toolCallName:D,partialToolCallArgs:G})});return m(R),R.stopPropagation!==!0&&(w.function.arguments+=x,m({messages:i})),g()}case M.TOOL_CALL_END:{let{toolCallId:h}=v,x=i.find(w=>w.toolCalls?.some(R=>R.id===h));if(!x)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${h}'`),g();let b=x.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,(x,b,w)=>x.onToolCallResultEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:x,toolCallId:b,content:w,role:R}=v,E={id:x,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,(x,b,w)=>x.onStateSnapshotEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{snapshot:x}=v;p=x,m({state:p})}return g()}case M.STATE_DELTA:{let h=yield Ge(n,i,p,(x,b,w)=>x.onStateDeltaEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{delta:x}=v;try{p=Bf.applyPatch(p,x,!0,!1).newDocument,m({state:p})}catch(b){let w=b instanceof Error?b.message:String(b);console.warn(`Failed to apply state patch:
35
+ `):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Pl(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var nc=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 Jf?b.errors:[b]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var x=no(v),h=x.next();!h.done;h=x.next()){var C=h.value;try{yE(C)}catch(b){a=a??[],b instanceof Jf?a=tc(tc([],ec(a)),ec(b.errors)):a.push(b)}}}catch(b){n={error:b}}finally{try{h&&!h.done&&(o=x.return)&&o.call(x)}finally{if(n)throw n.error}}}if(a)throw new Jf(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)yE(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)&&Pl(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Pl(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var yA=nc.EMPTY;function Xf(e){return e instanceof nc||e&&"closed"in e&&Ne(e.remove)&&Ne(e.add)&&Ne(e.unsubscribe)}function yE(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 oc={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=oc.delegate;return o?.setTimeout?o.setTimeout.apply(o,tc([e,t],ec(r))):setTimeout.apply(void 0,tc([e,t],ec(r)))},clearTimeout:function(e){var t=oc.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Zf(e){oc.setTimeout(function(){var t=$r.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function kl(){}d();c();l();u();var SE=function(){return SA("C",void 0,void 0)}();function vE(e){return SA("E",void 0,e)}function AE(e){return SA("N",e,void 0)}function SA(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var ri=null;function ac(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 CE(e){$r.useDeprecatedSynchronousErrorHandling&&ri&&(ri.errorThrown=!0,ri.error=e)}var Ol=function(e){gn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Xf(r)&&r.add(n)):n.destination=SQ,n}return t.create=function(r,n,o){return new tm(r,n,o)},t.prototype.next=function(r){this.isStopped?AA(AE(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?AA(vE(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?AA(SE,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}(nc);var gQ=Function.prototype.bind;function vA(e,t){return gQ.call(e,t)}var hQ=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){em(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){em(n)}else em(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){em(r)}},e}(),tm=function(e){gn(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&&vA(r.next,p),error:r.error&&vA(r.error,p),complete:r.complete&&vA(r.complete,p)}):i=r}return a.destination=new hQ(i),a}return t}(Ol);function em(e){$r.useDeprecatedSynchronousErrorHandling?CE(e):Zf(e)}function yQ(e){throw e}function AA(e,t){var r=$r.onStoppedNotification;r&&oc.setTimeout(function(){return r(e,t)})}var SQ={closed:!0,next:kl,error:yQ,complete:kl};d();c();l();u();var ic=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function sc(e){return e}function rm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return CA(e)}function CA(e){return e.length===0?sc:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Xe=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=AQ(t)?t:new tm(t,r,n);return ac(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=xE(r),new r(function(o,a){var i=new tm({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[ic]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return CA(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=xE(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 xE(e){var t;return(t=e??$r.Promise)!==null&&t!==void 0?t:Promise}function vQ(e){return e&&Ne(e.next)&&Ne(e.error)&&Ne(e.complete)}function AQ(e){return e&&e instanceof Ol||vQ(e)&&Xf(e)}d();c();l();u();function CQ(e){return Ne(e?.lift)}function mt(e){return function(t){if(CQ(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 Ct(e,t,r,n,o){return new xQ(e,t,r,n,o)}var xQ=function(e){gn(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}(Ol);d();c();l();u();d();c();l();u();var bE=rc(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var hn=function(e){gn(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 wE(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new bE},t.prototype.next=function(r){var n=this;ac(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;ac(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;ac(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?yA:(this.currentObservers=null,p.push(r),new nc(function(){n.currentObservers=null,Pl(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 Xe;return r.source=this,r},t.create=function(r,n){return new wE(r,n)},t}(Xe);var wE=function(e){gn(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:yA},t}(hn);d();c();l();u();d();c();l();u();var xA={now:function(){return(xA.delegate||Date).now()},delegate:void 0};var nm=function(e){gn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=xA);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}(hn);d();c();l();u();var om=new Xe(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function RE(e){return e&&Ne(e.schedule)}function bQ(e){return e[e.length-1]}function FE(e){return RE(bQ(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 am=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function im(e){return Ne(e?.then)}d();c();l();u();function sm(e){return Ne(e[ic])}d();c();l();u();function cm(e){return Symbol.asyncIterator&&Ne(e?.[Symbol.asyncIterator])}d();c();l();u();function um(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 wQ(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var lm=wQ();function dm(e){return Ne(e?.[lm])}d();c();l();u();function pm(e){return gE(this,arguments,function(){var r,n,o,a;return Yf(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 fm(e){return Ne(e?.getReader)}function xt(e){if(e instanceof Xe)return e;if(e!=null){if(sm(e))return RQ(e);if(am(e))return FQ(e);if(im(e))return EQ(e);if(cm(e))return EE(e);if(dm(e))return IQ(e);if(fm(e))return TQ(e)}throw um(e)}function RQ(e){return new Xe(function(t){var r=e[ic]();if(Ne(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function FQ(e){return new Xe(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function EQ(e){return new Xe(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Zf)})}function IQ(e){return new Xe(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 EE(e){return new Xe(function(t){PQ(e,t).catch(function(r){return t.error(r)})})}function TQ(e){return EE(pm(e))}function PQ(e,t){var r,n,o,a;return mE(this,void 0,void 0,function(){var i,p;return Yf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=hE(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 Tr(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 mm(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(Ct(n,function(o){return Tr(n,e,function(){return n.next(o)},t)},function(){return Tr(n,e,function(){return n.complete()},t)},function(o){return Tr(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function gm(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function IE(e,t){return xt(e).pipe(gm(t),mm(t))}d();c();l();u();function TE(e,t){return xt(e).pipe(gm(t),mm(t))}d();c();l();u();function PE(e,t){return new Xe(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 kE(e,t){return new Xe(function(r){var n;return Tr(r,t,function(){n=e[lm](),Tr(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 hm(e,t){if(!e)throw new Error("Iterable cannot be null");return new Xe(function(r){Tr(r,t,function(){var n=e[Symbol.asyncIterator]();Tr(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function OE(e,t){return hm(pm(e),t)}function _E(e,t){if(e!=null){if(sm(e))return IE(e,t);if(am(e))return PE(e,t);if(im(e))return TE(e,t);if(cm(e))return hm(e,t);if(dm(e))return kE(e,t);if(fm(e))return OE(e,t)}throw um(e)}function ni(e,t){return t?_E(e,t):xt(e)}function ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=FE(e);return ni(e,r)}d();c();l();u();function Ze(e,t){var r=Ne(e)?e:function(){return e},n=function(o){return o.error(r())};return new Xe(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var NE=rc(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function ym(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 NE)}})})}d();c();l();u();function oi(e,t){return mt(function(r,n){var o=0;r.subscribe(Ct(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function DE(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,v=!1,x=function(){v&&!f.length&&!m&&t.complete()},h=function(b){return m<n?C(b):f.push(b)},C=function(b){a&&t.next(b),m++;var w=!1;xt(r(b,g++)).subscribe(Ct(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?Tr(t,i,function(){return C(E)}):C(E)};f.length&&m<n;)R();x()}catch(E){t.error(E)}}))};return e.subscribe(Ct(t,h,function(){v=!0,x()})),function(){p?.()}}function nr(e,t,r){return r===void 0&&(r=1/0),Ne(t)?nr(function(n,o){return oi(function(a,i){return t(n,a,o,i)})(xt(e(n,o)))},r):(typeof t=="number"&&(r=t),mt(function(n,o){return DE(n,o,e,r)}))}function bA(e){return e===void 0&&(e=1/0),nr(sc,e)}d();c();l();u();function Sm(e){return new Xe(function(t){xt(e()).subscribe(t)})}d();c();l();u();function _l(e){return mt(function(t,r){var n=null,o=!1,a;n=t.subscribe(Ct(r,void 0,void 0,function(i){a=xt(e(i,_l(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 vm(e,t){return Ne(t)?nr(e,t,1):nr(e,1)}d();c();l();u();function wA(e){return mt(function(t,r){var n=!1;t.subscribe(Ct(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 RA(e,t){return mt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(Ct(n,function(f){o?.unsubscribe();var m=0,g=a++;xt(e(f,g)).subscribe(o=Ct(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 Am(e){return mt(function(t,r){xt(e).subscribe(Ct(r,function(){return r.complete()},kl)),!r.closed&&t.subscribe(r)})}d();c();l();u();function FA(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(Ct(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)}))}):sc}d();c();l();u();d();c();l();u();function qE(e){return` \r
36
+ `.indexOf(e)>=0}function Cm(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--},x=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 C=e[r];switch(t[t.length-1]){case"topLevel":x(C);break;case"string":switch(C){case"\"":g();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":C==="u"?i("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":C==="."?p("numberNeedsDigit"):C==="e"||C==="E"?p("numberNeedsExponent"):(C<"0"||C>"9")&&(v(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(C==="+"||C==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(C<"a"||C>"z")&&(v(),g());break;case"arrayNeedsValue":C==="]"?g():qE(C)||(m("collectionItem"),p("arrayNeedsComma"),x(C));break;case"arrayNeedsComma":C==="]"?g():C===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":C==="}"?g():C==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":C===":"&&p("objectNeedsValue");break;case"objectNeedsValue":qE(C)||(m("collectionItem"),p("objectNeedsComma"),x(C));break;case"objectNeedsComma":C==="}"?g():C===","&&(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 VE(){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 bm(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 xm=4294967296;function EA(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>=xm&&(o=o+(n/xm|0),n=n%xm)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?LE(n,o):TA(n,o)}function jE(e,t){let r=TA(e,t),n=r.hi&2147483648;n&&(r=LE(r.lo,r.hi));let o=IA(r.lo,r.hi);return n?"-"+o:o}function IA(e,t){if({lo:e,hi:t}=kQ(e,t),t<=2097151)return String(xm*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()+ME(i)+ME(a)}function kQ(e,t){return{lo:e>>>0,hi:t>>>0}}function TA(e,t){return{lo:e|0,hi:t|0}}function LE(e,t){return t=~t,e?e=~e+1:t+=1,TA(e,t)}var ME=e=>{let t=String(e);return"0000000".slice(t.length)+t};function PA(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 UE(){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=OQ();function OQ(){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()),QE(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),BE(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),QE(r),EA(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),BE(r),EA(r)},dec(r,n){return jE(r,n)},uDec(r,n){return IA(r,n)}}}function QE(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function BE(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var kA=Symbol.for("@bufbuild/protobuf/text-encoding");function OA(){if(y[kA]==null){let e=new y.TextEncoder,t=new y.TextDecoder,r;y[kA]={encodeUtf8(n){return e.encode(n)},decodeUtf8(n,o){return o?(r===void 0&&(r=new y.TextDecoder("utf-8",{fatal:!0})),r.decode(n)):t.decode(n)},checkUtf8(n){try{return encodeURIComponent(n),!0}catch{return!1}}}}return y[kA]}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 _Q=34028234663852886e22,NQ=-34028234663852886e22,DQ=4294967295,qQ=2147483647,MQ=-2147483648,Oe=class{constructor(t=OA().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(GE(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return _A(t),PA(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){VQ(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){GE(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){_A(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return _A(t),t=(t<<1^t>>31)>>>0,PA(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 bm(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 bm(o,a,this.buf),this}uint64(t){let r=Hr.uEnc(t);return bm(r.lo,r.hi,this.buf),this}},se=class{constructor(t,r=OA().decodeUtf8){this.decodeUtf8=r,this.varint64=VE,this.uint32=UE,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.pos,r=this.uint32(),n=this.pos-t;if(n>5||n==5&&this.buf[this.pos-1]>15)throw new Error("illegal tag: varint overflows uint32");let o=r>>>3,a=r&7;if(o<=0||a>5)throw new Error("illegal tag: field no "+o+" wire type "+a);return[o,a]}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(t){return this.decodeUtf8(this.bytes(),t)}};function _A(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>qQ||e<MQ)throw new Error("invalid int32: "+e)}function GE(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>DQ||e<0)throw new Error("invalid uint32: "+e)}function VQ(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>_Q||e<NQ))throw new Error("invalid float32: "+e)}var jQ=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function NA(){return{fields:{}}}var Nl={encode(e,t=new Oe){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&MA.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=NA();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=MA.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 Nl.fromPartial(e??{})},fromPartial(e){let t=NA();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=NA();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 $E(){return{key:"",value:void 0}}var MA={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=$E();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 MA.fromPartial(e??{})},fromPartial(e){let t=$E();return t.key=e.key??"",t.value=e.value??void 0,t}};function DA(){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&&Nl.encode(Nl.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Dl.encode(Dl.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=DA();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=Nl.unwrap(Nl.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=Dl.unwrap(Dl.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=DA();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=DA();if(e===null)t.nullValue=jQ.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 qA(){return{values:[]}}var Dl={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=qA();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 Dl.fromPartial(e??{})},fromPartial(e){let t=qA();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=qA();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},LQ=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 HE(){return{op:0,path:"",from:void 0,value:void 0}}var Rm={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=HE();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 Rm.fromPartial(e??{})},fromPartial(e){let t=HE();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function zE(){return{id:"",type:"",function:void 0}}var Fm={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&&Em.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=zE();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=Em.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=zE();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?Em.fromPartial(e.function):void 0,t}};function WE(){return{name:"",arguments:""}}var Em={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=WE();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 Em.fromPartial(e??{})},fromPartial(e){let t=WE();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function KE(){return{value:"",mimeType:""}}var Im={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=KE();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 Im.fromPartial(e??{})},fromPartial(e){let t=KE();return t.value=e.value??"",t.mimeType=e.mimeType??"",t}};function YE(){return{value:"",mimeType:void 0}}var Tm={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=YE();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 Tm.fromPartial(e??{})},fromPartial(e){let t=YE();return t.value=e.value??"",t.mimeType=e.mimeType??void 0,t}};function JE(){return{data:void 0,url:void 0}}var pr={encode(e,t=new Oe){return e.data!==void 0&&Im.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&Tm.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=JE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.data=Im.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.url=Tm.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=JE();return t.data=e.data!==void 0&&e.data!==null?Im.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?Tm.fromPartial(e.url):void 0,t}};function XE(){return{text:""}}var Pm={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=XE();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 Pm.fromPartial(e??{})},fromPartial(e){let t=XE();return t.text=e.text??"",t}};function ZE(){return{source:void 0,metadata:void 0}}var km={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=ZE();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 km.fromPartial(e??{})},fromPartial(e){let t=ZE();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function eI(){return{source:void 0,metadata:void 0}}var Om={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=eI();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 Om.fromPartial(e??{})},fromPartial(e){let t=eI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function tI(){return{source:void 0,metadata:void 0}}var _m={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=tI();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 _m.fromPartial(e??{})},fromPartial(e){let t=tI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function rI(){return{source:void 0,metadata:void 0}}var Nm={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=rI();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 Nm.fromPartial(e??{})},fromPartial(e){let t=rI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function nI(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var Dm={encode(e,t=new Oe){return e.text!==void 0&&Pm.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&km.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Om.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&_m.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&Nm.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=nI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.text=Pm.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.image=km.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.audio=Om.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.video=_m.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.document=Nm.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=nI();return t.text=e.text!==void 0&&e.text!==null?Pm.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?km.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Om.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?_m.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?Nm.fromPartial(e.document):void 0,t}};function oI(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var qm={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)Fm.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)Dm.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=oI();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(Fm.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(Dm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qm.fromPartial(e??{})},fromPartial(e){let t=oI();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=>Fm.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(r=>Dm.fromPartial(r))||[],t}},UQ=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 aI(){return{type:0,timestamp:void 0,rawEvent:void 0}}var Ae={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=aI();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=QQ(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 Ae.fromPartial(e??{})},fromPartial(e){let t=aI();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function iI(){return{baseEvent:void 0,messageId:"",role:void 0,name:void 0}}var Mm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=iI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Mm.fromPartial(e??{})},fromPartial(e){let t=iI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t.name=e.name??void 0,t}};function sI(){return{baseEvent:void 0,messageId:"",delta:""}}var Vm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=sI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Vm.fromPartial(e??{})},fromPartial(e){let t=sI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function cI(){return{baseEvent:void 0,messageId:""}}var jm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=cI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 jm.fromPartial(e??{})},fromPartial(e){let t=cI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function uI(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Lm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=uI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Lm.fromPartial(e??{})},fromPartial(e){let t=uI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function lI(){return{baseEvent:void 0,toolCallId:"",delta:""}}var Um={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=lI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Um.fromPartial(e??{})},fromPartial(e){let t=lI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function dI(){return{baseEvent:void 0,toolCallId:""}}var Qm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=dI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Qm.fromPartial(e??{})},fromPartial(e){let t=dI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function pI(){return{baseEvent:void 0,snapshot:void 0}}var Bm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=pI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Bm.fromPartial(e??{})},fromPartial(e){let t=pI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function fI(){return{baseEvent:void 0,delta:[]}}var Gm={encode(e,t=new Oe){e.baseEvent!==void 0&&Ae.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)Rm.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=fI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(Rm.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=fI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>Rm.fromPartial(r))||[],t}};function mI(){return{baseEvent:void 0,messages:[]}}var $m={encode(e,t=new Oe){e.baseEvent!==void 0&&Ae.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)qm.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=mI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(qm.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=mI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>qm.fromPartial(r))||[],t}};function gI(){return{baseEvent:void 0,event:void 0,source:void 0}}var Hm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=gI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Hm.fromPartial(e??{})},fromPartial(e){let t=gI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function hI(){return{baseEvent:void 0,name:"",value:void 0}}var zm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=hI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 zm.fromPartial(e??{})},fromPartial(e){let t=hI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function yI(){return{baseEvent:void 0,threadId:"",runId:""}}var Wm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=yI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Wm.fromPartial(e??{})},fromPartial(e){let t=yI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function SI(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var Km={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=SI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Km.fromPartial(e??{})},fromPartial(e){let t=SI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function vI(){return{baseEvent:void 0,code:void 0,message:""}}var Ym={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=vI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Ym.fromPartial(e??{})},fromPartial(e){let t=vI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function AI(){return{baseEvent:void 0,stepName:""}}var Jm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=Ae.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 Jm.fromPartial(e??{})},fromPartial(e){let t=AI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function CI(){return{baseEvent:void 0,stepName:""}}var Xm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=CI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Xm.fromPartial(e??{})},fromPartial(e){let t=CI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function xI(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var Zm={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=xI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 Zm.fromPartial(e??{})},fromPartial(e){let t=xI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.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 bI(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var eg={encode(e,t=new Oe){return e.baseEvent!==void 0&&Ae.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=bI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ae.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 eg.fromPartial(e??{})},fromPartial(e){let t=bI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ae.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 wI(){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 RI={encode(e,t=new Oe){return e.textMessageStart!==void 0&&Mm.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Vm.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&jm.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Lm.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Um.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Qm.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Bm.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Gm.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&$m.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Hm.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&zm.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Wm.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Km.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Ym.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Jm.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Xm.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Zm.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&eg.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=wI();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=Vm.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=jm.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=Lm.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=Um.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=Qm.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=Bm.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=Gm.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=$m.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=Hm.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=zm.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Wm.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=Km.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=Ym.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=Jm.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=Xm.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=Zm.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=eg.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return RI.fromPartial(e??{})},fromPartial(e){let t=wI();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?Vm.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?jm.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Lm.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Um.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Qm.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Bm.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Gm.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?$m.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Hm.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?zm.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Wm.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Km.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Ym.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Jm.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Xm.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Zm.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?eg.fromPartial(e.toolCallChunk):void 0,t}};function QQ(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 wm=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}}},BQ=e=>{if(!(!e||typeof e!="object")){if(e.text)return{type:"text",text:e.text.text};if(e.image)return{type:"image",source:wm(e.image.source),metadata:e.image.metadata};if(e.audio)return{type:"audio",source:wm(e.audio.source),metadata:e.audio.metadata};if(e.video)return{type:"video",source:wm(e.video.source),metadata:e.video.metadata};if(e.document)return{type:"document",source:wm(e.document.source),metadata:e.document.metadata}}};function FI(e){let t=RI.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=UQ[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=>BQ(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=LQ[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]}),Uf.parse(r)}var VA="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var $Q=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,jA=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match($Q);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},EI=e=>e==="*"||e==="x"||e==="X",II=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},HQ=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],zQ=(e,t)=>{if(EI(e)||EI(t))return 0;let[r,n]=HQ(II(e),II(t));return r>n?1:r<n?-1:0},LA=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=zQ(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var ql=(e,t)=>{let r=jA(e),n=jA(t),o=r.pop(),a=n.pop(),i=LA(r,n);return i!==0?i:o&&a?LA(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 Ml(){return Lo()}function BA(e){if(Object.freeze(e),typeof e=="object"&&e)for(let t of Object.values(e))typeof t=="object"&&t&&!Object.isFrozen(t)&&BA(t);return e}function $e(_x140,_x141,_x142,_x143){return _$e.apply(this,arguments)}function _$e(){_$e=_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 x of e)try{i&&(BA(m),BA(g));let h=yield n(x,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 _$e.apply(this,arguments)}function tg(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 Vl(e){if(e instanceof GA)return e;if(e===!0)return new GA(tg(!0))}var GA=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 UA(e){return e.enabled?new GA(e):void 0}function WQ(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 NI=(e,t,r,n,o)=>{let a=Vl(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):om};return t.pipe(vm(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(v){let x=yield $e(n,i,p,(h,C,b)=>h.onEvent?.({event:v,agent:r,input:e,messages:C,state:b}));if(m(x),x.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}),x.stopPropagation===!0)return g();switch(v.type){case M.TEXT_MESSAGE_START:{let h=yield $e(n,i,p,(C,b,w)=>C.onTextMessageStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:C,role:b="assistant",name:w}=v;if(!i.find(R=>R.id===C)){let R={id:C,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:C}=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 $e(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:""}${C}`,m({messages:i})),g()}case M.TEXT_MESSAGE_END:{let{messageId:h}=v,C=i.find(b=>b.id===h);return C?(m(yield $e(n,i,p,(b,w,R)=>b.onTextMessageEndEvent?.({event:v,messages:w,state:R,agent:r,input:e,textMessageBuffer:typeof C.content=="string"?C.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:C,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 $e(n,i,p,(C,b,w)=>C.onToolCallStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{toolCallId:C,toolCallName:b,parentMessageId:w}=v,R=WQ(i,w,C);R.toolCalls??(R.toolCalls=[]),R.toolCalls.push({id:C,type:"function",function:{name:b,arguments:""}}),m({messages:i})}return g()}case M.TOOL_CALL_ARGS:{let{toolCallId:h,delta:C}=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 $e(n,i,p,(E,I,k)=>{let T=w.function.arguments,D=w.function.name,G={};try{G=Cm(T)}catch{}return E.onToolCallArgsEvent?.({event:v,messages:I,state:k,agent:r,input:e,toolCallBuffer:T,toolCallName:D,partialToolCallArgs:G})});return m(R),R.stopPropagation!==!0&&(w.function.arguments+=C,m({messages:i})),g()}case M.TOOL_CALL_END:{let{toolCallId:h}=v,C=i.find(w=>w.toolCalls?.some(R=>R.id===h));if(!C)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${h}'`),g();let b=C.toolCalls?.find(w=>w.id===h);return b?(m(yield $e(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 $e(n,i,p,(C,b,w)=>C.onToolCallResultEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:C,toolCallId:b,content:w,role:R}=v,E={id:C,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 $e(n,i,p,(C,b,w)=>C.onStateSnapshotEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{snapshot:C}=v;p=C,m({state:p})}return g()}case M.STATE_DELTA:{let h=yield $e(n,i,p,(C,b,w)=>C.onStateDeltaEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{delta:C}=v;try{p=Kf.applyPatch(p,C,!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
37
  Current state: ${JSON.stringify(p,null,2)}
38
- Patch operations: ${JSON.stringify(x,null,2)}
39
- Error: ${w}`)}}return g()}case M.MESSAGES_SNAPSHOT:{let h=yield Ge(n,i,p,(x,b,w)=>x.onMessagesSnapshotEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messages:x}=v,b=new Map(x.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 x)R.has(E.id)||i.push(E);m({messages:i})}return g()}case M.ACTIVITY_SNAPSHOT:{let h=v,x=i.findIndex(I=>I.id===h.messageId),b=x>=0?i[x]: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;x===-1?(i.push(I),k=I):w?R&&(i[x]={...w,activityType:h.activityType,content:Le(h.content)}):R&&(i[x]=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,x=i.findIndex(E=>E.id===h.messageId);if(x===-1)return g();let b=i[x];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=Bf.applyPatch(E,h.patch??[],!0,!1).newDocument;i[x]={...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,x,b)=>h.onRawEvent?.({event:v,messages:x,state:b,agent:r,input:e}))),g();case M.CUSTOM:return m(yield Ge(n,i,p,(h,x,b)=>h.onCustomEvent?.({event:v,messages:x,state:b,agent:r,input:e}))),g();case M.RUN_STARTED:{let h=yield Ge(n,i,p,(x,b,w)=>x.onRunStartedEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let x=v;if(x.input?.messages){for(let b of x.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,x,b)=>h.onRunFinishedEvent?.({event:v,messages:x,state:b,agent:r,input:e,result:v.result}))),g();case M.RUN_ERROR:return m(yield Ge(n,i,p,(h,x,b)=>h.onRunErrorEvent?.({event:v,messages:x,state:b,agent:r,input:e}))),g();case M.STEP_STARTED:return m(yield Ge(n,i,p,(h,x,b)=>h.onStepStartedEvent?.({event:v,messages:x,state:b,agent:r,input:e}))),g();case M.STEP_FINISHED:return m(yield Ge(n,i,p,(h,x,b)=>h.onStepFinishedEvent?.({event:v,messages:x,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,x,b)=>h.onReasoningStartEvent?.({event:v,messages:x,state:b,agent:r,input:e}))),g();case M.REASONING_MESSAGE_START:{let h=yield Ge(n,i,p,(x,b,w)=>x.onReasoningMessageStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:x}=v;if(!i.find(b=>b.id===x)){let b={id:x,role:"reasoning",content:""};i.push(b),m({messages:i})}}return g()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:h,delta:x}=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:""}${x}`,m({messages:i})),g()}case M.REASONING_MESSAGE_END:{let{messageId:h}=v,x=i.find(b=>b.id===h);return x?(m(yield Ge(n,i,p,(b,w,R)=>b.onReasoningMessageEndEvent?.({event:v,messages:w,state:R,agent:r,input:e,reasoningMessageBuffer:typeof x.content=="string"?x.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:x,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,x,b)=>h.onReasoningEndEvent?.({event:v,messages:x,state:b,agent:r,input:e}))),g();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:h,entityId:x,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===x);if(I){I.encryptedValue=b,R=!0;break}}}else{let E=i.find(I=>I.id===x);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)}}()),mA(),n.length>0?gA({}):v=>v)},_A=e=>t=>{let r=ql(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 x=h.type;if(r?.event("VERIFY","Event:",h,{type:h.type}),i)return Ze(()=>new nt(`Cannot send event type '${x}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&x!==M.RUN_ERROR&&x!==M.RUN_STARTED)return Ze(()=>new nt(`Cannot send event type '${x}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(p){if(x===M.RUN_STARTED){if(v&&!a)return Ze(()=>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,x!==M.RUN_STARTED&&x!==M.RUN_ERROR)return Ze(()=>new nt("First event must be 'RUN_STARTED'"));switch(x){case M.TEXT_MESSAGE_START:{let b=h.messageId;return n.has(b)?Ze(()=>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):Ze(()=>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)):Ze(()=>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)?Ze(()=>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):Ze(()=>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)):Ze(()=>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)?Ze(()=>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)):Ze(()=>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 Ze(()=>new nt(`Cannot send 'RUN_FINISHED' while steps are still active: ${b}`))}if(n.size>0){let b=Array.from(n.keys()).join(", ");return Ze(()=>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 Ze(()=>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?Ze(()=>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)):Ze(()=>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):Ze(()=>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)):Ze(()=>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?Ze(()=>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)):Ze(()=>new nt("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return ot(h)}}))},si=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),jQ=(e,t)=>pm(()=>oi(S(e,t))).pipe(hA(r=>{if(!r.ok){let a=r.headers.get("content-type")||"";return oi(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,Ze(()=>f)}))}let n={type:si.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new Je(a=>(a.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:p}=yield o.read();if(i)break;let f={type:si.DATA,data:p};a.next(f)}a.complete()}catch(i){a.error(i)}})(),()=>{o.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):Ze(()=>Error("Failed to getReader() from response"))})),LQ=(e,t)=>{let r=ql(t),n=new gn,o=new TextDecoder("utf-8",{fatal:!1}),a="";e.subscribe({next:p=>{if(p.type!==si.HEADERS&&p.type===si.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(`
38
+ Patch operations: ${JSON.stringify(C,null,2)}
39
+ Error: ${w}`)}}return g()}case M.MESSAGES_SNAPSHOT:{let h=yield $e(n,i,p,(C,b,w)=>C.onMessagesSnapshotEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messages:C}=v,b=new Map(C.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 C)R.has(E.id)||i.push(E);m({messages:i})}return g()}case M.ACTIVITY_SNAPSHOT:{let h=v,C=i.findIndex(I=>I.id===h.messageId),b=C>=0?i[C]:void 0,w=b?.role==="activity"?b:void 0,R=h.replace??!0,E=yield $e(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;C===-1?(i.push(I),k=I):w?R&&(i[C]={...w,activityType:h.activityType,content:Le(h.content)}):R&&(i[C]=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,C=i.findIndex(E=>E.id===h.messageId);if(C===-1)return g();let b=i[C];if(b.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${h.messageId}' is not an activity message`),g();let w=b,R=yield $e(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=Kf.applyPatch(E,h.patch??[],!0,!1).newDocument;i[C]={...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 $e(n,i,p,(h,C,b)=>h.onRawEvent?.({event:v,messages:C,state:b,agent:r,input:e}))),g();case M.CUSTOM:return m(yield $e(n,i,p,(h,C,b)=>h.onCustomEvent?.({event:v,messages:C,state:b,agent:r,input:e}))),g();case M.RUN_STARTED:{let h=yield $e(n,i,p,(C,b,w)=>C.onRunStartedEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let C=v;if(C.input?.messages){for(let b of C.input.messages)i.find(w=>w.id===b.id)||i.push(b);m({messages:i})}}return g()}case M.RUN_FINISHED:return m(yield $e(n,i,p,(h,C,b)=>h.onRunFinishedEvent?.({event:v,messages:C,state:b,agent:r,input:e,result:v.result}))),g();case M.RUN_ERROR:return m(yield $e(n,i,p,(h,C,b)=>h.onRunErrorEvent?.({event:v,messages:C,state:b,agent:r,input:e}))),g();case M.STEP_STARTED:return m(yield $e(n,i,p,(h,C,b)=>h.onStepStartedEvent?.({event:v,messages:C,state:b,agent:r,input:e}))),g();case M.STEP_FINISHED:return m(yield $e(n,i,p,(h,C,b)=>h.onStepFinishedEvent?.({event:v,messages:C,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 $e(n,i,p,(h,C,b)=>h.onReasoningStartEvent?.({event:v,messages:C,state:b,agent:r,input:e}))),g();case M.REASONING_MESSAGE_START:{let h=yield $e(n,i,p,(C,b,w)=>C.onReasoningMessageStartEvent?.({event:v,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:C}=v;if(!i.find(b=>b.id===C)){let b={id:C,role:"reasoning",content:""};i.push(b),m({messages:i})}}return g()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:h,delta:C}=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 $e(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:""}${C}`,m({messages:i})),g()}case M.REASONING_MESSAGE_END:{let{messageId:h}=v,C=i.find(b=>b.id===h);return C?(m(yield $e(n,i,p,(b,w,R)=>b.onReasoningMessageEndEvent?.({event:v,messages:w,state:R,agent:r,input:e,reasoningMessageBuffer:typeof C.content=="string"?C.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:C,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 $e(n,i,p,(h,C,b)=>h.onReasoningEndEvent?.({event:v,messages:C,state:b,agent:r,input:e}))),g();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:h,entityId:C,encryptedValue:b}=v,w=yield $e(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===C);if(I){I.encryptedValue=b,R=!0;break}}}else{let E=i.find(I=>I.id===C);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)}}()),bA(),n.length>0?wA({}):v=>v)},QA=e=>t=>{let r=Vl(e),n=new Map,o=new Map,a=!1,i=!1,p=!1,f=new Map,m=!1,g=!1,v=!1,x=()=>{n.clear(),o.clear(),f.clear(),m=!1,g=!1,a=!1,i=!1,v=!0};return t.pipe(nr(h=>{let C=h.type;if(r?.event("VERIFY","Event:",h,{type:h.type}),i)return Ze(()=>new nt(`Cannot send event type '${C}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&C!==M.RUN_ERROR&&C!==M.RUN_STARTED)return Ze(()=>new nt(`Cannot send event type '${C}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(p){if(C===M.RUN_STARTED){if(v&&!a)return Ze(()=>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&&x()}}else if(p=!0,C!==M.RUN_STARTED&&C!==M.RUN_ERROR)return Ze(()=>new nt("First event must be 'RUN_STARTED'"));switch(C){case M.TEXT_MESSAGE_START:{let b=h.messageId;return n.has(b)?Ze(()=>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):Ze(()=>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)):Ze(()=>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)?Ze(()=>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):Ze(()=>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)):Ze(()=>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)?Ze(()=>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)):Ze(()=>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 Ze(()=>new nt(`Cannot send 'RUN_FINISHED' while steps are still active: ${b}`))}if(n.size>0){let b=Array.from(n.keys()).join(", ");return Ze(()=>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 Ze(()=>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?Ze(()=>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)):Ze(()=>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):Ze(()=>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)):Ze(()=>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?Ze(()=>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)):Ze(()=>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}({}),KQ=(e,t)=>Sm(()=>ni(S(e,t))).pipe(RA(r=>{if(!r.ok){let a=r.headers.get("content-type")||"";return ni(r.text()).pipe(nr(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,Ze(()=>f)}))}let n={type:ii.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new Xe(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})})):Ze(()=>Error("Failed to getReader() from response"))})),YQ=(e,t)=>{let r=Vl(t),n=new hn,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
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()},UQ=e=>{let t=new gn,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==si.HEADERS&&o.type===si.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=gI(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=ql(t),n=new gn,o=new Xf,a=!1;return e.subscribe({next:i=>{if(o.next(i),i.type===si.HEADERS&&!a){a=!0;let p=i.headers.get("content-type");r?.lifecycle("HTTP","Stream format detected:",{contentType:p,parser:p===TA?"protobuf":"sse"}),p===TA?UQ(o).subscribe({next:f=>n.next(f),error:f=>n.error(f),complete:()=>n.complete()}):LQ(o,r).subscribe({next:f=>{try{let m=Df.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"]),BQ=F.enum(["LangGraphInterruptEvent","PredictState","Exit"]),GQ=F.object({type:F.literal(Ye.enum.TextMessageStart),messageId:F.string(),parentMessageId:F.string().optional(),role:F.string().optional()}),$Q=F.object({type:F.literal(Ye.enum.TextMessageContent),messageId:F.string(),content:F.string()}),HQ=F.object({type:F.literal(Ye.enum.TextMessageEnd),messageId:F.string()}),zQ=F.object({type:F.literal(Ye.enum.ActionExecutionStart),actionExecutionId:F.string(),actionName:F.string(),parentMessageId:F.string().optional()}),WQ=F.object({type:F.literal(Ye.enum.ActionExecutionArgs),actionExecutionId:F.string(),args:F.string()}),KQ=F.object({type:F.literal(Ye.enum.ActionExecutionEnd),actionExecutionId:F.string()}),YQ=F.object({type:F.literal(Ye.enum.ActionExecutionResult),actionName:F.string(),actionExecutionId:F.string(),result:F.string()}),XQ=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()}),JQ=F.object({type:F.literal(Ye.enum.MetaEvent),name:BQ,value:F.any()}),ZQ=F.object({type:F.literal(Ye.enum.RunError),message:F.string(),code:F.string().optional()});F.discriminatedUnion("type",[GQ,$Q,HQ,zQ,WQ,KQ,YQ,XQ,JQ,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 eB=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
- `)},tB=(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 x=h;return[{type:Ye.enum.TextMessageStart,messageId:x.messageId,role:x.role}]}case M.TEXT_MESSAGE_CONTENT:{let x=h;return[{type:Ye.enum.TextMessageContent,messageId:x.messageId,content:x.delta}]}case M.TEXT_MESSAGE_END:{let x=h;return[{type:Ye.enum.TextMessageEnd,messageId:x.messageId}]}case M.TOOL_CALL_START:{let x=h;return g.push({id:x.toolCallId,type:"function",function:{name:x.toolCallName,arguments:""}}),i=!0,v[x.toolCallId]=x.toolCallName,[{type:Ye.enum.ActionExecutionStart,actionExecutionId:x.toolCallId,actionName:x.toolCallName,parentMessageId:x.parentMessageId}]}case M.TOOL_CALL_ARGS:{let x=h,b=g.find(R=>R.id===x.toolCallId);if(!b)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${x.toolCallId}'`),[];b.function.arguments+=x.delta;let w=!1;if(m){let R=m.find(E=>E.tool==b.function.name);if(R)try{let E=JSON.parse(gm(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:x.toolCallId,args:x.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 x=h;return[{type:Ye.enum.ActionExecutionEnd,actionExecutionId:x.toolCallId}]}case M.TOOL_CALL_RESULT:{let x=h;return[{type:Ye.enum.ActionExecutionResult,actionExecutionId:x.toolCallId,result:x.content,actionName:v[x.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let x=h;switch(x.name){case"Exit":a=!1;break;case"PredictState":m=x.value;break}return[{type:Ye.enum.MetaEvent,name:x.name,value:x.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 x=h,b=Bf.applyPatch(o,x.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:rB(f)}:{})}),active:!1}];case M.RUN_ERROR:{let x=h;return[{type:Ye.enum.RunError,message:x.message,code:x.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 rB(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=eB(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 Ym=e=>t=>{let r=ql(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 x=v,b=[];if((i!=="tool"||x.toolCallId!==void 0&&x.toolCallId!==o?.toolCallId)&&b.push(...g()),i!=="tool"){if(x.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(x.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");o={toolCallId:x.toolCallId,toolCallName:x.toolCallName,parentMessageId:x.parentMessageId},i="tool";let E={type:M.TOOL_CALL_START,toolCallId:x.toolCallId,toolCallName:x.toolCallName,parentMessageId:x.parentMessageId};b.push(E),r?.event("TRANSFORM","TOOL_CALL_START",E,{toolCallId:x.toolCallId,toolCallName:x.toolCallName})}if(x.delta!==void 0){let E={type:M.TOOL_CALL_ARGS,toolCallId:o.toolCallId,delta:x.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,[]}),ii(()=>{g()}))},Xm=class{runNext(e,t){return t.run(e).pipe(Ym(!1))}runNextWithState(e,t){let r=Le(e.messages||[]),n=Le(e.state||{}),o=new Xf;return bI(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(fm(/*#__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)}}()))}},nB=class extends Xm{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function oB(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 aB=class extends Xm{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(oB)};return this.runNext(o,t)}},SI="THINKING_START",vI="THINKING_END",AI="THINKING_TEXT_MESSAGE_START",xI="THINKING_TEXT_MESSAGE_CONTENT",CI="THINKING_TEXT_MESSAGE_END",iB=class extends Xm{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(ai(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case SI:{this.currentReasoningId=Dl();let{title:t,...r}=e;return this.warnAboutTransformation(SI,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case AI:return this.currentMessageId=Dl(),this.warnAboutTransformation(AI,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case xI:{let{delta:t,...r}=e;return this.warnAboutTransformation(xI,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Dl(),delta:t}}case CI:{let t=this.currentMessageId??Dl();return this.warnAboutTransformation(CI,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case vI:{let t=this.currentReasoningId??Dl();return this.warnAboutTransformation(vI,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}};function sB(e){return e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":"document"}function cB(e){return typeof e=="object"&&!!e&&"type"in e&&e.type==="binary"&&"mimeType"in e&&typeof e.mimeType=="string"}function uB(e){let t=sB(e.mimeType);return e.data?{type:t,source:{type:"data",value:e.data,mimeType:e.mimeType},...(e.filename?{metadata:{filename:e.filename}}:{})}:e.url?{type:t,source:{type:"url",value:e.url,mimeType:e.mimeType},...(e.filename?{metadata:{filename:e.filename}}:{})}:e}function lB(e){let t=e.content;if(!Array.isArray(t))return e;let r=t.map(n=>cB(n)?uB(n):n);return{...e,content:r}}var dB=class extends Xm{run(e,t){let r={...e,messages:e.messages.map(lB)};return this.runNext(r,t)}},pB="0.0.53",fB=class{get maxVersion(){return pB}get debug(){return this._debug}set debug(e){this._debug=Km(e),this._debugLogger=OA(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){typeof e=="boolean"?this._debugLogger=e?OA(Km(!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??Lo(),this.messages=Le(n??[]),this.state=Le(o??{}),this._debug=Km(a),this._debugLogger=OA(this._debug),Nl(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new aB),Nl(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new iB),Nl(this.maxVersion,"0.0.47")<=0&&this.middlewares.unshift(new dB)}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 nB(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??Lo();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 dm(Yf(()=>_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),Ym(_this28.debugLogger),_A(_this28.debugLogger),f=>f.pipe(mm(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),kl(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))),ii(()=>{_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 tA}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??Lo();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 dm(Yf(()=>pm(()=>_this29.connect(r)),Ym(_this29.debugLogger),_A(_this29.debugLogger),f=>f.pipe(mm(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),kl(f=>(_this29.isRunning=!1,f instanceof tA?Jf:_this29.onError(r,f,a))),ii(()=>{_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 bI(e,t,this,r,this.debugLogger)}processApplyEvents(e,t,r){return t.pipe(yA(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||Lo(),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 oi(Ge(r,this.messages,this.state,(n,o,a)=>n.onRunFailed?.({error:t,messages:o,state:a,agent:this,input:e}))).pipe(ai(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??Lo();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(Ym(this.debugLogger),_A(this.debugLogger),tB(this.threadId,t.runId,this.agentId),r=>r.pipe(ai(n=>(this.debugLogger?.event("LEGACY","Event:",n,{type:n.type}),n))))}},Jm=class extends fB{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(jQ(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 Zm=(e,t,r)=>{let n=mr(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 qA=class extends Jm{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}}},wI=(e,t,r)=>new qA({url:`${Zm(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var mB=new U({required:!0}),RI=new U({required:!0,constrainTo:cf}),FI=e=>({...e,name:uf(e.name)}),eg=P("followUpAnswers/setIsEnabled",e=>O(e,new pe({required:!0}))),tg=P("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,W)),rg=P("followUpAnswers/setFollowUpAnswersConversationToken",e=>O(e,W)),ng=P("followUpAnswers/clearFollowUpAnswersConversationToken"),og=P("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:W})),Ml=P("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,W)),ag=P("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:lf,answerId:W})),ig=P("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new pe({required:!0}),answerId:W})),sg=P("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new pe({required:!0}),answerId:W})),cg=P("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:mB,answerId:W})),ug=P("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new ie({required:!0,each:new J({values:Qv})}),answerId:W})),lg=P("followUpAnswers/followUpCompleted",e=>O(e,{answerId:W,cannotAnswer:new pe({required:!1})})),dg=P("followUpAnswers/followUpFailed",e=>O(e,{message:new U,code:new re({min:0}),answerId:W})),pg=P("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new U})),fg=P("followUpAnswers/likeFollowUp",e=>O(e,{answerId:W})),mg=P("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:W})),EI=P("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:W})),gg=P("followUpAnswers/resetFollowUpAnswers"),hg=P("followUpAnswers/stepStarted",e=>O(FI(e),{answerId:W,name:RI,startedAt:new re({min:0,required:!0})})),yg=P("followUpAnswers/stepFinished",e=>O(FI(e),{answerId:W,name:RI,finishedAt:new re({min:0,required:!0})}));d();c();l();u();var gB={"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 Sg(e){return e?gB[e]??1004:1004}function hB(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 ci(e){if(e)return hB({...e})}var II=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(js(n.runId)),e(un(!1)),e(Oa(!0)),e(tg(n.threadId)),e(ng())},onStepStartedEvent:({event:n})=>{e(xf({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n})=>{e(Cf({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(_a({textDelta:n.delta}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(qa(a.contentFormat)),typeof a?.followUpEnabled=="boolean"&&e(eg(a.followUpEnabled)),a?.conversationToken&&e(rg(a.conversationToken));return}case"citations":{e(Na({citations:a.citations}));return}}},onRunErrorEvent:({event:n})=>{let o=Sg(n.code);e(Da({message:n.message,code:o}))},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(xl(o)),e(Ma(!o)),e(Oa(!1)),e(Jn(o,t,a)),e(Vo())}}};var vg=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,o,a){t();let i=mp(n),p=pp(n),f=fp(n),m=dp(n),g=Fw(n),v=wI(i,p,f);e=v;let C=II(o),h=vF(n,a());try{o(un(!0)),yield v.runAgent({forwardedProps:{params:h,accessToken:m,recordDebugSession:g}},C)}catch(x){o(un(!1)),o(Da({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",x)}});return function run(_x146,_x147,_x148){return _ref64.apply(this,arguments)}}(),abortRun:t}};var TI=e=>{let t=Ib({extra:e}),r=vg();return t.startListening({actionCreator:z.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,o){let a=o.getState();if(!WS(a))return;r.abortRun(),o.dispatch(lr()),o.dispatch(gg());let i=ka(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 PI=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)},kI=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var MA=(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 OI(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=oC(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(Li({...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 VA(e){if(!e||!yB(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 _I(e,t=60){if(!e)return!1;let r=VA(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function yB(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function DI(e,t){let r=0,n=null,o=gd(()=>{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=vB(m);if(!(!g||!_I(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."),NI(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."),NI(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 Vi().name}function NI(e,t){e.dispatch(ks({status:401,statusCode:401,message:t.message,type:t.name}))}function vB(e){return e.configuration.accessToken}d();c();l();u();function qI({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return mb({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(kI(n.logger))})}function AB(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},a={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return a.analyticsMode!=="next"&&nC()?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):a}function MI(e,t){let r={...e.reducers,configuration:me,version:EF},n=xB({...e,reducers:r},t,me),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(rn({accessToken:o,environment:a,organizationId:i}));let p=AB(e.configuration,n.logger);return p&&n.dispatch(Ro(p)),n}function xB(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=OI({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return Yu(m.state,o)},get navigatorContext(){return MA(this.relay,o)}},f=CB(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(us())},disableAnalytics(){f.dispatch(cs())},get state(){return f.getState()},get relay(){return Yu(this.state,o)},get navigatorContext(){return MA(this.relay,o)},logger:i,store:f};return m}function CB(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=bB(e,t.logger,()=>t.navigatorContext);return qI({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function bB(e,t,r){let{renewAccessToken:n}=e.configuration,o=DI(t,n),a=TI({getNavigatorContext:r});return[qF,o,PI(t),TF].concat(Va.middleware,a.middleware,e.middlewares||[])}var wB=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
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()},JQ=e=>{let t=new hn,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=FI(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()},XQ=(e,t)=>{let r=Vl(t),n=new hn,o=new nm,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===VA?"protobuf":"sse"}),p===VA?JQ(o).subscribe({next:f=>n.next(f),error:f=>n.error(f),complete:()=>n.complete()}):YQ(o,r).subscribe({next:f=>{try{let m=Uf.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"]),ZQ=F.enum(["LangGraphInterruptEvent","PredictState","Exit"]),eB=F.object({type:F.literal(Ye.enum.TextMessageStart),messageId:F.string(),parentMessageId:F.string().optional(),role:F.string().optional()}),tB=F.object({type:F.literal(Ye.enum.TextMessageContent),messageId:F.string(),content:F.string()}),rB=F.object({type:F.literal(Ye.enum.TextMessageEnd),messageId:F.string()}),nB=F.object({type:F.literal(Ye.enum.ActionExecutionStart),actionExecutionId:F.string(),actionName:F.string(),parentMessageId:F.string().optional()}),oB=F.object({type:F.literal(Ye.enum.ActionExecutionArgs),actionExecutionId:F.string(),args:F.string()}),aB=F.object({type:F.literal(Ye.enum.ActionExecutionEnd),actionExecutionId:F.string()}),iB=F.object({type:F.literal(Ye.enum.ActionExecutionResult),actionName:F.string(),actionExecutionId:F.string(),result:F.string()}),sB=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()}),cB=F.object({type:F.literal(Ye.enum.MetaEvent),name:ZQ,value:F.any()}),uB=F.object({type:F.literal(Ye.enum.RunError),message:F.string(),code:F.string().optional()});F.discriminatedUnion("type",[eB,tB,rB,nB,oB,aB,iB,sB,cB,uB]),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 lB=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
+ `)},dB=(e,t,r)=>n=>{let o={},a=!0,i=!0,p="",f=null,m=null,g=[],v={},x=h=>{typeof h=="object"&&h&&("messages"in h&&delete h.messages,o=h)};return n.pipe(nr(h=>{switch(h.type){case M.TEXT_MESSAGE_START:{let C=h;return[{type:Ye.enum.TextMessageStart,messageId:C.messageId,role:C.role}]}case M.TEXT_MESSAGE_CONTENT:{let C=h;return[{type:Ye.enum.TextMessageContent,messageId:C.messageId,content:C.delta}]}case M.TEXT_MESSAGE_END:{let C=h;return[{type:Ye.enum.TextMessageEnd,messageId:C.messageId}]}case M.TOOL_CALL_START:{let C=h;return g.push({id:C.toolCallId,type:"function",function:{name:C.toolCallName,arguments:""}}),i=!0,v[C.toolCallId]=C.toolCallName,[{type:Ye.enum.ActionExecutionStart,actionExecutionId:C.toolCallId,actionName:C.toolCallName,parentMessageId:C.parentMessageId}]}case M.TOOL_CALL_ARGS:{let C=h,b=g.find(R=>R.id===C.toolCallId);if(!b)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${C.toolCallId}'`),[];b.function.arguments+=C.delta;let w=!1;if(m){let R=m.find(E=>E.tool==b.function.name);if(R)try{let E=JSON.parse(Cm(b.function.arguments));R.tool_argument&&R.tool_argument in E?(x({...o,[R.state_key]:E[R.tool_argument]}),w=!0):R.tool_argument||(x({...o,[R.state_key]:E}),w=!0)}catch{}}return[{type:Ye.enum.ActionExecutionArgs,actionExecutionId:C.toolCallId,args:C.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 C=h;return[{type:Ye.enum.ActionExecutionEnd,actionExecutionId:C.toolCallId}]}case M.TOOL_CALL_RESULT:{let C=h;return[{type:Ye.enum.ActionExecutionResult,actionExecutionId:C.toolCallId,result:C.content,actionName:v[C.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let C=h;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 x(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 C=h,b=Kf.applyPatch(o,C.delta,!0,!1);return b?(x(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:pB(f)}:{})}),active:!1}];case M.RUN_ERROR:{let C=h;return[{type:Ye.enum.RunError,message:C.message,code:C.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 pB(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=lB(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 rg=e=>t=>{let r=Vl(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(nr(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 x=v,h=[];if((i!=="text"||x.messageId!==void 0&&x.messageId!==n?.messageId)&&h.push(...g()),i!=="text"){if(x.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");n={messageId:x.messageId,name:x.name},i="text";let E={type:M.TEXT_MESSAGE_START,messageId:x.messageId,role:x.role||"assistant",...(x.name!==void 0&&{name:x.name})};h.push(E),r?.event("TRANSFORM","TEXT_MESSAGE_START",E,{messageId:x.messageId})}if(x.delta!==void 0){let E={type:M.TEXT_MESSAGE_CONTENT,messageId:n.messageId,delta:x.delta};h.push(E),r?.event("TRANSFORM","TEXT_MESSAGE_CONTENT",E,{messageId:n.messageId})}return h;case M.TOOL_CALL_CHUNK:let C=v,b=[];if((i!=="tool"||C.toolCallId!==void 0&&C.toolCallId!==o?.toolCallId)&&b.push(...g()),i!=="tool"){if(C.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(C.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");o={toolCallId:C.toolCallId,toolCallName:C.toolCallName,parentMessageId:C.parentMessageId},i="tool";let E={type:M.TOOL_CALL_START,toolCallId:C.toolCallId,toolCallName:C.toolCallName,parentMessageId:C.parentMessageId};b.push(E),r?.event("TRANSFORM","TOOL_CALL_START",E,{toolCallId:C.toolCallId,toolCallName:C.toolCallName})}if(C.delta!==void 0){let E={type:M.TOOL_CALL_ARGS,toolCallId:o.toolCallId,delta:C.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()}))},ng=class{runNext(e,t){return t.run(e).pipe(rg(!1))}runNextWithState(e,t){let r=Le(e.messages||[]),n=Le(e.state||{}),o=new nm;return NI(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(vm(/*#__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)}}()))}},fB=class extends ng{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function mB(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 gB=class extends ng{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(mB)};return this.runNext(o,t)}},TI="THINKING_START",PI="THINKING_END",kI="THINKING_TEXT_MESSAGE_START",OI="THINKING_TEXT_MESSAGE_CONTENT",_I="THINKING_TEXT_MESSAGE_END",hB=class extends ng{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 TI:{this.currentReasoningId=Ml();let{title:t,...r}=e;return this.warnAboutTransformation(TI,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case kI:return this.currentMessageId=Ml(),this.warnAboutTransformation(kI,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case OI:{let{delta:t,...r}=e;return this.warnAboutTransformation(OI,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Ml(),delta:t}}case _I:{let t=this.currentMessageId??Ml();return this.warnAboutTransformation(_I,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case PI:{let t=this.currentReasoningId??Ml();return this.warnAboutTransformation(PI,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}};function yB(e){return e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":"document"}function SB(e){return typeof e=="object"&&!!e&&"type"in e&&e.type==="binary"&&"mimeType"in e&&typeof e.mimeType=="string"}function vB(e){let t=yB(e.mimeType);return e.data?{type:t,source:{type:"data",value:e.data,mimeType:e.mimeType},...(e.filename?{metadata:{filename:e.filename}}:{})}:e.url?{type:t,source:{type:"url",value:e.url,mimeType:e.mimeType},...(e.filename?{metadata:{filename:e.filename}}:{})}:e}function AB(e){let t=e.content;if(!Array.isArray(t))return e;let r=t.map(n=>SB(n)?vB(n):n);return{...e,content:r}}var CB=class extends ng{run(e,t){let r={...e,messages:e.messages.map(AB)};return this.runNext(r,t)}},xB="0.0.53",bB=class{get maxVersion(){return xB}get debug(){return this._debug}set debug(e){this._debug=tg(e),this._debugLogger=UA(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){typeof e=="boolean"?this._debugLogger=e?UA(tg(!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??Lo(),this.messages=Le(n??[]),this.state=Le(o??{}),this._debug=tg(a),this._debugLogger=UA(this._debug),ql(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new gB),ql(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new hB),ql(this.maxVersion,"0.0.47")<=0&&this.middlewares.unshift(new CB)}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 fB(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??Lo();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 hn;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield ym(rm(()=>_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),rg(_this28.debugLogger),QA(_this28.debugLogger),f=>f.pipe(Am(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),_l(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 lA}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??Lo();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 hn;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield ym(rm(()=>Sm(()=>_this29.connect(r)),rg(_this29.debugLogger),QA(_this29.debugLogger),f=>f.pipe(Am(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),_l(f=>(_this29.isRunning=!1,f instanceof lA?om:_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 NI(e,t,this,r,this.debugLogger)}processApplyEvents(e,t,r){return t.pipe(FA(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||Lo(),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 $e(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($e(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 $e(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??Lo();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(rg(this.debugLogger),QA(this.debugLogger),dB(this.threadId,t.runId,this.agentId),r=>r.pipe(oi(n=>(this.debugLogger?.event("LEGACY","Event:",n,{type:n.type}),n))))}},og=class extends bB{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 XQ(KQ(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 ag=(e,t,r)=>{let n=gr(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 $A=class extends og{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}}},DI=(e,t,r)=>new $A({url:`${ag(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var wB=new L({required:!0}),qI=new L({required:!0,constrainTo:df}),MI=e=>({...e,name:pf(e.name)}),ig=P("followUpAnswers/setIsEnabled",e=>O(e,new fe({required:!0}))),sg=P("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,z)),cg=P("followUpAnswers/setFollowUpAnswersConversationToken",e=>O(e,z)),ug=P("followUpAnswers/clearFollowUpAnswersConversationToken"),lg=P("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:z})),jl=P("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,z)),dg=P("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:mf,answerId:z})),pg=P("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new fe({required:!0}),answerId:z})),fg=P("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new fe({required:!0}),answerId:z})),mg=P("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:wB,answerId:z})),gg=P("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new ie({required:!0,each:new X({values:Jv})}),answerId:z})),hg=P("followUpAnswers/followUpCompleted",e=>O(e,{answerId:z,cannotAnswer:new fe({required:!1})})),yg=P("followUpAnswers/followUpFailed",e=>O(e,{message:new L,code:new re({min:0}),answerId:z})),Sg=P("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new L})),vg=P("followUpAnswers/likeFollowUp",e=>O(e,{answerId:z})),Ag=P("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:z})),VI=P("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:z})),Cg=P("followUpAnswers/resetFollowUpAnswers"),xg=P("followUpAnswers/stepStarted",e=>O(MI(e),{answerId:z,name:qI,startedAt:new re({min:0,required:!0})})),bg=P("followUpAnswers/stepFinished",e=>O(MI(e),{answerId:z,name:qI,finishedAt:new re({min:0,required:!0})})),wg=P("followUpAnswers/startToolCall",e=>O(e,{answerId:z,toolCallName:z,startedAt:new re({min:0,required:!0}),toolCallId:z})),Rg=P("followUpAnswers/finishToolCall",e=>O(e,{answerId:z,finishedAt:new re({min:0,required:!0}),toolCallId:z})),cc=P("followUpAnswers/toolCallArgs",e=>O(e,{answerId:z,toolCallId:z,args:new X({options:{required:!0}}),type:new L({required:!0,constrainTo:ff})}));d();c();l();u();var RB={"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 Fg(e){return e?RB[e]??1004:1004}function FB(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 FB({...e})}var jI=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Ls(n.runId)),e(ln(!1)),e(ka(!0)),e(sg(n.threadId)),e(ug())},onStepStartedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(Rf({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(Ff({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onToolCallStartEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallName:a,toolCallId:i,timestamp:p}=n;e(Ef({toolCallId:i,toolCallName:a,startedAt:p??Date.now()}))},onToolCallEndEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:a,timestamp:i}=n;e(If({toolCallId:a,finishedAt:i??Date.now()}))},onToolCallArgsEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:a,delta:i}=n;try{let p=JSON.parse(i);typeof p?.q=="string"?e(Qs({toolCallId:a,args:p,type:"search"})):e(Qs({toolCallId:a,args:{raw:i},type:"generic"}))}catch{console.warn(`Failed to parse tool call args delta as JSON. Using raw string instead. Delta: ${i}`),e(Qs({toolCallId:a,args:{raw:i},type:"generic"}))}},onTextMessageContentEvent:({event:n,agent:o})=>{o.isRunning!==!1&&(n.delta.length>0&&(r=!0),e(Oa({textDelta:n.delta})))},onCustomEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{name:a,value:i}=n;switch(a){case"header":{i?.contentFormat&&e(Da(i.contentFormat)),typeof i?.followUpEnabled=="boolean"&&e(ig(i.followUpEnabled)),i?.conversationToken&&e(cg(i.conversationToken));return}case"citations":{e(_a({citations:i.citations}));return}}},onRunErrorEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let a=Fg(n.code);e(Na({message:n.message,code:a}))},onRunFinishedEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let a=n.result?.completionReason==="ANSWERED",i=a?!r:void 0;e(bl(a)),e(qa(!a)),e(ka(!1)),e(Xn(a,t,i)),e(jo())}}};var Eg=()=>{let e,t=()=>{e&&(e.isRunning=!1,e.abortRun()),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,o,a){t();let i=hp(n),p=mp(n),f=gp(n),m=fp(n),g=Dw(n),v=DI(i,p,f);e=v;let x=jI(o),h=PF(n,a());try{o(ln(!0)),yield v.runAgent({forwardedProps:{params:h,accessToken:m,recordDebugSession:g}},x)}catch(C){o(ln(!1)),o(Na({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",C)}});return function run(_x146,_x147,_x148){return _ref64.apply(this,arguments)}}(),abortRun:t}};var LI=e=>{let t=Mb({extra:e}),r=Eg();return t.startListening({actionCreator:W.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,o){let a=o.getState();if(!rv(a))return;r.abortRun(),o.dispatch(dr()),o.dispatch(Cg());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 UI=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)},QI=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var HA=(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 BI(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=fx(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(ji({...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 zA(e){if(!e||!EB(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 GI(e,t=60){if(!e)return!1;let r=zA(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function EB(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function HI(e,t){let r=0,n=null,o=yd(()=>{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(x){if(!m)throw x;return null}})().finally(()=>{n=null}));let v=yield n;return g&&v&&f.dispatch(nn({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=TB(m);if(!(!g||!GI(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."),$I(f,m.error),m;!n&&(r++,o());try{yield a(f,!0)}catch(x){e.debug(x,"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",x=typeof t=="function";if(!v)return m(g);x&&(yield i(f));let h=yield m(g);return IB(h)?x?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."),$I(f,h.error),h):h});return function(_x156){return _ref70.apply(this,arguments)}}())}function IB(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Mi().name}function $I(e,t){e.dispatch(ks({status:401,statusCode:401,message:t.message,type:t.name}))}function TB(e){return e.configuration.accessToken}d();c();l();u();function zI({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return bb({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(QI(n.logger))})}function PB(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},a={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return a.analyticsMode!=="next"&&px()?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):a}function WI(e,t){let r={...e.reducers,configuration:me,version:VF},n=kB({...e,reducers:r},t,me),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(nn({accessToken:o,environment:a,organizationId:i}));let p=PB(e.configuration,n.logger);return p&&n.dispatch(Fo(p)),n}function kB(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=BI({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return Zu(m.state,o)},get navigatorContext(){return HA(this.relay,o)}},f=OB(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(us())},disableAnalytics(){f.dispatch(cs())},get state(){return f.getState()},get relay(){return Zu(this.state,o)},get navigatorContext(){return HA(this.relay,o)},logger:i,store:f};return m}function OB(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=_B(e,t.logger,()=>t.navigatorContext);return zI({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function _B(e,t,r){let{renewAccessToken:n}=e.configuration,o=HI(t,n),a=LI({getNavigatorContext:r});return[zF,o,UI(t),LF].concat(Ma.middleware,a.middleware,e.middlewares||[])}var NB=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
43
43
  However, this mode is not available for Coveo for Service features, and this configuration may not work as expected.
44
44
  Please switch back to the "legacy" analytics mode to ensure proper functionality.
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(wB)}d();c();l();u();var zI=Vr(HI(),1);function WI(e){return(0,zI.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function KI(e,t){let r=QB(e),n=gr,o=BB(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function QB(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function BB(e){return e.preprocessRequest||Sd}d();c();l();u();var GA=(e,t,r,n,o,a)=>{let i=e[t];fe(i)||fe(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}]`))},$A=(e,t)=>!(fe(e)||t===e),jl=e=>{let t=VA(e);return t||!1},JI=(e,t)=>($A(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),YI=(e,t,r,n)=>(GA(e,"searchHub",t.searchHub,Co(),r,n),JI(e,t)),ZI=(e,t)=>($A(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),XI=(e,t,r,n)=>(GA(e,"pipeline",t.pipeline,Kn(),r,n),ZI(e,t)),eT=(e,t)=>($A(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),GB=(e,t,r,n)=>(GA(e,"userDisplayName",t.configuration.analytics.userDisplayName,Qs().analytics.userDisplayName,r,n),eT(e,t)),tT=e=>ae({},t=>{t.addCase(Os,(r,n)=>{let o=jl(r.configuration.accessToken);return o?YI(o,r,n.payload,e):r}).addCase(fs,(r,n)=>{let o=jl(r.configuration.accessToken);return o?XI(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=jl(o);return a?[ZI,JI,eT].reduce((i,p)=>p(a,i),r):r}).addCase(vr,(r,n)=>{let o=jl(r.configuration.accessToken);if(!o)return r;let a=YI(o,r,n.payload.searchHub,e);return XI(o,a,n.payload?.pipeline,e)}).addCase(Ro,(r,n)=>{let o=jl(r.configuration.accessToken);return o?GB(o,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var rT={organizationId:W,accessToken:W,name:new U({required:!1,emptyAllowed:!1}),analytics:new J({options:{required:!1},values:{enabled:new pe({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 nT(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var oT=new Se({...rT,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 HA(){return{...nT(),search:{searchHub:"default"}}}var $B={debug:ps,pipeline:ms,searchHub:_s,search:he};function HB(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 aT(e){let t=WI(e.loggerOptions),{configuration:r}=e;zB(r,t);let n=WB(r,t),o=KB(t),a={...KI(r,t),apiClient:n,streamingClient:o},i={...e,reducers:$B,crossReducer:tT(t)},p=MI(i,a),f=HB(r);return f&&p.dispatch(vr(f)),{...p,get state(){return p.state},executeFirstSearch(m=Cp()){if(pl(p.state))return;let g=z({legacy:m,next:$w()});p.dispatch(g)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:g,metadata:v}=m;if(pl(p.state))return;let C=v&&g==="omniboxFromLink",h=z({legacy:C?wp(v):bp(),next:C?zw():Hw()});p.dispatch(h)}}}function zB(e,t){try{oT.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function WB(e,t){let{search:r}=e;return new Cd({logger:t,preprocessRequest:e.preprocessRequest||Sd,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||PC,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||kC,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||OC})}function KB(e){return new yd({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var li={value:W,numberOfResults:new re({min:0}),state:W};d();c();l();u();var ve=W;var ZB=new re({min:1,default:8,required:!1}),e1=new re({min:1,max:20,default:5,required:!1}),t1={desiredCount:e1,numberOfValues:ZB},sc=P("automaticFacet/setOptions",e=>O(e,t1)),cc=P("automaticFacet/deselectAll",e=>O(e,ve)),r1=W,hn=P("automaticFacet/toggleSelectValue",e=>O(e,{field:r1,selection:new J({values:li})}));d();c();l();u();d();c();l();u();var n1={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 pe({required:!1})};function zA(e){e.children.forEach(t=>{zA(t)}),gr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},n1)}var uc={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 pe({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 pe({required:!1})};var yn=P("categoryFacet/register",e=>O(e,uc)),Wo=P("categoryFacet/toggleSelectValue",e=>{try{return gr(e.facetId,W),zA(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:Bn(t)}}}),Sn=P("categoryFacet/deselectAll",e=>O(e,uc.facetId)),di=P("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:uc.facetId,numberOfValues:uc.numberOfValues})),lc=P("categoryFacet/updateSortCriterion",e=>O(e,{facetId:uc.facetId,criterion:new Qe})),Cg=P("categoryFacet/updateBasePath",e=>O(e,{facetId:uc.facetId,basePath:new ie({each:W})}));d();c();l();u();var o1={categoryFacetId:ve,categoryFacetPath:new ie({required:!0,each:W})},a1=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},bg=e=>X("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,o1),t.makeBreadcrumbFacet(a1(r,e)))),iT=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var Fe=P("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new pe({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 Ll={facetId:ve,captions:new J({options:{required:!1}}),numberOfValues:new re({required:!1,min:1}),query:new U({required:!1,emptyAllowed:!0})};var i1={path:new ie({required:!0,each:W}),displayValue:Be,rawValue:Be,count:new re({required:!0,min:0})},dc=P("categoryFacet/selectSearchResult",e=>O(e,{facetId:ve,value:new J({values:i1})})),pc=P("categoryFacetSearch/register",e=>O(e,Ll));d();c();l();u();function fc(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function mc(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function wg(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function Ul(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Rg(e,t,r){e.currentValues=s1(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function s1(e,t){if(!e.length)return[];let r=sT(e[0],t),n=r;for(let o of e.splice(1)){let a=sT(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function sT(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var vn=ae(Ji(),e=>{e.addCase(yn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=u1(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&&Rg(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&Rg(p,m,i.initialNumberOfValues)})}).addCase(lc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(Cg,(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=c1(i,f,a);if(m.length){let v=m[0];v.retrieveChildren=!0,v.state="selected",v.previousState="idle",v.children=[];return}let g=uT(o.value,a);g.state="selected",g.previousState="idle",m.push(g),i.numberOfValues=1}).addCase(Sn,(t,r)=>{let n=r.payload;Ul(t,n)}).addCase(ft,t=>{Object.keys(t).forEach(r=>Ul(t,r))}).addCase(nn,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(di,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,a=t[n]?.request;if(a){if(!a.currentValues.length)return wg(a,o);l1(t,r.payload)}}).addCase(dc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];Rg(a.request,i,a.initialNumberOfValues)}).addCase(wr.fulfilled,(t,r)=>{cT(t,r.payload.response.facets)}).addCase(z.fulfilled,(t,r)=>{cT(t,r.payload.response.facets)}).addCase(tt,(t,r)=>{Ul(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)&&Ul(t,o)})})}),Ql={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function c1(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=uT(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function u1(e){return{...Ql,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function uT(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function cT(e,t){t.forEach(r=>{if(!d1(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=p1(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function l1(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 d1(e,t){return t.facetId in e}function p1(e,t){let r=sr(e.currentValues),n=sr(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var An=new U({regex:/^[a-zA-Z0-9-_]+$/}),xn=new U({required:!0}),lT=new ie({each:new U}),dT=new U,pT=new pe,Cn=new pe,bn=new re({min:0}),zr=new re({min:1}),Fg=new pe({required:!0}),f1=new J,m1=new U,g1={captions:f1,numberOfValues:zr,query:m1},gc=new J({values:g1}),Eg=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})})}}),fT=new pe,Ig=new ie({min:1,max:25,required:!1,each:new U({emptyAllowed:!1,required:!0})});var h1={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 pe({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:Eg,customSort:Ig},wn=P("facet/register",e=>O(e,h1)),Rn=P("facet/toggleSelectValue",e=>O(e,{facetId:ve,selection:new J({values:li})})),Fn=P("facet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new J({values:li})})),rt=P("facet/deselectAll",e=>O(e,ve)),hc=P("facet/updateSortCriterion",e=>O(e,{facetId:ve,criterion:new Qe({required:!0})})),pi=P("facet/updateNumberOfValues",e=>O(e,{facetId:ve,numberOfValues:new re({required:!0,min:1})})),fi=P("facet/updateIsFieldExpanded",e=>O(e,{facetId:ve,isFieldExpanded:new pe({required:!0})})),ao=P("facet/updateFreezeCurrentValues",e=>O(e,{facetId:ve,freezeCurrentValues:new pe({required:!0})}));d();c();l();u();var yc=e=>X("analytics/facet/showMore",(t,r)=>{O(e,ve);let n=rs(e,cr(r));return t.makeFacetShowMore(n)}),Sc=e=>X("analytics/facet/showLess",(t,r)=>{O(e,ve);let n=rs(e,cr(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=cr(r),p={...rs(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),bt=e=>X("analytics/facet/reset",(t,r)=>{O(e,ve);let n=cr(r),o=rs(e,n);return t.makeFacetClearAll(o)}),it=e=>X("analytics/facet/select",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=cr(r),o=ns(e,n);return t.makeFacetSelect(o)}),pr=e=>X("analytics/facet/exclude",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=cr(r),o=ns(e,n);return t.makeFacetExclude(o)}),Wr=e=>X("analytics/facet/deselect",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=cr(r),o=ns(e,n);return t.makeFacetDeselect(o)}),io=e=>X("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=cr(r),o=ns(e,n);return t.makeFacetUnexclude(o)}),vc=e=>X("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:ve,facetValue:W});let n=ns(e,cr(r));return t.makeBreadcrumbFacet(n)}),Bt=()=>({actionCause:"facetClearAll"}),gt=()=>({actionCause:"facetSelect"}),so=()=>({actionCause:"facetExclude"}),co=()=>({actionCause:"facetDeselect"}),mT=()=>({actionCause:"facetUnexclude"}),Tg=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var gT={facetId:ve,value:new J({values:{displayValue:Be,rawValue:Be,count:new re({required:!0,min:0})}})},Pg=P("facetSearch/register",e=>O(e,Ll)),Ko=P("facetSearch/update",e=>O(e,Ll)),mi=P("facetSearch/toggleSelectValue",e=>O(e,gT)),gi=P("facetSearch/toggleExcludeValue",e=>O(e,gT));var Tr=ae(ts(),e=>{e.addCase(wn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=vw(y1(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(yT),...m.map(ST),...v.map(v1)],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){kg(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){kg(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)=>{mc(t[r.payload]?.request)}).addCase(ft,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>mc(r))}).addCase(gs,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>mc(r))}).addCase(nn,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(hc,(t,r)=>{fc(t,r.payload)}).addCase(pi,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;wg(t[n]?.request,o)}).addCase(fi,(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=>hT(t[o.facetId]?.request,o))}).addCase(wr.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>hT(t[o.facetId]?.request,o))}).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="selected";return}let m=yT(i);kg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(gi,(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=ST(i);kg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(tt,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];mc(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)&&mc(a.request)})})});function kg(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 hT(e,t){e&&(e.currentValues=t.values.map(S1),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var Bl={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function y1(e){return{...Bl,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 yT(e){return{value:e,state:"selected"}}function ST(e){return{value:e,state:"excluded"}}function v1(e){return{...e,state:"idle"}}d();c();l();u();var Og=()=>X("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function Yo(e){let t=vT(e.start,e),r=vT(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function vT(e,t){let{dateFormat:r}=t;return cR(e)?(Po(e),aR(e)):typeof e=="string"&&sn(e)?(Po(e),e):(_p(e,r),cl(Ra(e,r)))}d();c();l();u();var Ac=P("rangeFacet/updateSortCriterion",e=>O(e,{facetId:ve,criterion:new Qe({required:!0})}));d();c();l();u();var hi={state:W,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new pe({required:!0}),numberOfResults:new re({required:!0,min:0})},yi={start:W,end:W,endInclusive:new pe({required:!0}),state:W,numberOfResults:new re({required:!0,min:0})},Si=e=>({facetId:ve,selection:typeof e.start=="string"?new J({values:yi}):new J({values:hi})});var A1={start:W,end:W,endInclusive:new pe({required:!0}),state:W},x1={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:A1})}),generateAutomaticRanges:new pe({required:!0}),filterFacetCount:new pe({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 AT(e){return sn(e)?ll(e):e}function _g(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Yo(t);if(Ra(AT(r)).isAfter(Ra(AT(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,x1),_g(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:yi})})),Pn=P("dateFacet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new J({values:yi})})),uo=P("dateFacet/updateFacetValues",e=>{try{return gr(e,{facetId:ve,values:new ie({each:new J({values:yi})})}),_g({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Bn(t)}}}),Ng=Ac,Dg=rt;d();c();l();u();d();c();l();u();var qg=(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}`}},Mg=()=>({actionCause:"breadcrumbFacet"});var Gl=e=>X("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,Si(e.selection));let n=qg(r,e);return t.makeBreadcrumbFacet(n)}),WA=Mg;d();c();l();u();function C1(e,t){return!!t&&t.facetId in e.dateFacetSet}var xT=(e,t)=>{let r=Lr(e,t);if(C1(e,r))return r},CT=(e,t)=>(xT(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),bT=(e,t)=>(xT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var jg={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function Lg(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=wT(r);r.numberOfValues=o,e[n]=t}function Ug(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=wT(n))}function Qg(e,t,r){let n=e[t]?.request;if(!n)return;let o=Vg(n.currentValues,r);if(!o)return;let a=o.state==="selected";o.previousState=o.state,o.state=a?"idle":"selected",n.preventAutoSelect=!0}function Bg(e,t,r){let n=e[t]?.request;if(!n)return;let o=Vg(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 Gg(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(!!Vg(o,p)?p.state="selected":typeof t=="object"&&r in t&&p.state!=="idle"&&(p.previousState=p.state,p.state="idle"),p));let a=o.filter(p=>!Vg(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function $g(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 Vg(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function wT(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var On=ae(Zi(),e=>{e.addCase(In,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=b1(n);Lg(t,yw(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.df||{};Gg(t,n)}).addCase(Tn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Qg(t,n,o)}).addCase(Pn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Bg(t,n,o)}).addCase(uo,(t,r)=>{let{facetId:n,values:o}=r.payload;Ug(t,n,o)}).addCase(Dg,(t,r)=>{kn(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{kn(t,r)})}).addCase(Ng,(t,r)=>{fc(t,r.payload)}).addCase(z.fulfilled,(t,r)=>{let n=r.payload.response.facets;$g(t,n,w1)}).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 b1(e){return{...jg,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function w1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var R1={state:W,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new pe({required:!0})},F1={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:R1})}),generateAutomaticRanges:new pe({required:!0}),filterFacetCount:new pe({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 Hg(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,F1),Hg(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:hi})})),Dn=P("numericFacet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new J({values:hi})})),lo=P("numericFacet/updateFacetValues",e=>{try{return gr(e,{facetId:ve,values:new ie({each:new J({values:hi})})}),Hg({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Bn(t)}}}),zg=Ac,Wg=rt;d();c();l();u();var $l=e=>X("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,Si(e.selection));let n=qg(r,e);return t.makeBreadcrumbFacet(n)}),KA=Mg;d();c();l();u();function E1(e,t){return!!t&&t.facetId in e.numericFacetSet}var RT=(e,t)=>{let r=Lr(e,t);if(E1(e,r))return r},FT=(e,t)=>(RT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),ET=(e,t)=>(RT(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var Pr=ae(es(),e=>{e.addCase(_n,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=I1(n);Lg(t,Sw(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.nf||{};Gg(t,n)}).addCase(Nn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Qg(t,n,o)}).addCase(Dn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Bg(t,n,o)}).addCase(lo,(t,r)=>{let{facetId:n,values:o}=r.payload;Ug(t,n,o)}).addCase(Wg,(t,r)=>{kn(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{kn(t,r)})}).addCase(zg,(t,r)=>{fc(t,r.payload)}).addCase(z.fulfilled,(t,r)=>{let n=r.payload.response.facets;$g(t,n,T1)}).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 I1(e){return{...jg,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function T1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var vi=W,Kg=new J({options:{required:!0},values:{caption:Be,expression:Be,state:new U({constrainTo:["idle","selected","excluded"]})}}),Yg=new ie({required:!0,each:Kg});var xc=P("staticFilter/register",e=>O(e,{id:vi,values:Yg})),po=P("staticFilter/toggleSelect",e=>O(e,{id:vi,value:Kg})),fo=P("staticFilter/toggleExclude",e=>O(e,{id:vi,value:Kg})),Xo=P("staticFilter/deselectAllFilterValues",e=>O(e,vi)),Xg=e=>X("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),Cc=e=>X("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),Jg=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 Zg=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 IT(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 TT(e){if(!P1(e))throw K;let t=IT(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:vc({facetId:R,facetValue:E.value}),next:Tg()}))},executeToggleExclude:({facetId:R,selection:E})=>{r(Fn({facetId:R,selection:E})),r(ao({facetId:R,freezeCurrentValues:!1})),r(z({legacy:vc({facetId:R,facetValue:E.value}),next:Tg()}))},facetValuesSelector:mw};return Zg(w)},a=()=>{let w={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:R=>{r(Nn(R)),r(z({legacy:$l(R),next:KA()}))},executeToggleExclude:R=>{r(Dn(R)),r(z({legacy:$l(R),next:KA()}))},facetValuesSelector:FT};return Zg(w)},i=()=>{let w={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:R=>{r(Tn(R)),r(z({legacy:Gl(R),next:WA()}))},executeToggleExclude:R=>{r(Pn(R)),r(z({legacy:Gl(R),next:WA()}))},facetValuesSelector:bT};return Zg(w)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(w=>w.path.length),f=w=>{let R=hw(n(),w);return{facetId:w,field:n().categoryFacetSet[w].request.field,path:R,deselect:()=>{r(Sn(w)),r(z({legacy:bg({categoryFacetPath:R.map(E=>E.value),categoryFacetId:w}),next:iT()}))}}},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:Cc({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=>x(R,k));return{facetId:R,field:R,label:E,values:I}},x=(w,R)=>({value:R,deselect:()=>{r(hn({field:w,selection:R})),r(z({legacy:vc({facetId:w,facetValue:R.value}),next:Tg()}))}});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:Og(),next:{actionCause:"breadcrumbResetAll"}}))}}}function P1(e){return e.addReducers({configuration:me,search:he,facetSet:Tr,numericFacetSet:Pr,dateFacetSet:On,categoryFacetSet:vn}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var k1=new ie({each:W,required:!0}),PT=(e,t)=>(O(e,W),_i(t)?O(t,W):O(t,k1),{payload:{contextKey:e,contextValue:t}}),Ai=P("context/set",e=>{for(let[t,r]of Object.entries(e))PT(t,r);return{payload:e}}),xi=P("context/add",e=>PT(e.contextKey,e.contextValue)),Ci=P("context/remove",e=>O(e,W));d();c();l();u();var eh=ae(Vp(),e=>{e.addCase(Ai,(t,r)=>{t.contextValues=r.payload}).addCase(xi,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Ci,(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 O1=["caseId","caseNumber"],_1={caseId:"caseContext",caseNumber:"caseContext"},Hl=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${_1[t]} to set this value.}`)}};function YA(e){return O1.includes(e)}var N1=new Se({values:new J({options:{required:!1}})});function kT(e,t={}){if(!M1(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=lt(e,N1,t.initialState,"buildContext");return a.values&&n(Ai(a.values)),{...r,get state(){return{values:o().context.contextValues}},set(i){n(Ai(i))},...(o().configuration.analytics.analyticsMode==="legacy"?D1(n):q1(n))}}var D1=e=>({add(t,r){e(xi({contextKey:t,contextValue:r}))},remove(t){e(Ci(t))}}),q1=e=>({add(t,r){if(YA(t))throw new Hl(t);e(xi({contextKey:t,contextValue:r}))},remove(t){if(YA(t))throw new Hl(t);e(Ci(t))}});function M1(e){return e.addReducers({context:eh}),!0}function OT(e,t){return kT(e,t)}d();c();l();u();d();c();l();u();var wt=ae(Lp(),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;th(o,t,n)}).addCase(wn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;th(o,t,n)}).addCase(In,(t,r)=>{let{facetId:n,tabs:o}=r.payload;th(o,t,n)}).addCase(_n,(t,r)=>{let{facetId:n,tabs:o}=r.payload;th(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]=Sv()),t.facets[n].enabled=!0})})});function th(e,t,r){let n={...Sv(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var bc=ae(Gp(),e=>{e.addCase(Us,(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;_T(t,n)}).addCase(ls,(t,r)=>{let n=r.payload;_T(t,n)}).addCase(qe.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(Me,(t,r)=>{let n=r.payload.tab;fe(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function _T(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function rh(e){if(!V1(e))throw K;let t=oe(e),r=et(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function V1(e){return e.addReducers({tabSet:bc}),!0}function NT(e,t){if(!j1(e))throw K;let r=rh(e),n=x=>e.state.facetOptions.facets[x]?.enabled??!1,o=x=>e.state.facetSet?.[x]?.request?.currentValues??e.state.categoryFacetSet?.[x]?.request?.currentValues??e.state.numericFacetSet?.[x]?.request?.currentValues??e.state.dateFacetSet?.[x]?.request?.currentValues??null,a=x=>x in e.state.facetOptions.facets,i=x=>e.state.facetOptions.facets[x]?.tabs,p=()=>Di({isFacetRegistered:a(t.facetId),parentFacets:t.conditions.map(({parentFacetId:x})=>a(x)?{enabled:n(x),values:o(x)}:null),isTabEnabled:nr(i(t.facetId),r.state.activeTab)}),f=()=>{let x=p();return x===C?!1:(C=x,!0)},m=()=>t.conditions.length>0?t.conditions.some(x=>{if(!n(x.parentFacetId))return!1;let b=o(x.parentFacetId);return b===null?!1:x.condition(b)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([x,b])=>b.request.freezeCurrentValues&&e.dispatch(ao({facetId:x,freezeCurrentValues:!1})))},v=()=>{if(!a(t.facetId))return;let x=n(t.facetId),b=m(),w=nr(i(t.facetId),r.state.activeTab),R=b&&w;x!==R&&(e.dispatch(R?Qt(t.facetId):tt(t.facetId)),g())},C=p(),h=e.subscribe(()=>{f()&&v()});return v(),{stopWatching(){h()}}}function j1(e){return e.addReducers({facetOptions:wt}),!0}d();c();l();u();d();c();l();u();var wc=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}}),Rc=P("dictionaryFieldContext/add",e=>{let t=new J({options:{required:!0},values:{field:Be,key:Be}});return O(e,t)}),Fc=P("dictionaryFieldContext/remove",e=>O(e,Be));d();c();l();u();var nh=ae(jp(),e=>{e.addCase(wc,(t,r)=>{t.contextValues=r.payload}).addCase(Rc,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Fc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function DT(e){if(!L1(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(wc(o))},add(o,a){r(Rc({field:o,key:a}))},remove(o){r(Fc(o))}}}function L1(e){return e.addReducers({dictionaryFieldContext:nh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var qT=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var oh=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),MT=()=>({correctedQuery:"",corrections:[],originalQuery:""});function VT(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:oh(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var jT=(e,t)=>{let r={...MT(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var ah=ae(VT(),e=>{e.addCase(Fs,t=>{t.enableDidYouMean=!0}).addCase(Dp,t=>{t.enableDidYouMean=!1}).addCase(qp,t=>{t.automaticallyCorrectQuery=!0}).addCase(Es,t=>{t.automaticallyCorrectQuery=!1}).addCase(z.pending,t=>{t.queryCorrection=oh(),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]:oh();t.queryCorrection=a}t.queryCorrectionMode==="next"&&jT(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(Ar,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(Fa,(t,r)=>{t.queryCorrectionMode=r.payload})});function LT(e,t={}){if(!U1(e))throw K;let r=oe(e),{dispatch:n}=e;n(Fs()),t.options?.automaticallyCorrectQuery===!1&&n(Es()),n(Fa(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>qT(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(Ar(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(Fa(i))}}}function U1(e){return e.addReducers({configuration:me,didYouMean:ah}),!0}function UT(e,t={}){let r=LT(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(z({legacy:Mp(),next:fR()}))}}}d();c();l();u();d();c();l();u();function QT(e){if(!Q1(e))throw K;let t=oe(e),r=()=>e.state;return{...t,sort(n){return dl(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function Q1(e){return e.addReducers({search:he,facetOptions:wt}),!0}function BT(e){return QT(e)}d();c();l();u();d();c();l();u();var ih=ae(Yi(),e=>{e.addCase(z.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(sc,(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(cc,(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=B1(a),p=n[a].map(f=>GT(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(GT(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 B1(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function GT(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var sh=e=>e.state==="selected",ch=e=>e.state==="excluded",uh=(e,t)=>{let r={facetId:e,facetValue:t.value};return sh(t)?Wr(r):it(r)},lh=e=>sh(e)?co():gt(),$T=(e,t)=>{let r={facetId:e,facetValue:t.value};return ch(t)?io(r):pr(r)},HT=e=>ch(e)?mT():so();function zT(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:uh(o,a),next:lh(a)}))},deselectAll(){r(cc(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 WT(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function KT(e,t){if(!G1(e))throw K;let{dispatch:r}=e,n=WT(t.options);return r(sc(n)),{...oe(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>zT(e,{field:i.field}))??[]}}}}function G1(e){return e.addReducers({automaticFacetSet:ih,configuration:me,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function dh(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 ph(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function fh(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function mh(e,t){let r=e[t];r&&(r.isLoading=!1)}function gh(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function zl(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 hh(e,t){Object.keys(e).forEach(r=>zl(e,{facetId:r},t))}var qn={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var YT=/*#__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=$1(a),x=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:x,filterFacetCount:C,type:"hierarchical",...(n?{}:{searchContext:(yield Cr(t,r)).request})}});return function YT(_x157,_x158,_x159,_x160){return _ref71.apply(this,arguments)}}(),$1=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var XT=/*#__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 XT(_x161,_x162,_x163,_x164){return _ref72.apply(this,arguments)}}();var JT=e=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,W),H1(i,t)?p=yield XT(t,i,a,e):p=yield YT(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=xe("facetSearch/executeSearch",JT(!1)),Mn=xe("facetSearch/executeSearch",JT(!0)),Ec=P("facetSearch/clearResults",e=>O(e,{facetId:ve})),H1=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function ZT(){return{}}var Ic=ae(ZT(),e=>{e.addCase(pc,(t,r)=>{let n=r.payload;dh(t,n,XA)}).addCase(Ko,(t,r)=>{ph(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;fh(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;mh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{gh(t,r.payload,r.meta.requestId)}).addCase(Ec,(t,{payload:{facetId:r}})=>{zl(t,{facetId:r},XA)}).addCase(z.fulfilled,t=>{hh(t,XA)})});function XA(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function eP(e,t){let{field:r,state:n}=e;if(!z1(e))return r;let o=`${r}_`,a=W1(o,n);return Y1(r,t),`${o}${a}`}function z1(e){let{field:t,state:r}=e;return tP(r).some(o=>o&&t in o)}function W1(e,t){let n=tP(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return K1(n,e)+1}function tP(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function K1(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 Y1(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||eP({field:o,state:r},n)}d();c();l();u();d();c();l();u();var rP=["alphanumeric","occurrences"];var nP=new Se({field:xn,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),basePath:lT,delimitingCharacter:dT,facetId:An,facetSearch:gc,filterByBasePath:pT,filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,sortCriteria:new U({constrainTo:rP})});function oP(e,t){if(!X1(e))throw K;let r=oe(e),{dispatch:n}=e,o=Gt(e,t.options),a=t.options.tabs??{},i=Lt(e.state.tabSet),p={...Ql,...md("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...qn,...t.options.facetSearch},...p};$e(e,nP,f,"buildCategoryFacet");let m=()=>BS(e.state,o),g=()=>QS(e.state,o),v=()=>en(e.state),C=()=>cn(e.state,o);return n(yn(p)),{...r,toggleSelect(h){let x=f.numberOfValues;n(Wo({facetId:o,selection:h,retrieveCount:x})),n(Fe())},deselectAll(){n(Sn(o)),n(Fe())},sortBy(h){n(lc({facetId:o,criterion:h})),n(Fe())},isSortedBy(h){return m().sortCriteria===h},showMoreValues(){let{numberOfValues:h}=f,{activeValue:x,valuesAsTrees:b}=this.state,w=(x?.children.length??b.length)+h;n(di({facetId:o,numberOfValues:w})),n(Fe())},showLessValues(){let{numberOfValues:h}=f;n(di({facetId:o,numberOfValues:h})),n(Fe())},enable(){n(Qt(o))},disable(){n(tt(o))},get state(){let h=m(),x=g(),b=v(),w=C(),R=x?.values??[],E=R.some(B=>B.children.length>0)??!1,{parents:I,values:k}=gw(x?.values),T=sr(R),D=T.length?T[T.length-1]:void 0,G=!!D,L=D?.moreValuesAvailable??x?.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:G,canShowMoreValues:L,canShowLessValues:V,sortCriteria:h.sortCriteria,enabled:w}}}}function X1(e){return e.addReducers({categoryFacetSet:vn,categoryFacetSearchSet:Ic,facetOptions:wt,configuration:me,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var J1="coveo-headless-internal-state",yh=Symbol.for(J1);d();c();l();u();function Tc(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(Ec({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 aP(e,t){let{dispatch:r}=e,n={...qn,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[yh].categoryFacetSearchSet[o];r(pc(n));let i=Tc(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(dc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function Sh(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=aP(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(pc(p));let v=Tc(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Mn});return{...v,...g,get state(){return{...v.state,...g.state}}}}function iP(e,t){if(!Z1(e))throw K;let r=oP(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=Sh(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:eG(o(),f),next:tG(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:yc(o())}))},showLessValues(){r.showLessValues(),n(wr({legacy:Sc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function Z1(e){return e.addReducers({categoryFacetSet:vn,categoryFacetSearchSet:Ic,configuration:me,search:he}),!0}function eG(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Wr(r):it(r)}function tG(e){return e.state==="selected"?co():gt()}d();c();l();u();d();c();l();u();d();c();l();u();function sP(){return{}}var Pc=ae(sP(),e=>{e.addCase(Pg,(t,r)=>{let n=r.payload;dh(t,n,JA)}).addCase(Ko,(t,r)=>{ph(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;fh(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;mh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{gh(t,r.payload,r.meta.requestId)}).addCase(Ec,(t,{payload:r})=>{zl(t,r,JA)}).addCase(z.fulfilled,t=>{hh(t,JA)})});function JA(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var cP={facetId:ve,selection:new J({values:li})},uP=xe("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},cP),n(Rn({facetId:e,selection:t})),n(Fe())}),lP=xe("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},cP),n(Fn({facetId:e,selection:t})),n(Fe())});d();c();l();u();d();c();l();u();var kc=["allValues","atLeastOneValue"];d();c();l();u();var vh=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var dP=new Se({facetId:An,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),field:xn,filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,sortCriteria:new U({constrainTo:vh}),resultsMustMatch:new U({constrainTo:kc}),facetSearch:gc});function pP(e,t,r=dP){if(!rG(e))throw K;let{dispatch:n}=e,o=oe(e),a=Gt(e,t.options),i=t.options.tabs??{},p=Lt(e.state.tabSet),f={...Bl,...md("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=()=>lp(e.state,a),v=()=>Xi(e.state,a),C=()=>en(e.state),h=()=>cn(e.state,a),x=()=>{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(uP({facetId:m.facetId,selection:w})),toggleExclude:w=>n(lP({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:sh,isValueExcluded:ch,deselectAll(){n(rt(a)),n(Fe())},sortBy(w){n(hc({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(pi({facetId:a,numberOfValues:I})),n(fi({facetId:a,isFieldExpanded:!0})),n(Fe())},showLessValues(){let w=m.numberOfValues,R=Math.max(w,x());n(pi({facetId:a,numberOfValues:R})),n(fi({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"),G=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:G,canShowLessValues:b(),enabled:I}}}}function rG(e){return e.addReducers({facetSet:Tr,facetOptions:wt,configuration:me,facetSearchSet:Pc}),!0}d();c();l();u();function Ah(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[yh].facetSearchSet[m];r(Pg(n));let v=Tc(e,{options:n,getFacetSearch:g,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...v,select(C){r(mi({facetId:m,value:C})),o(C)},exclude(C){r(gi({facetId:m,value:C})),a(C)},singleSelect(C){r(rt(m)),r(mi({facetId:m,value:C})),o(C)},singleExclude(C){r(rt(m)),r(gi({facetId:m,value:C})),a(C)},get state(){let{values:C}=v.state;return{...v.state,values:C.map(({count:h,displayValue:x,rawValue:b})=>({count:h,displayValue:x,rawValue:b}))}}}}d();c();l();u();var fP=new Se({facetId:An,field:xn,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:vh}),resultsMustMatch:new U({constrainTo:kc}),facetSearch:gc,allowedValues:Eg,hasBreadcrumbs:fT,customSort:Ig});function mP(e,t){if(!nG(e))throw K;let{dispatch:r}=e,n=pP(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},fP),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return Ah(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:pr({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:uh(o(),m),next:lh(m)}))},toggleExclude(m){n.toggleExclude(m),r(z({legacy:$T(o(),m),next:HT(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:yc(o())}))},showLessValues(){n.showLessValues(),r(wr({legacy:Sc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function nG(e){return e.addReducers({facetSet:Tr,configuration:me,facetSearchSet:Pc,search:he}),!0}d();c();l();u();d();c();l();u();var xh=e=>e.state==="selected",ZA=e=>e.state==="excluded",Ch=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return xh(t)?Wr(n):it(n)},bh=e=>xh(e)?co():gt(),gP=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return ZA(t)?io(n):pr(n)};d();c();l();u();d();c();l();u();d();c();l();u();var wh=P("rangeFacet/executeToggleSelect",e=>O(e,Si(e.selection))),Rh=P("rangeFacet/executeToggleExclude",e=>O(e,Si(e.selection)));var hP={facetId:ve,selection:new J({values:yi})},yP=xe("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,hP),t(Tn(e)),t(wh(e)),t(Fe())}),SP=xe("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,hP),t(Pn(e)),t(Rh(e)),t(Fe())});d();c();l();u();function Fh(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 Eh(e,t){let{facetId:r,getRequest:n}=t,o=oe(e),a=e.dispatch,i=()=>cn(e.state,r);return{...o,isValueSelected:xh,isValueExcluded:ZA,deselectAll(){a(rt(r)),a(Fe())},sortBy(p){a(Ac({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(),x=v.some(w=>w.state!=="idle"),b=f?.domain;return{facetId:r,values:v,sortCriterion:m,resultsMustMatch:g,hasActiveValues:x,isLoading:C,enabled:h,domain:b}}}}d();c();l();u();d();c();l();u();var Ih=["idle","selected","excluded"];d();c();l();u();var Th=["ascending","descending"],Ph=["even","equiprobable"];var oG={start:new U,end:new U,endInclusive:new pe,state:new U({constrainTo:Ih})},aG=new Se({facetId:An,field:xn,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),generateAutomaticRanges:Fg,filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,currentValues:new ie({each:new J({values:oG})}),sortCriteria:new U({constrainTo:Th}),rangeAlgorithm:new U({constrainTo:Ph})});function kh(e,t){$e(e,aG,t,"buildDateFacet"),_g(t)}function vP(e,t){if(!iG(e))throw K;Fh(t.options,"buildDateFacet");let r=e.dispatch,n=Gt(e,t.options),o=t.options.tabs??{},a=Lt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};kh(e,i),r(In(i));let p=Eh(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(yP({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(rt(n)),this.toggleSelect(f)},toggleExclude:f=>r(SP({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(rt(n)),this.toggleExclude(f)},get state(){return p.state}}}function iG(e){return e.addReducers({configuration:me,search:he,dateFacetSet:On,facetOptions:wt}),!0}function AP(e,t){let r=vP(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:Ch(o(),a),next:bh(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(z({legacy:gP(o(),a)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function xP(e,t){if(!sG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Gt(e,t.options),i=t.options.tabs??{},p=Lt(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};kh(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=CT(o(),a),h=C.length?C[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:v}}}}function sG(e){return e.addReducers({dateFacetSet:On,facetOptions:wt,configuration:me,search:he}),!0}function CP(e,t){if(!cG(e))throw K;let r=xP(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 cG(e){return e.addReducers({dateFacetSet:On,configuration:me,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var bP={facetId:ve,selection:new J({values:hi})},wP=xe("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,bP),t(Nn(e)),t(wh(e)),t(Fe())}),aQe=xe("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,bP),t(Dn(e)),t(Rh(e)),t(Fe())});d();c();l();u();var uG={start:new re,end:new re,endInclusive:new pe,state:new U({constrainTo:Ih})},lG=new Se({facetId:An,tabs:new J({options:{required:!1},values:{included:new ie({each:new U}),excluded:new ie({each:new U})}}),field:xn,generateAutomaticRanges:Fg,filterFacetCount:Cn,injectionDepth:bn,numberOfValues:zr,currentValues:new ie({each:new J({values:uG})}),sortCriteria:new U({constrainTo:Th}),resultsMustMatch:new U({constrainTo:kc}),rangeAlgorithm:new U({constrainTo:Ph})});function Oh(e,t){$e(e,lG,t,"buildNumericFacet"),Hg(t)}d();c();l();u();function Oc(e){return{endInclusive:!1,state:"idle",...e}}function RP(e,t){if(!dG(e))throw K;Fh(t.options,"buildNumericFacet");let r=e.dispatch,n=Gt(e,t.options),o=t.options.tabs??{},a=Lt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Oh(e,i),r(_n(i));let p=Eh(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(wP({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(rt(n)),this.toggleSelect(f)},get state(){return p.state}}}function dG(e){return e.addReducers({numericFacetSet:Pr,facetOptions:wt,configuration:me,search:he}),!0}function FP(e,t){if(!pG(e))throw K;let r=RP(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:Ch(o(),a),next:bh(a)}))},get state(){return{...r.state}}}}function pG(e){return e.addReducers({numericFacetSet:Pr,configuration:me,search:he}),!0}d();c();l();u();d();c();l();u();function EP(e,t){if(!fG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Gt(e,t.options),i=t.options.tabs??{},p=Lt(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};Oh(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=ET(o(),a),h=C.length?C[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:v}}}}function fG(e){return e.addReducers({numericFacetSet:Pr,facetOptions:wt,configuration:me,search:he}),!0}function IP(e,t){if(!mG(e))throw K;let r=EP(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 mG(e){return e.addReducers({numericFacetSet:Pr,configuration:me,search:he}),!0}d();c();l();u();function TP(e,t){if(!gG(e))throw K;let{facetSearch:r,...n}=t.options.facet,o=Gt(e,n);e.dispatch(yn({...Ql,...n,facetId:o}));let a=Sh(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 gG(e){return e.addReducers({categoryFacetSet:vn,configuration:me,categoryFacetSearchSet:Ic,search:he}),!0}d();c();l();u();function PP(e,t){if(!hG(e))throw K;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Gt(e,o);e.dispatch(wn({...Bl,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=Ah(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:pr({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 hG(e){return e.addReducers({facetSet:Tr,configuration:me,facetSearchSet:Pc,search:he}),!0}d();c();l();u();d();c();l();u();var ex={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,ex)),Zo=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 Io(a):bs(a,o),p=yield n.search({...i,q:yG(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 yG(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)))),vG=()=>X("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),kP={logShowMoreFoldedResults:SG,logShowLessFoldedResults:vG};d();c();l();u();d();c();l();u();d();c();l();u();var _h=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function AG(e,t){return e.raw[t.collection]}function tx(e,t){return e.raw[t.parent]}function Wl(e,t){let r=e.raw[t.child];return pd(r)?r[0]:r}function xG(e,t){return(e||t)!==void 0&&e===t}function _P(e,t,r,n=[]){let o=Wl(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=Wl(a,r)===Wl(e,r);return tx(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:_P(i,t,r,[...n,o])}}):[]}function CG(e,t){return e.find(r=>{let n=tx(r,t)===void 0,o=xG(tx(r,t),Wl(r,t));return n||o})}function NP(e){return e.parentResult?NP(e.parentResult):e}function bG(e,t,r,n){let o=Ap(e),i={...(n??CG(o,t)??NP(e)),searchUid:r},p=_P(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function Nh(e,t,r,n){let o={};return e.forEach(a=>{let i=AG(a,t);i&&(!Wl(a,t)&&!a.parentResult||(o[i]=bG(a,t,r,n)))}),o}function OP(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 Dh=ae(_h(),e=>e.addCase(z.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Nh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(jt.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Nh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(br.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...Nh(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;OP(t,n).isLoadingMoreResults=!0}).addCase(Zo.rejected,(t,{meta:r})=>{let n=r.arg;OP(t,n).isLoadingMoreResults=!1}).addCase(Zo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=Nh(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 Kl={id:W},_c=P("querySuggest/register",e=>O(e,{...Kl,count:new re({min:0})})),DP=P("querySuggest/unregister",e=>O(e,Kl)),Vn=P("querySuggest/selectSuggestion",e=>O(e,{...Kl,expression:Be})),ea=P("querySuggest/clear",e=>O(e,Kl)),ta=xe("querySuggest/fetch",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,Kl);let i=e.id,p=yield wG(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)}}()),wG=/*#__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 ws(t.configuration.analytics):Ur(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function wG(_x171,_x172,_x173){return _ref76.apply(this,arguments)}}();var Ft=ae(dt(),e=>e.addCase(Vt,(t,r)=>({...t,...r.payload})).addCase(Ar,(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,wd)),Nc=P("fields/fetchall/enable"),bi=P("fields/fetchall/disable"),Dc=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??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 qh=["author","language","urihash","objecttype","collection","source","permanentid"],rx=[...qh,"date","filetype","parents"],qP=[...rx,"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"],MP=()=>({fieldsToInclude:qh,fetchAllFields:!1,fieldsDescription:[]});var na=ae(MP(),e=>e.addCase(ra,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Nc,t=>{t.fetchAllFields=!0}).addCase(bi,t=>{t.fetchAllFields=!1}).addCase(Dc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Jo,(t,{payload:r})=>{let n=_h().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function qc(e){if(!RG(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:pl(n)}}}}function RG(e){return e.addReducers({search:he}),!0}var FG=new Se({fieldsToInclude:new ie({required:!1,each:new U({required:!0,emptyAllowed:!1})})});function Mh(e,t){if(!EG(e))throw K;let r=oe(e),n=qc(e),{dispatch:o}=e,a=()=>e.state,i=$e(e,FG,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 x=a();return{...n.state,results:x.search.results,moreResultsAvailable:p(),searchResponseId:x.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 EG(e){return e.addReducers({search:he,configuration:me,fields:na}),!0}var IG=new Se(ex);function VP(e,t,r){if(!TG(e))throw K;let n=Mh(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?$e(e,IG,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 nx(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return nx(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 TG(e){return e.addReducers({search:he,configuration:Ef,folding:Dh,query:Ft}),!0}function nx(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=nx(n.children,t);if(o)return o}}return null}function jP(e,t={}){let r=VP(e,{...t,loadCollectionActionCreator:Zo,fetchMoreResultsActionCreator:br},kP);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Mc(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var Vc=ae(Uv(),e=>e.addCase(Vs,(t,{payload:r})=>{t.isVisible=r}).addCase(vl,(t,{payload:r})=>{t.isEnabled=r}).addCase(hf,(t,{payload:r})=>{t.id=r.id}).addCase(_a,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,delete t.error;let n=r.textDelta,o=!!t.answer?.trim(),a=n.trim().length>0;if(o){t.answer+=n;return}t.answer=a?n:void 0}).addCase(Na,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Mc([...t.citations,...r.citations]),delete t.error}).addCase(Da,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===Uy},t.citations=[],delete t.answer}).addCase(pf,t=>{t.liked=!0,t.disliked=!1}).addCase(ff,t=>{t.liked=!1,t.disliked=!0}).addCase(mf,t=>{t.feedbackModalOpen=!0}).addCase(yf,t=>{t.feedbackModalOpen=!1}).addCase(Ls,t=>{t.feedbackSubmitted=!0}).addCase(lr,t=>({...Uv(),...(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(Oa,(t,{payload:r})=>{t.isStreaming=r}).addCase(qa,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(Sf,(t,{payload:r})=>{t.responseFormat=r}).addCase(Af,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(xl,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(Al,t=>{t.expanded=!0}).addCase(gf,t=>{t.expanded=!1}).addCase(vf,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(Ma,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(Bv,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(js,(t,{payload:r})=>{t.answerId=r}).addCase(df,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(xf,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(Cf,(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 jc(e,t,r={}){if(!PG(e))throw K;let{dispatch:n}=e,o=oe(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(Vs(i));let p=r.initialState?.responseFormat;p&&n(Sf(p));let f=r.fieldsToIncludeInCitations;return f&&n(Af(f)),r.initialState?.expanded&&n(Al()),{...o,get state(){let g=a().generatedAnswer;return{...g,error:ci(g.error)}},like(){this.state.liked||(n(pf()),n(t.logLikeGeneratedAnswer(this.state.answerId)))},dislike(){this.state.disliked||(n(ff()),n(t.logDislikeGeneratedAnswer(this.state.answerId)))},openFeedbackModal(){n(mf())},closeFeedbackModal(){n(yf())},sendFeedback(g){n(t.logGeneratedAnswerFeedback(g)),n(Ls())},logCitationClick(g,v){n(t.logOpenGeneratedAnswerSource(g,v))},logCitationHover(g,v,C){n(t.logHoverCitation(g,v,C))},show(){this.state.isVisible||(n(Vs(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(Vs(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(Al()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(gf()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(vl(!0))},disable(){this.state.isEnabled&&n(vl(!1))},logCopyToClipboard(g){n(t.logCopyGeneratedAnswer(g))},retry(){}}}function PG(e){return e.addReducers({generatedAnswer:Vc}),!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(lr())}if(!$t.getIsStreamInProgress(a)&&o&&o!==$t.engines[a].lastStreamId){if($t.engines[a].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(FF({setAbortControllerRef:p=>$t.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function LP(e,t,r={}){if(!kG(e))throw K;let n=jc(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(hf({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 kG(e){return e.addReducers({generatedAnswer:Vc}),!0}d();c();l();u();d();c();l();u();var UP=Rf.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Vh=e=>e==="yes"?!0:e==="no"?!1:null,OG=({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:Vh(t.correctTopic),documented:Vh(t.documented),hallucinationFree:Vh(t.hallucinationFree),readable:Vh(t.readable)},helpful:t.helpful,question:r}),_G=e=>{let t="",r=()=>{let n=e.state,o=lF(n),a=o.requestId;a!==t&&(t=a,e.dispatch(lr()),o.q?.length>0&&e.dispatch(bf()))};e.subscribe(r)};function QP(e,t,r={}){if(!NG(e))throw K;Ho(e.state.configuration.analytics.analyticsMode);let{...n}=jc(e,t,r),o=()=>e.state;return e.dispatch(vf(r.answerConfigurationId)),_G(e),{...n,get state(){let a=Gv(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:Mc(a?.citations??[]),error:ci({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=af(o());e.dispatch(wf(a??Pa))},reset(){e.dispatch(lr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=OG({query:o().query.q,feedback:a,answerApiState:Gv(e.state).data});e.dispatch(UP.endpoints.post.initiate(i)),e.dispatch(Ls())})()}}}function NG(e){return e.addReducers({[Va.reducerPath]:Va.reducer,query:Ft}),!0}d();c();l();u();d();c();l();u();var ox=class extends Jm{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}}},BP=(e,t,r)=>new ox({url:`${Zm(e,t,r)}/follow-up`});d();c();l();u();var GP=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Ml(t)),e(ig({answerId:t,isLoading:!1})),e(sg({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:n})=>{e(hg({name:n.stepName,startedAt:n.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:n})=>{e(yg({name:n.stepName,finishedAt:n.timestamp??Date.now(),answerId:t}))},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(cg({textDelta:n.delta,answerId:t}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(ag({contentFormat:a.contentFormat,answerId:t}));return}case"citations":{e(ug({citations:a.citations,answerId:t}));return}}},onRunErrorEvent:({input:n,event:o})=>{t||(t=n.runId,e(Ml(n.runId)));let a=Sg(o.code);e(dg({message:o.message,code:a,answerId:t})),t=""},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(lg({cannotAnswer:!o,answerId:t})),e(Jn(o,t,a)),e(Vo(t)),t="",r=!1}}};d();c();l();u();d();c();l();u();function $P(){return{conversationId:"",conversationToken:"",isEnabled:!1,followUpAnswers:[]}}var HP=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function ax(e){return e.followUpAnswers.find(t=>t.isActive)}function kr(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var zP=ae($P(),e=>e.addCase(eg,(t,{payload:r})=>{t.isEnabled=r}).addCase(tg,(t,{payload:r})=>{t.conversationId=r}).addCase(rg,(t,{payload:r})=>{t.conversationToken=r}).addCase(ng,t=>{t.conversationToken=""}).addCase(og,(t,{payload:r})=>{let n=ax(t);n&&(n.isActive=!1),t.followUpAnswers.push(HP(r.question))}).addCase(Ml,(t,{payload:r})=>{let n=ax(t);!n||n.answerId||(n.answerId=r)}).addCase(ag,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(ig,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(sg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(cg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(ug,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.citations=Mc([...n.citations,...r.citations]),delete n.error)}).addCase(lg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(dg,(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(pg,(t,{payload:r})=>{let n=ax(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(fg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(mg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(EI,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(hg,(t,{payload:r})=>{let n=kr(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(yg,(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(gg,t=>{t.followUpAnswers=[],t.conversationId="",t.conversationToken="",t.isEnabled=!1}));function WP(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!DG(e))throw K;let n=jc(e,t,r),o=()=>e.state;e.dispatch(Ep(r.agentId));let a=pp(o()),i=dp(o()),p=fp(o()),f=BP(r.agentId,a,p),m=GP(e.dispatch),g=vg();return{...n,get state(){let v=o().followUpAnswers,C=o().generatedAnswer;return{...C,error:ci(C.error),followUpAnswers:{...v,followUpAnswers:v.followUpAnswers.map(h=>({...h,error:ci(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(fg({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(mg({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(!_this37.state.followUpAnswers.isEnabled||!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(og({question:v}));let x=Ur(o().configuration.analytics,e.navigatorContext);try{yield f.runAgent({forwardedProps:{q:v,analytics:x.analytics,conversationId:C,conversationToken:h,accessToken:i}},m)}catch(b){e.dispatch(pg({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",b)}})()}}}function DG(e){return e.addReducers({followUpAnswers:zP}),!0}function KP(e,t={}){Ho(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=WP(e,jo,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=QP(e,jo,t):r=LP(e,jo,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function Ht(e,t,r){if(!qG(e))throw K;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:gd(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function qG(e){return e.addReducers({configuration:me}),!0}function YP(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id,r.options.answerId)))};return Ht(e,r,()=>{o()})}function XP(e,t){return YP(e,jo,t)}d();c();l();u();d();c();l();u();function JP(e,t,r){let n=!1;return Ht(e,r,()=>{n||(n=!0,e.dispatch(t.logGeneratedAnswerOpenInlineLink(r.options.link,r.options.answerId)))})}function ZP(e,t){return JP(e,jo,t)}d();c();l();u();d();c();l();u();var Lc=ae(Up(),e=>{e.addCase(z.fulfilled,MG).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function MG(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var jh=()=>X("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),Lh=()=>X("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Uh=()=>X("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var ek=e=>({past:[],present:e,future:[]}),VG=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]}},jG=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}},LG=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:[]}:ek(i)},tk=e=>{let{actionTypes:t,reducer:r}=e,n=ek();return(o=n,a)=>{switch(a.type){case t.undo:return VG(o);case t.redo:return jG(o);case t.snapshot:return LG({state:o,reducer:r,action:a});default:return o}}};d();c();l();u();d();c();l();u();var{getOwnPropertyNames:UG,getOwnPropertySymbols:QG}=Object,{hasOwnProperty:BG}=Object.prototype;function ix(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function Qh(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 rk(e){return UG(e).concat(QG(e))}var GG=Object.hasOwn||((e,t)=>BG.call(e,t)),$G="__v",HG="__o",zG="_owner",{getOwnPropertyDescriptor:nk,keys:ok}=Object,wi=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function WG(e,t){return e===t}function KG(e,t){return e.byteLength===t.byteLength&&Bh(new Uint8Array(e),new Uint8Array(t))}function YG(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 XG(e,t){return e.byteLength===t.byteLength&&Bh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function JG(e,t){return wi(e.getTime(),t.getTime())}function ZG(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function ak(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 e2(e,t,r){let n=ok(e),o=n.length;if(ok(t).length!==o)return!1;for(;o-->0;)if(!sk(e,t,r,n[o]))return!1;return!0}function Yl(e,t,r){let n=rk(e),o=n.length;if(rk(t).length!==o)return!1;let a,i,p;for(;o-->0;)if(a=n[o],!sk(e,t,r,a)||(i=nk(e,a),p=nk(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function t2(e,t){return wi(e.valueOf(),t.valueOf())}function r2(e,t){return e.source===t.source&&e.flags===t.flags}function ik(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 Bh(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 n2(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 sk(e,t,r,n){return(n===zG||n===HG||n===$G)&&(e.$$typeof||t.$$typeof)?!0:GG(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var o2=Object.prototype.toString;function a2(e){let t=u2(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:o,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:p,areRegExpsEqual:f,areSetsEqual:m,getUnsupportedCustomComparator:g}=e;return function(C,h,x){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,x):b==="function"?o(C,h,x):!1;let w=C.constructor;if(w!==h.constructor)return!1;if(w===Object)return p(C,h,x);if(w===Array)return r(C,h,x);if(w===Date)return n(C,h,x);if(w===RegExp)return f(C,h,x);if(w===Map)return a(C,h,x);if(w===Set)return m(C,h,x);if(w===Promise)return!1;if(Array.isArray(C))return r(C,h,x);let R=o2.call(C),E=t[R];if(E)return E(C,h,x);let I=g&&g(C,h,x,R);return I?I(C,h,x):!1}}function i2({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:KG,areArraysEqual:r?Yl:YG,areDataViewsEqual:XG,areDatesEqual:JG,areErrorsEqual:ZG,areFunctionsEqual:WG,areMapsEqual:r?ix(ak,Yl):ak,areNumbersEqual:wi,areObjectsEqual:r?Yl:e2,arePrimitiveWrappersEqual:t2,areRegExpsEqual:r2,areSetsEqual:r?ix(ik,Yl):ik,areTypedArraysEqual:r?ix(Bh,Yl):Bh,areUrlsEqual:n2,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=Qh(n.areArraysEqual),a=Qh(n.areMapsEqual),i=Qh(n.areObjectsEqual),p=Qh(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:p})}return n}function s2(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function c2({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 u2({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]":(x,b,w)=>typeof x.then!="function"&&typeof b.then!="function"&&f(x,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 sx=jn(),G3e=jn({strict:!0}),$3e=jn({circular:!0}),H3e=jn({circular:!0,strict:!0}),z3e=jn({createInternalComparator:()=>wi}),W3e=jn({strict:!0,createInternalComparator:()=>wi}),K3e=jn({circular:!0,createInternalComparator:()=>wi}),Y3e=jn({circular:!0,createInternalComparator:()=>wi,strict:!0});function jn(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=i2(e),i=a2(a),p=r?r(i):s2(i);return c2({circular:t,comparator:i,createState:n,equals:p,strict:o})}function Ri(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function l2(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>Xl(r,n))!==-1)}var Xl=jn({createCustomConfig:e=>({...e,areArraysEqual:l2})});var d2=ae(gR(),e=>{e.addCase(ur,(t,r)=>p2(t,r.payload)?void 0:r.payload)}),p2=(e,t)=>f2(e.context,t.context)&&m2(e.dictionaryFieldContext,t.dictionaryFieldContext)&&x2(e.advancedSearchQueries,t.advancedSearchQueries)&&g2(e.tabSet,t.tabSet)&&h2(e.staticFilterSet,t.staticFilterSet)&&cx(e.facetSet,t.facetSet)&&cx(e.dateFacetSet,t.dateFacetSet)&&cx(e.numericFacetSet,t.numericFacetSet)&&S2(e.automaticFacetSet,t.automaticFacetSet)&&y2(e.categoryFacetSet,t.categoryFacetSet)&&v2(e.pagination,t.pagination)&&A2(e.query,t.query)&&C2(e,t)&&b2(e.pipeline,t.pipeline)&&w2(e.searchHub,t.searchHub)&&R2(e.facetOrder,t.facetOrder)&&F2(e.debug,t.debug),f2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),m2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),g2=(e,t)=>{let r=ck(e),n=ck(t);return r?.id===n?.id},ck=e=>Object.values(e).find(t=>t.isActive),h2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=uk(e[r]),a=uk(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},uk=e=>e.values.filter(t=>t.state!=="idle"),cx=(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},y2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=sr(e[r]?.request.currentValues).map(({value:i})=>i),a=sr(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},v2=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,A2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),x2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),C2=(e,t)=>e.sortCriteria===t.sortCriteria,b2=(e,t)=>e===t,w2=(e,t)=>e===t,R2=(e,t)=>Ri(e,t),F2=(e,t)=>e===t,Gh=tk({actionTypes:{redo:ov.type,undo:nv.type,snapshot:ur.type},reducer:d2});function lk(e){if(!E2(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=a=>a.past.length>0&&!fe(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(il()),r(z({legacy:Lh()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(Tp()),r(z({legacy:jh()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r(il()),r(z({legacy:Uh()})))})()}}}function E2(e){return e.addReducers({history:Gh,configuration:me,facetOrder:Lc}),!0}d();c();l();u();d();c();l();u();var I2={results:new ie({required:!0,each:new J({values:xp})}),maxLength:new re({required:!0,min:1,default:10})},Uc=P("recentResults/registerRecentResults",e=>O(e,I2)),Or=P("recentResults/pushRecentResult",e=>(Jt(e),{payload:e})),Qc=P("recentResults/clearRecentResults");function dk(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Kw(t.options.result)))};return Ht(e,t,()=>{n(),e.dispatch(Or(t.options.result))})}d();c();l();u();d();c();l();u();function $h(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var pk=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},fk=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},mk=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{$h(o)&&delete t[r].cache[n]})},gk=(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)){T2(e,t,r);return}let n=ux(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},hk=(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}},yk=(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},T2=(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 Sk(){return{}}var Hh=ae(Sk(),e=>{e.addCase(hs,(t,r)=>{pk(r.payload,t)}),e.addCase(on,(t,r)=>{fk(r.payload,t)}),e.addCase(ys,(t,r)=>{mk(r.payload,t)}),e.addCase(Ps.pending,(t,r)=>{gk(r.meta.arg,t,{results:[]})}),e.addCase(Ps.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));hk({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(Ps.rejected,(t,r)=>{yk(r.meta.arg,t)})});d();c();l();u();var P2={searchBoxId:st,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re},vk=new Se(P2);function Ak(e,t){if(!k2(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,vk,a,"buildInstantResults");let i=a.searchBoxId;n(hs({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||$h(C)))&&n(Ps({id:i,q:v,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(on({id:i,q:v}))},clearExpired(){n(ys({id:i}))},get state(){let v=m(),C=f(v);return{q:v,isLoading:C?.isLoading||!1,error:C?.error||null,results:g()}}}}function k2(e){return e.addReducers({instantResults:Hh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var _r=ae(xr(),e=>{e.addCase(Ss,(t,r)=>{let n=lx(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Jl(n,o)}).addCase(vs,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(ht,t=>{t.firstResult=0}).addCase(As,(t,r)=>{let n=r.payload;t.firstResult=Jl(n,t.numberOfResults)}).addCase(an,(t,r)=>{let n=r.payload;t.firstResult=Jl(n,t.numberOfResults)}).addCase(Cs,t=>{let r=lx(t),n=Math.max(r-1,1);t.firstResult=Jl(n,t.numberOfResults)}).addCase(xs,t=>{let r=lx(t),n=O2(t),o=Math.min(r+1,n);t.firstResult=Jl(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(jt.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(rt,t=>{zt(t)}).addCase(Pn,t=>{zt(t)}).addCase(Fn,t=>{zt(t)}).addCase(Dn,t=>{zt(t)}).addCase(gi,t=>{zt(t)}).addCase(Rn,t=>{zt(t)}).addCase(Sn,t=>{zt(t)}).addCase(Wo,t=>{zt(t)}).addCase(dc,t=>{zt(t)}).addCase(Tn,t=>{zt(t)}).addCase(Nn,t=>{zt(t)}).addCase(ft,t=>{zt(t)}).addCase(uo,t=>{zt(t)}).addCase(lo,t=>{zt(t)}).addCase(mi,t=>{zt(t)}).addCase(hn,t=>{zt(t)})});function zt(e){e.firstResult=xr().firstResult}function lx(e){let{firstResult:t,numberOfResults:r}=e;return dx(t,r)}function O2(e){let{totalCountFiltered:t,numberOfResults:r}=e;return px(t,r)}function Jl(e,t){return(e-1)*t}function dx(e,t){return Math.round(e/t)+1}function px(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function _2(e){return e.pagination.firstResult}function xk(e){return e.pagination.numberOfResults}function N2(e){return e.pagination.totalCountFiltered}var mo=e=>{let t=_2(e),r=xk(e);return dx(t,r)},Zl=e=>{let t=N2(e),r=xk(e);return px(t,r)},zh=(e,t)=>{let r=mo(e),n=Zl(e),o=D2(r,t);return o=q2(o),o=M2(o,n),V2(o)};function D2(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 q2(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function M2(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 V2(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Gc=()=>X("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||xr().numberOfResults})),$c=()=>X("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:mo(t)})),Wh=()=>X("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:mo(t)})),Kh=()=>X("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:mo(t)})),Hc=()=>({actionCause:"browseResults"});d();c();l();u();var j2=new Se({numberOfPages:new re({default:5,min:0})}),L2=new Se({page:new re({min:1})});function Ck(e,t={}){if(!U2(e))throw K;let r=oe(e),{dispatch:n}=e,o=$e(e,j2,t.options,"buildPager"),i=lt(e,L2,t.initialState,"buildPager").page;i&&n(As(i));let p=()=>mo(e.state),f=()=>{let{numberOfPages:g}=o;return zh(e.state,g)},m=()=>Zl(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(xs())},previousPage(){n(Cs())},isCurrentPage(g){return g===this.state.currentPage}}}function U2(e){return e.addReducers({configuration:me,pagination:_r}),!0}function bk(e,t={}){let{dispatch:r}=e,n=Ck(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(jt({legacy:$c(),next:Hc()}))},nextPage(){n.nextPage(),r(jt({legacy:Wh(),next:Hc()}))},previousPage(){n.previousPage(),r(jt({legacy:Kh(),next:Hc()}))}}}d();c();l();u();d();c();l();u();function wk(e){if(!Q2(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 Q2(e){return e.addReducers({search:he}),!0}function Rk(e){return wk(e)}d();c();l();u();d();c();l();u();function Fk(e){if(!B2(e))throw K;let t=oe(e),r=qc(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 B2(e){return e.addReducers({search:he,pagination:_r}),!0}function Ek(e){return Fk(e)}d();c();l();u();d();c();l();u();d();c();l();u();function Yh(_x176,_x177){return _Yh.apply(this,arguments)}function _Yh(){_Yh=_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 _Yh.apply(this,arguments)}var Fi=xe("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield Yh(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)}}()),zc=P("resultPreview/next"),Wc=P("resultPreview/previous"),Kc=P("resultPreview/prepare",e=>O(e,{results:new ie({required:!0})})),Ik=2048,Yc=xe("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=FC(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>Ik&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${Ik} characters.`),{contentURL:o}});return function(_x180,_x181){return _ref80.apply(this,arguments)}}());d();c();l();u();var Tk=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 fx(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var mx=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=fx();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},gx=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),Xh=ae(fx(),e=>{e.addCase(Fi.pending,t=>{t.isLoading=!0}).addCase(Fi.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)=>{mx(t),t.resultsWithPreview=gx(r.payload.response.results)}).addCase(br.fulfilled,(t,r)=>{mx(t),t.resultsWithPreview=t.resultsWithPreview.concat(gx(r.payload.response.results))}).addCase(jt.fulfilled,mx).addCase(Kc,(t,r)=>{t.resultsWithPreview=gx(r.payload.results)}).addCase(zc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(Wc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Yc.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function Pk(e,t,r,n,o){if(!G2(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(Yc({uniqueId:C,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(Fi({uniqueId:C,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){v(f.uniqueId)},next(){a(zc()),v(g())},previous(){a(Wc()),v(g())},get state(){let C=i(),h=f.hasHtmlVersion,x=C.resultPreview,b=f.uniqueId===x.uniqueId?x.content:"",w=x.isLoading,R=x.contentURL,E=g();return{content:b,resultHasPreview:h,isLoading:w,contentURL:R,currentResultUniqueId:E}}}}function G2(e){return e.addReducers({configuration:me,resultPreview:Xh}),!0}function kk(e,t){if(!$2(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=Pk(e,t,Yh,"/html",()=>{e.dispatch(Tk(t.options.result))});return r(Kc({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function $2(e){return e.addReducers({search:he}),!0}d();c();l();u();d();c();l();u();var Ok=()=>X("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),_k=()=>X("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var H2={queries:new ie({required:!0,each:new U({emptyAllowed:!1})}),maxLength:new re({required:!0,min:1,default:10})},Ei=P("recentQueries/registerRecentQueries",e=>O(e,H2)),Xc=P("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function Nk(){return{queries:[],maxLength:10}}var Jh=ae(Nk(),e=>{e.addCase(Ei,z2).addCase(Xc,W2).addCase(z.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||K2(n,t)})});function z2(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 W2(e){e.queries=[]}function K2(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 Y2={queries:[]},X2={maxLength:10,clearFilters:!0},J2=new Se({queries:new ie({required:!0})}),Z2=new Se({maxLength:new re({required:!0,min:1}),clearFilters:new pe});function e$(e,t){$e(e,Z2,t?.options,"buildRecentQueriesList"),lt(e,J2,t?.initialState,"buildRecentQueriesList")}function Dk(e,t){if(!t$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...X2,...t?.options},i={...Y2,...t?.initialState};e$(e,{options:a,initialState:i});let p={queries:i.queries,maxLength:a.maxLength};return n(Ei(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(Xc())},updateRecentQueries(f){let m=new ie({required:!0,each:new U({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(Ei({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};dd(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(Ts(g))}}}function t$(e){return e.addReducers({search:he,recentQueries:Jh,query:Ft}),!0}function qk(e,t){let r=Dk(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(Ok()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(z({legacy:_k(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var Mk=e=>X("analytics/recentResults/click",(t,r)=>(Jt(e),t.makeRecentResultClick(pt(e,r),Ke(e)))),Vk=()=>X("analytics/recentResults/clear",e=>e.makeClearRecentResults());function jk(e,t){return Ht(e,t,()=>e.dispatch(Mk(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function Lk(){return{results:[],maxLength:10}}var Zh=ae(Lk(),e=>{e.addCase(Uc,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Qc,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 r$={initialState:{results:[]},options:{maxLength:10}},n$=new Se({results:new ie({required:!0})}),o$=new Se({maxLength:new re({required:!0,min:1})});function a$(e,t){$e(e,o$,t?.options,"buildRecentResultsList"),lt(e,n$,t?.initialState,"buildRecentResultsList")}function Uk(e,t){if(!i$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...r$,...t};a$(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n(Uc(i)),{...r,get state(){return o().recentResults},clear(){n(Vk()),n(Qc())}}}function i$(e){return e.addReducers({recentResults:Zh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var Bk=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=c$(e),f=Gk(o?o[1]:null),m=s$(a),g=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:g,qreWeights:p}},Gk=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},Qk=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},s$=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=Qk(e[1],t);if(!n)return null;let o={};for(let a of n){let i=Qk(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=Gk(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},c$=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 $k(e){return e.search.response.results.map(r=>{let n=Bk(r.rankingInfo);return{result:r,ranking:n}})}var u$=new Se({enabled:new pe({default:!1})});function Hk(e,t={}){if(!l$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;lt(e,u$,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:x}=p.search.response,{fieldsDescription:b,fetchAllFields:w}=p.fields;return{isEnabled:f,rankingInformation:$k(p),executionReport:m,expressions:{basicExpression:g,advancedExpression:v,constantExpression:C},userIdentities:h,rankingExpressions:x,fieldsDescription:b,fetchAllFields:w}},enable(){n(Fo()),i("debug")},disable(){n(ds()),n(bi())},enableFetchAllFields(){n(Nc()),i("fetchAllFields")},disableFetchAllFields(){n(bi())},fetchFieldsDescription(){!this.state.isEnabled&&n(Fo()),n(Dc()),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(NB)}d();c();l();u();var oT=Vr(nT(),1);function aT(e){return(0,oT.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function iT(e,t){let r=XB(e),n=hr,o=ZB(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function XB(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function ZB(e){return e.preprocessRequest||Ad}d();c();l();u();var ZA=(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}]`))},eC=(e,t)=>!(de(e)||t===e),Ul=e=>{let t=zA(e);return t||!1},uT=(e,t)=>(eC(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),sT=(e,t,r,n)=>(ZA(e,"searchHub",t.searchHub,xo(),r,n),uT(e,t)),lT=(e,t)=>(eC(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),cT=(e,t,r,n)=>(ZA(e,"pipeline",t.pipeline,rn(),r,n),lT(e,t)),dT=(e,t)=>(eC(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),e1=(e,t,r,n)=>(ZA(e,"userDisplayName",t.configuration.analytics.userDisplayName,Gs().analytics.userDisplayName,r,n),dT(e,t)),pT=e=>ae({},t=>{t.addCase(Os,(r,n)=>{let o=Ul(r.configuration.accessToken);return o?sT(o,r,n.payload,e):r}).addCase(fs,(r,n)=>{let o=Ul(r.configuration.accessToken);return o?cT(o,r,n.payload,e):r}).addCase(nn,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:o}=n.payload;if(!o)return r;let a=Ul(o);return a?[lT,uT,dT].reduce((i,p)=>p(a,i),r):r}).addCase(Ar,(r,n)=>{let o=Ul(r.configuration.accessToken);if(!o)return r;let a=sT(o,r,n.payload.searchHub,e);return cT(o,a,n.payload?.pipeline,e)}).addCase(Fo,(r,n)=>{let o=Ul(r.configuration.accessToken);return o?e1(o,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var fT={organizationId:z,accessToken:z,name:new L({required:!1,emptyAllowed:!1}),analytics:new X({options:{required:!1},values:{enabled:new fe({required:!1}),originContext:new L({required:!1}),originLevel2:new L({required:!1}),originLevel3:new L({required:!1}),analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new L({required:!1,url:!0}),trackingId:new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new L({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function mT(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var gT=new Se({...fT,search:new X({options:{required:!1},values:{pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:st,locale:st,timezone:st,authenticationProviders:new ie({required:!1,each:z}),proxyBaseUrl:new L({required:!1,url:!0})}})});function tC(){return{...mT(),search:{searchHub:"default"}}}var t1={debug:ps,pipeline:ms,searchHub:_s,search:he};function r1(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 hT(e){let t=aT(e.loggerOptions),{configuration:r}=e;n1(r,t);let n=o1(r,t),o=a1(t),a={...iT(r,t),apiClient:n,streamingClient:o},i={...e,reducers:t1,crossReducer:pT(t)},p=WI(i,a),f=r1(r);return f&&p.dispatch(Ar(f)),{...p,get state(){return p.state},executeFirstSearch(m=wp()){if(ml(p.state))return;let g=W({legacy:m,next:rR()});p.dispatch(g)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:g,metadata:v}=m;if(ml(p.state))return;let x=v&&g==="omniboxFromLink",h=W({legacy:x?Fp(v):Rp(),next:x?oR():nR()});p.dispatch(h)}}}function n1(e,t){try{gT.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function o1(e,t){let{search:r}=e;return new wd({logger:t,preprocessRequest:e.preprocessRequest||Ad,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||jx,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||Lx,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||Ux})}function a1(e){return new vd({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var ui={value:z,numberOfResults:new re({min:0}),state:z};d();c();l();u();var ve=z;var u1=new re({min:1,default:8,required:!1}),l1=new re({min:1,max:20,default:5,required:!1}),d1={desiredCount:l1,numberOfValues:u1},lc=P("automaticFacet/setOptions",e=>O(e,d1)),dc=P("automaticFacet/deselectAll",e=>O(e,ve)),p1=z,yn=P("automaticFacet/toggleSelectValue",e=>O(e,{field:p1,selection:new X({values:ui})}));d();c();l();u();d();c();l();u();var f1={state:new Be({required:!0}),numberOfResults:new re({required:!0,min:0}),value:new L({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:z}),moreValuesAvailable:new fe({required:!1})};function rC(e){e.children.forEach(t=>{rC(t)}),hr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},f1)}var pc={facetId:ve,field:z,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),activeTab:new L({required:!1}),delimitingCharacter:new L({required:!1,emptyAllowed:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),basePath:new ie({required:!1,each:z}),filterByBasePath:new fe({required:!1})};var Sn=P("categoryFacet/register",e=>O(e,pc)),Wo=P("categoryFacet/toggleSelectValue",e=>{try{return hr(e.facetId,z),rC(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:Gn(t)}}}),vn=P("categoryFacet/deselectAll",e=>O(e,pc.facetId)),li=P("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:pc.facetId,numberOfValues:pc.numberOfValues})),fc=P("categoryFacet/updateSortCriterion",e=>O(e,{facetId:pc.facetId,criterion:new Be})),Pg=P("categoryFacet/updateBasePath",e=>O(e,{facetId:pc.facetId,basePath:new ie({each:z})}));d();c();l();u();var m1={categoryFacetId:ve,categoryFacetPath:new ie({required:!0,each:z})},g1=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},kg=e=>J("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,m1),t.makeBreadcrumbFacet(g1(r,e)))),yT=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var Fe=P("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new fe({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 or=(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:ve,captions:new X({options:{required:!1}}),numberOfValues:new re({required:!1,min:1}),query:new L({required:!1,emptyAllowed:!0})};var h1={path:new ie({required:!0,each:z}),displayValue:Ge,rawValue:Ge,count:new re({required:!0,min:0})},mc=P("categoryFacet/selectSearchResult",e=>O(e,{facetId:ve,value:new X({values:h1})})),gc=P("categoryFacetSearch/register",e=>O(e,Ql));d();c();l();u();function hc(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function yc(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function Og(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function Bl(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function _g(e,t,r){e.currentValues=y1(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function y1(e,t){if(!e.length)return[];let r=ST(e[0],t),n=r;for(let o of e.splice(1)){let a=ST(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function ST(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var An=ae(Ji(),e=>{e.addCase(Sn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=v1(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)&&!or(i.tabs,o)){p.currentValues.length&&_g(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&_g(p,m,i.initialNumberOfValues)})}).addCase(fc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(Pg,(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=S1(i,f,a);if(m.length){let v=m[0];v.retrieveChildren=!0,v.state="selected",v.previousState="idle",v.children=[];return}let g=AT(o.value,a);g.state="selected",g.previousState="idle",m.push(g),i.numberOfValues=1}).addCase(vn,(t,r)=>{let n=r.payload;Bl(t,n)}).addCase(ft,t=>{Object.keys(t).forEach(r=>Bl(t,r))}).addCase(on,(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 Og(a,o);A1(t,r.payload)}}).addCase(mc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];_g(a.request,i,a.initialNumberOfValues)}).addCase(Rr.fulfilled,(t,r)=>{vT(t,r.payload.response.facets)}).addCase(W.fulfilled,(t,r)=>{vT(t,r.payload.response.facets)}).addCase(tt,(t,r)=>{Bl(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)&&!or(a.tabs,n)&&Bl(t,o)})})}),Gl={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function S1(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=AT(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function v1(e){return{...Gl,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function AT(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function vT(e,t){t.forEach(r=>{if(!C1(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=x1(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function A1(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 C1(e,t){return t.facetId in e}function x1(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 Cn=new L({regex:/^[a-zA-Z0-9-_]+$/}),xn=new L({required:!0}),CT=new ie({each:new L}),xT=new L,bT=new fe,bn=new fe,wn=new re({min:0}),zr=new re({min:1}),Ng=new fe({required:!0}),b1=new X,w1=new L,R1={captions:b1,numberOfValues:zr,query:w1},Sc=new X({values:R1}),Dg=new X({options:{required:!1},values:{type:new L({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new L({emptyAllowed:!1,required:!0})})}}),wT=new fe,qg=new ie({min:1,max:25,required:!1,each:new L({emptyAllowed:!1,required:!0})});var F1={facetId:ve,field:new L({required:!0,emptyAllowed:!0}),tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),activeTab:new L({required:!1}),filterFacetCount:new fe({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),resultsMustMatch:new Be({required:!1}),allowedValues:Dg,customSort:qg},Rn=P("facet/register",e=>O(e,F1)),Fn=P("facet/toggleSelectValue",e=>O(e,{facetId:ve,selection:new X({values:ui})})),En=P("facet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new X({values:ui})})),rt=P("facet/deselectAll",e=>O(e,ve)),vc=P("facet/updateSortCriterion",e=>O(e,{facetId:ve,criterion:new Be({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 fe({required:!0})})),ao=P("facet/updateFreezeCurrentValues",e=>O(e,{facetId:ve,freezeCurrentValues:new fe({required:!0})}));d();c();l();u();var Ac=e=>J("analytics/facet/showMore",(t,r)=>{O(e,ve);let n=ts(e,ur(r));return t.makeFacetShowMore(n)}),Cc=e=>J("analytics/facet/showLess",(t,r)=>{O(e,ve);let n=ts(e,ur(r));return t.makeFacetShowLess(n)}),In=e=>J("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:ve,criterion:new Be({required:!0})});let{facetId:n,criterion:o}=e,a=ur(r),p={...ts(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),bt=e=>J("analytics/facet/reset",(t,r)=>{O(e,ve);let n=ur(r),o=ts(e,n);return t.makeFacetClearAll(o)}),it=e=>J("analytics/facet/select",(t,r)=>{O(e,{facetId:ve,facetValue:z});let n=ur(r),o=rs(e,n);return t.makeFacetSelect(o)}),fr=e=>J("analytics/facet/exclude",(t,r)=>{O(e,{facetId:ve,facetValue:z});let n=ur(r),o=rs(e,n);return t.makeFacetExclude(o)}),Wr=e=>J("analytics/facet/deselect",(t,r)=>{O(e,{facetId:ve,facetValue:z});let n=ur(r),o=rs(e,n);return t.makeFacetDeselect(o)}),io=e=>J("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:ve,facetValue:z});let n=ur(r),o=rs(e,n);return t.makeFacetUnexclude(o)}),xc=e=>J("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:ve,facetValue:z});let n=rs(e,ur(r));return t.makeBreadcrumbFacet(n)}),Bt=()=>({actionCause:"facetClearAll"}),gt=()=>({actionCause:"facetSelect"}),so=()=>({actionCause:"facetExclude"}),co=()=>({actionCause:"facetDeselect"}),RT=()=>({actionCause:"facetUnexclude"}),Mg=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var FT={facetId:ve,value:new X({values:{displayValue:Ge,rawValue:Ge,count:new re({required:!0,min:0})}})},Vg=P("facetSearch/register",e=>O(e,Ql)),Ko=P("facetSearch/update",e=>O(e,Ql)),fi=P("facetSearch/toggleSelectValue",e=>O(e,FT)),mi=P("facetSearch/toggleExcludeValue",e=>O(e,FT));var Pr=ae(es(),e=>{e.addCase(Rn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=Iw(E1(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(x=>!f.includes(x.value)&&!m.includes(x.value));p.currentValues=[...f.map(IT),...m.map(TT),...v.map(T1)],p.preventAutoSelect=g>0,p.numberOfValues=Math.max(g,p.numberOfValues)})}).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){jg(a,o);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",a.freezeCurrentValues=!0}).addCase(En,(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){jg(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)=>{yc(t[r.payload]?.request)}).addCase(ft,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>yc(r))}).addCase(gs,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>yc(r))}).addCase(on,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(vc,(t,r)=>{hc(t,r.payload)}).addCase(di,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;Og(t[n]?.request,o)}).addCase(pi,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,a=t[n]?.request;a&&(a.isFieldExpanded=o)}).addCase(W.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>ET(t[o.facetId]?.request,o))}).addCase(Rr.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>ET(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=IT(i);jg(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=TT(i);jg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(tt,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];yc(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)&&!or(a.tabs,n)&&yc(a.request)})})});function jg(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 ET(e,t){e&&(e.currentValues=t.values.map(I1),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var $l={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function E1(e){return{...$l,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function I1(e){let{value:t,state:r}=e;return{value:t,state:r}}function IT(e){return{value:e,state:"selected"}}function TT(e){return{value:e,state:"excluded"}}function T1(e){return{...e,state:"idle"}}d();c();l();u();var Lg=()=>J("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function Yo(e){let t=PT(e.start,e),r=PT(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function PT(e,t){let{dateFormat:r}=t;return vR(e)?(ko(e),hR(e)):typeof e=="string"&&cn(e)?(ko(e),e):(Dp(e,r),ll(wa(e,r)))}d();c();l();u();var bc=P("rangeFacet/updateSortCriterion",e=>O(e,{facetId:ve,criterion:new Be({required:!0})}));d();c();l();u();var gi={state:z,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new fe({required:!0}),numberOfResults:new re({required:!0,min:0})},hi={start:z,end:z,endInclusive:new fe({required:!0}),state:z,numberOfResults:new re({required:!0,min:0})},yi=e=>({facetId:ve,selection:typeof e.start=="string"?new X({values:hi}):new X({values:gi})});var P1={start:z,end:z,endInclusive:new fe({required:!0}),state:z},k1={facetId:ve,field:z,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),activeTab:new L({required:!1}),currentValues:new ie({required:!1,each:new X({values:P1})}),generateAutomaticRanges:new fe({required:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function kT(e){return cn(e)?pl(e):e}function Ug(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Yo(t);if(wa(kT(r)).isAfter(wa(kT(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Tn=P("dateFacet/register",e=>{try{return hr(e,k1),Ug(e),{payload:e,error:null}}catch(t){return{payload:e,error:Gn(t)}}}),Pn=P("dateFacet/toggleSelectValue",e=>O(e,{facetId:ve,selection:new X({values:hi})})),kn=P("dateFacet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new X({values:hi})})),uo=P("dateFacet/updateFacetValues",e=>{try{return hr(e,{facetId:ve,values:new ie({each:new X({values:hi})})}),Ug({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Gn(t)}}}),Qg=bc,Bg=rt;d();c();l();u();d();c();l();u();var Gg=(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 Hl=e=>J("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,yi(e.selection));let n=Gg(r,e);return t.makeBreadcrumbFacet(n)}),nC=$g;d();c();l();u();function O1(e,t){return!!t&&t.facetId in e.dateFacetSet}var OT=(e,t)=>{let r=Lr(e,t);if(O1(e,r))return r},_T=(e,t)=>(OT(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),NT=(e,t)=>(OT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var zg={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function Wg(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=DT(r);r.numberOfValues=o,e[n]=t}function Kg(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=DT(n))}function Yg(e,t,r){let n=e[t]?.request;if(!n)return;let o=Hg(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=Hg(n.currentValues,r);if(!o)return;let a=o.state==="excluded";o.previousState=o.state,o.state=a?"idle":"excluded",n.preventAutoSelect=!0}function On(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function Xg(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(!!Hg(o,p)?p.state="selected":typeof t=="object"&&r in t&&p.state!=="idle"&&(p.previousState=p.state,p.state="idle"),p));let a=o.filter(p=>!Hg(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function Zg(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 Hg(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function DT(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var _n=ae(Xi(),e=>{e.addCase(Tn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=_1(n);Wg(t,Fw(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.df||{};Xg(t,n)}).addCase(Pn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Yg(t,n,o)}).addCase(kn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Jg(t,n,o)}).addCase(uo,(t,r)=>{let{facetId:n,values:o}=r.payload;Kg(t,n,o)}).addCase(Bg,(t,r)=>{On(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{On(t,r)})}).addCase(Qg,(t,r)=>{hc(t,r.payload)}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.facets;Zg(t,n,N1)}).addCase(tt,(t,r)=>{On(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)&&!or(a.tabs,n)&&On(t,o)})})});function _1(e){return{...zg,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function N1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var D1={state:z,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new fe({required:!0})},q1={facetId:ve,field:z,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),activeTab:new L({required:!1}),currentValues:new ie({required:!1,each:new X({values:D1})}),generateAutomaticRanges:new fe({required:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function eh(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 Nn=P("numericFacet/register",e=>{try{return O(e,q1),eh(e),{payload:e,error:null}}catch(t){return{payload:e,error:Gn(t)}}}),Dn=P("numericFacet/toggleSelectValue",e=>O(e,{facetId:ve,selection:new X({values:gi})})),qn=P("numericFacet/toggleExcludeValue",e=>O(e,{facetId:ve,selection:new X({values:gi})})),lo=P("numericFacet/updateFacetValues",e=>{try{return hr(e,{facetId:ve,values:new ie({each:new X({values:gi})})}),eh({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Gn(t)}}}),th=bc,rh=rt;d();c();l();u();var zl=e=>J("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,yi(e.selection));let n=Gg(r,e);return t.makeBreadcrumbFacet(n)}),oC=$g;d();c();l();u();function M1(e,t){return!!t&&t.facetId in e.numericFacetSet}var qT=(e,t)=>{let r=Lr(e,t);if(M1(e,r))return r},MT=(e,t)=>(qT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),VT=(e,t)=>(qT(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var kr=ae(Zi(),e=>{e.addCase(Nn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=V1(n);Wg(t,Ew(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.nf||{};Xg(t,n)}).addCase(Dn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Yg(t,n,o)}).addCase(qn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Jg(t,n,o)}).addCase(lo,(t,r)=>{let{facetId:n,values:o}=r.payload;Kg(t,n,o)}).addCase(rh,(t,r)=>{On(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{On(t,r)})}).addCase(th,(t,r)=>{hc(t,r.payload)}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.facets;Zg(t,n,j1)}).addCase(tt,(t,r)=>{On(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)&&!or(a.tabs,n)&&On(t,o)})})});function V1(e){return{...zg,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function j1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var Si=z,nh=new X({options:{required:!0},values:{caption:Ge,expression:Ge,state:new L({constrainTo:["idle","selected","excluded"]})}}),oh=new ie({required:!0,each:nh});var wc=P("staticFilter/register",e=>O(e,{id:Si,values:oh})),po=P("staticFilter/toggleSelect",e=>O(e,{id:Si,value:nh})),fo=P("staticFilter/toggleExclude",e=>O(e,{id:Si,value:nh})),Jo=P("staticFilter/deselectAllFilterValues",e=>O(e,Si)),ah=e=>J("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),Rc=e=>J("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),ih=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 sh=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 jT(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 LT(e){if(!L1(e))throw K;let t=jT(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let w={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:R,selection:E})=>{r(Fn({facetId:R,selection:E})),r(ao({facetId:R,freezeCurrentValues:!1})),r(W({legacy:xc({facetId:R,facetValue:E.value}),next:Mg()}))},executeToggleExclude:({facetId:R,selection:E})=>{r(En({facetId:R,selection:E})),r(ao({facetId:R,freezeCurrentValues:!1})),r(W({legacy:xc({facetId:R,facetValue:E.value}),next:Mg()}))},facetValuesSelector:bw};return sh(w)},a=()=>{let w={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:R=>{r(Dn(R)),r(W({legacy:zl(R),next:oC()}))},executeToggleExclude:R=>{r(qn(R)),r(W({legacy:zl(R),next:oC()}))},facetValuesSelector:MT};return sh(w)},i=()=>{let w={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:R=>{r(Pn(R)),r(W({legacy:Hl(R),next:nC()}))},executeToggleExclude:R=>{r(kn(R)),r(W({legacy:Hl(R),next:nC()}))},facetValuesSelector:NT};return sh(w)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(w=>w.path.length),f=w=>{let R=Rw(n(),w);return{facetId:w,field:n().categoryFacetSet[w].request.field,path:R,deselect:()=>{r(vn(w)),r(W({legacy:kg({categoryFacetPath:R.map(E=>E.value),categoryFacetId:w}),next:yT()}))}}},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(W({legacy:Rc({staticFilterId:w,staticFilterValue:{caption:E,expression:I}})}))}}),x=()=>{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=>C(R,k));return{facetId:R,field:R,label:E,values:I}},C=(w,R)=>({value:R,deselect:()=>{r(yn({field:w,selection:R})),r(W({legacy:xc({facetId:w,facetValue:R.value}),next:Mg()}))}});function b(){return!![...o(),...a(),...i(),...p(),...m(),...x()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:a(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:x(),hasBreadcrumbs:b()}},deselectAll:()=>{t.deselectAll(),r(W({legacy:Lg(),next:{actionCause:"breadcrumbResetAll"}}))}}}function L1(e){return e.addReducers({configuration:me,search:he,facetSet:Pr,numericFacetSet:kr,dateFacetSet:_n,categoryFacetSet:An}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var U1=new ie({each:z,required:!0}),UT=(e,t)=>(O(e,z),Oi(t)?O(t,z):O(t,U1),{payload:{contextKey:e,contextValue:t}}),vi=P("context/set",e=>{for(let[t,r]of Object.entries(e))UT(t,r);return{payload:e}}),Ai=P("context/add",e=>UT(e.contextKey,e.contextValue)),Ci=P("context/remove",e=>O(e,z));d();c();l();u();var ch=ae(Lp(),e=>{e.addCase(vi,(t,r)=>{t.contextValues=r.payload}).addCase(Ai,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Ci,(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 Q1=["caseId","caseNumber"],B1={caseId:"caseContext",caseNumber:"caseContext"},Wl=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${B1[t]} to set this value.}`)}};function aC(e){return Q1.includes(e)}var G1=new Se({values:new X({options:{required:!1}})});function QT(e,t={}){if(!z1(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=lt(e,G1,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"?$1(n):H1(n))}}var $1=e=>({add(t,r){e(Ai({contextKey:t,contextValue:r}))},remove(t){e(Ci(t))}}),H1=e=>({add(t,r){if(aC(t))throw new Wl(t);e(Ai({contextKey:t,contextValue:r}))},remove(t){if(aC(t))throw new Wl(t);e(Ci(t))}});function z1(e){return e.addReducers({context:ch}),!0}function BT(e,t){return QT(e,t)}d();c();l();u();d();c();l();u();var wt=ae(Qp(),e=>{e.addCase(Fe,(t,r)=>({...t,...r.payload})).addCase(W.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(W.rejected,t=>{t.freezeFacetOrder=!1}).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(Sn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;uh(o,t,n)}).addCase(Rn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;uh(o,t,n)}).addCase(Tn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;uh(o,t,n)}).addCase(Nn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;uh(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]=Fv()),t.facets[n].enabled=!0})})});function uh(e,t,r){let n={...Fv(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var Fc=ae(Hp(),e=>{e.addCase(Bs,(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;GT(t,n)}).addCase(ls,(t,r)=>{let n=r.payload;GT(t,n)}).addCase(qe.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(Me,(t,r)=>{let n=r.payload.tab;de(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function GT(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function lh(e){if(!W1(e))throw K;let t=oe(e),r=et(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function W1(e){return e.addReducers({tabSet:Fc}),!0}function $T(e,t){if(!K1(e))throw K;let r=lh(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:or(i(t.facetId),r.state.activeTab)}),f=()=>{let C=p();return C===x?!1:(x=C,!0)},m=()=>t.conditions.length>0?t.conditions.some(C=>{if(!n(C.parentFacetId))return!1;let b=o(C.parentFacetId);return b===null?!1:C.condition(b)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([C,b])=>b.request.freezeCurrentValues&&e.dispatch(ao({facetId:C,freezeCurrentValues:!1})))},v=()=>{if(!a(t.facetId))return;let C=n(t.facetId),b=m(),w=or(i(t.facetId),r.state.activeTab),R=b&&w;C!==R&&(e.dispatch(R?Qt(t.facetId):tt(t.facetId)),g())},x=p(),h=e.subscribe(()=>{f()&&v()});return v(),{stopWatching(){h()}}}function K1(e){return e.addReducers({facetOptions:wt}),!0}d();c();l();u();d();c();l();u();var Ec=P("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:Ge}),a=O(n,o).error;return a?{payload:e,error:a}:{payload:e}}),Ic=P("dictionaryFieldContext/add",e=>{let t=new X({options:{required:!0},values:{field:Ge,key:Ge}});return O(e,t)}),Tc=P("dictionaryFieldContext/remove",e=>O(e,Ge));d();c();l();u();var dh=ae(Up(),e=>{e.addCase(Ec,(t,r)=>{t.contextValues=r.payload}).addCase(Ic,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Tc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function HT(e){if(!Y1(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(Ec(o))},add(o,a){r(Ic({field:o,key:a}))},remove(o){r(Tc(o))}}}function Y1(e){return e.addReducers({dictionaryFieldContext:dh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var zT=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var ph=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),WT=()=>({correctedQuery:"",corrections:[],originalQuery:""});function KT(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:ph(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var YT=(e,t)=>{let r={...WT(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var fh=ae(KT(),e=>{e.addCase(Fs,t=>{t.enableDidYouMean=!0}).addCase(Mp,t=>{t.enableDidYouMean=!1}).addCase(Vp,t=>{t.automaticallyCorrectQuery=!0}).addCase(Es,t=>{t.automaticallyCorrectQuery=!1}).addCase(W.pending,t=>{t.queryCorrection=ph(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(W.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let a=o?.[0]?o[0]:ph();t.queryCorrection=a}t.queryCorrectionMode==="next"&&YT(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(Cr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(Ra,(t,r)=>{t.queryCorrectionMode=r.payload})});function JT(e,t={}){if(!J1(e))throw K;let r=oe(e),{dispatch:n}=e;n(Fs()),t.options?.automaticallyCorrectQuery===!1&&n(Es()),n(Ra(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>zT(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(Cr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(Ra(i))}}}function J1(e){return e.addReducers({configuration:me,didYouMean:fh}),!0}function XT(e,t={}){let r=JT(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(W({legacy:jp(),next:wR()}))}}}d();c();l();u();d();c();l();u();function ZT(e){if(!X1(e))throw K;let t=oe(e),r=()=>e.state;return{...t,sort(n){return fl(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function X1(e){return e.addReducers({search:he,facetOptions:wt}),!0}function eP(e){return ZT(e)}d();c();l();u();d();c();l();u();var mh=ae(Ki(),e=>{e.addCase(W.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(lc,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(yn,(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(dc,(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=Z1(a),p=n[a].map(f=>tP(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(tP(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 Z1(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function tP(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var gh=e=>e.state==="selected",hh=e=>e.state==="excluded",yh=(e,t)=>{let r={facetId:e,facetValue:t.value};return gh(t)?Wr(r):it(r)},Sh=e=>gh(e)?co():gt(),rP=(e,t)=>{let r={facetId:e,facetValue:t.value};return hh(t)?io(r):fr(r)},nP=e=>hh(e)?RT():so();function oP(e,t){let{dispatch:r}=e,n=oe(e),{field:o}=t;return{...n,toggleSelect(a){r(yn({field:o,selection:a})),r(W({legacy:yh(o,a),next:Sh(a)}))},deselectAll(){r(dc(o)),r(W({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 aP(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function iP(e,t){if(!eG(e))throw K;let{dispatch:r}=e,n=aP(t.options);return r(lc(n)),{...oe(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>oP(e,{field:i.field}))??[]}}}}function eG(e){return e.addReducers({automaticFacetSet:mh,configuration:me,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function vh(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,a={...Mn,...t},i=r();e[n]={options:a,isLoading:o,response:i,initialNumberOfValues:a.numberOfValues,requestId:""}}function Ah(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function Ch(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function xh(e,t){let r=e[t];r&&(r.isLoading=!1)}function bh(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function Kl(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=Mn.query)}function wh(e,t){Object.keys(e).forEach(r=>Kl(e,{facetId:r},t))}var Mn={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var sP=/*#__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:x}=a,h=tG(a),C=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:C,filterFacetCount:x,type:"hierarchical",...(n?{}:{searchContext:(yield br(t,r)).request})}});return function sP(_x157,_x158,_x159,_x160){return _ref71.apply(this,arguments)}}(),tG=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var cP=/*#__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(x=>x.state!=="idle").map(x=>x.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 br(t,r)).request})}});return function cP(_x161,_x162,_x163,_x164){return _ref72.apply(this,arguments)}}();var uP=e=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,z),rG(i,t)?p=yield cP(t,i,a,e):p=yield sP(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=Ce("facetSearch/executeSearch",uP(!1)),Vn=Ce("facetSearch/executeSearch",uP(!0)),Pc=P("facetSearch/clearResults",e=>O(e,{facetId:ve})),rG=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function lP(){return{}}var kc=ae(lP(),e=>{e.addCase(gc,(t,r)=>{let n=r.payload;vh(t,n,iC)}).addCase(Ko,(t,r)=>{Ah(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;Ch(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;xh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{bh(t,r.payload,r.meta.requestId)}).addCase(Pc,(t,{payload:{facetId:r}})=>{Kl(t,{facetId:r},iC)}).addCase(W.fulfilled,t=>{wh(t,iC)})});function iC(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function dP(e,t){let{field:r,state:n}=e;if(!nG(e))return r;let o=`${r}_`,a=oG(o,n);return iG(r,t),`${o}${a}`}function nG(e){let{field:t,state:r}=e;return pP(r).some(o=>o&&t in o)}function oG(e,t){let n=pP(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return aG(n,e)+1}function pP(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function aG(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 iG(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||dP({field:o,state:r},n)}d();c();l();u();d();c();l();u();var fP=["alphanumeric","occurrences"];var mP=new Se({field:xn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),basePath:CT,delimitingCharacter:xT,facetId:Cn,facetSearch:Sc,filterByBasePath:bT,filterFacetCount:bn,injectionDepth:wn,numberOfValues:zr,sortCriteria:new L({constrainTo:fP})});function gP(e,t){if(!sG(e))throw K;let r=oe(e),{dispatch:n}=e,o=Gt(e,t.options),a=t.options.tabs??{},i=Lt(e.state.tabSet),p={...Gl,...hd("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...Mn,...t.options.facetSearch},...p};He(e,mP,f,"buildCategoryFacet");let m=()=>JS(e.state,o),g=()=>YS(e.state,o),v=()=>en(e.state),x=()=>un(e.state,o);return n(Sn(p)),{...r,toggleSelect(h){let C=f.numberOfValues;n(Wo({facetId:o,selection:h,retrieveCount:C})),n(Fe())},deselectAll(){n(vn(o)),n(Fe())},sortBy(h){n(fc({facetId:o,criterion:h})),n(Fe())},isSortedBy(h){return m().sortCriteria===h},showMoreValues(){let{numberOfValues:h}=f,{activeValue:C,valuesAsTrees:b}=this.state,w=(C?.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(),C=g(),b=v(),w=x(),R=C?.values??[],E=R.some(B=>B.children.length>0)??!1,{parents:I,values:k}=ww(C?.values),T=cr(R),D=T.length?T[T.length-1]:void 0,G=!!D,U=D?.moreValuesAvailable??C?.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:G,canShowMoreValues:U,canShowLessValues:V,sortCriteria:h.sortCriteria,enabled:w}}}}function sG(e){return e.addReducers({categoryFacetSet:An,categoryFacetSearchSet:kc,facetOptions:wt,configuration:me,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var cG="coveo-headless-internal-state",Rh=Symbol.for(cG);d();c();l();u();function Oc(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(Pc({facetId:p}))},updateCaptions(f){r(Ko({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:g}=o(),{query:v}=g,x=f.values;return{...f,values:x,isLoading:m,query:v}}}}function hP(e,t){let{dispatch:r}=e,n={...Mn,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[Rh].categoryFacetSearchSet[o];r(gc(n));let i=Oc(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(mc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function Fh(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a}=t,{dispatch:i}=e,p={...Mn,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],g=hP(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(gc(p));let v=Oc(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn});return{...v,...g,get state(){return{...v.state,...g.state}}}}function yP(e,t){if(!uG(e))throw K;let r=gP(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=Fh(e,{options:{facetId:o(),...t.options.facetSearch},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn,select:f=>{n(Fe()),n(W({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(W({legacy:lG(o(),f),next:dG(f)}))},deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:Bt()}))},sortBy(f){r.sortBy(f),n(W({legacy:In({facetId:o(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(Rr({legacy:Ac(o())}))},showLessValues(){r.showLessValues(),n(Rr({legacy:Cc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function uG(e){return e.addReducers({categoryFacetSet:An,categoryFacetSearchSet:kc,configuration:me,search:he}),!0}function lG(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Wr(r):it(r)}function dG(e){return e.state==="selected"?co():gt()}d();c();l();u();d();c();l();u();d();c();l();u();function SP(){return{}}var _c=ae(SP(),e=>{e.addCase(Vg,(t,r)=>{let n=r.payload;vh(t,n,sC)}).addCase(Ko,(t,r)=>{Ah(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;Ch(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;xh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{bh(t,r.payload,r.meta.requestId)}).addCase(Pc,(t,{payload:r})=>{Kl(t,r,sC)}).addCase(W.fulfilled,t=>{wh(t,sC)})});function sC(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var vP={facetId:ve,selection:new X({values:ui})},AP=Ce("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},vP),n(Fn({facetId:e,selection:t})),n(Fe())}),CP=Ce("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},vP),n(En({facetId:e,selection:t})),n(Fe())});d();c();l();u();d();c();l();u();var Nc=["allValues","atLeastOneValue"];d();c();l();u();var Eh=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var xP=new Se({facetId:Cn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),field:xn,filterFacetCount:bn,injectionDepth:wn,numberOfValues:zr,sortCriteria:new L({constrainTo:Eh}),resultsMustMatch:new L({constrainTo:Nc}),facetSearch:Sc});function bP(e,t,r=xP){if(!pG(e))throw K;let{dispatch:n}=e,o=oe(e),a=Gt(e,t.options),i=t.options.tabs??{},p=Lt(e.state.tabSet),f={...$l,...hd("facetSearch",t.options),field:t.options.field,facetId:a,tabs:i,activeTab:p},m={facetSearch:{...Mn,...t.options.facetSearch},...f};He(e,r,m,"buildFacet");let g=()=>pp(e.state,a),v=()=>Yi(e.state,a),x=()=>en(e.state),h=()=>un(e.state,a),C=()=>{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(Rn(f)),{...o,toggleSelect:w=>n(AP({facetId:m.facetId,selection:w})),toggleExclude:w=>n(CP({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:gh,isValueExcluded:hh,deselectAll(){n(rt(a)),n(Fe())},sortBy(w){n(vc({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,C());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=x(),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"),G=R?R.moreValuesAvailable:!1,U=w.resultsMustMatch;return{label:R?.label,facetId:a,tabs:i,values:T,sortCriterion:k,resultsMustMatch:U,isLoading:E,hasActiveValues:D,canShowMoreValues:G,canShowLessValues:b(),enabled:I}}}}function pG(e){return e.addReducers({facetSet:Pr,facetOptions:wt,configuration:me,facetSearchSet:_c}),!0}d();c();l();u();function Ih(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[Rh].facetSearchSet[m];r(Vg(n));let v=Oc(e,{options:n,getFacetSearch:g,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...v,select(x){r(fi({facetId:m,value:x})),o(x)},exclude(x){r(mi({facetId:m,value:x})),a(x)},singleSelect(x){r(rt(m)),r(fi({facetId:m,value:x})),o(x)},singleExclude(x){r(rt(m)),r(mi({facetId:m,value:x})),a(x)},get state(){let{values:x}=v.state;return{...v.state,values:x.map(({count:h,displayValue:C,rawValue:b})=>({count:h,displayValue:C,rawValue:b}))}}}}d();c();l();u();var wP=new Se({facetId:Cn,field:xn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),filterFacetCount:bn,injectionDepth:wn,numberOfValues:zr,sortCriteria:new L({constrainTo:Eh}),resultsMustMatch:new L({constrainTo:Nc}),facetSearch:Sc,allowedValues:Dg,hasBreadcrumbs:wT,customSort:qg});function RP(e,t){if(!fG(e))throw K;let{dispatch:r}=e,n=bP(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},wP),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return Ih(e,{options:{facetId:o(),...m},select:g=>{r(Fe()),r(W({legacy:it({facetId:o(),facetValue:g.rawValue}),next:gt()}))},exclude:g=>{r(Fe()),r(W({legacy:fr({facetId:o(),facetValue:g.rawValue}),next:so()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(W({legacy:yh(o(),m),next:Sh(m)}))},toggleExclude(m){n.toggleExclude(m),r(W({legacy:rP(o(),m),next:nP(m)}))},deselectAll(){n.deselectAll(),r(W({legacy:bt(o()),next:Bt()}))},sortBy(m){n.sortBy(m),r(W({legacy:In({facetId:o(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(Rr({legacy:Ac(o())}))},showLessValues(){n.showLessValues(),r(Rr({legacy:Cc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function fG(e){return e.addReducers({facetSet:Pr,configuration:me,facetSearchSet:_c,search:he}),!0}d();c();l();u();d();c();l();u();var Th=e=>e.state==="selected",cC=e=>e.state==="excluded",Ph=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Th(t)?Wr(n):it(n)},kh=e=>Th(e)?co():gt(),FP=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return cC(t)?io(n):fr(n)};d();c();l();u();d();c();l();u();d();c();l();u();var Oh=P("rangeFacet/executeToggleSelect",e=>O(e,yi(e.selection))),_h=P("rangeFacet/executeToggleExclude",e=>O(e,yi(e.selection)));var EP={facetId:ve,selection:new X({values:hi})},IP=Ce("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,EP),t(Pn(e)),t(Oh(e)),t(Fe())}),TP=Ce("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,EP),t(kn(e)),t(_h(e)),t(Fe())});d();c();l();u();function Nh(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 Dh(e,t){let{facetId:r,getRequest:n}=t,o=oe(e),a=e.dispatch,i=()=>un(e.state,r);return{...o,isValueSelected:Th,isValueExcluded:cC,deselectAll(){a(rt(r)),a(Fe())},sortBy(p){a(bc({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:[],x=en(e.state),h=i(),C=v.some(w=>w.state!=="idle"),b=f?.domain;return{facetId:r,values:v,sortCriterion:m,resultsMustMatch:g,hasActiveValues:C,isLoading:x,enabled:h,domain:b}}}}d();c();l();u();d();c();l();u();var qh=["idle","selected","excluded"];d();c();l();u();var Mh=["ascending","descending"],Vh=["even","equiprobable"];var mG={start:new L,end:new L,endInclusive:new fe,state:new L({constrainTo:qh})},gG=new Se({facetId:Cn,field:xn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),generateAutomaticRanges:Ng,filterFacetCount:bn,injectionDepth:wn,numberOfValues:zr,currentValues:new ie({each:new X({values:mG})}),sortCriteria:new L({constrainTo:Mh}),rangeAlgorithm:new L({constrainTo:Vh})});function jh(e,t){He(e,gG,t,"buildDateFacet"),Ug(t)}function PP(e,t){if(!hG(e))throw K;Nh(t.options,"buildDateFacet");let r=e.dispatch,n=Gt(e,t.options),o=t.options.tabs??{},a=Lt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};jh(e,i),r(Tn(i));let p=Dh(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(IP({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(rt(n)),this.toggleSelect(f)},toggleExclude:f=>r(TP({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(rt(n)),this.toggleExclude(f)},get state(){return p.state}}}function hG(e){return e.addReducers({configuration:me,search:he,dateFacetSet:_n,facetOptions:wt}),!0}function kP(e,t){let r=PP(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:Bt()}))},sortBy(a){r.sortBy(a),n(W({legacy:In({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(W({legacy:Ph(o(),a),next:kh(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(W({legacy:FP(o(),a)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function OP(e,t){if(!yG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Gt(e,t.options),i=t.options.tabs??{},p=Lt(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};jh(e,f),n(Tn(f));let m=()=>un(e.state,a);return{...r,clear:()=>{n(uo({facetId:a,values:[]})),n(Fe())},setRange:g=>{let v={...g,state:"selected",numberOfResults:0,endInclusive:!0},x=uo({facetId:a,values:[v]});return x.error?!1:(n(x),n(Fe()),!0)},enable(){n(Qt(a))},disable(){n(tt(a))},get state(){let g=en(o()),v=m(),x=_T(o(),a),h=x.length?x[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:v}}}}function yG(e){return e.addReducers({dateFacetSet:_n,facetOptions:wt,configuration:me,search:he}),!0}function _P(e,t){if(!SG(e))throw K;let r=OP(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(W({legacy:bt(o()),next:Bt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(W({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function SG(e){return e.addReducers({dateFacetSet:_n,configuration:me,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var NP={facetId:ve,selection:new X({values:gi})},DP=Ce("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,NP),t(Dn(e)),t(Oh(e)),t(Fe())}),gQe=Ce("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,NP),t(qn(e)),t(_h(e)),t(Fe())});d();c();l();u();var vG={start:new re,end:new re,endInclusive:new fe,state:new L({constrainTo:qh})},AG=new Se({facetId:Cn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),field:xn,generateAutomaticRanges:Ng,filterFacetCount:bn,injectionDepth:wn,numberOfValues:zr,currentValues:new ie({each:new X({values:vG})}),sortCriteria:new L({constrainTo:Mh}),resultsMustMatch:new L({constrainTo:Nc}),rangeAlgorithm:new L({constrainTo:Vh})});function Lh(e,t){He(e,AG,t,"buildNumericFacet"),eh(t)}d();c();l();u();function Dc(e){return{endInclusive:!1,state:"idle",...e}}function qP(e,t){if(!CG(e))throw K;Nh(t.options,"buildNumericFacet");let r=e.dispatch,n=Gt(e,t.options),o=t.options.tabs??{},a=Lt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Lh(e,i),r(Nn(i));let p=Dh(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(DP({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(rt(n)),this.toggleSelect(f)},get state(){return p.state}}}function CG(e){return e.addReducers({numericFacetSet:kr,facetOptions:wt,configuration:me,search:he}),!0}function MP(e,t){if(!xG(e))throw K;let r=qP(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:Bt()}))},sortBy(a){r.sortBy(a),n(W({legacy:In({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(W({legacy:Ph(o(),a),next:kh(a)}))},get state(){return{...r.state}}}}function xG(e){return e.addReducers({numericFacetSet:kr,configuration:me,search:he}),!0}d();c();l();u();d();c();l();u();function VP(e,t){if(!bG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Gt(e,t.options),i=t.options.tabs??{},p=Lt(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};Lh(e,f),n(Nn(f));let m=()=>un(e.state,a);return{...r,clear:()=>{n(lo({facetId:a,values:[]})),n(Fe())},setRange:g=>{let v={...g,state:"selected",numberOfResults:0,endInclusive:!0},x=lo({facetId:a,values:[v]});return x.error?!1:(n(x),n(Fe()),!0)},enable(){n(Qt(a))},disable(){n(tt(a))},get state(){let g=en(o()),v=m(),x=VT(o(),a),h=x.length?x[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:v}}}}function bG(e){return e.addReducers({numericFacetSet:kr,facetOptions:wt,configuration:me,search:he}),!0}function jP(e,t){if(!wG(e))throw K;let r=VP(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(W({legacy:bt(o()),next:Bt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(W({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function wG(e){return e.addReducers({numericFacetSet:kr,configuration:me,search:he}),!0}d();c();l();u();function LP(e,t){if(!RG(e))throw K;let{facetSearch:r,...n}=t.options.facet,o=Gt(e,n);e.dispatch(Sn({...Gl,...n,facetId:o}));let a=Fh(e,{options:{...r,facetId:o},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn,select:p=>{e.dispatch(Fe()),e.dispatch(W({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 RG(e){return e.addReducers({categoryFacetSet:An,configuration:me,categoryFacetSearchSet:kc,search:he}),!0}d();c();l();u();function UP(e,t){if(!FG(e))throw K;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Gt(e,o);e.dispatch(Rn({...$l,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=Ih(e,{options:{...r,facetId:a},select:f=>{e.dispatch(Fe()),e.dispatch(W({legacy:it({facetId:a,facetValue:f.rawValue}),next:gt()}))},exclude:f=>{e.dispatch(Fe()),e.dispatch(W({legacy:fr({facetId:a,facetValue:f.rawValue}),next:so()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn});return{...oe(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function FG(e){return e.addReducers({facetSet:Pr,configuration:me,facetSearchSet:_c,search:he}),!0}d();c();l();u();d();c();l();u();var uC={collectionField:new L({emptyAllowed:!1,required:!1}),parentField:new L({emptyAllowed:!1,required:!1}),childField:new L({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new re({min:0,required:!1})},Xo=P("folding/register",e=>O(e,uC)),Zo=Ce("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 To(a):bs(a,o),p=yield n.search({...i,q:EG(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 EG(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var IG=e=>J("analytics/folding/showMore",(t,r)=>(Zt(e),t.makeShowMoreFoldedResults(pt(e,r),Ke(e)))),TG=()=>J("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),QP={logShowMoreFoldedResults:IG,logShowLessFoldedResults:TG};d();c();l();u();d();c();l();u();d();c();l();u();var Uh=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function PG(e,t){return e.raw[t.collection]}function lC(e,t){return e.raw[t.parent]}function Yl(e,t){let r=e.raw[t.child];return md(r)?r[0]:r}function kG(e,t){return(e||t)!==void 0&&e===t}function GP(e,t,r,n=[]){let o=Yl(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=Yl(a,r)===Yl(e,r);return lC(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:GP(i,t,r,[...n,o])}}):[]}function OG(e,t){return e.find(r=>{let n=lC(r,t)===void 0,o=kG(lC(r,t),Yl(r,t));return n||o})}function $P(e){return e.parentResult?$P(e.parentResult):e}function _G(e,t,r,n){let o=xp(e),i={...(n??OG(o,t)??$P(e)),searchUid:r},p=GP(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function Qh(e,t,r,n){let o={};return e.forEach(a=>{let i=PG(a,t);i&&(!Yl(a,t)&&!a.parentResult||(o[i]=_G(a,t,r,n)))}),o}function BP(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 Bh=ae(Uh(),e=>e.addCase(W.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Qh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(jt.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Qh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(wr.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...Qh(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Xo,(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;BP(t,n).isLoadingMoreResults=!0}).addCase(Zo.rejected,(t,{meta:r})=>{let n=r.arg;BP(t,n).isLoadingMoreResults=!1}).addCase(Zo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=Qh(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 Jl={id:z},qc=P("querySuggest/register",e=>O(e,{...Jl,count:new re({min:0})})),HP=P("querySuggest/unregister",e=>O(e,Jl)),jn=P("querySuggest/selectSuggestion",e=>O(e,{...Jl,expression:Ge})),ea=P("querySuggest/clear",e=>O(e,Jl)),ta=Ce("querySuggest/fetch",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,Jl);let i=e.id,p=yield NG(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)}}()),NG=/*#__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 ws(t.configuration.analytics):Ur(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function NG(_x171,_x172,_x173){return _ref76.apply(this,arguments)}}();var Ft=ae(dt(),e=>e.addCase(Vt,(t,r)=>({...t,...r.payload})).addCase(Cr,(t,r)=>{t.q=r.payload}).addCase(jn,(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,Fd)),Mc=P("fields/fetchall/enable"),xi=P("fields/fetchall/disable"),Vc=Ce("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 Gh=["author","language","urihash","objecttype","collection","source","permanentid"],dC=[...Gh,"date","filetype","parents"],zP=[...dC,"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"],WP=()=>({fieldsToInclude:Gh,fetchAllFields:!1,fieldsDescription:[]});var na=ae(WP(),e=>e.addCase(ra,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Mc,t=>{t.fetchAllFields=!0}).addCase(xi,t=>{t.fetchAllFields=!1}).addCase(Vc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Xo,(t,{payload:r})=>{let n=Uh().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function jc(e){if(!DG(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:ml(n)}}}}function DG(e){return e.addReducers({search:he}),!0}var qG=new Se({fieldsToInclude:new ie({required:!1,each:new L({required:!0,emptyAllowed:!1})})});function $h(e,t){if(!MG(e))throw K;let r=oe(e),n=jc(e),{dispatch:o}=e,a=()=>e.state,i=He(e,qG,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,x=!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<v){if(m++,m>=g){f=Date.now(),!x&&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.`),x=!0;return}}else m=0;x=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref78.apply(this,arguments)}}()}}function MG(e){return e.addReducers({search:he,configuration:me,fields:na}),!0}var VG=new Se(uC);function KP(e,t,r){if(!jG(e))throw K;let n=$h(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?He(e,VG,t.options.folding,"buildFoldedResultList"):{};return o(Xo({...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 pC(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return pC(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 jG(e){return e.addReducers({search:he,configuration:_f,folding:Bh,query:Ft}),!0}function pC(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=pC(n.children,t);if(o)return o}}return null}function YP(e,t={}){let r=KP(e,{...t,loadCollectionActionCreator:Zo,fetchMoreResultsActionCreator:wr},QP);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Lc(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var Uc=ae(Yv(),e=>e.addCase(js,(t,{payload:r})=>{t.isVisible=r}).addCase(Cl,(t,{payload:r})=>{t.isEnabled=r}).addCase(Af,(t,{payload:r})=>{t.id=r.id}).addCase(Oa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,delete t.error;let n=r.textDelta,o=!!t.answer?.trim(),a=n.trim().length>0;if(o){t.answer+=n;return}t.answer=a?n:void 0}).addCase(_a,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Lc([...t.citations,...r.citations]),delete t.error}).addCase(Na,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===Ky},t.citations=[],delete t.answer}).addCase(hf,t=>{t.liked=!0,t.disliked=!1}).addCase(yf,t=>{t.liked=!1,t.disliked=!0}).addCase(Sf,t=>{t.feedbackModalOpen=!0}).addCase(Cf,t=>{t.feedbackModalOpen=!1}).addCase(Us,t=>{t.feedbackSubmitted=!0}).addCase(dr,t=>({...Yv(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase(ln,(t,{payload:r})=>{t.isLoading=r}).addCase(ka,(t,{payload:r})=>{t.isStreaming=r}).addCase(Da,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(xf,(t,{payload:r})=>{t.responseFormat=r}).addCase(wf,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(bl,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(xl,t=>{t.expanded=!0}).addCase(vf,t=>{t.expanded=!1}).addCase(bf,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(qa,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(Xv,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Ls,(t,{payload:r})=>{t.answerId=r}).addCase(gf,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(Rf,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(Ff,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}).addCase(Ef,(t,{payload:r})=>{let{toolCallName:n,toolCallId:o,startedAt:a}=r,i=t.generationSteps.findLast(p=>p.status==="active");i&&(i.toolCalls=i.toolCalls||[],i.toolCalls.push({toolCallName:n,toolCallId:o,startedAt:a,status:"active"}))}).addCase(Qs,(t,{payload:r})=>{let{toolCallId:n,args:o,type:a}=r,p=t.generationSteps.findLast(f=>f.status==="active")?.toolCalls?.find(f=>f.toolCallId===n);p&&(p.toolCallArgs=o,p.type=a==="search"?"search":"generic")}).addCase(If,(t,{payload:r})=>{let{toolCallId:n,finishedAt:o}=r,i=t.generationSteps.findLast(p=>p.status==="active")?.toolCalls?.find(p=>p.toolCallId===n);i&&(i.finishedAt=o,i.status="completed")}));d();c();l();u();function Qc(e,t,r={}){if(!LG(e))throw K;let{dispatch:n}=e,o=oe(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(js(i));let p=r.initialState?.responseFormat;p&&n(xf(p));let f=r.fieldsToIncludeInCitations;return f&&n(wf(f)),r.initialState?.expanded&&n(xl()),{...o,get state(){let g=a().generatedAnswer;return{...g,error:si(g.error)}},like(){this.state.liked||(n(hf()),n(t.logLikeGeneratedAnswer(this.state.answerId)))},dislike(){this.state.disliked||(n(yf()),n(t.logDislikeGeneratedAnswer(this.state.answerId)))},openFeedbackModal(){n(Sf())},closeFeedbackModal(){n(Cf())},sendFeedback(g){n(t.logGeneratedAnswerFeedback(g)),n(Us())},logCitationClick(g,v){n(t.logOpenGeneratedAnswerSource(g,v))},logCitationHover(g,v,x){n(t.logHoverCitation(g,v,x))},show(){this.state.isVisible||(n(js(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(js(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(xl()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(vf()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(Cl(!0))},disable(){this.state.isEnabled&&n(Cl(!1))},logCopyToClipboard(g){n(t.logCopyGeneratedAnswer(g))},retry(){}}}function LG(e){return e.addReducers({generatedAnswer:Uc}),!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(MF({setAbortControllerRef:p=>$t.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function JP(e,t,r={}){if(!UG(e))throw K;let n=Qc(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(Af({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(W({legacy:t.logRetryGeneratedAnswer()}))}}}function UG(e){return e.addReducers({generatedAnswer:Uc}),!0}d();c();l();u();d();c();l();u();var XP=kf.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Hh=e=>e==="yes"?!0:e==="no"?!1:null,QG=({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:Hh(t.correctTopic),documented:Hh(t.documented),hallucinationFree:Hh(t.hallucinationFree),readable:Hh(t.readable)},helpful:t.helpful,question:r}),BG=e=>{let t="",r=()=>{let n=e.state,o=CF(n),a=o.requestId;a!==t&&(t=a,e.dispatch(dr()),o.q?.length>0&&e.dispatch(Tf()))};e.subscribe(r)};function ZP(e,t,r={}){if(!GG(e))throw K;Ho(e.state.configuration.analytics.analyticsMode);let{...n}=Qc(e,t,r),o=()=>e.state;return e.dispatch(bf(r.answerConfigurationId)),BG(e),{...n,get state(){let a=Zv(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:Lc(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=cf(o());e.dispatch(Pf(a??Ta))},reset(){e.dispatch(dr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=QG({query:o().query.q,feedback:a,answerApiState:Zv(e.state).data});e.dispatch(XP.endpoints.post.initiate(i)),e.dispatch(Us())})()}}}function GG(e){return e.addReducers({[Ma.reducerPath]:Ma.reducer,query:Ft}),!0}d();c();l();u();d();c();l();u();var fC=class extends og{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}}},ek=(e,t,r)=>new fC({url:`${ag(e,t,r)}/follow-up`});d();c();l();u();var tk=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(jl(t)),e(pg({answerId:t,isLoading:!1})),e(fg({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:n})=>{e(xg({name:n.stepName,startedAt:n.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:n})=>{e(bg({name:n.stepName,finishedAt:n.timestamp??Date.now(),answerId:t}))},onToolCallStartEvent:({event:n})=>{let{toolCallName:o,toolCallId:a,timestamp:i}=n;e(wg({answerId:t,toolCallId:a,toolCallName:o,startedAt:i??Date.now()}))},onToolCallEndEvent:({event:n})=>{let{toolCallId:o,timestamp:a}=n;e(Rg({answerId:t,toolCallId:o,finishedAt:a??Date.now()}))},onToolCallArgsEvent:({event:n})=>{let{toolCallId:o,delta:a}=n;try{let i=JSON.parse(a);typeof i?.q=="string"?e(cc({answerId:t,toolCallId:o,args:i,type:"search"})):e(cc({answerId:t,toolCallId:o,args:{raw:a},type:"generic"}))}catch{console.warn(`Failed to parse tool call args delta as JSON. Using raw string instead. Delta: ${a}`),e(cc({answerId:t,toolCallId:o,args:{raw:a},type:"generic"}))}},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(mg({textDelta:n.delta,answerId:t}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(dg({contentFormat:a.contentFormat,answerId:t}));return}case"citations":{e(gg({citations:a.citations,answerId:t}));return}}},onRunErrorEvent:({input:n,event:o})=>{t||(t=n.runId,e(jl(n.runId)));let a=Fg(o.code);e(yg({message:o.message,code:a,answerId:t})),t=""},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(hg({cannotAnswer:!o,answerId:t})),e(Xn(o,t,a)),e(jo(t)),t="",r=!1}}};d();c();l();u();d();c();l();u();function rk(){return{conversationId:"",conversationToken:"",isEnabled:!1,followUpAnswers:[]}}var nk=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function mC(e){return e.followUpAnswers.find(t=>t.isActive)}function Jt(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var ok=ae(rk(),e=>e.addCase(ig,(t,{payload:r})=>{t.isEnabled=r}).addCase(sg,(t,{payload:r})=>{t.conversationId=r}).addCase(cg,(t,{payload:r})=>{t.conversationToken=r}).addCase(ug,t=>{t.conversationToken=""}).addCase(lg,(t,{payload:r})=>{let n=mC(t);n&&(n.isActive=!1),t.followUpAnswers.push(nk(r.question))}).addCase(jl,(t,{payload:r})=>{let n=mC(t);!n||n.answerId||(n.answerId=r)}).addCase(dg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(pg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(fg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(mg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(gg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.citations=Lc([...n.citations,...r.citations]),delete n.error)}).addCase(hg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(yg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(Sg,(t,{payload:r})=>{let n=mC(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(vg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(Ag,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(VI,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(xg,(t,{payload:r})=>{let n=Jt(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(bg,(t,{payload:r})=>{let n=Jt(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(Cg,t=>{t.followUpAnswers=[],t.conversationId="",t.conversationToken="",t.isEnabled=!1}).addCase(wg,(t,{payload:r})=>{let{toolCallName:n,toolCallId:o,startedAt:a,answerId:i}=r,p=Jt(t,i);if(!p)return;let f=p.generationSteps.findLast(m=>m.status==="active");f&&(f.toolCalls=f.toolCalls||[],f.toolCalls.push({toolCallName:n,toolCallId:o,startedAt:a,status:"active"}))}).addCase(cc,(t,{payload:r})=>{let{toolCallId:n,args:o,answerId:a,type:i}=r,p=Jt(t,a);if(!p)return;let m=p.generationSteps.findLast(g=>g.status==="active")?.toolCalls?.find(g=>g.toolCallId===n);m&&(m.toolCallArgs=o,m.type=i==="search"?"search":"generic")}).addCase(Rg,(t,{payload:r})=>{let{toolCallId:n,finishedAt:o,answerId:a}=r,i=Jt(t,a);if(!i)return;let f=i.generationSteps.findLast(m=>m.status==="active")?.toolCalls?.find(m=>m.toolCallId===n);f&&(f.finishedAt=o,f.status="completed")}));function ak(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!$G(e))throw K;let n=Qc(e,t,r),o=()=>e.state;e.dispatch(Tp(r.agentId));let a=mp(o()),i=fp(o()),p=gp(o()),f=ek(r.agentId,a,p),m=tk(e.dispatch),g=Eg();return{...n,get state(){let v=o().followUpAnswers,x=o().generatedAnswer;return{...x,error:si(x.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 x=this.state.followUpAnswers.followUpAnswers.find(h=>h.answerId===v);if(!x){console.warn(`No follow-up answer found with ID ${v}. Cannot like.`);return}x.liked||(e.dispatch(vg({answerId:v})),e.dispatch(t.logLikeGeneratedAnswer(v)))},dislike(v){if(!v||this.state.answerId===v){n.dislike();return}let x=this.state.followUpAnswers.followUpAnswers.find(h=>h.answerId===v);if(!x){console.warn(`No follow-up answer found with ID ${v}. Cannot dislike.`);return}x.disliked||(e.dispatch(Ag({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,x){let h=Ue(e.state);!x||x===h?e.dispatch(t.logOpenGeneratedAnswerSource(v,x)):t.logOpenGeneratedAnswerFollowUpSource&&e.dispatch(t.logOpenGeneratedAnswerFollowUpSource(v,x))},logCitationHover(v,x,h){if(!h||this.state.answerId===h){n.logCitationHover(v,x);return}e.dispatch(t.logHoverCitation(v,x,h))},askFollowUp(v){var _this37=this;return _asyncToGenerator(function*(){if(!_this37.state.followUpAnswers.isEnabled||!v||v.trim()==="")return;let x=_this37.state.followUpAnswers.conversationId,h=_this37.state.followUpAnswers.conversationToken;if(!x){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(lg({question:v}));let C=Ur(o().configuration.analytics,e.navigatorContext);try{yield f.runAgent({forwardedProps:{q:v,analytics:C.analytics,conversationId:x,conversationToken:h,accessToken:i}},m)}catch(b){e.dispatch(Sg({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",b)}})()}}}function $G(e){return e.addReducers({followUpAnswers:ok}),!0}function ik(e,t={}){Ho(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=ak(e,qs,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=ZP(e,qs,t):r=JP(e,qs,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function Ht(e,t,r){if(!HG(e))throw K;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:yd(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function HG(e){return e.addReducers({configuration:me}),!0}function sk(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logCitationOpen(r.options.citation.id,r.options.answerId)))};return Ht(e,r,()=>{o()})}d();c();l();u();function ck(e){return{logCitationOpen(t,r){let n=Ue(e());return r!==void 0&&n!==void 0&&r!==n?Hv(t,r):r!==void 0?lf(t,r):lf(t)}}}function uk(e,t){return sk(e,ck(()=>e.state),t)}d();c();l();u();d();c();l();u();function lk(e,t,r){let n=!1;return Ht(e,r,()=>{n||(n=!0,e.dispatch(t.logGeneratedAnswerOpenInlineLink(r.options.link,r.options.answerId)))})}function dk(e,t){return lk(e,qs,t)}d();c();l();u();d();c();l();u();var Bc=ae(Bp(),e=>{e.addCase(W.fulfilled,zG).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function zG(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var zh=()=>J("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),Wh=()=>J("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Kh=()=>J("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var pk=e=>({past:[],present:e,future:[]}),WG=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]}},KG=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}},YG=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:[]}:pk(i)},fk=e=>{let{actionTypes:t,reducer:r}=e,n=pk();return(o=n,a)=>{switch(a.type){case t.undo:return WG(o);case t.redo:return KG(o);case t.snapshot:return YG({state:o,reducer:r,action:a});default:return o}}};d();c();l();u();d();c();l();u();var{getOwnPropertyNames:JG,getOwnPropertySymbols:XG}=Object,{hasOwnProperty:ZG}=Object.prototype;function gC(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function Yh(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 mk(e){return JG(e).concat(XG(e))}var e2=Object.hasOwn||((e,t)=>ZG.call(e,t)),t2="__v",r2="__o",n2="_owner",{getOwnPropertyDescriptor:gk,keys:hk}=Object,bi=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function o2(e,t){return e===t}function a2(e,t){return e.byteLength===t.byteLength&&Jh(new Uint8Array(e),new Uint8Array(t))}function i2(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 s2(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 c2(e,t){return bi(e.getTime(),t.getTime())}function u2(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function yk(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 x=i.value,h=p.value;if(r.equals(x[0],h[0],f,v,e,t,r)&&r.equals(x[1],h[1],x[0],h[0],e,t,r)){g=o[v]=!0;break}v++}if(!g)return!1;f++}return!0}function l2(e,t,r){let n=hk(e),o=n.length;if(hk(t).length!==o)return!1;for(;o-->0;)if(!vk(e,t,r,n[o]))return!1;return!0}function Xl(e,t,r){let n=mk(e),o=n.length;if(mk(t).length!==o)return!1;let a,i,p;for(;o-->0;)if(a=n[o],!vk(e,t,r,a)||(i=gk(e,a),p=gk(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function d2(e,t){return bi(e.valueOf(),t.valueOf())}function p2(e,t){return e.source===t.source&&e.flags===t.flags}function Sk(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 f2(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 vk(e,t,r,n){return(n===n2||n===r2||n===t2)&&(e.$$typeof||t.$$typeof)?!0:e2(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var m2=Object.prototype.toString;function g2(e){let t=v2(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:o,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:p,areRegExpsEqual:f,areSetsEqual:m,getUnsupportedCustomComparator:g}=e;return function(x,h,C){if(x===h)return!0;if(x==null||h==null)return!1;let b=typeof x;if(b!==typeof h)return!1;if(b!=="object")return b==="number"||b==="bigint"?i(x,h,C):b==="function"?o(x,h,C):!1;let w=x.constructor;if(w!==h.constructor)return!1;if(w===Object)return p(x,h,C);if(w===Array)return r(x,h,C);if(w===Date)return n(x,h,C);if(w===RegExp)return f(x,h,C);if(w===Map)return a(x,h,C);if(w===Set)return m(x,h,C);if(w===Promise)return!1;if(Array.isArray(x))return r(x,h,C);let R=m2.call(x),E=t[R];if(E)return E(x,h,C);let I=g&&g(x,h,C,R);return I?I(x,h,C):!1}}function h2({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:a2,areArraysEqual:r?Xl:i2,areDataViewsEqual:s2,areDatesEqual:c2,areErrorsEqual:u2,areFunctionsEqual:o2,areMapsEqual:r?gC(yk,Xl):yk,areNumbersEqual:bi,areObjectsEqual:r?Xl:l2,arePrimitiveWrappersEqual:d2,areRegExpsEqual:p2,areSetsEqual:r?gC(Sk,Xl):Sk,areTypedArraysEqual:r?gC(Jh,Xl):Jh,areUrlsEqual:f2,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=Yh(n.areArraysEqual),a=Yh(n.areMapsEqual),i=Yh(n.areObjectsEqual),p=Yh(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:p})}return n}function y2(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function S2({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 v2({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:x,areUrlsEqual:h}){return{"[object Arguments]":f,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":p,"[object BigInt64Array]":x,"[object BigUint64Array]":x,"[object Boolean]":m,"[object DataView]":r,"[object Date]":n,"[object Error]":o,"[object Float16Array]":x,"[object Float32Array]":x,"[object Float64Array]":x,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":x,"[object Int16Array]":x,"[object Int32Array]":x,"[object Map]":i,"[object Number]":m,"[object Object]":(C,b,w)=>typeof C.then!="function"&&typeof b.then!="function"&&f(C,b,w),"[object RegExp]":g,"[object Set]":v,"[object String]":m,"[object URL]":h,"[object Uint8Array]":x,"[object Uint8ClampedArray]":x,"[object Uint16Array]":x,"[object Uint32Array]":x}}var hC=Ln(),cze=Ln({strict:!0}),uze=Ln({circular:!0}),lze=Ln({circular:!0,strict:!0}),dze=Ln({createInternalComparator:()=>bi}),pze=Ln({strict:!0,createInternalComparator:()=>bi}),fze=Ln({circular:!0,createInternalComparator:()=>bi}),mze=Ln({circular:!0,createInternalComparator:()=>bi,strict:!0});function Ln(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=h2(e),i=g2(a),p=r?r(i):y2(i);return S2({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 A2(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>Zl(r,n))!==-1)}var Zl=Ln({createCustomConfig:e=>({...e,areArraysEqual:A2})});var C2=ae(FR(),e=>{e.addCase(lr,(t,r)=>x2(t,r.payload)?void 0:r.payload)}),x2=(e,t)=>b2(e.context,t.context)&&w2(e.dictionaryFieldContext,t.dictionaryFieldContext)&&k2(e.advancedSearchQueries,t.advancedSearchQueries)&&R2(e.tabSet,t.tabSet)&&F2(e.staticFilterSet,t.staticFilterSet)&&yC(e.facetSet,t.facetSet)&&yC(e.dateFacetSet,t.dateFacetSet)&&yC(e.numericFacetSet,t.numericFacetSet)&&I2(e.automaticFacetSet,t.automaticFacetSet)&&E2(e.categoryFacetSet,t.categoryFacetSet)&&T2(e.pagination,t.pagination)&&P2(e.query,t.query)&&O2(e,t)&&_2(e.pipeline,t.pipeline)&&N2(e.searchHub,t.searchHub)&&D2(e.facetOrder,t.facetOrder)&&q2(e.debug,t.debug),b2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),w2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),R2=(e,t)=>{let r=Ak(e),n=Ak(t);return r?.id===n?.id},Ak=e=>Object.values(e).find(t=>t.isActive),F2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=Ck(e[r]),a=Ck(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},Ck=e=>e.values.filter(t=>t.state!=="idle"),yC=(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},E2=(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},I2=(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},T2=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,P2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),k2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),O2=(e,t)=>e.sortCriteria===t.sortCriteria,_2=(e,t)=>e===t,N2=(e,t)=>e===t,D2=(e,t)=>wi(e,t),q2=(e,t)=>e===t,Xh=fk({actionTypes:{redo:pv.type,undo:dv.type,snapshot:lr.type},reducer:C2});function xk(e){if(!M2(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(cl()),r(W({legacy:Wh()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(kp()),r(W({legacy:zh()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r(cl()),r(W({legacy:Kh()})))})()}}}function M2(e){return e.addReducers({history:Xh,configuration:me,facetOrder:Bc}),!0}d();c();l();u();d();c();l();u();var V2={results:new ie({required:!0,each:new X({values:bp})}),maxLength:new re({required:!0,min:1,default:10})},Gc=P("recentResults/registerRecentResults",e=>O(e,V2)),Or=P("recentResults/pushRecentResult",e=>(Zt(e),{payload:e})),$c=P("recentResults/clearRecentResults");function bk(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(iR(t.options.result)))};return Ht(e,t,()=>{n(),e.dispatch(Or(t.options.result))})}d();c();l();u();d();c();l();u();function Zh(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var wk=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},Rk=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},Fk=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{Zh(o)&&delete t[r].cache[n]})},Ek=(e,t,r)=>{for(let o in t)for(let a in t[o].cache)t[o].cache[a].isActive=!1;if(!SC(e,t)){j2(e,t,r);return}let n=SC(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},Ik=(e,t,r)=>{let{id:n,q:o,searchUid:a,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[o]={...SC(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},Tk=(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},SC=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},j2=(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 Pk(){return{}}var ey=ae(Pk(),e=>{e.addCase(hs,(t,r)=>{wk(r.payload,t)}),e.addCase(an,(t,r)=>{Rk(r.payload,t)}),e.addCase(ys,(t,r)=>{Fk(r.payload,t)}),e.addCase(Ps.pending,(t,r)=>{Ek(r.meta.arg,t,{results:[]})}),e.addCase(Ps.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));Ik({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(Ps.rejected,(t,r)=>{Tk(r.meta.arg,t)})});d();c();l();u();var L2={searchBoxId:st,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re},kk=new Se(L2);function Ok(e,t){if(!U2(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};He(e,kk,a,"buildInstantResults");let i=a.searchBoxId;n(hs({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 x=f(v);(!x||!x.isLoading&&(x.error||Zh(x)))&&n(Ps({id:i,q:v,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(an({id:i,q:v}))},clearExpired(){n(ys({id:i}))},get state(){let v=m(),x=f(v);return{q:v,isLoading:x?.isLoading||!1,error:x?.error||null,results:g()}}}}function U2(e){return e.addReducers({instantResults:ey}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var _r=ae(xr(),e=>{e.addCase(Ss,(t,r)=>{let n=vC(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=ed(n,o)}).addCase(vs,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(ht,t=>{t.firstResult=0}).addCase(As,(t,r)=>{let n=r.payload;t.firstResult=ed(n,t.numberOfResults)}).addCase(sn,(t,r)=>{let n=r.payload;t.firstResult=ed(n,t.numberOfResults)}).addCase(xs,t=>{let r=vC(t),n=Math.max(r-1,1);t.firstResult=ed(n,t.numberOfResults)}).addCase(Cs,t=>{let r=vC(t),n=Q2(t),o=Math.min(r+1,n);t.firstResult=ed(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(W.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(jt.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(rt,t=>{zt(t)}).addCase(kn,t=>{zt(t)}).addCase(En,t=>{zt(t)}).addCase(qn,t=>{zt(t)}).addCase(mi,t=>{zt(t)}).addCase(Fn,t=>{zt(t)}).addCase(vn,t=>{zt(t)}).addCase(Wo,t=>{zt(t)}).addCase(mc,t=>{zt(t)}).addCase(Pn,t=>{zt(t)}).addCase(Dn,t=>{zt(t)}).addCase(ft,t=>{zt(t)}).addCase(uo,t=>{zt(t)}).addCase(lo,t=>{zt(t)}).addCase(fi,t=>{zt(t)}).addCase(yn,t=>{zt(t)})});function zt(e){e.firstResult=xr().firstResult}function vC(e){let{firstResult:t,numberOfResults:r}=e;return AC(t,r)}function Q2(e){let{totalCountFiltered:t,numberOfResults:r}=e;return CC(t,r)}function ed(e,t){return(e-1)*t}function AC(e,t){return Math.round(e/t)+1}function CC(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function B2(e){return e.pagination.firstResult}function _k(e){return e.pagination.numberOfResults}function G2(e){return e.pagination.totalCountFiltered}var mo=e=>{let t=B2(e),r=_k(e);return AC(t,r)},td=e=>{let t=G2(e),r=_k(e);return CC(t,r)},ty=(e,t)=>{let r=mo(e),n=td(e),o=$2(r,t);return o=H2(o),o=z2(o,n),W2(o)};function $2(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 H2(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function z2(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 W2(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var zc=()=>J("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||xr().numberOfResults})),Wc=()=>J("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:mo(t)})),ry=()=>J("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:mo(t)})),ny=()=>J("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:mo(t)})),Kc=()=>({actionCause:"browseResults"});d();c();l();u();var K2=new Se({numberOfPages:new re({default:5,min:0})}),Y2=new Se({page:new re({min:1})});function Nk(e,t={}){if(!J2(e))throw K;let r=oe(e),{dispatch:n}=e,o=He(e,K2,t.options,"buildPager"),i=lt(e,Y2,t.initialState,"buildPager").page;i&&n(As(i));let p=()=>mo(e.state),f=()=>{let{numberOfPages:g}=o;return ty(e.state,g)},m=()=>td(e.state);return{...r,get state(){let g=p(),v=m(),x=g>1&&v>0,h=g<v;return{currentPage:g,currentPages:f(),maxPage:v,hasPreviousPage:x,hasNextPage:h}},selectPage(g){n(sn(g))},nextPage(){n(Cs())},previousPage(){n(xs())},isCurrentPage(g){return g===this.state.currentPage}}}function J2(e){return e.addReducers({configuration:me,pagination:_r}),!0}function Dk(e,t={}){let{dispatch:r}=e,n=Nk(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(jt({legacy:Wc(),next:Kc()}))},nextPage(){n.nextPage(),r(jt({legacy:ry(),next:Kc()}))},previousPage(){n.previousPage(),r(jt({legacy:ny(),next:Kc()}))}}}d();c();l();u();d();c();l();u();function qk(e){if(!X2(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 X2(e){return e.addReducers({search:he}),!0}function Mk(e){return qk(e)}d();c();l();u();d();c();l();u();function Vk(e){if(!Z2(e))throw K;let t=oe(e),r=jc(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 Z2(e){return e.addReducers({search:he,pagination:_r}),!0}function jk(e){return Vk(e)}d();c();l();u();d();c();l();u();d();c();l();u();function oy(_x176,_x177){return _oy.apply(this,arguments)}function _oy(){_oy=_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 _oy.apply(this,arguments)}var Ri=Ce("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield oy(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)}}()),Yc=P("resultPreview/next"),Jc=P("resultPreview/previous"),Xc=P("resultPreview/prepare",e=>O(e,{results:new ie({required:!0})})),Lk=2048,Zc=Ce("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=Dx(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>Lk&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${Lk} characters.`),{contentURL:o}});return function(_x180,_x181){return _ref80.apply(this,arguments)}}());d();c();l();u();var Uk=e=>J({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Zt(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 xC(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var bC=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=xC();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},wC=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),ay=ae(xC(),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(W.fulfilled,(t,r)=>{bC(t),t.resultsWithPreview=wC(r.payload.response.results)}).addCase(wr.fulfilled,(t,r)=>{bC(t),t.resultsWithPreview=t.resultsWithPreview.concat(wC(r.payload.response.results))}).addCase(jt.fulfilled,bC).addCase(Xc,(t,r)=>{t.resultsWithPreview=wC(r.payload.results)}).addCase(Yc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(Jc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Zc.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function Qk(e,t,r,n,o){if(!e$(e))throw K;let{dispatch:a}=e,i=()=>e.state,p=oe(e),{result:f,maximumPreviewSize:m}=t.options,g=()=>{let{resultsWithPreview:x,position:h}=i().resultPreview;return x[h]},v=x=>{a(Zc({uniqueId:x,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(Ri({uniqueId:x,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){v(f.uniqueId)},next(){a(Yc()),v(g())},previous(){a(Jc()),v(g())},get state(){let x=i(),h=f.hasHtmlVersion,C=x.resultPreview,b=f.uniqueId===C.uniqueId?C.content:"",w=C.isLoading,R=C.contentURL,E=g();return{content:b,resultHasPreview:h,isLoading:w,contentURL:R,currentResultUniqueId:E}}}}function e$(e){return e.addReducers({configuration:me,resultPreview:ay}),!0}function Bk(e,t){if(!t$(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=Qk(e,t,oy,"/html",()=>{e.dispatch(Uk(t.options.result))});return r(Xc({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function t$(e){return e.addReducers({search:he}),!0}d();c();l();u();d();c();l();u();var Gk=()=>J("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),$k=()=>J("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var r$={queries:new ie({required:!0,each:new L({emptyAllowed:!1})}),maxLength:new re({required:!0,min:1,default:10})},Fi=P("recentQueries/registerRecentQueries",e=>O(e,r$)),eu=P("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function Hk(){return{queries:[],maxLength:10}}var iy=ae(Hk(),e=>{e.addCase(Fi,n$).addCase(eu,o$).addCase(W.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||a$(n,t)})});function n$(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 o$(e){e.queries=[]}function a$(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 i$={queries:[]},s$={maxLength:10,clearFilters:!0},c$=new Se({queries:new ie({required:!0})}),u$=new Se({maxLength:new re({required:!0,min:1}),clearFilters:new fe});function l$(e,t){He(e,u$,t?.options,"buildRecentQueriesList"),lt(e,c$,t?.initialState,"buildRecentQueriesList")}function zk(e,t){if(!d$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...s$,...t?.options},i={...i$,...t?.initialState};l$(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(eu())},updateRecentQueries(f){let m=new ie({required:!0,each:new L({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};fd(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(Ts(g))}}}function d$(e){return e.addReducers({search:he,recentQueries:iy,query:Ft}),!0}function Wk(e,t){let r=zk(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(Gk()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(W({legacy:$k(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var Kk=e=>J("analytics/recentResults/click",(t,r)=>(Zt(e),t.makeRecentResultClick(pt(e,r),Ke(e)))),Yk=()=>J("analytics/recentResults/clear",e=>e.makeClearRecentResults());function Jk(e,t){return Ht(e,t,()=>e.dispatch(Kk(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function Xk(){return{results:[],maxLength:10}}var sy=ae(Xk(),e=>{e.addCase(Gc,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase($c,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 p$={initialState:{results:[]},options:{maxLength:10}},f$=new Se({results:new ie({required:!0})}),m$=new Se({maxLength:new re({required:!0,min:1})});function g$(e,t){He(e,m$,t?.options,"buildRecentResultsList"),lt(e,f$,t?.initialState,"buildRecentResultsList")}function Zk(e,t){if(!h$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...p$,...t};g$(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n(Gc(i)),{...r,get state(){return o().recentResults},clear(){n(Yk()),n($c())}}}function h$(e){return e.addReducers({recentResults:sy}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var tO=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=S$(e),f=rO(o?o[1]:null),m=y$(a),g=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:g,qreWeights:p}},rO=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},eO=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},y$=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=eO(e[1],t);if(!n)return null;let o={};for(let a of n){let i=eO(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=rO(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},S$=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 nO(e){return e.search.response.results.map(r=>{let n=tO(r.rankingInfo);return{result:r,ranking:n}})}var v$=new Se({enabled:new fe({default:!1})});function oO(e,t={}){if(!A$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;lt(e,v$,t.initialState,"buildRelevanceInspector").enabled&&n(Eo());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:x,userIdentities:h,rankingExpressions:C}=p.search.response,{fieldsDescription:b,fetchAllFields:w}=p.fields;return{isEnabled:f,rankingInformation:nO(p),executionReport:m,expressions:{basicExpression:g,advancedExpression:v,constantExpression:x},userIdentities:h,rankingExpressions:C,fieldsDescription:b,fetchAllFields:w}},enable(){n(Eo()),i("debug")},disable(){n(ds()),n(xi())},enableFetchAllFields(){n(Mc()),i("fetchAllFields")},disableFetchAllFields(){n(xi())},fetchFieldsDescription(){!this.state.isEnabled&&n(Eo()),n(Vc()),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.
47
47
 
48
48
  https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.ResultListOptions.html
49
- https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function l$(e){return e.addReducers({debug:ps,search:he,configuration:me,fields:na}),!0}d();c();l();u();d();c();l();u();var ey=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 zk(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(ey(t.options.result)))};return Ht(e,t,()=>{n(),e.dispatch(Or(t.options.result))})}d();c();l();u();function Wk(e,t){return Mh(e,{...t,fetchMoreResultsActionCreator:br})}d();c();l();u();d();c();l();u();var d$=new Se({numberOfResults:new re({min:0})});function Kk(e,t={}){if(!p$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,i=lt(e,d$,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(Ss(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(vs(p))},isSetTo(p){return p===this.state.numberOfResults}}}function p$(e){return e.addReducers({pagination:_r,configuration:me}),!0}function Yk(e,t={}){if(!f$(e))throw K;let r=Kk(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(jt({legacy:Gc(),next:Hc()}))}}}function f$(e){return e.addReducers({pagination:_r,configuration:me}),!0}d();c();l();u();d();c();l();u();var oa=()=>X("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),ty=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var Xk={id:W,query:Be},Jc=P("querySet/register",e=>O(e,Xk)),Ii=P("querySet/update",e=>O(e,Xk));d();c();l();u();var aa=ae(Qp(),e=>{e.addCase(Jc,(t,r)=>g$(t,r.payload)).addCase(Ii,(t,r)=>{let{id:n,query:o}=r.payload;hx(t,n,o)}).addCase(Vn,(t,r)=>{let{id:n,expression:o}=r.payload;hx(t,n,o)}).addCase(z.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;Jk(t,n)}).addCase(Me,m$).addCase(qe.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))hx(t,n,o)})});function m$(e,t){fe(t.payload.q)||Jk(e,t.payload.q)}function Jk(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var hx=(e,t,r)=>{t in e&&(e[t]=r)},g$=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var ry=e=>X("analytics/querySuggest",(t,r)=>{let n=yx(r,e);return t.makeOmniboxAnalytics(n)}),Zk=()=>({actionCause:"omniboxAnalytics"});function yx(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 eO(e,t){let r=t.id;r in e||(e[r]=h$(t))}function tO(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function rO(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function nO(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function h$(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var oO=()=>({});var Zc=ae(oO(),e=>e.addCase(_c,(t,r)=>{eO(t,r.payload)}).addCase(DP,(t,r)=>{delete t[r.payload.id]}).addCase(ta.pending,tO).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,rO).addCase(ea,(t,r)=>{nO(t,r.payload)}).addCase(ks,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var ny={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},Sx={open:new U,close:new U},vx={id:W,numberOfSuggestions:new re({min:0}),enableQuerySyntax:new pe,highlightOptions:new J({values:{notMatchDelimiters:new J({values:Sx}),exactMatchDelimiters:new J({values:Sx}),correctionDelimiters:new J({values:Sx})}}),clearFilters:new pe},aO=new Se(vx);function iO(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},...ny,...t.options};$e(e,aO,i,"buildSearchBox"),n(Jc({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(_c({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(Vt({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(Ts({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(Ii({id:a,query:m})),this.showSuggestions()},clear(){n(Ii({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:ry({id:a,suggestion:m}),next:Zk()}).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=y$(g,i.highlightOptions),C=g?g.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:v,isLoading:m.search.isLoading,isLoadingSuggestions:C}}}}function y$(e,t){return e?e.completions.map(r=>({highlightedValue:qy(r.highlighted,t),rawValue:r.expression})):[]}function S$(e){return e.addReducers({query:Ft,querySuggest:Zc,configuration:me,querySet:aa,search:he}),!0}function oy(e,t={}){let r=iO(e,{...t,executeSearchActionCreator:z,fetchQuerySuggestionsActionCreator:ta,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(oa(),ty())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var eu=()=>X("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||Sr()})),ay=()=>({actionCause:"resultsSort"});function cO(e,t){return e.q!==t.q?oa():e.sortCriteria!==t.sortCriteria?eu():e.firstResult!==t.firstResult?$c():e.numberOfResults!==t.numberOfResults?Gc():Nr(e.f,t.f)?ed(e.f,t.f):Nr(e.fExcluded,t.fExcluded)?ed(e.fExcluded,t.fExcluded,!0):Nr(e.cf,t.cf)?ed(e.cf,t.cf):Nr(e.af,t.af)?ed(e.af,t.af):Nr(e.nf,t.nf)?sO(e.nf,t.nf):Nr(e.df,t.df)?sO(e.df,t.df):wo()}function ed(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?pr({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?pr({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 sO(e={},t={}){return ed(ru(e),ru(t))}function uO(e,t){return e.q!==t.q?ty():e.sortCriteria!==t.sortCriteria?ay():Nr(e.f,t.f)?tu(e.f,t.f):Nr(e.fExcluded,t.fExcluded)?tu(e.fExcluded,t.fExcluded,!0):Nr(e.cf,t.cf)?tu(e.cf,t.cf):Nr(e.af,t.af)?tu(e.af,t.af):Nr(e.nf,t.nf)?tu(ru(e.nf),ru(t.nf)):Nr(e.df,t.df)?tu(ru(e.df),ru(t.df)):ss()}function Nr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function tu(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 ss();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():ss()}function ru(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 lO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function dO(e,t,r){if(e===void 0)return{};let n=t(e);return!sx(n,r)?{sortCriteria:n}:{}}function iy(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 pO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function fO(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:xr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??xr().defaultNumberOfResults,sortCriteria:Sr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:Eo(),sf:{},tab:"",af:{},mnf:{}}}var v$=new Se({parameters:new J({options:{required:!0},values:Ip})});function hO(e,t){let{dispatch:r}=e,n=oe(e);lt(e,v$,t.initialState,"buildSearchParameterManager");let o=mO(e.state.tabSet,t.initialState.parameters);return r(Me(o)),{...n,synchronize(a){let i=mO(e.state.tabSet,sy(e,a));r(Me(i))},get state(){return{parameters:Ax(e)}}}}function sy(e,t){let n={...fO(e.state),...t},o={};if(e.state.dateFacetSet)for(let i of Object.keys(e.state.dateFacetSet))o[i]=[];let a={};if(e.state.numericFacetSet)for(let i of Object.keys(e.state.numericFacetSet))a[i]=[];return{...n,df:{...o,...n.df},nf:{...a,...n.nf}}}function mO(e,t){if(fe(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:gO(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??gO(e)}}return t}function gO(e){return Object.keys(e)[0]??""}function Ax(e){let t=e.state;return{...lO(t.query,r=>r.q,dt().q),...pO(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]:""),...dO(t.sortCriteria,r=>r,Sr()),...x$(t),...C$(t),...b$(t),...w$(t),...R$(t)}}function A$(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function cy(e){let t=A$(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=nr(n?.tabs,t);return o&&a}}function yO(e){return e.currentValues.filter(t=>t.state==="selected")}function x$(e){let t=e.facetSet;if(t===void 0)return{};let r=cy(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 C$(e){return iy(e.categoryFacetSet,cy(e),t=>sr(t.currentValues).map(r=>r.value),"cf")}function b$(e){return iy(e.numericFacetSet,cy(e),yO,"nf")}function w$(e){return iy(e.dateFacetSet,cy(e),yO,"df")}function R$(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=F$(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function F$(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function uy(e,t){let{dispatch:r}=e,n=hO(e,t);return{...n,synchronize(o){let a=SO(e),i=sy(e,a),p=sy(e,o);Xl(i,p)||(n.synchronize(o),r(z({legacy:cO(i,p),next:uO(i,p)})))},get state(){return{parameters:SO(e)}}}}function SO(e){let t=e.state;return{...Ax(e),...E$(t),...I$(t),...T$(t),...P$(t),...k$(t),...N$(t),...O$(t)}}function E$(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==dt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function I$(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function T$(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function P$(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==xr().firstResult?{firstResult:t}:{}}function k$(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function O$(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=_$(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function _$(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function N$(e){if(e.debug===void 0)return{};let t=e.debug;return t!==Eo()?{debug:t}:{}}d();c();l();u();function vO(e){return qc(e)}d();c();l();u();d();c();l();u();d();c();l();u();var ly=()=>new J({values:{questionAnswerId:W},options:{required:!0}}),xx=()=>new J({values:{linkText:Be,linkURL:Be},options:{required:!0}});function nu(e){return O(e,ly())}d();c();l();u();function ct(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&PR(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 Cx=()=>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}}}}),bx=()=>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}}}}),wx=()=>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}}}}),Rx=()=>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}}}}),Fx=()=>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}}}}),td=e=>X({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,xx());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}}}}),Ex=()=>X("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),Ix=()=>X("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),D$={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},Tx=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:D$[e]}}}),Px=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}}}),kx=e=>X({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{nu(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}}}}}),Ox=e=>X({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{nu(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}}}}}),rd=e=>X({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,ly());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}}}}}),dy=(e,t)=>X({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,ly()),O(t,xx());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}}}}}),py={logExpandSmartSnippet:Cx,logCollapseSmartSnippet:bx,logLikeSmartSnippet:wx,logDislikeSmartSnippet:Rx,logOpenSmartSnippetSource:Fx,logOpenSmartSnippetInlineLink:td,logOpenSmartSnippetFeedbackModal:Ex,logCloseSmartSnippetFeedbackModal:Ix,logSmartSnippetFeedback:Tx,logSmartSnippetDetailedFeedback:Px,logExpandSmartSnippetSuggestion:kx,logCollapseSmartSnippetSuggestion:Ox,logOpenSmartSnippetSuggestionSource:rd};d();c();l();u();d();c();l();u();var ou=P("smartSnippet/expand"),au=P("smartSnippet/collapse"),iu=P("smartSnippet/like"),su=P("smartSnippet/dislike"),cu=P("smartSnippet/feedbackModal/open"),ia=P("smartSnippet/feedbackModal/close"),uu=P("smartSnippet/related/expand",e=>nu(e)),lu=P("smartSnippet/related/collapse",e=>nu(e));d();c();l();u();d();c();l();u();var _x=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var AO=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function xO({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return Di({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function q$(e,t){let r=xO(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var Ln=ae(_x(),e=>e.addCase(ou,t=>{t.expanded=!0}).addCase(au,t=>{t.expanded=!1}).addCase(iu,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(su,t=>{t.liked=!1,t.disliked=!0}).addCase(cu,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)=>q$(a,t.relatedQuestions[i])),o=xO(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{..._x(),relatedQuestions:n,questionAnswerId:o}}).addCase(uu,(t,r)=>{let n=AO(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(lu,(t,r)=>{let n=AO(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function CO(e,t,r){if(!M$(e))throw K;let n=oe(e),o=()=>e.state,a=()=>ct(o()),i=null,p=Ht(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(ou())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(au())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(iu())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(su())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(cu())},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 M$(e){return e.addReducers({search:he,questionAnswering:Ln}),!0}d();c();l();u();function fy(e,t){if(!V$(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)=>Ht(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(v)||e.dispatch(C?dy({questionAnswerId:C},g):td(g))}),f={},m=(g,v)=>{let{searchResponseId:C}=r().search;i(C);let h=Di({...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 V$(e){return e.addReducers({search:he,questionAnswering:Ln}),!0}function bO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=CO(e,py,t),n=fy(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 wO(e,t){if(!j$(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(uu(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(lu(i))}}}function j$(e){return e.addReducers({search:he,questionAnswering:Ln}),!0}d();c();l();u();function RO(e,t){if(!L$(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)=>Ht(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(C)||(e.dispatch(rd({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 L$(e){return e.addReducers({search:he,questionAnswering:Ln}),!0}function FO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=wO(e,py),n=fy(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=RO(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 EO={by:new Ru({enum:ba,required:!0})},du=P("sortCriteria/register",e=>IO(e)),pu=P("sortCriteria/update",e=>IO(e)),IO=e=>Ni(e)?(e.forEach(t=>O(t,EO)),{payload:e}):O(e,EO);d();c();l();u();var my=ae(Sr(),e=>{e.addCase(du,(t,r)=>tn(r.payload)).addCase(pu,(t,r)=>tn(r.payload)).addCase(qe.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(Me,(t,r)=>r.payload.sortCriteria??t)});function U$(e,t){if(!t)return;let r=new Se({criterion:new ie({each:Ew})}),n=Q$(t),o={...t,criterion:n};lt(e,r,o,"buildSort")}function Q$(e){return e.criterion?Ni(e.criterion)?e.criterion:[e.criterion]:[]}function TO(e,t){if(!B$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;U$(e,t.initialState);let a=t.initialState?.criterion;return a&&n(du(a)),{...r,sortBy(i){n(pu(i)),n(an(1))},isSortedBy(i){return this.state.sortCriteria===tn(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function B$(e){return e.addReducers({configuration:me,sortCriteria:my}),!0}function PO(e,t={}){let{dispatch:r}=e,n=TO(e,t),o=()=>r(z({legacy:eu(),next:ay()}));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 kO(e){return e.type==="redirect"}var gy=class{constructor(t){de(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(kO);return t.length?t[0].content:null}};var fu=P("standaloneSearchBox/register",e=>O(e,{id:W,redirectionUrl:W,overwrite:new pe({required:!1})})),mu=P("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:W,redirectionUrl:W})),gu=P("standaloneSearchBox/reset",e=>O(e,{id:W})),hu=P("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:W})),yu=P("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),sa=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 $$(r(),i),f=yield o.plan(p);if(vt(f))return n(f.error);let{redirectionUrl:m}=new gy(f.success);return m&&t(G$(m)),m||""});return function(_x183,_x184){return _ref82.apply(this,arguments)}}()),G$=e=>X("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),$$=/*#__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!==void 0&&{enableQuerySyntax:e.query.enableQuerySyntax}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield ws(e.configuration.analytics):Ur(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function $$(_x185,_x186){return _ref83.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function OO(){return{}}var hy=ae(OO(),e=>e.addCase(fu,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=Nx(o))}).addCase(gu,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=Nx(o.defaultRedirectionUrl);return}}).addCase(mu,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=Nx(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(hu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(yu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function Nx(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var _O=new Se({...vx,redirectionUrl:new U({required:!0,emptyAllowed:!1}),overwrite:new pe({required:!1})});function NO(e,t){if(!H$(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},...ny,overwrite:!1,...t.options};$e(e,_O,a,"buildStandaloneSearchBox");let i=oy(e,{options:a});return r(fu({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(hu({id:o}))},selectSuggestion(p){let f=yx(n(),{id:o,suggestion:p});r(Vn({id:o,expression:p})),r(yu({id:o,metadata:f})),this.submit()},afterRedirection(){r(gu({id:o}))},updateRedirectUrl(p){r(mu({id:o,redirectionUrl:p}))},submit(){r(Vt({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 H$(e){return e.addReducers({standaloneSearchBoxSet:hy,configuration:me,query:Ft,querySuggest:Zc}),!0}d();c();l();u();d();c();l();u();var yy=ae(Bp(),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 Dx(e){return{state:"idle",...e}}var z$=new Se({id:vi,values:Yg});function DO(e,t){if(!W$(e))throw K;$e(e,z$,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:Sy(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Xo(a)),n(po({id:a,value:i})),n(z({legacy:Sy(a,i)}))},toggleExclude(i){n(fo({id:a,value:i})),n(z({legacy:Sy(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Xo(a)),n(fo({id:a,value:i})),n(z({legacy:Sy(a,i)}))},deselectAll(){n(Xo(a)),n(z({legacy:Jg({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 W$(e){return e.addReducers({staticFilterSet:yy}),!0}function Sy(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?Xg:Cc)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var K$=new Se({expression:Be,id:W,clearFiltersOnTabChange:new pe}),Y$=new Se({isActive:new pe});function qO(e,t){if(J$(t.options.id),!X$(e))throw K;let r=oe(e),{dispatch:n}=e;$e(e,K$,t.options,"buildTab");let o=lt(e,Y$,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n(Us({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(Ts({q:"",clearFilters:!0})),n(ht(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function X$(e){return e.addReducers({configuration:me,tabSet:bc}),!0}function J$(e){let t=Qs().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 MO(e,t){let{dispatch:r}=e,n=qO(e,t),o=()=>r(z({legacy:wo(),next:ss()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();function VO(e){let t=rh(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function jO(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function LO(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 UO(e,t){return e.queryModification={...t,queryToIgnore:""},e}function QO(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var BO=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var ca=ae(BO(),e=>e.addCase(z.pending,jO).addCase(z.fulfilled,(t,r)=>LO(t,r.payload.response.triggers)).addCase(Is,(t,r)=>UO(t,r.payload)).addCase(Oo,(t,r)=>QO(t,r.payload)));function GO(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=!Ri(this.state.executions,o,(f,m)=>f.functionName===m.functionName&&Ri(f.params,m.params));o=this.state.executions,p&&this.state.executions.length&&(a(),r(Kp()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function Z$(e){return e.addReducers({triggers:ca}),!0}d();c();l();u();d();c();l();u();function $O(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!eH(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=!Ri(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 eH(e){return e.addReducers({triggers:ca}),!0}function HO(e){return $O(e,{options:{logNotifyTriggerActionCreator:zp}})}d();c();l();u();function zO(e){if(!tH(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(Vt({q:a()})),r(z({legacy:Hp({undoneQuery:o()})}))}}}function tH(e){return e.addReducers({triggers:ca,query:Ft}),!0}d();c();l();u();function WO(e){if(!rH(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(Wp()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function rH(e){return e.addReducers({triggers:ca}),!0}d();c();l();u();d();c();l();u();var YO="..",qx="...",nH=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,oH={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},vy="&",nd="=";function od(){return{serialize:sH(cH),deserialize:mH}}function ad(e){return e in oH}function aH(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function iH(e){let r=e in{nf:!0,df:!0,mnf:!0};return ad(e)&&r}function XO(e){return aH(e)||ad(e)}var sH=e=>t=>Object.entries(t).map(e).filter(r=>r).join(vy);function cH(e){let[t,r]=e;return XO(t)?ad(t)&&!iH(t)?lH(r)?pH(t,r):"":t==="nf"||t==="df"?dH(r)?fH(t,r):"":uH(t,r):""}function uH(e,t){return`${e}${nd}${encodeURIComponent(t)}`}function lH(e){return Mx(e)?JO(e,r=>typeof r=="string"):!1}function dH(e){return Mx(e)?JO(e,r=>Mx(r)&&"start"in r&&"end"in r):!1}function Mx(e){return!!(e&&typeof e=="object")}function JO(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function pH(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${nd}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(vy)}function fH(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?qx:YO}${i}`).join(",");return`${e}-${r}${nd}${o}`}).join(vy)}function mH(e){return e.split(vy).map(n=>gH(n)).map(n=>hH(n)).filter(AH).map(n=>xH(n)).reduce((n,o)=>{let[a,i]=o;if(ad(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function gH(e){let[t,...r]=e.split(nd),n=r.join(nd);return[t,n]}function hH(e,t=nH){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=yH(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function yH(e,t){return e==="nf"||e==="mnf"?SH(t,"selected"):e==="df"?vH(t,"selected"):t}function SH(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=ZO(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(Oc({start:p,end:f,state:t,endInclusive:i}))}return r}function KO(e){try{return tR(e)?(_p(e,Rs),!0):sn(e)?(Po(e),!0):!1}catch{return!1}}function vH(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=ZO(n);!KO(a)||!KO(i)||r.push(Yo({start:a,end:i,state:t,endInclusive:o}))}return r}function AH(e){let t=XO(e[0]),r=e.length===2;return t&&r}function xH(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)]:ad(r)?[r,CH(n)]:[r,t?decodeURIComponent(n):n]}function CH(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[o,a]=n;r[o]=a.map(i=>_i(i)?decodeURIComponent(i):i)}),r}function ZO(e){let t=e.indexOf(qx)!==-1,[r,n]=e.split(t?qx:YO);return{isEndInclusive:t,startAsString:r,endAsString:n}}var bH=new Se({fragment:new U});function e_(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!RH(e))throw K;lt(e,bH,t.initialState,"buildUrlManager");let a=oe(e),i=t.initialState.fragment;n();let p=uy(e,{initialState:{parameters:Ay(i)}});return{...a,subscribe(f){let m=()=>{let g=this.state.fragment;!wH(i,g)&&o()&&(i=g,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:od().serialize(p.state.parameters)}},synchronize(f){i=f;let m=Ay(f);p.synchronize(m)}}}function wH(e,t){if(e===t)return!0;let r=Ay(e),n=Ay(t);return Xl(r,n)}function Ay(e){return od().deserialize(e)}function RH(e){return e.addReducers({configuration:me}),!0}d();c();l();u();d();c();l();u();var t_=xe("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 FH(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:t_}}d();c();l();u();d();c();l();u();d();c();l();u();var ua=()=>new U({required:!1,emptyAllowed:!0}),xy=P("advancedSearchQueries/update",e=>O(e,{aq:ua(),cq:ua(),lq:ua(),dq:ua()})),Cy=P("advancedSearchQueries/register",e=>O(e,{aq:ua(),cq:ua(),lq:ua(),dq:ua()}));var r_=ae(Qr(),e=>{e.addCase(xy,(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(Cy,(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 EH(e){return e.addReducers({advancedSearchQueries:r_}),{updateAdvancedSearchQueries:xy,registerAdvancedSearchQueries:Cy}}d();c();l();u();function IH(e){return e.addReducers({}),{logDocumentOpen:ey,logOpenSmartSnippetSource:Fx,logOpenSmartSnippetSuggestionSource:rd,logOpenSmartSnippetInlineLink:td,logOpenSmartSnippetSuggestionInlineLink:dy}}d();c();l();u();function TH(e){return e.addReducers({}),{logSearchEvent:Qw,logClickEvent:Bw,logCustomEvent:Gw}}d();c();l();u();function PH(e){return e.addReducers({}),{logClearBreadcrumbs:Og,logInterfaceLoad:Cp,logSearchFromLink:bp,logOmniboxFromLink:wp,logInterfaceChange:wo,logDidYouMeanClick:Mp,logCategoryFacetBreadcrumb:bg,logFacetBreadcrumb:vc,logFacetClearAll:bt,logFacetUnexclude:io,logFacetExclude:pr,logFacetDeselect:Wr,logFacetSelect:it,logFacetShowLess:Sc,logFacetShowMore:yc,logFacetUpdateSort:En,logDateFacetBreadcrumb:Gl,logNumericFacetBreadcrumb:$l,logNavigateBackward:Lh,logNavigateForward:jh,logPageNext:Wh,logPageNumber:$c,logPagePrevious:Kh,logPagerResize:Gc,logSearchboxSubmit:oa,logQuerySuggestionClick:ry,logResultsSort:eu,logDislikeSmartSnippet:Rx,logLikeSmartSnippet:wx,logOpenSmartSnippetFeedbackModal:Ex,logCloseSmartSnippetFeedbackModal:Ix,logSmartSnippetFeedback:Tx,logSmartSnippetDetailedFeedback:Px,logExpandSmartSnippet:Cx,logCollapseSmartSnippet:bx,logExpandSmartSnippetSuggestion:kx,logCollapseSmartSnippetSuggestion:Ox,logNoResultsBack:Uh,logStaticFilterSelect:Xg,logStaticFilterDeselect:Cc,logStaticFilterClearAll:Jg,logTriggerQuery:$p,logUndoTriggerQuery:Hp,logNotifyTrigger:zp,logTriggerRedirect:Wp,logTriggerExecute:Kp}}d();c();l();u();function kH(e){return e.addReducers({}),{deselectAllBreadcrumbs:ft,deselectAllNonBreadcrumbs:gs}}d();c();l();u();function OH(e){return e.addReducers({configuration:me}),{disableAnalytics:cs,enableAnalytics:us,setOriginLevel2:Rp,setOriginLevel3:Fp,updateAnalyticsConfiguration:Ro,updateBasicConfiguration:rn}}d();c();l();u();function _H(e){return e.addReducers({configuration:me,pipeline:ms,searchHub:_s}),{updateSearchConfiguration:vr}}d();c();l();u();function NH(e){return e.addReducers({context:eh}),{addContext:xi,removeContext:Ci,setContext:Ai}}d();c();l();u();function DH(e){return e.addReducers({debug:ps}),{disableDebug:ds,enableDebug:Fo}}d();c();l();u();function qH(e){return e.addReducers({dictionaryFieldContext:nh}),{addContext:Rc,removeContext:Fc,setContext:wc}}d();c();l();u();function MH(e){return e.addReducers({didYouMean:ah,query:Ft}),{applyDidYouMeanCorrection:Ar,disableDidYouMean:Dp,enableDidYouMean:Fs,enableAutomaticQueryCorrection:qp,disableAutomaticQueryCorrection:Es,setCorrectionMode:Fa}}d();c();l();u();d();c();l();u();d();c();l();u();var by=P("excerptLength/set",e=>O(e,new re({min:0,required:!0})));d();c();l();u();function n_(){return{length:void 0}}var o_=ae(n_(),e=>{e.addCase(by,(t,r)=>{t.length=r.payload})});function VH(e){return e.addReducers({excerptLength:o_}),{setExcerptLength:by}}d();c();l();u();function jH(e){return e.addReducers({facetOptions:wt}),{updateFacetOptions:Fe,enableFacet:Qt,disableFacet:tt}}d();c();l();u();function LH(e){return e.addReducers({automaticFacetSet:ih}),{setOptions:sc,deselectAllAutomaticFacetValues:cc,toggleSelectAutomaticFacetValue:hn}}d();c();l();u();function UH(e){return e.addReducers({categoryFacetSet:vn}),{deselectAllCategoryFacetValues:Sn,registerCategoryFacet:yn,toggleSelectCategoryFacetValue:Wo,updateCategoryFacetNumberOfValues:di,updateCategoryFacetSortCriterion:lc,updateFacetAutoSelection:nn,updateCategoryFacetBasePath:Cg}}d();c();l();u();function QH(e){return e.addReducers({facetSet:Tr}),{deselectAllFacetValues:rt,registerFacet:wn,toggleSelectFacetValue:Rn,toggleExcludeFacetValue:Fn,updateFacetIsFieldExpanded:fi,updateFacetNumberOfValues:pi,updateFacetSortCriterion:hc,updateFreezeCurrentValues:ao,updateFacetAutoSelection:nn}}d();c();l();u();function BH(e){return e.addReducers({dateFacetSet:On}),{deselectAllDateFacetValues:Dg,registerDateFacet:In,toggleSelectDateFacetValue:Tn,toggleExcludeDateFacetValue:Pn,updateDateFacetSortCriterion:Ng,updateDateFacetValues:uo}}d();c();l();u();function GH(e){return e.addReducers({numericFacetSet:Pr}),{deselectAllNumericFacetValues:Wg,registerNumericFacet:_n,toggleSelectNumericFacetValue:Nn,toggleExcludeNumericFacetValue:Dn,updateNumericFacetSortCriterion:zg,updateNumericFacetValues:lo}}d();c();l();u();function $H(e){return e.addReducers({fields:na}),{registerFieldsToInclude:ra,enableFetchAllFields:Nc,disableFetchAllFields:bi,fetchFieldsDescription:Dc}}d();c();l();u();function HH(e){return e.addReducers({folding:Dh}),{registerFolding:Jo,loadCollection:Zo}}d();c();l();u();function zH(e){return e.addReducers({generatedAnswer:Vc}),{generateAnswer:bf,resetAnswer:lr,setAnswerGenerationMode:df}}d();c();l();u();function WH(e){return e.addReducers({history:Gh,facetOrder:Lc}),{back:il,forward:Tp}}d();c();l();u();function KH(e){return e.addReducers({instantResults:Hh}),{registerInstantResults:hs,updateInstantResultsQuery:on,clearExpiredResults:ys}}d();c();l();u();function YH(e){return e.addReducers({pagination:_r}),{nextPage:xs,previousPage:Cs,registerNumberOfResults:Ss,registerPage:As,updateNumberOfResults:vs,updatePage:an}}d();c();l();u();function XH(e){return e.addReducers({pipeline:ms}),{setPipeline:fs}}d();c();l();u();function JH(e){return e.addReducers({query:Ft}),{updateQuery:Vt}}d();c();l();u();function ZH(e){return e.addReducers({querySet:aa}),{registerQuerySetQuery:Jc,updateQuerySetQuery:Ii}}d();c();l();u();function e3(e){return e.addReducers({querySuggest:Zc,querySet:aa}),{clearQuerySuggest:ea,fetchQuerySuggestions:ta,registerQuerySuggest:_c,selectQuerySuggestion:Vn}}d();c();l();u();function t3(e){return e.addReducers({questionAnswering:Ln}),{collapseSmartSnippet:au,expandSmartSnippet:ou,dislikeSmartSnippet:su,likeSmartSnippet:iu,openFeedbackModal:cu,closeFeedbackModal:ia,expandSmartSnippetRelatedQuestion:uu,collapseSmartSnippetRelatedQuestion:lu}}d();c();l();u();function r3(e){return e.addReducers({recentQueries:Jh}),{registerRecentQueries:Ei,clearRecentQueries:Xc}}d();c();l();u();function n3(e){return e.addReducers({recentResults:Zh}),{registerRecentResults:Uc,clearRecentResults:Qc,pushRecentResult:Or}}d();c();l();u();function o3(e){return e.addReducers({resultPreview:Xh}),{fetchResultContent:Fi,updateContentURL:Yc,nextPreview:zc,previousPreview:Wc,preparePreviewPagination:Kc}}d();c();l();u();d();c();l();u();var a3=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 a_(){let e=[],t=r=>{let n=a3.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new wu("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 i_(e){if(!i3(e))throw K;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=a_();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 i3(e){return e.addReducers({fields:na}),!0}d();c();l();u();function s3(e){return e.addReducers({search:he}),{executeSearch:yR,fetchMoreResults:vR,fetchFacetValues:AR,fetchPage:SR,fetchInstantResults:xR}}d();c();l();u();function c3(e){return e.addReducers({searchHub:_s}),{setSearchHub:Os}}d();c();l();u();function u3(e){return e.addReducers({facetOrder:Lc,facetSet:Tr,pagination:_r,query:Ft,querySet:aa}),{restoreSearchParameters:Me,restoreTab:ls}}d();c();l();u();function l3(e){let{by:t,order:r}=e;switch(t){case"relevancy":return os();case"qre":return yp();case"nosort":return Sp();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 gp(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 hp(t,r)}}function d3(e){return e===void 0||e==="ascending"||e==="descending"}function s_(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(!d3(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return l3({by:a,order:i})})}d();c();l();u();function p3(e){return e.addReducers({sortCriteria:my}),{registerSortCriterion:du,updateSortCriterion:pu}}d();c();l();u();function f3(e){return e.addReducers({standaloneSearchBoxSet:hy}),{registerStandaloneSearchBox:fu,fetchRedirectUrl:sa,updateStandaloneSearchBoxRedirectionUrl:mu,updateAnalyticsToSearchFromLink:hu,updateAnalyticsToOmniboxFromLink:yu,resetStandaloneSearchBox:gu}}d();c();l();u();function m3(e){return e.addReducers({staticFilterSet:yy}),{registerStaticFilter:xc,toggleSelectStaticFilterValue:po,toggleExcludeStaticFilterValue:fo,deselectAllStaticFilterValues:Xo}}d();c();l();u();function g3(e){return e.addReducers({tabSet:bc}),{registerTab:Us,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 c_(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Dr(e.operator);return`${Et(e)}@${t}${n}${r}`}}}d();c();l();u();function u_(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 l_(e){return{toQuerySyntax(){let t=Et(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function d_(e){return{toQuerySyntax(){let t=Et(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function p_(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function f_(e){return{toQuerySyntax(){let t=Et(e),{startTerm:r,otherTerms:n}=e,o=h3(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function h3(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function m_(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 g_(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 h_(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=y3(r);return`$${t}(${n})`}}}function y3(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 y_(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 S_(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(p_(r)),this},addNear(r){return e.push(f_(r)),this},addExactMatch(r){return e.push(l_(r)),this},addFieldExists(r){return e.push(d_(r)),this},addStringField(r){return e.push(S_(r)),this},addStringFacetField(r){return e.push(y_(r)),this},addNumericField(r){return e.push(m_(r)),this},addNumericRangeField(r){return e.push(g_(r)),this},addDateField(r){return e.push(c_(r)),this},addDateRangeField(r){return e.push(u_(r)),this},addQueryExtension(r){return e.push(h_(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=v3(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function v3(e){return e==="and"?"AND":"OR"}/**
49
+ https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function A$(e){return e.addReducers({debug:ps,search:he,configuration:me,fields:na}),!0}d();c();l();u();d();c();l();u();var cy=e=>J({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Zt(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 aO(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(cy(t.options.result)))};return Ht(e,t,()=>{n(),e.dispatch(Or(t.options.result))})}d();c();l();u();function iO(e,t){return $h(e,{...t,fetchMoreResultsActionCreator:wr})}d();c();l();u();d();c();l();u();var C$=new Se({numberOfResults:new re({min:0})});function sO(e,t={}){if(!x$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,i=lt(e,C$,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(Ss(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(vs(p))},isSetTo(p){return p===this.state.numberOfResults}}}function x$(e){return e.addReducers({pagination:_r,configuration:me}),!0}function cO(e,t={}){if(!b$(e))throw K;let r=sO(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(jt({legacy:zc(),next:Kc()}))}}}function b$(e){return e.addReducers({pagination:_r,configuration:me}),!0}d();c();l();u();d();c();l();u();var oa=()=>J("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),uy=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var uO={id:z,query:Ge},tu=P("querySet/register",e=>O(e,uO)),Ei=P("querySet/update",e=>O(e,uO));d();c();l();u();var aa=ae(Gp(),e=>{e.addCase(tu,(t,r)=>R$(t,r.payload)).addCase(Ei,(t,r)=>{let{id:n,query:o}=r.payload;RC(t,n,o)}).addCase(jn,(t,r)=>{let{id:n,expression:o}=r.payload;RC(t,n,o)}).addCase(W.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;lO(t,n)}).addCase(Me,w$).addCase(qe.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))RC(t,n,o)})});function w$(e,t){de(t.payload.q)||lO(e,t.payload.q)}function lO(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var RC=(e,t,r)=>{t in e&&(e[t]=r)},R$=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var ly=e=>J("analytics/querySuggest",(t,r)=>{let n=FC(r,e);return t.makeOmniboxAnalytics(n)}),dO=()=>({actionCause:"omniboxAnalytics"});function FC(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 pO(e,t){let r=t.id;r in e||(e[r]=F$(t))}function fO(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function mO(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function gO(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function F$(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var hO=()=>({});var ru=ae(hO(),e=>e.addCase(qc,(t,r)=>{pO(t,r.payload)}).addCase(HP,(t,r)=>{delete t[r.payload.id]}).addCase(ta.pending,fO).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,mO).addCase(ea,(t,r)=>{gO(t,r.payload)}).addCase(ks,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var dy={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},EC={open:new L,close:new L},IC={id:z,numberOfSuggestions:new re({min:0}),enableQuerySyntax:new fe,highlightOptions:new X({values:{notMatchDelimiters:new X({values:EC}),exactMatchDelimiters:new X({values:EC}),correctionDelimiters:new X({values:EC})}}),clearFilters:new fe},yO=new Se(IC);function SO(e,t){if(!I$(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},...dy,...t.options};He(e,yO,i,"buildSearchBox"),n(tu({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(qc({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(Vt({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(Ts({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(jn({id:a,expression:m})),f({legacy:ly({id:a,suggestion:m}),next:dO()}).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=E$(g,i.highlightOptions),x=g?g.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:v,isLoading:m.search.isLoading,isLoadingSuggestions:x}}}}function E$(e,t){return e?e.completions.map(r=>({highlightedValue:Gy(r.highlighted,t),rawValue:r.expression})):[]}function I$(e){return e.addReducers({query:Ft,querySuggest:ru,configuration:me,querySet:aa,search:he}),!0}function py(e,t={}){let r=SO(e,{...t,executeSearchActionCreator:W,fetchQuerySuggestionsActionCreator:ta,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(oa(),uy())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var nu=()=>J("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||vr()})),fy=()=>({actionCause:"resultsSort"});function AO(e,t){return e.q!==t.q?oa():e.sortCriteria!==t.sortCriteria?nu():e.firstResult!==t.firstResult?Wc():e.numberOfResults!==t.numberOfResults?zc():Nr(e.f,t.f)?rd(e.f,t.f):Nr(e.fExcluded,t.fExcluded)?rd(e.fExcluded,t.fExcluded,!0):Nr(e.cf,t.cf)?rd(e.cf,t.cf):Nr(e.af,t.af)?rd(e.af,t.af):Nr(e.nf,t.nf)?vO(e.nf,t.nf):Nr(e.df,t.df)?vO(e.df,t.df):Ro()}function rd(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(x=>!o.includes(x));if(a.length){let x=a[0];switch(!0){case e[x].length>1:return bt(x);case r:return io({facetId:x,facetValue:e[x][0]});default:return Wr({facetId:x,facetValue:e[x][0]})}}let i=o.filter(x=>!n.includes(x));if(i.length){let x=i[0];return r?fr({facetId:x,facetValue:t[x][0]}):it({facetId:x,facetValue:t[x][0]})}let p=o.find(x=>t[x].filter(h=>e[x].includes(h)));if(!p)return Ro();let f=e[p],m=t[p],g=m.filter(x=>!f.includes(x));if(g.length)return r?fr({facetId:p,facetValue:g[0]}):it({facetId:p,facetValue:g[0]});let v=f.filter(x=>!m.includes(x));return v.length?r?io({facetId:p,facetValue:v[0]}):Wr({facetId:p,facetValue:v[0]}):Ro()}function vO(e={},t={}){return rd(au(e),au(t))}function CO(e,t){return e.q!==t.q?uy():e.sortCriteria!==t.sortCriteria?fy():Nr(e.f,t.f)?ou(e.f,t.f):Nr(e.fExcluded,t.fExcluded)?ou(e.fExcluded,t.fExcluded,!0):Nr(e.cf,t.cf)?ou(e.cf,t.cf):Nr(e.af,t.af)?ou(e.af,t.af):Nr(e.nf,t.nf)?ou(au(e.nf),au(t.nf)):Nr(e.df,t.df)?ou(au(e.df),au(t.df)):ss()}function Nr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function ou(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(x=>!o.includes(x));if(a.length){let x=a[0];return e[x].length>1?Bt():co()}if(o.filter(x=>!n.includes(x)).length)return r?so():gt();let p=o.find(x=>t[x].filter(h=>e[x].includes(h)));if(!p)return ss();let f=e[p],m=t[p];return m.filter(x=>!f.includes(x)).length?r?so():gt():f.filter(x=>!m.includes(x)).length?co():ss()}function au(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 xO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function bO(e,t,r){if(e===void 0)return{};let n=t(e);return!hC(n,r)?{sortCriteria:n}:{}}function my(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 wO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function RO(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:xr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??xr().defaultNumberOfResults,sortCriteria:vr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:Io(),sf:{},tab:"",af:{},mnf:{}}}var T$=new Se({parameters:new X({options:{required:!0},values:Pp})});function IO(e,t){let{dispatch:r}=e,n=oe(e);lt(e,T$,t.initialState,"buildSearchParameterManager");let o=FO(e.state.tabSet,t.initialState.parameters);return r(Me(o)),{...n,synchronize(a){let i=FO(e.state.tabSet,gy(e,a));r(Me(i))},get state(){return{parameters:TC(e)}}}}function gy(e,t){let n={...RO(e.state),...t},o={};if(e.state.dateFacetSet)for(let i of Object.keys(e.state.dateFacetSet))o[i]=[];let a={};if(e.state.numericFacetSet)for(let i of Object.keys(e.state.numericFacetSet))a[i]=[];return{...n,df:{...o,...n.df},nf:{...a,...n.nf}}}function FO(e,t){if(de(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:EO(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??EO(e)}}return t}function EO(e){return Object.keys(e)[0]??""}function TC(e){let t=e.state;return{...xO(t.query,r=>r.q,dt().q),...wO(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]:""),...bO(t.sortCriteria,r=>r,vr()),...k$(t),...O$(t),..._$(t),...N$(t),...D$(t)}}function P$(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function hy(e){let t=P$(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=or(n?.tabs,t);return o&&a}}function TO(e){return e.currentValues.filter(t=>t.state==="selected")}function k$(e){let t=e.facetSet;if(t===void 0)return{};let r=hy(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 O$(e){return my(e.categoryFacetSet,hy(e),t=>cr(t.currentValues).map(r=>r.value),"cf")}function _$(e){return my(e.numericFacetSet,hy(e),TO,"nf")}function N$(e){return my(e.dateFacetSet,hy(e),TO,"df")}function D$(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=q$(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function q$(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function yy(e,t){let{dispatch:r}=e,n=IO(e,t);return{...n,synchronize(o){let a=PO(e),i=gy(e,a),p=gy(e,o);Zl(i,p)||(n.synchronize(o),r(W({legacy:AO(i,p),next:CO(i,p)})))},get state(){return{parameters:PO(e)}}}}function PO(e){let t=e.state;return{...TC(e),...M$(t),...V$(t),...j$(t),...L$(t),...U$(t),...G$(t),...Q$(t)}}function M$(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==dt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function V$(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function j$(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function L$(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==xr().firstResult?{firstResult:t}:{}}function U$(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function Q$(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=B$(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function B$(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function G$(e){if(e.debug===void 0)return{};let t=e.debug;return t!==Io()?{debug:t}:{}}d();c();l();u();function kO(e){return jc(e)}d();c();l();u();d();c();l();u();d();c();l();u();var Sy=()=>new X({values:{questionAnswerId:z},options:{required:!0}}),PC=()=>new X({values:{linkText:Ge,linkURL:Ge},options:{required:!0}});function iu(e){return O(e,Sy())}d();c();l();u();function ct(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&UR(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 kC=()=>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}}}}),OC=()=>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}}}}),_C=()=>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}}}}),NC=()=>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}}}}),DC=()=>J({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}}}}),nd=e=>J({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,PC());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}}}}),qC=()=>J("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),MC=()=>J("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),$$={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},VC=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:$$[e]}}}),jC=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}}}),LC=e=>J({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{iu(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}}}}}),UC=e=>J({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{iu(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}}}}}),od=e=>J({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,Sy());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}}}}}),vy=(e,t)=>J({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,Sy()),O(t,PC());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}}}}}),Ay={logExpandSmartSnippet:kC,logCollapseSmartSnippet:OC,logLikeSmartSnippet:_C,logDislikeSmartSnippet:NC,logOpenSmartSnippetSource:DC,logOpenSmartSnippetInlineLink:nd,logOpenSmartSnippetFeedbackModal:qC,logCloseSmartSnippetFeedbackModal:MC,logSmartSnippetFeedback:VC,logSmartSnippetDetailedFeedback:jC,logExpandSmartSnippetSuggestion:LC,logCollapseSmartSnippetSuggestion:UC,logOpenSmartSnippetSuggestionSource:od};d();c();l();u();d();c();l();u();var su=P("smartSnippet/expand"),cu=P("smartSnippet/collapse"),uu=P("smartSnippet/like"),lu=P("smartSnippet/dislike"),du=P("smartSnippet/feedbackModal/open"),ia=P("smartSnippet/feedbackModal/close"),pu=P("smartSnippet/related/expand",e=>iu(e)),fu=P("smartSnippet/related/collapse",e=>iu(e));d();c();l();u();d();c();l();u();var QC=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var OO=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function _O({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return Ni({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function H$(e,t){let r=_O(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var Un=ae(QC(),e=>e.addCase(su,t=>{t.expanded=!0}).addCase(cu,t=>{t.expanded=!1}).addCase(uu,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(lu,t=>{t.liked=!1,t.disliked=!0}).addCase(du,t=>{t.feedbackModalOpen=!0}).addCase(ia,t=>{t.feedbackModalOpen=!1}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((a,i)=>H$(a,t.relatedQuestions[i])),o=_O(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...QC(),relatedQuestions:n,questionAnswerId:o}}).addCase(pu,(t,r)=>{let n=OO(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(fu,(t,r)=>{let n=OO(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function NO(e,t,r){if(!z$(e))throw K;let n=oe(e),o=()=>e.state,a=()=>ct(o()),i=null,p=Ht(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(su())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(cu())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(uu())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(lu())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(du())},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 z$(e){return e.addReducers({search:he,questionAnswering:Un}),!0}d();c();l();u();function Cy(e,t){if(!W$(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,x)=>Ht(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(v)||e.dispatch(x?vy({questionAnswerId:x},g):nd(g))}),f={},m=(g,v)=>{let{searchResponseId:x}=r().search;i(x);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 W$(e){return e.addReducers({search:he,questionAnswering:Un}),!0}function DO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=NO(e,Ay,t),n=Cy(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 qO(e,t){if(!K$(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=>Vo(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(pu(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(fu(i))}}}function K$(e){return e.addReducers({search:he,questionAnswering:Un}),!0}d();c();l();u();function MO(e,t){if(!Y$(e))throw K;let r=()=>e.state,n=v=>{let x=r(),h=Kr(x,v);return h?ct(x,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,x)=>Ht(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(x)||(e.dispatch(od({questionAnswerId:x})),e.dispatch(Or(v)))}),m={},g=v=>{let{searchResponseId:x}=r().search;p(x);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 Y$(e){return e.addReducers({search:he,questionAnswering:Un}),!0}function VO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=qO(e,Ay),n=Cy(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=MO(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 jO={by:new Iu({enum:xa,required:!0})},mu=P("sortCriteria/register",e=>LO(e)),gu=P("sortCriteria/update",e=>LO(e)),LO=e=>_i(e)?(e.forEach(t=>O(t,jO)),{payload:e}):O(e,jO);d();c();l();u();var xy=ae(vr(),e=>{e.addCase(mu,(t,r)=>tn(r.payload)).addCase(gu,(t,r)=>tn(r.payload)).addCase(qe.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(Me,(t,r)=>r.payload.sortCriteria??t)});function J$(e,t){if(!t)return;let r=new Se({criterion:new ie({each:qw})}),n=X$(t),o={...t,criterion:n};lt(e,r,o,"buildSort")}function X$(e){return e.criterion?_i(e.criterion)?e.criterion:[e.criterion]:[]}function UO(e,t){if(!Z$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;J$(e,t.initialState);let a=t.initialState?.criterion;return a&&n(mu(a)),{...r,sortBy(i){n(gu(i)),n(sn(1))},isSortedBy(i){return this.state.sortCriteria===tn(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function Z$(e){return e.addReducers({configuration:me,sortCriteria:xy}),!0}function QO(e,t={}){let{dispatch:r}=e,n=UO(e,t),o=()=>r(W({legacy:nu(),next:fy()}));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 BO(e){return e.type==="redirect"}var by=class{constructor(t){pe(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(BO);return t.length?t[0].content:null}};var hu=P("standaloneSearchBox/register",e=>O(e,{id:z,redirectionUrl:z,overwrite:new fe({required:!1})})),yu=P("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:z,redirectionUrl:z})),Su=P("standaloneSearchBox/reset",e=>O(e,{id:z})),vu=P("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:z})),Au=P("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),sa=Ce("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 L({emptyAllowed:!1})});let p=yield tH(r(),i),f=yield o.plan(p);if(vt(f))return n(f.error);let{redirectionUrl:m}=new by(f.success);return m&&t(eH(m)),m||""});return function(_x183,_x184){return _ref82.apply(this,arguments)}}()),eH=e=>J("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),tH=/*#__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!==void 0&&{enableQuerySyntax:e.query.enableQuerySyntax}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield ws(e.configuration.analytics):Ur(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function tH(_x185,_x186){return _ref83.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function GO(){return{}}var wy=ae(GO(),e=>e.addCase(hu,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=BC(o))}).addCase(Su,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=BC(o.defaultRedirectionUrl);return}}).addCase(yu,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=BC(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(vu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(Au,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function BC(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var $O=new Se({...IC,redirectionUrl:new L({required:!0,emptyAllowed:!1}),overwrite:new fe({required:!1})});function HO(e,t){if(!rH(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},...dy,overwrite:!1,...t.options};He(e,$O,a,"buildStandaloneSearchBox");let i=py(e,{options:a});return r(hu({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(vu({id:o}))},selectSuggestion(p){let f=FC(n(),{id:o,suggestion:p});r(jn({id:o,expression:p})),r(Au({id:o,metadata:f})),this.submit()},afterRedirection(){r(Su({id:o}))},updateRedirectUrl(p){r(yu({id:o,redirectionUrl:p}))},submit(){r(Vt({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 rH(e){return e.addReducers({standaloneSearchBoxSet:wy,configuration:me,query:Ft,querySuggest:ru}),!0}d();c();l();u();d();c();l();u();var Ry=ae($p(),e=>e.addCase(wc,(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(Jo,(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 GC(e){return{state:"idle",...e}}var nH=new Se({id:Si,values:oh});function zO(e,t){if(!oH(e))throw K;He(e,nH,t.options,"buildStaticFilter");let r=oe(e),{dispatch:n}=e,o=()=>e.state,{id:a}=t.options;return n(wc(t.options)),{...r,toggleSelect(i){n(po({id:a,value:i})),n(W({legacy:Fy(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Jo(a)),n(po({id:a,value:i})),n(W({legacy:Fy(a,i)}))},toggleExclude(i){n(fo({id:a,value:i})),n(W({legacy:Fy(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Jo(a)),n(fo({id:a,value:i})),n(W({legacy:Fy(a,i)}))},deselectAll(){n(Jo(a)),n(W({legacy:ih({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 oH(e){return e.addReducers({staticFilterSet:Ry}),!0}function Fy(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?ah:Rc)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var aH=new Se({expression:Ge,id:z,clearFiltersOnTabChange:new fe}),iH=new Se({isActive:new fe});function WO(e,t){if(cH(t.options.id),!sH(e))throw K;let r=oe(e),{dispatch:n}=e;He(e,aH,t.options,"buildTab");let o=lt(e,iH,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n(Bs({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(Ts({q:"",clearFilters:!0})),n(ht(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function sH(e){return e.addReducers({configuration:me,tabSet:Fc}),!0}function cH(e){let t=Gs().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 KO(e,t){let{dispatch:r}=e,n=WO(e,t),o=()=>r(W({legacy:Ro(),next:ss()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();function YO(e){let t=lh(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function JO(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function XO(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 ZO(e,t){return e.queryModification={...t,queryToIgnore:""},e}function e_(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var t_=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var ca=ae(t_(),e=>e.addCase(W.pending,JO).addCase(W.fulfilled,(t,r)=>XO(t,r.payload.response.triggers)).addCase(Is,(t,r)=>ZO(t,r.payload)).addCase(_o,(t,r)=>e_(t,r.payload)));function r_(e){if(!uH(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(Jp()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function uH(e){return e.addReducers({triggers:ca}),!0}d();c();l();u();d();c();l();u();function n_(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!lH(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 lH(e){return e.addReducers({triggers:ca}),!0}function o_(e){return n_(e,{options:{logNotifyTriggerActionCreator:Kp}})}d();c();l();u();function a_(e){if(!dH(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(_o(o())),r(Vt({q:a()})),r(W({legacy:Wp({undoneQuery:o()})}))}}}function dH(e){return e.addReducers({triggers:ca,query:Ft}),!0}d();c();l();u();function i_(e){if(!pH(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(Yp()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function pH(e){return e.addReducers({triggers:ca}),!0}d();c();l();u();d();c();l();u();var c_="..",$C="...",fH=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,mH={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},Ey="&",ad="=";function id(){return{serialize:yH(SH),deserialize:wH}}function sd(e){return e in mH}function gH(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function hH(e){let r=e in{nf:!0,df:!0,mnf:!0};return sd(e)&&r}function u_(e){return gH(e)||sd(e)}var yH=e=>t=>Object.entries(t).map(e).filter(r=>r).join(Ey);function SH(e){let[t,r]=e;return u_(t)?sd(t)&&!hH(t)?AH(r)?xH(t,r):"":t==="nf"||t==="df"?CH(r)?bH(t,r):"":vH(t,r):""}function vH(e,t){return`${e}${ad}${encodeURIComponent(t)}`}function AH(e){return HC(e)?l_(e,r=>typeof r=="string"):!1}function CH(e){return HC(e)?l_(e,r=>HC(r)&&"start"in r&&"end"in r):!1}function HC(e){return!!(e&&typeof e=="object")}function l_(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function xH(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${ad}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(Ey)}function bH(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?$C:c_}${i}`).join(",");return`${e}-${r}${ad}${o}`}).join(Ey)}function wH(e){return e.split(Ey).map(n=>RH(n)).map(n=>FH(n)).filter(PH).map(n=>kH(n)).reduce((n,o)=>{let[a,i]=o;if(sd(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function RH(e){let[t,...r]=e.split(ad),n=r.join(ad);return[t,n]}function FH(e,t=fH){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=EH(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function EH(e,t){return e==="nf"||e==="mnf"?IH(t,"selected"):e==="df"?TH(t,"selected"):t}function IH(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=d_(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(Dc({start:p,end:f,state:t,endInclusive:i}))}return r}function s_(e){try{return pR(e)?(Dp(e,Rs),!0):cn(e)?(ko(e),!0):!1}catch{return!1}}function TH(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=d_(n);!s_(a)||!s_(i)||r.push(Yo({start:a,end:i,state:t,endInclusive:o}))}return r}function PH(e){let t=u_(e[0]),r=e.length===2;return t&&r}function kH(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)]:sd(r)?[r,OH(n)]:[r,t?decodeURIComponent(n):n]}function OH(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 d_(e){let t=e.indexOf($C)!==-1,[r,n]=e.split(t?$C:c_);return{isEndInclusive:t,startAsString:r,endAsString:n}}var _H=new Se({fragment:new L});function p_(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!DH(e))throw K;lt(e,_H,t.initialState,"buildUrlManager");let a=oe(e),i=t.initialState.fragment;n();let p=yy(e,{initialState:{parameters:Iy(i)}});return{...a,subscribe(f){let m=()=>{let g=this.state.fragment;!NH(i,g)&&o()&&(i=g,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:id().serialize(p.state.parameters)}},synchronize(f){i=f;let m=Iy(f);p.synchronize(m)}}}function NH(e,t){if(e===t)return!0;let r=Iy(e),n=Iy(t);return Zl(r,n)}function Iy(e){return id().deserialize(e)}function DH(e){return e.addReducers({configuration:me}),!0}d();c();l();u();d();c();l();u();var f_=Ce("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 qH(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:f_}}d();c();l();u();d();c();l();u();d();c();l();u();var ua=()=>new L({required:!1,emptyAllowed:!0}),Ty=P("advancedSearchQueries/update",e=>O(e,{aq:ua(),cq:ua(),lq:ua(),dq:ua()})),Py=P("advancedSearchQueries/register",e=>O(e,{aq:ua(),cq:ua(),lq:ua(),dq:ua()}));var m_=ae(Qr(),e=>{e.addCase(Ty,(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(Py,(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 MH(e){return e.addReducers({advancedSearchQueries:m_}),{updateAdvancedSearchQueries:Ty,registerAdvancedSearchQueries:Py}}d();c();l();u();function VH(e){return e.addReducers({}),{logDocumentOpen:cy,logOpenSmartSnippetSource:DC,logOpenSmartSnippetSuggestionSource:od,logOpenSmartSnippetInlineLink:nd,logOpenSmartSnippetSuggestionInlineLink:vy}}d();c();l();u();function jH(e){return e.addReducers({}),{logSearchEvent:Zw,logClickEvent:eR,logCustomEvent:tR}}d();c();l();u();function LH(e){return e.addReducers({}),{logClearBreadcrumbs:Lg,logInterfaceLoad:wp,logSearchFromLink:Rp,logOmniboxFromLink:Fp,logInterfaceChange:Ro,logDidYouMeanClick:jp,logCategoryFacetBreadcrumb:kg,logFacetBreadcrumb:xc,logFacetClearAll:bt,logFacetUnexclude:io,logFacetExclude:fr,logFacetDeselect:Wr,logFacetSelect:it,logFacetShowLess:Cc,logFacetShowMore:Ac,logFacetUpdateSort:In,logDateFacetBreadcrumb:Hl,logNumericFacetBreadcrumb:zl,logNavigateBackward:Wh,logNavigateForward:zh,logPageNext:ry,logPageNumber:Wc,logPagePrevious:ny,logPagerResize:zc,logSearchboxSubmit:oa,logQuerySuggestionClick:ly,logResultsSort:nu,logDislikeSmartSnippet:NC,logLikeSmartSnippet:_C,logOpenSmartSnippetFeedbackModal:qC,logCloseSmartSnippetFeedbackModal:MC,logSmartSnippetFeedback:VC,logSmartSnippetDetailedFeedback:jC,logExpandSmartSnippet:kC,logCollapseSmartSnippet:OC,logExpandSmartSnippetSuggestion:LC,logCollapseSmartSnippetSuggestion:UC,logNoResultsBack:Kh,logStaticFilterSelect:ah,logStaticFilterDeselect:Rc,logStaticFilterClearAll:ih,logTriggerQuery:zp,logUndoTriggerQuery:Wp,logNotifyTrigger:Kp,logTriggerRedirect:Yp,logTriggerExecute:Jp}}d();c();l();u();function UH(e){return e.addReducers({}),{deselectAllBreadcrumbs:ft,deselectAllNonBreadcrumbs:gs}}d();c();l();u();function QH(e){return e.addReducers({configuration:me}),{disableAnalytics:cs,enableAnalytics:us,setOriginLevel2:Ep,setOriginLevel3:Ip,updateAnalyticsConfiguration:Fo,updateBasicConfiguration:nn}}d();c();l();u();function BH(e){return e.addReducers({configuration:me,pipeline:ms,searchHub:_s}),{updateSearchConfiguration:Ar}}d();c();l();u();function GH(e){return e.addReducers({context:ch}),{addContext:Ai,removeContext:Ci,setContext:vi}}d();c();l();u();function $H(e){return e.addReducers({debug:ps}),{disableDebug:ds,enableDebug:Eo}}d();c();l();u();function HH(e){return e.addReducers({dictionaryFieldContext:dh}),{addContext:Ic,removeContext:Tc,setContext:Ec}}d();c();l();u();function zH(e){return e.addReducers({didYouMean:fh,query:Ft}),{applyDidYouMeanCorrection:Cr,disableDidYouMean:Mp,enableDidYouMean:Fs,enableAutomaticQueryCorrection:Vp,disableAutomaticQueryCorrection:Es,setCorrectionMode:Ra}}d();c();l();u();d();c();l();u();d();c();l();u();var ky=P("excerptLength/set",e=>O(e,new re({min:0,required:!0})));d();c();l();u();function g_(){return{length:void 0}}var h_=ae(g_(),e=>{e.addCase(ky,(t,r)=>{t.length=r.payload})});function WH(e){return e.addReducers({excerptLength:h_}),{setExcerptLength:ky}}d();c();l();u();function KH(e){return e.addReducers({facetOptions:wt}),{updateFacetOptions:Fe,enableFacet:Qt,disableFacet:tt}}d();c();l();u();function YH(e){return e.addReducers({automaticFacetSet:mh}),{setOptions:lc,deselectAllAutomaticFacetValues:dc,toggleSelectAutomaticFacetValue:yn}}d();c();l();u();function JH(e){return e.addReducers({categoryFacetSet:An}),{deselectAllCategoryFacetValues:vn,registerCategoryFacet:Sn,toggleSelectCategoryFacetValue:Wo,updateCategoryFacetNumberOfValues:li,updateCategoryFacetSortCriterion:fc,updateFacetAutoSelection:on,updateCategoryFacetBasePath:Pg}}d();c();l();u();function XH(e){return e.addReducers({facetSet:Pr}),{deselectAllFacetValues:rt,registerFacet:Rn,toggleSelectFacetValue:Fn,toggleExcludeFacetValue:En,updateFacetIsFieldExpanded:pi,updateFacetNumberOfValues:di,updateFacetSortCriterion:vc,updateFreezeCurrentValues:ao,updateFacetAutoSelection:on}}d();c();l();u();function ZH(e){return e.addReducers({dateFacetSet:_n}),{deselectAllDateFacetValues:Bg,registerDateFacet:Tn,toggleSelectDateFacetValue:Pn,toggleExcludeDateFacetValue:kn,updateDateFacetSortCriterion:Qg,updateDateFacetValues:uo}}d();c();l();u();function e3(e){return e.addReducers({numericFacetSet:kr}),{deselectAllNumericFacetValues:rh,registerNumericFacet:Nn,toggleSelectNumericFacetValue:Dn,toggleExcludeNumericFacetValue:qn,updateNumericFacetSortCriterion:th,updateNumericFacetValues:lo}}d();c();l();u();function t3(e){return e.addReducers({fields:na}),{registerFieldsToInclude:ra,enableFetchAllFields:Mc,disableFetchAllFields:xi,fetchFieldsDescription:Vc}}d();c();l();u();function r3(e){return e.addReducers({folding:Bh}),{registerFolding:Xo,loadCollection:Zo}}d();c();l();u();function n3(e){return e.addReducers({generatedAnswer:Uc}),{generateAnswer:Tf,resetAnswer:dr,setAnswerGenerationMode:gf}}d();c();l();u();function o3(e){return e.addReducers({history:Xh,facetOrder:Bc}),{back:cl,forward:kp}}d();c();l();u();function a3(e){return e.addReducers({instantResults:ey}),{registerInstantResults:hs,updateInstantResultsQuery:an,clearExpiredResults:ys}}d();c();l();u();function i3(e){return e.addReducers({pagination:_r}),{nextPage:Cs,previousPage:xs,registerNumberOfResults:Ss,registerPage:As,updateNumberOfResults:vs,updatePage:sn}}d();c();l();u();function s3(e){return e.addReducers({pipeline:ms}),{setPipeline:fs}}d();c();l();u();function c3(e){return e.addReducers({query:Ft}),{updateQuery:Vt}}d();c();l();u();function u3(e){return e.addReducers({querySet:aa}),{registerQuerySetQuery:tu,updateQuerySetQuery:Ei}}d();c();l();u();function l3(e){return e.addReducers({querySuggest:ru,querySet:aa}),{clearQuerySuggest:ea,fetchQuerySuggestions:ta,registerQuerySuggest:qc,selectQuerySuggestion:jn}}d();c();l();u();function d3(e){return e.addReducers({questionAnswering:Un}),{collapseSmartSnippet:cu,expandSmartSnippet:su,dislikeSmartSnippet:lu,likeSmartSnippet:uu,openFeedbackModal:du,closeFeedbackModal:ia,expandSmartSnippetRelatedQuestion:pu,collapseSmartSnippetRelatedQuestion:fu}}d();c();l();u();function p3(e){return e.addReducers({recentQueries:iy}),{registerRecentQueries:Fi,clearRecentQueries:eu}}d();c();l();u();function f3(e){return e.addReducers({recentResults:sy}),{registerRecentResults:Gc,clearRecentResults:$c,pushRecentResult:Or}}d();c();l();u();function m3(e){return e.addReducers({resultPreview:ay}),{fetchResultContent:Ri,updateContentURL:Zc,nextPreview:Yc,previousPreview:Jc,preparePreviewPagination:Xc}}d();c();l();u();d();c();l();u();var g3=new Se({content:new Be({required:!0}),conditions:new Be({required:!0}),priority:new re({required:!1,default:0,min:0}),fields:new ie({required:!1,each:z})});function y_(){let e=[],t=r=>{let n=g3.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new Eu("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 S_(e){if(!h3(e))throw K;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=y_();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 h3(e){return e.addReducers({fields:na}),!0}d();c();l();u();function y3(e){return e.addReducers({search:he}),{executeSearch:IR,fetchMoreResults:PR,fetchFacetValues:kR,fetchPage:TR,fetchInstantResults:OR}}d();c();l();u();function S3(e){return e.addReducers({searchHub:_s}),{setSearchHub:Os}}d();c();l();u();function v3(e){return e.addReducers({facetOrder:Bc,facetSet:Pr,pagination:_r,query:Ft,querySet:aa}),{restoreSearchParameters:Me,restoreTab:ls}}d();c();l();u();function A3(e){let{by:t,order:r}=e;switch(t){case"relevancy":return os();case"qre":return vp();case"nosort":return Ap();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 yp(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 Sp(t,r)}}function C3(e){return e===void 0||e==="ascending"||e==="descending"}function v_(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(!C3(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return A3({by:a,order:i})})}d();c();l();u();function x3(e){return e.addReducers({sortCriteria:xy}),{registerSortCriterion:mu,updateSortCriterion:gu}}d();c();l();u();function b3(e){return e.addReducers({standaloneSearchBoxSet:wy}),{registerStandaloneSearchBox:hu,fetchRedirectUrl:sa,updateStandaloneSearchBoxRedirectionUrl:yu,updateAnalyticsToSearchFromLink:vu,updateAnalyticsToOmniboxFromLink:Au,resetStandaloneSearchBox:Su}}d();c();l();u();function w3(e){return e.addReducers({staticFilterSet:Ry}),{registerStaticFilter:wc,toggleSelectStaticFilterValue:po,toggleExcludeStaticFilterValue:fo,deselectAllStaticFilterValues:Jo}}d();c();l();u();function R3(e){return e.addReducers({tabSet:Fc}),{registerTab:Bs,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 A_(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Dr(e.operator);return`${Et(e)}@${t}${n}${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 x_(e){return{toQuerySyntax(){let t=Et(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function b_(e){return{toQuerySyntax(){let t=Et(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function w_(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function R_(e){return{toQuerySyntax(){let t=Et(e),{startTerm:r,otherTerms:n}=e,o=F3(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function F3(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function F_(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 E_(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 I_(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=E3(r);return`$${t}(${n})`}}}function E3(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 T_(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 P_(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 I3(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(w_(r)),this},addNear(r){return e.push(R_(r)),this},addExactMatch(r){return e.push(x_(r)),this},addFieldExists(r){return e.push(b_(r)),this},addStringField(r){return e.push(P_(r)),this},addStringFacetField(r){return e.push(T_(r)),this},addNumericField(r){return e.push(F_(r)),this},addNumericRangeField(r){return e.push(E_(r)),this},addDateField(r){return e.push(A_(r)),this},addDateRangeField(r){return e.push(C_(r)),this},addQueryExtension(r){return e.push(I_(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=T3(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function T3(e){return e==="and"?"AND":"OR"}/**
50
50
  * @license
51
51
  *
52
52
  * Copyright 2026 Coveo Solutions Inc.
@@ -79,4 +79,4 @@ fast-json-patch/module/duplex.mjs:
79
79
  *)
80
80
  */if(__exports!=exports)module.exports=exports;return module.exports});
81
81
 
82
- window.coveoQuanticVersion = '3.40.0';
82
+ window.coveoQuanticVersion = '3.42.0';