@coveo/quantic 3.43.1 → 3.43.3

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 (111) hide show
  1. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +70 -6
  2. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +17 -13
  3. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +34 -14
  4. package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +24 -4
  5. package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +17 -13
  6. package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +26 -4
  7. package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +50 -9
  8. package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +18 -13
  9. package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +43 -9
  10. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +3 -3
  11. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.css +16 -4
  12. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.html +12 -16
  13. package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +24 -4
  14. package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +17 -13
  15. package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +28 -6
  16. package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +3 -3
  17. package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +1 -1
  18. package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +3 -2
  19. package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +138 -0
  20. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.css +50 -11
  21. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.html +17 -13
  22. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.js +38 -1
  23. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +66 -0
  24. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +20 -4
  25. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +24 -0
  26. package/force-app/main/default/staticresources/coveobueno/browser/bueno.js +1 -3
  27. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +3 -3
  28. package/force-app/main/default/staticresources/coveoheadless/definitions/app/insight-engine/insight-engine.d.ts +1 -1
  29. package/force-app/main/default/staticresources/coveoheadless/definitions/case-assist.index.d.ts +2 -2
  30. package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +6 -6
  31. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/breadcrumb-manager/headless-breadcrumb-manager.d.ts +1 -1
  32. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sort/headless-core-commerce-sort.d.ts +1 -1
  33. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/url-manager/headless-core-url-manager.d.ts +1 -1
  34. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-listing/headless-product-listing.d.ts +1 -1
  35. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recommendations/headless-recommendations.d.ts +1 -1
  36. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/headless-search.d.ts +1 -1
  37. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/context/headless-core-context.d.ts +0 -1
  38. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/did-you-mean/headless-core-did-you-mean.d.ts +0 -1
  39. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facet-manager/headless-core-facet-manager.d.ts +0 -1
  40. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet.d.ts +0 -4
  41. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/facet/headless-core-facet.d.ts +0 -5
  42. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-facet.d.ts +1 -5
  43. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-filter.d.ts +0 -1
  44. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-facet.d.ts +0 -1
  45. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-filter.d.ts +0 -1
  46. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/folded-result-list/headless-core-folded-result-list.d.ts +0 -1
  47. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/pager/headless-core-pager.d.ts +0 -2
  48. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/query-error/headless-core-query-error.d.ts +0 -1
  49. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/recent-queries-list/headless-core-recent-queries-list.d.ts +0 -1
  50. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/result-list/headless-core-result-list.d.ts +0 -2
  51. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/results-per-page/headless-core-results-per-page.d.ts +0 -1
  52. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/sort/headless-core-sort.d.ts +0 -2
  53. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/status/headless-core-status.d.ts +0 -1
  54. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/tab/headless-core-tab.d.ts +0 -1
  55. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-notify-trigger.d.ts +0 -1
  56. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-query-trigger.d.ts +0 -1
  57. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-redirection-trigger.d.ts +0 -1
  58. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/dictionary-field-context/headless-dictionary-field-context.d.ts +0 -1
  59. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/document-suggestion-list/case-assist-headless-interactive-result.d.ts +1 -1
  60. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/automatic-facet-generator/headless-automatic-facet-generator.d.ts +0 -4
  61. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/category-facet/headless-category-facet.d.ts +2 -0
  62. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet.d.ts +2 -0
  63. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/category-facet/headless-category-field-suggestions.d.ts +0 -1
  64. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/facet/headless-field-suggestions.d.ts +0 -1
  65. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-interactive-citation.d.ts +1 -1
  66. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/history-manager/headless-history-manager.d.ts +0 -1
  67. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-conditions-manager/headless-facet-conditions-manager.d.ts +1 -1
  68. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-interactive-citation.d.ts +1 -1
  69. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-interactive-result.d.ts +1 -1
  70. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/results-per-page/headless-insight-results-per-page.d.ts +1 -1
  71. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/instant-results/instant-results.d.ts +1 -1
  72. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/pager/headless-pager.d.ts +2 -0
  73. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/query-summary/headless-query-summary.d.ts +1 -1
  74. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/quickview/headless-quickview.d.ts +1 -2
  75. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-results-list/headless-recent-results-list.d.ts +0 -1
  76. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/headless-recommendation.d.ts +0 -1
  77. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/result-list/headless-recommendation-interactive-result.d.ts +1 -1
  78. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/relevance-inspector/headless-relevance-inspector.d.ts +0 -1
  79. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-interactive-result.d.ts +1 -1
  80. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-result-list.d.ts +2 -0
  81. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/results-per-page/headless-results-per-page.d.ts +1 -1
  82. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/smart-snippet-questions-list/headless-smart-snippet-questions-list.d.ts +0 -1
  83. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/sort/headless-sort.d.ts +2 -0
  84. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/standalone-search-box/headless-standalone-search-box.d.ts +1 -1
  85. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/static-filter/headless-static-filter.d.ts +1 -2
  86. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/triggers/headless-execute-trigger.d.ts +0 -4
  87. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/url-manager/headless-url-manager.d.ts +0 -1
  88. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/configuration/configuration-actions-loader.d.ts +1 -1
  89. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/cart/cart-actions-loader.d.ts +1 -1
  90. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/context-actions-loader.d.ts +1 -1
  91. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/category-facet/category-facet-actions-loader.d.ts +1 -1
  92. package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/insight-folding-actions.d.ts +1 -1
  93. package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-query-set-actions-loader.d.ts +1 -1
  94. package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-search-actions-loader.d.ts +1 -1
  95. package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-set/query-set-actions-loader.d.ts +1 -1
  96. package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +7 -7
  97. package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +2 -2
  98. package/force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index.d.ts +2 -2
  99. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
  100. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
  101. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +4 -4
  102. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +4 -4
  103. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
  104. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
  105. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +1 -1
  106. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next.index.d.ts +6 -6
  107. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr.index.d.ts +6 -6
  108. package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
  109. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  110. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +4 -4
  111. package/package.json +3 -3
@@ -24,12 +24,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24
24
  `)}
25
25
 
26
26
  ${t}
27
- `;return new ii(r)}var ii=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},mt=class{constructor(e){ie(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw yA(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Fe=class{constructor(e={}){ie(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&se(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 Xe(e){return e===void 0}function vA(e){return e===null}function se(e){return Xe(e)||vA(e)}var me=class{constructor(e={}){ie(this,"value");this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(SA(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function SA(e){return Xe(e)||Qf(e)}function Qf(e){return typeof e=="boolean"}var oe=class{constructor(e={}){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(bA(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 bA(e){return Xe(e)||Hf(e)}function Hf(e){return typeof e=="number"&&!Number.isNaN(e)}var wA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){ie(this,"value");ie(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Xe(e))return null;if(!Ra(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(wA.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 Ra(e){return Object.prototype.toString.call(e)==="[object String]"}var ne=class{constructor(e={}){ie(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Xe(e))return this.config.options.required?"value is required and is currently undefined":null;if(!zf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&se(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function zf(e){return e!==void 0&&typeof e=="object"}var ve=class{constructor(e={}){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(this.config)}validate(e){if(!se(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(se(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&&se(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 Qf(e)||Ra(e)||Hf(e)||zf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Wf(e){return Array.isArray(e)}var wl=class{constructor(e){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Xe(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}};m();d();f();p();function Kf(e){return Array.isArray(e)}function Ia(e){return e.trim()===""}var AA=new Set(["1",1,"yes",!0]);function Yf(){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=>AA.has(r))}function Xf(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ai(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ta(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function xA(e){if(Ia(e.openingDelimiter)||Ia(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(se(e.content)||Ia(e.content))return e.content;if(e.highlights.length===0)return $n(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=$n(e.content.slice(n,a)),r+=e.openingDelimiter,r+=$n(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=$n(e.content.slice(n))),r}function CA(e,t){return e=$n(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Al(n,t.notMatchDelimiters):o?Al(o,t.exactMatchDelimiters):i?Al(i,t.correctionDelimiters):r)}function Al(e,t){return t?t.open+e+t.close:e}function $n(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var um=Mt(im(),1);m();d();f();p();var Gt=new Error("Failed to load reducers."),Qn=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."}},Yr=class extends Error{constructor(r,n){super();ie(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function am(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function sm(e){return typeof e!="object"||!e?!1:Object.values(e).every(YA)}function YA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function cm(e){return e===429}var qt=class e{static call(t){return _asyncToGenerator(function*(){let r=XA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let u=yield A(i,a);if(cm(u.status))throw u;return u});return function s(){return _ref.apply(this,arguments)}}();try{let u=yield(0,um.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(c){let g=c&&cm(c.status);return g&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),g});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(u.status){case 419:case 401:throw n.info("Platform renewing token"),new Qn;case 404:throw new Yr(i,u.status);default:return n.info({response:u,requestInfo:o},"Platform response"),u}}catch(u){return u.message==="Failed to fetch"?new Yr(i):u}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...u}=t,c=ai(u);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return c})()}};function Et(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Hn(e,t,r="prod"){return e??Et(t,r)}function br(e,t="prod"){return`${Et(e,t)}/rest/search/v2`}function ka(e,t="prod"){return`${Et(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function XA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",u=ZA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:u}),signal:a}}function ZA(e,t){return t==="application/x-www-form-urlencoded"?sm(e)?am(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var Oa=e=>e;m();d();f();p();m();d();f();p();function Pa(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function $t(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Pa(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Pa(),extendedResults:{},searchAction:void 0}}m();d();f();p();function wr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Ar=e=>{let{response:t}=e;return t.body?JA(e):ex(t)},JA=e=>rx(e)?nx(e):tx(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},ex=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function tx(e){return e.body.statusCode!==void 0}function rx(e){return e.body.exception!==void 0}var nx=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var xr=class{constructor(){ie(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.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)}})()}};m();d();f();p();m();d();f();p();var ui=class{constructor(t){ie(this,"_basePath");ie(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}};m();d();f();p();function lm(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var ir=(e,t,r,n)=>{let o=new ui(`${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 dm=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield qt.call({...ir(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:wr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=lm(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return ox(a)?{success:a}:{error:Ar({response:r,body:a})}});return function dm(_x3,_x4){return _ref3.apply(this,arguments)}}();function ox(e){return typeof e=="string"}m();d();f();p();function ix(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function ax(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Na(e,t){if(t&&e.name==="AbortError")return{error:ax(e)};if(e instanceof Yr)return{error:ix(e)};throw e}var Fa=class{constructor(t){ie(this,"options",t);ie(this,"apiCallsQueues",{unknown:new xr,mainSearch:new xr,facetValues:new xr,foldingCollection:new xr,instantResults:new xr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield qt.call({...ir(t,"POST","application/json","/plan"),requestParams:wr(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Na(r);let n=yield r.json();return cx(n)?{success:n}:{error:Ar({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield qt.call({...ir(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:wr(t),..._this3.options});if(r instanceof Error)return Na(r);let n=yield r.json(),o={response:r,body:n};return sx(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:Ar(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>qt.call({...ir(t,"POST","application/json",""),requestParams:wr(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Na(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return pm(i)?(a.body=fm(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:Ar(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield qt.call({...ir(t,"POST","application/json","/facet"),requestParams:wr(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 qt.call({...ir(t,"POST","application/json",""),requestParams:wr(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(pm(n)){let o={response:r,body:n};return o.body=fm(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:Ar({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return dm(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield qt.call({...ir(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return ux(n)?{success:n}:{error:Ar({response:r,body:n})}})()}},Da=e=>e.success!==void 0,gt=e=>e.error!==void 0;function pm(e){return e.results!==void 0}function fm(e){let t=Pa();return se(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function sx(e){return e.completions!==void 0}function cx(e){return e.preprocessingOutput!==void 0}function ux(e){return e.fields!==void 0}m();d();f();p();var mm=e=>e,gm=e=>e,hm=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function Ze(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 lx=typeof Symbol=="function"&&Symbol.observable||"@@observable",ym=lx,Pl=()=>Math.random().toString(36).substring(7).split("").join("."),dx={INIT:`@@redux/INIT${Pl()}`,REPLACE:`@@redux/REPLACE${Pl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Pl()}`},Ma=dx;function Qt(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 Nl(e,t,r){if(typeof e!="function")throw new Error(Ze(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ze(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ze(1));return r(Nl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,u=!1;function c(){a===i&&(a=new Map,i.forEach((C,R)=>{a.set(R,C)}))}function g(){if(u)throw new Error(Ze(3));return o}function v(C){if(typeof C!="function")throw new Error(Ze(4));if(u)throw new Error(Ze(5));let R=!0;c();let T=s++;return a.set(T,C),function(){if(R){if(u)throw new Error(Ze(6));R=!1,c(),a.delete(T),i=null}}}function E(C){if(!Qt(C))throw new Error(Ze(7));if(typeof C.type>"u")throw new Error(Ze(8));if(typeof C.type!="string")throw new Error(Ze(17));if(u)throw new Error(Ze(9));try{u=!0,o=n(o,C)}finally{u=!1}return(i=a).forEach(T=>{T()}),C}function h(C){if(typeof C!="function")throw new Error(Ze(10));n=C,E({type:Ma.REPLACE})}function y(){let C=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ze(11));function T(){let k=R;k.next&&k.next(g())}return T(),{unsubscribe:C(T)}},[ym](){return this}}}return E({type:Ma.INIT}),{dispatch:E,subscribe:v,getState:g,replaceReducer:h,[ym]:y}}function px(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ma.INIT})>"u")throw new Error(Ze(12));if(typeof r(void 0,{type:Ma.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ze(13))})}function zn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{px(r)}catch(a){i=a}return function(s={},u){if(i)throw i;let c=!1,g={};for(let v=0;v<n.length;v++){let E=n[v],h=r[E],y=s[E],S=h(y,u);if(typeof S>"u"){let C=u&&u.type;throw new Error(Ze(14))}g[E]=S,c=c||S!==y}return c=c||n.length!==Object.keys(s).length,c?g:s}}function li(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function vm(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ze(15))},a={getState:o.getState,dispatch:(u,...c)=>i(u,...c)},s=e.map(u=>u(a));return i=li(...s)(o.dispatch),{...o,dispatch:i}}}function di(e){return Qt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var Bl=Symbol.for("immer-nothing"),pi=Symbol.for("immer-draftable"),ze=Symbol.for("immer-state");function Je(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wt=Object,Zr=wt.getPrototypeOf,fi="constructor",vi="prototype",Ml="configurable",Ua="enumerable",ja="writable",mi="value",lt=e=>!!e&&!!e[ze];function dt(e){return e?Rm(e)||bi(e)||!!e[pi]||!!e[fi]?.[pi]||wi(e)||Ai(e):!1}var fx=wt[vi][fi].toString(),Sm=new WeakMap;function Rm(e){if(!e||!Kn(e))return!1;let t=Zr(e);if(t===null||t===wt[vi])return!0;let r=wt.hasOwnProperty.call(t,fi)&&t[fi];if(r===Object)return!0;if(!Xr(r))return!1;let n=Sm.get(r);return n===void 0&&(n=Function.toString.call(r),Sm.set(r,n)),n===fx}function Im(e){return lt(e)||Je(15,e),e[ze].base_}function Si(e,t,r=!0){Jr(e)===0?(r?Reflect.ownKeys(e):wt.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Jr(e){let t=e[ze];return t?t.type_:bi(e)?1:wi(e)?2:Ai(e)?3:0}var Wn=(e,t,r=Jr(e))=>r===2?e.has(t):wt[vi].hasOwnProperty.call(e,t),ar=(e,t,r=Jr(e))=>r===2?e.get(t):e[t],Va=(e,t,r,n=Jr(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function mx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var bi=Array.isArray,wi=e=>e instanceof Map,Ai=e=>e instanceof Set,Kn=e=>typeof e=="object",Xr=e=>typeof e=="function",Fl=e=>typeof e=="boolean";function gx(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var hx=e=>Kn(e)?e?.[ze]:null,Ht=e=>e.copy_||e.base_;var Gl=e=>e.modified_?e.copy_:e.base_;function ql(e,t){if(wi(e))return new Map(e);if(Ai(e))return new Set(e);if(bi(e))return Array[vi].slice.call(e);let r=Rm(e);if(t===!0||t==="class_only"&&!r){let n=wt.getOwnPropertyDescriptors(e);delete n[ze];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[ja]===!1&&(s[ja]=!0,s[Ml]=!0),(s.get||s.set)&&(n[a]={[Ml]:!0,[ja]:!0,[Ua]:s[Ua],[mi]:e[a]})}return wt.create(Zr(e),n)}else{let n=Zr(e);if(n!==null&&r)return{...e};let o=wt.create(n);return wt.assign(o,e)}}function $l(e,t=!1){return za(e)||lt(e)||!dt(e)||(Jr(e)>1&&wt.defineProperties(e,{set:qa,add:qa,clear:qa,delete:qa}),wt.freeze(e),t&&Si(e,(r,n)=>{$l(n,!0)},!1)),e}function yx(){Je(2)}var qa={[mi]:yx};function za(e){return e===null||!Kn(e)?!0:wt.isFrozen(e)}var Ba="MapSet",Ga="Patches",bm="ArrayMethods",$a={};function en(e){let t=$a[e];return t||Je(0,e),t}var wm=e=>!!$a[e];function vx(e,t){$a[e]||($a[e]=t)}var gi,Tm=()=>gi,Sx=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:wm(Ba)?en(Ba):void 0,arrayMethodsPlugin_:wm(bm)?en(bm):void 0});function Am(e,t){t&&(e.patchPlugin_=en(Ga),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function jl(e){Ll(e),e.drafts_.forEach(bx),e.drafts_=null}function Ll(e){e===gi&&(gi=e.parent_)}var xm=e=>gi=Sx(gi,e);function bx(e){let t=e[ze];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Cm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ze].modified_&&(jl(t),Je(4)),dt(e)&&(e=Em(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ze].base_,e,t)}else e=Em(t,r);return wx(t,e,!0),jl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Bl?e:void 0}function Em(e,t){if(za(t))return t;let r=t[ze];if(!r)return Qa(t,e.handledSet_,e);if(!Wa(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);Om(r,e)}return r.copy_}function wx(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$l(t,r)}function _m(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Wa=(e,t)=>e.scope_===t,Ax=[];function km(e,t,r,n){let o=Ht(e),i=e.type_;if(n!==void 0&&ar(o,n,i)===t){Va(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Si(o,(u,c)=>{if(lt(c)){let g=s.get(c)||[];g.push(u),s.set(c,g)}})}let a=e.draftLocations_.get(t)??Ax;for(let s of a)Va(o,s,r,i)}function xx(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Wa(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Gl(i);km(e,i.draft_??i,a,r),Om(i,o)})}function Om(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)}_m(e)}}function Cx(e,t,r){let{scope_:n}=e;if(lt(r)){let o=r[ze];Wa(o,n)&&o.callbacks_.push(function(){La(e);let a=Gl(o);km(e,r,a,t)})}else dt(r)&&e.callbacks_.push(function(){let i=Ht(e);e.type_===3?i.has(r)&&Qa(r,n.handledSet_,n):ar(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Qa(ar(e.copy_,t,e.type_),n.handledSet_,n)})}function Qa(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||lt(e)||t.has(e)||!dt(e)||za(e)||(t.add(e),Si(e,(n,o)=>{if(lt(o)){let i=o[ze];if(Wa(i,r)){let a=Gl(i);Va(e,n,a,e.type_),_m(i)}}else dt(o)&&Qa(o,t,r)})),e}function Ex(e,t){let r=bi(e),n={type_:r?1:0,scope_:t?t.scope_:Tm(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=Ha;r&&(o=[n],i=hi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var Ha={get(e,t){if(t===ze)return e;if(t==="constructor"||t==="__proto__"){let s=Ht(e)[t];return new Proxy(s||{},{get:(u,c)=>c==="__proto__"||c==="prototype"?Object.freeze(Object.create(null)):Reflect.get(u,c),set:()=>!0,apply:(u,c,g)=>Reflect.apply(u,c,g)})}let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=Ht(e);if(!Wn(o,t,e.type_))return Rx(e,o,t);let i=o[t];if(e.finalized_||!dt(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&gx(t))return i;if(i===Dl(e.base_,t)){La(e);let a=e.type_===1?+t:t,s=Vl(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t==="constructor"||t==="__proto__"||t==="prototype"?!1:t in Ht(e)},ownKeys(e){return Reflect.ownKeys(Ht(e))},set(e,t,r){if(t==="constructor"||t==="__proto__"||t==="prototype")return!0;let n=Pm(Ht(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Dl(Ht(e),t),i=o?.[ze];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(mx(r,o)&&(r!==void 0||Wn(e.base_,t,e.type_)))return!0;La(e),Ul(e)}return e.copy_[t]===r&&(r!==void 0||Wn(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Cx(e,t,r)),!0},deleteProperty(e,t){return La(e),Dl(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ul(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Ht(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[ja]:!0,[Ml]:e.type_!==1||t!=="length",[Ua]:n[Ua],[mi]:r[t]}},defineProperty(){Je(11)},getPrototypeOf(e){return Zr(e.base_)},setPrototypeOf(){Je(12)}},hi={};for(let e in Ha){let t=Ha[e];hi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}hi.deleteProperty=function(e,t){return hi.set.call(this,e,t,void 0)};hi.set=function(e,t,r){return Ha.set.call(this,e[0],t,r,e[0])};function Dl(e,t){let r=e[ze];return(r?Ht(r):e)[t]}function Rx(e,t,r){let n=Pm(t,r);return n?mi in n?n[mi]:n.get?.call(e.draft_):void 0}function Pm(e,t){if(!(t in e))return;let r=Zr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Zr(r)}}function Ul(e){e.modified_||(e.modified_=!0,e.parent_&&Ul(e.parent_))}function La(e){e.copy_||(e.assigned_=new Map,e.copy_=ql(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ix=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Xr(t)&&!Xr(r)){let i=r;r=t;let a=this;return function(u=i,...c){return a.produce(u,g=>r.call(this,g,...c))}}Xr(r)||Je(6),n!==void 0&&!Xr(n)&&Je(7);let o;if(dt(t)){let i=xm(this),a=Vl(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?jl(i):Ll(i)}return Am(i,n),Cm(o,i)}else if(!t||!Kn(t)){if(o=r(t),o===void 0&&(o=t),o===Bl&&(o=void 0),this.autoFreeze_&&$l(o,!0),n){let i=[],a=[];en(Ga).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else Je(1,t)},this.produceWithPatches=(t,r)=>{if(Xr(t))return(a,...s)=>this.produceWithPatches(a,u=>t(u,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},Fl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Fl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Fl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){dt(e)||Je(8),lt(e)&&(e=Ka(e));let t=xm(this),r=Vl(t,e,void 0);return r[ze].isManual_=!0,Ll(t),r}finishDraft(e,t){let r=e&&e[ze];(!r||!r.isManual_)&&Je(9);let{scope_:n}=r;return Am(n,t),Cm(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=en(Ga).applyPatches_;return lt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Vl(e,t,r,n){let[o,i]=wi(t)?en(Ba).proxyMap_(t,r):Ai(t)?en(Ba).proxySet_(t,r):Ex(t,r);return(r?.scope_??Tm()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?xx(r,i,n):i.callbacks_.push(function(u){u.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:c}=u;i.modified_&&c&&c.generatePatches_(i,[],u)}),o}function Ka(e){return lt(e)||Je(10,e),Nm(e)}function Nm(e){if(!dt(e)||za(e))return e;let t=e[ze],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ql(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ql(e,!0);return Si(r,(o,i)=>{Va(r,o,Nm(i))},n),t&&(t.finalized_=!1),r}function Fm(){function t(y,S=[]){if(y.key_!==void 0){let C=y.parent_.copy_??y.parent_.base_,R=hx(ar(C,y.key_)),T=ar(C,y.key_);if(T===void 0||T!==y.draft_&&T!==y.base_&&T!==y.copy_||R!=null&&R.base_!==y.base_)return null;let I=y.parent_.type_===3,k;if(I){let _=y.parent_;k=Array.from(_.drafts_.keys()).indexOf(y.key_)}else k=y.key_;if(!(I&&C.size>k||Wn(C,k)))return null;S.push(k)}if(y.parent_)return t(y.parent_,S);S.reverse();try{r(y.copy_,S)}catch{return null}return S}function r(y,S){let C=y;for(let R=0;R<S.length-1;R++){let T=S[R];if(C=ar(C,T),!Kn(C)||C===null)throw new Error(`Cannot resolve path at '${S.join("/")}'`)}return C}let n="replace",o="add",i="remove";function a(y,S,C){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:R,inversePatches_:T}=C;switch(y.type_){case 0:case 2:return u(y,S,R,T);case 1:return s(y,S,R,T);case 3:return c(y,S,R,T)}}function s(y,S,C,R){let{base_:T,assigned_:I}=y,k=y.copy_;k.length<T.length&&([T,k]=[k,T],[C,R]=[R,C]);let _=y.allIndicesReassigned_===!0;for(let D=0;D<T.length;D++){let G=k[D],L=T[D];if((_||I?.get(D.toString()))&&G!==L){let V=G?.[ze];if(V&&V.modified_)continue;let q=S.concat([D]);C.push({op:n,path:q,value:h(G)}),R.push({op:n,path:q,value:h(L)})}}for(let D=T.length;D<k.length;D++){let G=S.concat([D]);C.push({op:o,path:G,value:h(k[D])})}for(let D=k.length-1;T.length<=D;--D){let G=S.concat([D]);R.push({op:i,path:G})}}function u(y,S,C,R){let{base_:T,copy_:I,type_:k}=y;Si(y.assigned_,(_,D)=>{let G=ar(T,_,k),L=ar(I,_,k),j=D?Wn(T,_)?n:o:i;if(G===L&&j===n)return;let V=S.concat(_);C.push(j===i?{op:j,path:V}:{op:j,path:V,value:h(L)}),R.push(j===o?{op:i,path:V}:j===i?{op:o,path:V,value:h(G)}:{op:n,path:V,value:h(G)})})}function c(y,S,C,R){let{base_:T,copy_:I}=y,k=0;T.forEach(_=>{if(!I.has(_)){let D=S.concat([k]);C.push({op:i,path:D,value:_}),R.unshift({op:o,path:D,value:_})}k++}),k=0,I.forEach(_=>{if(!T.has(_)){let D=S.concat([k]);C.push({op:o,path:D,value:_}),R.unshift({op:i,path:D,value:_})}k++})}function g(y,S,C){let{patches_:R,inversePatches_:T}=C;R.push({op:n,path:[],value:S===Bl?void 0:S}),T.push({op:n,path:[],value:y})}function v(y,S){return S.forEach(C=>{let{path:R,op:T}=C,I=y;for(let G=0;G<R.length-1;G++){let L=Jr(I),j=R[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(L===0||L===1)&&(j==="__proto__"||j===fi)&&Je(19),Xr(I)&&j===vi&&Je(19),I=ar(I,j),Kn(I)||Je(18,R.join("/"))}let k=Jr(I),_=E(C.value),D=R[R.length-1];switch(T){case n:switch(k){case 2:return I.set(D,_);case 3:Je(16);default:return I[D]=_}case o:switch(k){case 1:return D==="-"?I.push(_):I.splice(D,0,_);case 2:return I.set(D,_);case 3:return I.add(_);default:return I[D]=_}case i:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(C.value);default:return delete I[D]}default:Je(17,T)}}),y}function E(y){if(!dt(y))return y;if(bi(y))return y.map(E);if(wi(y))return new Map(Array.from(y.entries()).map(([C,R])=>[C,E(R)]));if(Ai(y))return new Set(Array.from(y).map(E));let S=Object.create(Zr(y));for(let C in y)S[C]=E(y[C]);return Wn(y,pi)&&(S[pi]=y[pi]),S}function h(y){return lt(y)?E(y):y}vx(Ga,{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:g,getPath:t})}var yi=new Ix,tn=yi.produce,Ql=yi.produceWithPatches.bind(yi);var Hl=yi.applyPatches.bind(yi);m();d();f();p();function Tx(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _x(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 Dm=e=>Array.isArray(e)?e:[e];function kx(e){let t=Array.isArray(e[0])?e[0]:e;return _x(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ox(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Px=class{constructor(e){this.value=e}deref(){return this.value}},Nx=()=>typeof WeakRef>"u"?Px:WeakRef,qm=Nx(),Fx=0,Mm=1;function Ya(){return{s:Fx,v:void 0,o:null,p:null}}function Dx(e){return e instanceof qm?e.deref():e}function xi(e,t={}){let r=Ya(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:u}=arguments;for(let v=0,E=u;v<E;v++){let h=arguments[v];if(typeof h=="function"||typeof h=="object"&&h!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let S=y.get(h);S===void 0?(s=Ya(),y.set(h,s)):s=S}else{let y=s.p;y===null&&(s.p=y=new Map);let S=y.get(h);S===void 0?(s=Ya(),y.set(h,s)):s=S}}let c=s,g;if(s.s===Mm)g=s.v;else if(g=e.apply(null,arguments),i++,n){let v=Dx(o);v!=null&&n(v,g)&&(g=v,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new qm(g):g}return c.s=Mm,c.v=g,g}return a.clearCache=()=>{r=Ya(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Mx(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,u={},c=o.pop();typeof c=="object"&&(u=c,c=o.pop()),Tx(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);let g={...r,...u},{memoize:v,memoizeOptions:E=[],argsMemoize:h=xi,argsMemoizeOptions:y=[]}=g,S=Dm(E),C=Dm(y),R=kx(o),T=v(function(){return i++,c.apply(null,arguments)},...S),I=!0,k=h(function(){a++;let D=Ox(R,arguments);return s=T.apply(null,D),s},...C);return Object.assign(k,{resultFunc:c,memoizedResultFunc:T,dependencies:R,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var Be=Mx(xi);m();d();f();p();function jm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Lm=jm(),Um=jm;var qx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?li:li.apply(null,arguments)},eq=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},jx=e=>e&&typeof e.match=="function";function O(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(pt(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=>di(n)&&n.type===e,r}var Wm=class Ci extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ci.prototype)}static get[Symbol.species](){return Ci}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ci(...t[0].concat(this)):new Ci(...t.concat(this))}};function Vm(e){return dt(e)?tn(e,()=>{}):e}function Xa(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Lx(e){return typeof e=="boolean"}var Ux=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Wm;return r&&(Lx(r)?a.push(Lm):a.push(Um(r.extraArgument))),a},Ei="RTK_autoBatch",Zn=()=>e=>({payload:e,meta:{[Ei]:!0}}),Bm=e=>t=>{setTimeout(t,e)},Vx=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=e(o),a=setTimeout(o,t)},Bx=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Vx(window.requestAnimationFrame,100):Bm(10):e.type==="callback"?e.queueNotification:Bm(e.timeout),c=()=>{a=!1,i&&(i=!1,s.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),E=n.subscribe(v);return s.add(g),()=>{E(),s.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ei],i=!o,i&&(a||(a=!0,u(c))),n.dispatch(g)}finally{o=!0}}})},Gx=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Wm(e);return n&&o.push(Bx(typeof n=="object"?n:void 0)),o};function Km(e){let t=Ux(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},u;if(typeof r=="function")u=r;else if(Qt(r))u=zn(r);else throw new Error(pt(1));let c;typeof n=="function"?c=n(t):c=t();let g=li;o&&(g=qx({trace:!1,...(typeof o=="object"&&o)}));let v=vm(...c),E=Gx(v),h=typeof s=="function"?s(E):E(),y=g(...h);return Nl(u,a,y)}function Ym(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(pt(28));if(s in t)throw new Error(pt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function $x(e){return typeof e=="function"}function Ue(e,t){let[r,n,o]=Ym(t),i;if($x(e))i=()=>Vm(e());else{let s=Vm(e);i=()=>s}function a(s=i(),u){let c=[r[u.type],...n.filter(({matcher:g})=>g(u)).map(({reducer:g})=>g)];return c.filter(g=>!!g).length===0&&(c=[o]),c.reduce((g,v)=>{if(v)if(lt(g)){let h=v(g,u);return h===void 0?g:h}else{if(dt(g))return tn(g,E=>v(E,u));{let E=v(g,u);if(E===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}}return g},s)}return a.getInitialState=i,a}var Xm=(e,t)=>jx(e)?e.match(t):e(t);function zt(...e){return t=>e.some(r=>Xm(r,t))}function Xn(...e){return t=>e.every(r=>Xm(r,t))}function ts(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 Ri(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function rs(...e){return e.length===0?t=>ts(t,["pending"]):Ri(e)?zt(...e.map(t=>t.pending)):rs()(e[0])}function nn(...e){return e.length===0?t=>ts(t,["rejected"]):Ri(e)?zt(...e.map(t=>t.rejected)):nn()(e[0])}function Ii(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Xn(nn(...e),t):Ri(e)?Xn(nn(...e),t):Ii()(e[0])}function sr(...e){return e.length===0?t=>ts(t,["fulfilled"]):Ri(e)?zt(...e.map(t=>t.fulfilled)):sr()(e[0])}function ns(...e){return e.length===0?t=>ts(t,["pending","fulfilled","rejected"]):Ri(e)?zt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ns()(e[0])}var Qx="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ti=(e=21)=>{let t="",r=e;for(;r--;)t+=Qx[Math.random()*64|0];return t},Hx=["name","message","stack","code"],zl=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},Gm=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},zx=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Hx)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},$m="External signal was aborted",Ie=(()=>{function e(t,r,n){let o=O(t+"/fulfilled",(u,c,g,v)=>({payload:u,meta:{...(v||{}),arg:g,requestId:c,requestStatus:"fulfilled"}})),i=O(t+"/pending",(u,c,g)=>({payload:void 0,meta:{...(g||{}),arg:c,requestId:u,requestStatus:"pending"}})),a=O(t+"/rejected",(u,c,g,v,E)=>({payload:v,error:(n&&n.serializeError||zx)(u||"Rejected"),meta:{...(E||{}),arg:g,requestId:c,rejectedWithValue:!!v,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"}}));function s(u,{signal:c}={}){return(g,v,E)=>{let h=n?.idGenerator?n.idGenerator(u):Ti(),y=new l.AbortController,S,C;function R(I){C=I,y.abort()}c&&(c.aborted?R($m):c.addEventListener("abort",()=>R($m),{once:!0}));let T=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(u,{getState:v,extra:E});if(Kx(_)&&(_=yield _),_===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,L)=>{S=()=>{L({name:"AbortError",message:C||"Aborted"})},y.signal.addEventListener("abort",S,{once:!0})});g(i(h,u,n?.getPendingMeta?.({requestId:h,arg:u},{getState:v,extra:E}))),I=yield Promise.race([D,Promise.resolve(r(u,{dispatch:g,getState:v,extra:E,requestId:h,signal:y.signal,abort:R,rejectWithValue:(G,L)=>new zl(G,L),fulfillWithValue:(G,L)=>new Gm(G,L)})).then(G=>{if(G instanceof zl)throw G;return G instanceof Gm?o(G.payload,h,u,G.meta):o(G,h,u)})])}catch(_){I=_ instanceof zl?a(null,h,u,_.payload,_.meta):a(_,h,u)}finally{S&&y.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||g(I),I})();return Object.assign(T,{abort:R,requestId:h,arg:u,unwrap(){return T.then(Wx)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:zt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Wx(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Kx(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Zm=Symbol.for("rtk-slice-createasyncthunk"),rq={[Zm]:Ie};function Yx(e,t){return`${e}/${t}`}function Xx({creators:e}={}){let t=e?.asyncThunk?.[Zm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(pt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Jx()):n.reducers)||{},s=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(I,k){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(pt(12));if(_ in u.sliceCaseReducersByType)throw new Error(pt(13));return u.sliceCaseReducersByType[_]=k,c},addMatcher(I,k){return u.sliceMatchers.push({matcher:I,reducer:k}),c},exposeAction(I,k){return u.actionCreators[I]=k,c},exposeCaseReducer(I,k){return u.sliceCaseReducersByName[I]=k,c}};s.forEach(I=>{let k=a[I],_={reducerName:I,type:Yx(o,I),createNotation:typeof n.reducers=="function"};tC(k)?nC(_,k,c,t):eC(_,k,c)});function g(){let[I={},k=[],_=void 0]=typeof n.extraReducers=="function"?Ym(n.extraReducers):[n.extraReducers],D={...I,...u.sliceCaseReducersByType};return Ue(n.initialState,G=>{for(let L in D)G.addCase(L,D[L]);for(let L of u.sliceMatchers)G.addMatcher(L.matcher,L.reducer);for(let L of k)G.addMatcher(L.matcher,L.reducer);_&&G.addDefaultCase(_)})}let v=I=>I,E=new Map,h=new WeakMap,y;function S(I,k){return y||(y=g()),y(I,k)}function C(){return y||(y=g()),y.getInitialState()}function R(I,k=!1){function _(G){let L=G[I];return typeof L>"u"&&k&&(L=Xa(h,_,C)),L}function D(G=v){let L=Xa(E,k,()=>new WeakMap);return Xa(L,G,()=>{let j={};for(let[V,q]of Object.entries(n.selectors??{}))j[V]=Zx(q,G,()=>Xa(h,G,C),k);return j})}return{reducerPath:I,getSelectors:D,get selectors(){return D(_)},selectSlice:_}}let T={name:o,reducer:S,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:C,...R(i),injectInto(I,{reducerPath:k,..._}={}){let D=k??i;return I.inject({reducerPath:D,reducer:S},_),{...T,...R(D,!0)}}};return T}}function Zx(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var on=Xx();function Jx(){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 eC({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!rC(n))throw new Error(pt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?O(e,a):O(e))}function tC(e){return e._reducerDefinitionType==="asyncThunk"}function rC(e){return e._reducerDefinitionType==="reducerWithPrepare"}function nC({type:e,reducerName:t},r,n,o){if(!o)throw new Error(pt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:u,settled:c,options:g}=r,v=o(e,i,g);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),u&&n.addCase(v.rejected,u),c&&n.addMatcher(v.settled,c),n.exposeCaseReducer(t,{fulfilled:a||Za,pending:s||Za,rejected:u||Za,settled:c||Za})}function Za(){}var oC="task",Jm="listener",eg="completed",Yl="cancelled",iC=`task-${Yl}`,aC=`task-${eg}`,Wl=`${Jm}-${Yl}`,sC=`${Jm}-${eg}`,os=class{constructor(e){ie(this,"code");ie(this,"name","TaskAbortError");ie(this,"message");this.code=e,this.message=`${oC} ${Yl} (reason: ${e})`}},Xl=(e,t)=>{if(typeof e!="function")throw new TypeError(pt(32))},Ja=()=>{},tg=(e,t=Ja)=>(e.catch(t),e),rg=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),rn=e=>{if(e.aborted)throw new os(e.reason)};function ng(e,t){let r=Ja;return new Promise((n,o)=>{let i=()=>o(new os(e.reason));if(e.aborted){i();return}r=rg(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ja})}var cC=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof os?"cancelled":"rejected",error:r}}finally{t?.()}});return function cC(_x5,_x6){return _ref5.apply(this,arguments)}}(),es=e=>t=>tg(ng(e,t).then(r=>(rn(e),r))),og=e=>{let t=es(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Yn}=Object,Qm={},is="listenerMiddleware",uC=(e,t)=>{let r=n=>rg(e,()=>n.abort(e.reason));return(n,o)=>{Xl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=cC(/*#__PURE__*/_asyncToGenerator(function*(){rn(e),rn(i.signal);let s=yield n({pause:es(i.signal),delay:og(i.signal),signal:i.signal});return rn(i.signal),s}),()=>i.abort(aC));return o?.autoJoin&&t.push(a.catch(Ja)),{result:es(e)(a),cancel(){i.abort(iC)}}}},lC=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){rn(t);let i=()=>{},s=[new Promise((u,c)=>{let g=e({predicate:n,effect:(v,E)=>{E.unsubscribe(),u([v,E.getState(),E.getOriginalState()])}});i=()=>{g(),c()}})];o!=null&&s.push(new Promise(u=>setTimeout(u,o,null)));try{let u=yield ng(t,Promise.race(s));return rn(t),u}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>tg(r(n,o))},ig=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=O(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(pt(21));return Xl(i,"options.listener"),{predicate:o,type:t,effect:i}},ag=Yn(e=>{let{type:t,predicate:r,effect:n}=ig(e);return{id:Ti(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(pt(22))}}},{withTypes:()=>ag}),Hm=(e,t)=>{let{type:r,effect:n,predicate:o}=ig(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},Kl=e=>{e.pending.forEach(t=>{t.abort(Wl)})},dC=(e,t)=>()=>{for(let r of t.keys())Kl(r);e.clear()},zm=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},sg=Yn(O(`${is}/add`),{withTypes:()=>sg}),pC=O(`${is}/removeAll`),cg=Yn(O(`${is}/remove`),{withTypes:()=>cg}),fC=(...e)=>{console.error(`${is}/error`,...e)},ug=(e={})=>{let t=new Map,r=new Map,n=h=>{let y=r.get(h)??0;r.set(h,y+1)},o=h=>{let y=r.get(h)??1;y===1?r.delete(h):r.set(h,y-1)},{extra:i,onError:a=fC}=e;Xl(a,"onError");let s=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),y=>{h.unsubscribe(),y?.cancelActive&&Kl(h)}),u=h=>{let y=Hm(t,h)??ag(h);return s(y)};Yn(u,{withTypes:()=>u});let c=h=>{let y=Hm(t,h);return y&&(y.unsubscribe(),h.cancelActive&&Kl(y)),!!y};Yn(c,{withTypes:()=>c});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,y,S,C){let R=new l.AbortController,T=lC(u,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(y,Yn({},S,{getOriginalState:C,condition:(k,_)=>T(k,_).then(Boolean),take:T,delay:og(R.signal),pause:es(R.signal),extra:i,signal:R.signal,fork:uC(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,_,D)=>{k!==R&&(k.abort(Wl),D.delete(k))})},cancel:()=>{R.abort(Wl),h.pending.delete(R)},throwIfCancelled:()=>{rn(R.signal)}})))}catch(k){k instanceof os||zm(a,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(sC),o(h),h.pending.delete(R)}});return function g(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),v=dC(t,r);return{middleware:h=>y=>S=>{if(!di(S))return y(S);if(sg.match(S))return u(S.payload);if(pC.match(S)){v();return}if(cg.match(S))return c(S.payload);let C=h.getState(),R=()=>{if(C===Qm)throw new Error(pt(23));return C},T;try{if(T=y(S),t.size>0){let I=h.getState(),k=Array.from(t.values());for(let _ of k){let D=!1;try{D=_.predicate(S,I,C)}catch(G){D=!1,zm(a,G,{raisedBy:"predicate"})}D&&g(_,S,h,R)}}}finally{C=Qm}return T},startListening:u,stopListening:c,clearListeners:v}};function pt(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. `}m();d();f();p();var Y=new z({required:!0,emptyAllowed:!1}),et=new z({required:!1,emptyAllowed:!1}),tt=new z({required:!0,emptyAllowed:!0}),mq=new z({required:!1,emptyAllowed:!0}),as=new ve({each:Y,required:!0}),lg=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),dg=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),gq=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),cr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Rt=(e,t)=>{if("required"in t)return{payload:new mt({value:t}).validate({value:e}).value};let o=new ne({options:{required:!0},values:t}).validate(e);if(o)throw new ii(o);return{payload:e}},B=(e,t)=>{try{return Rt(e,t)}catch(r){return{payload:e,error:cr(r)}}},pg=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return mg(e,t,r,o,"Controller initialization error")},fg=(e,t,r,n)=>{let o=`Check the options of ${n}`;return mg(e,t,r,o,"Controller initialization error")},mg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var Jn="3.53.1",gg=["@coveo/atomic","@coveo/quantic"];var Zl=()=>et,hg=()=>Y,Cr=O("configuration/updateBasicConfiguration",e=>B(e,{accessToken:et,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:et})),Wt=O("configuration/updateSearchConfiguration",e=>B(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:et,timezone:et,locale:et,authenticationProviders:new ve({required:!1,each:Y})})),mC={enabled:new me({default:!0}),originContext:Zl(),originLevel2:Zl(),originLevel3:Zl(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new Fe,anonymous:new me({default:!1}),deviceId:et,userDisplayName:et,documentLocation:et,trackingId:dg,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ne({options:{required:!1},values:gg.reduce((e,t)=>(e[t]=lg,e),{})})},eo=O("configuration/updateAnalyticsConfiguration",e=>B(e,mC)),to=O("configuration/analytics/disable"),ro=O("configuration/analytics/enable"),ss=O("configuration/analytics/originlevel2",e=>B(e,{originLevel2:hg()})),cs=O("configuration/analytics/originlevel3",e=>B(e,{originLevel3:hg()})),yg=O("knowledge/setAgentId",e=>B(e,new z({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var vg={q:new z,enableQuerySyntax:new me,aq:new z,cq:new z,firstResult:new oe({min:0}),numberOfResults:new oe({min:0}),sortCriteria:new z,f:new ne,fExcluded:new ne,cf:new ne,nf:new ne,mnf:new ne,df:new ne,debug:new me,sf:new ne,tab:new z,af:new ne};var Er=O("searchParameters/restore",e=>B(e,vg)),Sg=O("searchParameters/restoreTab",e=>B(e,Y));m();d();f();p();var us=O("debug/enable"),ls=O("debug/disable");m();d();f();p();var ds=()=>!1;var ps=Ue(ds(),e=>{e.addCase(us,()=>!0).addCase(ls,()=>!1).addCase(Er,(t,r)=>r.payload.debug??t)});m();d();f();p();var no=O("pipeline/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var gC=O("history/undo"),hC=O("history/redo"),Kt=O("history/snapshot"),Cj=Ie("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(gC()),yield t(ht())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),Ej=Ie("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(hC()),yield t(ht())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),ht=Ie("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var oo=()=>"";var io=Ue(oo(),e=>{e.addCase(no,(t,r)=>r.payload).addCase(ht.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Wt,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var fs=O("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var ao=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,u=/^(\d{1,3}\.){3}\d{1,3}$/,c=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;u.test(s)||c.test(s)||s.indexOf(".")===-1?Jl(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Jl(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Jl(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}m();d();f();p();function yC(){return typeof navigator<"u"}function bg(){try{return typeof localStorage<"u"}catch{return!1}}function wg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Ag(){return!!(yC()&&navigator.cookieEnabled)}var xg=null;function Cg(){return xg||(bg()?localStorage:Ag()?new ed:wg()?sessionStorage:new td)}var so=class so{getItem(t){return ao.get(`${so.prefix}${t}`)}removeItem(t){ao.erase(`${so.prefix}${t}`)}setItem(t,r,n){ao.set(`${so.prefix}${t}`,r,n)}};ie(so,"prefix","coveo_");var ed=so;var td=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ms="__coveo.analytics.history",vC=20,SC=1e3*60,bC=75,an=class an{constructor(t){ie(this,"store");this.store=t||Cg()}static getInstance(t){return an.instance||(an.instance=new an(t)),an.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(ms);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ms);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ms,JSON.stringify(t.slice(0,vC)))}catch{}}clear(){try{this.store.removeItem(ms)}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,bC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>SC:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};ie(an,"instance",null);var rd=an,It=rd;m();d();f();p();m();d();f();p();var co=Be(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Jn}`));m();d();f();p();m();d();f();p();function ur(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 U(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(g){try{c(n.next(g))}catch(v){a(v)}}function u(g){try{c(n.throw(g))}catch(v){a(v)}}function c(g){g.done?i(g.value):o(g.value).then(s,u)}c((n=n.apply(e,t||[])).next())})}var Ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ae||(Ae={}));function id(){return typeof window<"u"}function vd(){return typeof navigator<"u"}function uo(){return typeof document<"u"}function ad(){try{return typeof localStorage<"u"}catch{return!1}}function wC(){try{return typeof sessionStorage<"u"}catch{return!1}}function jg(){return vd()&&navigator.cookieEnabled}var AC=[Ae.click,Ae.custom,Ae.search,Ae.view],xC=(e,t)=>AC.indexOf(e)!==-1?Object.assign({language:uo()?document.documentElement.lang:"unknown",userAgent:vd()?navigator.userAgent:"unknown"},t):t,ki=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?Eg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Eg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Eg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function CC(){return ad()?localStorage:jg()?new Oi:wC()?sessionStorage:new po}var Oi=class e{getItem(t){return ki.get(`${e.prefix}${t}`)}removeItem(t){ki.erase(`${e.prefix}${t}`)}setItem(t,r,n){ki.set(`${e.prefix}${t}`,r,n)}};Oi.prefix="coveo_";var sd=class{constructor(){this.cookieStorage=new Oi}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)}},po=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},gs="__coveo.analytics.history",EC=20,RC=1e3*60,IC=75,vs=class{constructor(t){this.store=t||CC()}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 U(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 U(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(gs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return U(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(gs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(gs,JSON.stringify(t.slice(0,EC)))}catch{}}clear(){try{this.store.removeItem(gs)}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,IC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>RC:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var TC=(e,t)=>U(void 0,void 0,void 0,function*(){return e===Ae.view?(yield _C(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),_C=e=>U(void 0,void 0,void 0,function*(){let t=new vs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),hs,kC=new Uint8Array(16);function OC(){if(!hs&&(hs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hs(kC)}var PC=/^(?:[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 Ss(e){return typeof e=="string"&&PC.test(e)}var rt=[];for(let e=0;e<256;++e)rt.push((e+256).toString(16).slice(1));function Lg(e,t=0){return rt[e[t+0]]+rt[e[t+1]]+rt[e[t+2]]+rt[e[t+3]]+"-"+rt[e[t+4]]+rt[e[t+5]]+"-"+rt[e[t+6]]+rt[e[t+7]]+"-"+rt[e[t+8]]+rt[e[t+9]]+"-"+rt[e[t+10]]+rt[e[t+11]]+rt[e[t+12]]+rt[e[t+13]]+rt[e[t+14]]+rt[e[t+15]]}function NC(e){if(!Ss(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 FC(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var DC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",MC="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function qC(e,t,r){function n(o,i,a,s){var u;if(typeof o=="string"&&(o=FC(o)),typeof i=="string"&&(i=NC(i)),((u=i)===null||u===void 0?void 0:u.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+o.length);if(c.set(i),c.set(o,i.length),c=r(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,a){s=s||0;for(let g=0;g<16;++g)a[s+g]=c[g];return a}return Lg(c)}try{n.name=e}catch{}return n.DNS=DC,n.URL=MC,n}var jC=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Rg={randomUUID:jC};function sn(e,t,r){if(Rg.randomUUID&&!t&&!e)return Rg.randomUUID();e=e||{};let n=e.random||(e.rng||OC)();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 Lg(n)}function LC(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 nd(e,t){return e<<t|e>>>32-t}function UC(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let u=0;u<16;++u)s[u]=e[a*64+u*4]<<24|e[a*64+u*4+1]<<16|e[a*64+u*4+2]<<8|e[a*64+u*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let h=0;h<16;++h)s[h]=i[a][h];for(let h=16;h<80;++h)s[h]=nd(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let u=r[0],c=r[1],g=r[2],v=r[3],E=r[4];for(let h=0;h<80;++h){let y=Math.floor(h/20),S=nd(u,5)+LC(y,c,g,v)+E+t[y]+s[h]>>>0;E=v,v=g,g=nd(c,30)>>>0,c=u,u=S}r[0]=r[0]+u>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+E>>>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 VC=qC("v5",80,UC),Ig=VC,Ug="2.30.56",Tg=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,_i={pageview:"pageview",event:"event"},bs=class{constructor({client:t,uuidGenerator:r=sn}){this.client=t,this.uuidGenerator=r}},cd=class extends bs{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Tg(window.location),this.lastReferrer=uo()?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:uo()?document.title:"",encoding:uo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===_i.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===_i.pageview?this.nextPageViewId:this.pageViewId,referrer:t===_i.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===_i.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 Tg(window.location)}},Rr=class e{constructor(t,r){if(!Ss(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Ss(i)?new e(i,Number.parseInt(o)*1e3):null}};Rr.cvo_cid="cvo_cid";Rr.expirationTime=120;var ud=class extends bs{constructor({client:t,uuidGenerator:r=sn}){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 U(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(Rr.cvo_cid,new Rr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ud.Id="link";var _t=Object.keys;function ys(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var od=128,Vg=192,_g=224,kg=240;function BC(e){return(e&248)===kg?4:(e&kg)===_g?3:(e&_g)===Vg?2:1}function GC(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&od)!=od)break;if(r-=3,(n&Vg)!=od){t-r>=BC(n)*3&&(r=t);break}}return e.substring(0,r)}var ld={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"},$C=_t(ld).map(e=>ld[e]),QC=[...$C].join("|"),HC=new RegExp(`^(${QC}$)`),zC={svcAction:"svc_action",svcActionData:"svc_action_data"},WC=e=>_t(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=ld[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),KC=e=>HC.test(e),YC=[KC],Og={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Pg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},st={action:"pa",list:"pal",listSource:"pls"},ws={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},XC=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],dd={id:"quoteId",affiliation:"quoteAffiliation"},pd={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},ZC={add:st,bookmark_add:st,bookmark_remove:st,click:st,checkout:st,checkout_option:st,detail:st,impression:st,remove:st,refund:Object.assign(Object.assign({},st),ws),purchase:Object.assign(Object.assign({},st),ws),quickview:st,quote:Object.assign(Object.assign({},st),dd),review:Object.assign(Object.assign({},st),pd)},JC=_t(Og).map(e=>Og[e]),eE=_t(Pg).map(e=>Pg[e]),tE=_t(st).map(e=>st[e]),rE=_t(ws).map(e=>ws[e]),nE=_t(pd).map(e=>pd[e]),oE=_t(dd).map(e=>dd[e]),iE=[...JC,"custom"].join("|"),aE=[...eE,"custom"].join("|"),Bg="(pr[0-9]+)",Gg="(il[0-9]+pi[0-9]+)",sE=new RegExp(`^${Bg}(${iE})$`),cE=new RegExp(`^(${Gg}(${aE}))|(il[0-9]+nm)$`),uE=new RegExp(`^(${tE.join("|")})$`),lE=new RegExp(`^(${rE.join("|")})$`),dE=new RegExp(`^${Bg}custom$`),pE=new RegExp(`^${Gg}custom$`),fE=new RegExp(`^(${[...XC,...nE,...oE].join("|")})$`),mE=e=>sE.test(e),gE=e=>cE.test(e),hE=e=>uE.test(e),yE=e=>lE.test(e),vE=e=>fE.test(e),SE=[gE,mE,hE,yE,vE],bE=[dE,pE],wE={anonymizeIp:"aip"},AE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},xE={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},CE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],EE=Object.assign(Object.assign(Object.assign(Object.assign({},wE),AE),xE),CE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),fd=Object.assign(Object.assign({},EE),zC),RE=e=>{let t=!!e.action&&ZC[e.action]||{};return _t(e).reduce((r,n)=>{let o=t[n]||fd[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},IE=_t(fd).map(e=>fd[e]),TE=e=>IE.indexOf(e)!==-1,_E=e=>e==="custom",kE=e=>[...SE,...YC,TE,_E].some(t=>t(e)),OE=e=>_t(e).reduce((t,r)=>{let n=PE(r);return n?Object.assign(Object.assign({},t),NE(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),PE=e=>{let t;return[...bE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},NE=(e,t)=>_t(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),md=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),u=this.encodeForEventType(t,s),c=new Blob([u],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,c)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return U(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:u}=a;o=s||t;try{i=JSON.parse(u)}catch(c){console.error("Unable to process the request body as a JSON string",c)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return U(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[Ae.click,Ae.custom,Ae.search,Ae.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},gd=class{sendEvent(t,r){return U(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){return Promise.resolve()})}},Ng=b.fetch,As=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},u=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:c}=u,g=ur(u,["url"]),v;try{v=yield Ng(c,g)}catch(E){console.error("An error has occured when sending the event.",E);return}if(v.ok){let E=yield v.json();return E.visitorId&&o.setCurrentVisitorId(E.visitorId),E}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 U(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Ng(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ae.click,Ae.custom,Ae.search,Ae.view].indexOf(t)!==-1}getVisitorIdParam(){return U(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"})}},hd=class{constructor(t,r){ad()&&jg()?this.storage=new sd:ad()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new po),this.client=new As(t),this.beaconClient=new md(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},yd=class{constructor(t,r){this.storage=r||new po,this.client=new As(t)}getClientDependingOnEventType(t){return this.client}},xs=class{constructor(){this.storage=new po,this.client=new gd}getClientDependingOnEventType(t){return this.client}},FE="xx",DE=e=>e?.startsWith(FE)||!1,ME=`
27
+ `;return new ii(r)}var ii=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},mt=class{constructor(e){ie(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw yA(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Fe=class{constructor(e={}){ie(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&se(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 Xe(e){return e===void 0}function vA(e){return e===null}function se(e){return Xe(e)||vA(e)}var me=class{constructor(e={}){ie(this,"value");this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(SA(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function SA(e){return Xe(e)||Qf(e)}function Qf(e){return typeof e=="boolean"}var oe=class{constructor(e={}){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(bA(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 bA(e){return Xe(e)||Hf(e)}function Hf(e){return typeof e=="number"&&!Number.isNaN(e)}var wA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){ie(this,"value");ie(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Xe(e))return null;if(!Ra(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(wA.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 Ra(e){return Object.prototype.toString.call(e)==="[object String]"}var ne=class{constructor(e={}){ie(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Xe(e))return this.config.options.required?"value is required and is currently undefined":null;if(!zf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&se(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function zf(e){return e!==void 0&&typeof e=="object"}var ve=class{constructor(e={}){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(this.config)}validate(e){if(!se(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(se(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&&se(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 Qf(e)||Ra(e)||Hf(e)||zf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Wf(e){return Array.isArray(e)}var wl=class{constructor(e){ie(this,"config");ie(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Xe(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}};m();d();f();p();function Kf(e){return Array.isArray(e)}function Ia(e){return e.trim()===""}var AA=new Set(["1",1,"yes",!0]);function Yf(){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=>AA.has(r))}function Xf(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ai(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ta(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function xA(e){if(Ia(e.openingDelimiter)||Ia(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(se(e.content)||Ia(e.content))return e.content;if(e.highlights.length===0)return $n(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=$n(e.content.slice(n,a)),r+=e.openingDelimiter,r+=$n(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=$n(e.content.slice(n))),r}function CA(e,t){return e=$n(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Al(n,t.notMatchDelimiters):o?Al(o,t.exactMatchDelimiters):i?Al(i,t.correctionDelimiters):r)}function Al(e,t){return t?t.open+e+t.close:e}function $n(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var um=Mt(im(),1);m();d();f();p();var Gt=new Error("Failed to load reducers."),Qn=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."}},Yr=class extends Error{constructor(r,n){super();ie(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function am(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function sm(e){return typeof e!="object"||!e?!1:Object.values(e).every(YA)}function YA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function cm(e){return e===429}var qt=class e{static call(t){return _asyncToGenerator(function*(){let r=XA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let u=yield A(i,a);if(cm(u.status))throw u;return u});return function s(){return _ref.apply(this,arguments)}}();try{let u=yield(0,um.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(c){let g=c&&cm(c.status);return g&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),g});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(u.status){case 419:case 401:throw n.info("Platform renewing token"),new Qn;case 404:throw new Yr(i,u.status);default:return n.info({response:u,requestInfo:o},"Platform response"),u}}catch(u){return u.message==="Failed to fetch"?new Yr(i):u}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...u}=t,c=ai(u);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return c})()}};function Et(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Hn(e,t,r="prod"){return e??Et(t,r)}function br(e,t="prod"){return`${Et(e,t)}/rest/search/v2`}function ka(e,t="prod"){return`${Et(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function XA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",u=ZA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:u}),signal:a}}function ZA(e,t){return t==="application/x-www-form-urlencoded"?sm(e)?am(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var Oa=e=>e;m();d();f();p();m();d();f();p();function Pa(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function $t(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Pa(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Pa(),extendedResults:{},searchAction:void 0}}m();d();f();p();function wr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var Ar=e=>{let{response:t}=e;return t.body?JA(e):ex(t)},JA=e=>rx(e)?nx(e):tx(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},ex=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function tx(e){return e.body.statusCode!==void 0}function rx(e){return e.body.exception!==void 0}var nx=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var xr=class{constructor(){ie(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.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)}})()}};m();d();f();p();m();d();f();p();var ui=class{constructor(t){ie(this,"_basePath");ie(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}};m();d();f();p();function lm(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var ir=(e,t,r,n)=>{let o=new ui(`${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 dm=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield qt.call({...ir(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:wr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=lm(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return ox(a)?{success:a}:{error:Ar({response:r,body:a})}});return function dm(_x3,_x4){return _ref3.apply(this,arguments)}}();function ox(e){return typeof e=="string"}m();d();f();p();function ix(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function ax(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Na(e,t){if(t&&e.name==="AbortError")return{error:ax(e)};if(e instanceof Yr)return{error:ix(e)};throw e}var Fa=class{constructor(t){ie(this,"options",t);ie(this,"apiCallsQueues",{unknown:new xr,mainSearch:new xr,facetValues:new xr,foldingCollection:new xr,instantResults:new xr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield qt.call({...ir(t,"POST","application/json","/plan"),requestParams:wr(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Na(r);let n=yield r.json();return cx(n)?{success:n}:{error:Ar({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield qt.call({...ir(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:wr(t),..._this3.options});if(r instanceof Error)return Na(r);let n=yield r.json(),o={response:r,body:n};return sx(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:Ar(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>qt.call({...ir(t,"POST","application/json",""),requestParams:wr(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Na(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return pm(i)?(a.body=fm(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:Ar(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield qt.call({...ir(t,"POST","application/json","/facet"),requestParams:wr(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 qt.call({...ir(t,"POST","application/json",""),requestParams:wr(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(pm(n)){let o={response:r,body:n};return o.body=fm(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:Ar({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return dm(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield qt.call({...ir(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return ux(n)?{success:n}:{error:Ar({response:r,body:n})}})()}},Da=e=>e.success!==void 0,gt=e=>e.error!==void 0;function pm(e){return e.results!==void 0}function fm(e){let t=Pa();return se(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function sx(e){return e.completions!==void 0}function cx(e){return e.preprocessingOutput!==void 0}function ux(e){return e.fields!==void 0}m();d();f();p();var mm=e=>e,gm=e=>e,hm=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function Ze(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 lx=typeof Symbol=="function"&&Symbol.observable||"@@observable",ym=lx,Pl=()=>Math.random().toString(36).substring(7).split("").join("."),dx={INIT:`@@redux/INIT${Pl()}`,REPLACE:`@@redux/REPLACE${Pl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Pl()}`},Ma=dx;function Qt(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 Nl(e,t,r){if(typeof e!="function")throw new Error(Ze(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ze(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ze(1));return r(Nl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,u=!1;function c(){a===i&&(a=new Map,i.forEach((C,R)=>{a.set(R,C)}))}function g(){if(u)throw new Error(Ze(3));return o}function v(C){if(typeof C!="function")throw new Error(Ze(4));if(u)throw new Error(Ze(5));let R=!0;c();let T=s++;return a.set(T,C),function(){if(R){if(u)throw new Error(Ze(6));R=!1,c(),a.delete(T),i=null}}}function E(C){if(!Qt(C))throw new Error(Ze(7));if(typeof C.type>"u")throw new Error(Ze(8));if(typeof C.type!="string")throw new Error(Ze(17));if(u)throw new Error(Ze(9));try{u=!0,o=n(o,C)}finally{u=!1}return(i=a).forEach(T=>{T()}),C}function h(C){if(typeof C!="function")throw new Error(Ze(10));n=C,E({type:Ma.REPLACE})}function y(){let C=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ze(11));function T(){let k=R;k.next&&k.next(g())}return T(),{unsubscribe:C(T)}},[ym](){return this}}}return E({type:Ma.INIT}),{dispatch:E,subscribe:v,getState:g,replaceReducer:h,[ym]:y}}function px(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Ma.INIT})>"u")throw new Error(Ze(12));if(typeof r(void 0,{type:Ma.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ze(13))})}function zn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{px(r)}catch(a){i=a}return function(s={},u){if(i)throw i;let c=!1,g={};for(let v=0;v<n.length;v++){let E=n[v],h=r[E],y=s[E],S=h(y,u);if(typeof S>"u"){let C=u&&u.type;throw new Error(Ze(14))}g[E]=S,c=c||S!==y}return c=c||n.length!==Object.keys(s).length,c?g:s}}function li(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function vm(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ze(15))},a={getState:o.getState,dispatch:(u,...c)=>i(u,...c)},s=e.map(u=>u(a));return i=li(...s)(o.dispatch),{...o,dispatch:i}}}function di(e){return Qt(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var Bl=Symbol.for("immer-nothing"),pi=Symbol.for("immer-draftable"),ze=Symbol.for("immer-state");function Je(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wt=Object,Zr=wt.getPrototypeOf,fi="constructor",vi="prototype",Ml="configurable",Ua="enumerable",ja="writable",mi="value",lt=e=>!!e&&!!e[ze];function dt(e){return e?Rm(e)||bi(e)||!!e[pi]||!!e[fi]?.[pi]||wi(e)||Ai(e):!1}var fx=wt[vi][fi].toString(),Sm=new WeakMap;function Rm(e){if(!e||!Kn(e))return!1;let t=Zr(e);if(t===null||t===wt[vi])return!0;let r=wt.hasOwnProperty.call(t,fi)&&t[fi];if(r===Object)return!0;if(!Xr(r))return!1;let n=Sm.get(r);return n===void 0&&(n=Function.toString.call(r),Sm.set(r,n)),n===fx}function Im(e){return lt(e)||Je(15,e),e[ze].base_}function Si(e,t,r=!0){Jr(e)===0?(r?Reflect.ownKeys(e):wt.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Jr(e){let t=e[ze];return t?t.type_:bi(e)?1:wi(e)?2:Ai(e)?3:0}var Wn=(e,t,r=Jr(e))=>r===2?e.has(t):wt[vi].hasOwnProperty.call(e,t),ar=(e,t,r=Jr(e))=>r===2?e.get(t):e[t],Va=(e,t,r,n=Jr(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function mx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var bi=Array.isArray,wi=e=>e instanceof Map,Ai=e=>e instanceof Set,Kn=e=>typeof e=="object",Xr=e=>typeof e=="function",Fl=e=>typeof e=="boolean";function gx(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var hx=e=>Kn(e)?e?.[ze]:null,Ht=e=>e.copy_||e.base_;var Gl=e=>e.modified_?e.copy_:e.base_;function ql(e,t){if(wi(e))return new Map(e);if(Ai(e))return new Set(e);if(bi(e))return Array[vi].slice.call(e);let r=Rm(e);if(t===!0||t==="class_only"&&!r){let n=wt.getOwnPropertyDescriptors(e);delete n[ze];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[ja]===!1&&(s[ja]=!0,s[Ml]=!0),(s.get||s.set)&&(n[a]={[Ml]:!0,[ja]:!0,[Ua]:s[Ua],[mi]:e[a]})}return wt.create(Zr(e),n)}else{let n=Zr(e);if(n!==null&&r)return{...e};let o=wt.create(n);return wt.assign(o,e)}}function $l(e,t=!1){return za(e)||lt(e)||!dt(e)||(Jr(e)>1&&wt.defineProperties(e,{set:qa,add:qa,clear:qa,delete:qa}),wt.freeze(e),t&&Si(e,(r,n)=>{$l(n,!0)},!1)),e}function yx(){Je(2)}var qa={[mi]:yx};function za(e){return e===null||!Kn(e)?!0:wt.isFrozen(e)}var Ba="MapSet",Ga="Patches",bm="ArrayMethods",$a={};function en(e){let t=$a[e];return t||Je(0,e),t}var wm=e=>!!$a[e];function vx(e,t){$a[e]||($a[e]=t)}var gi,Tm=()=>gi,Sx=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:wm(Ba)?en(Ba):void 0,arrayMethodsPlugin_:wm(bm)?en(bm):void 0});function Am(e,t){t&&(e.patchPlugin_=en(Ga),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function jl(e){Ll(e),e.drafts_.forEach(bx),e.drafts_=null}function Ll(e){e===gi&&(gi=e.parent_)}var xm=e=>gi=Sx(gi,e);function bx(e){let t=e[ze];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Cm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ze].modified_&&(jl(t),Je(4)),dt(e)&&(e=Em(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ze].base_,e,t)}else e=Em(t,r);return wx(t,e,!0),jl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Bl?e:void 0}function Em(e,t){if(za(t))return t;let r=t[ze];if(!r)return Qa(t,e.handledSet_,e);if(!Wa(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);Om(r,e)}return r.copy_}function wx(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$l(t,r)}function _m(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Wa=(e,t)=>e.scope_===t,Ax=[];function km(e,t,r,n){let o=Ht(e),i=e.type_;if(n!==void 0&&ar(o,n,i)===t){Va(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Si(o,(u,c)=>{if(lt(c)){let g=s.get(c)||[];g.push(u),s.set(c,g)}})}let a=e.draftLocations_.get(t)??Ax;for(let s of a)Va(o,s,r,i)}function xx(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Wa(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Gl(i);km(e,i.draft_??i,a,r),Om(i,o)})}function Om(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)}_m(e)}}function Cx(e,t,r){let{scope_:n}=e;if(lt(r)){let o=r[ze];Wa(o,n)&&o.callbacks_.push(function(){La(e);let a=Gl(o);km(e,r,a,t)})}else dt(r)&&e.callbacks_.push(function(){let i=Ht(e);e.type_===3?i.has(r)&&Qa(r,n.handledSet_,n):ar(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Qa(ar(e.copy_,t,e.type_),n.handledSet_,n)})}function Qa(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||lt(e)||t.has(e)||!dt(e)||za(e)||(t.add(e),Si(e,(n,o)=>{if(lt(o)){let i=o[ze];if(Wa(i,r)){let a=Gl(i);Va(e,n,a,e.type_),_m(i)}}else dt(o)&&Qa(o,t,r)})),e}function Ex(e,t){let r=bi(e),n={type_:r?1:0,scope_:t?t.scope_:Tm(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=Ha;r&&(o=[n],i=hi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var Ha={get(e,t){if(t===ze)return e;if(t==="constructor"||t==="__proto__"){let s=Ht(e)[t];return new Proxy(s||{},{get:(u,c)=>c==="__proto__"||c==="prototype"?Object.freeze(Object.create(null)):Reflect.get(u,c),set:()=>!0,apply:(u,c,g)=>Reflect.apply(u,c,g)})}let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=Ht(e);if(!Wn(o,t,e.type_))return Rx(e,o,t);let i=o[t];if(e.finalized_||!dt(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&gx(t))return i;if(i===Dl(e.base_,t)){La(e);let a=e.type_===1?+t:t,s=Vl(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t==="constructor"||t==="__proto__"||t==="prototype"?!1:t in Ht(e)},ownKeys(e){return Reflect.ownKeys(Ht(e))},set(e,t,r){if(t==="constructor"||t==="__proto__"||t==="prototype")return!0;let n=Pm(Ht(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Dl(Ht(e),t),i=o?.[ze];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(mx(r,o)&&(r!==void 0||Wn(e.base_,t,e.type_)))return!0;La(e),Ul(e)}return e.copy_[t]===r&&(r!==void 0||Wn(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Cx(e,t,r)),!0},deleteProperty(e,t){return La(e),Dl(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ul(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Ht(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[ja]:!0,[Ml]:e.type_!==1||t!=="length",[Ua]:n[Ua],[mi]:r[t]}},defineProperty(){Je(11)},getPrototypeOf(e){return Zr(e.base_)},setPrototypeOf(){Je(12)}},hi={};for(let e in Ha){let t=Ha[e];hi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}hi.deleteProperty=function(e,t){return hi.set.call(this,e,t,void 0)};hi.set=function(e,t,r){return Ha.set.call(this,e[0],t,r,e[0])};function Dl(e,t){let r=e[ze];return(r?Ht(r):e)[t]}function Rx(e,t,r){let n=Pm(t,r);return n?mi in n?n[mi]:n.get?.call(e.draft_):void 0}function Pm(e,t){if(!(t in e))return;let r=Zr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Zr(r)}}function Ul(e){e.modified_||(e.modified_=!0,e.parent_&&Ul(e.parent_))}function La(e){e.copy_||(e.assigned_=new Map,e.copy_=ql(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ix=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Xr(t)&&!Xr(r)){let i=r;r=t;let a=this;return function(u=i,...c){return a.produce(u,g=>r.call(this,g,...c))}}Xr(r)||Je(6),n!==void 0&&!Xr(n)&&Je(7);let o;if(dt(t)){let i=xm(this),a=Vl(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?jl(i):Ll(i)}return Am(i,n),Cm(o,i)}else if(!t||!Kn(t)){if(o=r(t),o===void 0&&(o=t),o===Bl&&(o=void 0),this.autoFreeze_&&$l(o,!0),n){let i=[],a=[];en(Ga).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else Je(1,t)},this.produceWithPatches=(t,r)=>{if(Xr(t))return(a,...s)=>this.produceWithPatches(a,u=>t(u,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},Fl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Fl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Fl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){dt(e)||Je(8),lt(e)&&(e=Ka(e));let t=xm(this),r=Vl(t,e,void 0);return r[ze].isManual_=!0,Ll(t),r}finishDraft(e,t){let r=e&&e[ze];(!r||!r.isManual_)&&Je(9);let{scope_:n}=r;return Am(n,t),Cm(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=en(Ga).applyPatches_;return lt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Vl(e,t,r,n){let[o,i]=wi(t)?en(Ba).proxyMap_(t,r):Ai(t)?en(Ba).proxySet_(t,r):Ex(t,r);return(r?.scope_??Tm()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?xx(r,i,n):i.callbacks_.push(function(u){u.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:c}=u;i.modified_&&c&&c.generatePatches_(i,[],u)}),o}function Ka(e){return lt(e)||Je(10,e),Nm(e)}function Nm(e){if(!dt(e)||za(e))return e;let t=e[ze],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ql(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ql(e,!0);return Si(r,(o,i)=>{Va(r,o,Nm(i))},n),t&&(t.finalized_=!1),r}function Fm(){function t(y,S=[]){if(y.key_!==void 0){let C=y.parent_.copy_??y.parent_.base_,R=hx(ar(C,y.key_)),T=ar(C,y.key_);if(T===void 0||T!==y.draft_&&T!==y.base_&&T!==y.copy_||R!=null&&R.base_!==y.base_)return null;let I=y.parent_.type_===3,k;if(I){let _=y.parent_;k=Array.from(_.drafts_.keys()).indexOf(y.key_)}else k=y.key_;if(!(I&&C.size>k||Wn(C,k)))return null;S.push(k)}if(y.parent_)return t(y.parent_,S);S.reverse();try{r(y.copy_,S)}catch{return null}return S}function r(y,S){let C=y;for(let R=0;R<S.length-1;R++){let T=S[R];if(C=ar(C,T),!Kn(C)||C===null)throw new Error(`Cannot resolve path at '${S.join("/")}'`)}return C}let n="replace",o="add",i="remove";function a(y,S,C){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:R,inversePatches_:T}=C;switch(y.type_){case 0:case 2:return u(y,S,R,T);case 1:return s(y,S,R,T);case 3:return c(y,S,R,T)}}function s(y,S,C,R){let{base_:T,assigned_:I}=y,k=y.copy_;k.length<T.length&&([T,k]=[k,T],[C,R]=[R,C]);let _=y.allIndicesReassigned_===!0;for(let D=0;D<T.length;D++){let G=k[D],L=T[D];if((_||I?.get(D.toString()))&&G!==L){let V=G?.[ze];if(V&&V.modified_)continue;let q=S.concat([D]);C.push({op:n,path:q,value:h(G)}),R.push({op:n,path:q,value:h(L)})}}for(let D=T.length;D<k.length;D++){let G=S.concat([D]);C.push({op:o,path:G,value:h(k[D])})}for(let D=k.length-1;T.length<=D;--D){let G=S.concat([D]);R.push({op:i,path:G})}}function u(y,S,C,R){let{base_:T,copy_:I,type_:k}=y;Si(y.assigned_,(_,D)=>{let G=ar(T,_,k),L=ar(I,_,k),j=D?Wn(T,_)?n:o:i;if(G===L&&j===n)return;let V=S.concat(_);C.push(j===i?{op:j,path:V}:{op:j,path:V,value:h(L)}),R.push(j===o?{op:i,path:V}:j===i?{op:o,path:V,value:h(G)}:{op:n,path:V,value:h(G)})})}function c(y,S,C,R){let{base_:T,copy_:I}=y,k=0;T.forEach(_=>{if(!I.has(_)){let D=S.concat([k]);C.push({op:i,path:D,value:_}),R.unshift({op:o,path:D,value:_})}k++}),k=0,I.forEach(_=>{if(!T.has(_)){let D=S.concat([k]);C.push({op:o,path:D,value:_}),R.unshift({op:i,path:D,value:_})}k++})}function g(y,S,C){let{patches_:R,inversePatches_:T}=C;R.push({op:n,path:[],value:S===Bl?void 0:S}),T.push({op:n,path:[],value:y})}function v(y,S){return S.forEach(C=>{let{path:R,op:T}=C,I=y;for(let G=0;G<R.length-1;G++){let L=Jr(I),j=R[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(L===0||L===1)&&(j==="__proto__"||j===fi)&&Je(19),Xr(I)&&j===vi&&Je(19),I=ar(I,j),Kn(I)||Je(18,R.join("/"))}let k=Jr(I),_=E(C.value),D=R[R.length-1];switch(T){case n:switch(k){case 2:return I.set(D,_);case 3:Je(16);default:return I[D]=_}case o:switch(k){case 1:return D==="-"?I.push(_):I.splice(D,0,_);case 2:return I.set(D,_);case 3:return I.add(_);default:return I[D]=_}case i:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(C.value);default:return delete I[D]}default:Je(17,T)}}),y}function E(y){if(!dt(y))return y;if(bi(y))return y.map(E);if(wi(y))return new Map(Array.from(y.entries()).map(([C,R])=>[C,E(R)]));if(Ai(y))return new Set(Array.from(y).map(E));let S=Object.create(Zr(y));for(let C in y)S[C]=E(y[C]);return Wn(y,pi)&&(S[pi]=y[pi]),S}function h(y){return lt(y)?E(y):y}vx(Ga,{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:g,getPath:t})}var yi=new Ix,tn=yi.produce,Ql=yi.produceWithPatches.bind(yi);var Hl=yi.applyPatches.bind(yi);m();d();f();p();function Tx(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function _x(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 Dm=e=>Array.isArray(e)?e:[e];function kx(e){let t=Array.isArray(e[0])?e[0]:e;return _x(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ox(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var Px=class{constructor(e){this.value=e}deref(){return this.value}},Nx=()=>typeof WeakRef>"u"?Px:WeakRef,qm=Nx(),Fx=0,Mm=1;function Ya(){return{s:Fx,v:void 0,o:null,p:null}}function Dx(e){return e instanceof qm?e.deref():e}function xi(e,t={}){let r=Ya(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:u}=arguments;for(let v=0,E=u;v<E;v++){let h=arguments[v];if(typeof h=="function"||typeof h=="object"&&h!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let S=y.get(h);S===void 0?(s=Ya(),y.set(h,s)):s=S}else{let y=s.p;y===null&&(s.p=y=new Map);let S=y.get(h);S===void 0?(s=Ya(),y.set(h,s)):s=S}}let c=s,g;if(s.s===Mm)g=s.v;else if(g=e.apply(null,arguments),i++,n){let v=Dx(o);v!=null&&n(v,g)&&(g=v,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new qm(g):g}return c.s=Mm,c.v=g,g}return a.clearCache=()=>{r=Ya(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Mx(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,u={},c=o.pop();typeof c=="object"&&(u=c,c=o.pop()),Tx(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);let g={...r,...u},{memoize:v,memoizeOptions:E=[],argsMemoize:h=xi,argsMemoizeOptions:y=[]}=g,S=Dm(E),C=Dm(y),R=kx(o),T=v(function(){return i++,c.apply(null,arguments)},...S),I=!0,k=h(function(){a++;let D=Ox(R,arguments);return s=T.apply(null,D),s},...C);return Object.assign(k,{resultFunc:c,memoizedResultFunc:T,dependencies:R,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var Be=Mx(xi);m();d();f();p();function jm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Lm=jm(),Um=jm;var qx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?li:li.apply(null,arguments)},eq=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},jx=e=>e&&typeof e.match=="function";function O(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(pt(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=>di(n)&&n.type===e,r}var Wm=class Ci extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ci.prototype)}static get[Symbol.species](){return Ci}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ci(...t[0].concat(this)):new Ci(...t.concat(this))}};function Vm(e){return dt(e)?tn(e,()=>{}):e}function Xa(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Lx(e){return typeof e=="boolean"}var Ux=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Wm;return r&&(Lx(r)?a.push(Lm):a.push(Um(r.extraArgument))),a},Ei="RTK_autoBatch",Zn=()=>e=>({payload:e,meta:{[Ei]:!0}}),Bm=e=>t=>{setTimeout(t,e)},Vx=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=e(o),a=setTimeout(o,t)},Bx=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Vx(window.requestAnimationFrame,100):Bm(10):e.type==="callback"?e.queueNotification:Bm(e.timeout),c=()=>{a=!1,i&&(i=!1,s.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),E=n.subscribe(v);return s.add(g),()=>{E(),s.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ei],i=!o,i&&(a||(a=!0,u(c))),n.dispatch(g)}finally{o=!0}}})},Gx=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Wm(e);return n&&o.push(Bx(typeof n=="object"?n:void 0)),o};function Km(e){let t=Ux(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},u;if(typeof r=="function")u=r;else if(Qt(r))u=zn(r);else throw new Error(pt(1));let c;typeof n=="function"?c=n(t):c=t();let g=li;o&&(g=qx({trace:!1,...(typeof o=="object"&&o)}));let v=vm(...c),E=Gx(v),h=typeof s=="function"?s(E):E(),y=g(...h);return Nl(u,a,y)}function Ym(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(pt(28));if(s in t)throw new Error(pt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function $x(e){return typeof e=="function"}function Ue(e,t){let[r,n,o]=Ym(t),i;if($x(e))i=()=>Vm(e());else{let s=Vm(e);i=()=>s}function a(s=i(),u){let c=[r[u.type],...n.filter(({matcher:g})=>g(u)).map(({reducer:g})=>g)];return c.filter(g=>!!g).length===0&&(c=[o]),c.reduce((g,v)=>{if(v)if(lt(g)){let h=v(g,u);return h===void 0?g:h}else{if(dt(g))return tn(g,E=>v(E,u));{let E=v(g,u);if(E===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}}return g},s)}return a.getInitialState=i,a}var Xm=(e,t)=>jx(e)?e.match(t):e(t);function zt(...e){return t=>e.some(r=>Xm(r,t))}function Xn(...e){return t=>e.every(r=>Xm(r,t))}function ts(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 Ri(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function rs(...e){return e.length===0?t=>ts(t,["pending"]):Ri(e)?zt(...e.map(t=>t.pending)):rs()(e[0])}function nn(...e){return e.length===0?t=>ts(t,["rejected"]):Ri(e)?zt(...e.map(t=>t.rejected)):nn()(e[0])}function Ii(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Xn(nn(...e),t):Ri(e)?Xn(nn(...e),t):Ii()(e[0])}function sr(...e){return e.length===0?t=>ts(t,["fulfilled"]):Ri(e)?zt(...e.map(t=>t.fulfilled)):sr()(e[0])}function ns(...e){return e.length===0?t=>ts(t,["pending","fulfilled","rejected"]):Ri(e)?zt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):ns()(e[0])}var Qx="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ti=(e=21)=>{let t="",r=e;for(;r--;)t+=Qx[Math.random()*64|0];return t},Hx=["name","message","stack","code"],zl=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},Gm=class{constructor(e,t){ie(this,"payload");ie(this,"meta");ie(this,"_type");this.payload=e,this.meta=t}},zx=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Hx)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},$m="External signal was aborted",Ie=(()=>{function e(t,r,n){let o=O(t+"/fulfilled",(u,c,g,v)=>({payload:u,meta:{...(v||{}),arg:g,requestId:c,requestStatus:"fulfilled"}})),i=O(t+"/pending",(u,c,g)=>({payload:void 0,meta:{...(g||{}),arg:c,requestId:u,requestStatus:"pending"}})),a=O(t+"/rejected",(u,c,g,v,E)=>({payload:v,error:(n&&n.serializeError||zx)(u||"Rejected"),meta:{...(E||{}),arg:g,requestId:c,rejectedWithValue:!!v,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"}}));function s(u,{signal:c}={}){return(g,v,E)=>{let h=n?.idGenerator?n.idGenerator(u):Ti(),y=new l.AbortController,S,C;function R(I){C=I,y.abort()}c&&(c.aborted?R($m):c.addEventListener("abort",()=>R($m),{once:!0}));let T=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(u,{getState:v,extra:E});if(Kx(_)&&(_=yield _),_===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,L)=>{S=()=>{L({name:"AbortError",message:C||"Aborted"})},y.signal.addEventListener("abort",S,{once:!0})});g(i(h,u,n?.getPendingMeta?.({requestId:h,arg:u},{getState:v,extra:E}))),I=yield Promise.race([D,Promise.resolve(r(u,{dispatch:g,getState:v,extra:E,requestId:h,signal:y.signal,abort:R,rejectWithValue:(G,L)=>new zl(G,L),fulfillWithValue:(G,L)=>new Gm(G,L)})).then(G=>{if(G instanceof zl)throw G;return G instanceof Gm?o(G.payload,h,u,G.meta):o(G,h,u)})])}catch(_){I=_ instanceof zl?a(null,h,u,_.payload,_.meta):a(_,h,u)}finally{S&&y.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||g(I),I})();return Object.assign(T,{abort:R,requestId:h,arg:u,unwrap(){return T.then(Wx)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:zt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function Wx(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Kx(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Zm=Symbol.for("rtk-slice-createasyncthunk"),rq={[Zm]:Ie};function Yx(e,t){return`${e}/${t}`}function Xx({creators:e}={}){let t=e?.asyncThunk?.[Zm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(pt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(Jx()):n.reducers)||{},s=Object.keys(a),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(I,k){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(pt(12));if(_ in u.sliceCaseReducersByType)throw new Error(pt(13));return u.sliceCaseReducersByType[_]=k,c},addMatcher(I,k){return u.sliceMatchers.push({matcher:I,reducer:k}),c},exposeAction(I,k){return u.actionCreators[I]=k,c},exposeCaseReducer(I,k){return u.sliceCaseReducersByName[I]=k,c}};s.forEach(I=>{let k=a[I],_={reducerName:I,type:Yx(o,I),createNotation:typeof n.reducers=="function"};tC(k)?nC(_,k,c,t):eC(_,k,c)});function g(){let[I={},k=[],_=void 0]=typeof n.extraReducers=="function"?Ym(n.extraReducers):[n.extraReducers],D={...I,...u.sliceCaseReducersByType};return Ue(n.initialState,G=>{for(let L in D)G.addCase(L,D[L]);for(let L of u.sliceMatchers)G.addMatcher(L.matcher,L.reducer);for(let L of k)G.addMatcher(L.matcher,L.reducer);_&&G.addDefaultCase(_)})}let v=I=>I,E=new Map,h=new WeakMap,y;function S(I,k){return y||(y=g()),y(I,k)}function C(){return y||(y=g()),y.getInitialState()}function R(I,k=!1){function _(G){let L=G[I];return typeof L>"u"&&k&&(L=Xa(h,_,C)),L}function D(G=v){let L=Xa(E,k,()=>new WeakMap);return Xa(L,G,()=>{let j={};for(let[V,q]of Object.entries(n.selectors??{}))j[V]=Zx(q,G,()=>Xa(h,G,C),k);return j})}return{reducerPath:I,getSelectors:D,get selectors(){return D(_)},selectSlice:_}}let T={name:o,reducer:S,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:C,...R(i),injectInto(I,{reducerPath:k,..._}={}){let D=k??i;return I.inject({reducerPath:D,reducer:S},_),{...T,...R(D,!0)}}};return T}}function Zx(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var on=Xx();function Jx(){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 eC({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!rC(n))throw new Error(pt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?O(e,a):O(e))}function tC(e){return e._reducerDefinitionType==="asyncThunk"}function rC(e){return e._reducerDefinitionType==="reducerWithPrepare"}function nC({type:e,reducerName:t},r,n,o){if(!o)throw new Error(pt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:u,settled:c,options:g}=r,v=o(e,i,g);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),u&&n.addCase(v.rejected,u),c&&n.addMatcher(v.settled,c),n.exposeCaseReducer(t,{fulfilled:a||Za,pending:s||Za,rejected:u||Za,settled:c||Za})}function Za(){}var oC="task",Jm="listener",eg="completed",Yl="cancelled",iC=`task-${Yl}`,aC=`task-${eg}`,Wl=`${Jm}-${Yl}`,sC=`${Jm}-${eg}`,os=class{constructor(e){ie(this,"code");ie(this,"name","TaskAbortError");ie(this,"message");this.code=e,this.message=`${oC} ${Yl} (reason: ${e})`}},Xl=(e,t)=>{if(typeof e!="function")throw new TypeError(pt(32))},Ja=()=>{},tg=(e,t=Ja)=>(e.catch(t),e),rg=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),rn=e=>{if(e.aborted)throw new os(e.reason)};function ng(e,t){let r=Ja;return new Promise((n,o)=>{let i=()=>o(new os(e.reason));if(e.aborted){i();return}r=rg(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ja})}var cC=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof os?"cancelled":"rejected",error:r}}finally{t?.()}});return function cC(_x5,_x6){return _ref5.apply(this,arguments)}}(),es=e=>t=>tg(ng(e,t).then(r=>(rn(e),r))),og=e=>{let t=es(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Yn}=Object,Qm={},is="listenerMiddleware",uC=(e,t)=>{let r=n=>rg(e,()=>n.abort(e.reason));return(n,o)=>{Xl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=cC(/*#__PURE__*/_asyncToGenerator(function*(){rn(e),rn(i.signal);let s=yield n({pause:es(i.signal),delay:og(i.signal),signal:i.signal});return rn(i.signal),s}),()=>i.abort(aC));return o?.autoJoin&&t.push(a.catch(Ja)),{result:es(e)(a),cancel(){i.abort(iC)}}}},lC=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){rn(t);let i=()=>{},s=[new Promise((u,c)=>{let g=e({predicate:n,effect:(v,E)=>{E.unsubscribe(),u([v,E.getState(),E.getOriginalState()])}});i=()=>{g(),c()}})];o!=null&&s.push(new Promise(u=>setTimeout(u,o,null)));try{let u=yield ng(t,Promise.race(s));return rn(t),u}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>tg(r(n,o))},ig=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=O(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(pt(21));return Xl(i,"options.listener"),{predicate:o,type:t,effect:i}},ag=Yn(e=>{let{type:t,predicate:r,effect:n}=ig(e);return{id:Ti(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(pt(22))}}},{withTypes:()=>ag}),Hm=(e,t)=>{let{type:r,effect:n,predicate:o}=ig(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},Kl=e=>{e.pending.forEach(t=>{t.abort(Wl)})},dC=(e,t)=>()=>{for(let r of t.keys())Kl(r);e.clear()},zm=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},sg=Yn(O(`${is}/add`),{withTypes:()=>sg}),pC=O(`${is}/removeAll`),cg=Yn(O(`${is}/remove`),{withTypes:()=>cg}),fC=(...e)=>{console.error(`${is}/error`,...e)},ug=(e={})=>{let t=new Map,r=new Map,n=h=>{let y=r.get(h)??0;r.set(h,y+1)},o=h=>{let y=r.get(h)??1;y===1?r.delete(h):r.set(h,y-1)},{extra:i,onError:a=fC}=e;Xl(a,"onError");let s=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),y=>{h.unsubscribe(),y?.cancelActive&&Kl(h)}),u=h=>{let y=Hm(t,h)??ag(h);return s(y)};Yn(u,{withTypes:()=>u});let c=h=>{let y=Hm(t,h);return y&&(y.unsubscribe(),h.cancelActive&&Kl(y)),!!y};Yn(c,{withTypes:()=>c});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,y,S,C){let R=new l.AbortController,T=lC(u,R.signal),I=[];try{h.pending.add(R),n(h),yield Promise.resolve(h.effect(y,Yn({},S,{getOriginalState:C,condition:(k,_)=>T(k,_).then(Boolean),take:T,delay:og(R.signal),pause:es(R.signal),extra:i,signal:R.signal,fork:uC(R.signal,I),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((k,_,D)=>{k!==R&&(k.abort(Wl),D.delete(k))})},cancel:()=>{R.abort(Wl),h.pending.delete(R)},throwIfCancelled:()=>{rn(R.signal)}})))}catch(k){k instanceof os||zm(a,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(sC),o(h),h.pending.delete(R)}});return function g(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),v=dC(t,r);return{middleware:h=>y=>S=>{if(!di(S))return y(S);if(sg.match(S))return u(S.payload);if(pC.match(S)){v();return}if(cg.match(S))return c(S.payload);let C=h.getState(),R=()=>{if(C===Qm)throw new Error(pt(23));return C},T;try{if(T=y(S),t.size>0){let I=h.getState(),k=Array.from(t.values());for(let _ of k){let D=!1;try{D=_.predicate(S,I,C)}catch(G){D=!1,zm(a,G,{raisedBy:"predicate"})}D&&g(_,S,h,R)}}}finally{C=Qm}return T},startListening:u,stopListening:c,clearListeners:v}};function pt(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. `}m();d();f();p();var Y=new z({required:!0,emptyAllowed:!1}),et=new z({required:!1,emptyAllowed:!1}),tt=new z({required:!0,emptyAllowed:!0}),mq=new z({required:!1,emptyAllowed:!0}),as=new ve({each:Y,required:!0}),lg=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),dg=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),gq=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),cr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Rt=(e,t)=>{if("required"in t)return{payload:new mt({value:t}).validate({value:e}).value};let o=new ne({options:{required:!0},values:t}).validate(e);if(o)throw new ii(o);return{payload:e}},B=(e,t)=>{try{return Rt(e,t)}catch(r){return{payload:e,error:cr(r)}}},pg=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return mg(e,t,r,o,"Controller initialization error")},fg=(e,t,r,n)=>{let o=`Check the options of ${n}`;return mg(e,t,r,o,"Controller initialization error")},mg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var Jn="3.53.2",gg=["@coveo/atomic","@coveo/quantic"];var Zl=()=>et,hg=()=>Y,Cr=O("configuration/updateBasicConfiguration",e=>B(e,{accessToken:et,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:et})),Wt=O("configuration/updateSearchConfiguration",e=>B(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:et,timezone:et,locale:et,authenticationProviders:new ve({required:!1,each:Y})})),mC={enabled:new me({default:!0}),originContext:Zl(),originLevel2:Zl(),originLevel3:Zl(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new Fe,anonymous:new me({default:!1}),deviceId:et,userDisplayName:et,documentLocation:et,trackingId:dg,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ne({options:{required:!1},values:gg.reduce((e,t)=>(e[t]=lg,e),{})})},eo=O("configuration/updateAnalyticsConfiguration",e=>B(e,mC)),to=O("configuration/analytics/disable"),ro=O("configuration/analytics/enable"),ss=O("configuration/analytics/originlevel2",e=>B(e,{originLevel2:hg()})),cs=O("configuration/analytics/originlevel3",e=>B(e,{originLevel3:hg()})),yg=O("knowledge/setAgentId",e=>B(e,new z({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var vg={q:new z,enableQuerySyntax:new me,aq:new z,cq:new z,firstResult:new oe({min:0}),numberOfResults:new oe({min:0}),sortCriteria:new z,f:new ne,fExcluded:new ne,cf:new ne,nf:new ne,mnf:new ne,df:new ne,debug:new me,sf:new ne,tab:new z,af:new ne};var Er=O("searchParameters/restore",e=>B(e,vg)),Sg=O("searchParameters/restoreTab",e=>B(e,Y));m();d();f();p();var us=O("debug/enable"),ls=O("debug/disable");m();d();f();p();var ds=()=>!1;var ps=Ue(ds(),e=>{e.addCase(us,()=>!0).addCase(ls,()=>!1).addCase(Er,(t,r)=>r.payload.debug??t)});m();d();f();p();var no=O("pipeline/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var gC=O("history/undo"),hC=O("history/redo"),Kt=O("history/snapshot"),Cj=Ie("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(gC()),yield t(ht())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),Ej=Ie("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(hC()),yield t(ht())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),ht=Ie("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var oo=()=>"";var io=Ue(oo(),e=>{e.addCase(no,(t,r)=>r.payload).addCase(ht.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Wt,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var fs=O("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var ao=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,u=/^(\d{1,3}\.){3}\d{1,3}$/,c=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;u.test(s)||c.test(s)||s.indexOf(".")===-1?Jl(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Jl(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Jl(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}m();d();f();p();function yC(){return typeof navigator<"u"}function bg(){try{return typeof localStorage<"u"}catch{return!1}}function wg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Ag(){return!!(yC()&&navigator.cookieEnabled)}var xg=null;function Cg(){return xg||(bg()?localStorage:Ag()?new ed:wg()?sessionStorage:new td)}var so=class so{getItem(t){return ao.get(`${so.prefix}${t}`)}removeItem(t){ao.erase(`${so.prefix}${t}`)}setItem(t,r,n){ao.set(`${so.prefix}${t}`,r,n)}};ie(so,"prefix","coveo_");var ed=so;var td=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ms="__coveo.analytics.history",vC=20,SC=1e3*60,bC=75,an=class an{constructor(t){ie(this,"store");this.store=t||Cg()}static getInstance(t){return an.instance||(an.instance=new an(t)),an.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(ms);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ms);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ms,JSON.stringify(t.slice(0,vC)))}catch{}}clear(){try{this.store.removeItem(ms)}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,bC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>SC:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};ie(an,"instance",null);var rd=an,It=rd;m();d();f();p();m();d();f();p();var co=Be(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Jn}`));m();d();f();p();m();d();f();p();function ur(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 U(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(g){try{c(n.next(g))}catch(v){a(v)}}function u(g){try{c(n.throw(g))}catch(v){a(v)}}function c(g){g.done?i(g.value):o(g.value).then(s,u)}c((n=n.apply(e,t||[])).next())})}var Ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ae||(Ae={}));function id(){return typeof window<"u"}function vd(){return typeof navigator<"u"}function uo(){return typeof document<"u"}function ad(){try{return typeof localStorage<"u"}catch{return!1}}function wC(){try{return typeof sessionStorage<"u"}catch{return!1}}function jg(){return vd()&&navigator.cookieEnabled}var AC=[Ae.click,Ae.custom,Ae.search,Ae.view],xC=(e,t)=>AC.indexOf(e)!==-1?Object.assign({language:uo()?document.documentElement.lang:"unknown",userAgent:vd()?navigator.userAgent:"unknown"},t):t,ki=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?Eg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Eg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Eg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function CC(){return ad()?localStorage:jg()?new Oi:wC()?sessionStorage:new po}var Oi=class e{getItem(t){return ki.get(`${e.prefix}${t}`)}removeItem(t){ki.erase(`${e.prefix}${t}`)}setItem(t,r,n){ki.set(`${e.prefix}${t}`,r,n)}};Oi.prefix="coveo_";var sd=class{constructor(){this.cookieStorage=new Oi}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)}},po=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},gs="__coveo.analytics.history",EC=20,RC=1e3*60,IC=75,vs=class{constructor(t){this.store=t||CC()}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 U(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 U(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(gs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return U(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(gs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(gs,JSON.stringify(t.slice(0,EC)))}catch{}}clear(){try{this.store.removeItem(gs)}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,IC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>RC:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var TC=(e,t)=>U(void 0,void 0,void 0,function*(){return e===Ae.view?(yield _C(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),_C=e=>U(void 0,void 0,void 0,function*(){let t=new vs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),hs,kC=new Uint8Array(16);function OC(){if(!hs&&(hs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hs(kC)}var PC=/^(?:[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 Ss(e){return typeof e=="string"&&PC.test(e)}var rt=[];for(let e=0;e<256;++e)rt.push((e+256).toString(16).slice(1));function Lg(e,t=0){return rt[e[t+0]]+rt[e[t+1]]+rt[e[t+2]]+rt[e[t+3]]+"-"+rt[e[t+4]]+rt[e[t+5]]+"-"+rt[e[t+6]]+rt[e[t+7]]+"-"+rt[e[t+8]]+rt[e[t+9]]+"-"+rt[e[t+10]]+rt[e[t+11]]+rt[e[t+12]]+rt[e[t+13]]+rt[e[t+14]]+rt[e[t+15]]}function NC(e){if(!Ss(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 FC(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var DC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",MC="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function qC(e,t,r){function n(o,i,a,s){var u;if(typeof o=="string"&&(o=FC(o)),typeof i=="string"&&(i=NC(i)),((u=i)===null||u===void 0?void 0:u.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+o.length);if(c.set(i),c.set(o,i.length),c=r(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,a){s=s||0;for(let g=0;g<16;++g)a[s+g]=c[g];return a}return Lg(c)}try{n.name=e}catch{}return n.DNS=DC,n.URL=MC,n}var jC=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Rg={randomUUID:jC};function sn(e,t,r){if(Rg.randomUUID&&!t&&!e)return Rg.randomUUID();e=e||{};let n=e.random||(e.rng||OC)();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 Lg(n)}function LC(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 nd(e,t){return e<<t|e>>>32-t}function UC(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let u=0;u<16;++u)s[u]=e[a*64+u*4]<<24|e[a*64+u*4+1]<<16|e[a*64+u*4+2]<<8|e[a*64+u*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let h=0;h<16;++h)s[h]=i[a][h];for(let h=16;h<80;++h)s[h]=nd(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let u=r[0],c=r[1],g=r[2],v=r[3],E=r[4];for(let h=0;h<80;++h){let y=Math.floor(h/20),S=nd(u,5)+LC(y,c,g,v)+E+t[y]+s[h]>>>0;E=v,v=g,g=nd(c,30)>>>0,c=u,u=S}r[0]=r[0]+u>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+E>>>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 VC=qC("v5",80,UC),Ig=VC,Ug="2.30.56",Tg=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,_i={pageview:"pageview",event:"event"},bs=class{constructor({client:t,uuidGenerator:r=sn}){this.client=t,this.uuidGenerator=r}},cd=class extends bs{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Tg(window.location),this.lastReferrer=uo()?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:uo()?document.title:"",encoding:uo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===_i.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===_i.pageview?this.nextPageViewId:this.pageViewId,referrer:t===_i.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===_i.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 Tg(window.location)}},Rr=class e{constructor(t,r){if(!Ss(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Ss(i)?new e(i,Number.parseInt(o)*1e3):null}};Rr.cvo_cid="cvo_cid";Rr.expirationTime=120;var ud=class extends bs{constructor({client:t,uuidGenerator:r=sn}){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 U(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(Rr.cvo_cid,new Rr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ud.Id="link";var _t=Object.keys;function ys(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var od=128,Vg=192,_g=224,kg=240;function BC(e){return(e&248)===kg?4:(e&kg)===_g?3:(e&_g)===Vg?2:1}function GC(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&od)!=od)break;if(r-=3,(n&Vg)!=od){t-r>=BC(n)*3&&(r=t);break}}return e.substring(0,r)}var ld={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"},$C=_t(ld).map(e=>ld[e]),QC=[...$C].join("|"),HC=new RegExp(`^(${QC}$)`),zC={svcAction:"svc_action",svcActionData:"svc_action_data"},WC=e=>_t(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=ld[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),KC=e=>HC.test(e),YC=[KC],Og={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Pg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},st={action:"pa",list:"pal",listSource:"pls"},ws={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},XC=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],dd={id:"quoteId",affiliation:"quoteAffiliation"},pd={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},ZC={add:st,bookmark_add:st,bookmark_remove:st,click:st,checkout:st,checkout_option:st,detail:st,impression:st,remove:st,refund:Object.assign(Object.assign({},st),ws),purchase:Object.assign(Object.assign({},st),ws),quickview:st,quote:Object.assign(Object.assign({},st),dd),review:Object.assign(Object.assign({},st),pd)},JC=_t(Og).map(e=>Og[e]),eE=_t(Pg).map(e=>Pg[e]),tE=_t(st).map(e=>st[e]),rE=_t(ws).map(e=>ws[e]),nE=_t(pd).map(e=>pd[e]),oE=_t(dd).map(e=>dd[e]),iE=[...JC,"custom"].join("|"),aE=[...eE,"custom"].join("|"),Bg="(pr[0-9]+)",Gg="(il[0-9]+pi[0-9]+)",sE=new RegExp(`^${Bg}(${iE})$`),cE=new RegExp(`^(${Gg}(${aE}))|(il[0-9]+nm)$`),uE=new RegExp(`^(${tE.join("|")})$`),lE=new RegExp(`^(${rE.join("|")})$`),dE=new RegExp(`^${Bg}custom$`),pE=new RegExp(`^${Gg}custom$`),fE=new RegExp(`^(${[...XC,...nE,...oE].join("|")})$`),mE=e=>sE.test(e),gE=e=>cE.test(e),hE=e=>uE.test(e),yE=e=>lE.test(e),vE=e=>fE.test(e),SE=[gE,mE,hE,yE,vE],bE=[dE,pE],wE={anonymizeIp:"aip"},AE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},xE={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},CE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],EE=Object.assign(Object.assign(Object.assign(Object.assign({},wE),AE),xE),CE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),fd=Object.assign(Object.assign({},EE),zC),RE=e=>{let t=!!e.action&&ZC[e.action]||{};return _t(e).reduce((r,n)=>{let o=t[n]||fd[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},IE=_t(fd).map(e=>fd[e]),TE=e=>IE.indexOf(e)!==-1,_E=e=>e==="custom",kE=e=>[...SE,...YC,TE,_E].some(t=>t(e)),OE=e=>_t(e).reduce((t,r)=>{let n=PE(r);return n?Object.assign(Object.assign({},t),NE(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),PE=e=>{let t;return[...bE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},NE=(e,t)=>_t(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),md=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),u=this.encodeForEventType(t,s),c=new Blob([u],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,c)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return U(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:u}=a;o=s||t;try{i=JSON.parse(u)}catch(c){console.error("Unable to process the request body as a JSON string",c)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return U(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[Ae.click,Ae.custom,Ae.search,Ae.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},gd=class{sendEvent(t,r){return U(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){return Promise.resolve()})}},Ng=b.fetch,As=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},u=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:c}=u,g=ur(u,["url"]),v;try{v=yield Ng(c,g)}catch(E){console.error("An error has occured when sending the event.",E);return}if(v.ok){let E=yield v.json();return E.visitorId&&o.setCurrentVisitorId(E.visitorId),E}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 U(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Ng(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ae.click,Ae.custom,Ae.search,Ae.view].indexOf(t)!==-1}getVisitorIdParam(){return U(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"})}},hd=class{constructor(t,r){ad()&&jg()?this.storage=new sd:ad()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new po),this.client=new As(t),this.beaconClient=new md(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},yd=class{constructor(t,r){this.storage=r||new po,this.client=new As(t)}getClientDependingOnEventType(t){return this.client}},xs=class{constructor(){this.storage=new po,this.client=new gd}getClientDependingOnEventType(t){return this.client}},FE="xx",DE=e=>e?.startsWith(FE)||!1,ME=`
28
28
  We've detected you're using React Native but have not provided the corresponding runtime,
29
29
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
30
30
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
31
- `;function qE(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var jE=["1",1,"yes",!0];function Cs(){let e=[];return id()&&e.push(window.doNotTrack),vd()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>jE.indexOf(t)!==-1)}var $g="v15",Qg={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 LE(e=Qg.default,t=$g,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 UE="38824e1f-37f5-42d3-8372-a4b8fa9df946",Yt=class{get defaultOptions(){return{endpoint:Qg.default,isCustomEndpoint:!1,token:"",version:$g,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Ug}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=[TC,xC].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};Cs()?this.runtime=new xs:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Ae.view,{newEventType:Ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.click,{newEventType:Ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.custom,{newEventType:Ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.search,{newEventType:Ae.search,addClientIdParameter:!0})}initRuntime(t){return id()&&uo()?new hd(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(qE()&&console.warn(ME),new yd(t))}get storage(){return this.runtime.storage}determineVisitorId(){return U(this,void 0,void 0,function*(){try{return id()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||sn()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),sn()}})}getCurrentVisitorId(){return U(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return U(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return U(this,void 0,void 0,function*(){if(Ss(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Ig(t,Ig(r,UE)))}})}getParameters(t,...r){return U(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return U(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(sn()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Cs())return null;try{let r=new URL(t).searchParams.get(Rr.cvo_cid);if(r==null)return null;let n=Rr.fromString(r);return!n||!uo()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return U(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>U(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>i?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((y,S)=>U(this,void 0,void 0,function*(){let C=yield y;return yield S(t,C)}),h)].reduce((h,y)=>U(this,void 0,void 0,function*(){let S=yield h;return yield y(S)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return U(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?RE(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,E)=>U(this,void 0,void 0,function*(){let h=yield v;return yield E(h)}),Promise.resolve(r))})}makeEvent(t,...r){return U(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>U(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(s=>s(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return U(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return U(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 vs().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.search,t)})}sendSearchEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=ur(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.click,t)})}sendClickEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=ur(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.custom,t)})}sendCustomEvent(t){return U(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=ur(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.view,t)})}sendViewEvent(t){return U(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return U(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return U(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[Ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(kE(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=ur(t,["custom"]),o={};r&&ys(r)&&(o=this.lowercaseKeys(r));let i=OE(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=ur(t,["custom"]);if(r&&ys(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=ur(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Ae.view||r==Ae.click||r==Ae.search||r==Ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=ur(t,["userId"]);return DE(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=ur(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&ys(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&ys(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"?GC(t,r):t}get baseUrl(){return LE(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},lr;(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"})(lr||(lr={}));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 Fg={[$.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",[lr.expandToFullUI]:"interface",[lr.openUserActions]:"User Actions",[lr.showPrecedingSessions]:"User Actions",[lr.showFollowingSessions]:"User Actions",[lr.clickViewedDocument]:"User Actions",[lr.clickPageView]:"User Actions",[lr.createArticle]:"createArticle"},fo=class{constructor(){this.runtime=new xs,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(Ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Ug}};function VE(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function BE(e){return e.map(t=>t.replace(/;/g,""))}function Hg(e){let r=e.join(";");return r.length<=256?r:Hg(e.slice(1))}var Dg=e=>{let t=BE(e),r=VE(t);return Hg(r)};function Mg(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Dg(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Dg(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Es=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Cs();this.coveoAnalyticsClient=n?new fo:new Yt(t)}disable(){this.coveoAnalyticsClient=new fo}enable(){this.coveoAnalyticsClient=new Yt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return U(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,Mg(t))}logOmniboxAnalytics(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,Mg(t))}logOmniboxFromLink(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return U(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return U(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 U(this,arguments,void 0,function*(n,o,i=Fg[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),s=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),u=yield this.coveoAnalyticsClient.makeCustomEvent(s);return{description:this.makeEventDescription(u,n),log:({searchUID:c})=>u.log({lastSearchQueryUid:c})}})}logCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,i=Fg[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({lastSearchQueryUid:s})}})}logCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return U(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({searchQueryUid:s})}})}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return U(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 U(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 Yt?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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Rs=Object.assign({},_i),qg=Object.keys(Rs).map(e=>Rs[e]),lo=class extends cd{constructor({client:t,uuidGenerator:r=sn}){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])=>qg.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(qg.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Rs.pageview,{newEventType:Ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Rs.event,{newEventType:Ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return WC(this.ticket)}};lo.Id="svc";var Is;(function(e){e.click="click",e.flowStart="flowStart"})(Is||(Is={}));var Tt;(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"})(Tt||(Tt={}));var Ts;(function(e){e.quit="Quit",e.solved="Solved"})(Ts||(Ts={}));var _s=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Cs();this.coveoAnalyticsClient=o?new Yt(t):new fo,this.svc=new lo({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new fo,this.svc=new lo({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Yt(this.options),this.svc=new lo({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Tt.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Tt.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Tt.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Tt.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Tt.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Tt.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Tt.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Tt.caseCancelled,{reason:Ts.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Tt.caseSolved,{reason:Ts.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Tt.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Is.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Is.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return U(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 Yt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){var i,a;let s=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(s)})}};var zg=e=>new Yt(e).getCurrentVisitorId(),Pi=(e,t)=>typeof t=="function"?(...r)=>{let n=ai(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Ni=(e,t)=>(...r)=>{let n=ai(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function ks(){return{desiredCount:5,numberOfValues:8,set:{}}}m();d();f();p();m();d();f();p();m();d();f();p();function Wg(e){let{activeValue:t,ancestryMap:r}=GE(e);return t?$E(t,r):[]}function GE(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 $E(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var QE=(e,t)=>e.categoryFacetSet[t]?.request;var wd=(e,t)=>{let r=QE(e,t);return Wg(r?.currentValues??[])};m();d();f();p();function Os(){return{}}m();d();f();p();function Ps(){return{}}m();d();f();p();function Ns(){return{}}m();d();f();p();function Fs(){return{}}function Ad(e){return{facetSet:e.facetSet??Fs(),categoryFacetSet:e.categoryFacetSet??Os(),dateFacetSet:e.dateFacetSet??Ps(),numericFacetSet:e.numericFacetSet??Ns(),automaticFacetSet:e.automaticFacetSet??ks()}}var xd=e=>{let t=[];return WE(e).forEach((r,n)=>{let o=rR(e,r.facetId),i=eR(r,n+1);if(zE(r)){if(!!!wd(e,r.facetId).length)return;t.push({...i,...ZE(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,s)=>{if(a.state==="idle")return;let u=Kg(a,s+1,o),c=HE(r)?Yg(a):YE(a);t.push({...i,...u,...c})})}),KE(e).forEach((r,n)=>{let o=JE(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let s=Kg(i,a+1,"specific"),u=Yg(i);t.push({...o,...s,...u})})}),t},HE=e=>e.type==="specific",zE=e=>e.type==="hierarchical",WE=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),KE=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Kg=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),YE=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Yg=e=>({displayValue:e.value,value:e.value}),XE=(e,t)=>wd(e,t).map(n=>n.value).join(";"),ZE=(e,t)=>{let n=XE(e,t);return{value:n,valuePosition:1,displayValue:n}},JE=(e,t)=>({title:Xg(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),eR=(e,t)=>({title:Xg(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Xg=(e,t)=>`${e}_${t}`,tR=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,rR=(e,t)=>{let r=tR(e,t);return r?r.type:"specific"};m();d();f();p();m();d();f();p();var Cd=e=>e.configuration.search.locale,Zg=e=>e.configuration.search.timezone,Jg=e=>e.configuration.accessToken,eh=e=>e.configuration.organizationId,th=e=>e.configuration.environment,Ds=e=>e.configuration?.knowledge?.agentId,rh=e=>e.configuration.knowledge.debugAgentSession;var cn=e=>{if(nR(e)||Ed(e))return e.generatedAnswer?.answerId;if(oR(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},nR=e=>"answer"in e&&"generatedAnswer"in e&&!se(e.generatedAnswer?.answerConfigurationId),Ed=e=>{let t=Ds(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},oR=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",Rd=e=>e.generatedAnswer?.fieldsToIncludeInCitations,nh=e=>e.followUpAnswers?.conversationId,iR=e=>e.generatedAnswer?.citations,aR=e=>e.followUpAnswers?.followUpAnswers,sR=Be(aR,e=>e?.flatMap(t=>t.citations)),cR=(e,t)=>t,uR=Be(iR,sR,cR,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));m();d();f();p();var At=()=>({q:"",enableQuerySyntax:!1});m();d();f();p();m();d();f();p();var oh=(r=>(r.Ascending="ascending",r.Descending="descending",r))(oh||{}),ih=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(ih||{}),Id=e=>{if(Wf(e))return e.map(t=>Id(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""}},ah=()=>({by:"relevancy"});var fV=new ne({values:{by:new wl({enum:ih,required:!0}),order:new wl({enum:oh}),field:new z}});function Ms(){return Id(ah())}m();d();f();p();m();d();f();p();var mo=()=>"default";var lR=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},dr=class{constructor(t){ie(this,"getState",t);ie(this,"state");this.state=t()}getLanguage(){return lR(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let s=`context_${i}`;o[s]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Jn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||mo()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var Fi=class Fi extends dr{constructor(){super(...arguments);ie(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 xd(Ad(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Fi.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||$t().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Fi.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=cn(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Ms()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(c=>c.expression),a=o.partialQueries.length-1,s=o.partialQueries[a]||"",u=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:s,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:u}}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||At().q}get responseTime(){return this.state.search?.duration||$t().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||$t().response.totalCountFiltered}};ie(Fi,"fallbackPipelineName","default");var Ir=Fi,sh=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??Et(i.configuration.organizationId,i.configuration.environment,"analytics"),u=i.configuration.analytics.runtimeEnvironment,c=i.configuration.analytics.enabled,g=new Es({token:a,endpoint:s,runtimeEnvironment:u,preprocessRequest:Pi(e,n),beforeSendHooks:[Ni(e,r),(v,E)=>(e.info({...E,type:v,endpoint:s,token:a},"Analytics request"),E)]},o);return c||g.disable(),g},Td=()=>{let t=It.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var qs=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield zg(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}),...(Td()&&{pageId:Td()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:co(e)})}}});return function qs(_x17,_x18){return _ref10.apply(this,arguments)}}();m();d();f();p();m();d();f();p();m();d();f();p();var go=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Di=class extends dr{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:At().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||go().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||go().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||go().recommendations.length}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function ch(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}m();d();f();p();m();d();f();p();m();d();f();p();var uh=/^(?:[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 dR(e){return typeof e=="string"&&uh.test(e)}var _d=dR;m();d();f();p();var nt=[];for(let e=0;e<256;++e)nt.push((e+256).toString(16).slice(1));function lh(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()}m();d();f();p();var kd,pR=new Uint8Array(16);function Od(){if(!kd){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");kd=crypto.getRandomValues.bind(crypto)}return kd(pR)}m();d();f();p();m();d();f();p();var fR=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Pd={randomUUID:fR};function mR(e,t,r){e=e||{};let n=e.random??e.rng?.()??Od();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 lh(n)}function gR(e,t,r){return Pd.randomUUID&&!t&&!e?Pd.randomUUID():mR(e,t,r)}var Nd=gR;function hR(_x19){return _hR.apply(this,arguments)}function _hR(){_hR=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _hR.apply(this,arguments)}var hh="2.1.1",Fd=128,yh=192,dh=224,ph=240,yR=248;function vR(e){return(e&yR)===ph?4:(e&ph)===dh?3:(e&dh)===yh?2:1}function SR(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&Fd)!=Fd)break;if(r-=3,(n&yh)!=Fd){t-r>=vR(n)*3&&(r=t);break}}return e.substring(0,r)}function bR(e){let{trackingId:t}=e;return{trackingId:t}}function wR(e){return(e.source||[]).concat([`relay@${hh}`])}function vh(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=bR(t),s=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:wR(t),clientId:s,userAgent:i(),referrer:fh(n()),location:fh(o())})}function fh(e){return e!==null?SR(e,1024):null}function AR(e,t,r,n){return{...t,meta:vh(e,r,n)}}var xR="*";function CR(){let e=[];function t({type:u,callback:c}){return e.findIndex(g=>g.type===u&&g.callback===c)}function r(u,c){return u.type==="*"||c===u.type}function n(u){return t(u)<0&&e.push(u),()=>s(u.type,u.callback)}function o(u){e.forEach(c=>{if(r(c,u.meta.type))try{c.callback(u)}catch(g){console.error(g)}})}function i(u){if(u===xR)e.length=0;else for(let c=e.length-1;c>=0;c--)e[c].type===u&&e.splice(c,1)}function a(u){let c=t(u);c>=0&&e.splice(c,1)}function s(u,c){c?a({type:u,callback:c}):i(u)}return{add:n,call:o,remove:s}}function mh({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 ER(e){let t=mh(e);return{get:()=>t,update:r=>{t=mh({...t,...r})}}}var Dd=RR();function RR(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function IR(){return{getItem(e){return Dd.getItem(e)||localStorage.getItem(e)},removeItem(e){Dd.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Dd.setItem(e,t,31556952e3)}}}var gh="visitorId";function TR(){let e=document.referrer;return e===""?null:e}function Md(){let e=IR();return{runtime:"browser",send:function(){var _ref11=_asyncToGenerator(function*(t,r,n){let o=A(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});ch().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let s;try{s=yield a.json()}catch{return}for(let u of s.events)if(!u.accepted)throw new Error(`Received event was rejected for processing: ${u.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x20,_x21,_x22){return _ref11.apply(this,arguments)}}(),getReferrer:()=>TR(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(gh);if(t&&_d(t))return t;let r=Nd();return e.setItem(gh,r),r}}}function _R(){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 kR(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function OR(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=kR();return t&&r?{...r,runtime:"custom"}:t&&PR()&&_R()?Md():n}function PR(){try{return typeof window=="object"}catch{return!1}}function NR(e){return{get:()=>Object.freeze(OR(e))}}function Sh(e){let t=ER(e),r=CR(),n=NR(t);return{emit:function(){var _ref12=_asyncToGenerator(function*(o,i){let a=t.get(),s=n.get(),u=AR(o,i,a,s);return hR({config:a,environment:s,event:u,listenerManager:r})});return function emit(_x23,_x24){return _ref12.apply(this,arguments)}}(),getMeta:o=>vh(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:hh}}m();d();f();p();function bh(){return typeof window<"u"&&typeof document<"u"}var Mi=Be(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>co(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,s)=>{let u=DR(s);return Sh({mode:i?"emit":"disabled",url:o??ka(e,t),token:r,trackingId:n??null,source:a,environment:u})}),FR={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref13=_asyncToGenerator(function*(){});return function send(){return _ref13.apply(this,arguments)}}()},DR=e=>{if(!e)return;let t=e();return{...(bh()?Md():FR),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};m();d();f();p();var qi=class extends dr{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},wh=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new qi(t)})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??Et(i.configuration.organizationId,i.configuration.environment,"analytics"),u=i.configuration.analytics.runtimeEnvironment,c=i.configuration.analytics.enabled,g=new _s({enableAnalytics:c,token:a,endpoint:s,runtimeEnvironment:u,preprocessRequest:Pi(e,n),beforeSendHooks:[Ni(e,r),(v,E)=>(e.info({...E,type:v,endpoint:s,token:a},"Analytics request"),E)]},o);return c||g.disable(),g};m();d();f();p();m();d();f();p();function xh(e,t){return{...new Ir(t).getBaseMetadata(),actionCause:e,type:e}}function MR(e){return Object.assign(e,{instantlyCallable:!0})}function qR(e,t){let r=i=>{let a=Ie(e,i);return MR(Object.assign(a,{type:a.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(i,{getState:a,extra:s}){let{analyticsClientMiddleware:u,preprocessRequest:c,logger:g}=s;return yield(yield t({getState:a,analyticsClientMiddleware:u,preprocessRequest:c,logger:g})).log({state:a(),extra:s})});return function(_x25,_x26){return _ref14.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref15=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:u}){let{description:c,log:g}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:u});return{description:c,action:r(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(v,{getState:E,extra:h}){return yield g({state:E(),extra:h})});return function(_x28,_x29){return _ref16.apply(this,arguments)}}())}});return function prepare(_x27){return _ref15.apply(this,arguments)}}()}),n}var Ch=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return UR(i)}return n},jR=e=>e.configuration.analytics.analyticsMode==="legacy",LR=e=>e.configuration.analytics.analyticsMode==="next",UR=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=s=>new a(s)),qR(e,/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*({getState:s,analyticsClientMiddleware:u,preprocessRequest:c,logger:g}){let v=[],E={log:function(){var _ref18=_asyncToGenerator(function*({state:R}){for(let T of v)yield T(R)});return function log(_x31){return _ref18.apply(this,arguments)}}()},h=s(),y=i({getState:s,logger:g,analyticsClientMiddleware:u,preprocessRequest:c,provider:r(s)}),S=yield t(y,s());E.description=S?.description,v.push(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(R){jR(R)&&(yield VR(S,r,R,g,y.coveoAnalyticsClient))});return function(_x32){return _ref19.apply(this,arguments)}}());let{emit:C}=Mi(h);return v.push(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(R){if(LR(R)&&o&&n){let T=n(R);yield WR(C,o,T)}});return function(_x33){return _ref20.apply(this,arguments)}}()),E});return function(_x30){return _ref17.apply(this,arguments)}}()));function VR(_x34,_x35,_x36,_x37,_x38){return _VR.apply(this,arguments)}function _VR(){_VR=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _VR.apply(this,arguments)}var BR=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref21=_asyncToGenerator(function*(i){r(n,o)});return function log(_x39){return _ref21.apply(this,arguments)}}()}),ft=Ch(e=>sh({...e,provider:e.provider||new Ir(e.getState)}),e=>e,Ir),xB=Ch(wh,BR("caseAssist"),qi);var qd=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return GR(e,r,t)};function GR(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:HR(e),...(Ah(e)?{documentCategory:Ah(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:zR(e),queryPipeline:r.pipeline||oo()}}function Ah(e){return e.raw?.objecttype||void 0}var js=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||""}),Eh={urihash:new z,sourcetype:new z,permanentid:new z},Rh={uniqueId:Y,raw:new ne({values:Eh}),title:Y,uri:Y,clickUri:Y,rankingModifier:new z({required:!1,emptyAllowed:!0})};function $R(e){return Object.assign({},...Object.keys(Eh).map(t=>({[t]:e[t]})))}function QR(e){return Object.assign({},...Object.keys(Rh).map(t=>({[t]:e[t]})),{raw:$R(e.raw)})}function HR(e){let t=e.raw.author;return se(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function zR(e){let t=e.raw.source;return se(t)?"unknown":t}var jd=e=>new mt(Rh).validate(QR(e));function WR(_x40,_x41,_x42){return _WR.apply(this,arguments)}function _WR(){_WR=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _WR.apply(this,arguments)}m();d();f();p();var Ih=()=>ft("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Di(e)),Th=()=>({actionCause:"recommendationInterfaceLoad"}),Us=e=>ft({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(jd(e),t.makeRecommendationOpen(qd(e,r),js(e))),__legacy__provider:t=>new Di(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=qd(e,t),n=js(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var ho=O("recommendation/set",e=>B(e,{id:Y})),Tr=Ie("recommendation/get",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield KR(o),s=yield n.recommendations(a),u=Date.now()-i;return gt(s)?r(s.error):{recommendations:s.success.results,analyticsAction:Ih(),duration:u,searchUid:s.success.searchUid,splitTestRun:s.success.splitTestRun,pipeline:s.success.pipeline}});return function(_x43,_x44){return _ref22.apply(this,arguments)}}()),KR=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??br(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?It.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield YR(e,Th()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function KR(_x45){return _ref23.apply(this,arguments)}}(),YR=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield qs(e.configuration.analytics,r)});return function YR(_x46,_x47){return _ref24.apply(this,arguments)}}();var yo=Ue(go(),e=>{e.addCase(ho,(t,r)=>{t.id=r.payload.id}).addCase(Tr.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(Tr.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(Tr.pending,t=>{t.isLoading=!0}).addCase(fs,(t,r)=>{t.error=r.payload,t.isLoading=!1})});m();d();f();p();var vo=O("searchHub/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();var So=Ue(mo(),e=>{e.addCase(vo,(t,r)=>r.payload).addCase(ht.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Wt,(t,r)=>r.payload.searchHub||t)});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var _h=class extends Error{constructor(t){super(t[0].message);ie(this,"issues");this.name="SchemaError",this.issues=t}};var fr="uninitialized",Vd="pending",Li="fulfilled",Ui="rejected";function kh(e){return{status:e,isUninitialized:e===fr,isLoading:e===Vd,isSuccess:e===Li,isError:e===Ui}}var Oh=Qt;function Qh(e,t){if(e===t||!(Oh(e)&&Oh(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Qh(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function Bd(e,t,r){return e.reduce((n,o,i)=>(t(o,i)&&n.push(r(o,i)),n),[]).flat()}function XR(e){return new RegExp("(^|:)//").test(e)}function ZR(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Hd(e){return e!=null}function Ph(e){return[...(e?.values()??[])].filter(Hd)}function JR(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var eI=e=>e.replace(/\/$/,""),tI=e=>e.replace(/^\//,"");function rI(e,t){if(!e)return t;if(!t)return e;if(XR(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=eI(e),t=tI(t),`${e}${r}${t}`}function Gs(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Gd=()=>new Map,nI=e=>{let t=new l.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},oI=(...e)=>{for(let r of e)if(r.aborted)return l.AbortSignal.abort(r.reason);let t=new l.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},Nh=(...e)=>A(...e),iI=e=>e.status>=200&&e.status<=299,aI=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Fh(e){if(!Qt(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var sI=e=>typeof e=="object"&&(Qt(e)||Array.isArray(e)||typeof e.toJSON=="function");function Hh({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=Nh,paramsSerializer:n,isJsonContentType:o=aI,jsonContentType:i="application/json",jsonReplacer:a,timeout:s,responseHandler:u,validateStatus:c,...g}={}){return typeof A>"u"&&r===Nh&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(E,h,y){let{getState:S,extra:C,endpoint:R,forced:T,type:I}=h,k,{url:_,headers:D=new x(g.headers),params:G=void 0,responseHandler:L=u??"json",validateStatus:j=c??iI,timeout:V=s,...q}=typeof E=="string"?{url:E}:E,P={...g,signal:V?oI(h.signal,nI(V)):h.signal,...q};D=new x(Fh(D)),P.headers=(yield t(D,{getState:S,arg:E,extra:C,endpoint:R,forced:T,type:I,extraOptions:y}))||D;let N=sI(P.body);if(P.body!=null&&!N&&typeof P.body!="string"&&P.headers.delete("content-type"),!P.headers.has("content-type")&&N&&P.headers.set("content-type",i),N&&o(P.headers)&&(P.body=JSON.stringify(P.body,a)),P.headers.has("accept")||(L==="json"?P.headers.set("accept","application/json"):L==="text"&&P.headers.set("accept","text/plain, text/html, */*")),G){let te=~_.indexOf("?")?"&":"?",ue=n?n(G):new URLSearchParams(Fh(G));_+=te+ue}_=rI(e,_);let F=new Request(_,P);k={request:new Request(_,P)};let Q;try{Q=yield r(F)}catch(te){return{error:{status:(te instanceof Error||typeof DOMException<"u"&&te instanceof DOMException)&&te.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(te)},meta:k}}let Z=Q.clone();k.response=Z;let X,W="";try{let te;if(yield Promise.all([v(Q,L).then(ue=>X=ue,ue=>te=ue),Z.text().then(ue=>W=ue,()=>{})]),te)throw te}catch(te){return{error:{status:"PARSING_ERROR",originalStatus:Q.status,data:W,error:String(te)},meta:k}}return j(Q,X)?{data:X,meta:k}:{error:{status:Q.status,data:X},meta:k}});return function(_x48,_x49,_x50){return _ref25.apply(this,arguments)}}());function v(_x51,_x52){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(E,h){if(typeof h=="function")return h(E);if(h==="content-type"&&(h=o(E.headers)?"json":"text"),h==="json"){let y=yield E.text();return y.length?JSON.parse(y):null}return E.text()});return _v2.apply(this,arguments)}}var bo=class{constructor(e,t=void 0){ie(this,"value");ie(this,"meta");this.value=e,this.meta=t}};function cI(){return _cI.apply(this,arguments)}function _cI(){_cI=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((i,a)=>{let s=setTimeout(()=>i(),o);if(r){let u=()=>{clearTimeout(s),a(new Error("Aborted"))};r.aborted?(clearTimeout(s),a(new Error("Aborted"))):r.addEventListener("abort",u,{once:!0})}})});return _cI.apply(this,arguments)}function zh(e,t){throw Object.assign(new bo({error:e,meta:t}),{throwImmediately:!0})}function Ld(e){e.aborted&&zh({status:"CUSTOM_ERROR",error:"Aborted"})}var Dh={},uI=(e,t)=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Dh).maxRetries,(o||Dh).maxRetries].filter(g=>g!==void 0),[a]=i.slice(-1),u={maxRetries:a,backoff:cI,retryCondition:(g,v,{attempt:E})=>E<=a,...t,...o},c=0;for(;;){Ld(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new bo(g);return g}catch(g){if(c++,g.throwImmediately){if(g instanceof bo)return g.value;throw g}if(g instanceof bo){if(!u.retryCondition(g.value.error,r,{attempt:c,baseQueryApi:n,extraOptions:o}))return g.value}else if(c>u.maxRetries)return{error:g};Ld(n.signal);try{yield u.backoff(c,u.maxRetries,n.signal)}catch(v){throw Ld(n.signal),v}}}});return function(_x53,_x54,_x55){return _ref26.apply(this,arguments)}}()),Wh=Object.assign(uI,{fail:zh}),Qs="__rtkq/",lI="online",dI="offline";var Kh="focused";var zd=O(`${Qs}${Kh}`),Yh=O(`${Qs}un${Kh}`),Wd=O(`${Qs}${lI}`),Xh=O(`${Qs}${dI}`);var Gi="query",Zh="mutation",Jh="infinitequery";function Hs(e){return e.type===Gi}function pI(e){return e.type===Zh}function zs(e){return e.type===Jh}function $s(e){return Hs(e)||zs(e)}function Kd(e,t,r,n,o,i){let a=fI(e)?e(t,r,n,o):e;return a?Bd(a,Hd,s=>i(ey(s))):[]}function fI(e){return typeof e=="function"}function ey(e){return typeof e=="string"?{type:e}:e}function mI(e,t){return e.catch(t)}var wo=(e,t)=>e.endpointDefinitions[t],Vi=Symbol("forceQueryFn"),$d=e=>typeof e[Vi]=="function";function gI({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i,getInternalState:a}){let s=_=>a(_)?.runningQueries,u=_=>a(_)?.runningMutations,{unsubscribeQueryResult:c,removeMutationResult:g,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:T,buildInitiateInfiniteQuery:I,buildInitiateMutation:k,getRunningQueryThunk:E,getRunningMutationThunk:h,getRunningQueriesThunk:y,getRunningMutationsThunk:S};function E(_,D){return G=>{let L=wo(i,_),j=e({queryArgs:D,endpointDefinition:L,endpointName:_});return s(G)?.get(j)}}function h(_,D){return G=>u(G)?.get(D)}function y(){return _=>Ph(s(_))}function S(){return _=>Ph(u(_))}function C(_){}function R(_,D){let G=(L,{subscribe:j=!0,forceRefetch:V,subscriptionOptions:q,[Vi]:P,...N}={})=>(F,H)=>{let Q=e({queryArgs:L,endpointDefinition:D,endpointName:_}),Z,X={...N,type:Gi,subscribe:j,forceRefetch:V,subscriptionOptions:q,endpointName:_,originalArgs:L,queryCacheKey:Q,[Vi]:P};if(Hs(D))Z=t(X);else{let{direction:fe,initialPageParam:be,refetchCachedPages:he}=N;Z=r({...X,direction:fe,initialPageParam:be,refetchCachedPages:he})}let W=o.endpoints[_].select(L),te=F(Z),ue=W(H());let{requestId:Ee,abort:Me}=te,ke=ue.requestId!==Ee,Pe=s(F)?.get(Q),Ne=()=>W(H()),ge=Object.assign(P?te.then(Ne):ke&&!Pe?Promise.resolve(ue):Promise.all([Pe,te]).then(Ne),{arg:L,requestId:Ee,subscriptionOptions:q,queryCacheKey:Q,abort:Me,unwrap(){return _asyncToGenerator(function*(){let fe=yield ge;if(fe.isError)throw fe.error;return fe.data})()},refetch:fe=>F(G(L,{subscribe:!1,forceRefetch:!0,...fe})),unsubscribe(){j&&F(c({queryCacheKey:Q,requestId:Ee}))},updateSubscriptionOptions(fe){ge.subscriptionOptions=fe,F(v({endpointName:_,requestId:Ee,queryCacheKey:Q,options:fe}))}});if(!Pe&&!ke&&!P){let fe=s(F);fe.set(Q,ge),ge.then(()=>{fe.delete(Q)})}return ge};return G}function T(_,D){return R(_,D)}function I(_,D){return R(_,D)}function k(_){return(D,{track:G=!0,fixedCacheKey:L}={})=>(j,V)=>{let q=n({type:"mutation",endpointName:_,originalArgs:D,track:G,fixedCacheKey:L}),P=j(q);let{requestId:N,abort:F,unwrap:H}=P,Q=mI(P.unwrap().then(te=>({data:te})),te=>({error:te})),Z=()=>{j(g({requestId:N,fixedCacheKey:L}))},X=Object.assign(Q,{arg:P.arg,requestId:N,abort:F,unwrap:H,reset:Z}),W=u(j);return W.set(N,X),X.then(()=>{W.delete(N)}),L&&(W.set(L,X),X.then(()=>{W.get(L)===X&&W.delete(L)})),X}}}var ty=class extends _h{constructor(t,r,n,o){super(t);ie(this,"value");ie(this,"schemaName");ie(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},un=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function ln(_x56,_x57,_x58,_x59){return _ln.apply(this,arguments)}function _ln(){_ln=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new ty(o.issues,t,r,n);return o.value});return _ln.apply(this,arguments)}function Mh(e){return e}var ji=(e={})=>({...e,[Ei]:!0});function hI({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a,onSchemaFailure:s,catchSchemaFailure:u,skipSchemaValidation:c}){let g=(q,P,N,F)=>(H,Q)=>{let Z=r[q],X=n({queryArgs:P,endpointDefinition:Z,endpointName:q});if(H(o.internalActions.queryResultPatched({queryCacheKey:X,patches:N})),!F)return;let W=o.endpoints[q].select(P)(Q()),te=Kd(Z.providesTags,W.data,void 0,P,{},i);H(o.internalActions.updateProvidedBy([{queryCacheKey:X,providedTags:te}]))};function v(q,P,N=0){let F=[P,...q];return N&&F.length>N?F.slice(0,-1):F}function E(q,P,N=0){let F=[...q,P];return N&&F.length>N?F.slice(1):F}let h=(q,P,N,F=!0)=>(H,Q)=>{let X=o.endpoints[q].select(P)(Q()),W={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(q,P,W.inversePatches,F))};if(X.status===fr)return W;let te;if("data"in X)if(dt(X.data)){let[ue,Ee,Me]=Ql(X.data,N);W.patches.push(...Ee),W.inversePatches.push(...Me),te=ue}else te=N(X.data),W.patches.push({op:"replace",path:[],value:te}),W.inversePatches.push({op:"replace",path:[],value:X.data});return W.patches.length===0||H(o.util.patchQueryData(q,P,W.patches,F)),W},y=(q,P,N)=>F=>F(o.endpoints[q].initiate(P,{subscribe:!1,forceRefetch:!0,[Vi]:()=>({data:N})})),S=(q,P)=>q.query&&q[P]?q[P]:Mh,C=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(q,{signal:P,abort:N,rejectWithValue:F,fulfillWithValue:H,dispatch:Q,getState:Z,extra:X}){let W=r[q.endpointName],{metaSchema:te,skipSchemaValidation:ue=c}=W,Ee=q.type===Gi;try{let Me=Mh,ke={signal:P,abort:N,dispatch:Q,getState:Z,extra:X,endpoint:q.endpointName,type:q.type,forced:Ee?R(q,Z()):void 0,queryCacheKey:Ee?q.queryCacheKey:void 0},Pe=Ee?q[Vi]:void 0,Ne,ge=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(be,he,$e,He){if(he==null&&be.pages.length)return Promise.resolve({data:be});let Ft={queryArg:q.originalArgs,pageParam:he},bt=yield fe(Ft),Bt=He?v:E;return{data:{pages:Bt(be.pages,bt.data,$e),pageParams:Bt(be.pageParams,he,$e)},meta:bt.meta}});return function ge(_x62,_x63,_x64,_x65){return _ref28.apply(this,arguments)}}();function fe(_x66){return _fe.apply(this,arguments)}function _fe(){_fe=_asyncToGenerator(function*(be){let he,{extraOptions:$e,argSchema:He,rawResponseSchema:Ft,responseSchema:bt}=W;if(He&&!un(ue,"arg")&&(be=yield ln(He,be,"argSchema",{})),Pe?he=Pe():W.query?(Me=S(W,"transformResponse"),he=yield t(W.query(be),ke,$e)):he=yield W.queryFn(be,ke,$e,Dt=>t(Dt,ke,$e)),typeof process<"u",he.error)throw new bo(he.error,he.meta);let{data:Bt}=he;Ft&&!un(ue,"rawResponse")&&(Bt=yield ln(Ft,he.data,"rawResponseSchema",he.meta));let Ct=yield Me(Bt,he.meta,be);return bt&&!un(ue,"response")&&(Ct=yield ln(bt,Ct,"responseSchema",he.meta)),{...he,data:Ct}});return _fe.apply(this,arguments)}if(Ee&&"infiniteQueryOptions"in W){let{infiniteQueryOptions:be}=W,{maxPages:he=1/0}=be,$e=q.refetchCachedPages??be.refetchCachedPages??!0,He,Ft={pages:[],pageParams:[]},bt=a.selectQueryEntry(Z(),q.queryCacheKey)?.data,Ct=R(q,Z())&&!q.direction||!bt?Ft:bt;if("direction"in q&&q.direction&&Ct.pages.length){let Dt=q.direction==="backward",wa=(Dt?ry:Qd)(be,Ct,q.originalArgs);He=yield ge(Ct,wa,he,Dt)}else{let{initialPageParam:Dt=be.initialPageParam}=q,Jo=bt?.pageParams??[],wa=Jo[0]??Dt,Vw=Jo.length;if(He=yield ge(Ct,wa,he),Pe&&(He={data:He.data.pages[0]}),$e)for(let _f=1;_f<Vw;_f++){let Bw=Qd(be,He.data,q.originalArgs);He=yield ge(He.data,Bw,he)}}Ne=He}else Ne=yield fe(q.originalArgs);return te&&!un(ue,"meta")&&Ne.meta&&(Ne.meta=yield ln(te,Ne.meta,"metaSchema",Ne.meta)),H(Ne.data,ji({fulfilledTimeStamp:Date.now(),baseQueryMeta:Ne.meta}))}catch(Me){let ke=Me;if(ke instanceof bo){let Pe=S(W,"transformErrorResponse"),{rawErrorResponseSchema:Ne,errorResponseSchema:ge}=W,{value:fe,meta:be}=ke;try{Ne&&!un(ue,"rawErrorResponse")&&(fe=yield ln(Ne,fe,"rawErrorResponseSchema",be)),te&&!un(ue,"meta")&&(be=yield ln(te,be,"metaSchema",be));let he=yield Pe(fe,be,q.originalArgs);return ge&&!un(ue,"errorResponse")&&(he=yield ln(ge,he,"errorResponseSchema",be)),F(he,ji({baseQueryMeta:be}))}catch(he){ke=he}}try{if(ke instanceof ty){let Pe={endpoint:q.endpointName,arg:q.originalArgs,type:q.type,queryCacheKey:Ee?q.queryCacheKey:void 0};W.onSchemaFailure?.(ke,Pe),s?.(ke,Pe);let{catchSchemaFailure:Ne=u}=W;if(Ne)return F(Ne(ke,Pe),ji({baseQueryMeta:ke._bqMeta}))}}catch(Pe){ke=Pe}throw typeof process<"u",console.error(ke),ke}});return function C(_x60,_x61){return _ref27.apply(this,arguments)}}();function R(q,P){let N=a.selectQueryEntry(P,q.queryCacheKey),F=a.selectConfig(P).refetchOnMountOrArgChange,H=N?.fulfilledTimeStamp,Q=q.forceRefetch??(q.subscribe&&F);return Q?Q===!0||(Number(new Date)-Number(H))/1e3>=Q:!1}let T=()=>Ie(`${e}/executeQuery`,C,{getPendingMeta({arg:P}){let N=r[P.endpointName];return ji({startedTimeStamp:Date.now(),...(zs(N)?{direction:P.direction}:{})})},condition(P,{getState:N}){let F=N(),H=a.selectQueryEntry(F,P.queryCacheKey),Q=H?.fulfilledTimeStamp,Z=P.originalArgs,X=H?.originalArgs,W=r[P.endpointName],te=P.direction;return $d(P)?!0:H?.status==="pending"?!1:R(P,F)||Hs(W)&&W?.forceRefetch?.({currentArg:Z,previousArg:X,endpointState:H,state:F})?!0:!(Q&&!te)},dispatchConditionRejection:!0}),I=T(),k=T(),_=Ie(`${e}/executeMutation`,C,{getPendingMeta(){return ji({startedTimeStamp:Date.now()})}}),D=q=>"force"in q,G=q=>"ifOlderThan"in q,L=(q,P,N={})=>(F,H)=>{let Q=D(N)&&N.force,Z=G(N)&&N.ifOlderThan,X=(te=!0)=>{let ue={forceRefetch:te,subscribe:!1};return o.endpoints[q].initiate(P,ue)},W=o.endpoints[q].select(P)(H());if(Q)F(X());else if(Z){let te=W?.fulfilledTimeStamp;if(!te){F(X());return}(Number(new Date)-Number(new Date(te)))/1e3>=Z&&F(X())}else F(X(!1))};function j(q){return P=>P?.meta?.arg?.endpointName===q}function V(q,P){return{matchPending:Xn(rs(q),j(P)),matchFulfilled:Xn(sr(q),j(P)),matchRejected:Xn(nn(q),j(P))}}return{queryThunk:I,mutationThunk:_,infiniteQueryThunk:k,prefetch:L,updateQueryData:h,upsertQueryData:y,patchQueryData:g,buildMatchThunkActions:V}}function Qd(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function ry(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function ny(e,t,r,n){return Kd(r[e.meta.arg.endpointName][t],sr(e)?e.payload:void 0,Ii(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function qh(e){return lt(e)?Ka(e):e}function Vs(e,t,r){let n=e[t];n&&r(n)}function Bi(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function jh(e,t,r){let n=e[Bi(t)];n&&r(n)}var Bs={};function yI({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:u,config:c}){let g=O(`${e}/resetApiState`);function v(j,V,q,P){var N;j[N=V.queryCacheKey]??(j[N]={status:fr,endpointName:V.endpointName}),Vs(j,V.queryCacheKey,F=>{F.status=Vd,F.requestId=q&&F.requestId?F.requestId:P.requestId,V.originalArgs!==void 0&&(F.originalArgs=V.originalArgs),F.startedTimeStamp=P.startedTimeStamp;let H=o[P.arg.endpointName];zs(H)&&"direction"in V&&(F.direction=V.direction)})}function E(j,V,q,P){Vs(j,V.arg.queryCacheKey,N=>{if(N.requestId!==V.requestId&&!P)return;let{merge:F}=o[V.arg.endpointName];if(N.status=Li,F){if(N.data!==void 0){let{fulfilledTimeStamp:H,arg:Q,baseQueryMeta:Z,requestId:X}=V,W=tn(N.data,te=>F(te,q,{arg:Q.originalArgs,baseQueryMeta:Z,fulfilledTimeStamp:H,requestId:X}));N.data=W}else N.data=q;}else N.data=o[V.arg.endpointName].structuralSharing??!0?Qh(lt(N.data)?Im(N.data):N.data,q):q;delete N.error,N.fulfilledTimeStamp=V.fulfilledTimeStamp})}let h=on({name:`${e}/queries`,initialState:Bs,reducers:{removeQueryResult:{reducer(j,{payload:{queryCacheKey:V}}){delete j[V]},prepare:Zn()},cacheEntriesUpserted:{reducer(j,V){for(let q of V.payload){let{queryDescription:P,value:N}=q;v(j,P,!0,{arg:P,requestId:V.meta.requestId,startedTimeStamp:V.meta.timestamp}),E(j,{arg:P,requestId:V.meta.requestId,fulfilledTimeStamp:V.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:j=>({payload:j.map(P=>{let{endpointName:N,arg:F,value:H}=P,Q=o[N];return{queryDescription:{type:Gi,endpointName:N,originalArgs:P.arg,queryCacheKey:n({queryArgs:F,endpointDefinition:Q,endpointName:N})},value:H}}),meta:{[Ei]:!0,requestId:Ti(),timestamp:Date.now()}})},queryResultPatched:{reducer(j,{payload:{queryCacheKey:V,patches:q}}){Vs(j,V,P=>{P.data=Hl(P.data,q.concat())})},prepare:Zn()}},extraReducers(j){j.addCase(t.pending,(V,{meta:q,meta:{arg:P}})=>{let N=$d(P);v(V,P,N,q)}).addCase(t.fulfilled,(V,{meta:q,payload:P})=>{let N=$d(q.arg);E(V,q,P,N)}).addCase(t.rejected,(V,{meta:{condition:q,arg:P,requestId:N},error:F,payload:H})=>{Vs(V,P.queryCacheKey,Q=>{if(!q){if(Q.requestId!==N)return;Q.status=Ui,Q.error=H??F}})}).addMatcher(s,(V,q)=>{let{queries:P}=a(q);for(let[N,F]of Object.entries(P))(F?.status===Li||F?.status===Ui)&&(V[N]=F)})}}),y=on({name:`${e}/mutations`,initialState:Bs,reducers:{removeMutationResult:{reducer(j,{payload:V}){let q=Bi(V);q in j&&delete j[q]},prepare:Zn()}},extraReducers(j){j.addCase(r.pending,(V,{meta:q,meta:{requestId:P,arg:N,startedTimeStamp:F}})=>{N.track&&(V[Bi(q)]={requestId:P,status:Vd,endpointName:N.endpointName,startedTimeStamp:F})}).addCase(r.fulfilled,(V,{payload:q,meta:P})=>{P.arg.track&&jh(V,P,N=>{N.requestId===P.requestId&&(N.status=Li,N.data=q,N.fulfilledTimeStamp=P.fulfilledTimeStamp)})}).addCase(r.rejected,(V,{payload:q,error:P,meta:N})=>{N.arg.track&&jh(V,N,F=>{F.requestId===N.requestId&&(F.status=Ui,F.error=q??P)})}).addMatcher(s,(V,q)=>{let{mutations:P}=a(q);for(let[N,F]of Object.entries(P))(F?.status===Li||F?.status===Ui)&&N!==F?.requestId&&(V[N]=F)})}}),S={tags:{},keys:{}},C=on({name:`${e}/invalidation`,initialState:S,reducers:{updateProvidedBy:{reducer(j,V){var q,P,N;for(let{queryCacheKey:F,providedTags:H}of V.payload){R(j,F);for(let{type:Q,id:Z}of H){let X=(P=(q=j.tags)[Q]??(q[Q]={}))[N=Z||"__internal_without_id"]??(P[N]=[]);X.includes(F)||X.push(F)}j.keys[F]=H}},prepare:Zn()}},extraReducers(j){j.addCase(h.actions.removeQueryResult,(V,{payload:{queryCacheKey:q}})=>{R(V,q)}).addMatcher(s,(V,q)=>{var N,F,H;let{provided:P}=a(q);for(let[Q,Z]of Object.entries(P.tags??{}))for(let[X,W]of Object.entries(Z)){let te=(F=(N=V.tags)[Q]??(N[Q]={}))[H=X||"__internal_without_id"]??(F[H]=[]);for(let ue of W)te.includes(ue)||te.push(ue),V.keys[ue]=P.keys[ue]}}).addMatcher(zt(sr(t),Ii(t)),(V,q)=>{T(V,[q])}).addMatcher(h.actions.cacheEntriesUpserted.match,(V,q)=>{let P=q.payload.map(({queryDescription:N,value:F})=>({type:"UNKNOWN",payload:F,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));T(V,P)})}});function R(j,V){let q=qh(j.keys[V]??[]);for(let P of q){let N=P.type,F=P.id??"__internal_without_id",H=j.tags[N]?.[F];H&&(j.tags[N][F]=qh(H).filter(Q=>Q!==V))}delete j.keys[V]}function T(j,V){let q=V.map(P=>{let N=ny(P,"providesTags",o,u),{queryCacheKey:F}=P.meta.arg;return{queryCacheKey:F,providedTags:N}});C.caseReducers.updateProvidedBy(j,C.actions.updateProvidedBy(q))}let I=on({name:`${e}/subscriptions`,initialState:Bs,reducers:{updateSubscriptionOptions(j,V){},unsubscribeQueryResult(j,V){},internal_getRTKQSubscriptions(){}}}),k=on({name:`${e}/internalSubscriptions`,initialState:Bs,reducers:{subscriptionsUpdated:{reducer(j,V){return Hl(j,V.payload)},prepare:Zn()}}}),_=on({name:`${e}/config`,initialState:{online:JR(),focused:ZR(),middlewareRegistered:!1,...c},reducers:{middlewareRegistered(j,{payload:V}){j.middlewareRegistered=j.middlewareRegistered==="conflict"||i!==V?"conflict":!0}},extraReducers:j=>{j.addCase(Wd,V=>{V.online=!0}).addCase(Xh,V=>{V.online=!1}).addCase(zd,V=>{V.focused=!0}).addCase(Yh,V=>{V.focused=!1}).addMatcher(s,V=>({...V}))}}),D=zn({queries:h.reducer,mutations:y.reducer,provided:C.reducer,subscriptions:k.reducer,config:_.reducer}),G=(j,V)=>D(g.match(V)?void 0:j,V),L={..._.actions,...h.actions,...I.actions,...k.actions,...y.actions,...C.actions,resetApiState:g};return{reducer:G,actions:L}}var Ud=Symbol.for("RTKQ/skipToken"),oy={status:fr},Lh=tn(oy,()=>{}),Uh=tn(oy,()=>{});function vI({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>Lh,o=I=>Uh;return{buildQuerySelector:E,buildInfiniteQuerySelector:h,buildMutationSelector:y,selectInvalidatedBy:S,selectCachedArgsForQuery:C,selectApiState:a,selectQueries:s,selectMutations:c,selectQueryEntry:u,selectConfig:g};function i(I){return{...I,...kh(I.status)}}function a(I){return I[t]}function s(I){return a(I)?.queries}function u(I,k){return s(I)?.[k]}function c(I){return a(I)?.mutations}function g(I){return a(I)?.config}function v(I,k,_){return D=>{if(D===Ud)return r(n,_);let G=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(j=>u(j,G)??Lh,_)}}function E(I,k){return v(I,k,i)}function h(I,k){let{infiniteQueryOptions:_}=k;function D(G){let L={...G,...kh(G.status)},{isLoading:j,isError:V,direction:q}=L,P=q==="forward",N=q==="backward";return{...L,hasNextPage:R(_,L.data,L.originalArgs),hasPreviousPage:T(_,L.data,L.originalArgs),isFetchingNextPage:j&&P,isFetchingPreviousPage:j&&N,isFetchNextPageError:V&&P,isFetchPreviousPageError:V&&N}}return v(I,k,D)}function y(){return I=>{let k;return typeof I=="object"?k=Bi(I)??Ud:k=I,r(k===Ud?o:G=>a(G)?.mutations?.[k]??Uh,i)}}function S(I,k){let _=I[t],D=new Set,G=Bd(k,Hd,ey);for(let L of G){let j=_.provided.tags[L.type];if(!j)continue;let V=(L.id!==void 0?j[L.id]:Object.values(j).flat())??[];for(let q of V)D.add(q)}return Array.from(D.values()).flatMap(L=>{let j=_.queries[L];return j?{queryCacheKey:L,endpointName:j.endpointName,originalArgs:j.originalArgs}:[]})}function C(I,k){return Bd(Object.values(s(I)),_=>_?.endpointName===k&&_.status!==fr,_=>_.originalArgs)}function R(I,k,_){return k?Qd(I,k,_)!=null:!1}function T(I,k,_){return!k||!I.getPreviousPageParam?!1:ry(I,k,_)!=null}}var Vh=WeakMap?new WeakMap:void 0,Bh=({endpointName:e,queryArgs:t})=>{let r="",n=Vh?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Qt(a)?Object.keys(a).sort().reduce((s,u)=>(s[u]=a[u],s),{}):a,a));Qt(t)&&Vh?.set(t,o),r=o}return`${e}(${r})`};function SI(...e){return function(r){let n=xi(c=>r.extractRehydrationInfo?.(c,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(c){let g=Bh;if("serializeQueryArgs"in c.endpointDefinition){let v=c.endpointDefinition.serializeQueryArgs;g=E=>{let h=v(E);return typeof h=="string"?h:Bh({...E,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(c)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(c){c()},apiUid:Ti(),extractRehydrationInfo:n,hasRehydrationInfo:xi(c=>n(c)!=null)},a={injectEndpoints:u,enhanceEndpoints({addTagTypes:c,endpoints:g}){if(c)for(let v of c)o.tagTypes.includes(v)||o.tagTypes.push(v);if(g)for(let[v,E]of Object.entries(g))typeof E=="function"?E(wo(i,v)):Object.assign(wo(i,v)||{},E);return a}},s=e.map(c=>c.init(a,o,i));function u(c){let g=c.endpoints({query:v=>({...v,type:Gi}),mutation:v=>({...v,type:Zh}),infiniteQuery:v=>({...v,type:Jh})});for(let[v,E]of Object.entries(g)){if(c.overrideExisting!==!0&&v in i.endpointDefinitions){if(c.overrideExisting==="throw")throw new Error(pt(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[v]=E;for(let h of s)h.injectEndpoint(v,E)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function pr(e,...t){return Object.assign(e,...t)}var bI=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,i=null,a=null,{updateSubscriptionOptions:s,unsubscribeQueryResult:u}=e.internalActions,c=(S,C)=>{if(s.match(C)){let{queryCacheKey:T,requestId:I,options:k}=C.payload,_=S.get(T);return _?.has(I)&&_.set(I,k),!0}if(u.match(C)){let{queryCacheKey:T,requestId:I}=C.payload,k=S.get(T);return k&&k.delete(I),!0}if(e.internalActions.removeQueryResult.match(C))return S.delete(C.payload.queryCacheKey),!0;if(t.pending.match(C)){let{meta:{arg:T,requestId:I}}=C,k=Gs(S,T.queryCacheKey,Gd);return T.subscribe&&k.set(I,T.subscriptionOptions??k.get(I)??{}),!0}let R=!1;if(t.rejected.match(C)){let{meta:{condition:T,arg:I,requestId:k}}=C;if(T&&I.subscribe){let _=Gs(S,I.queryCacheKey,Gd);_.set(k,I.subscriptionOptions??_.get(k)??{}),R=!0}}return R},g=()=>r.currentSubscriptions,h={getSubscriptions:g,getSubscriptionCount:S=>g().get(S)?.size??0,isRequestSubscribed:(S,C)=>!!g()?.get(S)?.get(C)};function y(S){return JSON.parse(JSON.stringify(Object.fromEntries([...S].map(([C,R])=>[C,Object.fromEntries(R)]))))}return(S,C)=>{if(i||(i=y(r.currentSubscriptions)),e.util.resetApiState.match(S))return i={},r.currentSubscriptions.clear(),a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(S))return[!1,h];let R=c(r.currentSubscriptions,S),T=!0;if(R){a||(a=setTimeout(()=>{let _=y(r.currentSubscriptions),[,D]=Ql(i,()=>_);C.next(e.internalActions.subscriptionsUpdated(D)),i=_,a=null},500));let I=typeof S.type=="string"&&!!S.type.startsWith(o),k=t.rejected.match(S)&&S.meta.condition&&!!S.meta.arg.subscribe;T=!I&&!k}return[T,!1]}},wI=2147483647/1e3-1,AI=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a},getRunningQueryThunk:s,mwApi:u})=>{let{removeQueryResult:c,unsubscribeQueryResult:g,cacheEntriesUpserted:v}=t.internalActions,E=zt(g.match,r.fulfilled,r.rejected,v.match);function h(I){let k=o.currentSubscriptions.get(I);return k?k.size>0:!1}let y={};function S(I){for(let k of I.values())k?.abort?.()}let C=(I,k)=>{let _=k.getState(),D=a(_);if(E(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(y))L&&clearTimeout(L),delete y[G];S(o.runningQueries),S(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:G}=n.extractRehydrationInfo(I);R(Object.keys(G),k,D)}};function R(I,k,_){let D=k.getState();for(let G of I){let L=i(D,G);L?.endpointName&&T(G,L.endpointName,k,_)}}function T(I,k,_,D){let L=wo(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let j=Math.max(0,Math.min(L,wI));if(!h(I)){let V=y[I];V&&clearTimeout(V),y[I]=setTimeout(()=>{if(!h(I)){let q=i(_.getState(),I);q?.endpointName&&_.dispatch(s(q.endpointName,q.originalArgs))?.abort(),_.dispatch(c({queryCacheKey:I}))}delete y[I]},j*1e3)}}return C},Gh=new Error("Promise never resolved before cacheEntryRemoved."),xI=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:s}})=>{let u=ns(n),c=ns(o),g=sr(n,o),v={},{removeQueryResult:E,removeMutationResult:h,cacheEntriesUpserted:y}=e.internalActions;function S(_,D,G){let L=v[_];L?.valueResolved&&(L.valueResolved({data:D,meta:G}),delete L.valueResolved)}function C(_){let D=v[_];D&&(delete v[_],D.cacheEntryRemoved())}function R(_){let{arg:D,requestId:G}=_.meta,{endpointName:L,originalArgs:j}=D;return[L,j,G]}let T=(_,D,G)=>{let L=I(_);function j(V,q,P,N){let F=a(G,q),H=a(D.getState(),q);!F&&H&&k(V,N,q,D,P)}if(n.pending.match(_)){let[V,q,P]=R(_);j(V,L,P,q)}else if(y.match(_))for(let{queryDescription:V,value:q}of _.payload){let{endpointName:P,originalArgs:N,queryCacheKey:F}=V;j(P,F,_.meta.requestId,N),S(F,q,{})}else if(o.pending.match(_)){if(D.getState()[t].mutations[L]){let[q,P,N]=R(_);k(q,P,L,D,N)}}else if(g(_))S(L,_.payload,_.meta.baseQueryMeta);else if(E.match(_)||h.match(_))C(L);else if(e.util.resetApiState.match(_))for(let V of Object.keys(v))C(V)};function I(_){return u(_)?_.meta.arg.queryCacheKey:c(_)?_.meta.arg.fixedCacheKey??_.meta.requestId:E.match(_)?_.payload.queryCacheKey:h.match(_)?Bi(_.payload):""}function k(_,D,G,L,j){let V=wo(r,_),q=V?.onCacheEntryAdded;if(!q)return;let P={},N=new Promise(W=>{P.cacheEntryRemoved=W}),F=Promise.race([new Promise(W=>{P.valueResolved=W}),N.then(()=>{throw Gh})]);F.catch(()=>{}),v[G]=P;let H=e.endpoints[_].select($s(V)?D:G),Q=L.dispatch((W,te,ue)=>ue),Z={...L,getCacheEntry:()=>H(L.getState()),requestId:j,extra:Q,updateCachedData:$s(V)?W=>L.dispatch(e.util.updateQueryData(_,D,W)):void 0,cacheDataLoaded:F,cacheEntryRemoved:N},X=q(D,Z);Promise.resolve(X).catch(W=>{if(W!==Gh)throw W})}return T},CI=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},EI=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:s,internalState:u})=>{let{removeQueryResult:c}=i.internalActions,g=zt(sr(n),Ii(n)),v=zt(sr(o,n),nn(o,n)),E=[],h=0,y=(R,T)=>{(o.pending.match(R)||n.pending.match(R))&&h++,v(R)&&(h=Math.max(0,h-1)),g(R)?C(ny(R,"invalidatesTags",r,a),T):v(R)?C([],T):i.util.invalidateTags.match(R)&&C(Kd(R.payload,void 0,void 0,void 0,void 0,a),T)};function S(){return h>0}function C(R,T){let I=T.getState(),k=I[e];if(E.push(...R),k.config.invalidationBehavior==="delayed"&&S())return;let _=E;if(E=[],_.length===0)return;let D=i.util.selectInvalidatedBy(I,_);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:L}of G){let j=k.queries[L],V=Gs(u.currentSubscriptions,L,Gd);j&&(V.size===0?T.dispatch(c({queryCacheKey:L})):j.status!==fr&&T.dispatch(s(j)))}})}return y},RI=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:i,currentSubscriptions:a}=o,s=new Set,u=null,c=(C,R)=>{(r.internalActions.updateSubscriptionOptions.match(C)||r.internalActions.unsubscribeQueryResult.match(C))&&g(C.payload.queryCacheKey,R),(t.pending.match(C)||t.rejected.match(C)&&C.meta.condition)&&g(C.meta.arg.queryCacheKey,R),(t.fulfilled.match(C)||t.rejected.match(C)&&!C.meta.condition)&&v(C.meta.arg,R),r.util.resetApiState.match(C)&&(y(),u&&(clearTimeout(u),u=null),s.clear())};function g(C,R){s.add(C),u||(u=setTimeout(()=>{for(let T of s)E({queryCacheKey:T},R);s.clear(),u=null},0))}function v({queryCacheKey:C},R){let T=R.getState()[e],I=T.queries[C],k=a.get(C);if(!I||I.status===fr)return;let{lowestPollingInterval:_,skipPollingIfUnfocused:D}=S(k);if(!Number.isFinite(_))return;let G=i.get(C);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let L=Date.now()+_;i.set(C,{nextPollTimestamp:L,pollingInterval:_,timeout:setTimeout(()=>{(T.config.focused||!D)&&R.dispatch(n(I)),v({queryCacheKey:C},R)},_)})}function E({queryCacheKey:C},R){let I=R.getState()[e].queries[C],k=a.get(C);if(!I||I.status===fr)return;let{lowestPollingInterval:_}=S(k);if(!Number.isFinite(_)){h(C);return}let D=i.get(C),G=Date.now()+_;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:C},R)}function h(C){let R=i.get(C);R?.timeout&&clearTimeout(R.timeout),i.delete(C)}function y(){for(let C of i.keys())h(C)}function S(C=new Map){let R=!1,T=Number.POSITIVE_INFINITY;for(let I of C.values())I.pollingInterval&&(T=Math.min(I.pollingInterval,T),R=I.skipPollingIfUnfocused||R);return{lowestPollingInterval:T,skipPollingIfUnfocused:R}}return c},II=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=rs(r,n),i=nn(r,n),a=sr(r,n),s={};return(c,g)=>{if(o(c)){let{requestId:v,arg:{endpointName:E,originalArgs:h}}=c.meta,y=wo(t,E),S=y?.onQueryStarted;if(S){let C={},R=new Promise((_,D)=>{C.resolve=_,C.reject=D});R.catch(()=>{}),s[v]=C;let T=e.endpoints[E].select($s(y)?h:v),I=g.dispatch((_,D,G)=>G),k={...g,getCacheEntry:()=>T(g.getState()),requestId:v,extra:I,updateCachedData:$s(y)?_=>g.dispatch(e.util.updateQueryData(E,h,_)):void 0,queryFulfilled:R};S(h,k)}}else if(a(c)){let{requestId:v,baseQueryMeta:E}=c.meta;s[v]?.resolve({data:c.payload,meta:E}),delete s[v]}else if(i(c)){let{requestId:v,rejectedWithValue:E,baseQueryMeta:h}=c.meta;s[v]?.reject({error:c.payload??c.error,isUnhandledError:!E,meta:h}),delete s[v]}}},TI=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(u,c)=>{zd.match(u)&&s(c,"refetchOnFocus"),Wd.match(u)&&s(c,"refetchOnReconnect")};function s(u,c){let g=u.getState()[e],v=g.queries,E=o.currentSubscriptions;t.batch(()=>{for(let h of E.keys()){let y=v[h],S=E.get(h);if(!S||!y)continue;let C=[...S.values()];(C.some(T=>T[c]===!0)||C.every(T=>T[c]===void 0)&&g.config[c])&&(S.size===0?u.dispatch(i({queryCacheKey:h})):y.status!==fr&&u.dispatch(n(y)))}})}return a};function _I(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:i}=e,{apiUid:a}=o,s={invalidateTags:O(`${t}/invalidateTags`)},u=E=>E.type.startsWith(`${t}/`),c=[CI,AI,EI,RI,xI,II];return{middleware:E=>{let h=!1,y=i(E.dispatch),S={...e,internalState:y,refetchQuery:v,isThisApiSliceAction:u,mwApi:E},C=c.map(I=>I(S)),R=bI(S),T=TI(S);return I=>k=>{if(!di(k))return I(k);h||(h=!0,E.dispatch(n.internalActions.middlewareRegistered(a)));let _={...E,next:I},D=E.getState(),[G,L]=R(k,_,D),j;if(G?j=I(k):j=L,E.getState()[t]&&(T(k,_,D),u(k)||o.hasRehydrationInfo(k)))for(let V of C)V(k,_,D);return j}},actions:s};function v(E){return e.api.endpoints[E.endpointName].initiate(E.originalArgs,{subscribe:!1,forceRefetch:!0})}}var $h=Symbol(),kI=({createSelector:e=Be}={})=>({name:$h,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:u,refetchOnReconnect:c,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:E,skipSchemaValidation:h},y){Fm();let S=ge=>(typeof process<"u",ge);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Wd,onOffline:Xh,onFocus:zd,onFocusLost:Yh},util:{}});let C=vI({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:R,selectCachedArgsForQuery:T,buildQuerySelector:I,buildInfiniteQuerySelector:k,buildMutationSelector:_}=C;pr(t.util,{selectInvalidatedBy:R,selectCachedArgsForQuery:T});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,patchQueryData:j,updateQueryData:V,upsertQueryData:q,prefetch:P,buildMatchThunkActions:N}=hI({baseQuery:r,reducerPath:o,context:y,api:t,serializeQueryArgs:i,assertTagType:S,selectors:C,onSchemaFailure:v,catchSchemaFailure:E,skipSchemaValidation:h}),{reducer:F,actions:H}=yI({context:y,queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:g}});pr(t.util,{patchQueryData:j,updateQueryData:V,upsertQueryData:q,prefetch:P,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),pr(t.internalActions,H);let Q=new WeakMap,Z=ge=>Gs(Q,ge,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:X,buildInitiateInfiniteQuery:W,buildInitiateMutation:te,getRunningMutationThunk:ue,getRunningMutationsThunk:Ee,getRunningQueriesThunk:Me,getRunningQueryThunk:ke}=gI({queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,serializeQueryArgs:i,context:y,getInternalState:Z});pr(t.util,{getRunningMutationThunk:ue,getRunningMutationsThunk:Ee,getRunningQueryThunk:ke,getRunningQueriesThunk:Me});let{middleware:Pe,actions:Ne}=_I({reducerPath:o,context:y,queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,assertTagType:S,selectors:C,getRunningQueryThunk:ke,getInternalState:Z});return pr(t.util,Ne),pr(t,{reducer:F,middleware:Pe}),{name:$h,injectEndpoint(ge,fe){var $e;let he=($e=t.endpoints)[ge]??($e[ge]={});Hs(fe)&&pr(he,{name:ge,select:I(ge,fe),initiate:X(ge,fe)},N(D,ge)),pI(fe)&&pr(he,{name:ge,select:_(),initiate:te(ge)},N(L,ge)),zs(fe)&&pr(he,{name:ge,select:k(ge,fe),initiate:W(ge,fe)},N(D,ge))}}}}),iy=SI(kI());m();d();f();p();m();d();f();p();var dn=e=>e.query,ay=e=>e.query?.enableQuerySyntax;var r$=Be(e=>dn(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})),OI=Be(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);m();d();f();p();m();d();f();p();var Ao=(e,t,r)=>ft({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let i=t??cn(o);if(!i)return null;let a=nh(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:i,answerGenerated:e,answerTextIsEmpty:r,...(a&&{conversationId:a})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??cn(n)??"",answerGenerated:e??!1})}),xo=e=>ft({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??cn(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})});m();d();f();p();m();d();f();p();var sy=Be(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})}});m();d();f();p();var $i=(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:co(e)}});m();d();f();p();var Yd=e=>e.context;m();d();f();p();var Xd=e=>e.pipeline;m();d();f();p();m();d();f();p();var Qi=Mt(Ws(),1),fy=Mt(cy(),1);m();d();f();p();var Ks=Mt(Ws(),1),ly=Mt(uy(),1);Ks.default.extend(ly.default);var dy="YYYY/MM/DD@HH:mm:ss",PI="1401-01-01";function Co(e,t){let r=(0,Ks.default)(e,t);return!r.isValid()&&!t?(0,Ks.default)(e,dy):r}function Ys(e){return e.format(dy)}function py(e,t){let r=Co(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}`)}op(r)}function op(e){if(e.isBefore(PI))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Qi.default.extend(fy.default);var my=["past","now","next"],gy=["minute","hour","day","week","month","quarter","year"],NI=e=>{let t=e==="now";return{amount:new oe({required:!t,min:1}),unit:new z({required:!t,constrainTo:gy}),period:new z({required:!0,constrainTo:my})}};function ip(e){if(typeof e=="string"&&!_r(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?by(e):e;new mt(NI(t.period)).validate(t);let r=yy(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);op(r)}function hy(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function yy(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Qi.default)().subtract(r,n);case"next":return(0,Qi.default)().add(r,n);case"now":return(0,Qi.default)()}}function Hi(e){return Ys(yy(by(e)))}function vy(e){return e.toLocaleLowerCase().split("-")}function _r(e){let[t,r,n]=vy(e);if(t==="now")return!0;if(!my.includes(t)||!gy.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function Sy(e){return!!e&&typeof e=="object"&&"period"in e}function by(e){let[t,r,n]=vy(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}m();d();f();p();function wy(e){return e.type==="dateRange"}function Ay(e){return`start${e}`}function xy(e){return`end${e}`}var ap=()=>({dateFacetValueMap:{}});function FI(e,t,r){let n=e.start,o=e.end;return _r(n)&&(n=Hi(n),r.dateFacetValueMap[t][Ay(n)]=e.start),_r(o)&&(o=Hi(o),r.dateFacetValueMap[t][xy(o)]=e.end),{...e,start:n,end:o}}function sp(e,t){if(wy(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>FI(o,r,t))}}return e}function kr(e){let t=ap();return{request:{...e,facets:e.facets?.map(n=>sp(n,t))},mappings:t}}function DI(e,t,r){return{...e,start:r.dateFacetValueMap[t][Ay(e.start)]||e.start,end:r.dateFacetValueMap[t][xy(e.end)]||e.end}}function MI(e,t){return e.facetId in t.dateFacetValueMap}function qI(e,t){return MI(e,t)?{...e,values:e.values.map(r=>DI(r,e.facetId,t))}:e}function Xs(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>qI(n,t))}}:e}m();d();f();p();m();d();f();p();m();d();f();p();function Or(e){return Object.values(e).map(t=>t.request)}function cp(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function Cy(e){return Or(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var up={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function jI(e){return Or(e).map(t=>{let r=up[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function LI(e){return[...jI(e.facetSet??{}),...Cy(e.numericFacetSet??{}),...Cy(e.dateFacetSet??{}),...Or(e.categoryFacetSet??{})]}function UI(e){return LI(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Zs(e){return cp(UI(e),e.facetOrder??[])}m();d();f();p();m();d();f();p();var Pr=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??br(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:It.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 qs(e.configuration.analytics,t))),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Pr(_x67,_x68){return _ref29.apply(this,arguments)}}();m();d();f();p();var Eo=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??br(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&&$i(e.configuration.analytics,t,r)),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});m();d();f();p();var Ey=Be(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Nr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=dp(e),o=VI(e),i=BI(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Pr(e,r):Eo(e,t,r);return kr({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:lp(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:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Nr(_x69,_x70,_x71){return _ref30.apply(this,arguments)}}();function lp(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function VI(e){return cp($I(e),e.facetOrder??[])}function BI(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(GI).filter(r=>r.currentValues.length>0):void 0}function GI(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function $I(e){return QI(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function QI(e){return[...HI(e.facetSet??{}),...Ry(e.numericFacetSet??{}),...Ry(e.dateFacetSet??{}),...Or(e.categoryFacetSet??{})]}function HI(e){return Or(e).map(t=>{let r=up[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Ry(e){return Or(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function dp(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Ey(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}m();d();f();p();m();d();f();p();var zi=(e,t)=>{let r=e;return se(r[t])?se(e.raw[t])?null:e.raw[t]:r[t]},zI=e=>t=>e.every(r=>!se(zi(t,r))),WI=e=>t=>e.every(r=>se(zi(t,r))),KI=(e,t)=>r=>{let n=Iy(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},YI=(e,t)=>r=>{let n=Iy(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Iy=(e,t)=>{let r=zi(t,e);return Kf(r)?r:[r]},Ty={getResultProperty:zi,fieldsMustBeDefined:zI,fieldsMustNotBeDefined:WI,fieldMustMatch:KI,fieldMustNotMatch:YI};var pp=Be(e=>e.search,e=>e?.searchAction?.actionCause||"");m();d();f();p();var fp=e=>e.searchHub;m();d();f();p();var Js=Be(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),UQ=Be(e=>e,e=>{let t=Js(e);return t&&e?e[t].expression:""});m();d();f();p();var _y=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};m();d();f();p();var ky=e=>e.excerptLength?.length;m();d();f();p();var Oy=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};m();d();f();p();var Py=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};m();d();f();p();var Ny=e=>e.sortCriteria;var Fy=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Hn(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Fy(_x72){return _ref31.apply(this,arguments)}}(),Dy=(e,t)=>{let r=dn(e)?.q,{aq:n,cq:o,dq:i,lq:a}=jy(e),s=Yd(e),u=$i(e.configuration.analytics,t,{actionCause:pp(e)}),c=fp(e),g=Xd(e),v=Rd(e)??[],E=qy(e),h=Js(e.tabSet)||"default",y=Cd(e),S=Zg(e),C=t.referrer||"",R=Oy(e),T=Ny(e),I=XI(e),k=ky(e),_=Py(e),D=_y(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:ay(e)}),...(s?.contextValues&&{context:s.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(c?.length&&{searchHub:c}),...(g?.length&&{pipeline:g}),...(E.length&&{facets:E}),...(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:lp(e),firstResult:e.pagination.firstResult}),tab:h,locale:y,timezone:S,...(e.debug!==void 0&&{debug:e.debug}),referrer:C,...I,...(_??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:T,...(R&&{facetOptions:R}),...u,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},My=(e,t)=>{let r=dn(e)?.q,n=qy(e),o=$i(e.configuration.analytics,t,{actionCause:pp(e)}),i=Cd(e),a=Js(e.tabSet)||"default",s=t.referrer,{aq:u,cq:c}=jy(e),g=fp(e),v=Xd(e),E=Yd(e),h=Rd(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(E?.contextValues&&{context:E.contextValues}),...(u&&{aq:u}),...(c&&{cq:c}),tab:a,referrer:s,...o,locale:i}},qy=e=>Zs(e)?.map(t=>sp(t,ap())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),XI=e=>({actionsHistory:e.configuration.analytics.enabled?It.getInstance().getHistory():[]}),jy=e=>{let t=sy(e),r=dp(e);return{...t,...(r&&{cq:r})}};m();d();f();p();var ec=["searching","thinking","answering"];function tc(e){return e.toLowerCase()}var rc=["search","generic"];m();d();f();p();var Ly=["text/plain","text/markdown"];var Ro=new z({required:!0}),Uy=new z,Io=new me({required:!0}),mp={id:Ro,title:Ro,uri:Ro,permanentid:Ro,clickUri:Uy},nc=new z({required:!0,constrainTo:Ly}),Vy=new z({required:!0,constrainTo:ec}),By=e=>({...e,name:tc(e.name)}),az=O("generatedAnswer/setIsVisible",e=>B(e,Io)),oc=O("generatedAnswer/setAnswerId",e=>B(e,Y)),sz=O("generatedAnswer/setAnswerGenerationMode",e=>B(e,new z({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),cz=O("generatedAnswer/setIsEnabled",e=>B(e,Io)),Ki=O("generatedAnswer/updateMessage",e=>B(e,{textDelta:Ro})),Yi=O("generatedAnswer/updateCitations",e=>B(e,{citations:new ve({required:!0,each:new ne({values:mp})})})),Xi=O("generatedAnswer/updateError",e=>B(e,{message:Uy,code:new oe({min:0})})),ic=O("generatedAnswer/resetAnswer"),uz=O("generatedAnswer/like"),lz=O("generatedAnswer/dislike"),dz=O("generatedAnswer/feedbackModal/open"),pz=O("generatedAnswer/expand"),fz=O("generatedAnswer/collapse"),mz=O("generatedAnswer/setId",e=>B(e,{id:new z({required:!0})})),gz=O("generatedAnswer/feedbackModal/close"),hz=O("generatedAnswer/sendFeedback"),Fr=O("generatedAnswer/setIsLoading",e=>B(e,Io)),Wi=O("generatedAnswer/setIsStreaming",e=>B(e,Io)),Zi=O("generatedAnswer/setAnswerContentFormat",e=>B(e,nc)),yz=O("generatedAnswer/updateResponseFormat",e=>B(e,{contentFormat:new ve({each:nc,default:["text/plain"]})})),vz=O("knowledge/updateAnswerConfigurationId",e=>B(e,Ro)),Sz=O("generatedAnswer/registerFieldsToIncludeInCitations",e=>B(e,as)),gp=O("generatedAnswer/setIsAnswerGenerated",e=>B(e,Io)),Ji=O("generatedAnswer/setCannotAnswer",e=>B(e,Io)),ZI=O("generatedAnswer/setAnswerApiQueryParams",e=>B(e,new ne({}))),Gy=O("generatedAnswer/startStep",e=>B(By(e),{name:Vy,startedAt:new oe({min:0,required:!0})})),$y=O("generatedAnswer/finishStep",e=>B(By(e),{name:Vy,finishedAt:new oe({min:0,required:!0})})),Qy=O("generatedAnswer/startToolCall",e=>B(e,{toolCallName:Y,startedAt:new oe({min:0,required:!0}),toolCallId:Y})),Hy=O("generatedAnswer/finishToolCall",e=>B(e,{finishedAt:new oe({min:0,required:!0}),toolCallId:Y})),ac=O("generatedAnswer/toolCallArgs",e=>B(e,{toolCallId:Y,args:new ne({options:{required:!0}}),type:new z({required:!0,constrainTo:rc})})),bz=Ie("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:s}=a,{setAbortControllerRef:u}=e,c=yield Fy(r),g=(h,y)=>{switch(h){case"genqa.headerMessageType":{let S=JSON.parse(y);n(Zi(S.contentFormat));break}case"genqa.messageType":n(Ki(JSON.parse(y)));break;case"genqa.citationsType":n(Yi(JSON.parse(y)));break;case"genqa.endOfStreamType":{let S=JSON.parse(y).answerGenerated,{answerId:C,answer:R}=i().generatedAnswer,I=s.length!==0&&!S,k=!R?.trim();n(Ji(I)),n(Wi(!1)),n(gp(S)),n(Ao(S,C,S?k:void 0)),n(xo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(Fr(!0));let v=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,E=o.streamingClient?.streamGeneratedAnswer(c,{write:h=>{v(c)&&(n(Fr(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{v(c)&&n(Xi(h))},close:()=>{v(c)&&n(Wi(!1))},resetAnswer:()=>{v(c)&&n(ic())}});E?u(E):n(Fr(!1))});return function(_x73,_x74){return _ref32.apply(this,arguments)}}()),wz=Ie("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(ic());let i=t();if(i.generatedAnswer.isEnabled===!1){o.warn("[WARNING] The generateAnswer action was dispatched while the generated answer is disabled. No answer will be generated. Enable the generated answer before dispatching generateAnswer.");return}if(i.generatedAnswer.answerConfigurationId){let a=Dy(i,n);r(ZI(a)),yield r(zy(a))}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(_x75,_x76){return _ref33.apply(this,arguments)}}());m();d();f();p();m();d();f();p();function Ky(_x77,_x78){return _Ky.apply(this,arguments)}function _Ky(){_Ky=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Ky.apply(this,arguments)}function Yy(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=eT(t,a);let s=t.length,u=0;for(;r<s;){o&&(t[r]===10&&(u=++r),o=!1);let c=-1;for(;r<s&&c===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-u);break;case 13:o=!0,c=r;break;case 10:c=r;break}if(c===-1)break;e(t.subarray(u,c),n),u=r,n=-1}u===s?t=void 0:u!==0&&(t=t.subarray(u),r-=u)}}function Xy(e,t,r){let n=Wy(),o=new TextDecoder;return function(a,s){if(a.length===0)r?.(n),n=Wy();else if(s>0){let u=o.decode(a.subarray(0,s)),c=s+(a[s+1]===32?2:1),g=o.decode(a.subarray(c));switch(u){case"data":n.data=n.data?`${n.data}
32
- ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":JI(g,n,t);break}}}}function JI(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function eT(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Wy(){return{data:"",event:"",id:"",retry:void 0}}var hp="text/event-stream",tT=1e3,Zy="last-event-id";function Jy(){return typeof window<"u"}function ev(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:s,fetch:u,...c}){return new Promise((g,v)=>{let E={...r};E.accept||(E.accept=hp);let h;function y(){h?.abort(),document.hidden||k()}!s&&Jy()&&document.addEventListener("visibilitychange",y);let S=tT,C;function R(){Jy()&&document.removeEventListener("visibilitychange",y),clearTimeout(C),h?.abort()}t?.addEventListener("abort",()=>{R(),g()});let T=u??A,I=n??rT;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){h=l.AbortController?new l.AbortController:null;try{let _=yield T(e,{...c,headers:E,signal:h?.signal});yield I(_),yield Ky(_.body,Yy(Xy(D=>{D?E[Zy]=D:delete E[Zy]},D=>{S=D},o))),i?.(),R(),g()}catch(_){if(!h?.signal?.aborted)try{let D=a?.(_)??S;clearTimeout(C),C=setTimeout(k,D)}catch(D){R(),v(D)}}});return _k2.apply(this,arguments)}k()})}function rT(e){let t=e.headers.get("content-type");if(!t?.startsWith(hp))throw new Error(`Expected content-type to be ${hp}, Actual: ${t}`)}m();d();f();p();var nT=/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,s=n.generatedAnswer.answerConfigurationId,u={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let c=Hn(n.configuration.search?.apiBaseUrl,a,i);return Hh({baseUrl:`${c}/rest/organizations/${a}/answer/v1/configs/${s}`,fetchFn:function(){var _ref35=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,E={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(h=>{E[h]=g[h]}),E.duplex="half",E.body=yield g.text(),A(v,E)});return function fetchFn(_x82){return _ref35.apply(this,arguments)}}()})(u,{...t,signal:null},r)}catch(c){return{error:c}}});return function nT(_x79,_x80,_x81){return _ref34.apply(this,arguments)}}(),tv=iy({reducerPath:"answer",baseQuery:Wh(nT,{maxRetries:3}),endpoints:()=>({})});var oT=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},iT=(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)},aT=(e,t)=>{e.citations=t.citations},sT=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},cT=(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})`)},uT=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&cT(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(oT(t,o),r(Zi(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(iT(t,o),r(Ki({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(aT(t,o),r(Yi({citations:o.citations})));break;case"genqa.endOfStreamType":{sT(t,o);let i=t.answerId,a=o.answerGenerated??!1,s=a?!t.answer?.trim():void 0;r(Ao(a,i,s)),r(xo());break}}},lT=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},yp=tv.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(_x83,_x84){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:s,insightConfiguration:u}=r(),{organizationId:c,environment:g,accessToken:v}=a,E=Hn(a.search.apiBaseUrl,c,g),h=lT(E,c,s.answerConfigurationId,u?.insightId);yield ev(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref36=_asyncToGenerator(function*(y){let S=y.headers.get("x-answer-id");S&&o(C=>{C.answerId=S,i(oc(S))})});return function onopen(_x85){return _ref36.apply(this,arguments)}}(),onmessage:y=>{o(S=>{uT(y,S,i)})},onerror:y=>{throw y},onclose:()=>{o(y=>{i(Ji(!y.generated))})}})}).apply(this,arguments)}})})}),zy=e=>yp.endpoints.getAnswer.initiate(e);m();d();f();p();var rv=Ue(Jn,e=>e);m();d();f();p();function dT(e){let t=e.payload?.analyticsAction;return nv(e)&&!se(t)}function nv(e){return"type"in e}var ov=e=>t=>r=>{let n;dT(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return nv(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};m();d();f();p();m();d();f();p();m();d();f();p();var v4=O("tab/register",e=>{let t=new ne({values:{id:Y,expression:tt}});return B(e,t)}),sc=O("tab/updateActiveTab",e=>B(e,Y));m();d();f();p();var cc=Mt(Ws(),1),sv=Mt(iv(),1),cv=Mt(av(),1);cc.default.extend(cv.default);cc.default.extend(sv.default);var uv=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:cc.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"});m();d();f();p();var pT=/(^|; )Coveo-Pendragon=([^;]*)/,fT=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function lv(){return typeof window>"u"?!1:pT.exec(document.cookie)?.pop()||null}function dv(){return typeof window>"u"?!1:fT.test(document.cookie)}var pv=Ue(uv(),e=>e.addCase(Cr,(t,r)=>{mT(t,r.payload)}).addCase(Wt,(t,r)=>{gT(t,r.payload)}).addCase(eo,(t,r)=>{hT(t,r.payload)}).addCase(to,t=>{t.analytics.enabled=!1}).addCase(ro,t=>{t.analytics.enabled=!0}).addCase(ss,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(cs,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(sc,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Sg,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Er,(t,r)=>{se(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(yg,(t,{payload:r})=>{yT(t,r)}));function mT(e,t){se(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",se(t.organizationId)||(e.organizationId=t.organizationId)}function gT(e,t){se(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),se(t.locale)||(e.search.locale=t.locale),se(t.timezone)||(e.search.timezone=t.timezone),se(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function hT(e,t){se(t.enabled)||(e.analytics.enabled=t.enabled),se(t.originContext)||(e.analytics.originContext=t.originContext),se(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),se(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),se(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),se(t.trackingId)||(e.analytics.trackingId=t.trackingId),se(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),se(t.source)||(e.analytics.source=t.source);try{let r=lv();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}se(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),se(t.anonymous)||(e.analytics.anonymous=t.anonymous),se(t.deviceId)||(e.analytics.deviceId=t.deviceId),se(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),se(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function yT(e,t){e.knowledge.agentId=t;try{dv()&&(e.knowledge.debugAgentSession=!0)}catch{}}var jt=pv;m();d();f();p();function vT(e){return e.instantlyCallable}var fv=()=>e=>t=>e(vT(t)?t():t);m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var ot=[];for(let e=0;e<256;++e)ot.push((e+256).toString(16).slice(1));function mv(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()}m();d();f();p();var Ap,ST=new Uint8Array(16);function xp(){if(!Ap){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ap=crypto.getRandomValues.bind(crypto)}return Ap(ST)}m();d();f();p();m();d();f();p();var bT=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Cp={randomUUID:bT};function wT(e,t,r){if(Cp.randomUUID&&!t&&!e)return Cp.randomUUID();e=e||{};let n=e.random??e.rng?.()??xp();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 mv(n)}var Dr=wT;m();d();f();p();m();d();f();p();var w={};ti(w,{BRAND:()=>zT,DIRTY:()=>fn,EMPTY_PATH:()=>ET,INVALID:()=>de,NEVER:()=>O_,OK:()=>ct,ParseStatus:()=>it,Schema:()=>we,ZodAny:()=>jr,ZodArray:()=>yr,ZodBigInt:()=>gn,ZodBoolean:()=>hn,ZodBranded:()=>ta,ZodCatch:()=>In,ZodDate:()=>yn,ZodDefault:()=>Rn,ZodDiscriminatedUnion:()=>dc,ZodEffects:()=>Pt,ZodEnum:()=>Cn,ZodError:()=>yt,ZodFirstPartyTypeKind:()=>pe,ZodFunction:()=>fc,ZodIntersection:()=>wn,ZodIssueCode:()=>K,ZodLazy:()=>An,ZodLiteral:()=>xn,ZodMap:()=>No,ZodNaN:()=>Do,ZodNativeEnum:()=>En,ZodNever:()=>Lt,ZodNull:()=>Sn,ZodNullable:()=>Jt,ZodNumber:()=>mn,ZodObject:()=>vt,ZodOptional:()=>kt,ZodParsedType:()=>re,ZodPipeline:()=>ra,ZodPromise:()=>Lr,ZodReadonly:()=>Tn,ZodRecord:()=>pc,ZodSchema:()=>we,ZodSet:()=>Fo,ZodString:()=>qr,ZodSymbol:()=>Oo,ZodTransformer:()=>Pt,ZodTuple:()=>Zt,ZodType:()=>we,ZodUndefined:()=>vn,ZodUnion:()=>bn,ZodUnknown:()=>hr,ZodVoid:()=>Po,addIssueToContext:()=>ee,any:()=>r_,array:()=>a_,bigint:()=>XT,boolean:()=>Ev,coerce:()=>k_,custom:()=>Av,date:()=>ZT,datetimeRegex:()=>bv,defaultErrorMap:()=>mr,discriminatedUnion:()=>l_,effect:()=>A_,enum:()=>S_,function:()=>h_,getErrorMap:()=>To,getParsedType:()=>Xt,instanceof:()=>KT,intersection:()=>d_,isAborted:()=>uc,isAsync:()=>_o,isDirty:()=>lc,isValid:()=>Mr,late:()=>WT,lazy:()=>y_,literal:()=>v_,makeIssue:()=>ea,map:()=>m_,nan:()=>YT,nativeEnum:()=>b_,never:()=>o_,null:()=>t_,nullable:()=>C_,number:()=>Cv,object:()=>s_,objectUtil:()=>Ep,oboolean:()=>__,onumber:()=>T_,optional:()=>x_,ostring:()=>I_,pipeline:()=>R_,preprocess:()=>E_,promise:()=>w_,quotelessJson:()=>AT,record:()=>f_,set:()=>g_,setErrorMap:()=>CT,strictObject:()=>c_,string:()=>xv,symbol:()=>JT,transformer:()=>A_,tuple:()=>p_,undefined:()=>e_,union:()=>u_,unknown:()=>n_,util:()=>Ce,void:()=>i_});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Ce;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ce||(Ce={}));var Ep;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ep||(Ep={}));var re=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xt=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}};var K=Ce.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"]),AT=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),yt=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(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,u=0;for(;u<a.path.length;){let c=a.path[u];u===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(r(a))):s[c]=s[c]||{_errors:[]},s=s[c],u++}}};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,Ce.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 i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};yt.create=e=>new yt(e);var xT=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===re.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.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}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.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 K.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 K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}},mr=xT;var gv=mr;function CT(e){gv=e}function To(){return gv}m();d();f();p();var ea=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)s=c(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},ET=[];function ee(e,t){let r=To(),n=ea({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===mr?void 0:mr].filter(o=>!!o)});e.common.issues.push(n)}var it=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 de;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 i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return de;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},de=Object.freeze({status:"aborted"}),fn=e=>({status:"dirty",value:e}),ct=e=>({status:"valid",value:e}),uc=e=>e.status==="aborted",lc=e=>e.status==="dirty",Mr=e=>e.status==="valid",_o=e=>typeof Promise<"u"&&e instanceof Promise;m();d();f();p();m();d();f();p();var ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ae||(ae={}));var Ot=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}},hv=(e,t)=>{if(Mr(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 yt(e.common.issues);return this._error=r,this._error}}};function ye(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:(a,s)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??s.defaultError}:typeof s.data>"u"?{message:u??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:u??r??s.defaultError}},description:o}}var we=class{get description(){return this._def.description}_getType(t){return Xt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new it,ctx:{common:t.parent.common,data:t.data,parsedType:Xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(_o(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:Xt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return hv(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Mr(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=>Mr(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this10=this;return _asyncToGenerator(function*(){let n=yield _this10.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this11=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this11._def.errorMap,parent:null,data:t,parsedType:Xt(t)},o=_this11._parse({data:t,path:n.path,parent:n}),i=yield _o(o)?o:Promise.resolve(o);return hv(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),s=()=>i.addIssue({code:K.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!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 Pt({schema:this,typeName:pe.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 kt.create(this,this._def)}nullable(){return Jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Lr.create(this,this._def)}or(t){return bn.create([this,t],this._def)}and(t){return wn.create(this,t,this._def)}transform(t){return new Pt({...ye(this._def),schema:this,typeName:pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rn({...ye(this._def),innerType:this,defaultValue:r,typeName:pe.ZodDefault})}brand(){return new ta({typeName:pe.ZodBranded,type:this,...ye(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new In({...ye(this._def),innerType:this,catchValue:r,typeName:pe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ra.create(this,t)}readonly(){return Tn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RT=/^c[^\s-]{8,}$/i,IT=/^[0-9a-z]+$/,TT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_T=/^[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,kT=/^[a-z0-9_-]{21}$/i,OT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PT=/^[-+]?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)?)??$/,NT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rp,DT=/^(?:(?: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])$/,MT=/^(?:(?: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])$/,qT=/^(([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]))$/,jT=/^(([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])$/,LT=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vv="((\\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])))",VT=new RegExp(`^${vv}$`);function Sv(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 BT(e){return new RegExp(`^${Sv(e)}$`)}function bv(e){let t=`${vv}T${Sv(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 GT(e,t){return!!((t==="v4"||!t)&&DT.test(e)||(t==="v6"||!t)&&qT.test(e))}function $T(e,t){if(!OT.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 QT(e,t){return!!((t==="v4"||!t)&&MT.test(e)||(t==="v6"||!t)&&jT.test(e))}var qr=class e extends we{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.string,received:i.parsedType}),de}let n=new it,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(t,o),a?ee(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&ee(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")NT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"email",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Rp||(Rp=new RegExp(FT,"u")),Rp.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"emoji",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")_T.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"uuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")kT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"nanoid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")RT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")IT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid2",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")TT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ulid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ee(o,{validation:"url",code:K.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"regex",code:K.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?bv(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?VT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?BT(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?PT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"duration",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?GT(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ip",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?$T(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"jwt",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?QT(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cidr",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?LT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?UT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64url",code:K.invalid_string,message:i.message}),n.dirty()):Ce.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:K.invalid_string,...ae.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ae.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ae.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ae.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ae.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ae.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ae.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,...ae.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,...ae.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ae.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ae.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ae.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ae.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ae.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ae.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ae.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ae.errToObj(r)})}nonempty(t){return this.min(1,ae.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}};qr.create=e=>new qr({checks:[],typeName:pe.ZodString,coerce:e?.coerce??!1,...ye(e)});function HT(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var mn=class e extends we{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)!==re.number){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.number,received:i.parsedType}),de}let n,o=new it;for(let i of this._def.checks)i.kind==="int"?Ce.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:K.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?HT(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_finite,message:i.message}),o.dirty()):Ce.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ae.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ae.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ae.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"&&Ce.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)}};mn.create=e=>new mn({checks:[],typeName:pe.ZodNumber,coerce:e?.coerce||!1,...ye(e)});var gn=class e extends we{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)!==re.bigint)return this._getInvalidInput(t);let n,o=new it;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ce.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.bigint,received:r.parsedType}),de}gte(t,r){return this.setLimit("min",t,!0,ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ae.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ae.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:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ae.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}};gn.create=e=>new gn({checks:[],typeName:pe.ZodBigInt,coerce:e?.coerce??!1,...ye(e)});var hn=class extends we{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.boolean,received:n.parsedType}),de}return ct(t.data)}};hn.create=e=>new hn({typeName:pe.ZodBoolean,coerce:e?.coerce||!1,...ye(e)});var yn=class e extends we{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.date,received:i.parsedType}),de}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_date}),de}let n=new it,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ce.assertNever(i);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:ae.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ae.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}};yn.create=e=>new yn({checks:[],coerce:e?.coerce||!1,typeName:pe.ZodDate,...ye(e)});var Oo=class extends we{_parse(t){if(this._getType(t)!==re.symbol){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.symbol,received:n.parsedType}),de}return ct(t.data)}};Oo.create=e=>new Oo({typeName:pe.ZodSymbol,...ye(e)});var vn=class extends we{_parse(t){if(this._getType(t)!==re.undefined){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.undefined,received:n.parsedType}),de}return ct(t.data)}};vn.create=e=>new vn({typeName:pe.ZodUndefined,...ye(e)});var Sn=class extends we{_parse(t){if(this._getType(t)!==re.null){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.null,received:n.parsedType}),de}return ct(t.data)}};Sn.create=e=>new Sn({typeName:pe.ZodNull,...ye(e)});var jr=class extends we{constructor(){super(...arguments),this._any=!0}_parse(t){return ct(t.data)}};jr.create=e=>new jr({typeName:pe.ZodAny,...ye(e)});var hr=class extends we{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ct(t.data)}};hr.create=e=>new hr({typeName:pe.ZodUnknown,...ye(e)});var Lt=class extends we{_parse(t){let r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.never,received:r.parsedType}),de}};Lt.create=e=>new Lt({typeName:pe.ZodNever,...ye(e)});var Po=class extends we{_parse(t){if(this._getType(t)!==re.undefined){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.void,received:n.parsedType}),de}return ct(t.data)}};Po.create=e=>new Po({typeName:pe.ZodVoid,...ye(e)});var yr=class e extends we{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==re.array)return ee(r,{code:K.invalid_type,expected:re.array,received:r.parsedType}),de;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.length<o.exactLength.value;(a||s)&&(ee(r,{code:a?K.too_big:K.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?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&&(ee(r,{code:K.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&&(ee(r,{code:K.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((a,s)=>o.type._parseAsync(new Ot(r,a,r.path,s)))).then(a=>it.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new Ot(r,a,r.path,s)));return it.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ae.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ae.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ae.toString(r)}})}nonempty(t){return this.min(1,t)}};yr.create=(e,t)=>new yr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pe.ZodArray,...ye(t)});function ko(e){if(e instanceof vt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=kt.create(ko(n))}return new vt({...e._def,shape:()=>t})}else return e instanceof yr?new yr({...e._def,type:ko(e.element)}):e instanceof kt?kt.create(ko(e.unwrap())):e instanceof Jt?Jt.create(ko(e.unwrap())):e instanceof Zt?Zt.create(e.items.map(t=>ko(t))):e}var vt=class e extends we{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=Ce.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==re.object){let c=this._getOrReturnCtx(t);return ee(c,{code:K.invalid_type,expected:re.object,received:c.parsedType}),de}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Lt&&this._def.unknownKeys==="strip"))for(let c in o.data)a.includes(c)||s.push(c);let u=[];for(let c of a){let g=i[c],v=o.data[c];u.push({key:{status:"valid",value:c},value:g._parse(new Ot(o,v,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof Lt){let c=this._def.unknownKeys;if(c==="passthrough")for(let g of s)u.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(c==="strict")s.length>0&&(ee(o,{code:K.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let g of s){let v=o.data[g];u.push({key:{status:"valid",value:g},value:c._parse(new Ot(o,v,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let c=[];for(let g of u){let v=yield g.key,E=yield g.value;c.push({key:v,value:E,alwaysSet:g.alwaysSet})}return c})).then(c=>it.mergeObjectSync(n,c)):it.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return ae.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:ae.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:pe.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 Ce.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 Ce.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return ko(this)}partial(t){let r={};for(let n of Ce.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 Ce.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof kt;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return wv(Ce.objectKeys(this.shape))}};vt.create=(e,t)=>new vt({shape:()=>e,unknownKeys:"strip",catchall:Lt.create(),typeName:pe.ZodObject,...ye(t)});vt.strictCreate=(e,t)=>new vt({shape:()=>e,unknownKeys:"strict",catchall:Lt.create(),typeName:pe.ZodObject,...ye(t)});vt.lazycreate=(e,t)=>new vt({shape:e,unknownKeys:"strip",catchall:Lt.create(),typeName:pe.ZodObject,...ye(t)});var bn=class extends we{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new yt(s.ctx.common.issues));return ee(r,{code:K.invalid_union,unionErrors:a}),de}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x86){return _ref38.apply(this,arguments)}}())).then(o);{let i,a=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},g=u._parseSync({data:r.data,path:r.path,parent:c});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(u=>new yt(u));return ee(r,{code:K.invalid_union,unionErrors:s}),de}}get options(){return this._def.options}};bn.create=(e,t)=>new bn({options:e,typeName:pe.ZodUnion,...ye(t)});var gr=e=>e instanceof An?gr(e.schema):e instanceof Pt?gr(e.innerType()):e instanceof xn?[e.value]:e instanceof Cn?e.options:e instanceof En?Ce.objectValues(e.enum):e instanceof Rn?gr(e._def.innerType):e instanceof vn?[void 0]:e instanceof Sn?[null]:e instanceof kt?[void 0,...gr(e.unwrap())]:e instanceof Jt?[null,...gr(e.unwrap())]:e instanceof ta||e instanceof Tn?gr(e.unwrap()):e instanceof In?gr(e._def.innerType):[],dc=class e extends we{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.object)return ee(r,{code:K.invalid_type,expected:re.object,received:r.parsedType}),de;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(ee(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),de)}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 i of r){let a=gr(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);o.set(s,i)}}return new e({typeName:pe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...ye(n)})}};function Ip(e,t){let r=Xt(e),n=Xt(t);if(e===t)return{valid:!0,data:e};if(r===re.object&&n===re.object){let o=Ce.objectKeys(t),i=Ce.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(let s of i){let u=Ip(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(r===re.array&&n===re.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],u=Ip(a,s);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return r===re.date&&n===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var wn=class extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(uc(i)||uc(a))return de;let s=Ip(i.value,a.value);return s.valid?((lc(i)||lc(a))&&r.dirty(),{status:r.value,value:s.data}):(ee(n,{code:K.invalid_intersection_types}),de)};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(([i,a])=>o(i,a)):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}))}};wn.create=(e,t,r)=>new wn({left:e,right:t,typeName:pe.ZodIntersection,...ye(r)});var Zt=class e extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==re.array)return ee(n,{code:K.invalid_type,expected:re.array,received:n.parsedType}),de;if(n.data.length<this._def.items.length)return ee(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&n.data.length>this._def.items.length&&(ee(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let u=this._def.items[s]||this._def.rest;return u?u._parse(new Ot(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>it.mergeArray(r,a)):it.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Zt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zt({items:e,typeName:pe.ZodTuple,rest:null,...ye(t)})};var pc=class e extends we{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!==re.object)return ee(n,{code:K.invalid_type,expected:re.object,received:n.parsedType}),de;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new Ot(n,s,n.path,s)),value:a._parse(new Ot(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?it.mergeObjectAsync(r,o):it.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof we?new e({keyType:t,valueType:r,typeName:pe.ZodRecord,...ye(n)}):new e({keyType:qr.create(),valueType:t,typeName:pe.ZodRecord,...ye(r)})}},No=class extends we{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!==re.map)return ee(n,{code:K.invalid_type,expected:re.map,received:n.parsedType}),de;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,u],c)=>({key:o._parse(new Ot(n,s,n.path,[c,"key"])),value:i._parse(new Ot(n,u,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let u of a){let c=yield u.key,g=yield u.value;if(c.status==="aborted"||g.status==="aborted")return de;(c.status==="dirty"||g.status==="dirty")&&r.dirty(),s.set(c.value,g.value)}return{status:r.value,value:s}}))}else{let s=new Map;for(let u of a){let c=u.key,g=u.value;if(c.status==="aborted"||g.status==="aborted")return de;(c.status==="dirty"||g.status==="dirty")&&r.dirty(),s.set(c.value,g.value)}return{status:r.value,value:s}}}};No.create=(e,t,r)=>new No({valueType:t,keyType:e,typeName:pe.ZodMap,...ye(r)});var Fo=class e extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==re.set)return ee(n,{code:K.invalid_type,expected:re.set,received:n.parsedType}),de;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ee(n,{code:K.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&&(ee(n,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(u){let c=new Set;for(let g of u){if(g.status==="aborted")return de;g.status==="dirty"&&r.dirty(),c.add(g.value)}return{status:r.value,value:c}}let s=[...n.data.values()].map((u,c)=>i._parse(new Ot(n,u,n.path,c)));return n.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:ae.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ae.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Fo.create=(e,t)=>new Fo({valueType:e,minSize:null,maxSize:null,typeName:pe.ZodSet,...ye(t)});var fc=class e extends we{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.function)return ee(r,{code:K.invalid_type,expected:re.function,received:r.parsedType}),de;function n(s,u){return ea({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,To(),mr].filter(c=>!!c),issueData:{code:K.invalid_arguments,argumentsError:u}})}function o(s,u){return ea({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,To(),mr].filter(c=>!!c),issueData:{code:K.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Lr){let s=this;return ct(/*#__PURE__*/_asyncToGenerator(function*(...u){let c=new yt([]),g=yield s._def.args.parseAsync(u,i).catch(h=>{throw c.addIssue(n(u,h)),c}),v=yield Reflect.apply(a,this,g);return yield s._def.returns._def.type.parseAsync(v,i).catch(h=>{throw c.addIssue(o(v,h)),c})}))}else{let s=this;return ct(function(...u){let c=s._def.args.safeParse(u,i);if(!c.success)throw new yt([n(u,c.error)]);let g=Reflect.apply(a,this,c.data),v=s._def.returns.safeParse(g,i);if(!v.success)throw new yt([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:Zt.create(t).rest(hr.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||Zt.create([]).rest(hr.create()),returns:r||hr.create(),typeName:pe.ZodFunction,...ye(n)})}},An=class extends we{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})}};An.create=(e,t)=>new An({getter:e,typeName:pe.ZodLazy,...ye(t)});var xn=class extends we{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ee(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:t.data}}get value(){return this._def.value}};xn.create=(e,t)=>new xn({value:e,typeName:pe.ZodLiteral,...ye(t)});function wv(e,t){return new Cn({values:e,typeName:pe.ZodEnum,...ye(t)})}var Cn=class e extends we{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ee(r,{expected:Ce.joinValues(n),received:r.parsedType,code:K.invalid_type}),de}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 ee(r,{received:r.data,code:K.invalid_enum_value,options:n}),de}return ct(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})}};Cn.create=wv;var En=class extends we{_parse(t){let r=Ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==re.string&&n.parsedType!==re.number){let o=Ce.objectValues(r);return ee(n,{expected:Ce.joinValues(o),received:n.parsedType,code:K.invalid_type}),de}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ce.objectValues(r);return ee(n,{received:n.data,code:K.invalid_enum_value,options:o}),de}return ct(t.data)}get enum(){return this._def.values}};En.create=(e,t)=>new En({values:e,typeName:pe.ZodNativeEnum,...ye(t)});var Lr=class extends we{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.promise&&r.common.async===!1)return ee(r,{code:K.invalid_type,expected:re.promise,received:r.parsedType}),de;let n=r.parsedType===re.promise?r.data:Promise.resolve(r.data);return ct(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Lr.create=(e,t)=>new Lr({type:e,typeName:pe.ZodPromise,...ye(t)});var Pt=class extends we{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this12=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{ee(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(s){if(r.value==="aborted")return de;let u=yield _this12._def.schema._parseAsync({data:s,path:n.path,parent:n});return u.status==="aborted"?de:u.status==="dirty"?fn(u.value):r.value==="dirty"?fn(u.value):u});return function(_x87){return _ref41.apply(this,arguments)}}());{if(r.value==="aborted")return de;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?de:s.status==="dirty"?fn(s.value):r.value==="dirty"?fn(s.value):s}}if(o.type==="refinement"){let a=s=>{let u=o.refinement(s,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?de:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?de:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Mr(a))return de;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Mr(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):de);Ce.assertNever(o)}};Pt.create=(e,t,r)=>new Pt({schema:e,typeName:pe.ZodEffects,effect:t,...ye(r)});Pt.createWithPreprocess=(e,t,r)=>new Pt({schema:t,effect:{type:"preprocess",transform:e},typeName:pe.ZodEffects,...ye(r)});var kt=class extends we{_parse(t){return this._getType(t)===re.undefined?ct(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};kt.create=(e,t)=>new kt({innerType:e,typeName:pe.ZodOptional,...ye(t)});var Jt=class extends we{_parse(t){return this._getType(t)===re.null?ct(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Jt.create=(e,t)=>new Jt({innerType:e,typeName:pe.ZodNullable,...ye(t)});var Rn=class extends we{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===re.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rn.create=(e,t)=>new Rn({innerType:e,typeName:pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ye(t)});var In=class extends we{_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 _o(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};In.create=(e,t)=>new In({innerType:e,typeName:pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ye(t)});var Do=class extends we{_parse(t){if(this._getType(t)!==re.nan){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.nan,received:n.parsedType}),de}return{status:"valid",value:t.data}}};Do.create=e=>new Do({typeName:pe.ZodNaN,...ye(e)});var zT=Symbol("zod_brand"),ta=class extends we{_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}},ra=class e extends we{_parse(t){var _this13=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this13._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?de:i.status==="dirty"?(r.dirty(),fn(i.value)):_this13._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?de: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:pe.ZodPipeline})}},Tn=class extends we{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Mr(o)&&(o.value=Object.freeze(o.value)),o);return _o(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Tn.create=(e,t)=>new Tn({innerType:e,typeName:pe.ZodReadonly,...ye(t)});function yv(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Av(e,t={},r){return e?jr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let s=yv(t,n),u=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:u})}});if(!i){let a=yv(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}}):jr.create()}var WT={object:vt.lazycreate},pe;(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"})(pe||(pe={}));var KT=(e,t={message:`Input not instance of ${e.name}`})=>Av(r=>r instanceof e,t),xv=qr.create,Cv=mn.create,YT=Do.create,XT=gn.create,Ev=hn.create,ZT=yn.create,JT=Oo.create,e_=vn.create,t_=Sn.create,r_=jr.create,n_=hr.create,o_=Lt.create,i_=Po.create,a_=yr.create,s_=vt.create,c_=vt.strictCreate,u_=bn.create,l_=dc.create,d_=wn.create,p_=Zt.create,f_=pc.create,m_=No.create,g_=Fo.create,h_=fc.create,y_=An.create,v_=xn.create,S_=Cn.create,b_=En.create,w_=Lr.create,A_=Pt.create,x_=kt.create,C_=Jt.create,E_=Pt.createWithPreprocess,R_=ra.create,I_=()=>xv().optional(),T_=()=>Cv().optional(),__=()=>Ev().optional(),k_={string:e=>qr.create({...e,coerce:!0}),number:e=>mn.create({...e,coerce:!0}),boolean:e=>hn.create({...e,coerce:!0}),bigint:e=>gn.create({...e,coerce:!0}),date:e=>yn.create({...e,coerce:!0})};var O_=de;var P_=w.object({name:w.string(),arguments:w.string()}),N_=w.object({id:w.string(),type:w.literal("function"),function:P_,encryptedValue:w.string().optional()}),mc=w.object({id:w.string(),role:w.string(),content:w.string().optional(),name:w.string().optional(),encryptedValue:w.string().optional()}),F_=w.object({type:w.literal("text"),text:w.string()}),D_=w.object({type:w.literal("data"),value:w.string(),mimeType:w.string()}),M_=w.object({type:w.literal("url"),value:w.string(),mimeType:w.string().optional()}),gc=w.discriminatedUnion("type",[D_,M_]),q_=w.object({type:w.literal("image"),source:gc,metadata:w.unknown().optional()}),j_=w.object({type:w.literal("audio"),source:gc,metadata:w.unknown().optional()}),L_=w.object({type:w.literal("video"),source:gc,metadata:w.unknown().optional()}),U_=w.object({type:w.literal("document"),source:gc,metadata:w.unknown().optional()});var Rv=w.object({type:w.literal("binary"),mimeType:w.string(),id:w.string().optional(),url:w.string().optional(),data:w.string().optional(),filename:w.string().optional()}),Iv=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:w.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},K6=Rv.superRefine((e,t)=>{Iv(e,t)}),V_=w.discriminatedUnion("type",[F_,q_,j_,L_,U_,Rv]),B_=V_.superRefine((e,t)=>{e.type==="binary"&&Iv(e,t)}),G_=mc.extend({role:w.literal("developer"),content:w.string()}),$_=mc.extend({role:w.literal("system"),content:w.string()}),Q_=mc.extend({role:w.literal("assistant"),content:w.string().optional(),toolCalls:w.array(N_).optional()}),H_=mc.extend({role:w.literal("user"),content:w.union([w.string(),w.array(B_)])}),z_=w.object({id:w.string(),content:w.string(),role:w.literal("tool"),toolCallId:w.string(),error:w.string().optional(),encryptedValue:w.string().optional()}),W_=w.object({id:w.string(),role:w.literal("activity"),activityType:w.string(),content:w.record(w.any())}),K_=w.object({id:w.string(),role:w.literal("reasoning"),content:w.string(),encryptedValue:w.string().optional()}),Tv=w.discriminatedUnion("role",[G_,$_,Q_,H_,z_,W_,K_]),Y6=w.union([w.literal("developer"),w.literal("system"),w.literal("assistant"),w.literal("user"),w.literal("tool"),w.literal("activity"),w.literal("reasoning")]),Y_=w.object({description:w.string(),value:w.string()}),_v=w.object({name:w.string(),description:w.string(),parameters:w.any(),metadata:w.record(w.any()).optional()}),X_=w.object({id:w.string(),reason:w.string(),message:w.string().optional(),toolCallId:w.string().optional(),responseSchema:w.record(w.any()).optional(),expiresAt:w.string().optional(),metadata:w.record(w.any()).optional()}),Z_=w.object({interruptId:w.string(),status:w.enum(["resolved","cancelled"]),payload:w.any().optional()}),J_=w.object({threadId:w.string(),runId:w.string(),parentRunId:w.string().optional(),state:w.any(),messages:w.array(Tv),tools:w.array(_v),context:w.array(Y_),forwardedProps:w.any(),resume:w.array(Z_).optional()}),e0=w.any(),qe=class extends Error{constructor(e){super(e)}},Tp=class extends qe{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},t0=w.object({name:w.string(),description:w.string().optional()}),r0=w.object({name:w.string().optional(),type:w.string().optional(),description:w.string().optional(),version:w.string().optional(),provider:w.string().optional(),documentationUrl:w.string().optional(),metadata:w.record(w.unknown()).optional()}),n0=w.object({streaming:w.boolean().optional(),websocket:w.boolean().optional(),httpBinary:w.boolean().optional(),pushNotifications:w.boolean().optional(),resumable:w.boolean().optional()}),o0=w.object({supported:w.boolean().optional(),items:w.array(_v).optional(),parallelCalls:w.boolean().optional(),clientProvided:w.boolean().optional()}),i0=w.object({structuredOutput:w.boolean().optional(),supportedMimeTypes:w.array(w.string()).optional()}),a0=w.object({snapshots:w.boolean().optional(),deltas:w.boolean().optional(),memory:w.boolean().optional(),persistentState:w.boolean().optional()}),s0=w.object({supported:w.boolean().optional(),delegation:w.boolean().optional(),handoffs:w.boolean().optional(),subAgents:w.array(t0).optional()}),c0=w.object({supported:w.boolean().optional(),streaming:w.boolean().optional(),encrypted:w.boolean().optional()}),u0=w.object({image:w.boolean().optional(),audio:w.boolean().optional(),video:w.boolean().optional(),pdf:w.boolean().optional(),file:w.boolean().optional()}),l0=w.object({image:w.boolean().optional(),audio:w.boolean().optional()}),d0=w.object({input:u0.optional(),output:l0.optional()}),p0=w.object({codeExecution:w.boolean().optional(),sandboxed:w.boolean().optional(),maxIterations:w.number().optional(),maxExecutionTime:w.number().optional()}),f0=w.object({supported:w.boolean().optional(),approvals:w.boolean().optional(),interventions:w.boolean().optional(),feedback:w.boolean().optional(),interrupts:w.boolean().optional(),approveWithEdits:w.boolean().optional()}),X6=w.object({identity:r0.optional(),transport:n0.optional(),tools:o0.optional(),output:i0.optional(),state:a0.optional(),multiAgent:s0.optional(),reasoning:c0.optional(),multimodal:d0.optional(),execution:p0.optional(),humanInTheLoop:f0.optional(),custom:w.record(w.unknown()).optional()}),kv=w.union([w.literal("developer"),w.literal("system"),w.literal("assistant"),w.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}({}),Te=w.object({type:w.nativeEnum(M),timestamp:w.number().optional(),rawEvent:w.any().optional()}).passthrough(),m0=Te.extend({type:w.literal(M.TEXT_MESSAGE_START),messageId:w.string(),role:kv.default("assistant"),name:w.string().optional()}),Ov=Te.extend({type:w.literal(M.TEXT_MESSAGE_CONTENT),messageId:w.string(),delta:w.string()}),g0=Te.extend({type:w.literal(M.TEXT_MESSAGE_END),messageId:w.string()}),h0=Te.extend({type:w.literal(M.TEXT_MESSAGE_CHUNK),messageId:w.string().optional(),role:kv.optional(),delta:w.string().optional(),name:w.string().optional()}),y0=Te.extend({type:w.literal(M.THINKING_TEXT_MESSAGE_START)}),v0=Ov.omit({messageId:!0,type:!0}).extend({type:w.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),S0=Te.extend({type:w.literal(M.THINKING_TEXT_MESSAGE_END)}),b0=Te.extend({type:w.literal(M.TOOL_CALL_START),toolCallId:w.string(),toolCallName:w.string(),parentMessageId:w.string().optional()}),w0=Te.extend({type:w.literal(M.TOOL_CALL_ARGS),toolCallId:w.string(),delta:w.string()}),A0=Te.extend({type:w.literal(M.TOOL_CALL_END),toolCallId:w.string()}),x0=Te.extend({messageId:w.string(),type:w.literal(M.TOOL_CALL_RESULT),toolCallId:w.string(),content:w.string(),role:w.literal("tool").optional()}),C0=Te.extend({type:w.literal(M.TOOL_CALL_CHUNK),toolCallId:w.string().optional(),toolCallName:w.string().optional(),parentMessageId:w.string().optional(),delta:w.string().optional()}),E0=Te.extend({type:w.literal(M.THINKING_START),title:w.string().optional()}),R0=Te.extend({type:w.literal(M.THINKING_END)}),I0=Te.extend({type:w.literal(M.STATE_SNAPSHOT),snapshot:e0}),T0=Te.extend({type:w.literal(M.STATE_DELTA),delta:w.array(w.any())}),_0=Te.extend({type:w.literal(M.MESSAGES_SNAPSHOT),messages:w.array(Tv)}),k0=Te.extend({type:w.literal(M.ACTIVITY_SNAPSHOT),messageId:w.string(),activityType:w.string(),content:w.record(w.any()),replace:w.boolean().optional().default(!0)}),O0=Te.extend({type:w.literal(M.ACTIVITY_DELTA),messageId:w.string(),activityType:w.string(),patch:w.array(w.any())}),P0=Te.extend({type:w.literal(M.RAW),event:w.any(),source:w.string().optional()}),N0=Te.extend({type:w.literal(M.CUSTOM),name:w.string(),value:w.any()}),F0=Te.extend({type:w.literal(M.RUN_STARTED),threadId:w.string(),runId:w.string(),parentRunId:w.string().optional(),input:J_.optional()}),D0=w.object({type:w.literal("success")}).strict(),M0=w.object({type:w.literal("interrupt"),interrupts:w.array(X_).min(1)}).strict(),q0=w.discriminatedUnion("type",[D0,M0]),j0=Te.extend({type:w.literal(M.RUN_FINISHED),threadId:w.string(),runId:w.string(),result:w.any().optional(),outcome:q0.nullable().optional().transform(e=>e??void 0)}),L0=Te.extend({type:w.literal(M.RUN_ERROR),message:w.string(),code:w.string().optional()}),U0=Te.extend({type:w.literal(M.STEP_STARTED),stepName:w.string()}),V0=Te.extend({type:w.literal(M.STEP_FINISHED),stepName:w.string()}),B0=w.union([w.literal("tool-call"),w.literal("message")]),G0=Te.extend({type:w.literal(M.REASONING_START),messageId:w.string()}),$0=Te.extend({type:w.literal(M.REASONING_MESSAGE_START),messageId:w.string(),role:w.literal("reasoning")}),Q0=Te.extend({type:w.literal(M.REASONING_MESSAGE_CONTENT),messageId:w.string(),delta:w.string()}),H0=Te.extend({type:w.literal(M.REASONING_MESSAGE_END),messageId:w.string()}),z0=Te.extend({type:w.literal(M.REASONING_MESSAGE_CHUNK),messageId:w.string().optional(),delta:w.string().optional()}),W0=Te.extend({type:w.literal(M.REASONING_END),messageId:w.string()}),K0=Te.extend({type:w.literal(M.REASONING_ENCRYPTED_VALUE),subtype:B0,entityId:w.string(),encryptedValue:w.string()}),hc=w.discriminatedUnion("type",[m0,Ov,g0,h0,E0,R0,y0,v0,S0,b0,w0,A0,C0,x0,I0,T0,_0,k0,O0,P0,N0,F0,j0,L0,U0,V0,G0,$0,Q0,H0,z0,W0,K0]);m();d();f();p();var _p={};ti(_p,{JsonPatchError:()=>Ge,_areEquals:()=>ia,applyOperation:()=>_n,applyPatch:()=>xc,applyReducer:()=>ek,deepClone:()=>Z0,getValueByPointer:()=>wc,validate:()=>Nv,validator:()=>Ac});m();d();f();p();m();d();f();p();var Y0=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),X0=Object.prototype.hasOwnProperty;function vc(e,t){return X0.call(e,t)}function Sc(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)vc(e,o)&&n.push(o);return n}function at(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function bc(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 er(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function na(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function yc(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(yc(e[t]))return!0}else if(typeof e=="object"){for(var n=Sc(e),o=n.length,i=0;i<o;i++)if(yc(e[n[i]]))return!0}}return!1}function Pv(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(`
31
+ `;function qE(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var jE=["1",1,"yes",!0];function Cs(){let e=[];return id()&&e.push(window.doNotTrack),vd()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>jE.indexOf(t)!==-1)}var $g="v15",Qg={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 LE(e=Qg.default,t=$g,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 UE="38824e1f-37f5-42d3-8372-a4b8fa9df946",Yt=class{get defaultOptions(){return{endpoint:Qg.default,isCustomEndpoint:!1,token:"",version:$g,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Ug}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=[TC,xC].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};Cs()?this.runtime=new xs:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Ae.view,{newEventType:Ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.click,{newEventType:Ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.custom,{newEventType:Ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.search,{newEventType:Ae.search,addClientIdParameter:!0})}initRuntime(t){return id()&&uo()?new hd(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(qE()&&console.warn(ME),new yd(t))}get storage(){return this.runtime.storage}determineVisitorId(){return U(this,void 0,void 0,function*(){try{return id()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||sn()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),sn()}})}getCurrentVisitorId(){return U(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return U(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return U(this,void 0,void 0,function*(){if(Ss(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Ig(t,Ig(r,UE)))}})}getParameters(t,...r){return U(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return U(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(sn()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Cs())return null;try{let r=new URL(t).searchParams.get(Rr.cvo_cid);if(r==null)return null;let n=Rr.fromString(r);return!n||!uo()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return U(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>U(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>i?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((y,S)=>U(this,void 0,void 0,function*(){let C=yield y;return yield S(t,C)}),h)].reduce((h,y)=>U(this,void 0,void 0,function*(){let S=yield h;return yield y(S)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return U(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?RE(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,E)=>U(this,void 0,void 0,function*(){let h=yield v;return yield E(h)}),Promise.resolve(r))})}makeEvent(t,...r){return U(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>U(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(s=>s(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return U(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return U(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 vs().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.search,t)})}sendSearchEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=ur(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.click,t)})}sendClickEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=ur(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.custom,t)})}sendCustomEvent(t){return U(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=ur(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.view,t)})}sendViewEvent(t){return U(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return U(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return U(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[Ae.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(kE(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=ur(t,["custom"]),o={};r&&ys(r)&&(o=this.lowercaseKeys(r));let i=OE(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=ur(t,["custom"]);if(r&&ys(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=ur(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Ae.view||r==Ae.click||r==Ae.search||r==Ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Ae.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=ur(t,["userId"]);return DE(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=ur(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&ys(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&ys(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"?GC(t,r):t}get baseUrl(){return LE(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},lr;(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"})(lr||(lr={}));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 Fg={[$.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",[lr.expandToFullUI]:"interface",[lr.openUserActions]:"User Actions",[lr.showPrecedingSessions]:"User Actions",[lr.showFollowingSessions]:"User Actions",[lr.clickViewedDocument]:"User Actions",[lr.clickPageView]:"User Actions",[lr.createArticle]:"createArticle"},fo=class{constructor(){this.runtime=new xs,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(Ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Ug}};function VE(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function BE(e){return e.map(t=>t.replace(/;/g,""))}function Hg(e){let r=e.join(";");return r.length<=256?r:Hg(e.slice(1))}var Dg=e=>{let t=BE(e),r=VE(t);return Hg(r)};function Mg(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Dg(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Dg(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Es=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Cs();this.coveoAnalyticsClient=n?new fo:new Yt(t)}disable(){this.coveoAnalyticsClient=new fo}enable(){this.coveoAnalyticsClient=new Yt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return U(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,Mg(t))}logOmniboxAnalytics(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,Mg(t))}logOmniboxFromLink(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return U(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return U(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 U(this,arguments,void 0,function*(n,o,i=Fg[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),s=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),u=yield this.coveoAnalyticsClient.makeCustomEvent(s);return{description:this.makeEventDescription(u,n),log:({searchUID:c})=>u.log({lastSearchQueryUid:c})}})}logCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,i=Fg[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({lastSearchQueryUid:s})}})}logCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return U(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({searchQueryUid:s})}})}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return U(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 U(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 Yt?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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Rs=Object.assign({},_i),qg=Object.keys(Rs).map(e=>Rs[e]),lo=class extends cd{constructor({client:t,uuidGenerator:r=sn}){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])=>qg.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(qg.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Rs.pageview,{newEventType:Ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Rs.event,{newEventType:Ae.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return WC(this.ticket)}};lo.Id="svc";var Is;(function(e){e.click="click",e.flowStart="flowStart"})(Is||(Is={}));var Tt;(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"})(Tt||(Tt={}));var Ts;(function(e){e.quit="Quit",e.solved="Solved"})(Ts||(Ts={}));var _s=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Cs();this.coveoAnalyticsClient=o?new Yt(t):new fo,this.svc=new lo({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new fo,this.svc=new lo({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Yt(this.options),this.svc=new lo({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(Tt.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(Tt.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(Tt.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(Tt.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(Tt.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(Tt.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(Tt.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(Tt.caseCancelled,{reason:Ts.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(Tt.caseSolved,{reason:Ts.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(Tt.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Is.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Is.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return U(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 Yt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){var i,a;let s=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(s)})}};var zg=e=>new Yt(e).getCurrentVisitorId(),Pi=(e,t)=>typeof t=="function"?(...r)=>{let n=ai(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Ni=(e,t)=>(...r)=>{let n=ai(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function ks(){return{desiredCount:5,numberOfValues:8,set:{}}}m();d();f();p();m();d();f();p();m();d();f();p();function Wg(e){let{activeValue:t,ancestryMap:r}=GE(e);return t?$E(t,r):[]}function GE(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 $E(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var QE=(e,t)=>e.categoryFacetSet[t]?.request;var wd=(e,t)=>{let r=QE(e,t);return Wg(r?.currentValues??[])};m();d();f();p();function Os(){return{}}m();d();f();p();function Ps(){return{}}m();d();f();p();function Ns(){return{}}m();d();f();p();function Fs(){return{}}function Ad(e){return{facetSet:e.facetSet??Fs(),categoryFacetSet:e.categoryFacetSet??Os(),dateFacetSet:e.dateFacetSet??Ps(),numericFacetSet:e.numericFacetSet??Ns(),automaticFacetSet:e.automaticFacetSet??ks()}}var xd=e=>{let t=[];return WE(e).forEach((r,n)=>{let o=rR(e,r.facetId),i=eR(r,n+1);if(zE(r)){if(!!!wd(e,r.facetId).length)return;t.push({...i,...ZE(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,s)=>{if(a.state==="idle")return;let u=Kg(a,s+1,o),c=HE(r)?Yg(a):YE(a);t.push({...i,...u,...c})})}),KE(e).forEach((r,n)=>{let o=JE(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let s=Kg(i,a+1,"specific"),u=Yg(i);t.push({...o,...s,...u})})}),t},HE=e=>e.type==="specific",zE=e=>e.type==="hierarchical",WE=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),KE=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Kg=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),YE=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Yg=e=>({displayValue:e.value,value:e.value}),XE=(e,t)=>wd(e,t).map(n=>n.value).join(";"),ZE=(e,t)=>{let n=XE(e,t);return{value:n,valuePosition:1,displayValue:n}},JE=(e,t)=>({title:Xg(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),eR=(e,t)=>({title:Xg(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Xg=(e,t)=>`${e}_${t}`,tR=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,rR=(e,t)=>{let r=tR(e,t);return r?r.type:"specific"};m();d();f();p();m();d();f();p();var Cd=e=>e.configuration.search.locale,Zg=e=>e.configuration.search.timezone,Jg=e=>e.configuration.accessToken,eh=e=>e.configuration.organizationId,th=e=>e.configuration.environment,Ds=e=>e.configuration?.knowledge?.agentId,rh=e=>e.configuration.knowledge.debugAgentSession;var cn=e=>{if(nR(e)||Ed(e))return e.generatedAnswer?.answerId;if(oR(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},nR=e=>"answer"in e&&"generatedAnswer"in e&&!se(e.generatedAnswer?.answerConfigurationId),Ed=e=>{let t=Ds(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},oR=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",Rd=e=>e.generatedAnswer?.fieldsToIncludeInCitations,nh=e=>e.followUpAnswers?.conversationId,iR=e=>e.generatedAnswer?.citations,aR=e=>e.followUpAnswers?.followUpAnswers,sR=Be(aR,e=>e?.flatMap(t=>t.citations)),cR=(e,t)=>t,uR=Be(iR,sR,cR,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));m();d();f();p();var At=()=>({q:"",enableQuerySyntax:!1});m();d();f();p();m();d();f();p();var oh=(r=>(r.Ascending="ascending",r.Descending="descending",r))(oh||{}),ih=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(ih||{}),Id=e=>{if(Wf(e))return e.map(t=>Id(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""}},ah=()=>({by:"relevancy"});var fV=new ne({values:{by:new wl({enum:ih,required:!0}),order:new wl({enum:oh}),field:new z}});function Ms(){return Id(ah())}m();d();f();p();m();d();f();p();var mo=()=>"default";var lR=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},dr=class{constructor(t){ie(this,"getState",t);ie(this,"state");this.state=t()}getLanguage(){return lR(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let s=`context_${i}`;o[s]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Jn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||mo()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var Fi=class Fi extends dr{constructor(){super(...arguments);ie(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 xd(Ad(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Fi.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||$t().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Fi.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=cn(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Ms()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(c=>c.expression),a=o.partialQueries.length-1,s=o.partialQueries[a]||"",u=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:s,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:u}}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||At().q}get responseTime(){return this.state.search?.duration||$t().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||$t().response.totalCountFiltered}};ie(Fi,"fallbackPipelineName","default");var Ir=Fi,sh=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??Et(i.configuration.organizationId,i.configuration.environment,"analytics"),u=i.configuration.analytics.runtimeEnvironment,c=i.configuration.analytics.enabled,g=new Es({token:a,endpoint:s,runtimeEnvironment:u,preprocessRequest:Pi(e,n),beforeSendHooks:[Ni(e,r),(v,E)=>(e.info({...E,type:v,endpoint:s,token:a},"Analytics request"),E)]},o);return c||g.disable(),g},Td=()=>{let t=It.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var qs=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield zg(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}),...(Td()&&{pageId:Td()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:co(e)})}}});return function qs(_x17,_x18){return _ref10.apply(this,arguments)}}();m();d();f();p();m();d();f();p();m();d();f();p();var go=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Di=class extends dr{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:At().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||go().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||go().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||go().recommendations.length}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function ch(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}m();d();f();p();m();d();f();p();m();d();f();p();var uh=/^(?:[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 dR(e){return typeof e=="string"&&uh.test(e)}var _d=dR;m();d();f();p();var nt=[];for(let e=0;e<256;++e)nt.push((e+256).toString(16).slice(1));function lh(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()}m();d();f();p();var kd,pR=new Uint8Array(16);function Od(){if(!kd){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");kd=crypto.getRandomValues.bind(crypto)}return kd(pR)}m();d();f();p();m();d();f();p();var fR=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Pd={randomUUID:fR};function mR(e,t,r){e=e||{};let n=e.random??e.rng?.()??Od();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 lh(n)}function gR(e,t,r){return Pd.randomUUID&&!t&&!e?Pd.randomUUID():mR(e,t,r)}var Nd=gR;function hR(_x19){return _hR.apply(this,arguments)}function _hR(){_hR=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _hR.apply(this,arguments)}var hh="2.1.2",Fd=128,yh=192,dh=224,ph=240,yR=248;function vR(e){return(e&yR)===ph?4:(e&ph)===dh?3:(e&dh)===yh?2:1}function SR(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&Fd)!=Fd)break;if(r-=3,(n&yh)!=Fd){t-r>=vR(n)*3&&(r=t);break}}return e.substring(0,r)}function bR(e){let{trackingId:t}=e;return{trackingId:t}}function wR(e){return(e.source||[]).concat([`relay@${hh}`])}function vh(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=bR(t),s=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:wR(t),clientId:s,userAgent:i(),referrer:fh(n()),location:fh(o())})}function fh(e){return e!==null?SR(e,1024):null}function AR(e,t,r,n){return{...t,meta:vh(e,r,n)}}var xR="*";function CR(){let e=[];function t({type:u,callback:c}){return e.findIndex(g=>g.type===u&&g.callback===c)}function r(u,c){return u.type==="*"||c===u.type}function n(u){return t(u)<0&&e.push(u),()=>s(u.type,u.callback)}function o(u){e.forEach(c=>{if(r(c,u.meta.type))try{c.callback(u)}catch(g){console.error(g)}})}function i(u){if(u===xR)e.length=0;else for(let c=e.length-1;c>=0;c--)e[c].type===u&&e.splice(c,1)}function a(u){let c=t(u);c>=0&&e.splice(c,1)}function s(u,c){c?a({type:u,callback:c}):i(u)}return{add:n,call:o,remove:s}}function mh({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 ER(e){let t=mh(e);return{get:()=>t,update:r=>{t=mh({...t,...r})}}}var Dd=RR();function RR(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function IR(){return{getItem(e){return Dd.getItem(e)||localStorage.getItem(e)},removeItem(e){Dd.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Dd.setItem(e,t,31556952e3)}}}var gh="visitorId";function TR(){let e=document.referrer;return e===""?null:e}function Md(){let e=IR();return{runtime:"browser",send:function(){var _ref11=_asyncToGenerator(function*(t,r,n){let o=A(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});ch().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let s;try{s=yield a.json()}catch{return}for(let u of s.events)if(!u.accepted)throw new Error(`Received event was rejected for processing: ${u.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x20,_x21,_x22){return _ref11.apply(this,arguments)}}(),getReferrer:()=>TR(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(gh);if(t&&_d(t))return t;let r=Nd();return e.setItem(gh,r),r}}}function _R(){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 kR(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function OR(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=kR();return t&&r?{...r,runtime:"custom"}:t&&PR()&&_R()?Md():n}function PR(){try{return typeof window=="object"}catch{return!1}}function NR(e){return{get:()=>Object.freeze(OR(e))}}function Sh(e){let t=ER(e),r=CR(),n=NR(t);return{emit:function(){var _ref12=_asyncToGenerator(function*(o,i){let a=t.get(),s=n.get(),u=AR(o,i,a,s);return hR({config:a,environment:s,event:u,listenerManager:r})});return function emit(_x23,_x24){return _ref12.apply(this,arguments)}}(),getMeta:o=>vh(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:hh}}m();d();f();p();function bh(){return typeof window<"u"&&typeof document<"u"}var Mi=Be(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>co(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,s)=>{let u=DR(s);return Sh({mode:i?"emit":"disabled",url:o??ka(e,t),token:r,trackingId:n??null,source:a,environment:u})}),FR={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref13=_asyncToGenerator(function*(){});return function send(){return _ref13.apply(this,arguments)}}()},DR=e=>{if(!e)return;let t=e();return{...(bh()?Md():FR),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};m();d();f();p();var qi=class extends dr{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},wh=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new qi(t)})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??Et(i.configuration.organizationId,i.configuration.environment,"analytics"),u=i.configuration.analytics.runtimeEnvironment,c=i.configuration.analytics.enabled,g=new _s({enableAnalytics:c,token:a,endpoint:s,runtimeEnvironment:u,preprocessRequest:Pi(e,n),beforeSendHooks:[Ni(e,r),(v,E)=>(e.info({...E,type:v,endpoint:s,token:a},"Analytics request"),E)]},o);return c||g.disable(),g};m();d();f();p();m();d();f();p();function xh(e,t){return{...new Ir(t).getBaseMetadata(),actionCause:e,type:e}}function MR(e){return Object.assign(e,{instantlyCallable:!0})}function qR(e,t){let r=i=>{let a=Ie(e,i);return MR(Object.assign(a,{type:a.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(i,{getState:a,extra:s}){let{analyticsClientMiddleware:u,preprocessRequest:c,logger:g}=s;return yield(yield t({getState:a,analyticsClientMiddleware:u,preprocessRequest:c,logger:g})).log({state:a(),extra:s})});return function(_x25,_x26){return _ref14.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref15=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:u}){let{description:c,log:g}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:u});return{description:c,action:r(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(v,{getState:E,extra:h}){return yield g({state:E(),extra:h})});return function(_x28,_x29){return _ref16.apply(this,arguments)}}())}});return function prepare(_x27){return _ref15.apply(this,arguments)}}()}),n}var Ch=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return UR(i)}return n},jR=e=>e.configuration.analytics.analyticsMode==="legacy",LR=e=>e.configuration.analytics.analyticsMode==="next",UR=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=s=>new a(s)),qR(e,/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*({getState:s,analyticsClientMiddleware:u,preprocessRequest:c,logger:g}){let v=[],E={log:function(){var _ref18=_asyncToGenerator(function*({state:R}){for(let T of v)yield T(R)});return function log(_x31){return _ref18.apply(this,arguments)}}()},h=s(),y=i({getState:s,logger:g,analyticsClientMiddleware:u,preprocessRequest:c,provider:r(s)}),S=yield t(y,s());E.description=S?.description,v.push(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(R){jR(R)&&(yield VR(S,r,R,g,y.coveoAnalyticsClient))});return function(_x32){return _ref19.apply(this,arguments)}}());let{emit:C}=Mi(h);return v.push(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(R){if(LR(R)&&o&&n){let T=n(R);yield WR(C,o,T)}});return function(_x33){return _ref20.apply(this,arguments)}}()),E});return function(_x30){return _ref17.apply(this,arguments)}}()));function VR(_x34,_x35,_x36,_x37,_x38){return _VR.apply(this,arguments)}function _VR(){_VR=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _VR.apply(this,arguments)}var BR=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref21=_asyncToGenerator(function*(i){r(n,o)});return function log(_x39){return _ref21.apply(this,arguments)}}()}),ft=Ch(e=>sh({...e,provider:e.provider||new Ir(e.getState)}),e=>e,Ir),xB=Ch(wh,BR("caseAssist"),qi);var qd=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return GR(e,r,t)};function GR(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:HR(e),...(Ah(e)?{documentCategory:Ah(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:zR(e),queryPipeline:r.pipeline||oo()}}function Ah(e){return e.raw?.objecttype||void 0}var js=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||""}),Eh={urihash:new z,sourcetype:new z,permanentid:new z},Rh={uniqueId:Y,raw:new ne({values:Eh}),title:Y,uri:Y,clickUri:Y,rankingModifier:new z({required:!1,emptyAllowed:!0})};function $R(e){return Object.assign({},...Object.keys(Eh).map(t=>({[t]:e[t]})))}function QR(e){return Object.assign({},...Object.keys(Rh).map(t=>({[t]:e[t]})),{raw:$R(e.raw)})}function HR(e){let t=e.raw.author;return se(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function zR(e){let t=e.raw.source;return se(t)?"unknown":t}var jd=e=>new mt(Rh).validate(QR(e));function WR(_x40,_x41,_x42){return _WR.apply(this,arguments)}function _WR(){_WR=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _WR.apply(this,arguments)}m();d();f();p();var Ih=()=>ft("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Di(e)),Th=()=>({actionCause:"recommendationInterfaceLoad"}),Us=e=>ft({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(jd(e),t.makeRecommendationOpen(qd(e,r),js(e))),__legacy__provider:t=>new Di(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=qd(e,t),n=js(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var ho=O("recommendation/set",e=>B(e,{id:Y})),Tr=Ie("recommendation/get",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield KR(o),s=yield n.recommendations(a),u=Date.now()-i;return gt(s)?r(s.error):{recommendations:s.success.results,analyticsAction:Ih(),duration:u,searchUid:s.success.searchUid,splitTestRun:s.success.splitTestRun,pipeline:s.success.pipeline}});return function(_x43,_x44){return _ref22.apply(this,arguments)}}()),KR=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??br(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?It.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield YR(e,Th()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function KR(_x45){return _ref23.apply(this,arguments)}}(),YR=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield qs(e.configuration.analytics,r)});return function YR(_x46,_x47){return _ref24.apply(this,arguments)}}();var yo=Ue(go(),e=>{e.addCase(ho,(t,r)=>{t.id=r.payload.id}).addCase(Tr.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(Tr.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(Tr.pending,t=>{t.isLoading=!0}).addCase(fs,(t,r)=>{t.error=r.payload,t.isLoading=!1})});m();d();f();p();var vo=O("searchHub/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();var So=Ue(mo(),e=>{e.addCase(vo,(t,r)=>r.payload).addCase(ht.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Wt,(t,r)=>r.payload.searchHub||t)});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var _h=class extends Error{constructor(t){super(t[0].message);ie(this,"issues");this.name="SchemaError",this.issues=t}};var fr="uninitialized",Vd="pending",Li="fulfilled",Ui="rejected";function kh(e){return{status:e,isUninitialized:e===fr,isLoading:e===Vd,isSuccess:e===Li,isError:e===Ui}}var Oh=Qt;function Qh(e,t){if(e===t||!(Oh(e)&&Oh(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Qh(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function Bd(e,t,r){return e.reduce((n,o,i)=>(t(o,i)&&n.push(r(o,i)),n),[]).flat()}function XR(e){return new RegExp("(^|:)//").test(e)}function ZR(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Hd(e){return e!=null}function Ph(e){return[...(e?.values()??[])].filter(Hd)}function JR(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var eI=e=>e.replace(/\/$/,""),tI=e=>e.replace(/^\//,"");function rI(e,t){if(!e)return t;if(!t)return e;if(XR(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=eI(e),t=tI(t),`${e}${r}${t}`}function Gs(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Gd=()=>new Map,nI=e=>{let t=new l.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},oI=(...e)=>{for(let r of e)if(r.aborted)return l.AbortSignal.abort(r.reason);let t=new l.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},Nh=(...e)=>A(...e),iI=e=>e.status>=200&&e.status<=299,aI=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Fh(e){if(!Qt(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var sI=e=>typeof e=="object"&&(Qt(e)||Array.isArray(e)||typeof e.toJSON=="function");function Hh({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=Nh,paramsSerializer:n,isJsonContentType:o=aI,jsonContentType:i="application/json",jsonReplacer:a,timeout:s,responseHandler:u,validateStatus:c,...g}={}){return typeof A>"u"&&r===Nh&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(E,h,y){let{getState:S,extra:C,endpoint:R,forced:T,type:I}=h,k,{url:_,headers:D=new x(g.headers),params:G=void 0,responseHandler:L=u??"json",validateStatus:j=c??iI,timeout:V=s,...q}=typeof E=="string"?{url:E}:E,P={...g,signal:V?oI(h.signal,nI(V)):h.signal,...q};D=new x(Fh(D)),P.headers=(yield t(D,{getState:S,arg:E,extra:C,endpoint:R,forced:T,type:I,extraOptions:y}))||D;let N=sI(P.body);if(P.body!=null&&!N&&typeof P.body!="string"&&P.headers.delete("content-type"),!P.headers.has("content-type")&&N&&P.headers.set("content-type",i),N&&o(P.headers)&&(P.body=JSON.stringify(P.body,a)),P.headers.has("accept")||(L==="json"?P.headers.set("accept","application/json"):L==="text"&&P.headers.set("accept","text/plain, text/html, */*")),G){let te=~_.indexOf("?")?"&":"?",ue=n?n(G):new URLSearchParams(Fh(G));_+=te+ue}_=rI(e,_);let F=new Request(_,P);k={request:new Request(_,P)};let Q;try{Q=yield r(F)}catch(te){return{error:{status:(te instanceof Error||typeof DOMException<"u"&&te instanceof DOMException)&&te.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(te)},meta:k}}let Z=Q.clone();k.response=Z;let X,W="";try{let te;if(yield Promise.all([v(Q,L).then(ue=>X=ue,ue=>te=ue),Z.text().then(ue=>W=ue,()=>{})]),te)throw te}catch(te){return{error:{status:"PARSING_ERROR",originalStatus:Q.status,data:W,error:String(te)},meta:k}}return j(Q,X)?{data:X,meta:k}:{error:{status:Q.status,data:X},meta:k}});return function(_x48,_x49,_x50){return _ref25.apply(this,arguments)}}());function v(_x51,_x52){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(E,h){if(typeof h=="function")return h(E);if(h==="content-type"&&(h=o(E.headers)?"json":"text"),h==="json"){let y=yield E.text();return y.length?JSON.parse(y):null}return E.text()});return _v2.apply(this,arguments)}}var bo=class{constructor(e,t=void 0){ie(this,"value");ie(this,"meta");this.value=e,this.meta=t}};function cI(){return _cI.apply(this,arguments)}function _cI(){_cI=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((i,a)=>{let s=setTimeout(()=>i(),o);if(r){let u=()=>{clearTimeout(s),a(new Error("Aborted"))};r.aborted?(clearTimeout(s),a(new Error("Aborted"))):r.addEventListener("abort",u,{once:!0})}})});return _cI.apply(this,arguments)}function zh(e,t){throw Object.assign(new bo({error:e,meta:t}),{throwImmediately:!0})}function Ld(e){e.aborted&&zh({status:"CUSTOM_ERROR",error:"Aborted"})}var Dh={},uI=(e,t)=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Dh).maxRetries,(o||Dh).maxRetries].filter(g=>g!==void 0),[a]=i.slice(-1),u={maxRetries:a,backoff:cI,retryCondition:(g,v,{attempt:E})=>E<=a,...t,...o},c=0;for(;;){Ld(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new bo(g);return g}catch(g){if(c++,g.throwImmediately){if(g instanceof bo)return g.value;throw g}if(g instanceof bo){if(!u.retryCondition(g.value.error,r,{attempt:c,baseQueryApi:n,extraOptions:o}))return g.value}else if(c>u.maxRetries)return{error:g};Ld(n.signal);try{yield u.backoff(c,u.maxRetries,n.signal)}catch(v){throw Ld(n.signal),v}}}});return function(_x53,_x54,_x55){return _ref26.apply(this,arguments)}}()),Wh=Object.assign(uI,{fail:zh}),Qs="__rtkq/",lI="online",dI="offline";var Kh="focused";var zd=O(`${Qs}${Kh}`),Yh=O(`${Qs}un${Kh}`),Wd=O(`${Qs}${lI}`),Xh=O(`${Qs}${dI}`);var Gi="query",Zh="mutation",Jh="infinitequery";function Hs(e){return e.type===Gi}function pI(e){return e.type===Zh}function zs(e){return e.type===Jh}function $s(e){return Hs(e)||zs(e)}function Kd(e,t,r,n,o,i){let a=fI(e)?e(t,r,n,o):e;return a?Bd(a,Hd,s=>i(ey(s))):[]}function fI(e){return typeof e=="function"}function ey(e){return typeof e=="string"?{type:e}:e}function mI(e,t){return e.catch(t)}var wo=(e,t)=>e.endpointDefinitions[t],Vi=Symbol("forceQueryFn"),$d=e=>typeof e[Vi]=="function";function gI({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i,getInternalState:a}){let s=_=>a(_)?.runningQueries,u=_=>a(_)?.runningMutations,{unsubscribeQueryResult:c,removeMutationResult:g,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:T,buildInitiateInfiniteQuery:I,buildInitiateMutation:k,getRunningQueryThunk:E,getRunningMutationThunk:h,getRunningQueriesThunk:y,getRunningMutationsThunk:S};function E(_,D){return G=>{let L=wo(i,_),j=e({queryArgs:D,endpointDefinition:L,endpointName:_});return s(G)?.get(j)}}function h(_,D){return G=>u(G)?.get(D)}function y(){return _=>Ph(s(_))}function S(){return _=>Ph(u(_))}function C(_){}function R(_,D){let G=(L,{subscribe:j=!0,forceRefetch:V,subscriptionOptions:q,[Vi]:P,...N}={})=>(F,H)=>{let Q=e({queryArgs:L,endpointDefinition:D,endpointName:_}),Z,X={...N,type:Gi,subscribe:j,forceRefetch:V,subscriptionOptions:q,endpointName:_,originalArgs:L,queryCacheKey:Q,[Vi]:P};if(Hs(D))Z=t(X);else{let{direction:fe,initialPageParam:be,refetchCachedPages:he}=N;Z=r({...X,direction:fe,initialPageParam:be,refetchCachedPages:he})}let W=o.endpoints[_].select(L),te=F(Z),ue=W(H());let{requestId:Ee,abort:Me}=te,ke=ue.requestId!==Ee,Pe=s(F)?.get(Q),Ne=()=>W(H()),ge=Object.assign(P?te.then(Ne):ke&&!Pe?Promise.resolve(ue):Promise.all([Pe,te]).then(Ne),{arg:L,requestId:Ee,subscriptionOptions:q,queryCacheKey:Q,abort:Me,unwrap(){return _asyncToGenerator(function*(){let fe=yield ge;if(fe.isError)throw fe.error;return fe.data})()},refetch:fe=>F(G(L,{subscribe:!1,forceRefetch:!0,...fe})),unsubscribe(){j&&F(c({queryCacheKey:Q,requestId:Ee}))},updateSubscriptionOptions(fe){ge.subscriptionOptions=fe,F(v({endpointName:_,requestId:Ee,queryCacheKey:Q,options:fe}))}});if(!Pe&&!ke&&!P){let fe=s(F);fe.set(Q,ge),ge.then(()=>{fe.delete(Q)})}return ge};return G}function T(_,D){return R(_,D)}function I(_,D){return R(_,D)}function k(_){return(D,{track:G=!0,fixedCacheKey:L}={})=>(j,V)=>{let q=n({type:"mutation",endpointName:_,originalArgs:D,track:G,fixedCacheKey:L}),P=j(q);let{requestId:N,abort:F,unwrap:H}=P,Q=mI(P.unwrap().then(te=>({data:te})),te=>({error:te})),Z=()=>{j(g({requestId:N,fixedCacheKey:L}))},X=Object.assign(Q,{arg:P.arg,requestId:N,abort:F,unwrap:H,reset:Z}),W=u(j);return W.set(N,X),X.then(()=>{W.delete(N)}),L&&(W.set(L,X),X.then(()=>{W.get(L)===X&&W.delete(L)})),X}}}var ty=class extends _h{constructor(t,r,n,o){super(t);ie(this,"value");ie(this,"schemaName");ie(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},un=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function ln(_x56,_x57,_x58,_x59){return _ln.apply(this,arguments)}function _ln(){_ln=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new ty(o.issues,t,r,n);return o.value});return _ln.apply(this,arguments)}function Mh(e){return e}var ji=(e={})=>({...e,[Ei]:!0});function hI({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a,onSchemaFailure:s,catchSchemaFailure:u,skipSchemaValidation:c}){let g=(q,P,N,F)=>(H,Q)=>{let Z=r[q],X=n({queryArgs:P,endpointDefinition:Z,endpointName:q});if(H(o.internalActions.queryResultPatched({queryCacheKey:X,patches:N})),!F)return;let W=o.endpoints[q].select(P)(Q()),te=Kd(Z.providesTags,W.data,void 0,P,{},i);H(o.internalActions.updateProvidedBy([{queryCacheKey:X,providedTags:te}]))};function v(q,P,N=0){let F=[P,...q];return N&&F.length>N?F.slice(0,-1):F}function E(q,P,N=0){let F=[...q,P];return N&&F.length>N?F.slice(1):F}let h=(q,P,N,F=!0)=>(H,Q)=>{let X=o.endpoints[q].select(P)(Q()),W={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(q,P,W.inversePatches,F))};if(X.status===fr)return W;let te;if("data"in X)if(dt(X.data)){let[ue,Ee,Me]=Ql(X.data,N);W.patches.push(...Ee),W.inversePatches.push(...Me),te=ue}else te=N(X.data),W.patches.push({op:"replace",path:[],value:te}),W.inversePatches.push({op:"replace",path:[],value:X.data});return W.patches.length===0||H(o.util.patchQueryData(q,P,W.patches,F)),W},y=(q,P,N)=>F=>F(o.endpoints[q].initiate(P,{subscribe:!1,forceRefetch:!0,[Vi]:()=>({data:N})})),S=(q,P)=>q.query&&q[P]?q[P]:Mh,C=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(q,{signal:P,abort:N,rejectWithValue:F,fulfillWithValue:H,dispatch:Q,getState:Z,extra:X}){let W=r[q.endpointName],{metaSchema:te,skipSchemaValidation:ue=c}=W,Ee=q.type===Gi;try{let Me=Mh,ke={signal:P,abort:N,dispatch:Q,getState:Z,extra:X,endpoint:q.endpointName,type:q.type,forced:Ee?R(q,Z()):void 0,queryCacheKey:Ee?q.queryCacheKey:void 0},Pe=Ee?q[Vi]:void 0,Ne,ge=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(be,he,$e,He){if(he==null&&be.pages.length)return Promise.resolve({data:be});let Ft={queryArg:q.originalArgs,pageParam:he},bt=yield fe(Ft),Bt=He?v:E;return{data:{pages:Bt(be.pages,bt.data,$e),pageParams:Bt(be.pageParams,he,$e)},meta:bt.meta}});return function ge(_x62,_x63,_x64,_x65){return _ref28.apply(this,arguments)}}();function fe(_x66){return _fe.apply(this,arguments)}function _fe(){_fe=_asyncToGenerator(function*(be){let he,{extraOptions:$e,argSchema:He,rawResponseSchema:Ft,responseSchema:bt}=W;if(He&&!un(ue,"arg")&&(be=yield ln(He,be,"argSchema",{})),Pe?he=Pe():W.query?(Me=S(W,"transformResponse"),he=yield t(W.query(be),ke,$e)):he=yield W.queryFn(be,ke,$e,Dt=>t(Dt,ke,$e)),typeof process<"u",he.error)throw new bo(he.error,he.meta);let{data:Bt}=he;Ft&&!un(ue,"rawResponse")&&(Bt=yield ln(Ft,he.data,"rawResponseSchema",he.meta));let Ct=yield Me(Bt,he.meta,be);return bt&&!un(ue,"response")&&(Ct=yield ln(bt,Ct,"responseSchema",he.meta)),{...he,data:Ct}});return _fe.apply(this,arguments)}if(Ee&&"infiniteQueryOptions"in W){let{infiniteQueryOptions:be}=W,{maxPages:he=1/0}=be,$e=q.refetchCachedPages??be.refetchCachedPages??!0,He,Ft={pages:[],pageParams:[]},bt=a.selectQueryEntry(Z(),q.queryCacheKey)?.data,Ct=R(q,Z())&&!q.direction||!bt?Ft:bt;if("direction"in q&&q.direction&&Ct.pages.length){let Dt=q.direction==="backward",wa=(Dt?ry:Qd)(be,Ct,q.originalArgs);He=yield ge(Ct,wa,he,Dt)}else{let{initialPageParam:Dt=be.initialPageParam}=q,Jo=bt?.pageParams??[],wa=Jo[0]??Dt,Vw=Jo.length;if(He=yield ge(Ct,wa,he),Pe&&(He={data:He.data.pages[0]}),$e)for(let _f=1;_f<Vw;_f++){let Bw=Qd(be,He.data,q.originalArgs);He=yield ge(He.data,Bw,he)}}Ne=He}else Ne=yield fe(q.originalArgs);return te&&!un(ue,"meta")&&Ne.meta&&(Ne.meta=yield ln(te,Ne.meta,"metaSchema",Ne.meta)),H(Ne.data,ji({fulfilledTimeStamp:Date.now(),baseQueryMeta:Ne.meta}))}catch(Me){let ke=Me;if(ke instanceof bo){let Pe=S(W,"transformErrorResponse"),{rawErrorResponseSchema:Ne,errorResponseSchema:ge}=W,{value:fe,meta:be}=ke;try{Ne&&!un(ue,"rawErrorResponse")&&(fe=yield ln(Ne,fe,"rawErrorResponseSchema",be)),te&&!un(ue,"meta")&&(be=yield ln(te,be,"metaSchema",be));let he=yield Pe(fe,be,q.originalArgs);return ge&&!un(ue,"errorResponse")&&(he=yield ln(ge,he,"errorResponseSchema",be)),F(he,ji({baseQueryMeta:be}))}catch(he){ke=he}}try{if(ke instanceof ty){let Pe={endpoint:q.endpointName,arg:q.originalArgs,type:q.type,queryCacheKey:Ee?q.queryCacheKey:void 0};W.onSchemaFailure?.(ke,Pe),s?.(ke,Pe);let{catchSchemaFailure:Ne=u}=W;if(Ne)return F(Ne(ke,Pe),ji({baseQueryMeta:ke._bqMeta}))}}catch(Pe){ke=Pe}throw typeof process<"u",console.error(ke),ke}});return function C(_x60,_x61){return _ref27.apply(this,arguments)}}();function R(q,P){let N=a.selectQueryEntry(P,q.queryCacheKey),F=a.selectConfig(P).refetchOnMountOrArgChange,H=N?.fulfilledTimeStamp,Q=q.forceRefetch??(q.subscribe&&F);return Q?Q===!0||(Number(new Date)-Number(H))/1e3>=Q:!1}let T=()=>Ie(`${e}/executeQuery`,C,{getPendingMeta({arg:P}){let N=r[P.endpointName];return ji({startedTimeStamp:Date.now(),...(zs(N)?{direction:P.direction}:{})})},condition(P,{getState:N}){let F=N(),H=a.selectQueryEntry(F,P.queryCacheKey),Q=H?.fulfilledTimeStamp,Z=P.originalArgs,X=H?.originalArgs,W=r[P.endpointName],te=P.direction;return $d(P)?!0:H?.status==="pending"?!1:R(P,F)||Hs(W)&&W?.forceRefetch?.({currentArg:Z,previousArg:X,endpointState:H,state:F})?!0:!(Q&&!te)},dispatchConditionRejection:!0}),I=T(),k=T(),_=Ie(`${e}/executeMutation`,C,{getPendingMeta(){return ji({startedTimeStamp:Date.now()})}}),D=q=>"force"in q,G=q=>"ifOlderThan"in q,L=(q,P,N={})=>(F,H)=>{let Q=D(N)&&N.force,Z=G(N)&&N.ifOlderThan,X=(te=!0)=>{let ue={forceRefetch:te,subscribe:!1};return o.endpoints[q].initiate(P,ue)},W=o.endpoints[q].select(P)(H());if(Q)F(X());else if(Z){let te=W?.fulfilledTimeStamp;if(!te){F(X());return}(Number(new Date)-Number(new Date(te)))/1e3>=Z&&F(X())}else F(X(!1))};function j(q){return P=>P?.meta?.arg?.endpointName===q}function V(q,P){return{matchPending:Xn(rs(q),j(P)),matchFulfilled:Xn(sr(q),j(P)),matchRejected:Xn(nn(q),j(P))}}return{queryThunk:I,mutationThunk:_,infiniteQueryThunk:k,prefetch:L,updateQueryData:h,upsertQueryData:y,patchQueryData:g,buildMatchThunkActions:V}}function Qd(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function ry(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function ny(e,t,r,n){return Kd(r[e.meta.arg.endpointName][t],sr(e)?e.payload:void 0,Ii(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function qh(e){return lt(e)?Ka(e):e}function Vs(e,t,r){let n=e[t];n&&r(n)}function Bi(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function jh(e,t,r){let n=e[Bi(t)];n&&r(n)}var Bs={};function yI({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:u,config:c}){let g=O(`${e}/resetApiState`);function v(j,V,q,P){var N;j[N=V.queryCacheKey]??(j[N]={status:fr,endpointName:V.endpointName}),Vs(j,V.queryCacheKey,F=>{F.status=Vd,F.requestId=q&&F.requestId?F.requestId:P.requestId,V.originalArgs!==void 0&&(F.originalArgs=V.originalArgs),F.startedTimeStamp=P.startedTimeStamp;let H=o[P.arg.endpointName];zs(H)&&"direction"in V&&(F.direction=V.direction)})}function E(j,V,q,P){Vs(j,V.arg.queryCacheKey,N=>{if(N.requestId!==V.requestId&&!P)return;let{merge:F}=o[V.arg.endpointName];if(N.status=Li,F){if(N.data!==void 0){let{fulfilledTimeStamp:H,arg:Q,baseQueryMeta:Z,requestId:X}=V,W=tn(N.data,te=>F(te,q,{arg:Q.originalArgs,baseQueryMeta:Z,fulfilledTimeStamp:H,requestId:X}));N.data=W}else N.data=q;}else N.data=o[V.arg.endpointName].structuralSharing??!0?Qh(lt(N.data)?Im(N.data):N.data,q):q;delete N.error,N.fulfilledTimeStamp=V.fulfilledTimeStamp})}let h=on({name:`${e}/queries`,initialState:Bs,reducers:{removeQueryResult:{reducer(j,{payload:{queryCacheKey:V}}){delete j[V]},prepare:Zn()},cacheEntriesUpserted:{reducer(j,V){for(let q of V.payload){let{queryDescription:P,value:N}=q;v(j,P,!0,{arg:P,requestId:V.meta.requestId,startedTimeStamp:V.meta.timestamp}),E(j,{arg:P,requestId:V.meta.requestId,fulfilledTimeStamp:V.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:j=>({payload:j.map(P=>{let{endpointName:N,arg:F,value:H}=P,Q=o[N];return{queryDescription:{type:Gi,endpointName:N,originalArgs:P.arg,queryCacheKey:n({queryArgs:F,endpointDefinition:Q,endpointName:N})},value:H}}),meta:{[Ei]:!0,requestId:Ti(),timestamp:Date.now()}})},queryResultPatched:{reducer(j,{payload:{queryCacheKey:V,patches:q}}){Vs(j,V,P=>{P.data=Hl(P.data,q.concat())})},prepare:Zn()}},extraReducers(j){j.addCase(t.pending,(V,{meta:q,meta:{arg:P}})=>{let N=$d(P);v(V,P,N,q)}).addCase(t.fulfilled,(V,{meta:q,payload:P})=>{let N=$d(q.arg);E(V,q,P,N)}).addCase(t.rejected,(V,{meta:{condition:q,arg:P,requestId:N},error:F,payload:H})=>{Vs(V,P.queryCacheKey,Q=>{if(!q){if(Q.requestId!==N)return;Q.status=Ui,Q.error=H??F}})}).addMatcher(s,(V,q)=>{let{queries:P}=a(q);for(let[N,F]of Object.entries(P))(F?.status===Li||F?.status===Ui)&&(V[N]=F)})}}),y=on({name:`${e}/mutations`,initialState:Bs,reducers:{removeMutationResult:{reducer(j,{payload:V}){let q=Bi(V);q in j&&delete j[q]},prepare:Zn()}},extraReducers(j){j.addCase(r.pending,(V,{meta:q,meta:{requestId:P,arg:N,startedTimeStamp:F}})=>{N.track&&(V[Bi(q)]={requestId:P,status:Vd,endpointName:N.endpointName,startedTimeStamp:F})}).addCase(r.fulfilled,(V,{payload:q,meta:P})=>{P.arg.track&&jh(V,P,N=>{N.requestId===P.requestId&&(N.status=Li,N.data=q,N.fulfilledTimeStamp=P.fulfilledTimeStamp)})}).addCase(r.rejected,(V,{payload:q,error:P,meta:N})=>{N.arg.track&&jh(V,N,F=>{F.requestId===N.requestId&&(F.status=Ui,F.error=q??P)})}).addMatcher(s,(V,q)=>{let{mutations:P}=a(q);for(let[N,F]of Object.entries(P))(F?.status===Li||F?.status===Ui)&&N!==F?.requestId&&(V[N]=F)})}}),S={tags:{},keys:{}},C=on({name:`${e}/invalidation`,initialState:S,reducers:{updateProvidedBy:{reducer(j,V){var q,P,N;for(let{queryCacheKey:F,providedTags:H}of V.payload){R(j,F);for(let{type:Q,id:Z}of H){let X=(P=(q=j.tags)[Q]??(q[Q]={}))[N=Z||"__internal_without_id"]??(P[N]=[]);X.includes(F)||X.push(F)}j.keys[F]=H}},prepare:Zn()}},extraReducers(j){j.addCase(h.actions.removeQueryResult,(V,{payload:{queryCacheKey:q}})=>{R(V,q)}).addMatcher(s,(V,q)=>{var N,F,H;let{provided:P}=a(q);for(let[Q,Z]of Object.entries(P.tags??{}))for(let[X,W]of Object.entries(Z)){let te=(F=(N=V.tags)[Q]??(N[Q]={}))[H=X||"__internal_without_id"]??(F[H]=[]);for(let ue of W)te.includes(ue)||te.push(ue),V.keys[ue]=P.keys[ue]}}).addMatcher(zt(sr(t),Ii(t)),(V,q)=>{T(V,[q])}).addMatcher(h.actions.cacheEntriesUpserted.match,(V,q)=>{let P=q.payload.map(({queryDescription:N,value:F})=>({type:"UNKNOWN",payload:F,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));T(V,P)})}});function R(j,V){let q=qh(j.keys[V]??[]);for(let P of q){let N=P.type,F=P.id??"__internal_without_id",H=j.tags[N]?.[F];H&&(j.tags[N][F]=qh(H).filter(Q=>Q!==V))}delete j.keys[V]}function T(j,V){let q=V.map(P=>{let N=ny(P,"providesTags",o,u),{queryCacheKey:F}=P.meta.arg;return{queryCacheKey:F,providedTags:N}});C.caseReducers.updateProvidedBy(j,C.actions.updateProvidedBy(q))}let I=on({name:`${e}/subscriptions`,initialState:Bs,reducers:{updateSubscriptionOptions(j,V){},unsubscribeQueryResult(j,V){},internal_getRTKQSubscriptions(){}}}),k=on({name:`${e}/internalSubscriptions`,initialState:Bs,reducers:{subscriptionsUpdated:{reducer(j,V){return Hl(j,V.payload)},prepare:Zn()}}}),_=on({name:`${e}/config`,initialState:{online:JR(),focused:ZR(),middlewareRegistered:!1,...c},reducers:{middlewareRegistered(j,{payload:V}){j.middlewareRegistered=j.middlewareRegistered==="conflict"||i!==V?"conflict":!0}},extraReducers:j=>{j.addCase(Wd,V=>{V.online=!0}).addCase(Xh,V=>{V.online=!1}).addCase(zd,V=>{V.focused=!0}).addCase(Yh,V=>{V.focused=!1}).addMatcher(s,V=>({...V}))}}),D=zn({queries:h.reducer,mutations:y.reducer,provided:C.reducer,subscriptions:k.reducer,config:_.reducer}),G=(j,V)=>D(g.match(V)?void 0:j,V),L={..._.actions,...h.actions,...I.actions,...k.actions,...y.actions,...C.actions,resetApiState:g};return{reducer:G,actions:L}}var Ud=Symbol.for("RTKQ/skipToken"),oy={status:fr},Lh=tn(oy,()=>{}),Uh=tn(oy,()=>{});function vI({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>Lh,o=I=>Uh;return{buildQuerySelector:E,buildInfiniteQuerySelector:h,buildMutationSelector:y,selectInvalidatedBy:S,selectCachedArgsForQuery:C,selectApiState:a,selectQueries:s,selectMutations:c,selectQueryEntry:u,selectConfig:g};function i(I){return{...I,...kh(I.status)}}function a(I){return I[t]}function s(I){return a(I)?.queries}function u(I,k){return s(I)?.[k]}function c(I){return a(I)?.mutations}function g(I){return a(I)?.config}function v(I,k,_){return D=>{if(D===Ud)return r(n,_);let G=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(j=>u(j,G)??Lh,_)}}function E(I,k){return v(I,k,i)}function h(I,k){let{infiniteQueryOptions:_}=k;function D(G){let L={...G,...kh(G.status)},{isLoading:j,isError:V,direction:q}=L,P=q==="forward",N=q==="backward";return{...L,hasNextPage:R(_,L.data,L.originalArgs),hasPreviousPage:T(_,L.data,L.originalArgs),isFetchingNextPage:j&&P,isFetchingPreviousPage:j&&N,isFetchNextPageError:V&&P,isFetchPreviousPageError:V&&N}}return v(I,k,D)}function y(){return I=>{let k;return typeof I=="object"?k=Bi(I)??Ud:k=I,r(k===Ud?o:G=>a(G)?.mutations?.[k]??Uh,i)}}function S(I,k){let _=I[t],D=new Set,G=Bd(k,Hd,ey);for(let L of G){let j=_.provided.tags[L.type];if(!j)continue;let V=(L.id!==void 0?j[L.id]:Object.values(j).flat())??[];for(let q of V)D.add(q)}return Array.from(D.values()).flatMap(L=>{let j=_.queries[L];return j?{queryCacheKey:L,endpointName:j.endpointName,originalArgs:j.originalArgs}:[]})}function C(I,k){return Bd(Object.values(s(I)),_=>_?.endpointName===k&&_.status!==fr,_=>_.originalArgs)}function R(I,k,_){return k?Qd(I,k,_)!=null:!1}function T(I,k,_){return!k||!I.getPreviousPageParam?!1:ry(I,k,_)!=null}}var Vh=WeakMap?new WeakMap:void 0,Bh=({endpointName:e,queryArgs:t})=>{let r="",n=Vh?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Qt(a)?Object.keys(a).sort().reduce((s,u)=>(s[u]=a[u],s),{}):a,a));Qt(t)&&Vh?.set(t,o),r=o}return`${e}(${r})`};function SI(...e){return function(r){let n=xi(c=>r.extractRehydrationInfo?.(c,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(c){let g=Bh;if("serializeQueryArgs"in c.endpointDefinition){let v=c.endpointDefinition.serializeQueryArgs;g=E=>{let h=v(E);return typeof h=="string"?h:Bh({...E,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(c)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(c){c()},apiUid:Ti(),extractRehydrationInfo:n,hasRehydrationInfo:xi(c=>n(c)!=null)},a={injectEndpoints:u,enhanceEndpoints({addTagTypes:c,endpoints:g}){if(c)for(let v of c)o.tagTypes.includes(v)||o.tagTypes.push(v);if(g)for(let[v,E]of Object.entries(g))typeof E=="function"?E(wo(i,v)):Object.assign(wo(i,v)||{},E);return a}},s=e.map(c=>c.init(a,o,i));function u(c){let g=c.endpoints({query:v=>({...v,type:Gi}),mutation:v=>({...v,type:Zh}),infiniteQuery:v=>({...v,type:Jh})});for(let[v,E]of Object.entries(g)){if(c.overrideExisting!==!0&&v in i.endpointDefinitions){if(c.overrideExisting==="throw")throw new Error(pt(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[v]=E;for(let h of s)h.injectEndpoint(v,E)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function pr(e,...t){return Object.assign(e,...t)}var bI=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,i=null,a=null,{updateSubscriptionOptions:s,unsubscribeQueryResult:u}=e.internalActions,c=(S,C)=>{if(s.match(C)){let{queryCacheKey:T,requestId:I,options:k}=C.payload,_=S.get(T);return _?.has(I)&&_.set(I,k),!0}if(u.match(C)){let{queryCacheKey:T,requestId:I}=C.payload,k=S.get(T);return k&&k.delete(I),!0}if(e.internalActions.removeQueryResult.match(C))return S.delete(C.payload.queryCacheKey),!0;if(t.pending.match(C)){let{meta:{arg:T,requestId:I}}=C,k=Gs(S,T.queryCacheKey,Gd);return T.subscribe&&k.set(I,T.subscriptionOptions??k.get(I)??{}),!0}let R=!1;if(t.rejected.match(C)){let{meta:{condition:T,arg:I,requestId:k}}=C;if(T&&I.subscribe){let _=Gs(S,I.queryCacheKey,Gd);_.set(k,I.subscriptionOptions??_.get(k)??{}),R=!0}}return R},g=()=>r.currentSubscriptions,h={getSubscriptions:g,getSubscriptionCount:S=>g().get(S)?.size??0,isRequestSubscribed:(S,C)=>!!g()?.get(S)?.get(C)};function y(S){return JSON.parse(JSON.stringify(Object.fromEntries([...S].map(([C,R])=>[C,Object.fromEntries(R)]))))}return(S,C)=>{if(i||(i=y(r.currentSubscriptions)),e.util.resetApiState.match(S))return i={},r.currentSubscriptions.clear(),a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(S))return[!1,h];let R=c(r.currentSubscriptions,S),T=!0;if(R){a||(a=setTimeout(()=>{let _=y(r.currentSubscriptions),[,D]=Ql(i,()=>_);C.next(e.internalActions.subscriptionsUpdated(D)),i=_,a=null},500));let I=typeof S.type=="string"&&!!S.type.startsWith(o),k=t.rejected.match(S)&&S.meta.condition&&!!S.meta.arg.subscribe;T=!I&&!k}return[T,!1]}},wI=2147483647/1e3-1,AI=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a},getRunningQueryThunk:s,mwApi:u})=>{let{removeQueryResult:c,unsubscribeQueryResult:g,cacheEntriesUpserted:v}=t.internalActions,E=zt(g.match,r.fulfilled,r.rejected,v.match);function h(I){let k=o.currentSubscriptions.get(I);return k?k.size>0:!1}let y={};function S(I){for(let k of I.values())k?.abort?.()}let C=(I,k)=>{let _=k.getState(),D=a(_);if(E(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(y))L&&clearTimeout(L),delete y[G];S(o.runningQueries),S(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:G}=n.extractRehydrationInfo(I);R(Object.keys(G),k,D)}};function R(I,k,_){let D=k.getState();for(let G of I){let L=i(D,G);L?.endpointName&&T(G,L.endpointName,k,_)}}function T(I,k,_,D){let L=wo(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let j=Math.max(0,Math.min(L,wI));if(!h(I)){let V=y[I];V&&clearTimeout(V),y[I]=setTimeout(()=>{if(!h(I)){let q=i(_.getState(),I);q?.endpointName&&_.dispatch(s(q.endpointName,q.originalArgs))?.abort(),_.dispatch(c({queryCacheKey:I}))}delete y[I]},j*1e3)}}return C},Gh=new Error("Promise never resolved before cacheEntryRemoved."),xI=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:s}})=>{let u=ns(n),c=ns(o),g=sr(n,o),v={},{removeQueryResult:E,removeMutationResult:h,cacheEntriesUpserted:y}=e.internalActions;function S(_,D,G){let L=v[_];L?.valueResolved&&(L.valueResolved({data:D,meta:G}),delete L.valueResolved)}function C(_){let D=v[_];D&&(delete v[_],D.cacheEntryRemoved())}function R(_){let{arg:D,requestId:G}=_.meta,{endpointName:L,originalArgs:j}=D;return[L,j,G]}let T=(_,D,G)=>{let L=I(_);function j(V,q,P,N){let F=a(G,q),H=a(D.getState(),q);!F&&H&&k(V,N,q,D,P)}if(n.pending.match(_)){let[V,q,P]=R(_);j(V,L,P,q)}else if(y.match(_))for(let{queryDescription:V,value:q}of _.payload){let{endpointName:P,originalArgs:N,queryCacheKey:F}=V;j(P,F,_.meta.requestId,N),S(F,q,{})}else if(o.pending.match(_)){if(D.getState()[t].mutations[L]){let[q,P,N]=R(_);k(q,P,L,D,N)}}else if(g(_))S(L,_.payload,_.meta.baseQueryMeta);else if(E.match(_)||h.match(_))C(L);else if(e.util.resetApiState.match(_))for(let V of Object.keys(v))C(V)};function I(_){return u(_)?_.meta.arg.queryCacheKey:c(_)?_.meta.arg.fixedCacheKey??_.meta.requestId:E.match(_)?_.payload.queryCacheKey:h.match(_)?Bi(_.payload):""}function k(_,D,G,L,j){let V=wo(r,_),q=V?.onCacheEntryAdded;if(!q)return;let P={},N=new Promise(W=>{P.cacheEntryRemoved=W}),F=Promise.race([new Promise(W=>{P.valueResolved=W}),N.then(()=>{throw Gh})]);F.catch(()=>{}),v[G]=P;let H=e.endpoints[_].select($s(V)?D:G),Q=L.dispatch((W,te,ue)=>ue),Z={...L,getCacheEntry:()=>H(L.getState()),requestId:j,extra:Q,updateCachedData:$s(V)?W=>L.dispatch(e.util.updateQueryData(_,D,W)):void 0,cacheDataLoaded:F,cacheEntryRemoved:N},X=q(D,Z);Promise.resolve(X).catch(W=>{if(W!==Gh)throw W})}return T},CI=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},EI=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:s,internalState:u})=>{let{removeQueryResult:c}=i.internalActions,g=zt(sr(n),Ii(n)),v=zt(sr(o,n),nn(o,n)),E=[],h=0,y=(R,T)=>{(o.pending.match(R)||n.pending.match(R))&&h++,v(R)&&(h=Math.max(0,h-1)),g(R)?C(ny(R,"invalidatesTags",r,a),T):v(R)?C([],T):i.util.invalidateTags.match(R)&&C(Kd(R.payload,void 0,void 0,void 0,void 0,a),T)};function S(){return h>0}function C(R,T){let I=T.getState(),k=I[e];if(E.push(...R),k.config.invalidationBehavior==="delayed"&&S())return;let _=E;if(E=[],_.length===0)return;let D=i.util.selectInvalidatedBy(I,_);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:L}of G){let j=k.queries[L],V=Gs(u.currentSubscriptions,L,Gd);j&&(V.size===0?T.dispatch(c({queryCacheKey:L})):j.status!==fr&&T.dispatch(s(j)))}})}return y},RI=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:i,currentSubscriptions:a}=o,s=new Set,u=null,c=(C,R)=>{(r.internalActions.updateSubscriptionOptions.match(C)||r.internalActions.unsubscribeQueryResult.match(C))&&g(C.payload.queryCacheKey,R),(t.pending.match(C)||t.rejected.match(C)&&C.meta.condition)&&g(C.meta.arg.queryCacheKey,R),(t.fulfilled.match(C)||t.rejected.match(C)&&!C.meta.condition)&&v(C.meta.arg,R),r.util.resetApiState.match(C)&&(y(),u&&(clearTimeout(u),u=null),s.clear())};function g(C,R){s.add(C),u||(u=setTimeout(()=>{for(let T of s)E({queryCacheKey:T},R);s.clear(),u=null},0))}function v({queryCacheKey:C},R){let T=R.getState()[e],I=T.queries[C],k=a.get(C);if(!I||I.status===fr)return;let{lowestPollingInterval:_,skipPollingIfUnfocused:D}=S(k);if(!Number.isFinite(_))return;let G=i.get(C);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let L=Date.now()+_;i.set(C,{nextPollTimestamp:L,pollingInterval:_,timeout:setTimeout(()=>{(T.config.focused||!D)&&R.dispatch(n(I)),v({queryCacheKey:C},R)},_)})}function E({queryCacheKey:C},R){let I=R.getState()[e].queries[C],k=a.get(C);if(!I||I.status===fr)return;let{lowestPollingInterval:_}=S(k);if(!Number.isFinite(_)){h(C);return}let D=i.get(C),G=Date.now()+_;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:C},R)}function h(C){let R=i.get(C);R?.timeout&&clearTimeout(R.timeout),i.delete(C)}function y(){for(let C of i.keys())h(C)}function S(C=new Map){let R=!1,T=Number.POSITIVE_INFINITY;for(let I of C.values())I.pollingInterval&&(T=Math.min(I.pollingInterval,T),R=I.skipPollingIfUnfocused||R);return{lowestPollingInterval:T,skipPollingIfUnfocused:R}}return c},II=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=rs(r,n),i=nn(r,n),a=sr(r,n),s={};return(c,g)=>{if(o(c)){let{requestId:v,arg:{endpointName:E,originalArgs:h}}=c.meta,y=wo(t,E),S=y?.onQueryStarted;if(S){let C={},R=new Promise((_,D)=>{C.resolve=_,C.reject=D});R.catch(()=>{}),s[v]=C;let T=e.endpoints[E].select($s(y)?h:v),I=g.dispatch((_,D,G)=>G),k={...g,getCacheEntry:()=>T(g.getState()),requestId:v,extra:I,updateCachedData:$s(y)?_=>g.dispatch(e.util.updateQueryData(E,h,_)):void 0,queryFulfilled:R};S(h,k)}}else if(a(c)){let{requestId:v,baseQueryMeta:E}=c.meta;s[v]?.resolve({data:c.payload,meta:E}),delete s[v]}else if(i(c)){let{requestId:v,rejectedWithValue:E,baseQueryMeta:h}=c.meta;s[v]?.reject({error:c.payload??c.error,isUnhandledError:!E,meta:h}),delete s[v]}}},TI=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(u,c)=>{zd.match(u)&&s(c,"refetchOnFocus"),Wd.match(u)&&s(c,"refetchOnReconnect")};function s(u,c){let g=u.getState()[e],v=g.queries,E=o.currentSubscriptions;t.batch(()=>{for(let h of E.keys()){let y=v[h],S=E.get(h);if(!S||!y)continue;let C=[...S.values()];(C.some(T=>T[c]===!0)||C.every(T=>T[c]===void 0)&&g.config[c])&&(S.size===0?u.dispatch(i({queryCacheKey:h})):y.status!==fr&&u.dispatch(n(y)))}})}return a};function _I(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:i}=e,{apiUid:a}=o,s={invalidateTags:O(`${t}/invalidateTags`)},u=E=>E.type.startsWith(`${t}/`),c=[CI,AI,EI,RI,xI,II];return{middleware:E=>{let h=!1,y=i(E.dispatch),S={...e,internalState:y,refetchQuery:v,isThisApiSliceAction:u,mwApi:E},C=c.map(I=>I(S)),R=bI(S),T=TI(S);return I=>k=>{if(!di(k))return I(k);h||(h=!0,E.dispatch(n.internalActions.middlewareRegistered(a)));let _={...E,next:I},D=E.getState(),[G,L]=R(k,_,D),j;if(G?j=I(k):j=L,E.getState()[t]&&(T(k,_,D),u(k)||o.hasRehydrationInfo(k)))for(let V of C)V(k,_,D);return j}},actions:s};function v(E){return e.api.endpoints[E.endpointName].initiate(E.originalArgs,{subscribe:!1,forceRefetch:!0})}}var $h=Symbol(),kI=({createSelector:e=Be}={})=>({name:$h,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:u,refetchOnReconnect:c,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:E,skipSchemaValidation:h},y){Fm();let S=ge=>(typeof process<"u",ge);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Wd,onOffline:Xh,onFocus:zd,onFocusLost:Yh},util:{}});let C=vI({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:R,selectCachedArgsForQuery:T,buildQuerySelector:I,buildInfiniteQuerySelector:k,buildMutationSelector:_}=C;pr(t.util,{selectInvalidatedBy:R,selectCachedArgsForQuery:T});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,patchQueryData:j,updateQueryData:V,upsertQueryData:q,prefetch:P,buildMatchThunkActions:N}=hI({baseQuery:r,reducerPath:o,context:y,api:t,serializeQueryArgs:i,assertTagType:S,selectors:C,onSchemaFailure:v,catchSchemaFailure:E,skipSchemaValidation:h}),{reducer:F,actions:H}=yI({context:y,queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:g}});pr(t.util,{patchQueryData:j,updateQueryData:V,upsertQueryData:q,prefetch:P,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),pr(t.internalActions,H);let Q=new WeakMap,Z=ge=>Gs(Q,ge,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:X,buildInitiateInfiniteQuery:W,buildInitiateMutation:te,getRunningMutationThunk:ue,getRunningMutationsThunk:Ee,getRunningQueriesThunk:Me,getRunningQueryThunk:ke}=gI({queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,serializeQueryArgs:i,context:y,getInternalState:Z});pr(t.util,{getRunningMutationThunk:ue,getRunningMutationsThunk:Ee,getRunningQueryThunk:ke,getRunningQueriesThunk:Me});let{middleware:Pe,actions:Ne}=_I({reducerPath:o,context:y,queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,assertTagType:S,selectors:C,getRunningQueryThunk:ke,getInternalState:Z});return pr(t.util,Ne),pr(t,{reducer:F,middleware:Pe}),{name:$h,injectEndpoint(ge,fe){var $e;let he=($e=t.endpoints)[ge]??($e[ge]={});Hs(fe)&&pr(he,{name:ge,select:I(ge,fe),initiate:X(ge,fe)},N(D,ge)),pI(fe)&&pr(he,{name:ge,select:_(),initiate:te(ge)},N(L,ge)),zs(fe)&&pr(he,{name:ge,select:k(ge,fe),initiate:W(ge,fe)},N(D,ge))}}}}),iy=SI(kI());m();d();f();p();m();d();f();p();var dn=e=>e.query,ay=e=>e.query?.enableQuerySyntax;var r$=Be(e=>dn(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})),OI=Be(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);m();d();f();p();m();d();f();p();var Ao=(e,t,r)=>ft({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let i=t??cn(o);if(!i)return null;let a=nh(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:i,answerGenerated:e,answerTextIsEmpty:r,...(a&&{conversationId:a})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??cn(n)??"",answerGenerated:e??!1})}),xo=e=>ft({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??cn(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})});m();d();f();p();m();d();f();p();var sy=Be(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})}});m();d();f();p();var $i=(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:co(e)}});m();d();f();p();var Yd=e=>e.context;m();d();f();p();var Xd=e=>e.pipeline;m();d();f();p();m();d();f();p();var Qi=Mt(Ws(),1),fy=Mt(cy(),1);m();d();f();p();var Ks=Mt(Ws(),1),ly=Mt(uy(),1);Ks.default.extend(ly.default);var dy="YYYY/MM/DD@HH:mm:ss",PI="1401-01-01";function Co(e,t){let r=(0,Ks.default)(e,t);return!r.isValid()&&!t?(0,Ks.default)(e,dy):r}function Ys(e){return e.format(dy)}function py(e,t){let r=Co(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}`)}op(r)}function op(e){if(e.isBefore(PI))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Qi.default.extend(fy.default);var my=["past","now","next"],gy=["minute","hour","day","week","month","quarter","year"],NI=e=>{let t=e==="now";return{amount:new oe({required:!t,min:1}),unit:new z({required:!t,constrainTo:gy}),period:new z({required:!0,constrainTo:my})}};function ip(e){if(typeof e=="string"&&!_r(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?by(e):e;new mt(NI(t.period)).validate(t);let r=yy(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);op(r)}function hy(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function yy(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Qi.default)().subtract(r,n);case"next":return(0,Qi.default)().add(r,n);case"now":return(0,Qi.default)()}}function Hi(e){return Ys(yy(by(e)))}function vy(e){return e.toLocaleLowerCase().split("-")}function _r(e){let[t,r,n]=vy(e);if(t==="now")return!0;if(!my.includes(t)||!gy.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function Sy(e){return!!e&&typeof e=="object"&&"period"in e}function by(e){let[t,r,n]=vy(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}m();d();f();p();function wy(e){return e.type==="dateRange"}function Ay(e){return`start${e}`}function xy(e){return`end${e}`}var ap=()=>({dateFacetValueMap:{}});function FI(e,t,r){let n=e.start,o=e.end;return _r(n)&&(n=Hi(n),r.dateFacetValueMap[t][Ay(n)]=e.start),_r(o)&&(o=Hi(o),r.dateFacetValueMap[t][xy(o)]=e.end),{...e,start:n,end:o}}function sp(e,t){if(wy(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>FI(o,r,t))}}return e}function kr(e){let t=ap();return{request:{...e,facets:e.facets?.map(n=>sp(n,t))},mappings:t}}function DI(e,t,r){return{...e,start:r.dateFacetValueMap[t][Ay(e.start)]||e.start,end:r.dateFacetValueMap[t][xy(e.end)]||e.end}}function MI(e,t){return e.facetId in t.dateFacetValueMap}function qI(e,t){return MI(e,t)?{...e,values:e.values.map(r=>DI(r,e.facetId,t))}:e}function Xs(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>qI(n,t))}}:e}m();d();f();p();m();d();f();p();m();d();f();p();function Or(e){return Object.values(e).map(t=>t.request)}function cp(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function Cy(e){return Or(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var up={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function jI(e){return Or(e).map(t=>{let r=up[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function LI(e){return[...jI(e.facetSet??{}),...Cy(e.numericFacetSet??{}),...Cy(e.dateFacetSet??{}),...Or(e.categoryFacetSet??{})]}function UI(e){return LI(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Zs(e){return cp(UI(e),e.facetOrder??[])}m();d();f();p();m();d();f();p();var Pr=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??br(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:It.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 qs(e.configuration.analytics,t))),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Pr(_x67,_x68){return _ref29.apply(this,arguments)}}();m();d();f();p();var Eo=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??br(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&&$i(e.configuration.analytics,t,r)),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});m();d();f();p();var Ey=Be(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Nr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=dp(e),o=VI(e),i=BI(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Pr(e,r):Eo(e,t,r);return kr({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:lp(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:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Nr(_x69,_x70,_x71){return _ref30.apply(this,arguments)}}();function lp(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function VI(e){return cp($I(e),e.facetOrder??[])}function BI(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(GI).filter(r=>r.currentValues.length>0):void 0}function GI(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function $I(e){return QI(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function QI(e){return[...HI(e.facetSet??{}),...Ry(e.numericFacetSet??{}),...Ry(e.dateFacetSet??{}),...Or(e.categoryFacetSet??{})]}function HI(e){return Or(e).map(t=>{let r=up[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Ry(e){return Or(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function dp(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Ey(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}m();d();f();p();m();d();f();p();var zi=(e,t)=>{let r=e;return se(r[t])?se(e.raw[t])?null:e.raw[t]:r[t]},zI=e=>t=>e.every(r=>!se(zi(t,r))),WI=e=>t=>e.every(r=>se(zi(t,r))),KI=(e,t)=>r=>{let n=Iy(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},YI=(e,t)=>r=>{let n=Iy(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Iy=(e,t)=>{let r=zi(t,e);return Kf(r)?r:[r]},Ty={getResultProperty:zi,fieldsMustBeDefined:zI,fieldsMustNotBeDefined:WI,fieldMustMatch:KI,fieldMustNotMatch:YI};var pp=Be(e=>e.search,e=>e?.searchAction?.actionCause||"");m();d();f();p();var fp=e=>e.searchHub;m();d();f();p();var Js=Be(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),UQ=Be(e=>e,e=>{let t=Js(e);return t&&e?e[t].expression:""});m();d();f();p();var _y=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};m();d();f();p();var ky=e=>e.excerptLength?.length;m();d();f();p();var Oy=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};m();d();f();p();var Py=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};m();d();f();p();var Ny=e=>e.sortCriteria;var Fy=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Hn(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Fy(_x72){return _ref31.apply(this,arguments)}}(),Dy=(e,t)=>{let r=dn(e)?.q,{aq:n,cq:o,dq:i,lq:a}=jy(e),s=Yd(e),u=$i(e.configuration.analytics,t,{actionCause:pp(e)}),c=fp(e),g=Xd(e),v=Rd(e)??[],E=qy(e),h=Js(e.tabSet)||"default",y=Cd(e),S=Zg(e),C=t.referrer||"",R=Oy(e),T=Ny(e),I=XI(e),k=ky(e),_=Py(e),D=_y(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:ay(e)}),...(s?.contextValues&&{context:s.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(c?.length&&{searchHub:c}),...(g?.length&&{pipeline:g}),...(E.length&&{facets:E}),...(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:lp(e),firstResult:e.pagination.firstResult}),tab:h,locale:y,timezone:S,...(e.debug!==void 0&&{debug:e.debug}),referrer:C,...I,...(_??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:T,...(R&&{facetOptions:R}),...u,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},My=(e,t)=>{let r=dn(e)?.q,n=qy(e),o=$i(e.configuration.analytics,t,{actionCause:pp(e)}),i=Cd(e),a=Js(e.tabSet)||"default",s=t.referrer,{aq:u,cq:c}=jy(e),g=fp(e),v=Xd(e),E=Yd(e),h=Rd(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(E?.contextValues&&{context:E.contextValues}),...(u&&{aq:u}),...(c&&{cq:c}),tab:a,referrer:s,...o,locale:i}},qy=e=>Zs(e)?.map(t=>sp(t,ap())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),XI=e=>({actionsHistory:e.configuration.analytics.enabled?It.getInstance().getHistory():[]}),jy=e=>{let t=sy(e),r=dp(e);return{...t,...(r&&{cq:r})}};m();d();f();p();var ec=["searching","thinking","answering"];function tc(e){return e.toLowerCase()}var rc=["search","generic"];m();d();f();p();var Ly=["text/plain","text/markdown"];var Ro=new z({required:!0}),Uy=new z,Io=new me({required:!0}),mp={id:Ro,title:Ro,uri:Ro,permanentid:Ro,clickUri:Uy},nc=new z({required:!0,constrainTo:Ly}),Vy=new z({required:!0,constrainTo:ec}),By=e=>({...e,name:tc(e.name)}),az=O("generatedAnswer/setIsVisible",e=>B(e,Io)),oc=O("generatedAnswer/setAnswerId",e=>B(e,Y)),sz=O("generatedAnswer/setAnswerGenerationMode",e=>B(e,new z({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),cz=O("generatedAnswer/setIsEnabled",e=>B(e,Io)),Ki=O("generatedAnswer/updateMessage",e=>B(e,{textDelta:Ro})),Yi=O("generatedAnswer/updateCitations",e=>B(e,{citations:new ve({required:!0,each:new ne({values:mp})})})),Xi=O("generatedAnswer/updateError",e=>B(e,{message:Uy,code:new oe({min:0})})),ic=O("generatedAnswer/resetAnswer"),uz=O("generatedAnswer/like"),lz=O("generatedAnswer/dislike"),dz=O("generatedAnswer/feedbackModal/open"),pz=O("generatedAnswer/expand"),fz=O("generatedAnswer/collapse"),mz=O("generatedAnswer/setId",e=>B(e,{id:new z({required:!0})})),gz=O("generatedAnswer/feedbackModal/close"),hz=O("generatedAnswer/sendFeedback"),Fr=O("generatedAnswer/setIsLoading",e=>B(e,Io)),Wi=O("generatedAnswer/setIsStreaming",e=>B(e,Io)),Zi=O("generatedAnswer/setAnswerContentFormat",e=>B(e,nc)),yz=O("generatedAnswer/updateResponseFormat",e=>B(e,{contentFormat:new ve({each:nc,default:["text/plain"]})})),vz=O("knowledge/updateAnswerConfigurationId",e=>B(e,Ro)),Sz=O("generatedAnswer/registerFieldsToIncludeInCitations",e=>B(e,as)),gp=O("generatedAnswer/setIsAnswerGenerated",e=>B(e,Io)),Ji=O("generatedAnswer/setCannotAnswer",e=>B(e,Io)),ZI=O("generatedAnswer/setAnswerApiQueryParams",e=>B(e,new ne({}))),Gy=O("generatedAnswer/startStep",e=>B(By(e),{name:Vy,startedAt:new oe({min:0,required:!0})})),$y=O("generatedAnswer/finishStep",e=>B(By(e),{name:Vy,finishedAt:new oe({min:0,required:!0})})),Qy=O("generatedAnswer/startToolCall",e=>B(e,{toolCallName:Y,startedAt:new oe({min:0,required:!0}),toolCallId:Y})),Hy=O("generatedAnswer/finishToolCall",e=>B(e,{finishedAt:new oe({min:0,required:!0}),toolCallId:Y})),ac=O("generatedAnswer/toolCallArgs",e=>B(e,{toolCallId:Y,args:new ne({options:{required:!0}}),type:new z({required:!0,constrainTo:rc})})),bz=Ie("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:s}=a,{setAbortControllerRef:u}=e,c=yield Fy(r),g=(h,y)=>{switch(h){case"genqa.headerMessageType":{let S=JSON.parse(y);n(Zi(S.contentFormat));break}case"genqa.messageType":n(Ki(JSON.parse(y)));break;case"genqa.citationsType":n(Yi(JSON.parse(y)));break;case"genqa.endOfStreamType":{let S=JSON.parse(y).answerGenerated,{answerId:C,answer:R}=i().generatedAnswer,I=s.length!==0&&!S,k=!R?.trim();n(Ji(I)),n(Wi(!1)),n(gp(S)),n(Ao(S,C,S?k:void 0)),n(xo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(Fr(!0));let v=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,E=o.streamingClient?.streamGeneratedAnswer(c,{write:h=>{v(c)&&(n(Fr(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{v(c)&&n(Xi(h))},close:()=>{v(c)&&n(Wi(!1))},resetAnswer:()=>{v(c)&&n(ic())}});E?u(E):n(Fr(!1))});return function(_x73,_x74){return _ref32.apply(this,arguments)}}()),wz=Ie("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(ic());let i=t();if(i.generatedAnswer.isEnabled===!1){o.warn("[WARNING] The generateAnswer action was dispatched while the generated answer is disabled. No answer will be generated. Enable the generated answer before dispatching generateAnswer.");return}if(i.generatedAnswer.answerConfigurationId){let a=Dy(i,n);r(ZI(a)),yield r(zy(a))}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(_x75,_x76){return _ref33.apply(this,arguments)}}());m();d();f();p();m();d();f();p();function Ky(_x77,_x78){return _Ky.apply(this,arguments)}function _Ky(){_Ky=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Ky.apply(this,arguments)}function Yy(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=eT(t,a);let s=t.length,u=0;for(;r<s;){o&&(t[r]===10&&(u=++r),o=!1);let c=-1;for(;r<s&&c===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-u);break;case 13:o=!0,c=r;break;case 10:c=r;break}if(c===-1)break;e(t.subarray(u,c),n),u=r,n=-1}u===s?t=void 0:u!==0&&(t=t.subarray(u),r-=u)}}function Xy(e,t,r){let n=Wy(),o=new TextDecoder;return function(a,s){if(a.length===0)r?.(n),n=Wy();else if(s>0){let u=o.decode(a.subarray(0,s)),c=s+(a[s+1]===32?2:1),g=o.decode(a.subarray(c));switch(u){case"data":n.data=n.data?`${n.data}
32
+ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":JI(g,n,t);break}}}}function JI(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function eT(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Wy(){return{data:"",event:"",id:"",retry:void 0}}var hp="text/event-stream",tT=1e3,Zy="last-event-id";function Jy(){return typeof window<"u"}function ev(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:s,fetch:u,...c}){return new Promise((g,v)=>{let E={...r};E.accept||(E.accept=hp);let h;function y(){h?.abort(),document.hidden||k()}!s&&Jy()&&document.addEventListener("visibilitychange",y);let S=tT,C;function R(){Jy()&&document.removeEventListener("visibilitychange",y),clearTimeout(C),h?.abort()}t?.addEventListener("abort",()=>{R(),g()});let T=u??A,I=n??rT;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){h=l.AbortController?new l.AbortController:null;try{let _=yield T(e,{...c,headers:E,signal:h?.signal});yield I(_),yield Ky(_.body,Yy(Xy(D=>{D?E[Zy]=D:delete E[Zy]},D=>{S=D},o))),i?.(),R(),g()}catch(_){if(!h?.signal?.aborted)try{let D=a?.(_)??S;clearTimeout(C),C=setTimeout(k,D)}catch(D){R(),v(D)}}});return _k2.apply(this,arguments)}k()})}function rT(e){let t=e.headers.get("content-type");if(!t?.startsWith(hp))throw new Error(`Expected content-type to be ${hp}, Actual: ${t}`)}m();d();f();p();var nT=/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,s=n.generatedAnswer.answerConfigurationId,u={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let c=Hn(n.configuration.search?.apiBaseUrl,a,i);return Hh({baseUrl:`${c}/rest/organizations/${a}/answer/v1/configs/${s}`,fetchFn:function(){var _ref35=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,E={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(h=>{E[h]=g[h]}),E.duplex="half",E.body=yield g.text(),A(v,E)});return function fetchFn(_x82){return _ref35.apply(this,arguments)}}()})(u,{...t,signal:null},r)}catch(c){return{error:c}}});return function nT(_x79,_x80,_x81){return _ref34.apply(this,arguments)}}(),tv=iy({reducerPath:"answer",baseQuery:Wh(nT,{maxRetries:3}),endpoints:()=>({})});var oT=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},iT=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(delete e.error,e.answer=n?.trim()?n.concat(r):r)},aT=(e,t)=>{delete e.error,e.citations=t.citations},sT=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},cT=(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})`)},uT=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&cT(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(oT(t,o),r(Zi(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(iT(t,o),r(Ki({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(aT(t,o),r(Yi({citations:o.citations})));break;case"genqa.endOfStreamType":{sT(t,o);let i=t.answerId,a=o.answerGenerated??!1,s=a?!t.answer?.trim():void 0;r(Ao(a,i,s)),r(xo());break}}},lT=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},yp=tv.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(_x83,_x84){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:s,insightConfiguration:u}=r(),{organizationId:c,environment:g,accessToken:v}=a,E=Hn(a.search.apiBaseUrl,c,g),h=lT(E,c,s.answerConfigurationId,u?.insightId);yield ev(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref36=_asyncToGenerator(function*(y){let S=y.headers.get("x-answer-id");S&&o(C=>{C.answerId=S,i(oc(S))})});return function onopen(_x85){return _ref36.apply(this,arguments)}}(),onmessage:y=>{o(S=>{uT(y,S,i)})},onerror:y=>{throw y},onclose:()=>{o(y=>{i(Ji(!y.generated))})}})}).apply(this,arguments)}})})}),zy=e=>yp.endpoints.getAnswer.initiate(e);m();d();f();p();var rv=Ue(Jn,e=>e);m();d();f();p();function dT(e){let t=e.payload?.analyticsAction;return nv(e)&&!se(t)}function nv(e){return"type"in e}var ov=e=>t=>r=>{let n;dT(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return nv(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};m();d();f();p();m();d();f();p();m();d();f();p();var v4=O("tab/register",e=>{let t=new ne({values:{id:Y,expression:tt}});return B(e,t)}),sc=O("tab/updateActiveTab",e=>B(e,Y));m();d();f();p();var cc=Mt(Ws(),1),sv=Mt(iv(),1),cv=Mt(av(),1);cc.default.extend(cv.default);cc.default.extend(sv.default);var uv=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:cc.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"});m();d();f();p();var pT=/(^|; )Coveo-Pendragon=([^;]*)/,fT=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function lv(){return typeof window>"u"?!1:pT.exec(document.cookie)?.pop()||null}function dv(){return typeof window>"u"?!1:fT.test(document.cookie)}var pv=Ue(uv(),e=>e.addCase(Cr,(t,r)=>{mT(t,r.payload)}).addCase(Wt,(t,r)=>{gT(t,r.payload)}).addCase(eo,(t,r)=>{hT(t,r.payload)}).addCase(to,t=>{t.analytics.enabled=!1}).addCase(ro,t=>{t.analytics.enabled=!0}).addCase(ss,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(cs,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(sc,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Sg,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Er,(t,r)=>{se(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(yg,(t,{payload:r})=>{yT(t,r)}));function mT(e,t){se(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",se(t.organizationId)||(e.organizationId=t.organizationId)}function gT(e,t){se(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),se(t.locale)||(e.search.locale=t.locale),se(t.timezone)||(e.search.timezone=t.timezone),se(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function hT(e,t){se(t.enabled)||(e.analytics.enabled=t.enabled),se(t.originContext)||(e.analytics.originContext=t.originContext),se(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),se(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),se(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),se(t.trackingId)||(e.analytics.trackingId=t.trackingId),se(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),se(t.source)||(e.analytics.source=t.source);try{let r=lv();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}se(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),se(t.anonymous)||(e.analytics.anonymous=t.anonymous),se(t.deviceId)||(e.analytics.deviceId=t.deviceId),se(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),se(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function yT(e,t){e.knowledge.agentId=t;try{dv()&&(e.knowledge.debugAgentSession=!0)}catch{}}var jt=pv;m();d();f();p();function vT(e){return e.instantlyCallable}var fv=()=>e=>t=>e(vT(t)?t():t);m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var ot=[];for(let e=0;e<256;++e)ot.push((e+256).toString(16).slice(1));function mv(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()}m();d();f();p();var Ap,ST=new Uint8Array(16);function xp(){if(!Ap){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ap=crypto.getRandomValues.bind(crypto)}return Ap(ST)}m();d();f();p();m();d();f();p();var bT=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Cp={randomUUID:bT};function wT(e,t,r){if(Cp.randomUUID&&!t&&!e)return Cp.randomUUID();e=e||{};let n=e.random??e.rng?.()??xp();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 mv(n)}var Dr=wT;m();d();f();p();m();d();f();p();var w={};ti(w,{BRAND:()=>zT,DIRTY:()=>fn,EMPTY_PATH:()=>ET,INVALID:()=>de,NEVER:()=>O_,OK:()=>ct,ParseStatus:()=>it,Schema:()=>we,ZodAny:()=>jr,ZodArray:()=>yr,ZodBigInt:()=>gn,ZodBoolean:()=>hn,ZodBranded:()=>ta,ZodCatch:()=>In,ZodDate:()=>yn,ZodDefault:()=>Rn,ZodDiscriminatedUnion:()=>dc,ZodEffects:()=>Pt,ZodEnum:()=>Cn,ZodError:()=>yt,ZodFirstPartyTypeKind:()=>pe,ZodFunction:()=>fc,ZodIntersection:()=>wn,ZodIssueCode:()=>K,ZodLazy:()=>An,ZodLiteral:()=>xn,ZodMap:()=>No,ZodNaN:()=>Do,ZodNativeEnum:()=>En,ZodNever:()=>Lt,ZodNull:()=>Sn,ZodNullable:()=>Jt,ZodNumber:()=>mn,ZodObject:()=>vt,ZodOptional:()=>kt,ZodParsedType:()=>re,ZodPipeline:()=>ra,ZodPromise:()=>Lr,ZodReadonly:()=>Tn,ZodRecord:()=>pc,ZodSchema:()=>we,ZodSet:()=>Fo,ZodString:()=>qr,ZodSymbol:()=>Oo,ZodTransformer:()=>Pt,ZodTuple:()=>Zt,ZodType:()=>we,ZodUndefined:()=>vn,ZodUnion:()=>bn,ZodUnknown:()=>hr,ZodVoid:()=>Po,addIssueToContext:()=>ee,any:()=>r_,array:()=>a_,bigint:()=>XT,boolean:()=>Ev,coerce:()=>k_,custom:()=>Av,date:()=>ZT,datetimeRegex:()=>bv,defaultErrorMap:()=>mr,discriminatedUnion:()=>l_,effect:()=>A_,enum:()=>S_,function:()=>h_,getErrorMap:()=>To,getParsedType:()=>Xt,instanceof:()=>KT,intersection:()=>d_,isAborted:()=>uc,isAsync:()=>_o,isDirty:()=>lc,isValid:()=>Mr,late:()=>WT,lazy:()=>y_,literal:()=>v_,makeIssue:()=>ea,map:()=>m_,nan:()=>YT,nativeEnum:()=>b_,never:()=>o_,null:()=>t_,nullable:()=>C_,number:()=>Cv,object:()=>s_,objectUtil:()=>Ep,oboolean:()=>__,onumber:()=>T_,optional:()=>x_,ostring:()=>I_,pipeline:()=>R_,preprocess:()=>E_,promise:()=>w_,quotelessJson:()=>AT,record:()=>f_,set:()=>g_,setErrorMap:()=>CT,strictObject:()=>c_,string:()=>xv,symbol:()=>JT,transformer:()=>A_,tuple:()=>p_,undefined:()=>e_,union:()=>u_,unknown:()=>n_,util:()=>Ce,void:()=>i_});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Ce;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ce||(Ce={}));var Ep;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Ep||(Ep={}));var re=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xt=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}};var K=Ce.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"]),AT=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),yt=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(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,u=0;for(;u<a.path.length;){let c=a.path[u];u===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(r(a))):s[c]=s[c]||{_errors:[]},s=s[c],u++}}};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,Ce.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 i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};yt.create=e=>new yt(e);var xT=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===re.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.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}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.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 K.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 K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}},mr=xT;var gv=mr;function CT(e){gv=e}function To(){return gv}m();d();f();p();var ea=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)s=c(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},ET=[];function ee(e,t){let r=To(),n=ea({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===mr?void 0:mr].filter(o=>!!o)});e.common.issues.push(n)}var it=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 de;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 i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return de;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},de=Object.freeze({status:"aborted"}),fn=e=>({status:"dirty",value:e}),ct=e=>({status:"valid",value:e}),uc=e=>e.status==="aborted",lc=e=>e.status==="dirty",Mr=e=>e.status==="valid",_o=e=>typeof Promise<"u"&&e instanceof Promise;m();d();f();p();m();d();f();p();var ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ae||(ae={}));var Ot=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}},hv=(e,t)=>{if(Mr(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 yt(e.common.issues);return this._error=r,this._error}}};function ye(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:(a,s)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??s.defaultError}:typeof s.data>"u"?{message:u??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:u??r??s.defaultError}},description:o}}var we=class{get description(){return this._def.description}_getType(t){return Xt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new it,ctx:{common:t.parent.common,data:t.data,parsedType:Xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(_o(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:Xt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return hv(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Mr(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=>Mr(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this10=this;return _asyncToGenerator(function*(){let n=yield _this10.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this11=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this11._def.errorMap,parent:null,data:t,parsedType:Xt(t)},o=_this11._parse({data:t,path:n.path,parent:n}),i=yield _o(o)?o:Promise.resolve(o);return hv(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),s=()=>i.addIssue({code:K.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!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 Pt({schema:this,typeName:pe.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 kt.create(this,this._def)}nullable(){return Jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Lr.create(this,this._def)}or(t){return bn.create([this,t],this._def)}and(t){return wn.create(this,t,this._def)}transform(t){return new Pt({...ye(this._def),schema:this,typeName:pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rn({...ye(this._def),innerType:this,defaultValue:r,typeName:pe.ZodDefault})}brand(){return new ta({typeName:pe.ZodBranded,type:this,...ye(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new In({...ye(this._def),innerType:this,catchValue:r,typeName:pe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ra.create(this,t)}readonly(){return Tn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RT=/^c[^\s-]{8,}$/i,IT=/^[0-9a-z]+$/,TT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_T=/^[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,kT=/^[a-z0-9_-]{21}$/i,OT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PT=/^[-+]?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)?)??$/,NT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rp,DT=/^(?:(?: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])$/,MT=/^(?:(?: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])$/,qT=/^(([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]))$/,jT=/^(([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])$/,LT=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vv="((\\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])))",VT=new RegExp(`^${vv}$`);function Sv(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 BT(e){return new RegExp(`^${Sv(e)}$`)}function bv(e){let t=`${vv}T${Sv(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 GT(e,t){return!!((t==="v4"||!t)&&DT.test(e)||(t==="v6"||!t)&&qT.test(e))}function $T(e,t){if(!OT.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 QT(e,t){return!!((t==="v4"||!t)&&MT.test(e)||(t==="v6"||!t)&&jT.test(e))}var qr=class e extends we{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.string,received:i.parsedType}),de}let n=new it,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(t,o),a?ee(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&ee(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")NT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"email",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Rp||(Rp=new RegExp(FT,"u")),Rp.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"emoji",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")_T.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"uuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")kT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"nanoid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")RT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")IT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid2",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")TT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ulid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ee(o,{validation:"url",code:K.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"regex",code:K.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?bv(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?VT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?BT(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?PT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"duration",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?GT(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ip",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?$T(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"jwt",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?QT(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cidr",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?LT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?UT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64url",code:K.invalid_string,message:i.message}),n.dirty()):Ce.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:K.invalid_string,...ae.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ae.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ae.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ae.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ae.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ae.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ae.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,...ae.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,...ae.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ae.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ae.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ae.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ae.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ae.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ae.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ae.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ae.errToObj(r)})}nonempty(t){return this.min(1,ae.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}};qr.create=e=>new qr({checks:[],typeName:pe.ZodString,coerce:e?.coerce??!1,...ye(e)});function HT(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var mn=class e extends we{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)!==re.number){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.number,received:i.parsedType}),de}let n,o=new it;for(let i of this._def.checks)i.kind==="int"?Ce.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:K.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?HT(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_finite,message:i.message}),o.dirty()):Ce.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ae.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ae.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ae.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"&&Ce.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)}};mn.create=e=>new mn({checks:[],typeName:pe.ZodNumber,coerce:e?.coerce||!1,...ye(e)});var gn=class e extends we{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)!==re.bigint)return this._getInvalidInput(t);let n,o=new it;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ce.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.bigint,received:r.parsedType}),de}gte(t,r){return this.setLimit("min",t,!0,ae.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ae.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ae.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ae.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ae.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:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ae.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}};gn.create=e=>new gn({checks:[],typeName:pe.ZodBigInt,coerce:e?.coerce??!1,...ye(e)});var hn=class extends we{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.boolean,received:n.parsedType}),de}return ct(t.data)}};hn.create=e=>new hn({typeName:pe.ZodBoolean,coerce:e?.coerce||!1,...ye(e)});var yn=class e extends we{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.date,received:i.parsedType}),de}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_date}),de}let n=new it,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ce.assertNever(i);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:ae.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ae.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}};yn.create=e=>new yn({checks:[],coerce:e?.coerce||!1,typeName:pe.ZodDate,...ye(e)});var Oo=class extends we{_parse(t){if(this._getType(t)!==re.symbol){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.symbol,received:n.parsedType}),de}return ct(t.data)}};Oo.create=e=>new Oo({typeName:pe.ZodSymbol,...ye(e)});var vn=class extends we{_parse(t){if(this._getType(t)!==re.undefined){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.undefined,received:n.parsedType}),de}return ct(t.data)}};vn.create=e=>new vn({typeName:pe.ZodUndefined,...ye(e)});var Sn=class extends we{_parse(t){if(this._getType(t)!==re.null){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.null,received:n.parsedType}),de}return ct(t.data)}};Sn.create=e=>new Sn({typeName:pe.ZodNull,...ye(e)});var jr=class extends we{constructor(){super(...arguments),this._any=!0}_parse(t){return ct(t.data)}};jr.create=e=>new jr({typeName:pe.ZodAny,...ye(e)});var hr=class extends we{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ct(t.data)}};hr.create=e=>new hr({typeName:pe.ZodUnknown,...ye(e)});var Lt=class extends we{_parse(t){let r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.never,received:r.parsedType}),de}};Lt.create=e=>new Lt({typeName:pe.ZodNever,...ye(e)});var Po=class extends we{_parse(t){if(this._getType(t)!==re.undefined){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.void,received:n.parsedType}),de}return ct(t.data)}};Po.create=e=>new Po({typeName:pe.ZodVoid,...ye(e)});var yr=class e extends we{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==re.array)return ee(r,{code:K.invalid_type,expected:re.array,received:r.parsedType}),de;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.length<o.exactLength.value;(a||s)&&(ee(r,{code:a?K.too_big:K.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?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&&(ee(r,{code:K.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&&(ee(r,{code:K.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((a,s)=>o.type._parseAsync(new Ot(r,a,r.path,s)))).then(a=>it.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new Ot(r,a,r.path,s)));return it.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ae.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ae.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ae.toString(r)}})}nonempty(t){return this.min(1,t)}};yr.create=(e,t)=>new yr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pe.ZodArray,...ye(t)});function ko(e){if(e instanceof vt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=kt.create(ko(n))}return new vt({...e._def,shape:()=>t})}else return e instanceof yr?new yr({...e._def,type:ko(e.element)}):e instanceof kt?kt.create(ko(e.unwrap())):e instanceof Jt?Jt.create(ko(e.unwrap())):e instanceof Zt?Zt.create(e.items.map(t=>ko(t))):e}var vt=class e extends we{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=Ce.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==re.object){let c=this._getOrReturnCtx(t);return ee(c,{code:K.invalid_type,expected:re.object,received:c.parsedType}),de}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Lt&&this._def.unknownKeys==="strip"))for(let c in o.data)a.includes(c)||s.push(c);let u=[];for(let c of a){let g=i[c],v=o.data[c];u.push({key:{status:"valid",value:c},value:g._parse(new Ot(o,v,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof Lt){let c=this._def.unknownKeys;if(c==="passthrough")for(let g of s)u.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(c==="strict")s.length>0&&(ee(o,{code:K.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let g of s){let v=o.data[g];u.push({key:{status:"valid",value:g},value:c._parse(new Ot(o,v,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let c=[];for(let g of u){let v=yield g.key,E=yield g.value;c.push({key:v,value:E,alwaysSet:g.alwaysSet})}return c})).then(c=>it.mergeObjectSync(n,c)):it.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return ae.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:ae.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:pe.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 Ce.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 Ce.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return ko(this)}partial(t){let r={};for(let n of Ce.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 Ce.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof kt;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return wv(Ce.objectKeys(this.shape))}};vt.create=(e,t)=>new vt({shape:()=>e,unknownKeys:"strip",catchall:Lt.create(),typeName:pe.ZodObject,...ye(t)});vt.strictCreate=(e,t)=>new vt({shape:()=>e,unknownKeys:"strict",catchall:Lt.create(),typeName:pe.ZodObject,...ye(t)});vt.lazycreate=(e,t)=>new vt({shape:e,unknownKeys:"strip",catchall:Lt.create(),typeName:pe.ZodObject,...ye(t)});var bn=class extends we{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new yt(s.ctx.common.issues));return ee(r,{code:K.invalid_union,unionErrors:a}),de}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x86){return _ref38.apply(this,arguments)}}())).then(o);{let i,a=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},g=u._parseSync({data:r.data,path:r.path,parent:c});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(u=>new yt(u));return ee(r,{code:K.invalid_union,unionErrors:s}),de}}get options(){return this._def.options}};bn.create=(e,t)=>new bn({options:e,typeName:pe.ZodUnion,...ye(t)});var gr=e=>e instanceof An?gr(e.schema):e instanceof Pt?gr(e.innerType()):e instanceof xn?[e.value]:e instanceof Cn?e.options:e instanceof En?Ce.objectValues(e.enum):e instanceof Rn?gr(e._def.innerType):e instanceof vn?[void 0]:e instanceof Sn?[null]:e instanceof kt?[void 0,...gr(e.unwrap())]:e instanceof Jt?[null,...gr(e.unwrap())]:e instanceof ta||e instanceof Tn?gr(e.unwrap()):e instanceof In?gr(e._def.innerType):[],dc=class e extends we{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.object)return ee(r,{code:K.invalid_type,expected:re.object,received:r.parsedType}),de;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(ee(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),de)}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 i of r){let a=gr(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);o.set(s,i)}}return new e({typeName:pe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...ye(n)})}};function Ip(e,t){let r=Xt(e),n=Xt(t);if(e===t)return{valid:!0,data:e};if(r===re.object&&n===re.object){let o=Ce.objectKeys(t),i=Ce.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(let s of i){let u=Ip(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(r===re.array&&n===re.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],u=Ip(a,s);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return r===re.date&&n===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var wn=class extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(uc(i)||uc(a))return de;let s=Ip(i.value,a.value);return s.valid?((lc(i)||lc(a))&&r.dirty(),{status:r.value,value:s.data}):(ee(n,{code:K.invalid_intersection_types}),de)};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(([i,a])=>o(i,a)):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}))}};wn.create=(e,t,r)=>new wn({left:e,right:t,typeName:pe.ZodIntersection,...ye(r)});var Zt=class e extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==re.array)return ee(n,{code:K.invalid_type,expected:re.array,received:n.parsedType}),de;if(n.data.length<this._def.items.length)return ee(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&n.data.length>this._def.items.length&&(ee(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let u=this._def.items[s]||this._def.rest;return u?u._parse(new Ot(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>it.mergeArray(r,a)):it.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Zt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zt({items:e,typeName:pe.ZodTuple,rest:null,...ye(t)})};var pc=class e extends we{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!==re.object)return ee(n,{code:K.invalid_type,expected:re.object,received:n.parsedType}),de;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new Ot(n,s,n.path,s)),value:a._parse(new Ot(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?it.mergeObjectAsync(r,o):it.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof we?new e({keyType:t,valueType:r,typeName:pe.ZodRecord,...ye(n)}):new e({keyType:qr.create(),valueType:t,typeName:pe.ZodRecord,...ye(r)})}},No=class extends we{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!==re.map)return ee(n,{code:K.invalid_type,expected:re.map,received:n.parsedType}),de;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,u],c)=>({key:o._parse(new Ot(n,s,n.path,[c,"key"])),value:i._parse(new Ot(n,u,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let u of a){let c=yield u.key,g=yield u.value;if(c.status==="aborted"||g.status==="aborted")return de;(c.status==="dirty"||g.status==="dirty")&&r.dirty(),s.set(c.value,g.value)}return{status:r.value,value:s}}))}else{let s=new Map;for(let u of a){let c=u.key,g=u.value;if(c.status==="aborted"||g.status==="aborted")return de;(c.status==="dirty"||g.status==="dirty")&&r.dirty(),s.set(c.value,g.value)}return{status:r.value,value:s}}}};No.create=(e,t,r)=>new No({valueType:t,keyType:e,typeName:pe.ZodMap,...ye(r)});var Fo=class e extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==re.set)return ee(n,{code:K.invalid_type,expected:re.set,received:n.parsedType}),de;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ee(n,{code:K.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&&(ee(n,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(u){let c=new Set;for(let g of u){if(g.status==="aborted")return de;g.status==="dirty"&&r.dirty(),c.add(g.value)}return{status:r.value,value:c}}let s=[...n.data.values()].map((u,c)=>i._parse(new Ot(n,u,n.path,c)));return n.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:ae.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ae.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Fo.create=(e,t)=>new Fo({valueType:e,minSize:null,maxSize:null,typeName:pe.ZodSet,...ye(t)});var fc=class e extends we{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.function)return ee(r,{code:K.invalid_type,expected:re.function,received:r.parsedType}),de;function n(s,u){return ea({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,To(),mr].filter(c=>!!c),issueData:{code:K.invalid_arguments,argumentsError:u}})}function o(s,u){return ea({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,To(),mr].filter(c=>!!c),issueData:{code:K.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Lr){let s=this;return ct(/*#__PURE__*/_asyncToGenerator(function*(...u){let c=new yt([]),g=yield s._def.args.parseAsync(u,i).catch(h=>{throw c.addIssue(n(u,h)),c}),v=yield Reflect.apply(a,this,g);return yield s._def.returns._def.type.parseAsync(v,i).catch(h=>{throw c.addIssue(o(v,h)),c})}))}else{let s=this;return ct(function(...u){let c=s._def.args.safeParse(u,i);if(!c.success)throw new yt([n(u,c.error)]);let g=Reflect.apply(a,this,c.data),v=s._def.returns.safeParse(g,i);if(!v.success)throw new yt([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:Zt.create(t).rest(hr.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||Zt.create([]).rest(hr.create()),returns:r||hr.create(),typeName:pe.ZodFunction,...ye(n)})}},An=class extends we{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})}};An.create=(e,t)=>new An({getter:e,typeName:pe.ZodLazy,...ye(t)});var xn=class extends we{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ee(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:t.data}}get value(){return this._def.value}};xn.create=(e,t)=>new xn({value:e,typeName:pe.ZodLiteral,...ye(t)});function wv(e,t){return new Cn({values:e,typeName:pe.ZodEnum,...ye(t)})}var Cn=class e extends we{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ee(r,{expected:Ce.joinValues(n),received:r.parsedType,code:K.invalid_type}),de}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 ee(r,{received:r.data,code:K.invalid_enum_value,options:n}),de}return ct(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})}};Cn.create=wv;var En=class extends we{_parse(t){let r=Ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==re.string&&n.parsedType!==re.number){let o=Ce.objectValues(r);return ee(n,{expected:Ce.joinValues(o),received:n.parsedType,code:K.invalid_type}),de}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ce.objectValues(r);return ee(n,{received:n.data,code:K.invalid_enum_value,options:o}),de}return ct(t.data)}get enum(){return this._def.values}};En.create=(e,t)=>new En({values:e,typeName:pe.ZodNativeEnum,...ye(t)});var Lr=class extends we{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.promise&&r.common.async===!1)return ee(r,{code:K.invalid_type,expected:re.promise,received:r.parsedType}),de;let n=r.parsedType===re.promise?r.data:Promise.resolve(r.data);return ct(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Lr.create=(e,t)=>new Lr({type:e,typeName:pe.ZodPromise,...ye(t)});var Pt=class extends we{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this12=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{ee(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(s){if(r.value==="aborted")return de;let u=yield _this12._def.schema._parseAsync({data:s,path:n.path,parent:n});return u.status==="aborted"?de:u.status==="dirty"?fn(u.value):r.value==="dirty"?fn(u.value):u});return function(_x87){return _ref41.apply(this,arguments)}}());{if(r.value==="aborted")return de;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?de:s.status==="dirty"?fn(s.value):r.value==="dirty"?fn(s.value):s}}if(o.type==="refinement"){let a=s=>{let u=o.refinement(s,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?de:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?de:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Mr(a))return de;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Mr(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):de);Ce.assertNever(o)}};Pt.create=(e,t,r)=>new Pt({schema:e,typeName:pe.ZodEffects,effect:t,...ye(r)});Pt.createWithPreprocess=(e,t,r)=>new Pt({schema:t,effect:{type:"preprocess",transform:e},typeName:pe.ZodEffects,...ye(r)});var kt=class extends we{_parse(t){return this._getType(t)===re.undefined?ct(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};kt.create=(e,t)=>new kt({innerType:e,typeName:pe.ZodOptional,...ye(t)});var Jt=class extends we{_parse(t){return this._getType(t)===re.null?ct(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Jt.create=(e,t)=>new Jt({innerType:e,typeName:pe.ZodNullable,...ye(t)});var Rn=class extends we{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===re.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rn.create=(e,t)=>new Rn({innerType:e,typeName:pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ye(t)});var In=class extends we{_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 _o(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new yt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};In.create=(e,t)=>new In({innerType:e,typeName:pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ye(t)});var Do=class extends we{_parse(t){if(this._getType(t)!==re.nan){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.nan,received:n.parsedType}),de}return{status:"valid",value:t.data}}};Do.create=e=>new Do({typeName:pe.ZodNaN,...ye(e)});var zT=Symbol("zod_brand"),ta=class extends we{_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}},ra=class e extends we{_parse(t){var _this13=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this13._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?de:i.status==="dirty"?(r.dirty(),fn(i.value)):_this13._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?de: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:pe.ZodPipeline})}},Tn=class extends we{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Mr(o)&&(o.value=Object.freeze(o.value)),o);return _o(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Tn.create=(e,t)=>new Tn({innerType:e,typeName:pe.ZodReadonly,...ye(t)});function yv(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Av(e,t={},r){return e?jr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let s=yv(t,n),u=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:u})}});if(!i){let a=yv(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}}):jr.create()}var WT={object:vt.lazycreate},pe;(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"})(pe||(pe={}));var KT=(e,t={message:`Input not instance of ${e.name}`})=>Av(r=>r instanceof e,t),xv=qr.create,Cv=mn.create,YT=Do.create,XT=gn.create,Ev=hn.create,ZT=yn.create,JT=Oo.create,e_=vn.create,t_=Sn.create,r_=jr.create,n_=hr.create,o_=Lt.create,i_=Po.create,a_=yr.create,s_=vt.create,c_=vt.strictCreate,u_=bn.create,l_=dc.create,d_=wn.create,p_=Zt.create,f_=pc.create,m_=No.create,g_=Fo.create,h_=fc.create,y_=An.create,v_=xn.create,S_=Cn.create,b_=En.create,w_=Lr.create,A_=Pt.create,x_=kt.create,C_=Jt.create,E_=Pt.createWithPreprocess,R_=ra.create,I_=()=>xv().optional(),T_=()=>Cv().optional(),__=()=>Ev().optional(),k_={string:e=>qr.create({...e,coerce:!0}),number:e=>mn.create({...e,coerce:!0}),boolean:e=>hn.create({...e,coerce:!0}),bigint:e=>gn.create({...e,coerce:!0}),date:e=>yn.create({...e,coerce:!0})};var O_=de;var P_=w.object({name:w.string(),arguments:w.string()}),N_=w.object({id:w.string(),type:w.literal("function"),function:P_,encryptedValue:w.string().optional()}),mc=w.object({id:w.string(),role:w.string(),content:w.string().optional(),name:w.string().optional(),encryptedValue:w.string().optional()}),F_=w.object({type:w.literal("text"),text:w.string()}),D_=w.object({type:w.literal("data"),value:w.string(),mimeType:w.string()}),M_=w.object({type:w.literal("url"),value:w.string(),mimeType:w.string().optional()}),gc=w.discriminatedUnion("type",[D_,M_]),q_=w.object({type:w.literal("image"),source:gc,metadata:w.unknown().optional()}),j_=w.object({type:w.literal("audio"),source:gc,metadata:w.unknown().optional()}),L_=w.object({type:w.literal("video"),source:gc,metadata:w.unknown().optional()}),U_=w.object({type:w.literal("document"),source:gc,metadata:w.unknown().optional()});var Rv=w.object({type:w.literal("binary"),mimeType:w.string(),id:w.string().optional(),url:w.string().optional(),data:w.string().optional(),filename:w.string().optional()}),Iv=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:w.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},K6=Rv.superRefine((e,t)=>{Iv(e,t)}),V_=w.discriminatedUnion("type",[F_,q_,j_,L_,U_,Rv]),B_=V_.superRefine((e,t)=>{e.type==="binary"&&Iv(e,t)}),G_=mc.extend({role:w.literal("developer"),content:w.string()}),$_=mc.extend({role:w.literal("system"),content:w.string()}),Q_=mc.extend({role:w.literal("assistant"),content:w.string().optional(),toolCalls:w.array(N_).optional()}),H_=mc.extend({role:w.literal("user"),content:w.union([w.string(),w.array(B_)])}),z_=w.object({id:w.string(),content:w.string(),role:w.literal("tool"),toolCallId:w.string(),error:w.string().optional(),encryptedValue:w.string().optional()}),W_=w.object({id:w.string(),role:w.literal("activity"),activityType:w.string(),content:w.record(w.any())}),K_=w.object({id:w.string(),role:w.literal("reasoning"),content:w.string(),encryptedValue:w.string().optional()}),Tv=w.discriminatedUnion("role",[G_,$_,Q_,H_,z_,W_,K_]),Y6=w.union([w.literal("developer"),w.literal("system"),w.literal("assistant"),w.literal("user"),w.literal("tool"),w.literal("activity"),w.literal("reasoning")]),Y_=w.object({description:w.string(),value:w.string()}),_v=w.object({name:w.string(),description:w.string(),parameters:w.any(),metadata:w.record(w.any()).optional()}),X_=w.object({id:w.string(),reason:w.string(),message:w.string().optional(),toolCallId:w.string().optional(),responseSchema:w.record(w.any()).optional(),expiresAt:w.string().optional(),metadata:w.record(w.any()).optional()}),Z_=w.object({interruptId:w.string(),status:w.enum(["resolved","cancelled"]),payload:w.any().optional()}),J_=w.object({threadId:w.string(),runId:w.string(),parentRunId:w.string().optional(),state:w.any(),messages:w.array(Tv),tools:w.array(_v),context:w.array(Y_),forwardedProps:w.any(),resume:w.array(Z_).optional()}),e0=w.any(),qe=class extends Error{constructor(e){super(e)}},Tp=class extends qe{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},t0=w.object({name:w.string(),description:w.string().optional()}),r0=w.object({name:w.string().optional(),type:w.string().optional(),description:w.string().optional(),version:w.string().optional(),provider:w.string().optional(),documentationUrl:w.string().optional(),metadata:w.record(w.unknown()).optional()}),n0=w.object({streaming:w.boolean().optional(),websocket:w.boolean().optional(),httpBinary:w.boolean().optional(),pushNotifications:w.boolean().optional(),resumable:w.boolean().optional()}),o0=w.object({supported:w.boolean().optional(),items:w.array(_v).optional(),parallelCalls:w.boolean().optional(),clientProvided:w.boolean().optional()}),i0=w.object({structuredOutput:w.boolean().optional(),supportedMimeTypes:w.array(w.string()).optional()}),a0=w.object({snapshots:w.boolean().optional(),deltas:w.boolean().optional(),memory:w.boolean().optional(),persistentState:w.boolean().optional()}),s0=w.object({supported:w.boolean().optional(),delegation:w.boolean().optional(),handoffs:w.boolean().optional(),subAgents:w.array(t0).optional()}),c0=w.object({supported:w.boolean().optional(),streaming:w.boolean().optional(),encrypted:w.boolean().optional()}),u0=w.object({image:w.boolean().optional(),audio:w.boolean().optional(),video:w.boolean().optional(),pdf:w.boolean().optional(),file:w.boolean().optional()}),l0=w.object({image:w.boolean().optional(),audio:w.boolean().optional()}),d0=w.object({input:u0.optional(),output:l0.optional()}),p0=w.object({codeExecution:w.boolean().optional(),sandboxed:w.boolean().optional(),maxIterations:w.number().optional(),maxExecutionTime:w.number().optional()}),f0=w.object({supported:w.boolean().optional(),approvals:w.boolean().optional(),interventions:w.boolean().optional(),feedback:w.boolean().optional(),interrupts:w.boolean().optional(),approveWithEdits:w.boolean().optional()}),X6=w.object({identity:r0.optional(),transport:n0.optional(),tools:o0.optional(),output:i0.optional(),state:a0.optional(),multiAgent:s0.optional(),reasoning:c0.optional(),multimodal:d0.optional(),execution:p0.optional(),humanInTheLoop:f0.optional(),custom:w.record(w.unknown()).optional()}),kv=w.union([w.literal("developer"),w.literal("system"),w.literal("assistant"),w.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}({}),Te=w.object({type:w.nativeEnum(M),timestamp:w.number().optional(),rawEvent:w.any().optional()}).passthrough(),m0=Te.extend({type:w.literal(M.TEXT_MESSAGE_START),messageId:w.string(),role:kv.default("assistant"),name:w.string().optional()}),Ov=Te.extend({type:w.literal(M.TEXT_MESSAGE_CONTENT),messageId:w.string(),delta:w.string()}),g0=Te.extend({type:w.literal(M.TEXT_MESSAGE_END),messageId:w.string()}),h0=Te.extend({type:w.literal(M.TEXT_MESSAGE_CHUNK),messageId:w.string().optional(),role:kv.optional(),delta:w.string().optional(),name:w.string().optional()}),y0=Te.extend({type:w.literal(M.THINKING_TEXT_MESSAGE_START)}),v0=Ov.omit({messageId:!0,type:!0}).extend({type:w.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),S0=Te.extend({type:w.literal(M.THINKING_TEXT_MESSAGE_END)}),b0=Te.extend({type:w.literal(M.TOOL_CALL_START),toolCallId:w.string(),toolCallName:w.string(),parentMessageId:w.string().optional()}),w0=Te.extend({type:w.literal(M.TOOL_CALL_ARGS),toolCallId:w.string(),delta:w.string()}),A0=Te.extend({type:w.literal(M.TOOL_CALL_END),toolCallId:w.string()}),x0=Te.extend({messageId:w.string(),type:w.literal(M.TOOL_CALL_RESULT),toolCallId:w.string(),content:w.string(),role:w.literal("tool").optional()}),C0=Te.extend({type:w.literal(M.TOOL_CALL_CHUNK),toolCallId:w.string().optional(),toolCallName:w.string().optional(),parentMessageId:w.string().optional(),delta:w.string().optional()}),E0=Te.extend({type:w.literal(M.THINKING_START),title:w.string().optional()}),R0=Te.extend({type:w.literal(M.THINKING_END)}),I0=Te.extend({type:w.literal(M.STATE_SNAPSHOT),snapshot:e0}),T0=Te.extend({type:w.literal(M.STATE_DELTA),delta:w.array(w.any())}),_0=Te.extend({type:w.literal(M.MESSAGES_SNAPSHOT),messages:w.array(Tv)}),k0=Te.extend({type:w.literal(M.ACTIVITY_SNAPSHOT),messageId:w.string(),activityType:w.string(),content:w.record(w.any()),replace:w.boolean().optional().default(!0)}),O0=Te.extend({type:w.literal(M.ACTIVITY_DELTA),messageId:w.string(),activityType:w.string(),patch:w.array(w.any())}),P0=Te.extend({type:w.literal(M.RAW),event:w.any(),source:w.string().optional()}),N0=Te.extend({type:w.literal(M.CUSTOM),name:w.string(),value:w.any()}),F0=Te.extend({type:w.literal(M.RUN_STARTED),threadId:w.string(),runId:w.string(),parentRunId:w.string().optional(),input:J_.optional()}),D0=w.object({type:w.literal("success")}).strict(),M0=w.object({type:w.literal("interrupt"),interrupts:w.array(X_).min(1)}).strict(),q0=w.discriminatedUnion("type",[D0,M0]),j0=Te.extend({type:w.literal(M.RUN_FINISHED),threadId:w.string(),runId:w.string(),result:w.any().optional(),outcome:q0.nullable().optional().transform(e=>e??void 0)}),L0=Te.extend({type:w.literal(M.RUN_ERROR),message:w.string(),code:w.string().optional()}),U0=Te.extend({type:w.literal(M.STEP_STARTED),stepName:w.string()}),V0=Te.extend({type:w.literal(M.STEP_FINISHED),stepName:w.string()}),B0=w.union([w.literal("tool-call"),w.literal("message")]),G0=Te.extend({type:w.literal(M.REASONING_START),messageId:w.string()}),$0=Te.extend({type:w.literal(M.REASONING_MESSAGE_START),messageId:w.string(),role:w.literal("reasoning")}),Q0=Te.extend({type:w.literal(M.REASONING_MESSAGE_CONTENT),messageId:w.string(),delta:w.string()}),H0=Te.extend({type:w.literal(M.REASONING_MESSAGE_END),messageId:w.string()}),z0=Te.extend({type:w.literal(M.REASONING_MESSAGE_CHUNK),messageId:w.string().optional(),delta:w.string().optional()}),W0=Te.extend({type:w.literal(M.REASONING_END),messageId:w.string()}),K0=Te.extend({type:w.literal(M.REASONING_ENCRYPTED_VALUE),subtype:B0,entityId:w.string(),encryptedValue:w.string()}),hc=w.discriminatedUnion("type",[m0,Ov,g0,h0,E0,R0,y0,v0,S0,b0,w0,A0,C0,x0,I0,T0,_0,k0,O0,P0,N0,F0,j0,L0,U0,V0,G0,$0,Q0,H0,z0,W0,K0]);m();d();f();p();var _p={};ti(_p,{JsonPatchError:()=>Ge,_areEquals:()=>ia,applyOperation:()=>_n,applyPatch:()=>xc,applyReducer:()=>ek,deepClone:()=>Z0,getValueByPointer:()=>wc,validate:()=>Nv,validator:()=>Ac});m();d();f();p();m();d();f();p();var Y0=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),X0=Object.prototype.hasOwnProperty;function vc(e,t){return X0.call(e,t)}function Sc(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)vc(e,o)&&n.push(o);return n}function at(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function bc(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 er(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function na(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function yc(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(yc(e[t]))return!0}else if(typeof e=="object"){for(var n=Sc(e),o=n.length,i=0;i<o;i++)if(yc(e[n[i]]))return!0}}return!1}function Pv(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
33
  `)}var oa=function(e){Y0(t,e);function t(r,n,o,i,a){var s=this.constructor,u=e.call(this,Pv(r,{name:n,index:o,operation:i,tree:a}))||this;return u.name=n,u.index=o,u.operation=i,u.tree=a,Object.setPrototypeOf(u,s.prototype),u.message=Pv(r,{name:n,index:o,operation:i,tree:a}),u}return t}(Error);var Ge=oa,Z0=at,Mo={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=wc(r,this.path);n&&(n=at(n));var o=_n(r,{op:"remove",path:this.from}).removed;return _n(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=wc(r,this.from);return _n(r,{op:"add",path:this.path,value:at(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:ia(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},J0={add:function(e,t,r){return bc(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:Mo.move,copy:Mo.copy,test:Mo.test,_get:Mo._get};function wc(e,t){if(t=="")return e;var r={op:"_get",path:t};return _n(e,r),r.value}function _n(e,t,r,n,o,i){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),i===void 0&&(i=0),r&&(typeof r=="function"?r(t,0,e,t.path):Ac(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=wc(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=ia(e,t.value),a.test===!1)throw new Ge("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new Ge("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{n||(e=at(e));var s=t.path||"",u=s.split("/"),c=e,g=1,v=u.length,E=void 0,h=void 0,y=void 0;for(typeof r=="function"?y=r:y=Ac;;){if(h=u[g],h&&h.indexOf("~")!=-1&&(h=na(h)),o&&(h=="__proto__"||h=="prototype"&&g>0&&u[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&&E===void 0&&(c[h]===void 0?E=u.slice(0,g).join("/"):g==v-1&&(E=t.path),E!==void 0&&y(t,0,e,E)),g++,Array.isArray(c)){if(h==="-")h=c.length;else{if(r&&!bc(h))throw new Ge("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",i,t,e);bc(h)&&(h=~~h)}if(g>=v){if(r&&t.op==="add"&&h>c.length)throw new Ge("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var a=J0[t.op].call(t,c,h,e);if(a.test===!1)throw new Ge("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(g>=v){var a=Mo[t.op].call(t,c,h,e);if(a.test===!1)throw new Ge("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}if(c=c[h],r&&g<v&&(!c||typeof c!="object"))throw new Ge("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function xc(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new Ge("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=at(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=_n(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function ek(e,t,r){var n=_n(e,t);if(n.test===!1)throw new Ge("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Ac(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ge("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Mo[e.op]){if(typeof e.path!="string")throw new Ge("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ge("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 Ge("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 Ge("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")&&yc(e.value))throw new Ge("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,i=n.split("/").length;if(o!==i+1&&o!==i)throw new Ge("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 Ge("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 a={op:"_get",path:e.from,value:void 0},s=Nv([a],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ge("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Ge("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Nv(e,t,r){try{if(!Array.isArray(e))throw new Ge("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)xc(at(t),at(e),r||!0);else{r=r||Ac;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof Ge)return o;throw o}}function ia(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,i,a;if(r&&n){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!ia(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var s=Object.keys(e);if(i=s.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!t.hasOwnProperty(s[o]))return!1;for(o=i;o--!==0;)if(a=s[o],!ia(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Np={};ti(Np,{compare:()=>ck,generate:()=>kp,observe:()=>sk,unobserve:()=>ak});m();d();f();p();var Op=new WeakMap,tk=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),rk=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function nk(e){return Op.get(e)}function ok(e,t){return e.observers.get(t)}function ik(e,t){e.observers.delete(t.callback)}function ak(e,t){t.unobserve()}function sk(e,t){var r=[],n,o=nk(e);if(!o)o=new tk(e),Op.set(e,o);else{var i=ok(o,t);n=i&&i.observer}if(n)return n;if(n={},o.value=at(e),t){n.callback=t,n.next=null;var a=function(){kp(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=r,n.object=e,n.unobserve=function(){kp(n),clearTimeout(n.next),ik(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},o.observers.set(t,new rk(t,n)),n}function kp(e,t){t===void 0&&(t=!1);var r=Op.get(e.object);Pp(r.value,e.object,e.patches,"",t),e.patches.length&&xc(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function Pp(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=Sc(t),a=Sc(e),s=!1,u=!1,c=a.length-1;c>=0;c--){var g=a[c],v=e[g];if(vc(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var E=t[g];typeof v=="object"&&v!=null&&typeof E=="object"&&E!=null&&Array.isArray(v)===Array.isArray(E)?Pp(v,E,r,n+"/"+er(g),o):v!==E&&(s=!0,o&&r.push({op:"test",path:n+"/"+er(g),value:at(v)}),r.push({op:"replace",path:n+"/"+er(g),value:at(E)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+er(g),value:at(v)}),r.push({op:"remove",path:n+"/"+er(g)}),u=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),s=!0)}if(!(!u&&i.length==a.length))for(var c=0;c<i.length;c++){var g=i[c];!vc(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+er(g),value:at(t[g])})}}}function ck(e,t,r){r===void 0&&(r=!1);var n=[];return Pp(e,t,n,"",r),n}var Cc=Object.assign({},_p,Np,{JsonPatchError:oa,deepClone:at,escapePathComponent:er,unescapePathComponent:na});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Fp=function(e,t){return Fp=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])},Fp(e,t)};function tr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Fp(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Fv(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(g){try{c(n.next(g))}catch(v){a(v)}}function u(g){try{c(n.throw(g))}catch(v){a(v)}}function c(g){g.done?i(g.value):o(g.value).then(s,u)}c((n=n.apply(e,t||[])).next())})}function Ec(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(g){return u([c,g])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(g){c=[6,g],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function vr(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 qo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function jo(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function kn(e){return this instanceof kn?(this.v=e,this):new kn(e)}function Dv(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(h){return function(y){return Promise.resolve(y).then(h,v)}}function s(h,y){n[h]&&(o[h]=function(S){return new Promise(function(C,R){i.push([h,S,C,R])>1||u(h,S)})},y&&(o[h]=y(o[h])))}function u(h,y){try{c(n[h](y))}catch(S){E(i[0][3],S)}}function c(h){h.value instanceof kn?Promise.resolve(h.value.v).then(g,v):E(i[0][2],h)}function g(h){u("next",h)}function v(h){u("throw",h)}function E(h,y){h(y),i.shift(),i.length&&u(i[0][0],i[0][1])}}function Mv(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 vr=="function"?vr(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,u){a=e[i](a),o(s,u,a.done,a.value)})}}function o(i,a,s,u){Promise.resolve(u).then(function(c){i({value:c,done:s})},a)}}m();d();f();p();function xe(e){return typeof e=="function"}m();d();f();p();m();d();f();p();m();d();f();p();function Lo(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 Rc=Lo(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
35
  `):"",this.name="UnsubscriptionError",this.errors=r}});m();d();f();p();function aa(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Uo=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,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=vr(a),u=s.next();!u.done;u=s.next()){var c=u.value;c.remove(this)}}catch(S){t={error:S}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var g=this.initialTeardown;if(xe(g))try{g()}catch(S){i=S instanceof Rc?S.errors:[S]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var E=vr(v),h=E.next();!h.done;h=E.next()){var y=h.value;try{qv(y)}catch(S){i=i??[],S instanceof Rc?i=jo(jo([],qo(i)),qo(S.errors)):i.push(S)}}}catch(S){n={error:S}}finally{try{h&&!h.done&&(o=E.return)&&o.call(E)}finally{if(n)throw n.error}}}if(i)throw new Rc(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)qv(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)&&aa(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&aa(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Dp=Uo.EMPTY;function Ic(e){return e instanceof Uo||e&&"closed"in e&&xe(e.remove)&&xe(e.add)&&xe(e.unsubscribe)}function qv(e){xe(e)?e():e.unsubscribe()}m();d();f();p();var Ut={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};m();d();f();p();m();d();f();p();var Vo={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Vo.delegate;return o?.setTimeout?o.setTimeout.apply(o,jo([e,t],qo(r))):setTimeout.apply(void 0,jo([e,t],qo(r)))},clearTimeout:function(e){var t=Vo.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Tc(e){Vo.setTimeout(function(){var t=Ut.onUnhandledError;if(t)t(e);else throw e})}m();d();f();p();function sa(){}m();d();f();p();var jv=function(){return Mp("C",void 0,void 0)}();function Lv(e){return Mp("E",void 0,e)}function Uv(e){return Mp("N",e,void 0)}function Mp(e,t,r){return{kind:e,value:t,error:r}}m();d();f();p();var On=null;function Bo(e){if(Ut.useDeprecatedSynchronousErrorHandling){var t=!On;if(t&&(On={errorThrown:!1,error:null}),e(),t){var r=On,n=r.errorThrown,o=r.error;if(On=null,n)throw o}}else e()}function Vv(e){Ut.useDeprecatedSynchronousErrorHandling&&On&&(On.errorThrown=!0,On.error=e)}var ca=function(e){tr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Ic(r)&&r.add(n)):n.destination=pk,n}return t.create=function(r,n,o){return new kc(r,n,o)},t.prototype.next=function(r){this.isStopped?jp(Uv(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?jp(Lv(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?jp(jv,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}(Uo);var uk=Function.prototype.bind;function qp(e,t){return uk.call(e,t)}var lk=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){_c(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){_c(n)}else _c(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){_c(r)}},e}(),kc=function(e){tr(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(xe(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&Ut.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&qp(r.next,s),error:r.error&&qp(r.error,s),complete:r.complete&&qp(r.complete,s)}):a=r}return i.destination=new lk(a),i}return t}(ca);function _c(e){Ut.useDeprecatedSynchronousErrorHandling?Vv(e):Tc(e)}function dk(e){throw e}function jp(e,t){var r=Ut.onStoppedNotification;r&&Vo.setTimeout(function(){return r(e,t)})}var pk={closed:!0,next:sa,error:dk,complete:sa};m();d();f();p();var Go=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();m();d();f();p();m();d();f();p();function $o(e){return e}function Oc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Lp(e)}function Lp(e){return e.length===0?$o: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,i=mk(t)?t:new kc(t,r,n);return Bo(function(){var a=o,s=a.operator,u=a.source;i.add(s?s.call(i,u):u?o._subscribe(i):o._trySubscribe(i))}),i},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=Bv(r),new r(function(o,i){var a=new kc({next:function(s){try{t(s)}catch(u){i(u),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Go]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Lp(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Bv(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e}();function Bv(e){var t;return(t=e??Ut.Promise)!==null&&t!==void 0?t:Promise}function fk(e){return e&&xe(e.next)&&xe(e.error)&&xe(e.complete)}function mk(e){return e&&e instanceof ca||fk(e)&&Ic(e)}m();d();f();p();function gk(e){return xe(e?.lift)}function Qe(e){return function(t){if(gk(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")}}m();d();f();p();function We(e,t,r,n,o){return new hk(e,t,r,n,o)}var hk=function(e){tr(t,e);function t(r,n,o,i,a,s){var u=e.call(this,r)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=n?function(c){try{n(c)}catch(g){r.error(g)}}:e.prototype._next,u._error=i?function(c){try{i(c)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,u._complete=o?function(){try{o()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,u}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}(ca);m();d();f();p();m();d();f();p();var Gv=Lo(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var rr=function(e){tr(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 $v(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Gv},t.prototype.next=function(r){var n=this;Bo(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=vr(n.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(r)}}catch(c){o={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Bo(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;Bo(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,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?Dp:(this.currentObservers=null,s.push(r),new Uo(function(){n.currentObservers=null,aa(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new je;return r.source=this,r},t.create=function(r,n){return new $v(r,n)},t}(je);var $v=function(e){tr(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:Dp},t}(rr);m();d();f();p();m();d();f();p();var Up={now:function(){return(Up.delegate||Date).now()},delegate:void 0};var Pc=function(e){tr(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Up);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,u=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+u)),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,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),u=0;u<s.length&&!r.closed;u+=i?1:2)r.next(s[u]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<i.length&&i.splice(0,i.length-s),!a){for(var u=o.now(),c=0,g=1;g<i.length&&i[g]<=u;g+=2)c=g;c&&i.splice(0,c+1)}},t}(rr);m();d();f();p();var Nc=new je(function(e){return e.complete()});m();d();f();p();m();d();f();p();m();d();f();p();function Qv(e){return e&&xe(e.schedule)}function yk(e){return e[e.length-1]}function Hv(e){return Qv(yk(e))?e.pop():void 0}m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Fc=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};m();d();f();p();function Dc(e){return xe(e?.then)}m();d();f();p();function Mc(e){return xe(e[Go])}m();d();f();p();function qc(e){return Symbol.asyncIterator&&xe(e?.[Symbol.asyncIterator])}m();d();f();p();function jc(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.")}m();d();f();p();m();d();f();p();function vk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Lc=vk();function Uc(e){return xe(e?.[Lc])}m();d();f();p();function Vc(e){return Dv(this,arguments,function(){var r,n,o,i;return Ec(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,kn(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,kn(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,kn(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Bc(e){return xe(e?.getReader)}function Ke(e){if(e instanceof je)return e;if(e!=null){if(Mc(e))return Sk(e);if(Fc(e))return bk(e);if(Dc(e))return wk(e);if(qc(e))return zv(e);if(Uc(e))return Ak(e);if(Bc(e))return xk(e)}throw jc(e)}function Sk(e){return new je(function(t){var r=e[Go]();if(xe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function bk(e){return new je(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function wk(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,Tc)})}function Ak(e){return new je(function(t){var r,n;try{for(var o=vr(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function zv(e){return new je(function(t){Ck(e,t).catch(function(r){return t.error(r)})})}function xk(e){return zv(Vc(e))}function Ck(e,t){var r,n,o,i;return Fv(this,void 0,void 0,function(){var a,s;return Ec(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=Mv(e),u.label=1;case 1:return[4,r.next()];case 2:if(n=u.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),o={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:u.sent(),u.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]}})})}m();d();f();p();m();d();f();p();function Nt(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}function Gc(e,t){return t===void 0&&(t=0),Qe(function(r,n){r.subscribe(We(n,function(o){return Nt(n,e,function(){return n.next(o)},t)},function(){return Nt(n,e,function(){return n.complete()},t)},function(o){return Nt(n,e,function(){return n.error(o)},t)}))})}m();d();f();p();function $c(e,t){return t===void 0&&(t=0),Qe(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function Wv(e,t){return Ke(e).pipe($c(t),Gc(t))}m();d();f();p();function Kv(e,t){return Ke(e).pipe($c(t),Gc(t))}m();d();f();p();function Yv(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())})})}m();d();f();p();function Xv(e,t){return new je(function(r){var n;return Nt(r,t,function(){n=e[Lc](),Nt(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(s){r.error(s);return}a?r.complete():r.next(i)},0,!0)}),function(){return xe(n?.return)&&n.return()}})}m();d();f();p();function Qc(e,t){if(!e)throw new Error("Iterable cannot be null");return new je(function(r){Nt(r,t,function(){var n=e[Symbol.asyncIterator]();Nt(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}m();d();f();p();function Zv(e,t){return Qc(Vc(e),t)}function Jv(e,t){if(e!=null){if(Mc(e))return Wv(e,t);if(Fc(e))return Yv(e,t);if(Dc(e))return Kv(e,t);if(qc(e))return Qc(e,t);if(Uc(e))return Xv(e,t);if(Bc(e))return Zv(e,t)}throw jc(e)}function Pn(e,t){return t?Jv(e,t):Ke(e)}function Ve(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Hv(e);return Pn(e,r)}m();d();f();p();function Le(e,t){var r=xe(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)}m();d();f();p();m();d();f();p();var eS=Lo(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Hc(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(s){a=s,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new eS)}})})}m();d();f();p();function Nn(e,t){return Qe(function(r,n){var o=0;r.subscribe(We(n,function(i){n.next(e.call(t,i,o++))}))})}m();d();f();p();m();d();f();p();m();d();f();p();function tS(e,t,r,n,o,i,a,s){var u=[],c=0,g=0,v=!1,E=function(){v&&!u.length&&!c&&t.complete()},h=function(S){return c<n?y(S):u.push(S)},y=function(S){i&&t.next(S),c++;var C=!1;Ke(r(S,g++)).subscribe(We(t,function(R){o?.(R),i?h(R):t.next(R)},function(){C=!0},void 0,function(){if(C)try{c--;for(var R=function(){var T=u.shift();a?Nt(t,a,function(){return y(T)}):y(T)};u.length&&c<n;)R();E()}catch(T){t.error(T)}}))};return e.subscribe(We(t,h,function(){v=!0,E()})),function(){s?.()}}function St(e,t,r){return r===void 0&&(r=1/0),xe(t)?St(function(n,o){return Nn(function(i,a){return t(n,i,o,a)})(Ke(e(n,o)))},r):(typeof t=="number"&&(r=t),Qe(function(n,o){return tS(n,o,e,r)}))}function Vp(e){return e===void 0&&(e=1/0),St($o,e)}m();d();f();p();function zc(e){return new je(function(t){Ke(e()).subscribe(t)})}m();d();f();p();function ua(e){return Qe(function(t,r){var n=null,o=!1,i;n=t.subscribe(We(r,void 0,void 0,function(a){i=Ke(e(a,ua(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}m();d();f();p();function Wc(e,t){return xe(t)?St(e,t,1):St(e,1)}m();d();f();p();function Bp(e){return Qe(function(t,r){var n=!1;t.subscribe(We(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}m();d();f();p();function Fn(e){return Qe(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}m();d();f();p();function Gp(e,t){return Qe(function(r,n){var o=null,i=0,a=!1,s=function(){return a&&!o&&n.complete()};r.subscribe(We(n,function(u){o?.unsubscribe();var c=0,g=i++;Ke(e(u,g)).subscribe(o=We(n,function(v){return n.next(t?t(u,v,g,c++):v)},function(){o=null,s()}))},function(){a=!0,s()}))})}m();d();f();p();function Kc(e){return Qe(function(t,r){Ke(e).subscribe(We(r,function(){return r.complete()},sa)),!r.closed&&t.subscribe(r)})}m();d();f();p();function $p(e,t,r){var n=xe(e)||t||r?{next:e,error:t,complete:r}:e;return n?Qe(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;o.subscribe(We(i,function(u){var c;(c=n.next)===null||c===void 0||c.call(n,u),i.next(u)},function(){var u;s=!1,(u=n.complete)===null||u===void 0||u.call(n),i.complete()},function(u){var c;s=!1,(c=n.error)===null||c===void 0||c.call(n,u),i.error(u)},function(){var u,c;s&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):$o}m();d();f();p();m();d();f();p();function rS(e){return` \r
@@ -72,4 +72,4 @@ fast-json-patch/module/duplex.mjs:
72
72
  *)
73
73
  */if(__exports!=exports)module.exports=exports;return module.exports});
74
74
 
75
- window.coveoQuanticVersion = '3.43.1';
75
+ window.coveoQuanticVersion = '3.43.3';