@coveo/quantic 3.36.7 → 3.36.9

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 (165) hide show
  1. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +14 -14
  2. package/force-app/main/default/staticresources/coveoheadless/definitions/api/api-client-utils.d.ts +1 -1
  3. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/request.d.ts +2 -2
  4. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/result.d.ts +12 -0
  5. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/product-enrichment/product-enrichment-request.d.ts +2 -2
  6. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/recommendations/recommendations-request.d.ts +2 -2
  7. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/plan/plan-request.d.ts +2 -2
  8. package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/query-suggest/query-suggest-request.d.ts +2 -2
  9. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/answer-agent/head-answer-strategy.d.ts +2 -2
  10. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-slice.d.ts +0 -5
  11. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +3 -3
  12. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-case-classifications/get-case-classifications-request.d.ts +2 -2
  13. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-document-suggestions/get-document-suggestions-request.d.ts +2 -2
  14. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/get-interface/get-interface-config-request.d.ts +2 -2
  15. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/query/query-request.d.ts +4 -4
  16. package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/user-actions/user-actions-request.d.ts +2 -2
  17. package/force-app/main/default/staticresources/coveoheadless/definitions/app/search-engine/search-engine.d.ts +1 -1
  18. package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +35 -36
  19. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/breadcrumb-manager/headless-breadcrumb-manager.d.ts +1 -1
  20. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/headless-core-commerce-facet.d.ts +1 -1
  21. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sort/headless-core-commerce-sort.d.ts +2 -2
  22. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/url-manager/headless-core-url-manager.d.ts +1 -1
  23. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recent-queries-list/headless-recent-queries-list.d.ts +1 -1
  24. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/did-you-mean/headless-did-you-mean.d.ts +1 -1
  25. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search-box/headless-search-box.d.ts +1 -1
  26. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/context/headless-context.d.ts +1 -1
  27. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet.d.ts +1 -1
  28. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-facet.d.ts +1 -1
  29. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/generated-answer/headless-core-interactive-citation.d.ts +5 -1
  30. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/search-box/headless-core-search-box.d.ts +1 -1
  31. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/did-you-mean/headless-did-you-mean.d.ts +1 -1
  32. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facet-manager/headless-facet-manager.d.ts +1 -1
  33. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/category-facet/headless-category-facet.d.ts +1 -1
  34. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet.d.ts +1 -1
  35. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/date-facet/headless-date-facet.d.ts +1 -1
  36. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/date-facet/headless-date-filter.d.ts +1 -1
  37. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/numeric-facet/headless-numeric-facet.d.ts +1 -1
  38. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/numeric-facet/headless-numeric-filter.d.ts +1 -1
  39. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/folded-result-list/headless-folded-result-list.d.ts +1 -1
  40. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-generated-answer.d.ts +1 -1
  41. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-interactive-citation.d.ts +1 -1
  42. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/breadcrumb-manager/headless-insight-breadcrumb-manager.d.ts +1 -1
  43. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/did-you-mean/headless-insight-did-you-mean.d.ts +1 -1
  44. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-conditions-manager/headless-facet-conditions-manager.d.ts +1 -1
  45. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-manager/headless-insight-facet-manager.d.ts +1 -1
  46. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/category-facet/headless-insight-category-facet.d.ts +1 -1
  47. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/facet/headless-insight-facet-options.d.ts +1 -1
  48. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/facet/headless-insight-facet.d.ts +1 -1
  49. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/date-facet/headless-insight-date-facet.d.ts +1 -1
  50. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/date-facet/headless-insight-date-filter.d.ts +1 -1
  51. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/numeric-facet/headless-insight-numeric-facet.d.ts +1 -1
  52. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/numeric-facet/headless-insight-numeric-filter.d.ts +1 -1
  53. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/folded-result-list/headless-insight-folded-result-list.d.ts +1 -1
  54. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-generated-answer.d.ts +1 -1
  55. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-interactive-citation.d.ts +1 -1
  56. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/pager/headless-insight-pager.d.ts +1 -1
  57. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/recent-queries-list/headless-insight-recent-queries-list.d.ts +1 -1
  58. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-interactive-result.d.ts +1 -1
  59. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-result-list.d.ts +1 -1
  60. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/results-per-page/headless-insight-results-per-page.d.ts +1 -1
  61. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/search-box/headless-insight-search-box.d.ts +1 -1
  62. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/search-parameter-manager/headless-insight-search-parameter-manager.d.ts +1 -1
  63. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/sort/headless-insight-sort.d.ts +1 -1
  64. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/tab/headless-insight-tab.d.ts +1 -1
  65. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/pager/headless-pager.d.ts +1 -1
  66. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/quickview/headless-quickview.d.ts +1 -1
  67. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-queries-list/headless-recent-queries-list.d.ts +1 -1
  68. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/result-list/headless-recommendation-interactive-result.d.ts +1 -1
  69. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/relevance-inspector/headless-relevance-inspector.d.ts +1 -1
  70. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-result-list.d.ts +1 -1
  71. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/results-per-page/headless-results-per-page.d.ts +1 -1
  72. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-box/headless-search-box.d.ts +1 -1
  73. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-parameter-manager/headless-search-parameter-manager.d.ts +1 -1
  74. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-status/headless-search-status.d.ts +1 -1
  75. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/smart-snippet/headless-smart-snippet.d.ts +1 -1
  76. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/sort/headless-sort.d.ts +1 -1
  77. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/standalone-search-box/headless-standalone-search-box.d.ts +1 -1
  78. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/static-filter/headless-static-filter.d.ts +1 -1
  79. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/tab/headless-tab.d.ts +1 -1
  80. package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/generic-analytics-actions-loader.d.ts +1 -1
  81. package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/insight-analytics-actions-loader.d.ts +1 -1
  82. package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/search-analytics-actions-loader.d.ts +1 -1
  83. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/date-facet/date-facet-actions-loader.d.ts +1 -1
  84. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/numeric-facet/numeric-facet-actions-loader.d.ts +1 -1
  85. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/pagination/pagination-actions-loader.d.ts +1 -1
  86. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-actions-loader.d.ts +1 -1
  87. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/recommendations/recommendations-actions-loader.d.ts +1 -1
  88. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-actions-loader.d.ts +1 -1
  89. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/sort/sort.d.ts +1 -1
  90. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/triggers/triggers-actions-loader.d.ts +1 -1
  91. package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-actions-loader.d.ts +1 -1
  92. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facet-options/facet-options-actions-loader.d.ts +1 -1
  93. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/category-facet-set/category-facet-set-actions-loader.d.ts +1 -1
  94. package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-set/facet-set-actions-loader.d.ts +1 -1
  95. package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/insight-folding-actions.d.ts +1 -1
  96. package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-actions.d.ts +10 -18
  97. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +11 -25
  98. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-request.d.ts +13 -2
  99. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-selectors.d.ts +1 -1
  100. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +7 -0
  101. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/sse-generated-answer-errors.d.ts +22 -1
  102. package/force-app/main/default/staticresources/coveoheadless/definitions/features/instant-results/instant-results-actions-loader.d.ts +1 -1
  103. package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/legacy/search-request.d.ts +1 -1
  104. package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-request.d.ts +1 -1
  105. package/force-app/main/default/staticresources/coveoheadless/definitions/features/search-parameters/search-parameter-actions.d.ts +0 -1
  106. package/force-app/main/default/staticresources/coveoheadless/definitions/features/standalone-search-box-set/standalone-search-box-set-actions-loader.d.ts +1 -1
  107. package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +25 -25
  108. package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +5 -5
  109. package/force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index.d.ts +1 -1
  110. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -1
  111. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +1 -1
  112. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
  113. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +1 -1
  114. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +1 -1
  115. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/product-enrichment/headless-product-enrichment.ssr.d.ts +1 -1
  116. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/product-list/headless-product-list.ssr.d.ts +15 -3
  117. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -1
  118. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -1
  119. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
  120. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/summary/headless-core-summary.ssr.d.ts +1 -1
  121. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/controller-definitions.d.ts +1 -1
  122. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/engine.d.ts +1 -1
  123. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +2 -0
  124. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +1 -0
  125. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -1
  126. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +1 -1
  127. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
  128. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +1 -1
  129. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +1 -1
  130. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-enrichment/headless-product-enrichment.ssr.d.ts +1 -1
  131. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-list/headless-product-list.ssr.d.ts +15 -3
  132. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -1
  133. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -1
  134. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
  135. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/summary/headless-core-summary.ssr.d.ts +1 -1
  136. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/triggers/headless-query-trigger.ssr.d.ts +3 -2
  137. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/recommendation-static-state-factory.d.ts +1 -1
  138. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/factories/static-state-factory.d.ts +1 -1
  139. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-inference.d.ts +1 -1
  140. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +1 -1
  141. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/controller-definition.d.ts +1 -1
  142. package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-controller.d.ts +2 -1
  143. package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-product-listing-controller.d.ts +2 -0
  144. package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-search-controller.d.ts +2 -0
  145. package/force-app/main/default/staticresources/coveoheadless/definitions/utils/facet-utils.d.ts +1 -1
  146. package/force-app/main/default/staticresources/coveoheadless/definitions/utils/query-expression/query-expression.d.ts +1 -1
  147. package/force-app/main/default/staticresources/coveoheadless/headless.js +19 -19
  148. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +17 -17
  149. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +13 -13
  150. package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
  151. package/package.json +17 -18
  152. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/answer-generation-api-state.d.ts +0 -29
  153. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/answer-generation-api.d.ts +0 -4
  154. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/answer/answer-endpoint.d.ts +0 -30
  155. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/answer/url-builders/endpoint-url-builder.d.ts +0 -5
  156. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/follow-up/follow-up-endpoint.d.ts +0 -24
  157. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/follow-up/url-builders/endpoint-url-builder.d.ts +0 -5
  158. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/streaming/answer-draft-reducer/answer-draft-reducer.d.ts +0 -26
  159. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/streaming/answer-streaming-runner.d.ts +0 -26
  160. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/streaming/server-state-event-handler/server-state-event-handler.d.ts +0 -21
  161. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/streaming/strategies/streaming-strategy-creators.d.ts +0 -4
  162. package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/streaming/types.d.ts +0 -41
  163. package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answer-request.d.ts +0 -4
  164. package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answer-strategy.d.ts +0 -3
  165. package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/head-answer-strategy.d.ts +0 -3
@@ -14,38 +14,38 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadless",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadless"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var tO=Object.create;var bu=Object.defineProperty;var rO=Object.getOwnPropertyDescriptor;var nO=Object.getOwnPropertyNames;var aO=Object.getPrototypeOf,oO=Object.prototype.hasOwnProperty;var iO=(e,t,r)=>t in e?bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var wu=(e,t)=>()=>(e&&(t=e(e=0)),t);var Rt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ru=(e,t)=>{for(var r in t)bu(e,r,{get:t[r],enumerable:!0})},jA=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of nO(t))!oO.call(e,a)&&a!==r&&bu(e,a,{get:()=>t[a],enumerable:!(n=rO(t,a))||n.enumerable});return e};var Or=(e,t,r)=>(r=e!=null?tO(aO(e)):{},jA(t||!e||!e.__esModule?bu(r,"default",{value:e,enumerable:!0}):r,e)),sO=e=>jA(bu({},"__esModule",{value:!0}),e);var Ne=(e,t,r)=>iO(e,typeof t!="symbol"?t+"":t,r);var y,c=wu(()=>{"use strict";y=typeof globalThis<"u"?globalThis:window});function Jl(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jl=function(t){return typeof t}:Jl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jl(e)}function lO(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=dO.bind(this))}function dO(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",a="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");a.open("POST",e,!n),a.withCredentials=!0,a.setRequestHeader("Accept","*/*"),cO(t)?(a.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),a.responseType="text"):uO(t)&&t.type&&a.setRequestHeader("Content-Type",t.type);try{a.send(t)}catch{return!1}return!0}var cO,uO,u=wu(()=>{"use strict";cO=function(t){return typeof t=="string"},uO=function(t){return t instanceof Blob};lO.call((typeof window>"u"?"undefined":Jl(window))==="object"?window:{})});var jh=Rt(Fu=>{"use strict";d();c();l();u();Object.defineProperty(Fu,"__esModule",{value:!0});function VA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function pO(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fO(e,t,r){return t=Ai(t),gO(e,BA()?Reflect.construct(t,r||[],Ai(e).constructor):t.apply(e,r))}function Dh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,vO(n.key),n)}}function qh(e,t,r){return t&&LA(e.prototype,t),r&&LA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function UA(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=AO(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,i=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return i=f.done,f},e:function(f){p=!0,o=f},f:function(){try{i||r.return==null||r.return()}finally{if(p)throw o}}}}function Nh(){return Nh=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=hO(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:r):a.value}},Nh.apply(null,arguments)}function Ai(e){return Ai=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ai(e)}function mO(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_h(e,t)}function BA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BA=function(){return!!e})()}function gO(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pO(e)}function _h(e,t){return _h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},_h(e,t)}function hO(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ai(e))!==null;);return e}function yO(e,t,r,n){var a=Nh(Ai(1&n?e.prototype:e),t,r);return 2&n&&typeof a=="function"?function(o){return a.apply(r,o)}:a}function SO(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vO(e){var t=SO(e,"string");return typeof t=="symbol"?t:t+""}function AO(e,t){if(e){if(typeof e=="string")return VA(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?VA(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function xO(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function CO(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var QA=function(){function e(){Dh(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return qh(e,[{key:"addEventListener",value:function(r,n,a){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:a})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var a=this.listeners[r],o=0,i=a.length;o<i;o++)if(a[o].callback===n){a.splice(o,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var a=this.listeners[r.type],o=a.slice(),i=function(){var g=o[p];try{g.callback.call(n,r)}catch(A){Promise.resolve().then(function(){throw A})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},p=0,f=o.length;p<f;p++)i();return!r.defaultPrevented}}}])}(),Mh=function(e){function t(){var r;return Dh(this,t),r=fO(this,t),r.listeners||QA.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return mO(t,e),qh(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),yO(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,a=this.reason,o=a===void 0?"Aborted":a;if(n)throw o}}],[{key:"timeout",value:function(n){var a=new Xl;return setTimeout(function(){return a.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),a.signal}},{key:"any",value:function(n){var a=new Xl;function o(){a.abort(this.reason),i()}function i(){var g=UA(n),A;try{for(g.s();!(A=g.n()).done;){var x=A.value;x.removeEventListener("abort",o)}}catch(h){g.e(h)}finally{g.f()}}var p=UA(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){a.abort(m.reason);break}else m.addEventListener("abort",o)}}catch(g){p.e(g)}finally{p.f()}return a.signal}}])}(QA),Xl=function(){function e(){Dh(this,e),Object.defineProperty(this,"signal",{value:new Mh,writable:!0,configurable:!0})}return qh(e,[{key:"abort",value:function(r){var n=CO(r),a=xO(n);this.signal.reason=n,this.signal.dispatchEvent(a)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Xl.prototype[Symbol.toStringTag]="AbortController",Mh.prototype[Symbol.toStringTag]="AbortSignal");function bO(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function wO(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,a=n===void 0?r.Request:n,o=t.AbortController,i=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=i===void 0?!1:i;if(!bO({fetch:r,Request:a,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=a;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(x,h){var C;h&&h.signal&&(C=h.signal,delete h.signal);var R=new a(x,h);return C&&Object.defineProperty(R,"signal",{writable:!1,enumerable:!1,configurable:!0,value:C}),R},f.prototype=a.prototype);var m=r,g=function(x,h){var C=f&&f.prototype.isPrototypeOf(x)?x.signal:h?h.signal:void 0;if(C){var R;try{R=new DOMException("Aborted","AbortError")}catch{R=new Error("Aborted"),R.name="AbortError"}if(C.aborted)return Promise.reject(R);var w=new Promise(function(b,F){C.addEventListener("abort",function(){return F(R)},{once:!0})});return h&&h.signal&&delete h.signal,Promise.race([w,m(x,h)])}return m(x,h)};return{fetch:g,Request:f}}Fu.AbortController=Xl;Fu.AbortSignal=Mh;Fu.abortableFetch=wO});var GA,s,S,l=wu(()=>{"use strict";GA=Or(jh(),1),s=Or(jh(),1),{fetch:S}=(0,GA.abortableFetch)({fetch})});function Eu(e){if(_O.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Vh(e){return e.replace(DO,"")}function Iu(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!qO(r))return!1}return!0}function qO(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function HA(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var RO,JA,FO,XA,EO,IO,TO,PO,kO,OO,NO,_O,$A,DO,xi,Lh,zA,WA,KA,YA,v,ex=wu(()=>{"use strict";d();c();l();u();RO=Object.create,JA=Object.defineProperty,FO=Object.getOwnPropertyDescriptor,XA=Object.getOwnPropertyNames,EO=Object.getPrototypeOf,IO=Object.prototype.hasOwnProperty,TO=(e,t)=>function(){return t||(0,e[XA(e)[0]])((t={exports:{}}).exports,t),t.exports},PO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of XA(t))!IO.call(e,a)&&a!==r&&JA(e,a,{get:()=>t[a],enumerable:!(n=FO(t,a))||n.enumerable});return e},kO=(e,t,r)=>(r=e!=null?RO(EO(e)):{},PO(t||!e||!e.__esModule?JA(r,"default",{value:e,enumerable:!0}):r,e)),OO=TO({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function a(f,m){var g=f.split(";").filter(n),A=g.shift(),x=o(A),h=x.name,C=x.value;m=m?Object.assign({},r,m):r;try{C=m.decodeValues?decodeURIComponent(C):C}catch(w){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+C+"'. Set options.decodeValues to false to disable this feature.",w)}var R={name:h,value:C};return g.forEach(function(w){var b=w.split("="),F=b.shift().trimLeft().toLowerCase(),E=b.join("=");F==="expires"?R.expires=new Date(E):F==="max-age"?R.maxAge=parseInt(E,10):F==="secure"?R.secure=!0:F==="httponly"?R.httpOnly=!0:F==="samesite"?R.sameSite=E:R[F]=E}),R}function o(f){var m="",g="",A=f.split("=");return A.length>1?(m=A.shift(),g=A.join("=")):g=f,{name:m,value:g}}function i(f,m){if(m=m?Object.assign({},r,m):r,!f)return m.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var g=f.headers[Object.keys(f.headers).find(function(x){return x.toLowerCase()==="set-cookie"})];!g&&f.headers.cookie&&!m.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=g}if(Array.isArray(f)||(f=[f]),m=m?Object.assign({},r,m):r,m.map){var A={};return f.filter(n).reduce(function(x,h){var C=a(h,m);return x[C.name]=C,x},A)}else return f.filter(n).map(function(x){return a(x,m)})}function p(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var m=[],g=0,A,x,h,C,R;function w(){for(;g<f.length&&/\s/.test(f.charAt(g));)g+=1;return g<f.length}function b(){return x=f.charAt(g),x!=="="&&x!==";"&&x!==","}for(;g<f.length;){for(A=g,R=!1;w();)if(x=f.charAt(g),x===","){for(h=g,g+=1,w(),C=g;g<f.length&&b();)g+=1;g<f.length&&f.charAt(g)==="="?(R=!0,g=C,m.push(f.substring(A,h)),A=g):g=h+1}else g+=1;(!R||g>=f.length)&&m.push(f.substring(A,f.length))}return m}t.exports=i,t.exports.parse=i,t.exports.parseString=a,t.exports.splitCookiesString=p}}),NO=kO(OO()),_O=/[^a-z0-9\-#$%&'*+.^_`|~]/i;$A=[`
19
- `,"\r","\t"," "],DO=new RegExp(`(^[${$A.join("")}]|$[${$A.join("")}])`,"g");xi=Symbol("normalizedHeaders"),Lh=Symbol("rawHeaderNames"),zA=", ",v=class ZA{constructor(t){this[WA]={},this[KA]=new Map,this[YA]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof ZA||typeof y.Headers<"u"&&t instanceof y.Headers?t.forEach((n,a)=>{this.append(a,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(zA):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(zA):n)})}[(WA=xi,KA=Lh,YA=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[xi]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Iu(t))throw new TypeError(`Invalid header name "${t}"`);return this[xi].hasOwnProperty(Eu(t))}get(t){if(!Iu(t))throw TypeError(`Invalid header name "${t}"`);return this[xi][Eu(t)]??null}set(t,r){if(!Iu(t)||!HA(r))return;let n=Eu(t),a=Vh(r);this[xi][n]=Vh(a),this[Lh].set(n,t)}append(t,r){if(!Iu(t)||!HA(r))return;let n=Eu(t),a=Vh(r),o=this.has(n)?`${this.get(n)}, ${a}`:a;this.set(t,o)}delete(t){if(!Iu(t)||!this.has(t))return;let r=Eu(t);delete this[xi][r],this[Lh].delete(r)}forEach(t,r){for(let[n,a]of this.entries())t.call(r,a,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,NO.splitCookiesString)(t)}}});var d=wu(()=>{"use strict";ex()});var mx=Rt(Nu=>{"use strict";d();c();l();u();var od=Nu&&Nu.__assign||function(){return od=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},od.apply(this,arguments)};Object.defineProperty(Nu,"__esModule",{value:!0});var XO={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function ZO(e){var t=od(od({},XO),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Nu.getSanitizedOptions=ZO});var gx=Rt(Wh=>{"use strict";d();c();l();u();Object.defineProperty(Wh,"__esModule",{value:!0});function eN(e){var t=Math.random()*e;return Math.round(t)}Wh.fullJitter=eN});var hx=Rt(Kh=>{"use strict";d();c();l();u();Object.defineProperty(Kh,"__esModule",{value:!0});function tN(e){return e}Kh.noJitter=tN});var yx=Rt(Yh=>{"use strict";d();c();l();u();Object.defineProperty(Yh,"__esModule",{value:!0});var rN=gx(),nN=hx();function aN(e){switch(e.jitter){case"full":return rN.fullJitter;case"none":default:return nN.noJitter}}Yh.JitterFactory=aN});var Xh=Rt(Jh=>{"use strict";d();c();l();u();Object.defineProperty(Jh,"__esModule",{value:!0});var oN=yx(),iN=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=oN.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,a=t*Math.pow(r,n);return Math.min(a,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Jh.Delay=iN});var Sx=Rt(Nn=>{"use strict";d();c();l();u();var sN=Nn&&Nn.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)a.hasOwnProperty(o)&&(n[o]=a[o])},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)}}(),cN=Nn&&Nn.__awaiter||function(e,t,r,n){function a(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function p(g){try{m(n.next(g))}catch(A){i(A)}}function f(g){try{m(n.throw(g))}catch(A){i(A)}}function m(g){g.done?o(g.value):a(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},uN=Nn&&Nn.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(o=m[0]&2?a.return:m[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,m[1])).done)return o;switch(a=0,o&&(m=[m[0]&2,o.value]),m[0]){case 0:case 1:o=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,a=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!o||m[1]>o[0]&&m[1]<o[3])){r.label=m[1];break}if(m[0]===6&&r.label<o[1]){r.label=o[1],o=m;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(m);break}o[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],a=0}finally{n=o=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Nn,"__esModule",{value:!0});var lN=Xh(),dN=function(e){sN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return cN(this,void 0,void 0,function(){return uN(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(lN.Delay);Nn.SkipFirstDelay=dN});var vx=Rt(_u=>{"use strict";d();c();l();u();var pN=_u&&_u.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)a.hasOwnProperty(o)&&(n[o]=a[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_u,"__esModule",{value:!0});var fN=Xh(),mN=function(e){pN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(fN.Delay);_u.AlwaysDelay=mN});var Ax=Rt(Zh=>{"use strict";d();c();l();u();Object.defineProperty(Zh,"__esModule",{value:!0});var gN=Sx(),hN=vx();function yN(e,t){var r=SN(e);return r.setAttemptNumber(t),r}Zh.DelayFactory=yN;function SN(e){return e.delayFirstAttempt?new hN.AlwaysDelay(e):new gN.SkipFirstDelay(e)}});var xx=Rt(so=>{"use strict";d();c();l();u();var ey=so&&so.__awaiter||function(e,t,r,n){function a(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function p(g){try{m(n.next(g))}catch(A){i(A)}}function f(g){try{m(n.throw(g))}catch(A){i(A)}}function m(g){g.done?o(g.value):a(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},ty=so&&so.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(o=m[0]&2?a.return:m[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,m[1])).done)return o;switch(a=0,o&&(m=[m[0]&2,o.value]),m[0]){case 0:case 1:o=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,a=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!o||m[1]>o[0]&&m[1]<o[3])){r.label=m[1];break}if(m[0]===6&&r.label<o[1]){r.label=o[1],o=m;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(m);break}o[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],a=0}finally{n=o=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(so,"__esModule",{value:!0});var vN=mx(),AN=Ax();function xN(e,t){return t===void 0&&(t={}),ey(this,void 0,void 0,function(){var r,n;return ty(this,function(a){switch(a.label){case 0:return r=vN.getSanitizedOptions(t),n=new CN(e,r),[4,n.execute()];case 1:return[2,a.sent()]}})})}so.backOff=xN;var CN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return ey(this,void 0,void 0,function(){var t,r;return ty(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return ey(this,void 0,void 0,function(){var t;return ty(this,function(r){switch(r.label){case 0:return t=AN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var up=Rt((fS,mS)=>{"use strict";d();c();l();u();(function(e,t){typeof fS=="object"&&typeof mS<"u"?mS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(fS,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",a="second",o="minute",i="hour",p="day",f="week",m="month",g="quarter",A="year",x="date",h="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var B=["th","st","nd","rd"],Q=H%100;return"["+H+(B[(Q-20)%10]||B[Q]||B[0])+"]"}},b=function(H,B,Q){var K=String(H);return!K||K.length>=B?H:""+Array(B+1-K.length).join(Q)+H},F={s:b,z:function(H){var B=-H.utcOffset(),Q=Math.abs(B),K=Math.floor(Q/60),$=Q%60;return(B<=0?"+":"-")+b(K,2,"0")+":"+b($,2,"0")},m:function H(B,Q){if(B.date()<Q.date())return-H(Q,B);var K=12*(Q.year()-B.year())+(Q.month()-B.month()),$=B.clone().add(K,m),te=Q-$<0,re=B.clone().add(K+(te?-1:1),m);return+(-(K+(Q-$)/(te?$-re:re-$))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:m,y:A,w:f,d:p,D:x,h:i,m:o,s:a,ms:n,Q:g}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},E="en",P={};P[E]=w;var V="$isDayjsObject",_=function(H){return H instanceof U||!(!H||!H[V])},k=function H(B,Q,K){var $;if(!B)return E;if(typeof B=="string"){var te=B.toLowerCase();P[te]&&($=te),Q&&(P[te]=Q,$=te);var re=B.split("-");if(!$&&re.length>1)return H(re[0])}else{var pe=B.name;P[pe]=B,$=pe}return!K&&$&&(E=$),$||!K&&E},N=function(H,B){if(_(H))return H.clone();var Q=typeof B=="object"?B:{};return Q.date=H,Q.args=arguments,new U(Q)},q=F;q.l=k,q.i=_,q.w=function(H,B){return N(H,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var U=function(){function H(Q){this.$L=k(Q.locale,null,!0),this.parse(Q),this.$x=this.$x||Q.x||{},this[V]=!0}var B=H.prototype;return B.parse=function(Q){this.$d=function(K){var $=K.date,te=K.utc;if($===null)return new Date(NaN);if(q.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var re=$.match(C);if(re){var pe=re[2]-1||0,we=(re[7]||"0").substring(0,3);return te?new Date(Date.UTC(re[1],pe,re[3]||1,re[4]||0,re[5]||0,re[6]||0,we)):new Date(re[1],pe,re[3]||1,re[4]||0,re[5]||0,re[6]||0,we)}}return new Date($)}(Q),this.init()},B.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},B.$utils=function(){return q},B.isValid=function(){return this.$d.toString()!==h},B.isSame=function(Q,K){var $=N(Q);return this.startOf(K)<=$&&$<=this.endOf(K)},B.isAfter=function(Q,K){return N(Q)<this.startOf(K)},B.isBefore=function(Q,K){return this.endOf(K)<N(Q)},B.$g=function(Q,K,$){return q.u(Q)?this[K]:this.set($,Q)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(Q,K){var $=this,te=!!q.u(K)||K,re=q.p(Q),pe=function(Me,Ze){var ot=q.w($.$u?Date.UTC($.$y,Ze,Me):new Date($.$y,Ze,Me),$);return te?ot:ot.endOf(p)},we=function(Me,Ze){return q.w($.toDate()[Me].apply($.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(Ze)),$)},ke=this.$W,Ce=this.$M,Re=this.$D,xe="set"+(this.$u?"UTC":"");switch(re){case A:return te?pe(1,0):pe(31,11);case m:return te?pe(1,Ce):pe(0,Ce+1);case f:var Ee=this.$locale().weekStart||0,rt=(ke<Ee?ke+7:ke)-Ee;return pe(te?Re-rt:Re+(6-rt),Ce);case p:case x:return we(xe+"Hours",0);case i:return we(xe+"Minutes",1);case o:return we(xe+"Seconds",2);case a:return we(xe+"Milliseconds",3);default:return this.clone()}},B.endOf=function(Q){return this.startOf(Q,!1)},B.$set=function(Q,K){var $,te=q.p(Q),re="set"+(this.$u?"UTC":""),pe=($={},$[p]=re+"Date",$[x]=re+"Date",$[m]=re+"Month",$[A]=re+"FullYear",$[i]=re+"Hours",$[o]=re+"Minutes",$[a]=re+"Seconds",$[n]=re+"Milliseconds",$)[te],we=te===p?this.$D+(K-this.$W):K;if(te===m||te===A){var ke=this.clone().set(x,1);ke.$d[pe](we),ke.init(),this.$d=ke.set(x,Math.min(this.$D,ke.daysInMonth())).$d}else pe&&this.$d[pe](we);return this.init(),this},B.set=function(Q,K){return this.clone().$set(Q,K)},B.get=function(Q){return this[q.p(Q)]()},B.add=function(Q,K){var $,te=this;Q=Number(Q);var re=q.p(K),pe=function(Ce){var Re=N(te);return q.w(Re.date(Re.date()+Math.round(Ce*Q)),te)};if(re===m)return this.set(m,this.$M+Q);if(re===A)return this.set(A,this.$y+Q);if(re===p)return pe(1);if(re===f)return pe(7);var we=($={},$[o]=t,$[i]=r,$[a]=e,$)[re]||1,ke=this.$d.getTime()+Q*we;return q.w(ke,this)},B.subtract=function(Q,K){return this.add(-1*Q,K)},B.format=function(Q){var K=this,$=this.$locale();if(!this.isValid())return $.invalidDate||h;var te=Q||"YYYY-MM-DDTHH:mm:ssZ",re=q.z(this),pe=this.$H,we=this.$m,ke=this.$M,Ce=$.weekdays,Re=$.months,xe=$.meridiem,Ee=function(Ze,ot,$t,lr){return Ze&&(Ze[ot]||Ze(K,te))||$t[ot].slice(0,lr)},rt=function(Ze){return q.s(pe%12||12,Ze,"0")},Me=xe||function(Ze,ot,$t){var lr=Ze<12?"AM":"PM";return $t?lr.toLowerCase():lr};return te.replace(R,function(Ze,ot){return ot||function($t){switch($t){case"YY":return String(K.$y).slice(-2);case"YYYY":return q.s(K.$y,4,"0");case"M":return ke+1;case"MM":return q.s(ke+1,2,"0");case"MMM":return Ee($.monthsShort,ke,Re,3);case"MMMM":return Ee(Re,ke);case"D":return K.$D;case"DD":return q.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return Ee($.weekdaysMin,K.$W,Ce,2);case"ddd":return Ee($.weekdaysShort,K.$W,Ce,3);case"dddd":return Ce[K.$W];case"H":return String(pe);case"HH":return q.s(pe,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return Me(pe,we,!0);case"A":return Me(pe,we,!1);case"m":return String(we);case"mm":return q.s(we,2,"0");case"s":return String(K.$s);case"ss":return q.s(K.$s,2,"0");case"SSS":return q.s(K.$ms,3,"0");case"Z":return re}return null}(Ze)||re.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(Q,K,$){var te,re=this,pe=q.p(K),we=N(Q),ke=(we.utcOffset()-this.utcOffset())*t,Ce=this-we,Re=function(){return q.m(re,we)};switch(pe){case A:te=Re()/12;break;case m:te=Re();break;case g:te=Re()/3;break;case f:te=(Ce-ke)/6048e5;break;case p:te=(Ce-ke)/864e5;break;case i:te=Ce/r;break;case o:te=Ce/t;break;case a:te=Ce/e;break;default:te=Ce}return $?te:q.a(te)},B.daysInMonth=function(){return this.endOf(m).$D},B.$locale=function(){return P[this.$L]},B.locale=function(Q,K){if(!Q)return this.$L;var $=this.clone(),te=k(Q,K,!0);return te&&($.$L=te),$},B.clone=function(){return q.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},H}(),X=U.prototype;return N.prototype=X,[["$ms",n],["$s",a],["$m",o],["$H",i],["$W",p],["$M",m],["$y",A],["$D",x]].forEach(function(H){X[H[1]]=function(B){return this.$g(B,H[0],H[1])}}),N.extend=function(H,B){return H.$i||(H(B,U,N),H.$i=!0),N},N.locale=k,N.isDayjs=_,N.unix=function(H){return N(1e3*H)},N.en=P[E],N.Ls=P,N.p={},N})});var zb=Rt((gS,hS)=>{"use strict";d();c();l();u();(function(e,t){typeof gS=="object"&&typeof hS<"u"?hS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(gS,function(){"use strict";var e="month",t="quarter";return function(r,n){var a=n.prototype;a.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var o=a.add;a.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):o.bind(this)(p,f)};var i=a.startOf;a.startOf=function(p,f){var m=this.$utils(),g=!!m.u(f)||f;if(m.p(p)===t){var A=this.quarter()-1;return g?this.month(3*A).startOf(e).startOf("day"):this.month(3*A+2).endOf(e).endOf("day")}return i.bind(this)(p,f)}}})});var Wb=Rt((yS,SS)=>{"use strict";d();c();l();u();(function(e,t){typeof yS=="object"&&typeof SS<"u"?SS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(yS,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,a=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,i={},p=function(C){return(C=+C)+(C>68?1900:2e3)},f=function(C){return function(R){this[C]=+R}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(R){if(!R||R==="Z")return 0;var w=R.match(/([+-]|\d\d)/g),b=60*w[1]+(+w[2]||0);return b===0?0:w[0]==="+"?-b:b}(C)}],g=function(C){var R=i[C];return R&&(R.indexOf?R:R.s.concat(R.f))},A=function(C,R){var w,b=i.meridiem;if(b){for(var F=1;F<=24;F+=1)if(C.indexOf(b(F,0,R))>-1){w=F>12;break}}else w=C===(R?"pm":"PM");return w},x={A:[o,function(C){this.afternoon=A(C,!1)}],a:[o,function(C){this.afternoon=A(C,!0)}],Q:[r,function(C){this.month=3*(C-1)+1}],S:[r,function(C){this.milliseconds=100*+C}],SS:[n,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[a,f("seconds")],ss:[a,f("seconds")],m:[a,f("minutes")],mm:[a,f("minutes")],H:[a,f("hours")],h:[a,f("hours")],HH:[a,f("hours")],hh:[a,f("hours")],D:[a,f("day")],DD:[n,f("day")],Do:[o,function(C){var R=i.ordinal,w=C.match(/\d+/);if(this.day=w[0],R)for(var b=1;b<=31;b+=1)R(b).replace(/\[|\]/g,"")===C&&(this.day=b)}],w:[a,f("week")],ww:[n,f("week")],M:[a,f("month")],MM:[n,f("month")],MMM:[o,function(C){var R=g("months"),w=(g("monthsShort")||R.map(function(b){return b.slice(0,3)})).indexOf(C)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[o,function(C){var R=g("months").indexOf(C)+1;if(R<1)throw new Error;this.month=R%12||R}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(C){this.year=p(C)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function h(C){var R,w;R=C,w=i&&i.formats;for(var b=(C=R.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(N,q,U){var X=U&&U.toUpperCase();return q||w[U]||e[U]||w[X].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(H,B,Q){return B||Q.slice(1)})})).match(t),F=b.length,E=0;E<F;E+=1){var P=b[E],V=x[P],_=V&&V[0],k=V&&V[1];b[E]=k?{regex:_,parser:k}:P.replace(/^\[|\]$/g,"")}return function(N){for(var q={},U=0,X=0;U<F;U+=1){var H=b[U];if(typeof H=="string")X+=H.length;else{var B=H.regex,Q=H.parser,K=N.slice(X),$=B.exec(K)[0];Q.call(q,$),N=N.replace($,"")}}return function(te){var re=te.afternoon;if(re!==void 0){var pe=te.hours;re?pe<12&&(te.hours+=12):pe===12&&(te.hours=0),delete te.afternoon}}(q),q}}return function(C,R,w){w.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(p=C.parseTwoDigitYear);var b=R.prototype,F=b.parse;b.parse=function(E){var P=E.date,V=E.utc,_=E.args;this.$u=V;var k=_[1];if(typeof k=="string"){var N=_[2]===!0,q=_[3]===!0,U=N||q,X=_[2];q&&(X=_[2]),i=this.$locale(),!N&&X&&(i=w.Ls[X]),this.$d=function(K,$,te,re){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*K);var pe=h($)(K),we=pe.year,ke=pe.month,Ce=pe.day,Re=pe.hours,xe=pe.minutes,Ee=pe.seconds,rt=pe.milliseconds,Me=pe.zone,Ze=pe.week,ot=new Date,$t=Ce||(we||ke?1:ot.getDate()),lr=we||ot.getFullYear(),la=0;we&&!ke||(la=ke>0?ke-1:ot.getMonth());var Si,vi=Re||0,Cu=xe||0,kh=Ee||0,Oh=rt||0;return Me?new Date(Date.UTC(lr,la,$t,vi,Cu,kh,Oh+60*Me.offset*1e3)):te?new Date(Date.UTC(lr,la,$t,vi,Cu,kh,Oh)):(Si=new Date(lr,la,$t,vi,Cu,kh,Oh),Ze&&(Si=re(Si).week(Ze).toDate()),Si)}catch{return new Date("")}}(P,k,V,w),this.init(),X&&X!==!0&&(this.$L=this.locale(X).$L),U&&P!=this.format(k)&&(this.$d=new Date("")),i={}}else if(k instanceof Array)for(var H=k.length,B=1;B<=H;B+=1){_[1]=k[B-1];var Q=w.apply(this,_);if(Q.isValid()){this.$d=Q.$d,this.$L=Q.$L,this.init();break}B===H&&(this.$d=new Date(""))}else F.call(this,E)}}})});var FR=Rt((WS,KS)=>{"use strict";d();c();l();u();(function(e,t){typeof WS=="object"&&typeof KS<"u"?KS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(WS,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,a){var o,i=function(g,A,x){x===void 0&&(x={});var h=new Date(g),C=function(R,w){w===void 0&&(w={});var b=w.timeZoneName||"short",F=R+"|"+b,E=t[F];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:R,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:b}),t[F]=E),E}(A,x);return C.formatToParts(h)},p=function(g,A){for(var x=i(g,A),h=[],C=0;C<x.length;C+=1){var R=x[C],w=R.type,b=R.value,F=e[w];F>=0&&(h[F]=parseInt(b,10))}var E=h[3],P=E===24?0:E,V=h[0]+"-"+h[1]+"-"+h[2]+" "+P+":"+h[4]+":"+h[5]+":000",_=+g;return(a.utc(V).valueOf()-(_-=_%1e3))/6e4},f=n.prototype;f.tz=function(g,A){g===void 0&&(g=o);var x,h=this.utcOffset(),C=this.toDate(),R=C.toLocaleString("en-US",{timeZone:g}),w=Math.round((C-new Date(R))/1e3/60),b=15*-Math.round(C.getTimezoneOffset()/15)-w;if(!Number(b))x=this.utcOffset(0,A);else if(x=a(R,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(b,!0),A){var F=x.utcOffset();x=x.add(h-F,"minute")}return x.$x.$timezone=g,x},f.offsetName=function(g){var A=this.$x.$timezone||a.tz.guess(),x=i(this.valueOf(),A,{timeZoneName:g}).find(function(h){return h.type.toLowerCase()==="timezonename"});return x&&x.value};var m=f.startOf;f.startOf=function(g,A){if(!this.$x||!this.$x.$timezone)return m.call(this,g,A);var x=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(x,g,A).tz(this.$x.$timezone,!0)},a.tz=function(g,A,x){var h=x&&A,C=x||A||o,R=p(+a(),C);if(typeof g!="string")return a(g).tz(C);var w=function(P,V,_){var k=P-60*V*1e3,N=p(k,_);if(V===N)return[k,V];var q=p(k-=60*(N-V)*1e3,_);return N===q?[k,N]:[P-60*Math.min(N,q)*1e3,Math.max(N,q)]}(a.utc(g,h).valueOf(),R,C),b=w[0],F=w[1],E=a(b).utcOffset(F);return E.$x.$timezone=C,E},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(g){o=g}}})});var ER=Rt((YS,JS)=>{"use strict";d();c();l();u();(function(e,t){typeof YS=="object"&&typeof JS<"u"?JS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(YS,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,a,o){var i=a.prototype;o.utc=function(h){var C={date:h,utc:!0,args:arguments};return new a(C)},i.utc=function(h){var C=o(this.toDate(),{locale:this.$L,utc:!0});return h?C.add(this.utcOffset(),e):C},i.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var p=i.parse;i.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),p.call(this,h)};var f=i.init;i.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else f.call(this)};var m=i.utcOffset;i.utcOffset=function(h,C){var R=this.$utils().u;if(R(h))return this.$u?0:R(this.$offset)?m.call(this):this.$offset;if(typeof h=="string"&&(h=function(E){E===void 0&&(E="");var P=E.match(t);if(!P)return null;var V=(""+P[0]).match(r)||["-",0,0],_=V[0],k=60*+V[1]+ +V[2];return k===0?0:_==="+"?k:-k}(h),h===null))return this;var w=Math.abs(h)<=16?60*h:h,b=this;if(C)return b.$offset=w,b.$u=h===0,b;if(h!==0){var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(b=this.local().add(w+F,e)).$offset=w,b.$x.$localOffset=F}else b=this.utc();return b};var g=i.format;i.format=function(h){var C=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,C)},i.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var A=i.toDate;i.toDate=function(h){return h==="s"&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():A.call(this)};var x=i.diff;i.diff=function(h,C,R){if(h&&this.$u===h.$u)return x.call(this,h,C,R);var w=this.local(),b=o(h).local();return x.call(w,b,C,R)}}})});var CE=Rt((Jbe,xE)=>{"use strict";d();c();l();u();function OU(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}xE.exports=NU;function NU(e,t,r){var n=r&&r.stringify||OU,a=1;if(typeof e=="object"&&e!==null){var o=t.length+a;if(o===1)return e;var i=new Array(o);i[0]=n(e);for(var p=1;p<o;p++)i[p]=n(t[p]);return i.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",g=1-a,A=-1,x=e&&e.length||0,h=0;h<x;){if(e.charCodeAt(h)===37&&h+1<x){switch(A=A>-1?A:0,e.charCodeAt(h+1)){case 100:case 102:if(g>=f||t[g]==null)break;A<h&&(m+=e.slice(A,h)),m+=Number(t[g]),A=h+2,h++;break;case 105:if(g>=f||t[g]==null)break;A<h&&(m+=e.slice(A,h)),m+=Math.floor(Number(t[g])),A=h+2,h++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;A<h&&(m+=e.slice(A,h));var C=typeof t[g];if(C==="string"){m+="'"+t[g]+"'",A=h+2,h++;break}if(C==="function"){m+=t[g].name||"<anonymous>",A=h+2,h++;break}m+=n(t[g]),A=h+2,h++;break;case 115:if(g>=f)break;A<h&&(m+=e.slice(A,h)),m+=String(t[g]),A=h+2,h++;break;case 37:A<h&&(m+=e.slice(A,h)),m+="%",A=h+2,h++,g--;break}++g}++h}return A===-1?e:(A<x&&(m+=e.slice(A)),m)}});var IE=Rt((rwe,Tm)=>{"use strict";d();c();l();u();var bE=CE();Tm.exports=ea;var Tl=WU().console||{},_U={mapHttpRequest:Im,mapHttpResponse:Im,wrapRequestSerializer:Uv,wrapResponseSerializer:Uv,wrapErrorSerializer:Uv,req:Im,res:Im,err:RE,errWithCause:RE};function Ga(e,t){return e==="silent"?1/0:t.levels.values[e]}var Gv=Symbol("pino.logFuncs"),Qv=Symbol("pino.hierarchy"),DU={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function wE(e,t){let r={logger:t,parent:e[Qv]};t[Qv]=r}function qU(e,t,r){let n={};t.forEach(a=>{n[a]=r[a]?r[a]:Tl[a]||Tl[DU[a]||"log"]||lc}),e[Gv]=n}function MU(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function ea(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Tl;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},a=MU(e.browser.serialize,n),o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);let i=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&p.forEach(function(R){r[R]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=lc),qU(m,p,r),wE({},m),Object.defineProperty(m,"levelVal",{get:A}),Object.defineProperty(m,"level",{get:x,set:h});let g={transmit:t,serialize:a,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:p,timestamp:$U(e),messageKey:e.messageKey||"msg",onChild:e.onChild||lc};m.levels=jU(e),m.level=f,m.isLevelEnabled=function(R){return this.levels.values[R]?this.levels.values[R]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=lc,m.serializers=n,m._serialize=a,m._stdErrSerialize=o,m.child=function(...R){return C.call(this,g,...R)},t&&(m._logEvent=Bv());function A(){return Ga(this.level,this)}function x(){return this._level}function h(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,Xo(this,g,m,"error"),Xo(this,g,m,"fatal"),Xo(this,g,m,"warn"),Xo(this,g,m,"info"),Xo(this,g,m,"debug"),Xo(this,g,m,"trace"),i.forEach(w=>{Xo(this,g,m,w)})}function C(R,w,b){if(!w)throw new Error("missing bindings for child Pino");b=b||{},a&&w.serializers&&(b.serializers=w.serializers);let F=b.serializers;if(a&&F){var E=Object.assign({},n,F),P=e.browser.serialize===!0?Object.keys(E):a;delete w.serializers,$v([w],P,E,this._stdErrSerialize)}function V(k){this._childLevel=(k._childLevel|0)+1,this.bindings=w,E&&(this.serializers=E,this._serialize=P),t&&(this._logEvent=Bv([].concat(k._logEvent.bindings,w)))}V.prototype=this;let _=new V(this);return wE(this,_),_.child=function(...k){return C.call(this,R,...k)},_.level=b.level||this.level,R.onChild(_),_}return m}function jU(e){let t=e.customLevels||{},r=Object.assign({},ea.levels.values,t),n=Object.assign({},ea.levels.labels,VU(t));return{values:r,labels:n}}function VU(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}ea.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};ea.stdSerializers=_U;ea.stdTimeFunctions=Object.assign({},{nullTime:FE,epochTime:EE,unixTime:HU,isoTime:zU});function LU(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Qv];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Xo(e,t,r,n){if(Object.defineProperty(e,n,{value:Ga(e.level,r)>Ga(n,r)?lc:r[Gv][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===lc){if(!t.transmit)return;let o=t.transmit.level||e.level,i=Ga(o,r);if(Ga(n,r)<i)return}e[n]=QU(e,t,r,n);let a=LU(e);a.length!==0&&(e[n]=UU(a,e[n]))}function UU(e,t){return function(){return t.apply(this,[...e,...arguments])}}function QU(e,t,r,n){return function(a){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Tl?Tl:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&($v(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters?a.call(f,...BU(this,n,p,i,t)):a.apply(f,p),t.transmit){let A=t.transmit.level||e._level,x=Ga(A,r),h=Ga(n,r);if(h<x)return;GU(this,{ts:i,methodLevel:n,methodValue:h,transmitLevel:A,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Ga(e._level,r)},p,g)}}}(e[Gv][n])}function BU(e,t,r,n,a){let{level:o,log:i=A=>A}=a.formatters||{},p=r.slice(),f=p[0],m={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(m.time=n),o){let A=o(t,e.levels.values[t]);Object.assign(m,A)}else m.level=e.levels.values[t];if(a.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[i(m),...p]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?bE(p.shift(),p):void 0}else typeof f=="string"&&(f=bE(p.shift(),p));return f!==void 0&&(m[a.messageKey]=f),[i(m)]}}function $v(e,t,r,n){for(let a in e)if(n&&e[a]instanceof Error)e[a]=ea.stdSerializers.err(e[a]);else if(typeof e[a]=="object"&&!Array.isArray(e[a])&&t)for(let o in e[a])t.indexOf(o)>-1&&o in r&&(e[a][o]=r[o](e[a][o]))}function GU(e,t,r,n=!1){let a=t.send,o=t.ts,i=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||$v(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=r.filter(function(g){return m.indexOf(g)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=p,a(i,e._logEvent,f),e._logEvent=Bv(m)}function Bv(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function RE(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function $U(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?FE:EE}function Im(){return{}}function Uv(e){return e}function lc(){}function FE(){return!1}function EE(){return Date.now()}function HU(){return Math.round(Date.now()/1e3)}function zU(){return new Date(Date.now()).toISOString()}function WU(){function e(t){return typeof t<"u"&&t}try{return typeof y<"u"?y:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),y)}catch{return e(self)||e(window)||e(this)||{}}}Tm.exports.default=ea;Tm.exports.pino=ea});var j2={};Ru(j2,{API_DATE_FORMAT:()=>Ss,DefaultFieldsToInclude:()=>aA,EcommerceDefaultFieldsToInclude:()=>ST,HighlightUtils:()=>Bh,MinimumFieldsToInclude:()=>Gg,ResultTemplatesHelpers:()=>ww,SortBy:()=>vo,SortOrder:()=>tl,VERSION:()=>ha,baseFacetResponseSelector:()=>_r,buildAutomaticFacetGenerator:()=>kI,buildBreadcrumbManager:()=>dI,buildCategoryFacet:()=>QI,buildCategoryFieldSuggestions:()=>dT,buildContext:()=>mI,buildController:()=>ne,buildCriterionExpression:()=>zr,buildDateFacet:()=>rT,buildDateFilter:()=>aT,buildDateRange:()=>za,buildDateSortCriterion:()=>zd,buildDictionaryFieldContext:()=>yI,buildDidYouMean:()=>bI,buildExecuteTrigger:()=>Fk,buildFacet:()=>YI,buildFacetConditionsManager:()=>hI,buildFacetManager:()=>RI,buildFieldSortCriterion:()=>Wd,buildFieldSuggestions:()=>pT,buildFoldedResultList:()=>xT,buildGeneratedAnswer:()=>kT,buildHistoryManager:()=>zT,buildInstantResults:()=>nP,buildInteractiveCitation:()=>NT,buildInteractiveInstantResult:()=>WT,buildInteractiveRecentResult:()=>CP,buildInteractiveResult:()=>PP,buildNoSortCriterion:()=>Yd,buildNotifyTrigger:()=>Ik,buildNumericFacet:()=>cT,buildNumericFilter:()=>lT,buildNumericRange:()=>qc,buildPager:()=>iP,buildQueryError:()=>cP,buildQueryExpression:()=>q2,buildQueryRankingExpressionSortCriterion:()=>Kd,buildQuerySummary:()=>lP,buildQueryTrigger:()=>Tk,buildQuickview:()=>mP,buildRecentQueriesList:()=>vP,buildRecentResultsList:()=>wP,buildRedirectionTrigger:()=>Pk,buildRelevanceInspector:()=>TP,buildRelevanceSortCriterion:()=>Ji,buildResultList:()=>kP,buildResultTemplatesManager:()=>Qk,buildResultsPerPage:()=>NP,buildSearchBox:()=>dh,buildSearchEngine:()=>UE,buildSearchParameterManager:()=>hh,buildSearchParameterSerializer:()=>Kl,buildSearchStatus:()=>tk,buildSmartSnippet:()=>ok,buildSmartSnippetQuestionsList:()=>ck,buildSort:()=>pk,buildStandaloneSearchBox:()=>hk,buildStaticFilter:()=>yk,buildStaticFilterValue:()=>DA,buildTab:()=>vk,buildTabManager:()=>Ak,buildUrlManager:()=>qk,currentPageSelector:()=>ua,currentPagesSelector:()=>eh,deserializeRelativeDate:()=>aw,facetRequestSelector:()=>Bd,facetResponseSelectedValuesSelector:()=>lb,facetResponseSelector:()=>Gi,getAnalyticsNextApiBaseUrl:()=>id,getOrganizationEndpoint:()=>it,getSampleSearchEngineConfiguration:()=>Wv,getSearchApiBaseUrl:()=>ut,loadAdvancedSearchQueryActions:()=>$$,loadAutomaticFacetSetActions:()=>a2,loadBreadcrumbActions:()=>K$,loadCategoryFacetSetActions:()=>o2,loadClickAnalyticsActions:()=>H$,loadConfigurationActions:()=>Y$,loadContextActions:()=>X$,loadDateFacetSetActions:()=>s2,loadDebugActions:()=>Z$,loadDictionaryFieldContextActions:()=>e2,loadDidYouMeanActions:()=>t2,loadExcerptLengthActions:()=>r2,loadFacetOptionsActions:()=>n2,loadFacetSetActions:()=>i2,loadFieldActions:()=>u2,loadFoldingActions:()=>l2,loadGeneratedAnswerActions:()=>d2,loadGenericAnalyticsActions:()=>z$,loadHistoryActions:()=>p2,loadIPXActionsHistoryActions:()=>G$,loadInstantResultsActions:()=>f2,loadNumericFacetSetActions:()=>c2,loadPaginationActions:()=>m2,loadPipelineActions:()=>g2,loadQueryActions:()=>h2,loadQuerySetActions:()=>y2,loadQuerySuggestActions:()=>S2,loadQuestionAnsweringActions:()=>v2,loadRecentQueriesActions:()=>A2,loadRecentResultsActions:()=>x2,loadResultPreviewActions:()=>C2,loadSearchActions:()=>R2,loadSearchAnalyticsActions:()=>W$,loadSearchConfigurationActions:()=>J$,loadSearchHubActions:()=>F2,loadSearchParameterActions:()=>E2,loadSortCriteriaActions:()=>I2,loadStandaloneSearchBoxSetActions:()=>T2,loadStaticFilterSetActions:()=>P2,loadTabSetActions:()=>k2,maxPageSelector:()=>Gl,parseCriterionExpression:()=>Bk,validateRelativeDate:()=>Ea});module.exports=sO(j2);d();c();l();u();var Bh={};Ru(Bh,{escapeHtml:()=>Ri,getHighlightedSuggestion:()=>Qh,highlightString:()=>GO});d();c();l();u();d();c();l();u();function MO(e,t){let r=`
17
+ */(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadless",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadless"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var Uk=Object.create;var lu=Object.defineProperty;var Qk=Object.getOwnPropertyDescriptor;var Bk=Object.getOwnPropertyNames;var Gk=Object.getPrototypeOf,$k=Object.prototype.hasOwnProperty;var Hk=(e,t,r)=>t in e?lu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var du=(e,t)=>()=>(e&&(t=e(e=0)),t);var Rt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pu=(e,t)=>{for(var r in t)lu(e,r,{get:t[r],enumerable:!0})},_x=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bk(t))!$k.call(e,o)&&o!==r&&lu(e,o,{get:()=>t[o],enumerable:!(n=Qk(t,o))||n.enumerable});return e};var kr=(e,t,r)=>(r=e!=null?Uk(Gk(e)):{},_x(t||!e||!e.__esModule?lu(r,"default",{value:e,enumerable:!0}):r,e)),zk=e=>_x(lu({},"__esModule",{value:!0}),e);var Ne=(e,t,r)=>Hk(e,typeof t!="symbol"?t+"":t,r);var y,c=du(()=>{"use strict";y=typeof globalThis<"u"?globalThis:window});function jl(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jl=function(t){return typeof t}:jl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jl(e)}function Yk(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=Jk.bind(this))}function Jk(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),Wk(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):Kk(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var Wk,Kk,u=du(()=>{"use strict";Wk=function(t){return typeof t=="string"},Kk=function(t){return t instanceof Blob};Yk.call((typeof window>"u"?"undefined":jl(window))==="object"?window:{})});var Nh=Rt(fu=>{"use strict";d();c();l();u();Object.defineProperty(fu,"__esModule",{value:!0});function Dx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Xk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zk(e,t,r){return t=yi(t),tO(e,Vx()?Reflect.construct(t,r||[],yi(e).constructor):t.apply(e,r))}function Ph(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,aO(n.key),n)}}function kh(e,t,r){return t&&qx(e.prototype,t),r&&qx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mx(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=iO(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,i=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return i=f.done,f},e:function(f){p=!0,a=f},f:function(){try{i||r.return==null||r.return()}finally{if(p)throw a}}}}function Ih(){return Ih=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=rO(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},Ih.apply(null,arguments)}function yi(e){return yi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yi(e)}function eO(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Th(e,t)}function Vx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Vx=function(){return!!e})()}function tO(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xk(e)}function Th(e,t){return Th=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Th(e,t)}function rO(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=yi(e))!==null;);return e}function nO(e,t,r,n){var o=Ih(yi(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function oO(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aO(e){var t=oO(e,"string");return typeof t=="symbol"?t:t+""}function iO(e,t){if(e){if(typeof e=="string")return Dx(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dx(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function sO(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function cO(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var jx=function(){function e(){Ph(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return kh(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],a=0,i=o.length;a<i;a++)if(o[a].callback===n){o.splice(a,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],a=o.slice(),i=function(){var g=a[p];try{g.callback.call(n,r)}catch(S){Promise.resolve().then(function(){throw S})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},p=0,f=a.length;p<f;p++)i();return!r.defaultPrevented}}}])}(),Oh=function(e){function t(){var r;return Ph(this,t),r=Zk(this,t),r.listeners||jx.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return eO(t,e),kh(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),nO(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,a=o===void 0?"Aborted":o;if(n)throw a}}],[{key:"timeout",value:function(n){var o=new Vl;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new Vl;function a(){o.abort(this.reason),i()}function i(){var g=Mx(n),S;try{for(g.s();!(S=g.n()).done;){var A=S.value;A.removeEventListener("abort",a)}}catch(h){g.e(h)}finally{g.f()}}var p=Mx(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",a)}}catch(g){p.e(g)}finally{p.f()}return o.signal}}])}(jx),Vl=function(){function e(){Ph(this,e),Object.defineProperty(this,"signal",{value:new Oh,writable:!0,configurable:!0})}return kh(e,[{key:"abort",value:function(r){var n=cO(r),o=sO(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Vl.prototype[Symbol.toStringTag]="AbortController",Oh.prototype[Symbol.toStringTag]="AbortSignal");function uO(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function lO(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,a=t.AbortController,i=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=i===void 0?!1:i;if(!uO({fetch:r,Request:o,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(A,h){var C;h&&h.signal&&(C=h.signal,delete h.signal);var w=new o(A,h);return C&&Object.defineProperty(w,"signal",{writable:!1,enumerable:!1,configurable:!0,value:C}),w},f.prototype=o.prototype);var m=r,g=function(A,h){var C=f&&f.prototype.isPrototypeOf(A)?A.signal:h?h.signal:void 0;if(C){var w;try{w=new DOMException("Aborted","AbortError")}catch{w=new Error("Aborted"),w.name="AbortError"}if(C.aborted)return Promise.reject(w);var R=new Promise(function(b,F){C.addEventListener("abort",function(){return F(w)},{once:!0})});return h&&h.signal&&delete h.signal,Promise.race([R,m(A,h)])}return m(A,h)};return{fetch:g,Request:f}}fu.AbortController=Vl;fu.AbortSignal=Oh;fu.abortableFetch=lO});var Lx,s,v,l=du(()=>{"use strict";Lx=kr(Nh(),1),s=kr(Nh(),1),{fetch:v}=(0,Lx.abortableFetch)({fetch})});function mu(e){if(xO.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function _h(e){return e.replace(AO,"")}function gu(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!CO(r))return!1}return!0}function CO(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function Qx(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var dO,zx,pO,Wx,fO,mO,gO,hO,yO,SO,vO,xO,Ux,AO,Si,Dh,Bx,Gx,$x,Hx,x,Yx=du(()=>{"use strict";d();c();l();u();dO=Object.create,zx=Object.defineProperty,pO=Object.getOwnPropertyDescriptor,Wx=Object.getOwnPropertyNames,fO=Object.getPrototypeOf,mO=Object.prototype.hasOwnProperty,gO=(e,t)=>function(){return t||(0,e[Wx(e)[0]])((t={exports:{}}).exports,t),t.exports},hO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wx(t))!mO.call(e,o)&&o!==r&&zx(e,o,{get:()=>t[o],enumerable:!(n=pO(t,o))||n.enumerable});return e},yO=(e,t,r)=>(r=e!=null?dO(fO(e)):{},hO(t||!e||!e.__esModule?zx(r,"default",{value:e,enumerable:!0}):r,e)),SO=gO({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,m){var g=f.split(";").filter(n),S=g.shift(),A=a(S),h=A.name,C=A.value;m=m?Object.assign({},r,m):r;try{C=m.decodeValues?decodeURIComponent(C):C}catch(R){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+C+"'. Set options.decodeValues to false to disable this feature.",R)}var w={name:h,value:C};return g.forEach(function(R){var b=R.split("="),F=b.shift().trimLeft().toLowerCase(),E=b.join("=");F==="expires"?w.expires=new Date(E):F==="max-age"?w.maxAge=parseInt(E,10):F==="secure"?w.secure=!0:F==="httponly"?w.httpOnly=!0:F==="samesite"?w.sameSite=E:w[F]=E}),w}function a(f){var m="",g="",S=f.split("=");return S.length>1?(m=S.shift(),g=S.join("=")):g=f,{name:m,value:g}}function i(f,m){if(m=m?Object.assign({},r,m):r,!f)return m.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var g=f.headers[Object.keys(f.headers).find(function(A){return A.toLowerCase()==="set-cookie"})];!g&&f.headers.cookie&&!m.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),f=g}if(Array.isArray(f)||(f=[f]),m=m?Object.assign({},r,m):r,m.map){var S={};return f.filter(n).reduce(function(A,h){var C=o(h,m);return A[C.name]=C,A},S)}else return f.filter(n).map(function(A){return o(A,m)})}function p(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var m=[],g=0,S,A,h,C,w;function R(){for(;g<f.length&&/\s/.test(f.charAt(g));)g+=1;return g<f.length}function b(){return A=f.charAt(g),A!=="="&&A!==";"&&A!==","}for(;g<f.length;){for(S=g,w=!1;R();)if(A=f.charAt(g),A===","){for(h=g,g+=1,R(),C=g;g<f.length&&b();)g+=1;g<f.length&&f.charAt(g)==="="?(w=!0,g=C,m.push(f.substring(S,h)),S=g):g=h+1}else g+=1;(!w||g>=f.length)&&m.push(f.substring(S,f.length))}return m}t.exports=i,t.exports.parse=i,t.exports.parseString=o,t.exports.splitCookiesString=p}}),vO=yO(SO()),xO=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Ux=[`
19
+ `,"\r","\t"," "],AO=new RegExp(`(^[${Ux.join("")}]|$[${Ux.join("")}])`,"g");Si=Symbol("normalizedHeaders"),Dh=Symbol("rawHeaderNames"),Bx=", ",x=class Kx{constructor(t){this[Gx]={},this[$x]=new Map,this[Hx]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof Kx||typeof y.Headers<"u"&&t instanceof y.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(Bx):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(Bx):n)})}[(Gx=Si,$x=Dh,Hx=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[Si]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!gu(t))throw new TypeError(`Invalid header name "${t}"`);return this[Si].hasOwnProperty(mu(t))}get(t){if(!gu(t))throw TypeError(`Invalid header name "${t}"`);return this[Si][mu(t)]??null}set(t,r){if(!gu(t)||!Qx(r))return;let n=mu(t),o=_h(r);this[Si][n]=_h(o),this[Dh].set(n,t)}append(t,r){if(!gu(t)||!Qx(r))return;let n=mu(t),o=_h(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!gu(t)||!this.has(t))return;let r=mu(t);delete this[Si][r],this[Dh].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:(0,vO.splitCookiesString)(t)}}});var d=du(()=>{"use strict";Yx()});var lA=Rt(xu=>{"use strict";d();c();l();u();var zl=xu&&xu.__assign||function(){return zl=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},zl.apply(this,arguments)};Object.defineProperty(xu,"__esModule",{value:!0});var jO={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function VO(e){var t=zl(zl({},jO),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}xu.getSanitizedOptions=VO});var dA=Rt(Bh=>{"use strict";d();c();l();u();Object.defineProperty(Bh,"__esModule",{value:!0});function LO(e){var t=Math.random()*e;return Math.round(t)}Bh.fullJitter=LO});var pA=Rt(Gh=>{"use strict";d();c();l();u();Object.defineProperty(Gh,"__esModule",{value:!0});function UO(e){return e}Gh.noJitter=UO});var fA=Rt($h=>{"use strict";d();c();l();u();Object.defineProperty($h,"__esModule",{value:!0});var QO=dA(),BO=pA();function GO(e){return e.jitter==="full"?QO.fullJitter:BO.noJitter}$h.JitterFactory=GO});var zh=Rt(Hh=>{"use strict";d();c();l();u();Object.defineProperty(Hh,"__esModule",{value:!0});var $O=fA(),HO=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=$O.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();Hh.Delay=HO});var mA=Rt(On=>{"use strict";d();c();l();u();var zO=On&&On.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),WO=On&&On.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},KO=On&&On.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(On,"__esModule",{value:!0});var YO=zh(),JO=function(e){zO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return WO(this,void 0,void 0,function(){return KO(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(YO.Delay);On.SkipFirstDelay=JO});var gA=Rt(Au=>{"use strict";d();c();l();u();var XO=Au&&Au.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Au,"__esModule",{value:!0});var ZO=zh(),eN=function(e){XO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ZO.Delay);Au.AlwaysDelay=eN});var hA=Rt(Wh=>{"use strict";d();c();l();u();Object.defineProperty(Wh,"__esModule",{value:!0});var tN=mA(),rN=gA();function nN(e,t){var r=oN(e);return r.setAttemptNumber(t),r}Wh.DelayFactory=nN;function oN(e){return e.delayFirstAttempt?new rN.AlwaysDelay(e):new tN.SkipFirstDelay(e)}});var yA=Rt(Zo=>{"use strict";d();c();l();u();var Kh=Zo&&Zo.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},Yh=Zo&&Zo.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Zo,"__esModule",{value:!0});var aN=lA(),iN=hA();function sN(e,t){return t===void 0&&(t={}),Kh(this,void 0,void 0,function(){var r,n;return Yh(this,function(o){switch(o.label){case 0:return r=aN.getSanitizedOptions(t),n=new cN(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Zo.backOff=sN;var cN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Kh(this,void 0,void 0,function(){var t,r;return Yh(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return Kh(this,void 0,void 0,function(){var t;return Yh(this,function(r){switch(r.label){case 0:return t=iN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Xd=Rt((cS,uS)=>{"use strict";d();c();l();u();(function(e,t){typeof cS=="object"&&typeof uS<"u"?uS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(cS,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",p="day",f="week",m="month",g="quarter",S="year",A="date",h="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var B=["th","st","nd","rd"],Q=H%100;return"["+H+(B[(Q-20)%10]||B[Q]||B[0])+"]"}},b=function(H,B,Q){var K=String(H);return!K||K.length>=B?H:""+Array(B+1-K.length).join(Q)+H},F={s:b,z:function(H){var B=-H.utcOffset(),Q=Math.abs(B),K=Math.floor(Q/60),$=Q%60;return(B<=0?"+":"-")+b(K,2,"0")+":"+b($,2,"0")},m:function H(B,Q){if(B.date()<Q.date())return-H(Q,B);var K=12*(Q.year()-B.year())+(Q.month()-B.month()),$=B.clone().add(K,m),te=Q-$<0,re=B.clone().add(K+(te?-1:1),m);return+(-(K+(Q-$)/(te?$-re:re-$))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:m,y:S,w:f,d:p,D:A,h:i,m:a,s:o,ms:n,Q:g}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},E="en",P={};P[E]=R;var M="$isDayjsObject",_=function(H){return H instanceof U||!(!H||!H[M])},k=function H(B,Q,K){var $;if(!B)return E;if(typeof B=="string"){var te=B.toLowerCase();P[te]&&($=te),Q&&(P[te]=Q,$=te);var re=B.split("-");if(!$&&re.length>1)return H(re[0])}else{var pe=B.name;P[pe]=B,$=pe}return!K&&$&&(E=$),$||!K&&E},N=function(H,B){if(_(H))return H.clone();var Q=typeof B=="object"?B:{};return Q.date=H,Q.args=arguments,new U(Q)},q=F;q.l=k,q.i=_,q.w=function(H,B){return N(H,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var U=function(){function H(Q){this.$L=k(Q.locale,null,!0),this.parse(Q),this.$x=this.$x||Q.x||{},this[M]=!0}var B=H.prototype;return B.parse=function(Q){this.$d=function(K){var $=K.date,te=K.utc;if($===null)return new Date(NaN);if(q.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var re=$.match(C);if(re){var pe=re[2]-1||0,Re=(re[7]||"0").substring(0,3);return te?new Date(Date.UTC(re[1],pe,re[3]||1,re[4]||0,re[5]||0,re[6]||0,Re)):new Date(re[1],pe,re[3]||1,re[4]||0,re[5]||0,re[6]||0,Re)}}return new Date($)}(Q),this.init()},B.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},B.$utils=function(){return q},B.isValid=function(){return this.$d.toString()!==h},B.isSame=function(Q,K){var $=N(Q);return this.startOf(K)<=$&&$<=this.endOf(K)},B.isAfter=function(Q,K){return N(Q)<this.startOf(K)},B.isBefore=function(Q,K){return this.endOf(K)<N(Q)},B.$g=function(Q,K,$){return q.u(Q)?this[K]:this.set($,Q)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(Q,K){var $=this,te=!!q.u(K)||K,re=q.p(Q),pe=function(Me,Ze){var at=q.w($.$u?Date.UTC($.$y,Ze,Me):new Date($.$y,Ze,Me),$);return te?at:at.endOf(p)},Re=function(Me,Ze){return q.w($.toDate()[Me].apply($.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(Ze)),$)},ke=this.$W,Ce=this.$M,we=this.$D,Ae="set"+(this.$u?"UTC":"");switch(re){case S:return te?pe(1,0):pe(31,11);case m:return te?pe(1,Ce):pe(0,Ce+1);case f:var Ee=this.$locale().weekStart||0,rt=(ke<Ee?ke+7:ke)-Ee;return pe(te?we-rt:we+(6-rt),Ce);case p:case A:return Re(Ae+"Hours",0);case i:return Re(Ae+"Minutes",1);case a:return Re(Ae+"Seconds",2);case o:return Re(Ae+"Milliseconds",3);default:return this.clone()}},B.endOf=function(Q){return this.startOf(Q,!1)},B.$set=function(Q,K){var $,te=q.p(Q),re="set"+(this.$u?"UTC":""),pe=($={},$[p]=re+"Date",$[A]=re+"Date",$[m]=re+"Month",$[S]=re+"FullYear",$[i]=re+"Hours",$[a]=re+"Minutes",$[o]=re+"Seconds",$[n]=re+"Milliseconds",$)[te],Re=te===p?this.$D+(K-this.$W):K;if(te===m||te===S){var ke=this.clone().set(A,1);ke.$d[pe](Re),ke.init(),this.$d=ke.set(A,Math.min(this.$D,ke.daysInMonth())).$d}else pe&&this.$d[pe](Re);return this.init(),this},B.set=function(Q,K){return this.clone().$set(Q,K)},B.get=function(Q){return this[q.p(Q)]()},B.add=function(Q,K){var $,te=this;Q=Number(Q);var re=q.p(K),pe=function(Ce){var we=N(te);return q.w(we.date(we.date()+Math.round(Ce*Q)),te)};if(re===m)return this.set(m,this.$M+Q);if(re===S)return this.set(S,this.$y+Q);if(re===p)return pe(1);if(re===f)return pe(7);var Re=($={},$[a]=t,$[i]=r,$[o]=e,$)[re]||1,ke=this.$d.getTime()+Q*Re;return q.w(ke,this)},B.subtract=function(Q,K){return this.add(-1*Q,K)},B.format=function(Q){var K=this,$=this.$locale();if(!this.isValid())return $.invalidDate||h;var te=Q||"YYYY-MM-DDTHH:mm:ssZ",re=q.z(this),pe=this.$H,Re=this.$m,ke=this.$M,Ce=$.weekdays,we=$.months,Ae=$.meridiem,Ee=function(Ze,at,$t,ur){return Ze&&(Ze[at]||Ze(K,te))||$t[at].slice(0,ur)},rt=function(Ze){return q.s(pe%12||12,Ze,"0")},Me=Ae||function(Ze,at,$t){var ur=Ze<12?"AM":"PM";return $t?ur.toLowerCase():ur};return te.replace(w,function(Ze,at){return at||function($t){switch($t){case"YY":return String(K.$y).slice(-2);case"YYYY":return q.s(K.$y,4,"0");case"M":return ke+1;case"MM":return q.s(ke+1,2,"0");case"MMM":return Ee($.monthsShort,ke,we,3);case"MMMM":return Ee(we,ke);case"D":return K.$D;case"DD":return q.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return Ee($.weekdaysMin,K.$W,Ce,2);case"ddd":return Ee($.weekdaysShort,K.$W,Ce,3);case"dddd":return Ce[K.$W];case"H":return String(pe);case"HH":return q.s(pe,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return Me(pe,Re,!0);case"A":return Me(pe,Re,!1);case"m":return String(Re);case"mm":return q.s(Re,2,"0");case"s":return String(K.$s);case"ss":return q.s(K.$s,2,"0");case"SSS":return q.s(K.$ms,3,"0");case"Z":return re}return null}(Ze)||re.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(Q,K,$){var te,re=this,pe=q.p(K),Re=N(Q),ke=(Re.utcOffset()-this.utcOffset())*t,Ce=this-Re,we=function(){return q.m(re,Re)};switch(pe){case S:te=we()/12;break;case m:te=we();break;case g:te=we()/3;break;case f:te=(Ce-ke)/6048e5;break;case p:te=(Ce-ke)/864e5;break;case i:te=Ce/r;break;case a:te=Ce/t;break;case o:te=Ce/e;break;default:te=Ce}return $?te:q.a(te)},B.daysInMonth=function(){return this.endOf(m).$D},B.$locale=function(){return P[this.$L]},B.locale=function(Q,K){if(!Q)return this.$L;var $=this.clone(),te=k(Q,K,!0);return te&&($.$L=te),$},B.clone=function(){return q.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},H}(),X=U.prototype;return N.prototype=X,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",p],["$M",m],["$y",S],["$D",A]].forEach(function(H){X[H[1]]=function(B){return this.$g(B,H[0],H[1])}}),N.extend=function(H,B){return H.$i||(H(B,U,N),H.$i=!0),N},N.locale=k,N.isDayjs=_,N.unix=function(H){return N(1e3*H)},N.en=P[E],N.Ls=P,N.p={},N})});var Bb=Rt((lS,dS)=>{"use strict";d();c();l();u();(function(e,t){typeof lS=="object"&&typeof dS<"u"?dS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(lS,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var a=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):a.bind(this)(p,f)};var i=o.startOf;o.startOf=function(p,f){var m=this.$utils(),g=!!m.u(f)||f;if(m.p(p)===t){var S=this.quarter()-1;return g?this.month(3*S).startOf(e).startOf("day"):this.month(3*S+2).endOf(e).endOf("day")}return i.bind(this)(p,f)}}})});var Gb=Rt((pS,fS)=>{"use strict";d();c();l();u();(function(e,t){typeof pS=="object"&&typeof fS<"u"?fS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(pS,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},p=function(C){return(C=+C)+(C>68?1900:2e3)},f=function(C){return function(w){this[C]=+w}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var R=w.match(/([+-]|\d\d)/g),b=60*R[1]+(+R[2]||0);return b===0?0:R[0]==="+"?-b:b}(C)}],g=function(C){var w=i[C];return w&&(w.indexOf?w:w.s.concat(w.f))},S=function(C,w){var R,b=i.meridiem;if(b){for(var F=1;F<=24;F+=1)if(C.indexOf(b(F,0,w))>-1){R=F>12;break}}else R=C===(w?"pm":"PM");return R},A={A:[a,function(C){this.afternoon=S(C,!1)}],a:[a,function(C){this.afternoon=S(C,!0)}],Q:[r,function(C){this.month=3*(C-1)+1}],S:[r,function(C){this.milliseconds=100*+C}],SS:[n,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[a,function(C){var w=i.ordinal,R=C.match(/\d+/);if(this.day=R[0],w)for(var b=1;b<=31;b+=1)w(b).replace(/\[|\]/g,"")===C&&(this.day=b)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(C){var w=g("months"),R=(g("monthsShort")||w.map(function(b){return b.slice(0,3)})).indexOf(C)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[a,function(C){var w=g("months").indexOf(C)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(C){this.year=p(C)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function h(C){var w,R;w=C,R=i&&i.formats;for(var b=(C=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(N,q,U){var X=U&&U.toUpperCase();return q||R[U]||e[U]||R[X].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(H,B,Q){return B||Q.slice(1)})})).match(t),F=b.length,E=0;E<F;E+=1){var P=b[E],M=A[P],_=M&&M[0],k=M&&M[1];b[E]=k?{regex:_,parser:k}:P.replace(/^\[|\]$/g,"")}return function(N){for(var q={},U=0,X=0;U<F;U+=1){var H=b[U];if(typeof H=="string")X+=H.length;else{var B=H.regex,Q=H.parser,K=N.slice(X),$=B.exec(K)[0];Q.call(q,$),N=N.replace($,"")}}return function(te){var re=te.afternoon;if(re!==void 0){var pe=te.hours;re?pe<12&&(te.hours+=12):pe===12&&(te.hours=0),delete te.afternoon}}(q),q}}return function(C,w,R){R.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(p=C.parseTwoDigitYear);var b=w.prototype,F=b.parse;b.parse=function(E){var P=E.date,M=E.utc,_=E.args;this.$u=M;var k=_[1];if(typeof k=="string"){var N=_[2]===!0,q=_[3]===!0,U=N||q,X=_[2];q&&(X=_[2]),i=this.$locale(),!N&&X&&(i=R.Ls[X]),this.$d=function(K,$,te,re){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*K);var pe=h($)(K),Re=pe.year,ke=pe.month,Ce=pe.day,we=pe.hours,Ae=pe.minutes,Ee=pe.seconds,rt=pe.milliseconds,Me=pe.zone,Ze=pe.week,at=new Date,$t=Ce||(Re||ke?1:at.getDate()),ur=Re||at.getFullYear(),no=0;Re&&!ke||(no=ke>0?ke-1:at.getMonth());var gi,hi=we||0,uu=Ae||0,Fh=Ee||0,Eh=rt||0;return Me?new Date(Date.UTC(ur,no,$t,hi,uu,Fh,Eh+60*Me.offset*1e3)):te?new Date(Date.UTC(ur,no,$t,hi,uu,Fh,Eh)):(gi=new Date(ur,no,$t,hi,uu,Fh,Eh),Ze&&(gi=re(gi).week(Ze).toDate()),gi)}catch{return new Date("")}}(P,k,M,R),this.init(),X&&X!==!0&&(this.$L=this.locale(X).$L),U&&P!=this.format(k)&&(this.$d=new Date("")),i={}}else if(k instanceof Array)for(var H=k.length,B=1;B<=H;B+=1){_[1]=k[B-1];var Q=R.apply(this,_);if(Q.isValid()){this.$d=Q.$d,this.$L=Q.$L,this.init();break}B===H&&(this.$d=new Date(""))}else F.call(this,E)}}})});var pw=Rt((BS,GS)=>{"use strict";d();c();l();u();(function(e,t){typeof BS=="object"&&typeof GS<"u"?GS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(BS,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(g,S,A){A===void 0&&(A={});var h=new Date(g),C=function(w,R){R===void 0&&(R={});var b=R.timeZoneName||"short",F=w+"|"+b,E=t[F];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:w,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:b}),t[F]=E),E}(S,A);return C.formatToParts(h)},p=function(g,S){for(var A=i(g,S),h=[],C=0;C<A.length;C+=1){var w=A[C],R=w.type,b=w.value,F=e[R];F>=0&&(h[F]=parseInt(b,10))}var E=h[3],P=E===24?0:E,M=h[0]+"-"+h[1]+"-"+h[2]+" "+P+":"+h[4]+":"+h[5]+":000",_=+g;return(o.utc(M).valueOf()-(_-=_%1e3))/6e4},f=n.prototype;f.tz=function(g,S){g===void 0&&(g=a);var A,h=this.utcOffset(),C=this.toDate(),w=C.toLocaleString("en-US",{timeZone:g}),R=Math.round((C-new Date(w))/1e3/60),b=15*-Math.round(C.getTimezoneOffset()/15)-R;if(!Number(b))A=this.utcOffset(0,S);else if(A=o(w,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(b,!0),S){var F=A.utcOffset();A=A.add(h-F,"minute")}return A.$x.$timezone=g,A},f.offsetName=function(g){var S=this.$x.$timezone||o.tz.guess(),A=i(this.valueOf(),S,{timeZoneName:g}).find(function(h){return h.type.toLowerCase()==="timezonename"});return A&&A.value};var m=f.startOf;f.startOf=function(g,S){if(!this.$x||!this.$x.$timezone)return m.call(this,g,S);var A=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(A,g,S).tz(this.$x.$timezone,!0)},o.tz=function(g,S,A){var h=A&&S,C=A||S||a,w=p(+o(),C);if(typeof g!="string")return o(g).tz(C);var R=function(P,M,_){var k=P-60*M*1e3,N=p(k,_);if(M===N)return[k,M];var q=p(k-=60*(N-M)*1e3,_);return N===q?[k,N]:[P-60*Math.min(N,q)*1e3,Math.max(N,q)]}(o.utc(g,h).valueOf(),w,C),b=R[0],F=R[1],E=o(b).utcOffset(F);return E.$x.$timezone=C,E},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){a=g}}})});var fw=Rt(($S,HS)=>{"use strict";d();c();l();u();(function(e,t){typeof $S=="object"&&typeof HS<"u"?HS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})($S,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(h){var C={date:h,utc:!0,args:arguments};return new o(C)},i.utc=function(h){var C=a(this.toDate(),{locale:this.$L,utc:!0});return h?C.add(this.utcOffset(),e):C},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var p=i.parse;i.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),p.call(this,h)};var f=i.init;i.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else f.call(this)};var m=i.utcOffset;i.utcOffset=function(h,C){var w=this.$utils().u;if(w(h))return this.$u?0:w(this.$offset)?m.call(this):this.$offset;if(typeof h=="string"&&(h=function(E){E===void 0&&(E="");var P=E.match(t);if(!P)return null;var M=(""+P[0]).match(r)||["-",0,0],_=M[0],k=60*+M[1]+ +M[2];return k===0?0:_==="+"?k:-k}(h),h===null))return this;var R=Math.abs(h)<=16?60*h:h;if(R===0)return this.utc(C);var b=this.clone();if(C)return b.$offset=R,b.$u=!1,b;var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(b=this.local().add(R+F,e)).$offset=R,b.$x.$localOffset=F,b};var g=i.format;i.format=function(h){var C=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,C)},i.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var S=i.toDate;i.toDate=function(h){return h==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var A=i.diff;i.diff=function(h,C,w){if(h&&this.$u===h.$u)return A.call(this,h,C,w);var R=this.local(),b=a(h).local();return A.call(R,b,C,w)}}})});var lE=Rt((YAe,uE)=>{"use strict";d();c();l();u();function gU(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}uE.exports=hU;function hU(e,t,r){var n=r&&r.stringify||gU,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var p=1;p<a;p++)i[p]=n(t[p]);return i.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",g=1-o,S=-1,A=e&&e.length||0,h=0;h<A;){if(e.charCodeAt(h)===37&&h+1<A){switch(S=S>-1?S:0,e.charCodeAt(h+1)){case 100:case 102:if(g>=f||t[g]==null)break;S<h&&(m+=e.slice(S,h)),m+=Number(t[g]),S=h+2,h++;break;case 105:if(g>=f||t[g]==null)break;S<h&&(m+=e.slice(S,h)),m+=Math.floor(Number(t[g])),S=h+2,h++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;S<h&&(m+=e.slice(S,h));var C=typeof t[g];if(C==="string"){m+="'"+t[g]+"'",S=h+2,h++;break}if(C==="function"){m+=t[g].name||"<anonymous>",S=h+2,h++;break}m+=n(t[g]),S=h+2,h++;break;case 115:if(g>=f)break;S<h&&(m+=e.slice(S,h)),m+=String(t[g]),S=h+2,h++;break;case 37:S<h&&(m+=e.slice(S,h)),m+="%",S=h+2,h++,g--;break}++g}++h}return S===-1?e:(S<A&&(m+=e.slice(S)),m)}});var hE=Rt((tCe,bm)=>{"use strict";d();c();l();u();var dE=lE();bm.exports=zn;var hl=kU().console||{},yU={mapHttpRequest:Cm,mapHttpResponse:Cm,wrapRequestSerializer:qv,wrapResponseSerializer:qv,wrapErrorSerializer:qv,req:Cm,res:Cm,err:fE,errWithCause:fE};function qo(e,t){return e==="silent"?1/0:t.levels.values[e]}var Vv=Symbol("pino.logFuncs"),Mv=Symbol("pino.hierarchy"),SU={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function pE(e,t){let r={logger:t,parent:e[Mv]};t[Mv]=r}function vU(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:hl[o]||hl[SU[o]||"log"]||Js}),e[Vv]=n}function xU(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function zn(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||hl;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=xU(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&p.forEach(function(w){r[w]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=Js),vU(m,p,r),pE({},m),Object.defineProperty(m,"levelVal",{get:S}),Object.defineProperty(m,"level",{get:A,set:h});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:p,timestamp:IU(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Js};m.levels=AU(e),m.level=f,m.isLevelEnabled=function(w){return this.levels.values[w]?this.levels.values[w]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=Js,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...w){return C.call(this,g,...w)},t&&(m._logEvent=jv());function S(){return qo(this.level,this)}function A(){return this._level}function h(w){if(w!=="silent"&&!this.levels.values[w])throw Error("unknown level "+w);this._level=w,Ka(this,g,m,"error"),Ka(this,g,m,"fatal"),Ka(this,g,m,"warn"),Ka(this,g,m,"info"),Ka(this,g,m,"debug"),Ka(this,g,m,"trace"),i.forEach(R=>{Ka(this,g,m,R)})}function C(w,R,b){if(!R)throw new Error("missing bindings for child Pino");b=b||{},o&&R.serializers&&(b.serializers=R.serializers);let F=b.serializers;if(o&&F){var E=Object.assign({},n,F),P=e.browser.serialize===!0?Object.keys(E):o;delete R.serializers,Lv([R],P,E,this._stdErrSerialize)}function M(k){this._childLevel=(k._childLevel|0)+1,this.bindings=R,E&&(this.serializers=E,this._serialize=P),t&&(this._logEvent=jv([].concat(k._logEvent.bindings,R)))}M.prototype=this;let _=new M(this);return pE(this,_),_.child=function(...k){return C.call(this,w,...k)},_.level=b.level||this.level,w.onChild(_),_}return m}function AU(e){let t=e.customLevels||{},r=Object.assign({},zn.levels.values,t),n=Object.assign({},zn.levels.labels,CU(t));return{values:r,labels:n}}function CU(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}zn.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};zn.stdSerializers=yU;zn.stdTimeFunctions=Object.assign({},{nullTime:mE,epochTime:gE,unixTime:TU,isoTime:PU});function bU(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Mv];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Ka(e,t,r,n){if(Object.defineProperty(e,n,{value:qo(e.level,r)>qo(n,r)?Js:r[Vv][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Js){if(!t.transmit)return;let a=t.transmit.level||e.level,i=qo(a,r);if(qo(n,r)<i)return}e[n]=wU(e,t,r,n);let o=bU(e);o.length!==0&&(e[n]=RU(o,e[n]))}function RU(e,t){return function(){return t.apply(this,[...e,...arguments])}}function wU(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===hl?hl:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&(Lv(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters?o.call(f,...FU(this,n,p,i,t)):o.apply(f,p),t.transmit){let S=t.transmit.level||e._level,A=qo(S,r),h=qo(n,r);if(h<A)return;EU(this,{ts:i,methodLevel:n,methodValue:h,transmitLevel:S,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:qo(e._level,r)},p,g)}}}(e[Vv][n])}function FU(e,t,r,n,o){let{level:a,log:i=S=>S}=o.formatters||{},p=r.slice(),f=p[0],m={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(m.time=n),a){let S=a(t,e.levels.values[t]);Object.assign(m,S)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[i(m),...p]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?dE(p.shift(),p):void 0}else typeof f=="string"&&(f=dE(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function Lv(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=zn.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function EU(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||Lv(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(g){return m.indexOf(g)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=p,o(i,e._logEvent,f),e._logEvent=jv(m)}function jv(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function fE(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function IU(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?mE:gE}function Cm(){return{}}function qv(e){return e}function Js(){}function mE(){return!1}function gE(){return Date.now()}function TU(){return Math.round(Date.now()/1e3)}function PU(){return new Date(Date.now()).toISOString()}function kU(){function e(t){return typeof t<"u"&&t}try{return typeof y<"u"?y:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),y)}catch{return e(self)||e(window)||e(this)||{}}}bm.exports.default=zn;bm.exports.pino=zn});var w$={};pu(w$,{API_DATE_FORMAT:()=>ms,DefaultFieldsToInclude:()=>Zv,EcommerceDefaultFieldsToInclude:()=>iT,HighlightUtils:()=>jh,MinimumFieldsToInclude:()=>jg,ResultTemplatesHelpers:()=>xR,SortBy:()=>la,SortOrder:()=>Qu,VERSION:()=>uo,baseFacetResponseSelector:()=>Nr,buildAutomaticFacetGenerator:()=>vI,buildBreadcrumbManager:()=>ZE,buildCategoryFacet:()=>PI,buildCategoryFieldSuggestions:()=>ZI,buildContext:()=>rI,buildController:()=>ne,buildCriterionExpression:()=>Hr,buildDateFacet:()=>GI,buildDateFilter:()=>HI,buildDateRange:()=>Vo,buildDateSortCriterion:()=>qd,buildDictionaryFieldContext:()=>aI,buildDidYouMean:()=>dI,buildExecuteTrigger:()=>pk,buildFacet:()=>jI,buildFacetConditionsManager:()=>oI,buildFacetManager:()=>fI,buildFieldSortCriterion:()=>Md,buildFieldSuggestions:()=>eT,buildFoldedResultList:()=>uT,buildGeneratedAnswer:()=>vT,buildHistoryManager:()=>OT,buildInstantResults:()=>QT,buildInteractiveCitation:()=>AT,buildInteractiveInstantResult:()=>NT,buildInteractiveRecentResult:()=>sP,buildInteractiveResult:()=>gP,buildNoSortCriterion:()=>Vd,buildNotifyTrigger:()=>mk,buildNumericFacet:()=>YI,buildNumericFilter:()=>XI,buildNumericRange:()=>bc,buildPager:()=>$T,buildQueryError:()=>zT,buildQueryExpression:()=>b$,buildQueryRankingExpressionSortCriterion:()=>jd,buildQuerySummary:()=>KT,buildQueryTrigger:()=>gk,buildQuickview:()=>ZT,buildRecentQueriesList:()=>oP,buildRecentResultsList:()=>uP,buildRedirectionTrigger:()=>hk,buildRelevanceInspector:()=>mP,buildRelevanceSortCriterion:()=>zi,buildResultList:()=>hP,buildResultTemplatesManager:()=>Ik,buildResultsPerPage:()=>SP,buildSearchBox:()=>ih,buildSearchEngine:()=>TE,buildSearchParameterManager:()=>dh,buildSearchParameterSerializer:()=>ql,buildSearchStatus:()=>UP,buildSmartSnippet:()=>$P,buildSmartSnippetQuestionsList:()=>WP,buildSort:()=>XP,buildStandaloneSearchBox:()=>rk,buildStaticFilter:()=>nk,buildStaticFilterValue:()=>kx,buildTab:()=>ak,buildTabManager:()=>ik,buildUrlManager:()=>Ck,currentPageSelector:()=>ro,currentPagesSelector:()=>Kg,deserializeRelativeDate:()=>eR,facetRequestSelector:()=>kd,facetResponseSelectedValuesSelector:()=>ib,facetResponseSelector:()=>Li,getAnalyticsNextApiBaseUrl:()=>Wl,getOrganizationEndpoint:()=>Ft,getSampleSearchEngineConfiguration:()=>Bv,getSearchApiBaseUrl:()=>ct,loadAdvancedSearchQueryActions:()=>O2,loadAutomaticFacetSetActions:()=>$2,loadBreadcrumbActions:()=>q2,loadCategoryFacetSetActions:()=>H2,loadClickAnalyticsActions:()=>N2,loadConfigurationActions:()=>M2,loadContextActions:()=>V2,loadDateFacetSetActions:()=>W2,loadDebugActions:()=>L2,loadDictionaryFieldContextActions:()=>U2,loadDidYouMeanActions:()=>Q2,loadExcerptLengthActions:()=>B2,loadFacetOptionsActions:()=>G2,loadFacetSetActions:()=>z2,loadFieldActions:()=>Y2,loadFoldingActions:()=>J2,loadGeneratedAnswerActions:()=>X2,loadGenericAnalyticsActions:()=>_2,loadHistoryActions:()=>Z2,loadIPXActionsHistoryActions:()=>k2,loadInstantResultsActions:()=>e$,loadNumericFacetSetActions:()=>K2,loadPaginationActions:()=>t$,loadPipelineActions:()=>r$,loadQueryActions:()=>n$,loadQuerySetActions:()=>o$,loadQuerySuggestActions:()=>a$,loadQuestionAnsweringActions:()=>i$,loadRecentQueriesActions:()=>s$,loadRecentResultsActions:()=>c$,loadResultPreviewActions:()=>u$,loadSearchActions:()=>p$,loadSearchAnalyticsActions:()=>D2,loadSearchConfigurationActions:()=>j2,loadSearchHubActions:()=>f$,loadSearchParameterActions:()=>m$,loadSortCriteriaActions:()=>y$,loadStandaloneSearchBoxSetActions:()=>S$,loadStaticFilterSetActions:()=>v$,loadTabSetActions:()=>x$,maxPageSelector:()=>kl,parseCriterionExpression:()=>Tk,validateRelativeDate:()=>xo});module.exports=zk(w$);d();c();l();u();var jh={};pu(jh,{escapeHtml:()=>Ci,getHighlightedSuggestion:()=>Mh,highlightString:()=>PO});d();c();l();u();d();c();l();u();function bO(e,t){let r=`
20
20
  The following properties are invalid:
21
21
 
22
22
  ${e.join(`
23
23
  `)}
24
24
 
25
25
  ${t}
26
- `;return new Tu(r)}var Tu=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ge=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let a in this.definition){let o=this.definition[a].validate(r[a]);o&&n.push(`${a}: ${o}`)}if(n.length)throw MO(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}},Le=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&le(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 Ft(e){return e===void 0}function jO(e){return e===null}function le(e){return Ft(e)||jO(e)}var ce=class{constructor(e={}){Ne(this,"value");this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t||(VO(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function VO(e){return Ft(e)||Zl(e)}function Zl(e){return typeof e=="boolean"}var ee=class{constructor(e={}){Ne(this,"value");this.config=e,this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t||(LO(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 LO(e){return Ft(e)||tx(e)}function tx(e){return typeof e=="number"&&!Number.isNaN(e)}var UO=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,M=class{constructor(e={}){Ne(this,"value");Ne(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Le(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:a,ISODate:o}=this.config,i=this.value.validate(e);if(i)return i;if(Ft(e))return null;if(!Ci(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}`:a&&!a.includes(e)?`value should be one of: ${a.join(", ")}.`:o&&!(UO.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 Ci(e){return Object.prototype.toString.call(e)==="[object String]"}var J=class{constructor(e={}){Ne(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Ft(e))return this.config.options.required?"value is required and is currently undefined":null;if(!rx(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&le(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let a=e[r],o=n.validate(a);o!==null&&(t+=` ${o}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function rx(e){return e!==void 0&&typeof e=="object"}var oe=class{constructor(e={}){Ne(this,"value");this.config=e,this.value=new Le(this.config)}validate(e){if(!le(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(le(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&&le(n)&&(r=`value is null or undefined: ${e.join(",")}`);let a=this.validatePrimitiveValue(n,this.config.each);a!==null&&(r+=` ${a}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Zl(e)||Ci(e)||tx(e)||rx(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function bi(e){return Array.isArray(e)}var Pu=class{constructor(e){Ne(this,"value");this.config=e,this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Ft(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();var da=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function ed(e){return Array.isArray(e)}function td(e){return e.trim()===""}function nx(e,t){return[...e.reduce((r,n)=>{let a=t(n);return r.has(a)||r.set(a,n),r},new Map).values()]}function QO(e){return btoa(encodeURI(e))}function rd(e,t){let{[e]:r,...n}=t;return n}function wi(e){return QO(JSON.stringify(e))}var BO=new Set(["1",1,"yes",!0]);function ax(){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=>BO.has(r))}function ox(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ix(e,t,r){return clearTimeout(t),setTimeout(e,r)}function ku(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function nd(e,t,r={}){let n;return(...a)=>{let o=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,a)},t),o)return e.apply(void 0,a)}}function GO(e){if(td(e.openingDelimiter)||td(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(le(e.content)||td(e.content))return e.content;if(e.highlights.length===0)return Ri(e.content);let t=e.content.length,r="",n=0;for(let a=0;a<e.highlights.length;a++){let o=e.highlights[a],i=o.offset,p=i+o.length;if(p>t)break;r+=Ri(e.content.slice(n,i)),r+=e.openingDelimiter,r+=Ri(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Ri(e.content.slice(n))),r}function Qh(e,t){return e=Ri(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,a,o)=>n?Uh(n,t.notMatchDelimiters):a?Uh(a,t.exactMatchDelimiters):o?Uh(o,t.correctionDelimiters):r)}function Uh(e,t){return t?t.open+e+t.close:e}function Ri(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),a=RegExp(r,"g");return n.test(e)?e.replace(a,o=>t[o]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function cx(_x2,_x3){return _cx.apply(this,arguments)}function _cx(){_cx=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _cx.apply(this,arguments)}function ux(e){let t,r,n,a=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=HO(t,i);let p=t.length,f=0;for(;r<p;){a&&(t[r]===10&&(f=++r),a=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:a=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function lx(e,t,r){let n=sx(),a=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=sx();else if(p>0){let f=a.decode(i.subarray(0,p)),m=p+(i[p+1]===32?2:1),g=a.decode(i.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
27
- ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":$O(g,n,t);break}}}}function $O(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function HO(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function sx(){return{data:"",event:"",id:"",retry:void 0}}var Gh="text/event-stream",zO=1e3,dx="last-event-id";function px(){return typeof window<"u"}function Fi(e,{signal:t,headers:r,onopen:n,onmessage:a,onclose:o,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,A)=>{let x={...r};x.accept||(x.accept=Gh);let h;function C(){h?.abort(),document.hidden||P()}!p&&px()&&document.addEventListener("visibilitychange",C);let R=zO,w;function b(){px()&&document.removeEventListener("visibilitychange",C),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{b(),g()});let F=f??S,E=n??WO;function P(){return _P2.apply(this,arguments)}function _P2(){_P2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let V=yield F(e,{...m,headers:x,signal:h?.signal});yield E(V),yield cx(V.body,ux(lx(_=>{_?x[dx]=_:delete x[dx]},_=>{R=_},a))),o?.(),b(),g()}catch(V){if(!h?.signal?.aborted)try{let _=i?.(V)??R;clearTimeout(w),w=setTimeout(P,_)}catch(_){b(),A(_)}}});return _P2.apply(this,arguments)}P()})}function WO(e){let t=e.headers.get("content-type");if(!t?.startsWith(Gh))throw new Error(`Expected content-type to be ${Gh}, Actual: ${t}`)}d();c();l();u();var pa=class{constructor(t){Ne(this,"_basePath");Ne(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var KO=(e,t,r)=>new pa(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,fx=3,YO=5e3,JO="text/event-stream",zh=1,$h=class extends Error{},Ou=class extends Error{constructor(r){super(r.message);this.payload=r}},Hh=class{constructor(){Ne(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},ad=class{constructor(t){Ne(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:a,streamId:o,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,A=new Hh;if(!o){this.logger.error("No stream ID found");return}let x=0,h,C=()=>{h&&!A.isActive(h)&&(w?.abort(),g(),b())},R=()=>{A.remove(h),h=ix(C,h,YO),A.add(h)},w=new s.AbortController,b=()=>Fi(KO(n,a,o),{method:"GET",fetch:S,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(F){return _asyncToGenerator(function*(){if(F.ok&&F.headers.get("content-type")===JO)return;throw F.status>=400&&F.status<500&&F.status!==429?new Ou({message:"Error opening stream",code:F.status}):new $h})()},onmessage:F=>{if(w?.signal.aborted)return;let E=JSON.parse(F.data);if(E.finishReason==="ERROR"){A.remove(h),w?.abort(),f({message:E.errorMessage,code:E.statusCode});return}p(E),x=0,E.finishReason==="COMPLETED"?(A.remove(h),m()):R()},onerror:F=>{if(!w?.signal.aborted){if(A.remove(h),F instanceof Ou)throw w?.abort(),f(F),F;if(++x>fx){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:zh};throw w?.abort(),f(E),new Ou(E)}this.logger.info(`Retrying...(${x}/${fx})`),g()}}});return b(),w}};d();c();l();u();var Rx=Or(xx(),1);d();c();l();u();var W=new Error("Failed to load reducers."),Ei=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."}},co=class extends Error{constructor(r,n){super();Ne(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function Cx(e){let t=[];for(let r in e){let n=encodeURIComponent(r),a=encodeURIComponent(e[r]);t.push(`${n}=${a}`)}return t.join("&")}function bx(e){return typeof e!="object"||!e?!1:Object.values(e).every(bN)}function bN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function wx(e){return e===429}var Nr=class e{static call(t){return _asyncToGenerator(function*(){let r=wN(t),{logger:n}=t,a=yield e.preprocessRequest(r,t);n.info(a,"Platform request");let{url:o,...i}=a,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield S(o,i);if(wx(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,Rx.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&wx(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(A=>setTimeout(A,1e3))),g});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Ei;case 404:throw new co(o,f.status);default:return n.info({response:f,requestInfo:a},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new co(o):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:a,logger:o,requestMetadata:i}=r,{signal:p,...f}=t,m=ku(f);try{let g=yield a(t,n,i);return{...t,...g}}catch(g){o.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function it(e,t="prod",r="platform"){let n=t==="prod"?"":t,a=r==="platform"?"":`.${r}`;return`https://${e}${a}.org${n}.coveo.com`}function ut(e,t="prod"){return`${it(e,t)}/rest/search/v2`}function id(e,t="prod"){return`${it(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function wN(e){let{url:t,method:r,requestParams:n,contentType:a,accessToken:o,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=RN(n,a);return{url:t,method:r,headers:{"Content-Type":a,Authorization:`Bearer ${o}`,...e.headers},...(p&&{body:f}),signal:i}}function RN(e,t){return t==="application/x-www-form-urlencoded"?bx(e)?Cx(e):"":JSON.stringify(e)}d();c();l();u();var sd=e=>e;d();c();l();u();d();c();l();u();function Ii(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function nr(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Ii(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Ii(),extendedResults:{},searchAction:void 0}}d();c();l();u();function fa(e){let{url:t,accessToken:r,organizationId:n,authentication:a,...o}=e;return o}var ma=e=>{let{response:t}=e;return t.body?FN(e):EN(t)},FN=e=>TN(e)?PN(e):IN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},EN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function IN(e){return e.body.statusCode!==void 0}function TN(e){return e.body.exception!==void 0}var PN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var ga=class{constructor(){Ne(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let a=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(a?.signal??null)}finally{_this.currentAbortController===a&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();function Fx(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var _n=(e,t,r,n)=>{let a=new pa(`${e.url}${n}`);return a.addParam("organizationId",e.organizationId),e.authentication&&a.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:a.href,origin:"searchApiFetch"}};var Ex=(e,t)=>{let r=new pa(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},Ix=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Nr.call({..._n(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:fa(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Fx(r),a=yield r.arrayBuffer(),i=new TextDecoder(n).decode(a);return kN(i)?{success:i}:{error:ma({response:r,body:i})}});return function Ix(_x5,_x6){return _ref3.apply(this,arguments)}}();function kN(e){return typeof e=="string"}d();c();l();u();function ON(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function NN(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function cd(e,t){if(t&&e.name==="AbortError")return{error:NN(e)};if(e instanceof co)return{error:ON(e)};throw e}var ud=class{constructor(t){this.options=t;Ne(this,"apiCallsQueues",{unknown:new ga,mainSearch:new ga,facetValues:new ga,foldingCollection:new ga,instantResults:new ga})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Nr.call({..._n(t,"POST","application/json","/plan"),requestParams:fa(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return cd(r);let n=yield r.json();return DN(n)?{success:n}:{error:ma({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Nr.call({..._n(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:fa(t),..._this3.options});if(r instanceof Error)return cd(r);let n=yield r.json(),a={response:r,body:n};return _N(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(a)).body}:{error:ma(a)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",a=yield _this4.apiCallsQueues[n].enqueue(p=>Nr.call({..._n(t,"POST","application/json",""),requestParams:fa(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(a instanceof Error)return cd(a,r?.disableAbortWarning);let o=yield a.json(),i={response:a,body:o};return Tx(o)?(i.body=Px(o),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:ma(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Nr.call({..._n(t,"POST","application/json","/facet"),requestParams:fa(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),a={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(a)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Nr.call({..._n(t,"POST","application/json",""),requestParams:fa(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Tx(n)){let a={response:r,body:n};return a.body=Px(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(a)).body}}return{error:ma({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return Ix(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Nr.call({..._n(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return qN(n)?{success:n}:{error:ma({response:r,body:n})}})()}},ld=e=>e.success!==void 0,yt=e=>e.error!==void 0;function Tx(e){return e.results!==void 0}function Px(e){let t=Ii();return le(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function _N(e){return e.completions!==void 0}function DN(e){return e.preprocessingOutput!==void 0}function qN(e){return e.fields!==void 0}d();c();l();u();var kx=e=>e,Ox=e=>e,Nx=e=>e;d();c();l();u();d();c();l();u();var z=new M({required:!0,emptyAllowed:!1}),st=new M({required:!1,emptyAllowed:!1}),Ue=new M({required:!0,emptyAllowed:!0}),bW=new M({required:!1,emptyAllowed:!0}),dd=new oe({each:z,required:!0}),_x=new M({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Dx=new M({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),wW=new M({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Dn=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),dr=(e,t)=>{if("required"in t)return{payload:new ge({value:t}).validate({value:e}).value};let a=new J({options:{required:!0},values:t}).validate(e);if(a)throw new Tu(a);return{payload:e}},O=(e,t)=>{try{return dr(e,t)}catch(r){return{payload:e,error:Dn(r)}}},lt=(e,t,r,n)=>{let a=`Check the initialState of ${n}`;return qx(e,t,r,a,"Controller initialization error")},Be=(e,t,r,n)=>{let a=`Check the options of ${n}`;return qx(e,t,r,a,"Controller initialization error")},qx=(e,t,r,n,a)=>{try{return t.validate(r,n)}catch(o){throw e.logger.error(o,a),o}};d();c();l();u();d();c();l();u();d();c();l();u();function Et(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 MN=typeof Symbol=="function"&&Symbol.observable||"@@observable",Mx=MN,ry=()=>Math.random().toString(36).substring(7).split("").join("."),jN={INIT:`@@redux/INIT${ry()}`,REPLACE:`@@redux/REPLACE${ry()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ry()}`},pd=jN;function Br(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ny(e,t,r){if(typeof e!="function")throw new Error(Et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Et(1));return r(ny)(e,t)}let n=e,a=t,o=new Map,i=o,p=0,f=!1;function m(){i===o&&(i=new Map,o.forEach((w,b)=>{i.set(b,w)}))}function g(){if(f)throw new Error(Et(3));return a}function A(w){if(typeof w!="function")throw new Error(Et(4));if(f)throw new Error(Et(5));let b=!0;m();let F=p++;return i.set(F,w),function(){if(b){if(f)throw new Error(Et(6));b=!1,m(),i.delete(F),o=null}}}function x(w){if(!Br(w))throw new Error(Et(7));if(typeof w.type>"u")throw new Error(Et(8));if(typeof w.type!="string")throw new Error(Et(17));if(f)throw new Error(Et(9));try{f=!0,a=n(a,w)}finally{f=!1}return(o=i).forEach(F=>{F()}),w}function h(w){if(typeof w!="function")throw new Error(Et(10));n=w,x({type:pd.REPLACE})}function C(){let w=A;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(Et(11));function F(){let P=b;P.next&&P.next(g())}return F(),{unsubscribe:w(F)}},[Mx](){return this}}}return x({type:pd.INIT}),{dispatch:x,subscribe:A,getState:g,replaceReducer:h,[Mx]:C}}function VN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:pd.INIT})>"u")throw new Error(Et(12));if(typeof r(void 0,{type:pd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Et(13))})}function Ti(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),a,o;try{VN(r)}catch(i){o=i}return function(p={},f){if(o)throw o;let m=!1,g={};for(let A=0;A<n.length;A++){let x=n[A],h=r[x],C=p[x],R=h(C,f);if(typeof R>"u"){let w=f&&f.type;throw new Error(Et(14))}g[x]=R,m=m||R!==C}return m=m||n.length!==Object.keys(p).length,m?g:p}}function Pi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function jx(...e){return t=>(r,n)=>{let a=t(r,n),o=()=>{throw new Error(Et(15))},i={getState:a.getState,dispatch:(f,...m)=>o(f,...m)},p=e.map(f=>f(i));return o=Pi(...p)(a.dispatch),{...a,dispatch:o}}}function ki(e){return Br(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var fy=Symbol.for("immer-nothing"),Du=Symbol.for("immer-draftable"),Ht=Symbol.for("immer-state");function It(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Oi=Object.getPrototypeOf;function ar(e){return!!e&&!!e[Ht]}function zt(e){return e?Gx(e)||Array.isArray(e)||!!e[Du]||!!e.constructor?.[Du]||Ni(e)||Uu(e):!1}var LN=Object.prototype.constructor.toString(),Vx=new WeakMap;function Gx(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Vx.get(r);return n===void 0&&(n=Function.toString.call(r),Vx.set(r,n)),n===LN}function my(e){return ar(e)||It(15,e),e[Ht].base_}function qu(e,t,r=!0){lo(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function lo(e){let t=e[Ht];return t?t.type_:Array.isArray(e)?1:Ni(e)?2:Uu(e)?3:0}function Mu(e,t){return lo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ay(e,t){return lo(e)===2?e.get(t):e[t]}function $x(e,t,r){let n=lo(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function UN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ni(e){return e instanceof Map}function Uu(e){return e instanceof Set}function uo(e){return e.copy_||e.base_}function sy(e,t){if(Ni(e))return new Map(e);if(Uu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Gx(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ht];let a=Reflect.ownKeys(n);for(let o=0;o<a.length;o++){let i=a[o],p=n[i];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[i]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[i]})}return Object.create(Oi(e),n)}else{let n=Oi(e);if(n!==null&&r)return{...e};let a=Object.create(n);return Object.assign(a,e)}}function hd(e,t=!1){return yd(e)||ar(e)||!zt(e)||(lo(e)>1&&Object.defineProperties(e,{set:fd,add:fd,clear:fd,delete:fd}),Object.freeze(e),t&&Object.values(e).forEach(r=>hd(r,!0))),e}function QN(){It(2)}var fd={value:QN};function yd(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var cy={};function po(e){let t=cy[e];return t||It(0,e),t}function BN(e,t){cy[e]||(cy[e]=t)}var ju;function Hx(){return ju}function GN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Lx(e,t){t&&(po("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function uy(e){ly(e),e.drafts_.forEach($N),e.drafts_=null}function ly(e){e===ju&&(ju=e.parent_)}function Ux(e){return ju=GN(ju,e)}function $N(e){let t=e[Ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Qx(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ht].modified_&&(uy(t),It(4)),zt(e)&&(e=md(t,e),t.parent_||gd(t,e)),t.patches_&&po("Patches").generateReplacementPatches_(r[Ht].base_,e,t.patches_,t.inversePatches_)):e=md(t,r,[]),uy(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fy?e:void 0}function md(e,t,r){if(yd(t))return t;let n=e.immer_.shouldUseStrictIteration(),a=t[Ht];if(!a)return qu(t,(o,i)=>Bx(e,a,t,o,i,r),n),t;if(a.scope_!==e)return t;if(!a.modified_)return gd(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;let o=a.copy_,i=o,p=!1;a.type_===3&&(i=new Set(o),o.clear(),p=!0),qu(i,(f,m)=>Bx(e,a,o,f,m,r,p),n),gd(e,o,!1),r&&e.patches_&&po("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function Bx(e,t,r,n,a,o,i){if(a==null||typeof a!="object"&&!i)return;let p=yd(a);if(!(p&&!i)){if(ar(a)){let f=o&&t&&t.type_!==3&&!Mu(t.assigned_,n)?o.concat(n):void 0,m=md(e,a,f);if($x(r,n,m),ar(m))e.canAutoFreeze_=!1;else return}else i&&r.add(a);if(zt(a)&&!p){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===a&&p)return;md(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Ni(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&gd(e,a)}}}function gd(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hd(t,r)}function HN(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Hx(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},a=n,o=gy;r&&(a=[n],o=Vu);let{revoke:i,proxy:p}=Proxy.revocable(a,o);return n.draft_=p,n.revoke_=i,p}var gy={get(e,t){if(t===Ht)return e;let r=uo(e);if(!Mu(r,t))return zN(e,r,t);let n=r[t];return e.finalized_||!zt(n)?n:n===oy(e.base_,t)?(iy(e),e.copy_[t]=py(n,e)):n},has(e,t){return t in uo(e)},ownKeys(e){return Reflect.ownKeys(uo(e))},set(e,t,r){let n=zx(uo(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let a=oy(uo(e),t),o=a?.[Ht];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(UN(r,a)&&(r!==void 0||Mu(e.base_,t)))return!0;iy(e),dy(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return oy(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,iy(e),dy(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=uo(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){It(11)},getPrototypeOf(e){return Oi(e.base_)},setPrototypeOf(){It(12)}},Vu={};qu(gy,(e,t)=>{Vu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Vu.deleteProperty=function(e,t){return Vu.set.call(this,e,t,void 0)};Vu.set=function(e,t,r){return gy.set.call(this,e[0],t,r,e[0])};function oy(e,t){let r=e[Ht];return(r?uo(r):e)[t]}function zN(e,t,r){let n=zx(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function zx(e,t){if(!(t in e))return;let r=Oi(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Oi(r)}}function dy(e){e.modified_||(e.modified_=!0,e.parent_&&dy(e.parent_))}function iy(e){e.copy_||(e.copy_=sy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var WN=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let o=r;r=t;let i=this;return function(f=o,...m){return i.produce(f,g=>r.call(this,g,...m))}}typeof r!="function"&&It(6),n!==void 0&&typeof n!="function"&&It(7);let a;if(zt(t)){let o=Ux(this),i=py(t,void 0),p=!0;try{a=r(i),p=!1}finally{p?uy(o):ly(o)}return Lx(o,n),Qx(a,o)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===fy&&(a=void 0),this.autoFreeze_&&hd(a,!0),n){let o=[],i=[];po("Patches").generateReplacementPatches_(t,a,o,i),n(o,i)}return a}else It(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,a;return[this.produce(t,r,(i,p)=>{n=i,a=p}),n,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zt(e)||It(8),ar(e)&&(e=Wx(e));let t=Ux(this),r=py(e,void 0);return r[Ht].isManual_=!0,ly(t),r}finishDraft(e,t){let r=e&&e[Ht];(!r||!r.isManual_)&&It(9);let{scope_:n}=r;return Lx(n,t),Qx(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 a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));let n=po("Patches").applyPatches_;return ar(e)?n(e,t):this.produce(e,a=>n(a,t))}};function py(e,t){let r=Ni(e)?po("MapSet").proxyMap_(e,t):Uu(e)?po("MapSet").proxySet_(e,t):HN(e,t);return(t?t.scope_:Hx()).drafts_.push(r),r}function Wx(e){return ar(e)||It(10,e),Kx(e)}function Kx(e){if(!zt(e)||yd(e))return e;let t=e[Ht],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=sy(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=sy(e,!0);return qu(r,(a,o)=>{$x(r,a,Kx(o))},n),t&&(t.finalized_=!1),r}function Yx(){let t="replace",r="add",n="remove";function a(x,h,C,R){switch(x.type_){case 0:case 2:return i(x,h,C,R);case 1:return o(x,h,C,R);case 3:return p(x,h,C,R)}}function o(x,h,C,R){let{base_:w,assigned_:b}=x,F=x.copy_;F.length<w.length&&([w,F]=[F,w],[C,R]=[R,C]);for(let E=0;E<w.length;E++)if(b[E]&&F[E]!==w[E]){let P=h.concat([E]);C.push({op:t,path:P,value:A(F[E])}),R.push({op:t,path:P,value:A(w[E])})}for(let E=w.length;E<F.length;E++){let P=h.concat([E]);C.push({op:r,path:P,value:A(F[E])})}for(let E=F.length-1;w.length<=E;--E){let P=h.concat([E]);R.push({op:n,path:P})}}function i(x,h,C,R){let{base_:w,copy_:b}=x;qu(x.assigned_,(F,E)=>{let P=ay(w,F),V=ay(b,F),_=E?Mu(w,F)?t:r:n;if(P===V&&_===t)return;let k=h.concat(F);C.push(_===n?{op:_,path:k}:{op:_,path:k,value:V}),R.push(_===r?{op:n,path:k}:_===n?{op:r,path:k,value:A(P)}:{op:t,path:k,value:A(P)})})}function p(x,h,C,R){let{base_:w,copy_:b}=x,F=0;w.forEach(E=>{if(!b.has(E)){let P=h.concat([F]);C.push({op:n,path:P,value:E}),R.unshift({op:r,path:P,value:E})}F++}),F=0,b.forEach(E=>{if(!w.has(E)){let P=h.concat([F]);C.push({op:r,path:P,value:E}),R.unshift({op:n,path:P,value:E})}F++})}function f(x,h,C,R){C.push({op:t,path:[],value:h===fy?void 0:h}),R.push({op:t,path:[],value:x})}function m(x,h){return h.forEach(C=>{let{path:R,op:w}=C,b=x;for(let V=0;V<R.length-1;V++){let _=lo(b),k=R[V];typeof k!="string"&&typeof k!="number"&&(k=""+k),(_===0||_===1)&&(k==="__proto__"||k==="constructor")&&It(19),typeof b=="function"&&k==="prototype"&&It(19),b=ay(b,k),typeof b!="object"&&It(18,R.join("/"))}let F=lo(b),E=g(C.value),P=R[R.length-1];switch(w){case t:switch(F){case 2:return b.set(P,E);case 3:It(16);default:return b[P]=E}case r:switch(F){case 1:return P==="-"?b.push(E):b.splice(P,0,E);case 2:return b.set(P,E);case 3:return b.add(E);default:return b[P]=E}case n:switch(F){case 1:return b.splice(P,1);case 2:return b.delete(P);case 3:return b.delete(C.value);default:return delete b[P]}default:It(17,w)}}),x}function g(x){if(!zt(x))return x;if(Array.isArray(x))return x.map(g);if(Ni(x))return new Map(Array.from(x.entries()).map(([C,R])=>[C,g(R)]));if(Uu(x))return new Set(Array.from(x).map(g));let h=Object.create(Oi(x));for(let C in x)h[C]=g(x[C]);return Mu(x,Du)&&(h[Du]=x[Du]),h}function A(x){return ar(x)?g(x):x}BN("Patches",{applyPatches_:m,generatePatches_:a,generateReplacementPatches_:f})}var Lu=new WN,qn=Lu.produce,Sd=Lu.produceWithPatches.bind(Lu);var hy=Lu.applyPatches.bind(Lu);d();c();l();u();function KN(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function YN(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function JN(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 Jx=e=>Array.isArray(e)?e:[e];function XN(e){let t=Array.isArray(e[0])?e[0]:e;return JN(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ZN(e,t){let r=[],{length:n}=e;for(let a=0;a<n;a++)r.push(e[a].apply(null,t));return r}var UW=Symbol();var QW=Object.getPrototypeOf({});var e_=class{constructor(e){this.value=e}deref(){return this.value}},t_=typeof WeakRef<"u"?WeakRef:e_,r_=0,Xx=1;function vd(){return{s:r_,v:void 0,o:null,p:null}}function _i(e,t={}){let r=vd(),{resultEqualityCheck:n}=t,a,o=0;function i(){let p=r,{length:f}=arguments;for(let A=0,x=f;A<x;A++){let h=arguments[A];if(typeof h=="function"||typeof h=="object"&&h!==null){let C=p.o;C===null&&(p.o=C=new WeakMap);let R=C.get(h);R===void 0?(p=vd(),C.set(h,p)):p=R}else{let C=p.p;C===null&&(p.p=C=new Map);let R=C.get(h);R===void 0?(p=vd(),C.set(h,p)):p=R}}let m=p,g;if(p.s===Xx)g=p.v;else if(g=e.apply(null,arguments),o++,n){let A=a?.deref?.()??a;A!=null&&n(A,g)&&(g=A,o!==0&&o--),a=typeof g=="object"&&g!==null||typeof g=="function"?new t_(g):g}return m.s=Xx,m.v=g,g}return i.clearCache=()=>{r=vd(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function Zx(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...a)=>{let o=0,i=0,p,f={},m=a.pop();typeof m=="object"&&(f=m,m=a.pop()),KN(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:A,memoizeOptions:x=[],argsMemoize:h=_i,argsMemoizeOptions:C=[],devModeChecks:R={}}=g,w=Jx(x),b=Jx(C),F=XN(a),E=A(function(){return o++,m.apply(null,arguments)},...w),P=!0,V=h(function(){i++;let k=ZN(F,arguments);return p=E.apply(null,k),p},...b);return Object.assign(V,{resultFunc:m,memoizedResultFunc:E,dependencies:F,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:A,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var Ye=Zx(_i),n_=Object.assign((e,t=Ye)=>{YN(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(o=>e[o]);return t(n,(...o)=>o.reduce((i,p,f)=>(i[r[f]]=p,i),{}))},{withTypes:()=>n_});d();c();l();u();function eC(e){return({dispatch:r,getState:n})=>a=>o=>typeof o=="function"?o(r,n,e):a(o)}var tC=eC(),rC=eC;var a_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pi:Pi.apply(null,arguments)},i4=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},o_=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let a=t(...n);if(!a)throw new Error(Bt(0));return{type:e,payload:a.payload,...("meta"in a&&{meta:a.meta}),...("error"in a&&{error:a.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>ki(n)&&n.type===e,r}var lC=class Qu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Qu.prototype)}static get[Symbol.species](){return Qu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Qu(...t[0].concat(this)):new Qu(...t.concat(this))}};function nC(e){return zt(e)?qn(e,()=>{}):e}function aC(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function i_(e){return typeof e=="boolean"}var s_=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:o=!0}=t??{},i=new lC;return r&&(i_(r)?i.push(tC):i.push(rC(r.extraArgument))),i},Bu="RTK_autoBatch",Mi=()=>e=>({payload:e,meta:{[Bu]:!0}}),oC=e=>t=>{setTimeout(t,e)},c_=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),a=!0,o=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:oC(10):e.type==="callback"?e.queueNotification:oC(e.timeout),m=()=>{i=!1,o&&(o=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let A=()=>a&&g(),x=n.subscribe(A);return p.add(g),()=>{x(),p.delete(g)}},dispatch(g){try{return a=!g?.meta?.[Bu],o=!a,o&&(i||(i=!0,f(m))),n.dispatch(g)}finally{a=!0}}})},u_=e=>function(r){let{autoBatch:n=!0}=r??{},a=new lC(e);return n&&a.push(c_(typeof n=="object"?n:void 0)),a};function dC(e){let t=s_(),{reducer:r=void 0,middleware:n,devTools:a=!0,preloadedState:o=void 0,enhancers:i=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Br(r))p=Ti(r);else throw new Error(Bt(1));let f;typeof n=="function"?f=n(t):f=t();let m=Pi;a&&(m=a_({trace:!1,...(typeof a=="object"&&a)}));let g=jx(...f),A=u_(g),x=typeof i=="function"?i(A):A(),h=m(...x);return ny(p,o,h)}function pC(e){let t={},r=[],n,a={addCase(o,i){let p=typeof o=="string"?o:o.type;if(!p)throw new Error(Bt(28));if(p in t)throw new Error(Bt(29));return t[p]=i,a},addMatcher(o,i){return r.push({matcher:o,reducer:i}),a},addDefaultCase(o){return n=o,a}};return e(a),[t,r,n]}function l_(e){return typeof e=="function"}function ae(e,t){let[r,n,a]=pC(t),o;if(l_(e))o=()=>nC(e());else{let p=nC(e);o=()=>p}function i(p=o(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[a]),m.reduce((g,A)=>{if(A)if(ar(g)){let h=A(g,f);return h===void 0?g:h}else{if(zt(g))return qn(g,x=>A(x,f));{let x=A(g,f);if(x===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return g},p)}return i.getInitialState=o,i}var fC=(e,t)=>o_(e)?e.match(t):e(t);function Gr(...e){return t=>e.some(r=>fC(r,t))}function qi(...e){return t=>e.every(r=>fC(r,t))}function bd(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 Gu(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function wd(...e){return e.length===0?t=>bd(t,["pending"]):Gu(e)?Gr(...e.map(t=>t.pending)):wd()(e[0])}function go(...e){return e.length===0?t=>bd(t,["rejected"]):Gu(e)?Gr(...e.map(t=>t.rejected)):go()(e[0])}function $u(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?qi(go(...e),t):Gu(e)?qi(go(...e),t):$u()(e[0])}function Mn(...e){return e.length===0?t=>bd(t,["fulfilled"]):Gu(e)?Gr(...e.map(t=>t.fulfilled)):Mn()(e[0])}function Rd(...e){return e.length===0?t=>bd(t,["pending","fulfilled","rejected"]):Gu(e)?Gr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Rd()(e[0])}var d_="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Hu=(e=21)=>{let t="",r=e;for(;r--;)t+=d_[Math.random()*64|0];return t},p_=["name","message","stack","code"],yy=class{constructor(e,t){Ne(this,"_type");this.payload=e,this.meta=t}},iC=class{constructor(e,t){Ne(this,"_type");this.payload=e,this.meta=t}},f_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of p_)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Se=(()=>{function e(t,r,n){let a=T(t+"/fulfilled",(f,m,g,A)=>({payload:f,meta:{...(A||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),o=T(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=T(t+"/rejected",(f,m,g,A,x)=>({payload:A,error:(n&&n.serializeError||f_)(f||"Rejected"),meta:{...(x||{}),arg:g,requestId:m,rejectedWithValue:!!A,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f){return(m,g,A)=>{let x=n?.idGenerator?n.idGenerator(f):Hu(),h=new s.AbortController,C,R;function w(F){R=F,h.abort()}let b=_asyncToGenerator(function*(){let F;try{let P=n?.condition?.(f,{getState:g,extra:A});if(g_(P)&&(P=yield P),P===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let V=new Promise((_,k)=>{C=()=>{k({name:"AbortError",message:R||"Aborted"})},h.signal.addEventListener("abort",C)});m(o(x,f,n?.getPendingMeta?.({requestId:x,arg:f},{getState:g,extra:A}))),F=yield Promise.race([V,Promise.resolve(r(f,{dispatch:m,getState:g,extra:A,requestId:x,signal:h.signal,abort:w,rejectWithValue:(_,k)=>new yy(_,k),fulfillWithValue:(_,k)=>new iC(_,k)})).then(_=>{if(_ instanceof yy)throw _;return _ instanceof iC?a(_.payload,x,f,_.meta):a(_,x,f)})])}catch(P){F=P instanceof yy?i(null,x,f,P.payload,P.meta):i(P,x,f)}finally{C&&h.signal.removeEventListener("abort",C)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||m(F),F})();return Object.assign(b,{abort:w,requestId:x,arg:f,unwrap(){return b.then(m_)}})}}return Object.assign(p,{pending:o,rejected:i,fulfilled:a,settled:Gr(i,a),typePrefix:t})}return e.withTypes=()=>e,e})();function m_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function g_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var mC=Symbol.for("rtk-slice-createasyncthunk"),d4={[mC]:Se};function h_(e,t){return`${e}/${t}`}function y_({creators:e}={}){let t=e?.asyncThunk?.[mC];return function(n){let{name:a,reducerPath:o=a}=n;if(!a)throw new Error(Bt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(v_()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(F,E){let P=typeof F=="string"?F:F.type;if(!P)throw new Error(Bt(12));if(P in f.sliceCaseReducersByType)throw new Error(Bt(13));return f.sliceCaseReducersByType[P]=E,m},addMatcher(F,E){return f.sliceMatchers.push({matcher:F,reducer:E}),m},exposeAction(F,E){return f.actionCreators[F]=E,m},exposeCaseReducer(F,E){return f.sliceCaseReducersByName[F]=E,m}};p.forEach(F=>{let E=i[F],P={reducerName:F,type:h_(a,F),createNotation:typeof n.reducers=="function"};x_(E)?b_(P,E,m,t):A_(P,E,m)});function g(){let[F={},E=[],P=void 0]=typeof n.extraReducers=="function"?pC(n.extraReducers):[n.extraReducers],V={...F,...f.sliceCaseReducersByType};return ae(n.initialState,_=>{for(let k in V)_.addCase(k,V[k]);for(let k of f.sliceMatchers)_.addMatcher(k.matcher,k.reducer);for(let k of E)_.addMatcher(k.matcher,k.reducer);P&&_.addDefaultCase(P)})}let A=F=>F,x=new Map,h;function C(F,E){return h||(h=g()),h(F,E)}function R(){return h||(h=g()),h.getInitialState()}function w(F,E=!1){function P(_){let k=_[F];return typeof k>"u"&&E&&(k=R()),k}function V(_=A){let k=aC(x,E,()=>new WeakMap);return aC(k,_,()=>{let N={};for(let[q,U]of Object.entries(n.selectors??{}))N[q]=S_(U,_,R,E);return N})}return{reducerPath:F,getSelectors:V,get selectors(){return V(P)},selectSlice:P}}let b={name:a,reducer:C,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:R,...w(o),injectInto(F,{reducerPath:E,...P}={}){let V=E??o;return F.inject({reducerPath:V,reducer:C},P),{...b,...w(V,!0)}}};return b}}function S_(e,t,r,n){function a(o,...i){let p=t(o);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return a.unwrapped=e,a}var ho=y_();function v_(){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 A_({type:e,reducerName:t,createNotation:r},n,a){let o,i;if("reducer"in n){if(r&&!C_(n))throw new Error(Bt(17));o=n.reducer,i=n.prepare}else o=n;a.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?T(e,i):T(e))}function x_(e){return e._reducerDefinitionType==="asyncThunk"}function C_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function b_({type:e,reducerName:t},r,n,a){if(!a)throw new Error(Bt(18));let{payloadCreator:o,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,A=a(e,o,g);n.exposeAction(t,A),i&&n.addCase(A.fulfilled,i),p&&n.addCase(A.pending,p),f&&n.addCase(A.rejected,f),m&&n.addMatcher(A.settled,m),n.exposeCaseReducer(t,{fulfilled:i||Ad,pending:p||Ad,rejected:f||Ad,settled:m||Ad})}function Ad(){}var w_="task",gC="listener",hC="completed",Ay="cancelled",R_=`task-${Ay}`,F_=`task-${hC}`,Sy=`${gC}-${Ay}`,E_=`${gC}-${hC}`,Fd=class{constructor(e){Ne(this,"name","TaskAbortError");Ne(this,"message");this.code=e,this.message=`${w_} ${Ay} (reason: ${e})`}},xy=(e,t)=>{if(typeof e!="function")throw new TypeError(Bt(32))},xd=()=>{},yC=(e,t=xd)=>(e.catch(t),e),SC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),fo=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},mo=e=>{if(e.aborted){let{reason:t}=e;throw new Fd(t)}};function vC(e,t){let r=xd;return new Promise((n,a)=>{let o=()=>a(new Fd(e.reason));if(e.aborted){o();return}r=SC(e,o),t.finally(()=>r()).then(n,a)}).finally(()=>{r=xd})}var I_=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Fd?"cancelled":"rejected",error:r}}finally{t?.()}});return function I_(_x7,_x8){return _ref5.apply(this,arguments)}}(),Cd=e=>t=>yC(vC(e,t).then(r=>(mo(e),r))),AC=e=>{let t=Cd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Di}=Object,sC={},Ed="listenerMiddleware",T_=(e,t)=>{let r=n=>SC(e,()=>fo(n,e.reason));return(n,a)=>{xy(n,"taskExecutor");let o=new s.AbortController;r(o);let i=I_(/*#__PURE__*/_asyncToGenerator(function*(){mo(e),mo(o.signal);let p=yield n({pause:Cd(o.signal),delay:AC(o.signal),signal:o.signal});return mo(o.signal),p}),()=>fo(o,F_));return a?.autoJoin&&t.push(i.catch(xd)),{result:Cd(e)(i),cancel(){fo(o,R_)}}}},P_=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,a){mo(t);let o=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(A,x)=>{x.unsubscribe(),f([A,x.getState(),x.getOriginalState()])}});o=()=>{g(),m()}})];a!=null&&p.push(new Promise(f=>setTimeout(f,a,null)));try{let f=yield vC(t,Promise.race(p));return mo(t),f}finally{o()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,a)=>yC(r(n,a))},xC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:a,effect:o}=e;if(t)a=T(t).match;else if(r)t=r.type,a=r.match;else if(n)a=n;else if(!a)throw new Error(Bt(21));return xy(o,"options.listener"),{predicate:a,type:t,effect:o}},CC=Di(e=>{let{type:t,predicate:r,effect:n}=xC(e);return{id:Hu(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Bt(22))}}},{withTypes:()=>CC}),cC=(e,t)=>{let{type:r,effect:n,predicate:a}=xC(t);return Array.from(e.values()).find(o=>(typeof r=="string"?o.type===r:o.predicate===a)&&o.effect===n)},vy=e=>{e.pending.forEach(t=>{fo(t,Sy)})},k_=e=>()=>{e.forEach(vy),e.clear()},uC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},bC=Di(T(`${Ed}/add`),{withTypes:()=>bC}),O_=T(`${Ed}/removeAll`),wC=Di(T(`${Ed}/remove`),{withTypes:()=>wC}),N_=(...e)=>{console.error(`${Ed}/error`,...e)},RC=(e={})=>{let t=new Map,{extra:r,onError:n=N_}=e;xy(n,"onError");let a=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),A=>{g.unsubscribe(),A?.cancelActive&&vy(g)}),o=g=>{let A=cC(t,g)??CC(g);return a(A)};Di(o,{withTypes:()=>o});let i=g=>{let A=cC(t,g);return A&&(A.unsubscribe(),g.cancelActive&&vy(A)),!!A};Di(i,{withTypes:()=>i});let p=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,A,x,h){let C=new s.AbortController,R=P_(o,C.signal),w=[];try{g.pending.add(C),yield Promise.resolve(g.effect(A,Di({},x,{getOriginalState:h,condition:(b,F)=>R(b,F).then(Boolean),take:R,delay:AC(C.signal),pause:Cd(C.signal),extra:r,signal:C.signal,fork:T_(C.signal,w),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((b,F,E)=>{b!==C&&(fo(b,Sy),E.delete(b))})},cancel:()=>{fo(C,Sy),g.pending.delete(C)},throwIfCancelled:()=>{mo(C.signal)}})))}catch(b){b instanceof Fd||uC(n,b,{raisedBy:"effect"})}finally{yield Promise.all(w),fo(C,E_),g.pending.delete(C)}});return function p(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),f=k_(t);return{middleware:g=>A=>x=>{if(!ki(x))return A(x);if(bC.match(x))return o(x.payload);if(O_.match(x)){f();return}if(wC.match(x))return i(x.payload);let h=g.getState(),C=()=>{if(h===sC)throw new Error(Bt(23));return h},R;try{if(R=A(x),t.size>0){let w=g.getState(),b=Array.from(t.values());for(let F of b){let E=!1;try{E=F.predicate(x,w,h)}catch(P){E=!1,uC(n,P,{raisedBy:"predicate"})}E&&p(F,x,g,C)}}}finally{h=sC}return R},startListening:o,stopListening:i,clearListeners:f}};var f4=Symbol.for("rtk-state-proxy-original");function Bt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var FC=/^(?:[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 __(e){return typeof e=="string"&&FC.test(e)}var Cy=__;d();c();l();u();var Tt=[];for(let e=0;e<256;++e)Tt.push((e+256).toString(16).slice(1));function EC(e,t=0){return(Tt[e[t+0]]+Tt[e[t+1]]+Tt[e[t+2]]+Tt[e[t+3]]+"-"+Tt[e[t+4]]+Tt[e[t+5]]+"-"+Tt[e[t+6]]+Tt[e[t+7]]+"-"+Tt[e[t+8]]+Tt[e[t+9]]+"-"+Tt[e[t+10]]+Tt[e[t+11]]+Tt[e[t+12]]+Tt[e[t+13]]+Tt[e[t+14]]+Tt[e[t+15]]).toLowerCase()}d();c();l();u();var by,D_=new Uint8Array(16);function wy(){if(!by){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");by=crypto.getRandomValues.bind(crypto)}return by(D_)}d();c();l();u();d();c();l();u();var q_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ry={randomUUID:q_};function M_(e,t,r){e=e||{};let n=e.random??e.rng?.()??wy();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 a=0;a<16;++a)t[r+a]=n[a];return t}return EC(n)}function j_(e,t,r){return Ry.randomUUID&&!t&&!e?Ry.randomUUID():M_(e,t,r)}var Fy=j_;d();c();l();u();function IC(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function V_({config:e,environment:t,event:r,listenerManager:n}){let{url:a,token:o,mode:i}=e;i!=="disabled"&&(n.call(r),t.send(a,o,r))}var TC="visitorId";function L_(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(TC),a=n&&Cy(n)?n:t.generateUUID();return r.setItem(TC,a),a}}}var _C="1.2.15",Ey=128,DC=192,PC=224,kC=240,U_=248;function Q_(e){return(e&U_)===kC?4:(e&kC)===PC?3:(e&PC)===DC?2:1}function B_(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&Ey)!=Ey)break;if(r-=3,(n&DC)!=Ey){t-r>=Q_(n)*3&&(r=t);break}}return e.substring(0,r)}function G_(e){let{trackingId:t}=e;return{trackingId:t}}function $_(e){return(e.source||[]).concat([`relay@${_C}`])}function qC(e,t,r,n){let{getReferrer:a,getLocation:o,getUserAgent:i}=r,p=G_(t),f=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:$_(t),clientId:f,userAgent:i(),referrer:OC(a()),location:OC(o())})}function OC(e){return e!==null?B_(e,1024):null}function H_(e,t,r,n,a){return{...t,meta:qC(e,r,n,a)}}var z_="*";function W_(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function a(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function o(f){if(f===z_)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):o(f)}return{add:n,call:a,remove:p}}function NC({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 K_(e){let t=NC(e);return{get:()=>t,update:r=>{t=NC({...t,...r})}}}var Iy=Y_();function Y_(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,a=document.cookie.split(";");for(let o of a){let i=o.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,a){let o=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+a).toUTCString()}`,p=o?`;domain=${o}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function J_(){return{getItem(e){return Iy.getItem(e)||localStorage.getItem(e)},removeItem(e){Iy.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Iy.setItem(e,t,31556952e3)}}}function X_(){let e=document.referrer;return e===""?null:e}function Ty(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(IC().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>X_(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Fy(),storage:J_()}}function Z_(){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 e0(){return{getItem(){return null},removeItem(){},setItem(){}}}function t0(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:e0()}}function r0(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=t0();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&n0()&&Z_()?Ty():n}function n0(){try{return typeof window=="object"}catch{return!1}}function a0(e){return{get:()=>Object.freeze(r0(e))}}function MC(e){let t=K_(e),r=W_(),n=a0(t),a=L_(n);return{emit:(o,i)=>{let p=t.get(),f=n.get(),m=H_(o,i,p,f,a);return V_({config:p,environment:f,event:m,listenerManager:r})},getMeta:o=>qC(o,t.get(),n.get(),a),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:_C}}d();c();l();u();function jC(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var ha="3.46.1",VC=["@coveo/atomic","@coveo/quantic"];var ji=Ye(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ha}`));var zu=Ye(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ji(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:a,enabled:o},i,p)=>{let f=i0(p);return MC({mode:o?"emit":"disabled",url:a??id(e,t),token:r,trackingId:n??null,source:i,environment:f})}),o0={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},i0=e=>{if(!e)return;let t=e();return{...(jC()?Ty():o0),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function jn(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 a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function j(e,t,r,n){function a(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function p(g){try{m(n.next(g))}catch(A){i(A)}}function f(g){try{m(n.throw(g))}catch(A){i(A)}}function m(g){g.done?o(g.value):a(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var Te;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Te||(Te={}));function Oy(){return typeof window<"u"}function $y(){return typeof navigator<"u"}function Vi(){return typeof document<"u"}function Ny(){try{return typeof localStorage<"u"}catch{return!1}}function s0(){try{return typeof sessionStorage<"u"}catch{return!1}}function ZC(){return $y()&&navigator.cookieEnabled}var c0=[Te.click,Te.custom,Te.search,Te.view],u0=(e,t)=>c0.indexOf(e)!==-1?Object.assign({language:Vi()?document.documentElement.lang:"unknown",userAgent:$y()?navigator.userAgent:"unknown"},t):t,Ku=class e{static set(t,r,n){var a,o,i,p;n&&(o=new Date,o.setTime(o.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?LC(t,r,o):(i=p.split("."),a=i[i.length-2]+"."+i[i.length-1],LC(t,r,o,a))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),a=0;a<n.length;a++){var o=n[a];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function LC(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function l0(){return Ny()?localStorage:ZC()?new Yu:s0()?sessionStorage:new Ui}var Yu=class e{getItem(t){return Ku.get(`${e.prefix}${t}`)}removeItem(t){Ku.erase(`${e.prefix}${t}`)}setItem(t,r,n){Ku.set(`${e.prefix}${t}`,r,n)}};Yu.prefix="coveo_";var _y=class{constructor(){this.cookieStorage=new Yu}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)}},Ui=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Id="__coveo.analytics.history",d0=20,p0=1e3*60,f0=75,kd=class{constructor(t){this.store=t||l0()}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 j(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 j(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Id);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return j(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Id);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Id,JSON.stringify(t.slice(0,d0)))}catch{}}clear(){try{this.store.removeItem(Id)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,a)=>(a.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,f0)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>p0:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:a,value:o}=r;return{name:n,time:a,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:a}=t;return r&&typeof a=="string"&&r.toLowerCase()==="query"&&a.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var m0=(e,t)=>j(void 0,void 0,void 0,function*(){return e===Te.view?(yield g0(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),g0=e=>j(void 0,void 0,void 0,function*(){let t=new kd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Td,h0=new Uint8Array(16);function y0(){if(!Td&&(Td=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Td))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Td(h0)}var S0=/^(?:[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 Od(e){return typeof e=="string"&&S0.test(e)}var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function eb(e,t=0){return Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]}function v0(e){if(!Od(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 A0(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var x0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",C0="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function b0(e,t,r){function n(a,o,i,p){var f;if(typeof a=="string"&&(a=A0(a)),typeof o=="string"&&(o=v0(o)),((f=o)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+a.length);if(m.set(o),m.set(a,o.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let g=0;g<16;++g)i[p+g]=m[g];return i}return eb(m)}try{n.name=e}catch{}return n.DNS=x0,n.URL=C0,n}var w0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),UC={randomUUID:w0};function yo(e,t,r){if(UC.randomUUID&&!t&&!e)return UC.randomUUID();e=e||{};let n=e.random||(e.rng||y0)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let a=0;a<16;++a)t[r+a]=n[a];return t}return eb(n)}function R0(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 Py(e,t){return e<<t|e>>>32-t}function F0(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let p=0;p<i.length;++p)e.push(i.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,a=Math.ceil(n/16),o=new Array(a);for(let i=0;i<a;++i){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];o[i]=p}o[a-1][14]=(e.length-1)*8/Math.pow(2,32),o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<a;++i){let p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=o[i][h];for(let h=16;h<80;++h)p[h]=Py(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],A=r[3],x=r[4];for(let h=0;h<80;++h){let C=Math.floor(h/20),R=Py(f,5)+R0(C,m,g,A)+x+t[C]+p[h]>>>0;x=A,A=g,g=Py(m,30)>>>0,m=f,f=R}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+A>>>0,r[4]=r[4]+x>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var E0=b0("v5",80,F0),QC=E0,tb="2.30.52",BC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Wu={pageview:"pageview",event:"event"},Nd=class{constructor({client:t,uuidGenerator:r=yo}){this.client=t,this.uuidGenerator=r}},Dy=class extends Nd{constructor({client:t,uuidGenerator:r=yo}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=BC(window.location),this.lastReferrer=Vi()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:Vi()?document.title:"",encoding:Vi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},a={language:navigator.language,userAgent:navigator.userAgent},o={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},o),n),a),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:a,location:o}=this.getNextValues(t,r);this.lastReferrer=a,this.pageViewId=n,this.currentLocation=o,t===Wu.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Wu.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Wu.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Wu.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=a=>a.replace(/^\/?(.*)$/,"/$1");return`${(a=>a.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return BC(window.location)}},ya=class e{constructor(t,r){if(!Od(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(a=>new RegExp(a.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,a]=r;if(n.length!==32||isNaN(parseInt(a)))return null;let o=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Od(o)?new e(o,Number.parseInt(a)*1e3):null}};ya.cvo_cid="cvo_cid";ya.expirationTime=120;var qy=class extends Nd{constructor({client:t,uuidGenerator:r=yo}){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 j(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(ya.cvo_cid,new ya(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};qy.Id="link";var fr=Object.keys;function Pd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ky=128,rb=192,GC=224,$C=240;function I0(e){return(e&248)===$C?4:(e&$C)===GC?3:(e&GC)===rb?2:1}function T0(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&ky)!=ky)break;if(r-=3,(n&rb)!=ky){t-r>=I0(n)*3&&(r=t);break}}return e.substring(0,r)}var My={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"},P0=fr(My).map(e=>My[e]),k0=[...P0].join("|"),O0=new RegExp(`^(${k0}$)`),N0={svcAction:"svc_action",svcActionData:"svc_action_data"},_0=e=>fr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=My[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),D0=e=>O0.test(e),q0=[D0],HC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},zC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},_t={action:"pa",list:"pal",listSource:"pls"},_d={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},M0=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],jy={id:"quoteId",affiliation:"quoteAffiliation"},Vy={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},j0={add:_t,bookmark_add:_t,bookmark_remove:_t,click:_t,checkout:_t,checkout_option:_t,detail:_t,impression:_t,remove:_t,refund:Object.assign(Object.assign({},_t),_d),purchase:Object.assign(Object.assign({},_t),_d),quickview:_t,quote:Object.assign(Object.assign({},_t),jy),review:Object.assign(Object.assign({},_t),Vy)},V0=fr(HC).map(e=>HC[e]),L0=fr(zC).map(e=>zC[e]),U0=fr(_t).map(e=>_t[e]),Q0=fr(_d).map(e=>_d[e]),B0=fr(Vy).map(e=>Vy[e]),G0=fr(jy).map(e=>jy[e]),$0=[...V0,"custom"].join("|"),H0=[...L0,"custom"].join("|"),nb="(pr[0-9]+)",ab="(il[0-9]+pi[0-9]+)",z0=new RegExp(`^${nb}(${$0})$`),W0=new RegExp(`^(${ab}(${H0}))|(il[0-9]+nm)$`),K0=new RegExp(`^(${U0.join("|")})$`),Y0=new RegExp(`^(${Q0.join("|")})$`),J0=new RegExp(`^${nb}custom$`),X0=new RegExp(`^${ab}custom$`),Z0=new RegExp(`^(${[...M0,...B0,...G0].join("|")})$`),eD=e=>z0.test(e),tD=e=>W0.test(e),rD=e=>K0.test(e),nD=e=>Y0.test(e),aD=e=>Z0.test(e),oD=[tD,eD,rD,nD,aD],iD=[J0,X0],sD={anonymizeIp:"aip"},cD={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},uD={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},lD=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],dD=Object.assign(Object.assign(Object.assign(Object.assign({},sD),cD),uD),lD.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Ly=Object.assign(Object.assign({},dD),N0),pD=e=>{let t=!!e.action&&j0[e.action]||{};return fr(e).reduce((r,n)=>{let a=t[n]||Ly[n]||n;return Object.assign(Object.assign({},r),{[a]:e[n]})},{})},fD=fr(Ly).map(e=>Ly[e]),mD=e=>fD.indexOf(e)!==-1,gD=e=>e==="custom",hD=e=>[...oD,...q0,mD,gD].some(t=>t(e)),yD=e=>fr(e).reduce((t,r)=>{let n=SD(r);return n?Object.assign(Object.assign({},t),vD(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),SD=e=>{let t;return[...iD].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},vD=(e,t)=>fr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Uy=class{constructor(t){this.opts=t}sendEvent(t,r){return j(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:a}=this.opts,o=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${o}`,r,a),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return j(this,void 0,void 0,function*(){let a=t,o=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;a=p||t;try{o=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:o,url:a}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return j(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,a=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",a?`visitorId=${a}`:"","discardVisitInfo=true"].filter(o=>!!o).join("&")})}isEventTypeLegacy(t){return[Te.click,Te.custom,Te.search,Te.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let a=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(a=`access_token=${encodeURIComponent(n)}&${a}`),a}},Qy=class{sendEvent(t,r){return j(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return j(this,void 0,void 0,function*(){return Promise.resolve()})}},WC=y.fetch,Dd=class{constructor(t){this.opts=t}sendEvent(t,r){return j(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:a,preprocessRequest:o}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),o?yield o(p,"analyticsFetch"):{}),{url:m}=f,g=jn(f,["url"]),A;try{A=yield WC(m,g)}catch(x){console.error("An error has occured when sending the event.",x);return}if(A.ok){let x=yield A.json();return x.visitorId&&a.setCurrentVisitorId(x.visitorId),x}else{try{A.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,A,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return j(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield WC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Te.click,Te.custom,Te.search,Te.view].indexOf(t)!==-1}getVisitorIdParam(){return j(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"})}},By=class{constructor(t,r){Ny()&&ZC()?this.storage=new _y:Ny()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Ui),this.client=new Dd(t),this.beaconClient=new Uy(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:a,payload:o}of n)this.beaconClient.sendEvent(a,o)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Gy=class{constructor(t,r){this.storage=r||new Ui,this.client=new Dd(t)}getClientDependingOnEventType(t){return this.client}},qd=class{constructor(){this.storage=new Ui,this.client=new Qy}getClientDependingOnEventType(t){return this.client}},AD="xx",xD=e=>e?.startsWith(AD)||!1,CD=`
26
+ `;return new hu(r)}var hu=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ge=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw bO(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}},Le=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&ue(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 wt(e){return e===void 0}function RO(e){return e===null}function ue(e){return wt(e)||RO(e)}var ce=class{constructor(e={}){Ne(this,"value");this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t||(wO(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function wO(e){return wt(e)||Ll(e)}function Ll(e){return typeof e=="boolean"}var ee=class{constructor(e={}){Ne(this,"value");this.config=e,this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t||(FO(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 FO(e){return wt(e)||Jx(e)}function Jx(e){return typeof e=="number"&&!Number.isNaN(e)}var EO=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,j=class{constructor(e={}){Ne(this,"value");Ne(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Le(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,i=this.value.validate(e);if(i)return i;if(wt(e))return null;if(!vi(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(EO.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 vi(e){return Object.prototype.toString.call(e)==="[object String]"}var J=class{constructor(e={}){Ne(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(wt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Xx(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ue(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=` ${a}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Xx(e){return e!==void 0&&typeof e=="object"}var ae=class{constructor(e={}){Ne(this,"value");this.config=e,this.value=new Le(this.config)}validate(e){if(!ue(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ue(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&&ue(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 Ll(e)||vi(e)||Jx(e)||Xx(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function xi(e){return Array.isArray(e)}var yu=class{constructor(e){Ne(this,"value");this.config=e,this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t!==null?t:wt(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();var oo=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function Ul(e){return Array.isArray(e)}function Ql(e){return e.trim()===""}function Zx(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function IO(e){return btoa(encodeURI(e))}function Bl(e,t){let{[e]:r,...n}=t;return n}function Ai(e){return IO(JSON.stringify(e))}var TO=new Set(["1",1,"yes",!0]);function eA(){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=>TO.has(r))}function tA(e){let t={};for(let[r,n]of e)t[r]=n;return t}function rA(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Su(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Gl(e,t,r={}){let n;return(...o)=>{let a=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),a)return e.apply(void 0,o)}}function PO(e){if(Ql(e.openingDelimiter)||Ql(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ue(e.content)||Ql(e.content))return e.content;if(e.highlights.length===0)return Ci(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],i=a.offset,p=i+a.length;if(p>t)break;r+=Ci(e.content.slice(n,i)),r+=e.openingDelimiter,r+=Ci(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Ci(e.content.slice(n))),r}function Mh(e,t){return e=Ci(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?qh(n,t.notMatchDelimiters):o?qh(o,t.exactMatchDelimiters):a?qh(a,t.correctionDelimiters):r)}function qh(e,t){return t?t.open+e+t.close:e}function Ci(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function oA(_x2,_x3){return _oA.apply(this,arguments)}function _oA(){_oA=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _oA.apply(this,arguments)}function aA(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=OO(t,i);let p=t.length,f=0;for(;r<p;){o&&(t[r]===10&&(f=++r),o=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function iA(e,t,r){let n=nA(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=nA();else if(p>0){let f=o.decode(i.subarray(0,p)),m=p+(i[p+1]===32?2:1),g=o.decode(i.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
27
+ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":kO(g,n,t);break}}}}function kO(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function OO(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function nA(){return{data:"",event:"",id:"",retry:void 0}}var Vh="text/event-stream",NO=1e3,sA="last-event-id";function cA(){return typeof window<"u"}function $l(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,S)=>{let A={...r};A.accept||(A.accept=Vh);let h;function C(){h?.abort(),document.hidden||P()}!p&&cA()&&document.addEventListener("visibilitychange",C);let w=NO,R;function b(){cA()&&document.removeEventListener("visibilitychange",C),clearTimeout(R),h?.abort()}t?.addEventListener("abort",()=>{b(),g()});let F=f??v,E=n??_O;function P(){return _P2.apply(this,arguments)}function _P2(){_P2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let M=yield F(e,{...m,headers:A,signal:h?.signal});yield E(M),yield oA(M.body,aA(iA(_=>{_?A[sA]=_:delete A[sA]},_=>{w=_},o))),a?.(),b(),g()}catch(M){if(!h?.signal?.aborted)try{let _=i?.(M)??w;clearTimeout(R),R=setTimeout(P,_)}catch(_){b(),S(_)}}});return _P2.apply(this,arguments)}P()})}function _O(e){let t=e.headers.get("content-type");if(!t?.startsWith(Vh))throw new Error(`Expected content-type to be ${Vh}, Actual: ${t}`)}d();c();l();u();var ao=class{constructor(t){Ne(this,"_basePath");Ne(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var DO=(e,t,r)=>new ao(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,uA=3,qO=5e3,MO="text/event-stream",Qh=1,Lh=class extends Error{},vu=class extends Error{constructor(r){super(r.message);this.payload=r}},Uh=class{constructor(){Ne(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Hl=class{constructor(t){Ne(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,S=new Uh;if(!a){this.logger.error("No stream ID found");return}let A=0,h,C=()=>{h&&!S.isActive(h)&&(R?.abort(),g(),b())},w=()=>{S.remove(h),h=rA(C,h,qO),S.add(h)},R=new s.AbortController,b=()=>$l(DO(n,o,a),{method:"GET",fetch:v,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:R?.signal,onopen(F){return _asyncToGenerator(function*(){if(F.ok&&F.headers.get("content-type")===MO)return;throw F.status>=400&&F.status<500&&F.status!==429?new vu({message:"Error opening stream",code:F.status}):new Lh})()},onmessage:F=>{if(R?.signal.aborted)return;let E=JSON.parse(F.data);if(E.finishReason==="ERROR"){S.remove(h),R?.abort(),f({message:E.errorMessage,code:E.statusCode});return}p(E),A=0,E.finishReason==="COMPLETED"?(S.remove(h),m()):w()},onerror:F=>{if(!R?.signal.aborted){if(S.remove(h),F instanceof vu)throw R?.abort(),f(F),F;if(++A>uA){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:Qh};throw R?.abort(),f(E),new vu(E)}this.logger.info(`Retrying...(${A}/${uA})`),g()}}});return b(),R}};d();c();l();u();var AA=kr(yA(),1);d();c();l();u();var W=new Error("Failed to load reducers."),bi=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."}},ea=class extends Error{constructor(r,n){super();Ne(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function SA(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function vA(e){return typeof e!="object"||!e?!1:Object.values(e).every(uN)}function uN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function xA(e){return e===429}var Or=class e{static call(t){return _asyncToGenerator(function*(){let r=lN(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(a,i);if(xA(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,AA.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&xA(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(S=>setTimeout(S,1e3))),g});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new bi;case 404:throw new ea(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new ea(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=Su(f);try{let g=yield o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function Ft(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ct(e,t="prod"){return`${Ft(e,t)}/rest/search/v2`}function Wl(e,t="prod"){return`${Ft(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function lN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=dN(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function dN(e,t){return t==="application/x-www-form-urlencoded"?vA(e)?SA(e):"":JSON.stringify(e)}d();c();l();u();var Kl=e=>e;d();c();l();u();d();c();l();u();function Ri(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function rr(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Ri(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Ri(),extendedResults:{},searchAction:void 0}}d();c();l();u();function io(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var so=e=>{let{response:t}=e;return t.body?pN(e):fN(t)},pN=e=>gN(e)?hN(e):mN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},fN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function mN(e){return e.body.statusCode!==void 0}function gN(e){return e.body.exception!==void 0}var hN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var co=class{constructor(){Ne(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();function CA(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Nn=(e,t,r,n)=>{let o=new ao(`${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 bA=(e,t)=>{let r=new ao(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},RA=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Or.call({...Nn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:io(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=CA(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return yN(i)?{success:i}:{error:so({response:r,body:i})}});return function RA(_x5,_x6){return _ref3.apply(this,arguments)}}();function yN(e){return typeof e=="string"}d();c();l();u();function SN(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function vN(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Yl(e,t){if(t&&e.name==="AbortError")return{error:vN(e)};if(e instanceof ea)return{error:SN(e)};throw e}var Jl=class{constructor(t){this.options=t;Ne(this,"apiCallsQueues",{unknown:new co,mainSearch:new co,facetValues:new co,foldingCollection:new co,instantResults:new co})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/plan"),requestParams:io(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Yl(r);let n=yield r.json();return AN(n)?{success:n}:{error:so({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:io(t),..._this3.options});if(r instanceof Error)return Yl(r);let n=yield r.json(),o={response:r,body:n};return xN(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:so(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>Or.call({...Nn(t,"POST","application/json",""),requestParams:io(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Yl(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return wA(a)?(i.body=FA(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:so(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/facet"),requestParams:io(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 Or.call({...Nn(t,"POST","application/json",""),requestParams:io(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(wA(n)){let o={response:r,body:n};return o.body=FA(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:so({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return RA(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return CN(n)?{success:n}:{error:so({response:r,body:n})}})()}},Xl=e=>e.success!==void 0,ht=e=>e.error!==void 0;function wA(e){return e.results!==void 0}function FA(e){let t=Ri();return ue(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function xN(e){return e.completions!==void 0}function AN(e){return e.preprocessingOutput!==void 0}function CN(e){return e.fields!==void 0}d();c();l();u();var EA=e=>e,IA=e=>e,TA=e=>e;d();c();l();u();d();c();l();u();var z=new j({required:!0,emptyAllowed:!1}),it=new j({required:!1,emptyAllowed:!1}),Ue=new j({required:!0,emptyAllowed:!0}),lW=new j({required:!1,emptyAllowed:!0}),Zl=new ae({each:z,required:!0}),PA=new j({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),kA=new j({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),dW=new j({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),_n=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),lr=(e,t)=>{if("required"in t)return{payload:new ge({value:t}).validate({value:e}).value};let o=new J({options:{required:!0},values:t}).validate(e);if(o)throw new hu(o);return{payload:e}},O=(e,t)=>{try{return lr(e,t)}catch(r){return{payload:e,error:_n(r)}}},ut=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return OA(e,t,r,o,"Controller initialization error")},Be=(e,t,r,n)=>{let o=`Check the options of ${n}`;return OA(e,t,r,o,"Controller initialization error")},OA=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Et(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 bN=typeof Symbol=="function"&&Symbol.observable||"@@observable",NA=bN,Jh=()=>Math.random().toString(36).substring(7).split("").join("."),RN={INIT:`@@redux/INIT${Jh()}`,REPLACE:`@@redux/REPLACE${Jh()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Jh()}`},ed=RN;function Qr(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 Xh(e,t,r){if(typeof e!="function")throw new Error(Et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Et(1));return r(Xh)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((R,b)=>{i.set(b,R)}))}function g(){if(f)throw new Error(Et(3));return o}function S(R){if(typeof R!="function")throw new Error(Et(4));if(f)throw new Error(Et(5));let b=!0;m();let F=p++;return i.set(F,R),function(){if(b){if(f)throw new Error(Et(6));b=!1,m(),i.delete(F),a=null}}}function A(R){if(!Qr(R))throw new Error(Et(7));if(typeof R.type>"u")throw new Error(Et(8));if(typeof R.type!="string")throw new Error(Et(17));if(f)throw new Error(Et(9));try{f=!0,o=n(o,R)}finally{f=!1}return(a=i).forEach(F=>{F()}),R}function h(R){if(typeof R!="function")throw new Error(Et(10));n=R,A({type:ed.REPLACE})}function C(){let R=S;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(Et(11));function F(){let P=b;P.next&&P.next(g())}return F(),{unsubscribe:R(F)}},[NA](){return this}}}return A({type:ed.INIT}),{dispatch:A,subscribe:S,getState:g,replaceReducer:h,[NA]:C}}function wN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:ed.INIT})>"u")throw new Error(Et(12));if(typeof r(void 0,{type:ed.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Et(13))})}function wi(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{wN(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let S=0;S<n.length;S++){let A=n[S],h=r[A],C=p[A],w=h(C,f);if(typeof w>"u"){let R=f&&f.type;throw new Error(Et(14))}g[A]=w,m=m||w!==C}return m=m||n.length!==Object.keys(p).length,m?g:p}}function Fi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function _A(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Et(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=Fi(...p)(o.dispatch),{...o,dispatch:a}}}function Ei(e){return Qr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var cy=Symbol.for("immer-nothing"),Cu=Symbol.for("immer-draftable"),Ht=Symbol.for("immer-state");function It(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ii=Object.getPrototypeOf;function nr(e){return!!e&&!!e[Ht]}function zt(e){return e?LA(e)||Array.isArray(e)||!!e[Cu]||!!e.constructor?.[Cu]||Ti(e)||Iu(e):!1}var FN=Object.prototype.constructor.toString(),DA=new WeakMap;function LA(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=DA.get(r);return n===void 0&&(n=Function.toString.call(r),DA.set(r,n)),n===FN}function uy(e){return nr(e)||It(15,e),e[Ht].base_}function bu(e,t,r=!0){ra(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ra(e){let t=e[Ht];return t?t.type_:Array.isArray(e)?1:Ti(e)?2:Iu(e)?3:0}function Ru(e,t){return ra(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Zh(e,t){return ra(e)===2?e.get(t):e[t]}function UA(e,t,r){let n=ra(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function EN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ti(e){return e instanceof Map}function Iu(e){return e instanceof Set}function ta(e){return e.copy_||e.base_}function ry(e,t){if(Ti(e))return new Map(e);if(Iu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=LA(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ht];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[i]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[i]})}return Object.create(Ii(e),n)}else{let n=Ii(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function od(e,t=!1){return ad(e)||nr(e)||!zt(e)||(ra(e)>1&&Object.defineProperties(e,{set:td,add:td,clear:td,delete:td}),Object.freeze(e),t&&Object.values(e).forEach(r=>od(r,!0))),e}function IN(){It(2)}var td={value:IN};function ad(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var ny={};function na(e){let t=ny[e];return t||It(0,e),t}function TN(e,t){ny[e]||(ny[e]=t)}var wu;function QA(){return wu}function PN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function qA(e,t){t&&(na("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function oy(e){ay(e),e.drafts_.forEach(kN),e.drafts_=null}function ay(e){e===wu&&(wu=e.parent_)}function MA(e){return wu=PN(wu,e)}function kN(e){let t=e[Ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function jA(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ht].modified_&&(oy(t),It(4)),zt(e)&&(e=rd(t,e),t.parent_||nd(t,e)),t.patches_&&na("Patches").generateReplacementPatches_(r[Ht].base_,e,t.patches_,t.inversePatches_)):e=rd(t,r,[]),oy(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==cy?e:void 0}function rd(e,t,r){if(ad(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[Ht];if(!o)return bu(t,(a,i)=>VA(e,o,t,a,i,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return nd(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let a=o.copy_,i=a,p=!1;o.type_===3&&(i=new Set(a),a.clear(),p=!0),bu(i,(f,m)=>VA(e,o,a,f,m,r,p),n),nd(e,a,!1),r&&e.patches_&&na("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function VA(e,t,r,n,o,a,i){if(o==null||typeof o!="object"&&!i)return;let p=ad(o);if(!(p&&!i)){if(nr(o)){let f=a&&t&&t.type_!==3&&!Ru(t.assigned_,n)?a.concat(n):void 0,m=rd(e,o,f);if(UA(r,n,m),nr(m))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(zt(o)&&!p){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&p)return;rd(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Ti(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&nd(e,o)}}}function nd(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&od(t,r)}function ON(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:QA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=ly;r&&(o=[n],a=Fu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,p}var ly={get(e,t){if(t===Ht)return e;let r=ta(e);if(!Ru(r,t))return NN(e,r,t);let n=r[t];return e.finalized_||!zt(n)?n:n===ey(e.base_,t)?(ty(e),e.copy_[t]=sy(n,e)):n},has(e,t){return t in ta(e)},ownKeys(e){return Reflect.ownKeys(ta(e))},set(e,t,r){let n=BA(ta(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ey(ta(e),t),a=o?.[Ht];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(EN(r,o)&&(r!==void 0||Ru(e.base_,t)))return!0;ty(e),iy(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ey(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ty(e),iy(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ta(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){It(11)},getPrototypeOf(e){return Ii(e.base_)},setPrototypeOf(){It(12)}},Fu={};bu(ly,(e,t)=>{Fu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Fu.deleteProperty=function(e,t){return Fu.set.call(this,e,t,void 0)};Fu.set=function(e,t,r){return ly.set.call(this,e[0],t,r,e[0])};function ey(e,t){let r=e[Ht];return(r?ta(r):e)[t]}function NN(e,t,r){let n=BA(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function BA(e,t){if(!(t in e))return;let r=Ii(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ii(r)}}function iy(e){e.modified_||(e.modified_=!0,e.parent_&&iy(e.parent_))}function ty(e){e.copy_||(e.copy_=ry(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var _N=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}typeof r!="function"&&It(6),n!==void 0&&typeof n!="function"&&It(7);let o;if(zt(t)){let a=MA(this),i=sy(t,void 0),p=!0;try{o=r(i),p=!1}finally{p?oy(a):ay(a)}return qA(a,n),jA(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===cy&&(o=void 0),this.autoFreeze_&&od(o,!0),n){let a=[],i=[];na("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else It(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zt(e)||It(8),nr(e)&&(e=GA(e));let t=MA(this),r=sy(e,void 0);return r[Ht].isManual_=!0,ay(t),r}finishDraft(e,t){let r=e&&e[Ht];(!r||!r.isManual_)&&It(9);let{scope_:n}=r;return qA(n,t),jA(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=na("Patches").applyPatches_;return nr(e)?n(e,t):this.produce(e,o=>n(o,t))}};function sy(e,t){let r=Ti(e)?na("MapSet").proxyMap_(e,t):Iu(e)?na("MapSet").proxySet_(e,t):ON(e,t);return(t?t.scope_:QA()).drafts_.push(r),r}function GA(e){return nr(e)||It(10,e),$A(e)}function $A(e){if(!zt(e)||ad(e))return e;let t=e[Ht],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ry(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ry(e,!0);return bu(r,(o,a)=>{UA(r,o,$A(a))},n),t&&(t.finalized_=!1),r}function HA(){let t="replace",r="add",n="remove";function o(A,h,C,w){switch(A.type_){case 0:case 2:return i(A,h,C,w);case 1:return a(A,h,C,w);case 3:return p(A,h,C,w)}}function a(A,h,C,w){let{base_:R,assigned_:b}=A,F=A.copy_;F.length<R.length&&([R,F]=[F,R],[C,w]=[w,C]);for(let E=0;E<R.length;E++)if(b[E]&&F[E]!==R[E]){let P=h.concat([E]);C.push({op:t,path:P,value:S(F[E])}),w.push({op:t,path:P,value:S(R[E])})}for(let E=R.length;E<F.length;E++){let P=h.concat([E]);C.push({op:r,path:P,value:S(F[E])})}for(let E=F.length-1;R.length<=E;--E){let P=h.concat([E]);w.push({op:n,path:P})}}function i(A,h,C,w){let{base_:R,copy_:b}=A;bu(A.assigned_,(F,E)=>{let P=Zh(R,F),M=Zh(b,F),_=E?Ru(R,F)?t:r:n;if(P===M&&_===t)return;let k=h.concat(F);C.push(_===n?{op:_,path:k}:{op:_,path:k,value:M}),w.push(_===r?{op:n,path:k}:_===n?{op:r,path:k,value:S(P)}:{op:t,path:k,value:S(P)})})}function p(A,h,C,w){let{base_:R,copy_:b}=A,F=0;R.forEach(E=>{if(!b.has(E)){let P=h.concat([F]);C.push({op:n,path:P,value:E}),w.unshift({op:r,path:P,value:E})}F++}),F=0,b.forEach(E=>{if(!R.has(E)){let P=h.concat([F]);C.push({op:r,path:P,value:E}),w.unshift({op:n,path:P,value:E})}F++})}function f(A,h,C,w){C.push({op:t,path:[],value:h===cy?void 0:h}),w.push({op:t,path:[],value:A})}function m(A,h){return h.forEach(C=>{let{path:w,op:R}=C,b=A;for(let M=0;M<w.length-1;M++){let _=ra(b),k=w[M];typeof k!="string"&&typeof k!="number"&&(k=""+k),(_===0||_===1)&&(k==="__proto__"||k==="constructor")&&It(19),typeof b=="function"&&k==="prototype"&&It(19),b=Zh(b,k),typeof b!="object"&&It(18,w.join("/"))}let F=ra(b),E=g(C.value),P=w[w.length-1];switch(R){case t:switch(F){case 2:return b.set(P,E);case 3:It(16);default:return b[P]=E}case r:switch(F){case 1:return P==="-"?b.push(E):b.splice(P,0,E);case 2:return b.set(P,E);case 3:return b.add(E);default:return b[P]=E}case n:switch(F){case 1:return b.splice(P,1);case 2:return b.delete(P);case 3:return b.delete(C.value);default:return delete b[P]}default:It(17,R)}}),A}function g(A){if(!zt(A))return A;if(Array.isArray(A))return A.map(g);if(Ti(A))return new Map(Array.from(A.entries()).map(([C,w])=>[C,g(w)]));if(Iu(A))return new Set(Array.from(A).map(g));let h=Object.create(Ii(A));for(let C in A)h[C]=g(A[C]);return Ru(A,Cu)&&(h[Cu]=A[Cu]),h}function S(A){return nr(A)?g(A):A}TN("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:f})}var Eu=new _N,Dn=Eu.produce,id=Eu.produceWithPatches.bind(Eu);var dy=Eu.applyPatches.bind(Eu);d();c();l();u();function DN(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function qN(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function MN(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 zA=e=>Array.isArray(e)?e:[e];function jN(e){let t=Array.isArray(e[0])?e[0]:e;return MN(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function VN(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var IW=Object.getPrototypeOf({});var LN=class{constructor(e){this.value=e}deref(){return this.value}},UN=typeof WeakRef<"u"?WeakRef:LN,QN=0,WA=1;function sd(){return{s:QN,v:void 0,o:null,p:null}}function Pi(e,t={}){let r=sd(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let S=0,A=f;S<A;S++){let h=arguments[S];if(typeof h=="function"||typeof h=="object"&&h!==null){let C=p.o;C===null&&(p.o=C=new WeakMap);let w=C.get(h);w===void 0?(p=sd(),C.set(h,p)):p=w}else{let C=p.p;C===null&&(p.p=C=new Map);let w=C.get(h);w===void 0?(p=sd(),C.set(h,p)):p=w}}let m=p,g;if(p.s===WA)g=p.v;else if(g=e.apply(null,arguments),a++,n){let S=o?.deref?.()??o;S!=null&&n(S,g)&&(g=S,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new UN(g):g}return m.s=WA,m.v=g,g}return i.clearCache=()=>{r=sd(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function KA(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),DN(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:S,memoizeOptions:A=[],argsMemoize:h=Pi,argsMemoizeOptions:C=[],devModeChecks:w={}}=g,R=zA(A),b=zA(C),F=jN(o),E=S(function(){return a++,m.apply(null,arguments)},...R),P=!0,M=h(function(){i++;let k=VN(F,arguments);return p=E.apply(null,k),p},...b);return Object.assign(M,{resultFunc:m,memoizedResultFunc:E,dependencies:F,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:S,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var Ye=KA(Pi),BN=Object.assign((e,t=Ye)=>{qN(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((i,p,f)=>(i[r[f]]=p,i),{}))},{withTypes:()=>BN});d();c();l();u();function YA(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var JA=YA(),XA=YA;var GN=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Fi:Fi.apply(null,arguments)},HW=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},$N=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Bt(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=>Ei(n)&&n.type===e,r}var iC=class Tu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Tu.prototype)}static get[Symbol.species](){return Tu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Tu(...t[0].concat(this)):new Tu(...t.concat(this))}};function ZA(e){return zt(e)?Dn(e,()=>{}):e}function eC(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function HN(e){return typeof e=="boolean"}var zN=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new iC;return r&&(HN(r)?i.push(JA):i.push(XA(r.extraArgument))),i},Pu="RTK_autoBatch",Ni=()=>e=>({payload:e,meta:{[Pu]:!0}}),tC=e=>t=>{setTimeout(t,e)},WN=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tC(10):e.type==="callback"?e.queueNotification:tC(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let S=()=>o&&g(),A=n.subscribe(S);return p.add(g),()=>{A(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Pu],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},KN=e=>function(r){let{autoBatch:n=!0}=r??{},o=new iC(e);return n&&o.push(WN(typeof n=="object"?n:void 0)),o};function sC(e){let t=zN(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:i=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Qr(r))p=wi(r);else throw new Error(Bt(1));let f;typeof n=="function"?f=n(t):f=t();let m=Fi;o&&(m=GN({trace:!1,...(typeof o=="object"&&o)}));let g=_A(...f),S=KN(g),A=typeof i=="function"?i(S):S(),h=m(...A);return Xh(p,a,h)}function cC(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Bt(28));if(p in t)throw new Error(Bt(29));return t[p]=i,o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function YN(e){return typeof e=="function"}function oe(e,t){let[r,n,o]=cC(t),a;if(YN(e))a=()=>ZA(e());else{let p=ZA(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,S)=>{if(S)if(nr(g)){let h=S(g,f);return h===void 0?g:h}else{if(zt(g))return Dn(g,A=>S(A,f));{let A=S(g,f);if(A===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return A}}return g},p)}return i.getInitialState=a,i}var uC=(e,t)=>$N(e)?e.match(t):e(t);function Br(...e){return t=>e.some(r=>uC(r,t))}function Oi(...e){return t=>e.every(r=>uC(r,t))}function dd(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 ku(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function pd(...e){return e.length===0?t=>dd(t,["pending"]):ku(e)?Br(...e.map(t=>t.pending)):pd()(e[0])}function ia(...e){return e.length===0?t=>dd(t,["rejected"]):ku(e)?Br(...e.map(t=>t.rejected)):ia()(e[0])}function Ou(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Oi(ia(...e),t):ku(e)?Oi(ia(...e),t):Ou()(e[0])}function qn(...e){return e.length===0?t=>dd(t,["fulfilled"]):ku(e)?Br(...e.map(t=>t.fulfilled)):qn()(e[0])}function fd(...e){return e.length===0?t=>dd(t,["pending","fulfilled","rejected"]):ku(e)?Br(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):fd()(e[0])}var JN="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Nu=(e=21)=>{let t="",r=e;for(;r--;)t+=JN[Math.random()*64|0];return t},XN=["name","message","stack","code"],py=class{constructor(e,t){Ne(this,"_type");this.payload=e,this.meta=t}},rC=class{constructor(e,t){Ne(this,"_type");this.payload=e,this.meta=t}},ZN=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of XN)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Se=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,m,g,S)=>({payload:f,meta:{...(S||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=T(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=T(t+"/rejected",(f,m,g,S,A)=>({payload:S,error:(n&&n.serializeError||ZN)(f||"Rejected"),meta:{...(A||{}),arg:g,requestId:m,rejectedWithValue:!!S,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f){return(m,g,S)=>{let A=n?.idGenerator?n.idGenerator(f):Nu(),h=new s.AbortController,C,w;function R(F){w=F,h.abort()}let b=_asyncToGenerator(function*(){let F;try{let P=n?.condition?.(f,{getState:g,extra:S});if(t_(P)&&(P=yield P),P===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let M=new Promise((_,k)=>{C=()=>{k({name:"AbortError",message:w||"Aborted"})},h.signal.addEventListener("abort",C)});m(a(A,f,n?.getPendingMeta?.({requestId:A,arg:f},{getState:g,extra:S}))),F=yield Promise.race([M,Promise.resolve(r(f,{dispatch:m,getState:g,extra:S,requestId:A,signal:h.signal,abort:R,rejectWithValue:(_,k)=>new py(_,k),fulfillWithValue:(_,k)=>new rC(_,k)})).then(_=>{if(_ instanceof py)throw _;return _ instanceof rC?o(_.payload,A,f,_.meta):o(_,A,f)})])}catch(P){F=P instanceof py?i(null,A,f,P.payload,P.meta):i(P,A,f)}finally{C&&h.signal.removeEventListener("abort",C)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||m(F),F})();return Object.assign(b,{abort:R,requestId:A,arg:f,unwrap(){return b.then(e_)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Br(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function e_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function t_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var lC=Symbol.for("rtk-slice-createasyncthunk"),JW={[lC]:Se};function r_(e,t){return`${e}/${t}`}function n_({creators:e}={}){let t=e?.asyncThunk?.[lC];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Bt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(a_()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(F,E){let P=typeof F=="string"?F:F.type;if(!P)throw new Error(Bt(12));if(P in f.sliceCaseReducersByType)throw new Error(Bt(13));return f.sliceCaseReducersByType[P]=E,m},addMatcher(F,E){return f.sliceMatchers.push({matcher:F,reducer:E}),m},exposeAction(F,E){return f.actionCreators[F]=E,m},exposeCaseReducer(F,E){return f.sliceCaseReducersByName[F]=E,m}};p.forEach(F=>{let E=i[F],P={reducerName:F,type:r_(o,F),createNotation:typeof n.reducers=="function"};s_(E)?u_(P,E,m,t):i_(P,E,m)});function g(){let[F={},E=[],P=void 0]=typeof n.extraReducers=="function"?cC(n.extraReducers):[n.extraReducers],M={...F,...f.sliceCaseReducersByType};return oe(n.initialState,_=>{for(let k in M)_.addCase(k,M[k]);for(let k of f.sliceMatchers)_.addMatcher(k.matcher,k.reducer);for(let k of E)_.addMatcher(k.matcher,k.reducer);P&&_.addDefaultCase(P)})}let S=F=>F,A=new Map,h;function C(F,E){return h||(h=g()),h(F,E)}function w(){return h||(h=g()),h.getInitialState()}function R(F,E=!1){function P(_){let k=_[F];return typeof k>"u"&&E&&(k=w()),k}function M(_=S){let k=eC(A,E,()=>new WeakMap);return eC(k,_,()=>{let N={};for(let[q,U]of Object.entries(n.selectors??{}))N[q]=o_(U,_,w,E);return N})}return{reducerPath:F,getSelectors:M,get selectors(){return M(P)},selectSlice:P}}let b={name:o,reducer:C,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(a),injectInto(F,{reducerPath:E,...P}={}){let M=E??a;return F.inject({reducerPath:M,reducer:C},P),{...b,...R(M,!0)}}};return b}}function o_(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var sa=n_();function a_(){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 i_({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!c_(n))throw new Error(Bt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?T(e,i):T(e))}function s_(e){return e._reducerDefinitionType==="asyncThunk"}function c_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function u_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Bt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,S=o(e,a,g);n.exposeAction(t,S),i&&n.addCase(S.fulfilled,i),p&&n.addCase(S.pending,p),f&&n.addCase(S.rejected,f),m&&n.addMatcher(S.settled,m),n.exposeCaseReducer(t,{fulfilled:i||cd,pending:p||cd,rejected:f||cd,settled:m||cd})}function cd(){}var l_="task",dC="listener",pC="completed",gy="cancelled",d_=`task-${gy}`,p_=`task-${pC}`,fy=`${dC}-${gy}`,f_=`${dC}-${pC}`,md=class{constructor(e){Ne(this,"name","TaskAbortError");Ne(this,"message");this.code=e,this.message=`${l_} ${gy} (reason: ${e})`}},hy=(e,t)=>{if(typeof e!="function")throw new TypeError(Bt(32))},ud=()=>{},fC=(e,t=ud)=>(e.catch(t),e),mC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),oa=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},aa=e=>{if(e.aborted){let{reason:t}=e;throw new md(t)}};function gC(e,t){let r=ud;return new Promise((n,o)=>{let a=()=>o(new md(e.reason));if(e.aborted){a();return}r=mC(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=ud})}var m_=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof md?"cancelled":"rejected",error:r}}finally{t?.()}});return function m_(_x7,_x8){return _ref5.apply(this,arguments)}}(),ld=e=>t=>fC(gC(e,t).then(r=>(aa(e),r))),hC=e=>{let t=ld(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ki}=Object,nC={},gd="listenerMiddleware",g_=(e,t)=>{let r=n=>mC(e,()=>oa(n,e.reason));return(n,o)=>{hy(n,"taskExecutor");let a=new s.AbortController;r(a);let i=m_(/*#__PURE__*/_asyncToGenerator(function*(){aa(e),aa(a.signal);let p=yield n({pause:ld(a.signal),delay:hC(a.signal),signal:a.signal});return aa(a.signal),p}),()=>oa(a,p_));return o?.autoJoin&&t.push(i.catch(ud)),{result:ld(e)(i),cancel(){oa(a,d_)}}}},h_=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){aa(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(S,A)=>{A.unsubscribe(),f([S,A.getState(),A.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield gC(t,Promise.race(p));return aa(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>fC(r(n,o))},yC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=T(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Bt(21));return hy(a,"options.listener"),{predicate:o,type:t,effect:a}},SC=ki(e=>{let{type:t,predicate:r,effect:n}=yC(e);return{id:Nu(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Bt(22))}}},{withTypes:()=>SC}),oC=(e,t)=>{let{type:r,effect:n,predicate:o}=yC(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},my=e=>{e.pending.forEach(t=>{oa(t,fy)})},y_=e=>()=>{e.forEach(my),e.clear()},aC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},vC=ki(T(`${gd}/add`),{withTypes:()=>vC}),S_=T(`${gd}/removeAll`),xC=ki(T(`${gd}/remove`),{withTypes:()=>xC}),v_=(...e)=>{console.error(`${gd}/error`,...e)},AC=(e={})=>{let t=new Map,{extra:r,onError:n=v_}=e;hy(n,"onError");let o=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),S=>{g.unsubscribe(),S?.cancelActive&&my(g)}),a=g=>{let S=oC(t,g)??SC(g);return o(S)};ki(a,{withTypes:()=>a});let i=g=>{let S=oC(t,g);return S&&(S.unsubscribe(),g.cancelActive&&my(S)),!!S};ki(i,{withTypes:()=>i});let p=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,S,A,h){let C=new s.AbortController,w=h_(a,C.signal),R=[];try{g.pending.add(C),yield Promise.resolve(g.effect(S,ki({},A,{getOriginalState:h,condition:(b,F)=>w(b,F).then(Boolean),take:w,delay:hC(C.signal),pause:ld(C.signal),extra:r,signal:C.signal,fork:g_(C.signal,R),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((b,F,E)=>{b!==C&&(oa(b,fy),E.delete(b))})},cancel:()=>{oa(C,fy),g.pending.delete(C)},throwIfCancelled:()=>{aa(C.signal)}})))}catch(b){b instanceof md||aC(n,b,{raisedBy:"effect"})}finally{yield Promise.all(R),oa(C,f_),g.pending.delete(C)}});return function p(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),f=y_(t);return{middleware:g=>S=>A=>{if(!Ei(A))return S(A);if(vC.match(A))return a(A.payload);if(S_.match(A)){f();return}if(xC.match(A))return i(A.payload);let h=g.getState(),C=()=>{if(h===nC)throw new Error(Bt(23));return h},w;try{if(w=S(A),t.size>0){let R=g.getState(),b=Array.from(t.values());for(let F of b){let E=!1;try{E=F.predicate(A,R,h)}catch(P){E=!1,aC(n,P,{raisedBy:"predicate"})}E&&p(F,A,g,C)}}}finally{h=nC}return w},startListening:a,stopListening:i,clearListeners:f}};function Bt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();function CC(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var bC=/^(?:[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 x_(e){return typeof e=="string"&&bC.test(e)}var yy=x_;d();c();l();u();var Tt=[];for(let e=0;e<256;++e)Tt.push((e+256).toString(16).slice(1));function RC(e,t=0){return(Tt[e[t+0]]+Tt[e[t+1]]+Tt[e[t+2]]+Tt[e[t+3]]+"-"+Tt[e[t+4]]+Tt[e[t+5]]+"-"+Tt[e[t+6]]+Tt[e[t+7]]+"-"+Tt[e[t+8]]+Tt[e[t+9]]+"-"+Tt[e[t+10]]+Tt[e[t+11]]+Tt[e[t+12]]+Tt[e[t+13]]+Tt[e[t+14]]+Tt[e[t+15]]).toLowerCase()}d();c();l();u();var Sy,A_=new Uint8Array(16);function vy(){if(!Sy){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Sy=crypto.getRandomValues.bind(crypto)}return Sy(A_)}d();c();l();u();d();c();l();u();var C_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xy={randomUUID:C_};function b_(e,t,r){e=e||{};let n=e.random??e.rng?.()??vy();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 RC(n)}function R_(e,t,r){return xy.randomUUID&&!t&&!e?xy.randomUUID():b_(e,t,r)}var Ay=R_;function w_(_x13){return _w_.apply(this,arguments)}function _w_(){_w_=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _w_.apply(this,arguments)}var PC="2.0.4",Cy=128,kC=192,wC=224,FC=240,F_=248;function E_(e){return(e&F_)===FC?4:(e&FC)===wC?3:(e&wC)===kC?2:1}function I_(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&Cy)!=Cy)break;if(r-=3,(n&kC)!=Cy){t-r>=E_(n)*3&&(r=t);break}}return e.substring(0,r)}function T_(e){let{trackingId:t}=e;return{trackingId:t}}function P_(e){return(e.source||[]).concat([`relay@${PC}`])}function OC(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=T_(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:P_(t),clientId:p,userAgent:a(),referrer:EC(n()),location:EC(o())})}function EC(e){return e!==null?I_(e,1024):null}function k_(e,t,r,n){return{...t,meta:OC(e,r,n)}}var O_="*";function N_(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function a(f){if(f===O_)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function IC({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 __(e){let t=IC(e);return{get:()=>t,update:r=>{t=IC({...t,...r})}}}var by=D_();function D_(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function q_(){return{getItem(e){return by.getItem(e)||localStorage.getItem(e)},removeItem(e){by.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),by.setItem(e,t,31556952e3)}}}var TC="visitorId";function M_(){let e=document.referrer;return e===""?null:e}function Ry(){let e=q_();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=v(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});CC().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>M_(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(TC);if(t&&yy(t))return t;let r=Ay();return e.setItem(TC,r),r}}}function j_(){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 V_(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function L_(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=V_();return t&&r?{...r,runtime:"custom"}:t&&U_()&&j_()?Ry():n}function U_(){try{return typeof window=="object"}catch{return!1}}function Q_(e){return{get:()=>Object.freeze(L_(e))}}function NC(e){let t=__(e),r=N_(),n=Q_(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=k_(o,a,i,p);return w_({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>OC(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:PC}}d();c();l();u();function _C(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var uo="3.47.1",DC=["@coveo/atomic","@coveo/quantic"];var _i=Ye(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${uo}`));var _u=Ye(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>_i(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=G_(p);return NC({mode:a?"emit":"disabled",url:o??Wl(e,t),token:r,trackingId:n??null,source:i,environment:f})}),B_={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},G_=e=>{if(!e)return;let t=e();return{...(_C()?Ry():B_),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Mn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function V(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var Te;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Te||(Te={}));function Ey(){return typeof window<"u"}function Ly(){return typeof navigator<"u"}function Di(){return typeof document<"u"}function Iy(){try{return typeof localStorage<"u"}catch{return!1}}function $_(){try{return typeof sessionStorage<"u"}catch{return!1}}function KC(){return Ly()&&navigator.cookieEnabled}var H_=[Te.click,Te.custom,Te.search,Te.view],z_=(e,t)=>H_.indexOf(e)!==-1?Object.assign({language:Di()?document.documentElement.lang:"unknown",userAgent:Ly()?navigator.userAgent:"unknown"},t):t,qu=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?qC(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],qC(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function qC(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function W_(){return Iy()?localStorage:KC()?new Mu:$_()?sessionStorage:new Mi}var Mu=class e{getItem(t){return qu.get(`${e.prefix}${t}`)}removeItem(t){qu.erase(`${e.prefix}${t}`)}setItem(t,r,n){qu.set(`${e.prefix}${t}`,r,n)}};Mu.prefix="coveo_";var Ty=class{constructor(){this.cookieStorage=new Mu}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)}},Mi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},hd="__coveo.analytics.history",K_=20,Y_=1e3*60,J_=75,vd=class{constructor(t){this.store=t||W_()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return V(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(hd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(hd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(hd,JSON.stringify(t.slice(0,K_)))}catch{}}clear(){try{this.store.removeItem(hd)}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,J_)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Y_:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var X_=(e,t)=>V(void 0,void 0,void 0,function*(){return e===Te.view?(yield Z_(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Z_=e=>V(void 0,void 0,void 0,function*(){let t=new vd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),yd,e0=new Uint8Array(16);function t0(){if(!yd&&(yd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yd(e0)}var r0=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function xd(e){return typeof e=="string"&&r0.test(e)}var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function YC(e,t=0){return Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]}function n0(e){if(!xd(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function o0(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var a0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i0="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function s0(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=o0(o)),typeof a=="string"&&(a=n0(a)),((f=a)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let g=0;g<16;++g)i[p+g]=m[g];return i}return YC(m)}try{n.name=e}catch{}return n.DNS=a0,n.URL=i0,n}var c0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MC={randomUUID:c0};function ca(e,t,r){if(MC.randomUUID&&!t&&!e)return MC.randomUUID();e=e||{};let n=e.random||(e.rng||t0)();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 YC(n)}function u0(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 wy(e,t){return e<<t|e>>>32-t}function l0(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let p=0;p<i.length;++p)e.push(i.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=a[i][h];for(let h=16;h<80;++h)p[h]=wy(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],S=r[3],A=r[4];for(let h=0;h<80;++h){let C=Math.floor(h/20),w=wy(f,5)+u0(C,m,g,S)+A+t[C]+p[h]>>>0;A=S,S=g,g=wy(m,30)>>>0,m=f,f=w}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+S>>>0,r[4]=r[4]+A>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var d0=s0("v5",80,l0),jC=d0,JC="2.30.52",VC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Du={pageview:"pageview",event:"event"},Ad=class{constructor({client:t,uuidGenerator:r=ca}){this.client=t,this.uuidGenerator=r}},Py=class extends Ad{constructor({client:t,uuidGenerator:r=ca}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=VC(window.location),this.lastReferrer=Di()?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:Di()?document.title:"",encoding:Di()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Du.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Du.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Du.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Du.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 VC(window.location)}},lo=class e{constructor(t,r){if(!xd(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return xd(a)?new e(a,Number.parseInt(o)*1e3):null}};lo.cvo_cid="cvo_cid";lo.expirationTime=120;var ky=class extends Ad{constructor({client:t,uuidGenerator:r=ca}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return V(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(lo.cvo_cid,new lo(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};ky.Id="link";var pr=Object.keys;function Sd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Fy=128,XC=192,LC=224,UC=240;function p0(e){return(e&248)===UC?4:(e&UC)===LC?3:(e&LC)===XC?2:1}function f0(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&Fy)!=Fy)break;if(r-=3,(n&XC)!=Fy){t-r>=p0(n)*3&&(r=t);break}}return e.substring(0,r)}var Oy={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"},m0=pr(Oy).map(e=>Oy[e]),g0=[...m0].join("|"),h0=new RegExp(`^(${g0}$)`),y0={svcAction:"svc_action",svcActionData:"svc_action_data"},S0=e=>pr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Oy[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),v0=e=>h0.test(e),x0=[v0],QC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},BC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},_t={action:"pa",list:"pal",listSource:"pls"},Cd={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},A0=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Ny={id:"quoteId",affiliation:"quoteAffiliation"},_y={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},C0={add:_t,bookmark_add:_t,bookmark_remove:_t,click:_t,checkout:_t,checkout_option:_t,detail:_t,impression:_t,remove:_t,refund:Object.assign(Object.assign({},_t),Cd),purchase:Object.assign(Object.assign({},_t),Cd),quickview:_t,quote:Object.assign(Object.assign({},_t),Ny),review:Object.assign(Object.assign({},_t),_y)},b0=pr(QC).map(e=>QC[e]),R0=pr(BC).map(e=>BC[e]),w0=pr(_t).map(e=>_t[e]),F0=pr(Cd).map(e=>Cd[e]),E0=pr(_y).map(e=>_y[e]),I0=pr(Ny).map(e=>Ny[e]),T0=[...b0,"custom"].join("|"),P0=[...R0,"custom"].join("|"),ZC="(pr[0-9]+)",eb="(il[0-9]+pi[0-9]+)",k0=new RegExp(`^${ZC}(${T0})$`),O0=new RegExp(`^(${eb}(${P0}))|(il[0-9]+nm)$`),N0=new RegExp(`^(${w0.join("|")})$`),_0=new RegExp(`^(${F0.join("|")})$`),D0=new RegExp(`^${ZC}custom$`),q0=new RegExp(`^${eb}custom$`),M0=new RegExp(`^(${[...A0,...E0,...I0].join("|")})$`),j0=e=>k0.test(e),V0=e=>O0.test(e),L0=e=>N0.test(e),U0=e=>_0.test(e),Q0=e=>M0.test(e),B0=[V0,j0,L0,U0,Q0],G0=[D0,q0],$0={anonymizeIp:"aip"},H0={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},z0={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},W0=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],K0=Object.assign(Object.assign(Object.assign(Object.assign({},$0),H0),z0),W0.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Dy=Object.assign(Object.assign({},K0),y0),Y0=e=>{let t=!!e.action&&C0[e.action]||{};return pr(e).reduce((r,n)=>{let o=t[n]||Dy[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},J0=pr(Dy).map(e=>Dy[e]),X0=e=>J0.indexOf(e)!==-1,Z0=e=>e==="custom",eD=e=>[...B0,...x0,X0,Z0].some(t=>t(e)),tD=e=>pr(e).reduce((t,r)=>{let n=rD(r);return n?Object.assign(Object.assign({},t),nD(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),rD=e=>{let t;return[...G0].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},nD=(e,t)=>pr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),qy=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[Te.click,Te.custom,Te.search,Te.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}},My=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},GC=y.fetch,bd=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=Mn(f,["url"]),S;try{S=yield GC(m,g)}catch(A){console.error("An error has occured when sending the event.",A);return}if(S.ok){let A=yield S.json();return A.visitorId&&o.setCurrentVisitorId(A.visitorId),A}else{try{S.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield GC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Te.click,Te.custom,Te.search,Te.view].indexOf(t)!==-1}getVisitorIdParam(){return V(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},jy=class{constructor(t,r){Iy()&&KC()?this.storage=new Ty:Iy()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Mi),this.client=new bd(t),this.beaconClient=new qy(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Vy=class{constructor(t,r){this.storage=r||new Mi,this.client=new bd(t)}getClientDependingOnEventType(t){return this.client}},Rd=class{constructor(){this.storage=new Mi,this.client=new My}getClientDependingOnEventType(t){return this.client}},oD="xx",aD=e=>e?.startsWith(oD)||!1,iD=`
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 bD(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var wD=["1",1,"yes",!0];function Md(){let e=[];return Oy()&&e.push(window.doNotTrack),$y()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>wD.indexOf(t)!==-1)}var ob="v15",ib={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 RD(e=ib.default,t=ob,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 FD="38824e1f-37f5-42d3-8372-a4b8fa9df946",$r=class{get defaultOptions(){return{endpoint:ib.default,isCustomEndpoint:!1,token:"",version:ob,beforeSendHooks:[],afterSendHooks:[]}}get version(){return tb}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=[m0,u0].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};Md()?this.runtime=new qd:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Te.view,{newEventType:Te.view,addClientIdParameter:!0}),this.addEventTypeMapping(Te.click,{newEventType:Te.click,addClientIdParameter:!0}),this.addEventTypeMapping(Te.custom,{newEventType:Te.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Te.search,{newEventType:Te.search,addClientIdParameter:!0})}initRuntime(t){return Oy()&&Vi()?new By(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(bD()&&console.warn(CD),new Gy(t))}get storage(){return this.runtime.storage}determineVisitorId(){return j(this,void 0,void 0,function*(){try{return Oy()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||yo()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),yo()}})}getCurrentVisitorId(){return j(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return j(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return j(this,void 0,void 0,function*(){if(Od(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(QC(t,QC(r,FD)))}})}getParameters(t,...r){return j(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return j(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(yo()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Md())return null;try{let r=new URL(t).searchParams.get(ya.cvo_cid);if(r==null)return null;let n=ya.fromString(r);return!n||!Vi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return j(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:a=!1,usesMeasurementProtocol:o=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>j(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:a?yield this.getCurrentVisitorId():""})}),h=>j(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>o?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((C,R)=>j(this,void 0,void 0,function*(){let w=yield C;return yield R(t,w)}),h)].reduce((h,C)=>j(this,void 0,void 0,function*(){let R=yield h;return yield C(R)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return j(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[A=>this.setTrackingIdIfTrackingIdNotPresent(A),A=>this.removeEmptyPayloadValues(A,t),A=>this.validateParams(A,t),A=>n?pD(A):A,A=>n?this.removeUnknownParameters(A):A,A=>n?this.processCustomParameters(A):this.mapCustomParametersToCustomData(A)].reduce((A,x)=>j(this,void 0,void 0,function*(){let h=yield A;return yield x(h)}),Promise.resolve(r))})}makeEvent(t,...r){return j(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},a=yield this.resolveParameters(t,...r),o=yield this.resolvePayloadForParameters(t,a);return{eventType:n,payload:o,log:i=>j(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},o),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},a),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return j(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return j(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 kd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(Te.search,t)})}sendSearchEvent(t){return j(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=jn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(Te.click,t)})}sendClickEvent(t){return j(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=jn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(Te.custom,t)})}sendCustomEvent(t){return j(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=jn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(Te.view,t)})}sendViewEvent(t){return j(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return j(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return j(this,void 0,void 0,function*(){return yield(yield S(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let a=0,o=r.length;a<o;a++){let i=r[a];if(typeof i=="string")n[t[a]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[Te.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=a=>typeof a<"u"&&a!==null&&a!=="";return Object.keys(t).filter(a=>this.isKeyAllowedEmpty(r,a)||n(t[a])).reduce((a,o)=>Object.assign(Object.assign({},a),{[o]:t[o]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(hD(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,a)=>Object.assign(Object.assign({},n),{[a]:t[a]}),{})}processCustomParameters(t){let{custom:r}=t,n=jn(t,["custom"]),a={};r&&Pd(r)&&(a=this.lowercaseKeys(r));let o=yD(n);return Object.assign(Object.assign({},a),o)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=jn(t,["custom"]);if(r&&Pd(r)){let a=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},a),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(a=>{n[a.toLowerCase()]=t[a]}),n}validateParams(t,r){let{anonymizeIp:n}=t,a=jn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(a.anonymizeIp=1),(r==Te.view||r==Te.click||r==Te.search||r==Te.custom)&&(a.originLevel3=this.limit(a.originLevel3,1024)),r==Te.view&&(a.location=this.limit(a.location,1024)),(r=="pageview"||r=="event")&&(a.referrer=this.limit(a.referrer,2048),a.location=this.limit(a.location,2048),a.page=this.limit(a.page,2048)),a}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=jn(t,["userId"]);return xD(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=jn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Pd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Pd(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"?T0(t,r):t}get baseUrl(){return RD(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Vn;(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"})(Vn||(Vn={}));var L;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(L||(L={}));var KC={[L.triggerNotify]:"queryPipelineTriggers",[L.triggerExecute]:"queryPipelineTriggers",[L.triggerQuery]:"queryPipelineTriggers",[L.triggerRedirect]:"queryPipelineTriggers",[L.queryErrorBack]:"errors",[L.queryErrorClear]:"errors",[L.queryErrorRetry]:"errors",[L.pagerNext]:"getMoreResults",[L.pagerPrevious]:"getMoreResults",[L.pagerNumber]:"getMoreResults",[L.pagerResize]:"getMoreResults",[L.pagerScrolling]:"getMoreResults",[L.facetSearch]:"facet",[L.facetShowLess]:"facet",[L.facetShowMore]:"facet",[L.recommendation]:"recommendation",[L.likeSmartSnippet]:"smartSnippet",[L.dislikeSmartSnippet]:"smartSnippet",[L.expandSmartSnippet]:"smartSnippet",[L.collapseSmartSnippet]:"smartSnippet",[L.openSmartSnippetFeedbackModal]:"smartSnippet",[L.closeSmartSnippetFeedbackModal]:"smartSnippet",[L.sendSmartSnippetReason]:"smartSnippet",[L.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.clearRecentQueries]:"recentQueries",[L.recentResultClick]:"recentlyClickedDocuments",[L.clearRecentResults]:"recentlyClickedDocuments",[L.showLessFoldedResults]:"folding",[L.caseDetach]:"case",[L.likeGeneratedAnswer]:"generatedAnswer",[L.dislikeGeneratedAnswer]:"generatedAnswer",[L.openGeneratedAnswerSource]:"generatedAnswer",[L.generatedAnswerStreamEnd]:"generatedAnswer",[L.generatedAnswerSourceHover]:"generatedAnswer",[L.generatedAnswerCopyToClipboard]:"generatedAnswer",[L.generatedAnswerHideAnswers]:"generatedAnswer",[L.generatedAnswerShowAnswers]:"generatedAnswer",[L.generatedAnswerExpand]:"generatedAnswer",[L.generatedAnswerCollapse]:"generatedAnswer",[L.generatedAnswerFeedbackSubmit]:"generatedAnswer",[L.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Vn.expandToFullUI]:"interface",[Vn.openUserActions]:"User Actions",[Vn.showPrecedingSessions]:"User Actions",[Vn.showFollowingSessions]:"User Actions",[Vn.clickViewedDocument]:"User Actions",[Vn.clickPageView]:"User Actions",[Vn.createArticle]:"createArticle"},Qi=class{constructor(){this.runtime=new qd,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(Te.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Te.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Te.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Te.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return tb}};function ED(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function ID(e){return e.map(t=>t.replace(/;/g,""))}function sb(e){let r=e.join(";");return r.length<=256?r:sb(e.slice(1))}var YC=e=>{let t=ID(e),r=ED(t);return sb(r)};function JC(e){let t=typeof e.partialQueries=="string"?e.partialQueries:YC(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:YC(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var jd=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Md();this.coveoAnalyticsClient=n?new Qi:new $r(t)}disable(){this.coveoAnalyticsClient=new Qi}enable(){this.coveoAnalyticsClient=new $r(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(L.interfaceLoad)}logInterfaceLoad(){return j(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(L.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(L.recommendation)}logRecommendation(){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(L.recommendationOpen,t,r)}logRecommendationOpen(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(L.staticFilterClearAll,t)}logStaticFilterClearAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(L.staticFilterSelect,t)}logStaticFilterSelect(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(L.staticFilterDeselect,t)}logStaticFilterDeselect(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(L.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return j(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(L.interfaceChange,t)}logInterfaceChange(t){return j(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(L.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return j(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(L.didyoumeanClick)}logDidYouMeanClick(){return j(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(L.resultsSort,t)}logResultsSort(t){return j(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(L.searchboxSubmit)}logSearchboxSubmit(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(L.searchboxClear)}logSearchboxClear(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(L.searchboxAsYouType)}logSearchboxAsYouType(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(L.breadcrumbFacet,t)}logBreadcrumbFacet(t){return j(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(L.breadcrumbResetAll)}logBreadcrumbResetAll(){return j(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(L.documentQuickview,t,r)}logDocumentQuickview(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(L.documentOpen,t,r)}logDocumentOpen(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(L.omniboxAnalytics,JC(t))}logOmniboxAnalytics(t){return j(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(L.omniboxFromLink,JC(t))}logOmniboxFromLink(t){return j(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(L.searchFromLink)}logSearchFromLink(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(L.triggerNotify,t)}logTriggerNotify(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(L.triggerExecute,t)}logTriggerExecute(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(L.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(L.undoTriggerQuery,t)}logUndoTriggerQuery(t){return j(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(L.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(L.pagerResize,t)}logPagerResize(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(L.pagerNumber,t)}logPagerNumber(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(L.pagerNext,t)}logPagerNext(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(L.pagerPrevious,t)}logPagerPrevious(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(L.pagerScrolling)}logPagerScrolling(){return j(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(L.facetClearAll,t)}logFacetClearAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(L.facetSearch,t)}logFacetSearch(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(L.facetSelect,t)}logFacetSelect(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(L.facetDeselect,t)}logFacetDeselect(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(L.facetExclude,t)}logFacetExclude(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(L.facetUnexclude,t)}logFacetUnexclude(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(L.facetSelectAll,t)}logFacetSelectAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(L.facetUpdateSort,t)}logFacetUpdateSort(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(L.facetShowMore,t)}logFacetShowMore(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(L.facetShowLess,t)}logFacetShowLess(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(L.queryError,t)}logQueryError(t){return j(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorBack);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorBack)})}})}logQueryErrorBack(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorRetry);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorRetry)})}})}logQueryErrorRetry(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorClear);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorClear)})}})}logQueryErrorClear(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(L.likeSmartSnippet)}logLikeSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(L.dislikeSmartSnippet)}logDislikeSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(L.expandSmartSnippet)}logExpandSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(L.collapseSmartSnippet)}logCollapseSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return j(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(L.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(L.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(L.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(L.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(L.copyToClipboard,t,r)}logCopyToClipboard(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(L.recentQueryClick)}logRecentQueryClick(){return j(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(L.clearRecentQueries)}logClearRecentQueries(){return j(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(L.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(L.clearRecentResults)}logClearRecentResults(){return j(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(L.noResultsBack)}logNoResultsBack(){return j(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(L.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(L.showLessFoldedResults)}logShowLessFoldedResults(){return j(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 j(this,arguments,void 0,function*(n,a,o=KC[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),a),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:o,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return j(this,arguments,void 0,function*(n,a,o=KC[n]){return(yield this.makeCustomEvent(n,a,o)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return j(this,void 0,void 0,function*(){let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),o=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(o);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return j(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return j(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),a=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(a,t),log:({searchUID:o})=>a.log({searchQueryUid:o})}})}makeClickEvent(t,r,n,a){return j(this,void 0,void 0,function*(){let o=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),a))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(o);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,a){return j(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,a)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return j(this,void 0,void 0,function*(){var n,a;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(a=(n=this.provider).getGeneratedAnswerMetadata)===null||a===void 0?void 0:a.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return j(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 $r?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(L.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(L.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(L.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return j(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(L.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(L.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(L.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(L.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(L.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(L.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(L.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(L.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(L.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return j(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(L.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Vd=Object.assign({},Wu),XC=Object.keys(Vd).map(e=>Vd[e]),Li=class extends Dy{constructor({client:t,uuidGenerator:r=yo}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>XC.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(XC.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Vd.pageview,{newEventType:Te.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Vd.event,{newEventType:Te.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let a=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}:{}),o=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},o),a),r)}getTicketPayload(){return _0(this.ticket)}};Li.Id="svc";var Ld;(function(e){e.click="click",e.flowStart="flowStart"})(Ld||(Ld={}));var pr;(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"})(pr||(pr={}));var Ud;(function(e){e.quit="Quit",e.solved="Solved"})(Ud||(Ud={}));var Qd=class{constructor(t,r){var n;this.options=t,this.provider=r;let a=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Md();this.coveoAnalyticsClient=a?new $r(t):new Qi,this.svc=new Li({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Qi,this.svc=new Li({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new $r(this.options),this.svc=new Li({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(pr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(pr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(pr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(pr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(pr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(pr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(pr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(pr.caseCancelled,{reason:Ud.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(pr.caseSolved,{reason:Ud.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(pr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ld.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ld.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return j(this,void 0,void 0,function*(){var r,n;let a=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:a,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 $r?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,a,o;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:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel2(),originLevel3:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel3()}}logClickEvent(t,r,n,a){return j(this,void 0,void 0,function*(){var o,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),a))),{searchQueryUid:(i=(o=this.provider)===null||o===void 0?void 0:o.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var Sa=()=>"default";var TD=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},So=class{constructor(t){this.getState=t;Ne(this,"state");this.state=t()}getLanguage(){return TD(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},a={};for(let[o,i]of Object.entries(n)){let p=`context_${o}`;a[p]=i}return r.analytics.analyticsMode==="legacy"&&(a.coveoHeadlessVersion=ha),a}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||Sa()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var cb=e=>new $r(e).getCurrentVisitorId(),Ju=(e,t)=>typeof t=="function"?(...r)=>{let n=ku(r[0]);try{return t.apply(t,r)}catch(a){return e.error(a,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Xu=(e,t)=>(...r)=>{let n=ku(r[1]);try{return t.apply(t,r)}catch(a){return e.error(a,"Error in analytics hook. Returning original request."),n}};var Zu=class extends So{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},ub=({logger:e,getState:t,analyticsClientMiddleware:r=(o,i)=>i,preprocessRequest:n,provider:a=new Zu(t)})=>{let o=t(),i=o.configuration.accessToken,p=o.configuration.analytics.apiBaseUrl??it(o.configuration.organizationId,o.configuration.environment,"analytics"),f=o.configuration.analytics.runtimeEnvironment,m=o.configuration.analytics.enabled,g=new Qd({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Ju(e,n),beforeSendHooks:[Xu(e,r),(A,x)=>(e.info({...x,type:A,endpoint:p,token:i},"Analytics request"),x)]},a);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Bi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function PD(e,t){return!!t&&t.facetId in e.facetSet}var _r=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),Bd=(e,t)=>e.facetSet[t]?.request,Gi=(e,t)=>{let r=_r(e,t);return PD(e,r)?r:void 0},lb=(e,t)=>Gi(e,t)?.values.filter(r=>r.state==="selected")||[],db=(e,t)=>Gi(e,t)?.values.filter(r=>r.state!=="idle")||[],Hr=e=>e.search.isLoading;d();c();l();u();function pb(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(a=>a.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function or(e){let{activeValue:t,ancestryMap:r}=kD(e);return t?OD(t,r):[]}function kD(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 a of n.children)r.set(a,n);t.unshift(...n.children)}return{}}function OD(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function ND(e,t){return!!t&&t.facetId in e.categoryFacetSet}var Wy=(e,t)=>{let r=_r(e,t);if(ND(e,r))return r},Ky=(e,t)=>e.categoryFacetSet[t]?.request,fb=(e,t)=>{let r=Wy(e,t);return or(r?.values??[])},Yy=(e,t)=>{let r=Ky(e,t);return or(r?.currentValues??[])};d();c();l();u();function $i(){return{}}d();c();l();u();function mb(e,t){return{request:e,tabs:t}}function Hi(){return{}}d();c();l();u();function gb(e,t){return{request:e,tabs:t}}function zi(){return{}}d();c();l();u();function hb(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function Wi(){return{}}var Ki=(e,t)=>{let r=Ab(t,e),n=r?r.field:"",a=Xy(n,e);return{facetId:e,facetField:n,facetTitle:a}};function Yi(e,t){let{facetId:r,facetValue:n}=e,a=Ki(r,t),o=xb(t,r);return{...a,facetValue:o==="hierarchical"?vb(t,r):n}}function ir(e){return{facetSet:e.facetSet??Wi(),categoryFacetSet:e.categoryFacetSet??$i(),dateFacetSet:e.dateFacetSet??Hi(),numericFacetSet:e.numericFacetSet??zi(),automaticFacetSet:e.automaticFacetSet??Bi()}}var Jy=e=>{let t=[];return qD(e).forEach((r,n)=>{let a=xb(e,r.facetId),o=UD(r,n+1);if(DD(r)){if(!!!Yy(e,r.facetId).length)return;t.push({...o,...VD(e,r.facetId),facetType:a,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=yb(i,p+1,a),m=_D(r)?Sb(i):jD(i);t.push({...o,...f,...m})})}),MD(e).forEach((r,n)=>{let a=LD(r,n+1);r.values.forEach((o,i)=>{if(o.state==="idle")return;let p=yb(o,i+1,"specific"),f=Sb(o);t.push({...a,...p,...f})})}),t},_D=e=>e.type==="specific",DD=e=>e.type==="hierarchical",qD=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),MD=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),yb=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),jD=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Sb=e=>({displayValue:e.value,value:e.value}),vb=(e,t)=>Yy(e,t).map(n=>n.value).join(";"),VD=(e,t)=>{let n=vb(e,t);return{value:n,valuePosition:1,displayValue:n}},LD=(e,t)=>({title:Xy(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),UD=(e,t)=>({title:Xy(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Xy=(e,t)=>`${e}_${t}`,Ab=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,xb=(e,t)=>{let r=Ab(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var Zy=e=>e.configuration.search.locale,Cb=e=>e.configuration.search.timezone,Gd=e=>e.configuration.accessToken,$d=e=>e.configuration.organizationId,Hd=e=>e.configuration.environment,va=e=>e.configuration?.knowledge?.agentId;var $e=e=>{if(QD(e)||eS(e))return e.generatedAnswer?.answerId;if(BD(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},QD=e=>"answer"in e&&"generatedAnswer"in e&&!le(e.generatedAnswer?.answerConfigurationId),eS=e=>{let t=va(e);return"answerGenerationApi"in e&&"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},BD=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",tS=e=>e.generatedAnswer?.fieldsToIncludeInCitations,el=Ye(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var dt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var tl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(tl||{}),vo=(o=>(o.Relevancy="relevancy",o.QRE="qre",o.Date="date",o.Field="field",o.NoSort="nosort",o))(vo||{}),zr=e=>{if(bi(e))return e.map(t=>zr(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""}},Ji=()=>({by:"relevancy"}),zd=e=>({by:"date",order:e}),Wd=(e,t)=>({by:"field",order:t,field:e}),Kd=()=>({by:"qre"}),Yd=()=>({by:"nosort"}),bb=new J({values:{by:new Pu({enum:vo,required:!0}),order:new Pu({enum:tl}),field:new M}});function mr(){return zr(Ji())}d();c();l();u();d();c();l();u();d();c();l();u();var Xi=class e{static set(t,r,n){let a,o,i;n&&(o=new Date,o.setTime(o.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?rS(t,r,o):(i=p.split("."),a=i[i.length-2]+"."+i[i.length-1],rS(t,r,o,a))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let a=0;a<n.length;a++){let o=n[a];if(o=o.replace(/^\s+/,""),o.lastIndexOf(r,0)===0)return o.substring(r.length,o.length)}return null}static erase(t){e.set(t,"",-1)}};function rS(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function GD(){return typeof navigator<"u"}function wb(){try{return typeof localStorage<"u"}catch{return!1}}function Rb(){try{return typeof sessionStorage<"u"}catch{return!1}}function Fb(){return!!(GD()&&navigator.cookieEnabled)}var Eb=null;function Ib(){return Eb||(wb()?localStorage:Fb()?new nS:Rb()?sessionStorage:new aS)}var Zi=class Zi{getItem(t){return Xi.get(`${Zi.prefix}${t}`)}removeItem(t){Xi.erase(`${Zi.prefix}${t}`)}setItem(t,r,n){Xi.set(`${Zi.prefix}${t}`,r,n)}};Ne(Zi,"prefix","coveo_");var nS=Zi;var aS=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Jd="__coveo.analytics.history",$D=20,HD=1e3*60,zD=75,Ao=class Ao{constructor(t){Ne(this,"store");this.store=t||Ib()}static getInstance(t){return Ao.instance||(Ao.instance=new Ao(t)),Ao.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(Jd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Jd);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Jd,JSON.stringify(t.slice(0,$D)))}catch{}}clear(){try{this.store.removeItem(Jd)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,a)=>(a.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,zD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>HD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:a,value:o}=r;return{name:n,time:a,value:o}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:a}=t;return r&&typeof a=="string"&&r.toLowerCase()==="query"&&a.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};Ne(Ao,"instance",null);var oS=Ao,Wt=oS;var rl=class rl extends So{constructor(){super(...arguments);Ne(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 Jy(ir(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||rl.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||nr().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||rl.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),a=$e(r);return a&&(n.generativeQuestionAnsweringId=a),n}getFacetMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetValue:n,facetTitle:`${o}_${r}`}}getFacetClearAllMetadata(r){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetTitle:`${a}_${r}`}}getFacetUpdateSortMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,criteria:n,facetTitle:`${o}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${o}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??mr()}}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 o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:o,categoryFacetPath:n,categoryFacetTitle:`${o}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let a=this.state.querySuggest?.[r],o=a.completions.map(m=>m.expression),i=a.partialQueries.length-1,p=a.partialQueries[i]||"",f=a.responseId;return{...this.getBaseMetadata(),suggestionRanking:o.indexOf(n),partialQuery:p,partialQueries:a.partialQueries.length>0?a.partialQueries:"",suggestions:o.length>0?o:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||dt().q}get responseTime(){return this.state.search?.duration||nr().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||nr().response.totalCountFiltered}};Ne(rl,"fallbackPipelineName","default");var Aa=rl,Tb=({logger:e,getState:t,analyticsClientMiddleware:r=(o,i)=>i,preprocessRequest:n,provider:a})=>{let o=t(),i=o.configuration.accessToken,p=o.configuration.analytics.apiBaseUrl??it(o.configuration.organizationId,o.configuration.environment,"analytics"),f=o.configuration.analytics.runtimeEnvironment,m=o.configuration.analytics.enabled,g=new jd({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Ju(e,n),beforeSendHooks:[Xu(e,r),(A,x)=>(e.info({...x,type:A,endpoint:p,token:i},"Analytics request"),x)]},a);return m||g.disable(),g},iS=()=>{let t=Wt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Xd(e){let t=Pb(e),r=[e,...t].filter(a=>a.parentResult).map(a=>a.parentResult);return nx([e,...t,...r],a=>a.uniqueId)}function Pb(e){return e.childResults?e.childResults.flatMap(t=>[t,...Pb(t)]):[]}d();c();l();u();var Ln=()=>"";function kb(e,t){return{...new Aa(t).getBaseMetadata(),actionCause:e,type:e}}function WD(e){return Object.assign(e,{instantlyCallable:!0})}function KD(e,t){let r=o=>WD(Se(e,o)),n=r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(o,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x13,_x14){return _ref9.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref0=_asyncToGenerator(function*({getState:o,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:o,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(A,{getState:x,extra:h}){return yield g({state:x(),extra:h})});return function(_x16,_x17){return _ref1.apply(this,arguments)}}())}});return function prepare(_x15){return _ref0.apply(this,arguments)}}()}),n}var Ob=(e,t,r)=>{function n(...a){let o=a.length===1?{...a[0],__legacy__getBuilder:t(a[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:a[0],__legacy__getBuilder:t(a[1]),__legacy__provider:a[2],analyticsConfigurator:e,providerClass:r};return XD(o)}return n},YD=e=>e.configuration.analytics.analyticsMode==="legacy",JD=e=>e.configuration.analytics.analyticsMode==="next",XD=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:a,analyticsConfigurator:o,providerClass:i})=>(r??(r=p=>new i(p)),KD(e,/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let A=[],x={log:function(){var _ref11=_asyncToGenerator(function*({state:b}){for(let F of A)yield F(b)});return function log(_x19){return _ref11.apply(this,arguments)}}()},h=p(),C=o({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),R=yield t(C,p());x.description=R?.description,A.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(b){YD(b)&&(yield ZD(R,r,b,g,C.coveoAnalyticsClient))});return function(_x20){return _ref12.apply(this,arguments)}}());let{emit:w}=zu(h);return A.push(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(b){if(JD(b)&&a&&n){let F=n(b);yield cq(w,a,F)}});return function(_x21){return _ref13.apply(this,arguments)}}()),x});return function(_x18){return _ref10.apply(this,arguments)}}()));function ZD(_x22,_x23,_x24,_x25,_x26){return _ZD.apply(this,arguments)}function _ZD(){_ZD=_asyncToGenerator(function*(e,t,r,n,a){t(()=>r);let o=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:a,response:o},"Analytics response")});return _ZD.apply(this,arguments)}var eq=e=>r=>(n,a)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref14=_asyncToGenerator(function*(o){r(n,a)});return function log(_x27){return _ref14.apply(this,arguments)}}()}),Y=Ob(e=>Tb({...e,provider:e.provider||new Aa(e.getState)}),e=>e,Aa),_9=Ob(ub,eq("caseAssist"),Zu);var pt=(e,t)=>{let r=o=>o+(t.pagination?.firstResult??0),n=-1,a=t.search?.results;return n=qb(e,a),n<0&&(n=sq(e,a)),n<0&&(n=0),rq(e,r(n),t)};var Nb=(e,t)=>({sourceName:tq(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Ln()});function tq(e){let t=e.source;return le(t)?"unknown":t}var _b=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function rq(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:oq(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:iq(e),queryPipeline:r.pipeline||Ln()}}var He=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||""}),Db={urihash:new M,sourcetype:new M,permanentid:new M},Zd={uniqueId:z,raw:new J({values:Db}),title:z,uri:z,clickUri:z,rankingModifier:new M({required:!1,emptyAllowed:!0})};function nq(e){return Object.assign({},...Object.keys(Db).map(t=>({[t]:e[t]})))}function aq(e){return Object.assign({},...Object.keys(Zd).map(t=>({[t]:e[t]})),{raw:nq(e.raw)})}function oq(e){let t=e.raw.author;return le(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function iq(e){let t=e.raw.source;return le(t)?"unknown":t}var Kt=e=>new ge(Zd).validate(aq(e));function sq(e,t){for(let[r,n]of t.entries()){let a=Xd(n);if(qb(e,a)!==-1)return r}return-1}function qb(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function cq(_x28,_x29,_x30){return _cq.apply(this,arguments)}function _cq(){_cq=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _cq.apply(this,arguments)}d();c();l();u();var sS=e=>O(e,{evt:z,type:st}),Mb=e=>Y("analytics/generic/search",t=>{sS(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),jb=e=>Y("analytics/generic/click",(t,r)=>(Kt(e.result),sS(e),t.makeClickEvent(e.evt,pt(e.result,r),He(e.result),e.meta))),Vb=e=>Y("analytics/generic/custom",t=>(sS(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),ep=()=>Y("analytics/interface/load",e=>e.makeInterfaceLoad()),xa=()=>Y("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),tp=()=>Y("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),rp=e=>Y("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),Lb=()=>({actionCause:"interfaceLoad"}),es=()=>({actionCause:"interfaceChange"}),Ub=()=>({actionCause:"searchFromLink"}),Qb=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var cS=()=>st,Bb=()=>z,Wr=T("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new M({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),gr=T("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new M({required:!1,url:!0}),pipeline:new M({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new oe({required:!1,each:z})})),uq={enabled:new ce({default:!0}),originContext:cS(),originLevel2:cS(),originLevel3:cS(),proxyBaseUrl:new M({required:!1,url:!0}),runtimeEnvironment:new Le,anonymous:new ce({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:Dx,analyticsMode:new M({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new J({options:{required:!1},values:VC.reduce((e,t)=>(e[t]=_x,e),{})})},Ca=T("configuration/updateAnalyticsConfiguration",e=>O(e,uq)),ts=T("configuration/analytics/disable"),rs=T("configuration/analytics/enable"),np=T("configuration/analytics/originlevel2",e=>O(e,{originLevel2:Bb()})),ap=T("configuration/analytics/originlevel3",e=>O(e,{originLevel3:Bb()})),op=T("knowledge/setAgentId",e=>O(e,new M({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var ip={q:new M,enableQuerySyntax:new ce,aq:new M,cq:new M,firstResult:new ee({min:0}),numberOfResults:new ee({min:0}),sortCriteria:new M,f:new J,fExcluded:new J,cf:new J,nf:new J,mnf:new J,df:new J,debug:new ce,sf:new J,tab:new M,af:new J};var De=T("searchParameters/restore",e=>O(e,ip)),ns=T("searchParameters/restoreTab",e=>O(e,z));d();c();l();u();var ba=T("debug/enable"),as=T("debug/disable");d();c();l();u();var wa=()=>!1;var os=ae(wa(),e=>{e.addCase(ba,()=>!0).addCase(as,()=>!1).addCase(De,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var uS=T("history/undo"),lS=T("history/redo"),sr=T("history/snapshot"),nl=Se("history/back",/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e,{dispatch:t}){t(uS()),yield t(_e())});return function(_x31,_x32){return _ref15.apply(this,arguments)}}()),sp=Se("history/forward",/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,{dispatch:t}){t(lS()),yield t(_e())});return function(_x33,_x34){return _ref16.apply(this,arguments)}}()),_e=Se("history/change",/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x35,_x36){return _ref17.apply(this,arguments)}}());d();c();l();u();var is=T("pipeline/set",e=>O(e,new M({required:!0,emptyAllowed:!0})));var ss=ae(Ln(),e=>{e.addCase(is,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(gr,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var ft=T("breadcrumb/deselectAll"),cs=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var Kr=T("facet/updateFacetAutoSelection",e=>O(e,{allow:new ce({required:!0})}));d();c();l();u();d();c();l();u();var al=class extends Aa{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let a in r[n].cache)if(r[n].cache[a].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let a in r[n].cache)if(r[n].cache[a].isActive)return r[n].cache[a];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??dt().q}get responseTime(){return this.activeInstantResultCache?.duration??nr().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??nr().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Gb=e=>Y({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Kt(e),t.makeDocumentOpen(pt(e,r),He(e))),__legacy__provider:t=>new al(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),$b=()=>Y("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new al(e)),Hb=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var dS={id:z},lq={...dS,q:Ue},us=T("instantResults/register",e=>O(e,dS)),Yr=T("instantResults/updateQuery",e=>O(e,lq)),ls=T("instantResults/clearExpired",e=>O(e,dS));d();c();l();u();var cp=new ee({required:!0,min:0}),ds=T("pagination/registerNumberOfResults",e=>O(e,cp)),ps=T("pagination/updateNumberOfResults",e=>O(e,cp)),fs=T("pagination/registerPage",e=>O(e,cp)),Jr=T("pagination/updatePage",e=>O(e,cp)),ms=T("pagination/nextPage"),gs=T("pagination/previousPage");d();c();l();u();var Dt=T("query/updateQuery",e=>O(e,{q:new M,enableQuerySyntax:new ce}));d();c();l();u();d();c();l();u();var Un=(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:ji(e)}});var hs=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ut(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&&Un(e.configuration.analytics,t,r)),...(e.excerptLength&&!le(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();d();c();l();u();var ys=/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield cb(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}),...(iS()&&{pageId:iS()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:ji(e)})}}});return function ys(_x37,_x38){return _ref18.apply(this,arguments)}}();var Ra=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ut(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:Wt.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 ys(e.configuration.analytics,t))),...(e.excerptLength&&!le(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Ra(_x39,_x40){return _ref19.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Dr=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var pS=()=>Y("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Fa=e=>Y("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||dt().q,aq:r.advancedSearchQueries?.aq||Dr().aq,cq:r.advancedSearchQueries?.cq||Dr().cq,dq:r.advancedSearchQueries?.dq||Dr().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var il=Or(up(),1),Jb=Or(zb(),1);d();c();l();u();var lp=Or(up(),1),Kb=Or(Wb(),1);lp.default.extend(Kb.default);var Ss="YYYY/MM/DD@HH:mm:ss",dq="1401-01-01";function xo(e,t){let r=(0,lp.default)(e,t);return!r.isValid()&&!t?(0,lp.default)(e,Ss):r}function ol(e){return e.format(Ss)}function Yb(e){return ol(xo(e))===e}function dp(e,t){let r=xo(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.",a=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?a:n}`)}vS(r)}function vS(e){if(e.isBefore(dq))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}il.default.extend(Jb.default);var Xb=["past","now","next"],Zb=["minute","hour","day","week","month","quarter","year"],pq=e=>{let t=e==="now";return{amount:new ee({required:!t,min:1}),unit:new M({required:!t,constrainTo:Zb}),period:new M({required:!0,constrainTo:Xb})}};function Ea(e){if(typeof e=="string"&&!Xr(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?AS(e):e;new ge(pq(t.period)).validate(t);let r=tw(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);vS(r)}function ew(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function tw(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,il.default)().subtract(r,n);case"next":return(0,il.default)().add(r,n);case"now":return(0,il.default)()}}function sl(e){return ol(tw(AS(e)))}function rw(e){return e.toLocaleLowerCase().split("-")}function Xr(e){let[t,r,n]=rw(e);if(t==="now")return!0;if(!Xb.includes(t)||!Zb.includes(n))return!1;let a=parseInt(r);return!(Number.isNaN(a)||a<=0)}function nw(e){return!!e&&typeof e=="object"&&"period"in e}function AS(e){let[t,r,n]=rw(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}function aw(e){return Ea(e),AS(e)}d();c();l();u();function ow(e){return e.type==="dateRange"}function iw(e){return`start${e}`}function sw(e){return`end${e}`}var xS=()=>({dateFacetValueMap:{}});function fq(e,t,r){let n=e.start,a=e.end;return Xr(n)&&(n=sl(n),r.dateFacetValueMap[t][iw(n)]=e.start),Xr(a)&&(a=sl(a),r.dateFacetValueMap[t][sw(a)]=e.end),{...e,start:n,end:a}}function CS(e,t){if(ow(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(a=>fq(a,r,t))}}return e}function Ia(e){let t=xS();return{request:{...e,facets:e.facets?.map(n=>CS(n,t))},mappings:t}}function mq(e,t,r){return{...e,start:r.dateFacetValueMap[t][iw(e.start)]||e.start,end:r.dateFacetValueMap[t][sw(e.end)]||e.end}}function gq(e,t){return e.facetId in t.dateFacetValueMap}function hq(e,t){return gq(e,t)?{...e,values:e.values.map(r=>mq(r,e.facetId,t))}:e}function pp(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>hq(n,t))}}:e}d();c();l();u();d();c();l();u();var vs=T("didYouMean/enable"),fp=T("didYouMean/disable"),As=T("didYouMean/automaticCorrections/disable"),mp=T("didYouMean/automaticCorrections/enable"),hr=T("didYouMean/correction",e=>O(e,z)),Co=T("didYouMean/automaticCorrections/mode",e=>O(e,new M({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var gp=()=>Y("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),bS=()=>Y("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),cw=()=>({actionCause:"didYouMeanClick"}),uw=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function hp(){return{contextValues:{}}}d();c();l();u();function yp(){return{contextValues:{}}}d();c();l();u();function wS(){return{enabled:!0,tabs:{}}}function Sp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function vp(){return[]}d();c();l();u();function yr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Ap(){return{}}d();c();l();u();function xp(){return{}}d();c();l();u();function Cp(){return{}}function lw(){return qr({})}function qr(e){return{context:e.context||hp(),dictionaryFieldContext:e.dictionaryFieldContext||yp(),facetSet:e.facetSet||Wi(),numericFacetSet:e.numericFacetSet||zi(),dateFacetSet:e.dateFacetSet||Hi(),categoryFacetSet:e.categoryFacetSet||$i(),automaticFacetSet:e.automaticFacetSet??Bi(),pagination:e.pagination||yr(),query:e.query||dt(),tabSet:e.tabSet||Cp(),advancedSearchQueries:e.advancedSearchQueries||Dr(),staticFilterSet:e.staticFilterSet||xp(),querySet:e.querySet||Ap(),sortCriteria:e.sortCriteria||mr(),pipeline:e.pipeline||Ln(),searchHub:e.searchHub||Sa(),facetOptions:e.facetOptions||Sp(),facetOrder:e.facetOrder??vp(),debug:e.debug??wa()}}d();c();l();u();var yq=new J({values:{undoneQuery:Ue},options:{required:!0}}),bp=()=>Y("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),wp=e=>Y("analytics/trigger/query/undo",t=>(O(e,yq),t.makeUndoTriggerQuery(e))),Rp=()=>Y("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Fp=()=>Y("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),Ep=()=>Y("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var Ta=T("trigger/query/ignore",e=>O(e,new M({emptyAllowed:!0,required:!0}))),xs=T("trigger/query/modification",e=>O(e,new J({values:{originalQuery:st,modification:st}})));d();c();l();u();d();c();l();u();d();c();l();u();function Pa(e){return Object.values(e).map(t=>t.request)}function cl(e,t){let r={};e.forEach(o=>{r[o.facetId]=o});let n=[];t.forEach(o=>{o in r&&(n.push(r[o]),delete r[o])});let a=Object.values(r);return[...n,...a]}function dw(e){return Pa(e).map(t=>{let n=t.currentValues.some(({state:a})=>a!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var RS={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function Sq(e){return Pa(e).map(t=>{let r=RS[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function vq(e){return[...Sq(e.facetSet??{}),...dw(e.numericFacetSet??{}),...dw(e.dateFacetSet??{}),...Pa(e.categoryFacetSet??{})]}function Aq(e){return vq(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Ip(e){return cl(Aq(e),e.facetOrder??[])}d();c();l();u();var ka=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,t){let r=bq(e),n=Ip(e),a=xq(e),o=yield Ra(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Ia({...o,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function ka(_x41,_x42){return _ref20.apply(this,arguments)}}();function xq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Cq).filter(r=>r.currentValues.length>0):void 0}function Cq(e){let{field:t,label:r,values:n}=e,a=n.filter(o=>o.state==="selected");return{field:t,label:r,currentValues:a}}function bq(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(o=>o.isActive)?.expression.trim()||"",a=wq(e);return[t,n,...a].filter(o=>!!o).join(" AND ")}function wq(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(o=>o.state==="selected"&&!!o.expression.trim()),a=n.map(o=>o.expression).join(" OR ");return n.length>1?`(${a})`:a})}var Oa=class{constructor(t,r=n=>{this.dispatch(Dt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x43,_x44){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let a=Date.now(),o=pp(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-a,p=_this10.getState().query?.q||"";return{response:o,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return yt(t.response)?(this.dispatch(Fa(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:a,automaticallyCorrectQuery:o}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!a||!o)return null;let m=i.length===0&&p&&p.length!==0,g=!le(f)&&!le(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(sr(qr(_this12.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:a}=n.queryCorrections[0],o=yield _this13.automaticallyRetryQueryWithCorrection(a);return yt(o.response)?(_this13.dispatch(Fa(o.response.error)),_this13.rejectWithValue(o.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(sr(qr(_this13.getState()))),{...o,response:{...o.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:bS()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:a}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:a,analyticsAction:bS()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Ta("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let o=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return yt(i.response)?(_this14.dispatch(Fa(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(sr(qr(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:o,analyticsAction:bp()})})()}getStateAfterResponse(t,r,n,a){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...nr(),duration:r,response:a,results:a.results}}}processSuccessResponse(t){return this.dispatch(sr(qr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return ld(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield ka(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(hr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(xs({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield ka(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var pw=Se("search/executeSearch",/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Tp(r,t,e)});return function(_x45,_x46){return _ref21.apply(this,arguments)}}()),fw=Se("search/fetchPage",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){let r=t.getState();return yield ES(r,t,e)});return function(_x47,_x48){return _ref22.apply(this,arguments)}}()),mw=Se("search/fetchMoreResults",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=t.getState();return yield IS(t,r)});return function(_x49,_x50){return _ref23.apply(this,arguments)}}()),gw=Se("search/fetchFacetValues",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Iq(t,e,r)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),hw=Se("search/fetchInstantResults",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){return FS(e,t)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),Rq=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=yield ka(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function Rq(_x55,_x56){return _ref26.apply(this,arguments)}}(),Fq=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t,r){let n=yield Ra(e);return Ia({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function Fq(_x57,_x58,_x59){return _ref27.apply(this,arguments)}}(),Eq=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=yield ka(e,t);return r.request.numberOfResults=0,r});return function Eq(_x60,_x61){return _ref28.apply(this,arguments)}}(),yw=e=>{e.configuration.analytics.enabled&&Wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function FS(_x62,_x63){return _FS.apply(this,arguments)}function _FS(){_FS=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee});let{q:r,maxResultsPerQuery:n}=e,a=t.getState(),o=new Oa({...t,analyticsAction:$b()},m=>{t.dispatch(Yr({q:m,id:e.id}))}),i=yield Fq(a,r,n),p=yield o.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield o.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _FS.apply(this,arguments)}function ES(_x64,_x65,_x66){return _ES.apply(this,arguments)}function _ES(){_ES=_asyncToGenerator(function*(e,t,r){yw(e);let{analyticsClientMiddleware:n,preprocessRequest:a,logger:o}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:a,logger:o}),p=new Oa({...t,analyticsAction:r}),f=yield ka(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _ES.apply(this,arguments)}function IS(_x67,_x68){return _IS.apply(this,arguments)}function _IS(){_IS=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:a}=e.extra,{description:o}=yield pS().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:a}),i=new Oa({...e,analyticsAction:pS()}),p=yield Rq(t,o),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _IS.apply(this,arguments)}function Iq(_x69,_x70,_x71){return _Iq.apply(this,arguments)}function _Iq(){_Iq=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:a,logger:o}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:a,logger:o}),p=new Oa({...e,analyticsAction:t}),f=yield Eq(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _Iq.apply(this,arguments)}function Tp(_x72,_x73,_x74){return _Tp.apply(this,arguments)}function _Tp(){_Tp=_asyncToGenerator(function*(e,t,r){yw(e);let{analyticsClientMiddleware:n,preprocessRequest:a,logger:o}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:a,logger:o}),p=yield ka(e,i),f=new Oa({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Tp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var Sw=Ye(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(o=>o.state==="selected"&&!!o.expression.trim()),a=n.map(o=>o.expression).join(" OR ");return n.length>1?`(${a})`:a}));var Sr=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t,r){let n=PS(e),a=Tq(e),o=Pq(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield Ra(e,r):hs(e,t,r);return Ia({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(a.length&&{facets:a}),...(e.pagination&&{numberOfResults:TS(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:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Sr(_x75,_x76,_x77){return _ref29.apply(this,arguments)}}();function TS(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function Tq(e){return cl(Oq(e),e.facetOrder??[])}function Pq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(kq).filter(r=>r.currentValues.length>0):void 0}function kq(e){let{field:t,label:r,values:n}=e,a=n.filter(o=>o.state==="selected");return{field:t,label:r,currentValues:a}}function Oq(e){return Nq(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Nq(e){return[..._q(e.facetSet??{}),...vw(e.numericFacetSet??{}),...vw(e.dateFacetSet??{}),...Pa(e.categoryFacetSet??{})]}function _q(e){return Pa(e).map(t=>{let r=RS[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function vw(e){return Pa(e).map(t=>{let r=t.currentValues,n=r.some(({state:o})=>o!=="idle"),a=r.some(o=>o.previousState);return t.generateAutomaticRanges&&!n&&!a?{...t,currentValues:[]}:t})}function PS(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(o=>o.isActive)?.expression.trim()||"",a=Sw(e);return[t,n,...a].filter(o=>!!o).join(" AND ")}var Na=class{constructor(t,r=n=>{this.dispatch(Dt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x78,_x79){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let a=Date.now(),o=pp(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-a,p=_this17.getState().query?.q||"";return{response:o,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return yt(t.response)?(this.dispatch(Fa(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:a,automaticallyCorrectQuery:o}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!a||!o)return null;let m=i.length===0&&p&&p.length!==0,g=!le(f)&&!le(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(sr(qr(_this19.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:a}=n.queryCorrections[0],o=yield _this20.automaticallyRetryQueryWithCorrection(a);return yt(o.response)?(_this20.dispatch(Fa(o.response.error)),_this20.rejectWithValue(o.response.error)):(_this20.dispatch(sr(qr(_this20.getState()))),{...o,response:{...o.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:a}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:a}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Ta("")),null;let o=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return yt(i.response)?(_this21.dispatch(Fa(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(sr(qr(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:o})})()}processSuccessResponse(t){return this.dispatch(sr(qr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return ld(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=uw(),a=yield _this22.fetchFromAPI(yield Sr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(hr(t)),a})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(xs({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield Sr(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Cs=Se("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new M,enableQuerySyntax:new ce,clearFilters:new ce}),e.clearFilters&&(r(ft()),r(cs())),r(Kr({allow:!0})),r(Dt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Jr(1))}),Aw=T("search/updateSearchAction"),G=Se("search/executeSearch",/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Tp(r,t,e.legacy);xw(r);let n=e.next?Cw(e.next):void 0,a=yield Sr(r,t.extra.navigatorContext,n),o=new Na({...t,analyticsAction:n??{}}),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x80,_x81){return _ref30.apply(this,arguments)}}()),qt=Se("search/fetchPage",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();if(xw(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return ES(r,t,e.legacy);let n=new Na({...t,analyticsAction:e.next}),a=yield Sr(r,t.extra.navigatorContext,e.next),o=yield n.fetchFromAPI(a,{origin:"mainSearch"});return yield n.process(o)});return function(_x82,_x83){return _ref31.apply(this,arguments)}}()),vr=Se("search/fetchMoreResults",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return IS(t,r);let n=kb("browseResults",t.getState),a=new Na({...t,analyticsAction:n}),o=yield Dq(r,t.extra.navigatorContext,n),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x84,_x85){return _ref32.apply(this,arguments)}}()),Ar=Se("search/fetchFacetValues",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Tp(r,t,e.legacy);let n=new Na({...t,analyticsAction:{}}),a=yield Mq(r,t.extra.navigatorContext),o=yield n.fetchFromAPI(a,{origin:"facetValues"});return yield n.process(o)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),bs=Se("search/fetchInstantResults",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return FS(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee});let{q:n,maxResultsPerQuery:a}=e,o=Cw(Hb()),i=yield qq(r,t.extra.navigatorContext,n,a,o),p=new Na({...t,analyticsAction:o},g=>{t.dispatch(Yr({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),Dq=/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t,r){let n=yield Sr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function Dq(_x90,_x91,_x92){return _ref35.apply(this,arguments)}}(),qq=/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t,r,n,a){let o=hs(e,t,a);return Ia({...o,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function qq(_x93,_x94,_x95,_x96,_x97){return _ref36.apply(this,arguments)}}(),Mq=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t,r){let n=yield Sr(e,t,r);return n.request.numberOfResults=0,n});return function Mq(_x98,_x99,_x100){return _ref37.apply(this,arguments)}}(),xw=e=>{e.configuration.analytics.enabled&&Wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Cw=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var _a=(e,t)=>{let r=e;return le(r[t])?le(e.raw[t])?null:e.raw[t]:r[t]},jq=e=>t=>e.every(r=>!le(_a(t,r))),Vq=e=>t=>e.every(r=>le(_a(t,r))),Lq=(e,t)=>r=>{let n=bw(e,r);return t.some(a=>n.some(o=>`${o}`.toLowerCase()===a.toLowerCase()))},Uq=(e,t)=>r=>{let n=bw(e,r);return t.every(a=>n.every(o=>`${o}`.toLowerCase()!==a.toLowerCase()))},bw=(e,t)=>{let r=_a(t,e);return ed(r)?r:[r]},ww={getResultProperty:_a,fieldsMustBeDefined:jq,fieldsMustNotBeDefined:Vq,fieldMustMatch:Lq,fieldMustNotMatch:Uq};function ul(e){return e.search.response.searchUid!==""}function Rw(e,t,r){return e.search.results.find(n=>_a(n,t)===r)}var kS=Ye(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var ws=T("app/setError");function OS(e,t){let r=t.payload??null;r&&(e.response=nr().response,e.results=[],e.questionAnswer=Ii()),e.error=r,e.isLoading=!1}function NS(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function Qq(e,t){NS(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function Fw(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function Bq(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var fe=ae(nr(),e=>{e.addCase(G.rejected,(t,r)=>OS(t,r)),e.addCase(vr.rejected,(t,r)=>OS(t,r)),e.addCase(qt.rejected,(t,r)=>OS(t,r)),e.addCase(G.fulfilled,(t,r)=>{Qq(t,r)}),e.addCase(vr.fulfilled,(t,r)=>{NS(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(qt.fulfilled,(t,r)=>{NS(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Ar.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(G.pending,Fw),e.addCase(vr.pending,Bq),e.addCase(qt.pending,Fw),e.addCase(Aw,(t,r)=>{t.searchAction=r.payload}),e.addCase(ws,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var Rs=T("searchHub/set",e=>O(e,new M({required:!0,emptyAllowed:!0})));var Fs=ae(Sa(),e=>{e.addCase(Rs,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(gr,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();function Ew(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Iw=Br;function Lw(e,t){if(e===t||!(Iw(e)&&Iw(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),a=r.length===n.length,o=Array.isArray(t)?[]:{};for(let i of r)o[i]=Lw(e[i],t[i]),a&&(a=e[i]===o[i]);return a?e:o}function Es(e){let t=0;for(let r in e)t++;return t}var Tw=e=>[].concat(...e);function Gq(e){return new RegExp("(^|:)//").test(e)}function $q(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Op(e){return e!=null}function Hq(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var zq=e=>e.replace(/\/$/,""),Wq=e=>e.replace(/^\//,"");function Kq(e,t){if(!e)return t;if(!t)return e;if(Gq(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=zq(e),t=Wq(t),`${e}${r}${t}`}function Yq(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Pw=(...e)=>S(...e),Jq=e=>e.status>=200&&e.status<=299,Xq=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function kw(e){if(!Br(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function Uw({baseUrl:e,prepareHeaders:t=A=>A,fetchFn:r=Pw,paramsSerializer:n,isJsonContentType:a=Xq,jsonContentType:o="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===Pw&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(x,h,C){let{getState:R,extra:w,endpoint:b,forced:F,type:E}=h,P,{url:V,headers:_=new v(g.headers),params:k=void 0,responseHandler:N=f??"json",validateStatus:q=m??Jq,timeout:U=p,...X}=typeof x=="string"?{url:x}:x,H,B=h.signal;U&&(H=new s.AbortController,h.signal.addEventListener("abort",H.abort),B=H.signal);let Q={...g,signal:B,...X};_=new v(kw(_)),Q.headers=(yield t(_,{getState:R,arg:x,extra:w,endpoint:b,forced:F,type:E,extraOptions:C}))||_;let K=xe=>typeof xe=="object"&&(Br(xe)||Array.isArray(xe)||typeof xe.toJSON=="function");if(!Q.headers.has("content-type")&&K(Q.body)&&Q.headers.set("content-type",o),K(Q.body)&&a(Q.headers)&&(Q.body=JSON.stringify(Q.body,i)),k){let xe=~V.indexOf("?")?"&":"?",Ee=n?n(k):new URLSearchParams(kw(k));V+=xe+Ee}V=Kq(e,V);let $=new Request(V,Q);P={request:new Request(V,Q)};let re,pe=!1,we=H&&setTimeout(()=>{pe=!0,H.abort()},U);try{re=yield r($)}catch(xe){return{error:{status:pe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(xe)},meta:P}}finally{we&&clearTimeout(we),H?.signal.removeEventListener("abort",H.abort)}let ke=re.clone();P.response=ke;let Ce,Re="";try{let xe;if(yield Promise.all([A(re,N).then(Ee=>Ce=Ee,Ee=>xe=Ee),ke.text().then(Ee=>Re=Ee,()=>{})]),xe)throw xe}catch(xe){return{error:{status:"PARSING_ERROR",originalStatus:re.status,data:Re,error:String(xe)},meta:P}}return q(re,Ce)?{data:Ce,meta:P}:{error:{status:re.status,data:Ce},meta:P}});return function(_x101,_x102,_x103){return _ref38.apply(this,arguments)}}());function A(_x104,_x105){return _A2.apply(this,arguments)}function _A2(){_A2=_asyncToGenerator(function*(x,h){if(typeof h=="function")return h(x);if(h==="content-type"&&(h=a(x.headers)?"json":"text"),h==="json"){let C=yield x.text();return C.length?JSON.parse(C):null}return x.text()});return _A2.apply(this,arguments)}}var Is=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function Zq(){return _Zq.apply(this,arguments)}function _Zq(){_Zq=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(a=>setTimeout(o=>a(o),n))});return _Zq.apply(this,arguments)}function eM(e,t){throw Object.assign(new Is({error:e,meta:t}),{throwImmediately:!0})}var Ow={},tM=(e,t)=>(/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(r,n,a){let o=[5,(t||Ow).maxRetries,(a||Ow).maxRetries].filter(g=>g!==void 0),[i]=o.slice(-1),f={maxRetries:i,backoff:Zq,retryCondition:(g,A,{attempt:x})=>x<=i,...t,...a},m=0;for(;;)try{let g=yield e(r,n,a);if(g.error)throw new Is(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Is)return g.value;throw g}if(g instanceof Is&&!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:a}))return g.value;yield f.backoff(m,f.maxRetries)}});return function(_x106,_x107,_x108){return _ref39.apply(this,arguments)}}()),Np=Object.assign(tM,{fail:eM}),MS=T("__rtkq/focused"),Qw=T("__rtkq/unfocused"),jS=T("__rtkq/online"),Bw=T("__rtkq/offline");function VS(e){return e.type==="query"}function rM(e){return e.type==="mutation"}function LS(e){return e.type==="infinitequery"}function US(e,t,r,n,a,o){return nM(e)?e(t,r,n,a).filter(Op).map(_S).map(o):Array.isArray(e)?e.map(_S).map(o):[]}function nM(e){return typeof e=="function"}function _S(e){return typeof e=="string"?{type:e}:e}function aM(e,t){return e.catch(t)}var dl=Symbol("forceQueryFn"),DS=e=>typeof e[dl]=="function";function oM({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:a,context:o}){let i=new Map,p=new Map,{unsubscribeQueryResult:f,removeMutationResult:m,updateSubscriptionOptions:g}=a.internalActions;return{buildInitiateQuery:b,buildInitiateInfiniteQuery:F,buildInitiateMutation:E,getRunningQueryThunk:A,getRunningMutationThunk:x,getRunningQueriesThunk:h,getRunningMutationsThunk:C};function A(P,V){return _=>{let k=o.endpointDefinitions[P],N=e({queryArgs:V,endpointDefinition:k,endpointName:P});return i.get(_)?.[N]}}function x(P,V){return _=>p.get(_)?.[V]}function h(){return P=>Object.values(i.get(P)||{}).filter(Op)}function C(){return P=>Object.values(p.get(P)||{}).filter(Op)}function R(P){}function w(P,V){let _=(k,{subscribe:N=!0,forceRefetch:q,subscriptionOptions:U,[dl]:X,...H}={})=>(B,Q)=>{let K=e({queryArgs:k,endpointDefinition:V,endpointName:P}),$,te={...H,type:"query",subscribe:N,forceRefetch:q,subscriptionOptions:U,endpointName:P,originalArgs:k,queryCacheKey:K,[dl]:X};if(VS(V))$=t(te);else{let{direction:Me,initialPageParam:Ze}=H;$=r({...te,direction:Me,initialPageParam:Ze})}let re=a.endpoints[P].select(k),pe=B($),we=re(Q());let{requestId:ke,abort:Ce}=pe,Re=we.requestId!==ke,xe=i.get(B)?.[K],Ee=()=>re(Q()),rt=Object.assign(X?pe.then(Ee):Re&&!xe?Promise.resolve(we):Promise.all([xe,pe]).then(Ee),{arg:k,requestId:ke,subscriptionOptions:U,queryCacheKey:K,abort:Ce,unwrap(){return _asyncToGenerator(function*(){let Me=yield rt;if(Me.isError)throw Me.error;return Me.data})()},refetch:()=>B(_(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){N&&B(f({queryCacheKey:K,requestId:ke}))},updateSubscriptionOptions(Me){rt.subscriptionOptions=Me,B(g({endpointName:P,requestId:ke,queryCacheKey:K,options:Me}))}});if(!xe&&!Re&&!X){let Me=Yq(i,B,{});Me[K]=rt,rt.then(()=>{delete Me[K],Es(Me)||i.delete(B)})}return rt};return _}function b(P,V){return w(P,V)}function F(P,V){return w(P,V)}function E(P){return(V,{track:_=!0,fixedCacheKey:k}={})=>(N,q)=>{let U=n({type:"mutation",endpointName:P,originalArgs:V,track:_,fixedCacheKey:k}),X=N(U);let{requestId:H,abort:B,unwrap:Q}=X,K=aM(X.unwrap().then(pe=>({data:pe})),pe=>({error:pe})),$=()=>{N(m({requestId:H,fixedCacheKey:k}))},te=Object.assign(K,{arg:X.arg,requestId:H,abort:B,unwrap:Q,reset:$}),re=p.get(N)||{};return p.set(N,re),re[H]=te,te.then(()=>{delete re[H],Es(re)||p.delete(N)}),k&&(re[k]=te,te.then(()=>{re[k]===te&&(delete re[k],Es(re)||p.delete(N))})),te}}}function iM(e){return e}var Pp=(e={})=>({...e,[Bu]:!0});function sM({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:a,assertTagType:o,selectors:i}){let p=(N,q,U,X)=>(H,B)=>{let Q=r[N],K=n({queryArgs:q,endpointDefinition:Q,endpointName:N});if(H(a.internalActions.queryResultPatched({queryCacheKey:K,patches:U})),!X)return;let $=a.endpoints[N].select(q)(B()),te=US(Q.providesTags,$.data,void 0,q,{},o);H(a.internalActions.updateProvidedBy({queryCacheKey:K,providedTags:te}))};function f(N,q,U=0){let X=[q,...N];return U&&X.length>U?X.slice(0,-1):X}function m(N,q,U=0){let X=[...N,q];return U&&X.length>U?X.slice(1):X}let g=(N,q,U,X=!0)=>(H,B)=>{let K=a.endpoints[N].select(q)(B()),$={patches:[],inversePatches:[],undo:()=>H(a.util.patchQueryData(N,q,$.inversePatches,X))};if(K.status==="uninitialized")return $;let te;if("data"in K)if(zt(K.data)){let[re,pe,we]=Sd(K.data,U);$.patches.push(...pe),$.inversePatches.push(...we),te=re}else te=U(K.data),$.patches.push({op:"replace",path:[],value:te}),$.inversePatches.push({op:"replace",path:[],value:K.data});return $.patches.length===0||H(a.util.patchQueryData(N,q,$.patches,X)),$},A=(N,q,U)=>X=>X(a.endpoints[N].initiate(q,{subscribe:!1,forceRefetch:!0,[dl]:()=>({data:U})})),x=(N,q)=>N.query&&N[q]?N[q]:iM,h=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(N,{signal:q,abort:U,rejectWithValue:X,fulfillWithValue:H,dispatch:B,getState:Q,extra:K}){let $=r[N.endpointName];try{let te=x($,"transformResponse"),re={signal:q,abort:U,dispatch:B,getState:Q,extra:K,endpoint:N.endpointName,type:N.type,forced:N.type==="query"?C(N,Q()):void 0,queryCacheKey:N.type==="query"?N.queryCacheKey:void 0},pe=N.type==="query"?N[dl]:void 0,we,ke=/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(Re,xe,Ee,rt){if(xe==null&&Re.pages.length)return Promise.resolve({data:Re});let Me={queryArg:N.originalArgs,pageParam:xe},Ze=yield Ce(Me),ot=rt?f:m;return{data:{pages:ot(Re.pages,Ze.data,Ee),pageParams:ot(Re.pageParams,xe,Ee)}}});return function ke(_x111,_x112,_x113,_x114){return _ref41.apply(this,arguments)}}();function Ce(_x115){return _Ce.apply(this,arguments)}function _Ce(){_Ce=_asyncToGenerator(function*(Re){let xe,{extraOptions:Ee}=$;if(pe?xe=pe():$.query?xe=yield t($.query(Re),re,Ee):xe=yield $.queryFn(Re,re,Ee,Me=>t(Me,re,Ee)),typeof process<"u",xe.error)throw new Is(xe.error,xe.meta);let rt=yield te(xe.data,xe.meta,Re);return{...xe,data:rt}});return _Ce.apply(this,arguments)}if(N.type==="query"&&"infiniteQueryOptions"in $){let{infiniteQueryOptions:Re}=$,{maxPages:xe=1/0}=Re,Ee,rt={pages:[],pageParams:[]},Me=i.selectQueryEntry(Q(),N.queryCacheKey)?.data,ot=C(N,Q())&&!N.direction||!Me?rt:Me;if("direction"in N&&N.direction&&ot.pages.length){let $t=N.direction==="backward",la=($t?Gw:qS)(Re,ot);Ee=yield ke(ot,la,xe,$t)}else{let{initialPageParam:$t=Re.initialPageParam}=N,lr=Me?.pageParams??[],la=lr[0]??$t,Si=lr.length;Ee=yield ke(ot,la,xe),pe&&(Ee={data:Ee.data.pages[0]});for(let vi=1;vi<Si;vi++){let Cu=qS(Re,Ee.data);Ee=yield ke(Ee.data,Cu,xe)}}we=Ee}else we=yield Ce(N.originalArgs);return H(we.data,Pp({fulfilledTimeStamp:Date.now(),baseQueryMeta:we.meta}))}catch(te){let re=te;if(re instanceof Is){let pe=x($,"transformErrorResponse");try{return X(yield pe(re.value,re.meta,N.originalArgs),Pp({baseQueryMeta:re.meta}))}catch(we){re=we}}throw typeof process<"u",console.error(re),re}});return function h(_x109,_x110){return _ref40.apply(this,arguments)}}();function C(N,q){let U=i.selectQueryEntry(q,N.queryCacheKey),X=i.selectConfig(q).refetchOnMountOrArgChange,H=U?.fulfilledTimeStamp,B=N.forceRefetch??(N.subscribe&&X);return B?B===!0||(Number(new Date)-Number(H))/1e3>=B:!1}let R=()=>Se(`${e}/executeQuery`,h,{getPendingMeta({arg:q}){let U=r[q.endpointName];return Pp({startedTimeStamp:Date.now(),...(LS(U)?{direction:q.direction}:{})})},condition(q,{getState:U}){let X=U(),H=i.selectQueryEntry(X,q.queryCacheKey),B=H?.fulfilledTimeStamp,Q=q.originalArgs,K=H?.originalArgs,$=r[q.endpointName],te=q.direction;return DS(q)?!0:H?.status==="pending"?!1:C(q,X)||VS($)&&$?.forceRefetch?.({currentArg:Q,previousArg:K,endpointState:H,state:X})?!0:!(B&&!te)},dispatchConditionRejection:!0}),w=R(),b=R(),F=Se(`${e}/executeMutation`,h,{getPendingMeta(){return Pp({startedTimeStamp:Date.now()})}}),E=N=>"force"in N,P=N=>"ifOlderThan"in N,V=(N,q,U)=>(X,H)=>{let B=E(U)&&U.force,Q=P(U)&&U.ifOlderThan,K=(te=!0)=>{let re={forceRefetch:te,isPrefetch:!0};return a.endpoints[N].initiate(q,re)},$=a.endpoints[N].select(q)(H());if(B)X(K());else if(Q){let te=$?.fulfilledTimeStamp;if(!te){X(K());return}(Number(new Date)-Number(new Date(te)))/1e3>=Q&&X(K())}else X(K(!1))};function _(N){return q=>q?.meta?.arg?.endpointName===N}function k(N,q){return{matchPending:qi(wd(N),_(q)),matchFulfilled:qi(Mn(N),_(q)),matchRejected:qi(go(N),_(q))}}return{queryThunk:w,mutationThunk:F,infiniteQueryThunk:b,prefetch:V,updateQueryData:g,upsertQueryData:A,patchQueryData:p,buildMatchThunkActions:k}}function qS(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Gw(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function $w(e,t,r,n){return US(r[e.meta.arg.endpointName][t],Mn(e)?e.payload:void 0,$u(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function kp(e,t,r){let n=e[t];n&&r(n)}function pl(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Nw(e,t,r){let n=e[pl(t)];n&&r(n)}var ll={};function cM({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:a,apiUid:o,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=T(`${e}/resetApiState`);function A(_,k,N,q){var U;_[U=k.queryCacheKey]??(_[U]={status:"uninitialized",endpointName:k.endpointName}),kp(_,k.queryCacheKey,X=>{X.status="pending",X.requestId=N&&X.requestId?X.requestId:q.requestId,k.originalArgs!==void 0&&(X.originalArgs=k.originalArgs),X.startedTimeStamp=q.startedTimeStamp;let H=a[q.arg.endpointName];LS(H)&&"direction"in k&&(X.direction=k.direction)})}function x(_,k,N,q){kp(_,k.arg.queryCacheKey,U=>{if(U.requestId!==k.requestId&&!q)return;let{merge:X}=a[k.arg.endpointName];if(U.status="fulfilled",X){if(U.data!==void 0){let{fulfilledTimeStamp:H,arg:B,baseQueryMeta:Q,requestId:K}=k,$=qn(U.data,te=>X(te,N,{arg:B.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:H,requestId:K}));U.data=$}else U.data=N;}else U.data=a[k.arg.endpointName].structuralSharing??!0?Lw(ar(U.data)?my(U.data):U.data,N):N;delete U.error,U.fulfilledTimeStamp=k.fulfilledTimeStamp})}let h=ho({name:`${e}/queries`,initialState:ll,reducers:{removeQueryResult:{reducer(_,{payload:{queryCacheKey:k}}){delete _[k]},prepare:Mi()},cacheEntriesUpserted:{reducer(_,k){for(let N of k.payload){let{queryDescription:q,value:U}=N;A(_,q,!0,{arg:q,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),x(_,{arg:q,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},U,!0)}},prepare:_=>({payload:_.map(q=>{let{endpointName:U,arg:X,value:H}=q,B=a[U];return{queryDescription:{type:"query",endpointName:U,originalArgs:q.arg,queryCacheKey:n({queryArgs:X,endpointDefinition:B,endpointName:U})},value:H}}),meta:{[Bu]:!0,requestId:Hu(),timestamp:Date.now()}})},queryResultPatched:{reducer(_,{payload:{queryCacheKey:k,patches:N}}){kp(_,k,q=>{q.data=hy(q.data,N.concat())})},prepare:Mi()}},extraReducers(_){_.addCase(t.pending,(k,{meta:N,meta:{arg:q}})=>{let U=DS(q);A(k,q,U,N)}).addCase(t.fulfilled,(k,{meta:N,payload:q})=>{let U=DS(N.arg);x(k,N,q,U)}).addCase(t.rejected,(k,{meta:{condition:N,arg:q,requestId:U},error:X,payload:H})=>{kp(k,q.queryCacheKey,B=>{if(!N){if(B.requestId!==U)return;B.status="rejected",B.error=H??X}})}).addMatcher(p,(k,N)=>{let{queries:q}=i(N);for(let[U,X]of Object.entries(q))(X?.status==="fulfilled"||X?.status==="rejected")&&(k[U]=X)})}}),C=ho({name:`${e}/mutations`,initialState:ll,reducers:{removeMutationResult:{reducer(_,{payload:k}){let N=pl(k);N in _&&delete _[N]},prepare:Mi()}},extraReducers(_){_.addCase(r.pending,(k,{meta:N,meta:{requestId:q,arg:U,startedTimeStamp:X}})=>{U.track&&(k[pl(N)]={requestId:q,status:"pending",endpointName:U.endpointName,startedTimeStamp:X})}).addCase(r.fulfilled,(k,{payload:N,meta:q})=>{q.arg.track&&Nw(k,q,U=>{U.requestId===q.requestId&&(U.status="fulfilled",U.data=N,U.fulfilledTimeStamp=q.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:N,error:q,meta:U})=>{U.arg.track&&Nw(k,U,X=>{X.requestId===U.requestId&&(X.status="rejected",X.error=N??q)})}).addMatcher(p,(k,N)=>{let{mutations:q}=i(N);for(let[U,X]of Object.entries(q))(X?.status==="fulfilled"||X?.status==="rejected")&&U!==X?.requestId&&(k[U]=X)})}}),R=ho({name:`${e}/invalidation`,initialState:ll,reducers:{updateProvidedBy:{reducer(_,k){var U,X;let{queryCacheKey:N,providedTags:q}=k.payload;for(let H of Object.values(_))for(let B of Object.values(H)){let Q=B.indexOf(N);Q!==-1&&B.splice(Q,1)}for(let{type:H,id:B}of q){let Q=(U=_[H]??(_[H]={}))[X=B||"__internal_without_id"]??(U[X]=[]);Q.includes(N)||Q.push(N)}},prepare:Mi()}},extraReducers(_){_.addCase(h.actions.removeQueryResult,(k,{payload:{queryCacheKey:N}})=>{for(let q of Object.values(k))for(let U of Object.values(q)){let X=U.indexOf(N);X!==-1&&U.splice(X,1)}}).addMatcher(p,(k,N)=>{var U,X;let{provided:q}=i(N);for(let[H,B]of Object.entries(q))for(let[Q,K]of Object.entries(B)){let $=(U=k[H]??(k[H]={}))[X=Q||"__internal_without_id"]??(U[X]=[]);for(let te of K)$.includes(te)||$.push(te)}}).addMatcher(Gr(Mn(t),$u(t)),(k,N)=>{let q=$w(N,"providesTags",a,f),{queryCacheKey:U}=N.meta.arg;R.caseReducers.updateProvidedBy(k,R.actions.updateProvidedBy({queryCacheKey:U,providedTags:q}))})}}),w=ho({name:`${e}/subscriptions`,initialState:ll,reducers:{updateSubscriptionOptions(_,k){},unsubscribeQueryResult(_,k){},internal_getRTKQSubscriptions(){}}}),b=ho({name:`${e}/internalSubscriptions`,initialState:ll,reducers:{subscriptionsUpdated:{reducer(_,k){return hy(_,k.payload)},prepare:Mi()}}}),F=ho({name:`${e}/config`,initialState:{online:Hq(),focused:$q(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(_,{payload:k}){_.middlewareRegistered=_.middlewareRegistered==="conflict"||o!==k?"conflict":!0}},extraReducers:_=>{_.addCase(jS,k=>{k.online=!0}).addCase(Bw,k=>{k.online=!1}).addCase(MS,k=>{k.focused=!0}).addCase(Qw,k=>{k.focused=!1}).addMatcher(p,k=>({...k}))}}),E=Ti({queries:h.reducer,mutations:C.reducer,provided:R.reducer,subscriptions:b.reducer,config:F.reducer}),P=(_,k)=>E(g.match(k)?void 0:_,k),V={...F.actions,...h.actions,...w.actions,...b.actions,...C.actions,...R.actions,resetApiState:g};return{reducer:P,actions:V}}var wo=Symbol.for("RTKQ/skipToken"),Hw={status:"uninitialized"},_w=qn(Hw,()=>{}),Dw=qn(Hw,()=>{});function uM({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>_w,a=E=>Dw;return{buildQuerySelector:x,buildInfiniteQuerySelector:h,buildMutationSelector:C,selectInvalidatedBy:R,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function o(E){return{...E,...Ew(E.status)}}function i(E){return E[t]}function p(E){return i(E)?.queries}function f(E,P){return p(E)?.[P]}function m(E){return i(E)?.mutations}function g(E){return i(E)?.config}function A(E,P,V){return _=>{if(_===wo)return r(n,V);let k=e({queryArgs:_,endpointDefinition:P,endpointName:E});return r(q=>f(q,k)??_w,V)}}function x(E,P){return A(E,P,o)}function h(E,P){let{infiniteQueryOptions:V}=P;function _(k){let N={...k,...Ew(k.status)},{isLoading:q,isError:U,direction:X}=N,H=X==="forward",B=X==="backward";return{...N,hasNextPage:b(V,N.data),hasPreviousPage:F(V,N.data),isFetchingNextPage:q&&H,isFetchingPreviousPage:q&&B,isFetchNextPageError:U&&H,isFetchPreviousPageError:U&&B}}return A(E,P,_)}function C(){return E=>{let P;return typeof E=="object"?P=pl(E)??wo:P=E,r(P===wo?a:k=>i(k)?.mutations?.[P]??Dw,o)}}function R(E,P){let V=E[t],_=new Set;for(let k of P.filter(Op).map(_S)){let N=V.provided[k.type];if(!N)continue;let q=(k.id!==void 0?N[k.id]:Tw(Object.values(N)))??[];for(let U of q)_.add(U)}return Tw(Array.from(_.values()).map(k=>{let N=V.queries[k];return N?[{queryCacheKey:k,endpointName:N.endpointName,originalArgs:N.originalArgs}]:[]}))}function w(E,P){return Object.values(p(E)).filter(V=>V?.endpointName===P&&V.status!=="uninitialized").map(V=>V.originalArgs)}function b(E,P){return P?qS(E,P)!=null:!1}function F(E,P){return!P||!E.getPreviousPageParam?!1:Gw(E,P)!=null}}var qw=WeakMap?new WeakMap:void 0,Mw=({endpointName:e,queryArgs:t})=>{let r="",n=qw?.get(t);if(typeof n=="string")r=n;else{let a=JSON.stringify(t,(o,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Br(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Br(t)&&qw?.set(t,a),r=a}return`${e}(${r})`};function lM(...e){return function(r){let n=_i(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),a={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=Mw;if("serializeQueryArgs"in m.endpointDefinition){let A=m.endpointDefinition.serializeQueryArgs;g=x=>{let h=A(x);return typeof h=="string"?h:Mw({...x,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},o={endpointDefinitions:{},batch(m){m()},apiUid:Hu(),extractRehydrationInfo:n,hasRehydrationInfo:_i(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let A of m)a.tagTypes.includes(A)||a.tagTypes.push(A);if(g)for(let[A,x]of Object.entries(g))typeof x=="function"?x(o.endpointDefinitions[A]):Object.assign(o.endpointDefinitions[A]||{},x);return i}},p=e.map(m=>m.init(i,a,o));function f(m){let g=m.endpoints({query:A=>({...A,type:"query"}),mutation:A=>({...A,type:"mutation"}),infiniteQuery:A=>({...A,type:"infinitequery"})});for(let[A,x]of Object.entries(g)){if(m.overrideExisting!==!0&&A in o.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Bt(39));typeof process<"u";continue}typeof process<"u",o.endpointDefinitions[A]=x;for(let h of p)h.injectEndpoint(A,x)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Qn(e,...t){return Object.assign(e,...t)}var dM=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,a=null,o=null,{updateSubscriptionOptions:i,unsubscribeQueryResult:p}=e.internalActions,f=(h,C)=>{var w,b;if(i.match(C)){let{queryCacheKey:F,requestId:E,options:P}=C.payload;return h?.[F]?.[E]&&(h[F][E]=P),!0}if(p.match(C)){let{queryCacheKey:F,requestId:E}=C.payload;return h[F]&&delete h[F][E],!0}if(e.internalActions.removeQueryResult.match(C))return delete h[C.payload.queryCacheKey],!0;if(t.pending.match(C)){let{meta:{arg:F,requestId:E}}=C,P=h[w=F.queryCacheKey]??(h[w]={});return P[`${E}_running`]={},F.subscribe&&(P[E]=F.subscriptionOptions??P[E]??{}),!0}let R=!1;if(t.fulfilled.match(C)||t.rejected.match(C)){let F=h[C.meta.arg.queryCacheKey]||{},E=`${C.meta.requestId}_running`;R||(R=!!F[E]),delete F[E]}if(t.rejected.match(C)){let{meta:{condition:F,arg:E,requestId:P}}=C;if(F&&E.subscribe){let V=h[b=E.queryCacheKey]??(h[b]={});V[P]=E.subscriptionOptions??V[P]??{},R=!0}}return R},m=()=>r.currentSubscriptions,x={getSubscriptions:m,getSubscriptionCount:h=>{let R=m()[h]??{};return Es(R)},isRequestSubscribed:(h,C)=>!!m()?.[h]?.[C]};return(h,C)=>{if(a||(a=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(h))return a=r.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,x];let R=f(r.currentSubscriptions,h),w=!0;if(R){o||(o=setTimeout(()=>{let E=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,P]=Sd(a,()=>E);C.next(e.internalActions.subscriptionsUpdated(P)),a=E,o=null},500));let b=typeof h.type=="string"&&!!h.type.startsWith(n),F=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;w=!b&&!F}return[w,!1]}};function pM(e){for(let t in e)return!1;return!0}var fM=2147483647/1e3-1,mM=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:a,selectors:{selectQueryEntry:o,selectConfig:i}})=>{let{removeQueryResult:p,unsubscribeQueryResult:f,cacheEntriesUpserted:m}=t.internalActions,g=Gr(f.match,r.fulfilled,r.rejected,m.match);function A(w){let b=a.currentSubscriptions[w];return!!b&&!pM(b)}let x={},h=(w,b,F)=>{let E=b.getState(),P=i(E);if(g(w)){let V;if(m.match(w))V=w.payload.map(_=>_.queryDescription.queryCacheKey);else{let{queryCacheKey:_}=f.match(w)?w.payload:w.meta.arg;V=[_]}C(V,b,P)}if(t.util.resetApiState.match(w))for(let[V,_]of Object.entries(x))_&&clearTimeout(_),delete x[V];if(n.hasRehydrationInfo(w)){let{queries:V}=n.extractRehydrationInfo(w);C(Object.keys(V),b,P)}};function C(w,b,F){let E=b.getState();for(let P of w){let V=o(E,P);R(P,V?.endpointName,b,F)}}function R(w,b,F,E){let V=n.endpointDefinitions[b]?.keepUnusedDataFor??E.keepUnusedDataFor;if(V===1/0)return;let _=Math.max(0,Math.min(V,fM));if(!A(w)){let k=x[w];k&&clearTimeout(k),x[w]=setTimeout(()=>{A(w)||F.dispatch(p({queryCacheKey:w})),delete x[w]},_*1e3)}}return h},jw=new Error("Promise never resolved before cacheEntryRemoved."),gM=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:a,internalState:o,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Rd(n),m=Rd(a),g=Mn(n,a),A={};function x(b,F,E){let P=A[b];P?.valueResolved&&(P.valueResolved({data:F,meta:E}),delete P.valueResolved)}function h(b){let F=A[b];F&&(delete A[b],F.cacheEntryRemoved())}let C=(b,F,E)=>{let P=R(b);function V(_,k,N,q){let U=i(E,k),X=i(F.getState(),k);!U&&X&&w(_,q,k,F,N)}if(n.pending.match(b))V(b.meta.arg.endpointName,P,b.meta.requestId,b.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(b))for(let{queryDescription:_,value:k}of b.payload){let{endpointName:N,originalArgs:q,queryCacheKey:U}=_;V(N,U,b.meta.requestId,q),x(U,k,{})}else if(a.pending.match(b))F.getState()[t].mutations[P]&&w(b.meta.arg.endpointName,b.meta.arg.originalArgs,P,F,b.meta.requestId);else if(g(b))x(P,b.payload,b.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(b)||e.internalActions.removeMutationResult.match(b))h(P);else if(e.util.resetApiState.match(b))for(let _ of Object.keys(A))h(_)};function R(b){return f(b)?b.meta.arg.queryCacheKey:m(b)?b.meta.arg.fixedCacheKey??b.meta.requestId:e.internalActions.removeQueryResult.match(b)?b.payload.queryCacheKey:e.internalActions.removeMutationResult.match(b)?pl(b.payload):""}function w(b,F,E,P,V){let _=r.endpointDefinitions[b],k=_?.onCacheEntryAdded;if(!k)return;let N={},q=new Promise(K=>{N.cacheEntryRemoved=K}),U=Promise.race([new Promise(K=>{N.valueResolved=K}),q.then(()=>{throw jw})]);U.catch(()=>{}),A[E]=N;let X=e.endpoints[b].select(_.type==="query"?F:E),H=P.dispatch((K,$,te)=>te),B={...P,getCacheEntry:()=>X(P.getState()),requestId:V,extra:H,updateCachedData:_.type==="query"?K=>P.dispatch(e.util.updateQueryData(b,F,K)):void 0,cacheDataLoaded:U,cacheEntryRemoved:q},Q=k(F,B);Promise.resolve(Q).catch(K=>{if(K!==jw)throw K})}return C},hM=({api:e,context:{apiUid:t},reducerPath:r})=>(n,a)=>{e.util.resetApiState.match(n)&&a.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},yM=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:a,api:o,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=o.internalActions,g=Gr(Mn(n),$u(n)),A=Gr(Mn(n,a),go(n,a)),x=[],h=(w,b)=>{g(w)?R($w(w,"invalidatesTags",r,i),b):A(w)?R([],b):o.util.invalidateTags.match(w)&&R(US(w.payload,void 0,void 0,void 0,void 0,i),b)};function C(w){let{queries:b,mutations:F}=w;for(let E of[b,F])for(let P in E)if(E[P]?.status==="pending")return!0;return!1}function R(w,b){let F=b.getState(),E=F[e];if(x.push(...w),E.config.invalidationBehavior==="delayed"&&C(E))return;let P=x;if(x=[],P.length===0)return;let V=o.util.selectInvalidatedBy(F,P);t.batch(()=>{let _=Array.from(V.values());for(let{queryCacheKey:k}of _){let N=E.queries[k],q=f.currentSubscriptions[k]??{};N&&(Es(q)===0?b.dispatch(m({queryCacheKey:k})):N.status!=="uninitialized"&&b.dispatch(p(N)))}})}return h},SM=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:a})=>{let o={},i=(h,C)=>{(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&m(h.payload,C),(t.pending.match(h)||t.rejected.match(h)&&h.meta.condition)&&m(h.meta.arg,C),(t.fulfilled.match(h)||t.rejected.match(h)&&!h.meta.condition)&&f(h.meta.arg,C),r.util.resetApiState.match(h)&&A()};function p(h,C){let w=C.getState()[e].queries[h],b=a.currentSubscriptions[h];if(!(!w||w.status==="uninitialized"))return b}function f({queryCacheKey:h},C){let R=C.getState()[e],w=R.queries[h],b=a.currentSubscriptions[h];if(!w||w.status==="uninitialized")return;let{lowestPollingInterval:F,skipPollingIfUnfocused:E}=x(b);if(!Number.isFinite(F))return;let P=o[h];P?.timeout&&(clearTimeout(P.timeout),P.timeout=void 0);let V=Date.now()+F;o[h]={nextPollTimestamp:V,pollingInterval:F,timeout:setTimeout(()=>{(R.config.focused||!E)&&C.dispatch(n(w)),f({queryCacheKey:h},C)},F)}}function m({queryCacheKey:h},C){let w=C.getState()[e].queries[h],b=a.currentSubscriptions[h];if(!w||w.status==="uninitialized")return;let{lowestPollingInterval:F}=x(b);if(!Number.isFinite(F)){g(h);return}let E=o[h],P=Date.now()+F;(!E||P<E.nextPollTimestamp)&&f({queryCacheKey:h},C)}function g(h){let C=o[h];C?.timeout&&clearTimeout(C.timeout),delete o[h]}function A(){for(let h of Object.keys(o))g(h)}function x(h={}){let C=!1,R=Number.POSITIVE_INFINITY;for(let w in h)h[w].pollingInterval&&(R=Math.min(h[w].pollingInterval,R),C=h[w].skipPollingIfUnfocused||C);return{lowestPollingInterval:R,skipPollingIfUnfocused:C}}return i},vM=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let a=wd(r,n),o=go(r,n),i=Mn(r,n),p={};return(m,g)=>{if(a(m)){let{requestId:A,arg:{endpointName:x,originalArgs:h}}=m.meta,C=t.endpointDefinitions[x],R=C?.onQueryStarted;if(R){let w={},b=new Promise((V,_)=>{w.resolve=V,w.reject=_});b.catch(()=>{}),p[A]=w;let F=e.endpoints[x].select(C.type==="query"?h:A),E=g.dispatch((V,_,k)=>k),P={...g,getCacheEntry:()=>F(g.getState()),requestId:A,extra:E,updateCachedData:C.type==="query"?V=>g.dispatch(e.util.updateQueryData(x,h,V)):void 0,queryFulfilled:b};R(h,P)}}else if(i(m)){let{requestId:A,baseQueryMeta:x}=m.meta;p[A]?.resolve({data:m.payload,meta:x}),delete p[A]}else if(o(m)){let{requestId:A,rejectedWithValue:x,baseQueryMeta:h}=m.meta;p[A]?.reject({error:m.payload??m.error,isUnhandledError:!x,meta:h}),delete p[A]}}},AM=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:a})=>{let{removeQueryResult:o}=r.internalActions,i=(f,m)=>{MS.match(f)&&p(m,"refetchOnFocus"),jS.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],A=g.queries,x=a.currentSubscriptions;t.batch(()=>{for(let h of Object.keys(x)){let C=A[h],R=x[h];if(!R||!C)continue;(Object.values(R).some(b=>b[m]===!0)||Object.values(R).every(b=>b[m]===void 0)&&g.config[m])&&(Es(R)===0?f.dispatch(o({queryCacheKey:h})):C.status!=="uninitialized"&&f.dispatch(n(C)))}})}return i};function xM(e){let{reducerPath:t,queryThunk:r,api:n,context:a}=e,{apiUid:o}=a,i={invalidateTags:T(`${t}/invalidateTags`)},p=A=>A.type.startsWith(`${t}/`),f=[hM,mM,yM,SM,gM,vM];return{middleware:A=>{let x=!1,C={...e,internalState:{currentSubscriptions:{}},refetchQuery:g,isThisApiSliceAction:p},R=f.map(F=>F(C)),w=dM(C),b=AM(C);return F=>E=>{if(!ki(E))return F(E);x||(x=!0,A.dispatch(n.internalActions.middlewareRegistered(o)));let P={...A,next:F},V=A.getState(),[_,k]=w(E,P,V),N;if(_?N=F(E):N=k,A.getState()[t]&&(b(E,P,V),p(E)||a.hasRehydrationInfo(E)))for(let q of R)q(E,P,V);return N}},actions:i};function g(A){return e.api.endpoints[A.endpointName].initiate(A.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Vw=Symbol(),CM=({createSelector:e=Ye}={})=>({name:Vw,init(t,{baseQuery:r,tagTypes:n,reducerPath:a,serializeQueryArgs:o,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g},A){Yx();let x=Ce=>(typeof process<"u",Ce);Object.assign(t,{reducerPath:a,endpoints:{},internalActions:{onOnline:jS,onOffline:Bw,onFocus:MS,onFocusLost:Qw},util:{}});let h=uM({serializeQueryArgs:o,reducerPath:a,createSelector:e}),{selectInvalidatedBy:C,selectCachedArgsForQuery:R,buildQuerySelector:w,buildInfiniteQuerySelector:b,buildMutationSelector:F}=h;Qn(t.util,{selectInvalidatedBy:C,selectCachedArgsForQuery:R});let{queryThunk:E,infiniteQueryThunk:P,mutationThunk:V,patchQueryData:_,updateQueryData:k,upsertQueryData:N,prefetch:q,buildMatchThunkActions:U}=sM({baseQuery:r,reducerPath:a,context:A,api:t,serializeQueryArgs:o,assertTagType:x,selectors:h}),{reducer:X,actions:H}=cM({context:A,queryThunk:E,infiniteQueryThunk:P,mutationThunk:V,serializeQueryArgs:o,reducerPath:a,assertTagType:x,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:a,invalidationBehavior:g}});Qn(t.util,{patchQueryData:_,updateQueryData:k,upsertQueryData:N,prefetch:q,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),Qn(t.internalActions,H);let{middleware:B,actions:Q}=xM({reducerPath:a,context:A,queryThunk:E,mutationThunk:V,infiniteQueryThunk:P,api:t,assertTagType:x,selectors:h});Qn(t.util,Q),Qn(t,{reducer:X,middleware:B});let{buildInitiateQuery:K,buildInitiateInfiniteQuery:$,buildInitiateMutation:te,getRunningMutationThunk:re,getRunningMutationsThunk:pe,getRunningQueriesThunk:we,getRunningQueryThunk:ke}=oM({queryThunk:E,mutationThunk:V,infiniteQueryThunk:P,api:t,serializeQueryArgs:o,context:A});return Qn(t.util,{getRunningMutationThunk:re,getRunningMutationsThunk:pe,getRunningQueryThunk:ke,getRunningQueriesThunk:we}),{name:Vw,injectEndpoint(Ce,Re){var rt;let Ee=(rt=t.endpoints)[Ce]??(rt[Ce]={});VS(Re)&&Qn(Ee,{name:Ce,select:w(Ce,Re),initiate:K(Ce,Re)},U(E,Ce)),rM(Re)&&Qn(Ee,{name:Ce,select:F(),initiate:te(Ce)},U(V,Ce)),LS(Re)&&Qn(Ee,{name:Ce,select:b(Ce,Re),initiate:$(Ce,Re)},U(E,Ce))}}}}),_p=lM(CM());d();c();l();u();var QS=/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:a,environment:o,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${a}`}};try{let m=it(i,o);return{data:Uw({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref43=_asyncToGenerator(function*(A){if(A instanceof String)throw new Error("The provided 'request' must be a Request object.");let x=A.url,h={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(C=>{h[C]=A[C]}),h.duplex="half",h.body=yield A.text(),S(x,h)});return function fetchFn(_x119){return _ref43.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(m){return{error:m}}});return function QS(_x116,_x117,_x118){return _ref42.apply(this,arguments)}}(),Dp=_p({reducerPath:"answer",baseQuery:Np(QS,{maxRetries:3}),endpoints:()=>({})});var Bn=_p({reducerPath:"answerGenerationApi",refetchOnMountOrArgChange:!0,baseQuery:Np(QS,{maxRetries:3}),endpoints:()=>({})});d();c();l();u();d();c();l();u();d();c();l();u();var Ro=e=>e.query,zw=e=>e.query?.enableQuerySyntax;var Ww=Ye(e=>Ro(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,a)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:a})),qp=Ye(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();d();c();l();u();var Mp=()=>({contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!1,isLoading:!0});d();c();l();u();d();c();l();u();d();c();l();u();var Kw=(e,t)=>{t&&(e.answerId=t)},Yw=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},Jw=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},Xw=(e,t)=>{e.citations=t.citations},Zw=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},eR=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code??500},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)};var jp={handleOpen:(e,t)=>{let r=e.headers.get("x-answer-id");r&&t(n=>{Kw(n,r)})},handleMessage:{"agentInteraction.answerHeader":(e,t)=>{t(r=>{Yw(r,{contentFormat:"text/markdown"})})},"generativeengines.messageType":(e,t)=>{e?.payload?.textDelta&&t(r=>{Jw(r,e.payload)})},"agentInteraction.citations":(e,t)=>{e?.payload?.citations!==void 0&&t(r=>{Xw(r,e.payload)})},"generativeengines.endOfStreamType":(e,t)=>{t(r=>{Zw(r,e.payload)})},error:(e,t)=>{e.finishReason==="ERROR"&&t(r=>{eR(r,e)})}}};var Vp=(e,t,r,n)=>{let{dispatch:a,updateCachedData:o,getState:i}=r,{configuration:{accessToken:p}}=i();return Fi(e,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${p}`,Accept:"text/event-stream","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref44=_asyncToGenerator(function*(f){jp.handleOpen(f,o),n.handleOpen(f,a)});return function onopen(_x120){return _ref44.apply(this,arguments)}}(),onclose:()=>{n.handleClose?.(a)},onerror:f=>{n.handleError(f)},onmessage:f=>{let m=bM(f.data);if(!m)return;jp.handleMessage.error?.(m,o),n.handleMessage.error?.(m,a);let g=m.payloadType;jp.handleMessage[g]?.(m,o),n.handleMessage[g]?.(m,a)}})};function bM(e){if(!e?.length)return null;try{return JSON.parse(e)}catch(t){return console.warn("Failed to parse message",{payload:e,error:t}),null}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var tR=e=>{let{configuration:t}=e,{organizationId:r,environment:n,knowledge:{agentId:a}}=t,o=it(r,n),i=a?.trim();if(!o||!r||!i)throw new Error("Missing required parameters for follow up endpoint");let p=`/api/preview/organizations/${r}/agents`;return`${o}${p}/${i}/follow-up`};var wM=Bn.injectEndpoints({overrideExisting:!0,endpoints:e=>({generateFollowUpAnswer:e.query({queryFn:()=>({data:Mp()}),onQueryStarted(_x121,_x122){return _asyncToGenerator(function*(t,{getState:r,updateCachedData:n,dispatch:a}){let{strategyKey:o,...i}=t,p=tR(r());yield Vp(p,i,{getState:r,updateCachedData:n,dispatch:a},Lp[o]?.())}).apply(this,arguments)}})})}),rR=e=>wM.endpoints.generateFollowUpAnswer.initiate(e);d();c();l();u();var Ts=["searching","thinking","answering"];function BS(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var nR=(e,t)=>({conversationId:t.followUpAnswers?.conversationId??"",q:e});var RM=new M({required:!0}),Ps=T("followUpAnswers/setIsEnabled",e=>O(e,new ce({required:!0}))),ks=T("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,z)),fl=T("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:z})),Os=T("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,z)),Ns=T("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:Wp,answerId:z})),_s=T("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new ce({required:!0}),answerId:z})),Up=T("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new ce({required:!0}),answerId:z})),Ds=T("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:RM,answerId:z})),qs=T("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new oe({required:!0,each:new J({values:GS})}),answerId:z})),Ms=T("followUpAnswers/followUpCompleted",e=>O(e,{answerId:z,cannotAnswer:new ce({required:!1})})),js=T("followUpAnswers/followUpFailed",e=>O(e,{message:new M,code:new ee({min:0}),answerId:z})),Qp=T("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new M})),Bp=T("followUpAnswers/likeFollowUp",e=>O(e,{answerId:z})),Gp=T("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:z})),aR=T("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:z})),$p=T("followUpAnswers/resetFollowUpAnswers"),Hp=T("followUpAnswers/stepStarted",e=>O(e,{answerId:z,name:new M({required:!0,constrainTo:Ts}),startedAt:new ee({min:0,required:!0})})),zp=T("followUpAnswers/stepFinished",e=>O(e,{answerId:z,name:new M({required:!0,constrainTo:Ts}),finishedAt:new ee({min:0,required:!0})})),yoe=Se("generatedAnswerWithFollowUps/generateFollowUpAnswer",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{logger:n}}){let a=t(),o=va(a)?.trim(),i=nR(e,a);if(!o){n.warn("Missing agentId in engine configuration. The generateFollowUpAnswer action requires an agent ID.");return}if(!i.conversationId){n.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}r(fl({question:e})),yield r(rR({strategyKey:"follow-up-answer",...i}))});return function(_x123,_x124){return _ref45.apply(this,arguments)}}());var oR=()=>{let e=null;return{handleOpen:(t,r)=>{e=t.headers.get("x-answer-id"),e&&(r(Os(e)),r(_s({answerId:e,isLoading:!0})),r(Ns({contentFormat:"text/markdown",answerId:e})))},handleError:t=>{throw t},handleMessage:{"generativeengines.messageType":(t,r)=>{t?.payload?.textDelta&&r(Ds({textDelta:t.payload.textDelta,answerId:e}))},"agentInteraction.citations":(t,r)=>{t?.payload?.citations!==void 0&&r(qs({citations:t.payload.citations,answerId:e}))},"generativeengines.endOfStreamType":(t,r)=>{let n=t?.payload?.answerGenerated??!1;r(Ms({cannotAnswer:!n,answerId:e}))},error:(t,r)=>{t.finishReason==="ERROR"&&r(js({answerId:e,message:t.errorMessage,code:t.code}))}}}};d();c();l();u();d();c();l();u();var Kp=e=>{if(e==="yes")return!0;if(e==="no")return!1},FM=()=>Y("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function EM(e,t){return Y({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let a=t??$e(n),o=el(n,e);return!a||!o?null:r.makeGeneratedAnswerCitationClick(Nb(o,n),{generativeQuestionAnsweringId:a,citationId:o.id,documentId:_b(o)})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=el(r,e);return{answerId:t??$e(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function IM(e,t,r){return Y({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,a)=>{let o=r??$e(a),i=el(a,e);return!o||!i?null:n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:o,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let a=el(n,e);return{answerId:r??$e(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:a?.permanentid??"",title:a?.title,url:a?.clickUri},citationHoverTimeInMs:t}}})}function TM(e){return Y({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"like"})})}function PM(e){return Y({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"dislike"})})}var kM=e=>Y({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=$e(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=$e(t),{helpful:n,readable:a,documented:o,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:Kp(a),documented:Kp(o),correctTopic:Kp(p),hallucinationFree:Kp(i)},additionalNotes:m,correctAnswerUrl:f}}}),Fo=e=>Y({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=$e(r),a=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:a}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:$e(t)??"",answerGenerated:e??!1})}),Vs=()=>Y({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})}),OM=()=>Y({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"show"})}),NM=()=>Y({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"hide"})}),_M=()=>Y({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"expand"})}),DM=()=>Y({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"collapse"})});function qM(e){return Y({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"copyToClipboard"})})}var Ls={logCopyGeneratedAnswer:qM,logGeneratedAnswerHideAnswers:NM,logGeneratedAnswerShowAnswers:OM,logGeneratedAnswerStreamEnd:Fo,logGeneratedAnswerFeedback:kM,logDislikeGeneratedAnswer:PM,logLikeGeneratedAnswer:TM,logHoverCitation:IM,logOpenGeneratedAnswerSource:EM,logRetryGeneratedAnswer:FM,logGeneratedAnswerExpand:_M,logGeneratedAnswerCollapse:DM};var iR=()=>({handleOpen:(e,t)=>{let r=e.headers.get("x-answer-id");r&&t(Da(r))},handleError:e=>{throw e},handleMessage:{"agentInteraction.answerHeader":(e,t)=>{e?.payload?.conversationId&&t(ks(e.payload.conversationId)),e.payload.followUpEnabled&&t(Ps(e.payload.followUpEnabled)),t(zn("text/markdown")),t(Zr(!0)),t(cr(!1))},"generativeengines.messageType":(e,t)=>{e?.payload?.textDelta&&t(Gn({textDelta:e.payload.textDelta}))},"agentInteraction.citations":(e,t)=>{e?.payload?.citations!==void 0&&t($n({citations:e.payload.citations}))},"generativeengines.endOfStreamType":(e,t)=>{let r=e?.payload?.answerGenerated??!1;t(Eo(r)),t(Wn(!r)),t(Zr(!1)),t(cr(!1)),t(Fo(r)),t(Vs())},error:(e,t)=>{e.finishReason==="ERROR"&&t(Hn(e))}}});var Lp={"head-answer":iR,"follow-up-answer":oR};d();c();l();u();var sR=e=>{let{configuration:t}=e,{organizationId:r,environment:n,knowledge:{agentId:a}}=t,o=it(r,n),i=a?.trim();if(!o||!r||!i)throw new Error("Missing required parameters for answer endpoint");let p=`/api/preview/organizations/${r}/agents`;return`${o}${p}/${i}/answer`};var MM=Bn.injectEndpoints({overrideExisting:!0,endpoints:e=>({generateAnswer:e.query({queryFn:()=>({data:Mp()}),onQueryStarted(_x125,_x126){return _asyncToGenerator(function*(t,{getState:r,updateCachedData:n,dispatch:a}){let{strategyKey:o,...i}=t,p=sR(r());yield Vp(p,i,{getState:r,updateCachedData:n,dispatch:a},Lp[o]?.())}).apply(this,arguments)}})})}),cR=e=>MM.endpoints.generateAnswer.initiate(e);d();c();l();u();d();c();l();u();var uR=Ye(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:a}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(a&&{lq:a})}});d();c();l();u();var lR=e=>e.context;d();c();l();u();var $S=e=>e.pipeline;d();c();l();u();var HS=e=>e.searchHub;d();c();l();u();var Gt=Ye(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),qie=Ye(e=>e,e=>{let t=Gt(e);return t&&e?e[t].expression:""});d();c();l();u();var dR=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var pR=e=>e.excerptLength?.length;d();c();l();u();var en=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,fR=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var mR=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var gR=e=>e.sortCriteria;var hR=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:it(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function hR(_x127){return _ref46.apply(this,arguments)}}(),yR=(e,t)=>{let r=Ro(e)?.q,{aq:n,cq:a,dq:o,lq:i}=VM(e),p=lR(e),f=Un(e.configuration.analytics,t,{actionCause:kS(e)}),m=HS(e),g=$S(e),A=tS(e)??[],x=SR(e),h=Gt(e.tabSet)||"default",C=Zy(e),R=Cb(e),w=t.referrer||"",b=fR(e),F=gR(e),E=jM(e),P=pR(e),V=mR(e),_=dR(e);return{q:r,...(n&&{aq:n}),...(a&&{cq:a}),...(o&&{dq:o}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:zw(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:A}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(x.length&&{facets:x}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:TS(e),firstResult:e.pagination.firstResult}),tab:h,locale:C,timezone:R,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...E,...(V??{}),...(P&&{excerptLength:P}),...(_&&{dictionaryFieldContext:_}),sortCriteria:F,...(b&&{facetOptions:b}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Yp=(e,t)=>{let r=Ro(e)?.q,n=SR(e),a=Un(e.configuration.analytics,t,{actionCause:kS(e)}),o=Zy(e),i=HS(e),p=$S(e),f=tS(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:f}},...(i?.length&&{searchHub:i}),...(p?.length&&{pipeline:p}),...a,locale:o}},SR=e=>Ip(e)?.map(t=>CS(t,xS())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),jM=e=>({actionsHistory:e.configuration.analytics.enabled?Wt.getInstance().getHistory():[]}),VM=e=>{let t=uR(e),r=PS(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var vR=["text/plain","text/markdown"];var Us=new M({required:!0}),AR=new M,Qs=new ce({required:!0}),GS={id:Us,title:Us,uri:Us,permanentid:Us,clickUri:AR},Wp=new M({required:!0,constrainTo:vR}),Bs=T("generatedAnswer/setIsVisible",e=>O(e,Qs)),Da=T("generatedAnswer/setAnswerId",e=>O(e,z)),Jp=T("generatedAnswer/setAnswerGenerationMode",e=>O(e,new M({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),ml=T("generatedAnswer/setIsEnabled",e=>O(e,Qs)),Gn=T("generatedAnswer/updateMessage",e=>O(e,{textDelta:Us})),$n=T("generatedAnswer/updateCitations",e=>O(e,{citations:new oe({required:!0,each:new J({values:GS})})})),Hn=T("generatedAnswer/updateError",e=>O(e,{message:AR,code:new ee({min:0})})),Jt=T("generatedAnswer/resetAnswer"),Xp=T("generatedAnswer/like"),Zp=T("generatedAnswer/dislike"),ef=T("generatedAnswer/feedbackModal/open"),gl=T("generatedAnswer/expand"),tf=T("generatedAnswer/collapse"),rf=T("generatedAnswer/setId",e=>O(e,{id:new M({required:!0})})),nf=T("generatedAnswer/feedbackModal/close"),Gs=T("generatedAnswer/sendFeedback"),cr=T("generatedAnswer/setIsLoading",e=>O(e,Qs)),Zr=T("generatedAnswer/setIsStreaming",e=>O(e,Qs)),zn=T("generatedAnswer/setAnswerContentFormat",e=>O(e,Wp)),af=T("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new oe({each:Wp,default:["text/plain"]})})),of=T("knowledge/updateAnswerConfigurationId",e=>O(e,Us)),sf=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,dd)),Eo=T("generatedAnswer/setIsAnswerGenerated",e=>O(e,Qs)),Wn=T("generatedAnswer/setCannotAnswer",e=>O(e,Qs)),cf=T("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new J({}))),uf=T("generatedAnswer/startStep",e=>O(e,{name:new M({required:!0,constrainTo:Ts}),startedAt:new ee({min:0,required:!0})})),lf=T("generatedAnswer/finishStep",e=>O(e,{name:new M({required:!0,constrainTo:Ts}),finishedAt:new ee({min:0,required:!0})})),xR=Se("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:a,getState:o}=t,{search:i}=o(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield hR(r),g=(h,C)=>{switch(h){case"genqa.headerMessageType":{let R=JSON.parse(C);n(zn(R.contentFormat));break}case"genqa.messageType":n(Gn(JSON.parse(C)));break;case"genqa.citationsType":n($n(JSON.parse(C)));break;case"genqa.endOfStreamType":{let R=JSON.parse(C).answerGenerated,w=p.length!==0&&!R;n(Wn(w)),n(Zr(!1)),n(Eo(R)),n(Fo(R)),n(Vs());break}default:r.debug&&a.logger.warn(`Unknown payloadType: "${h}"`)}};n(cr(!0));let A=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,x=a.streamingClient?.streamGeneratedAnswer(m,{write:h=>{A(m)&&(n(cr(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{A(m)&&n(Hn(h))},close:()=>{A(m)&&n(Zr(!1))},resetAnswer:()=>{A(m)&&n(Jt())}});x?f(x):n(cr(!1))});return function(_x128,_x129){return _ref47.apply(this,arguments)}}()),df=Se("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:a}}){r(Jt());let o=t();if(o.generatedAnswer.answerConfigurationId){let i=yR(o,n);r(cf(i)),yield r(pf(i))}else a.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x130,_x131){return _ref48.apply(this,arguments)}}()),CR=Se("generatedAnswerWithFollowUps/generateHeadAnswer",/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:a}}){let o=t();if(!va(o)){a.warn("Missing agentId in engine configuration. The generateHeadAnswer action requires an agent ID.");return}r(Jt());let p=Yp(o,n),f={...p,strategyKey:"head-answer"};r(cf(p)),yield r(cR(f))});return function(_x132,_x133){return _ref49.apply(this,arguments)}}());var LM=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},UM=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},QM=(e,t)=>{e.citations=t.citations},BM=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},GM=(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})`)},$M=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&GM(t,n);let a=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":a.contentFormat&&(LM(t,a),r(zn(a.contentFormat)));break;case"genqa.messageType":a.textDelta&&(UM(t,a),r(Gn({textDelta:a.textDelta})));break;case"genqa.citationsType":a.citations&&(QM(t,a),r($n({citations:a.citations})));break;case"genqa.endOfStreamType":BM(t,a),r(Fo(a.answerGenerated??!1)),r(Vs());break}},HM=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let a=`/rest/organizations/${t}`,o=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${a}/${o}/${r}/generate`},Io=Dp.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,...a}=r;return`${t}(${JSON.stringify(a)})`},onCacheEntryAdded(_x134,_x135){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:a,dispatch:o}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:A}=i,x=it(m,g),h=HM(x,m,p.answerConfigurationId,f?.insightId);yield Fi(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${A}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref50=_asyncToGenerator(function*(C){let R=C.headers.get("x-answer-id");R&&a(w=>{w.answerId=R,o(Da(R))})});return function onopen(_x136){return _ref50.apply(this,arguments)}}(),onmessage:C=>{a(R=>{$M(C,R,o)})},onerror:C=>{throw C},onclose:()=>{a(C=>{o(Wn(!C.generated))})}})}).apply(this,arguments)}})})}),pf=e=>Io.endpoints.getAnswer.initiate(e),zS=e=>{let t=qp(e);return Io.endpoints.getAnswer.select(t??wo)(e)};d();c();l();u();var bR=ae(ha,e=>e);d();c();l();u();function zM(e){let t=e.payload?.analyticsAction;return wR(e)&&!le(t)}function wR(e){return"type"in e}var RR=e=>t=>r=>{let n;zM(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let a=t(r);return wR(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),a};d();c();l();u();d();c();l();u();d();c();l();u();var $s=T("tab/register",e=>{let t=new J({values:{id:z,expression:Ue}});return O(e,t)}),ht=T("tab/updateActiveTab",e=>O(e,z));d();c();l();u();var ff=Or(up(),1),IR=Or(FR(),1),TR=Or(ER(),1);ff.default.extend(TR.default);ff.default.extend(IR.default);var Hs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:ff.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var WM=/(^|; )Coveo-Pendragon=([^;]*)/;function XS(){return typeof window>"u"?!1:WM.exec(document.cookie)?.pop()||null}var mf=ae(Hs(),e=>e.addCase(Wr,(t,r)=>{KM(t,r.payload)}).addCase(gr,(t,r)=>{YM(t,r.payload)}).addCase(Ca,(t,r)=>{JM(t,r.payload)}).addCase(ts,t=>{t.analytics.enabled=!1}).addCase(rs,t=>{t.analytics.enabled=!0}).addCase(np,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(ap,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(ht,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ns,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(De,(t,r)=>{le(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(op,(t,{payload:r})=>{t.knowledge.agentId=r}));function KM(e,t){le(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",le(t.organizationId)||(e.organizationId=t.organizationId)}function YM(e,t){le(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),le(t.locale)||(e.search.locale=t.locale),le(t.timezone)||(e.search.timezone=t.timezone),le(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function JM(e,t){le(t.enabled)||(e.analytics.enabled=t.enabled),le(t.originContext)||(e.analytics.originContext=t.originContext),le(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),le(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),le(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),le(t.trackingId)||(e.analytics.trackingId=t.trackingId),le(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),le(t.source)||(e.analytics.source=t.source);try{let r=XS();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}le(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),le(t.anonymous)||(e.analytics.anonymous=t.anonymous),le(t.deviceId)||(e.analytics.deviceId=t.deviceId),le(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),le(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var ue=mf;d();c();l();u();function XM(e){return e.instantlyCallable}var PR=()=>e=>t=>e(XM(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var kt=[];for(let e=0;e<256;++e)kt.push((e+256).toString(16).slice(1));function kR(e,t=0){return(kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]).toLowerCase()}d();c();l();u();var ZS,ZM=new Uint8Array(16);function ev(){if(!ZS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ZS=crypto.getRandomValues.bind(crypto)}return ZS(ZM)}d();c();l();u();d();c();l();u();var ej=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),tv={randomUUID:ej};function tj(e,t,r){if(tv.randomUUID&&!t&&!e)return tv.randomUUID();e=e||{};let n=e.random??e.rng?.()??ev();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 a=0;a<16;++a)t[r+a]=n[a];return t}return kR(n)}var qa=tj;d();c();l();u();d();c();l();u();var I={};Ru(I,{BRAND:()=>Ej,DIRTY:()=>To,EMPTY_PATH:()=>oj,INVALID:()=>ve,NEVER:()=>dV,OK:()=>Mt,ParseStatus:()=>Ot,Schema:()=>Ie,ZodAny:()=>Va,ZodArray:()=>Xn,ZodBigInt:()=>ko,ZodBoolean:()=>Oo,ZodBranded:()=>yl,ZodCatch:()=>Bo,ZodDate:()=>No,ZodDefault:()=>Qo,ZodDiscriminatedUnion:()=>yf,ZodEffects:()=>br,ZodEnum:()=>Lo,ZodError:()=>Xt,ZodFirstPartyTypeKind:()=>Ae,ZodFunction:()=>vf,ZodIntersection:()=>Mo,ZodIssueCode:()=>Z,ZodLazy:()=>jo,ZodLiteral:()=>Vo,ZodMap:()=>Xs,ZodNaN:()=>ec,ZodNativeEnum:()=>Uo,ZodNever:()=>Mr,ZodNull:()=>Do,ZodNullable:()=>nn,ZodNumber:()=>Po,ZodObject:()=>Zt,ZodOptional:()=>xr,ZodParsedType:()=>se,ZodPipeline:()=>Sl,ZodPromise:()=>La,ZodReadonly:()=>Go,ZodRecord:()=>Sf,ZodSchema:()=>Ie,ZodSet:()=>Zs,ZodString:()=>ja,ZodSymbol:()=>Ys,ZodTransformer:()=>br,ZodTuple:()=>rn,ZodType:()=>Ie,ZodUndefined:()=>_o,ZodUnion:()=>qo,ZodUnknown:()=>Jn,ZodVoid:()=>Js,addIssueToContext:()=>ie,any:()=>qj,array:()=>Lj,bigint:()=>kj,boolean:()=>QR,coerce:()=>lV,custom:()=>VR,date:()=>Oj,datetimeRegex:()=>MR,defaultErrorMap:()=>Kn,discriminatedUnion:()=>Gj,effect:()=>rV,enum:()=>Zj,function:()=>Yj,getErrorMap:()=>zs,getParsedType:()=>tn,instanceof:()=>Tj,intersection:()=>$j,isAborted:()=>gf,isAsync:()=>Ws,isDirty:()=>hf,isValid:()=>Ma,late:()=>Ij,lazy:()=>Jj,literal:()=>Xj,makeIssue:()=>hl,map:()=>Wj,nan:()=>Pj,nativeEnum:()=>eV,never:()=>jj,null:()=>Dj,nullable:()=>aV,number:()=>UR,object:()=>Uj,objectUtil:()=>rv,oboolean:()=>uV,onumber:()=>cV,optional:()=>nV,ostring:()=>sV,pipeline:()=>iV,preprocess:()=>oV,promise:()=>tV,quotelessJson:()=>rj,record:()=>zj,set:()=>Kj,setErrorMap:()=>aj,strictObject:()=>Qj,string:()=>LR,symbol:()=>Nj,transformer:()=>rV,tuple:()=>Hj,undefined:()=>_j,union:()=>Bj,unknown:()=>Mj,util:()=>Oe,void:()=>Vj});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Oe;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{let o={};for(let i of a)o[i]=i;return o},e.getValidEnumValues=a=>{let o=e.objectKeys(a).filter(p=>typeof a[a[p]]!="number"),i={};for(let p of o)i[p]=a[p];return e.objectValues(i)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let o=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&o.push(i);return o},e.find=(a,o)=>{for(let i of a)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,o=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var rv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(rv||(rv={}));var se=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tn=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return Number.isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}};var Z=Oe.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"]),rj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Xt=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(o){return o.message},n={_errors:[]},a=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return a(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,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)if(a.path.length>0){let o=a.path[0];r[o]=r[o]||[],r[o].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Xt.create=e=>new Xt(e);var nj=(e,t)=>{let r;switch(e.code){case Z.invalid_type:e.received===se.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Oe.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(e.keys,", ")}`;break;case Z.invalid_union:r="Invalid input";break;case Z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(e.options)}`;break;case Z.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:r="Invalid function arguments";break;case Z.invalid_return_type:r="Invalid function return type";break;case Z.invalid_date:r="Invalid date";break;case Z.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}"`:Oe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Z.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 Z.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 Z.custom:r="Invalid input";break;case Z.invalid_intersection_types:r="Intersection results could not be merged";break;case Z.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:r="Number must be finite";break;default:r=t.defaultError,Oe.assertNever(e)}return{message:r}},Kn=nj;var OR=Kn;function aj(e){OR=e}function zs(){return OR}d();c();l();u();var hl=e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,o=[...r,...(a.path||[])],i={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...a,path:o,message:p}},oj=[];function ie(e,t){let r=zs(),n=hl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Kn?void 0:Kn].filter(a=>!!a)});e.common.issues.push(n)}var Ot=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 a of r){if(a.status==="aborted")return ve;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let a of r){let o=yield a.key,i=yield a.value;n.push({key:o,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:o,value:i}=a;if(o.status==="aborted"||i.status==="aborted")return ve;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}},ve=Object.freeze({status:"aborted"}),To=e=>({status:"dirty",value:e}),Mt=e=>({status:"valid",value:e}),gf=e=>e.status==="aborted",hf=e=>e.status==="dirty",Ma=e=>e.status==="valid",Ws=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var Cr=class{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}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}},NR=(e,t)=>{if(Ma(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 Xt(e.common.issues);return this._error=r,this._error}}};function Fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=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:a}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:a}}var Ie=class{get description(){return this._def.description}_getType(t){return tn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:tn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ot,ctx:{common:t.parent.common,data:t.data,parsedType:tn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Ws(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:tn(t)},a=this._parseSync({data:t,path:n.path,parent:n});return NR(n,a)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tn(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Ma(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=>Ma(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:tn(t)},a=_this25._parse({data:t,path:n.path,parent:n}),o=yield Ws(a)?a:Promise.resolve(a);return NR(n,o)})()}refine(t,r){let n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,o)=>{let i=t(a),p=()=>o.addIssue({code:Z.custom,...n(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new br({schema:this,typeName:Ae.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 xr.create(this,this._def)}nullable(){return nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xn.create(this)}promise(){return La.create(this,this._def)}or(t){return qo.create([this,t],this._def)}and(t){return Mo.create(this,t,this._def)}transform(t){return new br({...Fe(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Qo({...Fe(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new yl({typeName:Ae.ZodBranded,type:this,...Fe(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Bo({...Fe(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Sl.create(this,t)}readonly(){return Go.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ij=/^c[^\s-]{8,}$/i,sj=/^[0-9a-z]+$/,cj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uj=/^[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,lj=/^[a-z0-9_-]{21}$/i,dj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pj=/^[-+]?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)?)??$/,fj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",nv,gj=/^(?:(?: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])$/,hj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,yj=/^(([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]))$/,Sj=/^(([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])$/,vj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Aj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,DR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xj=new RegExp(`^${DR}$`);function qR(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 Cj(e){return new RegExp(`^${qR(e)}$`)}function MR(e){let t=`${DR}T${qR(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 bj(e,t){return!!((t==="v4"||!t)&&gj.test(e)||(t==="v6"||!t)&&yj.test(e))}function wj(e,t){if(!dj.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,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function Rj(e,t){return!!((t==="v4"||!t)&&hj.test(e)||(t==="v6"||!t)&&Sj.test(e))}var ja=class e extends Ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){let o=this._getOrReturnCtx(t);return ie(o,{code:Z.invalid_type,expected:se.string,received:o.parsedType}),ve}let n=new Ot,a;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=t.data.length>o.value,p=t.data.length<o.value;(i||p)&&(a=this._getOrReturnCtx(t,a),i?ie(a,{code:Z.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):p&&ie(a,{code:Z.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")fj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"email",code:Z.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")nv||(nv=new RegExp(mj,"u")),nv.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"emoji",code:Z.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")uj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"uuid",code:Z.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")lj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"nanoid",code:Z.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")ij.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"cuid",code:Z.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")sj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"cuid2",code:Z.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")cj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"ulid",code:Z.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),ie(a,{validation:"url",code:Z.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"regex",code:Z.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?MR(o).test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?xj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Cj(o).test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?pj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"duration",code:Z.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?bj(t.data,o.version)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"ip",code:Z.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?wj(t.data,o.alg)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"jwt",code:Z.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Rj(t.data,o.version)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"cidr",code:Z.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?vj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"base64",code:Z.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Aj.test(t.data)||(a=this._getOrReturnCtx(t,a),ie(a,{validation:"base64url",code:Z.invalid_string,message:o.message}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:Z.invalid_string,...de.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.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,...de.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,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...de.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...de.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...de.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...de.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...de.errToObj(r)})}nonempty(t){return this.min(1,de.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}};ja.create=e=>new ja({checks:[],typeName:Ae.ZodString,coerce:e?.coerce??!1,...Fe(e)});function Fj(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,o=Number.parseInt(e.toFixed(a).replace(".","")),i=Number.parseInt(t.toFixed(a).replace(".",""));return o%i/10**a}var Po=class e extends Ie{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)!==se.number){let o=this._getOrReturnCtx(t);return ie(o,{code:Z.invalid_type,expected:se.number,received:o.parsedType}),ve}let n,a=new Ot;for(let o of this._def.checks)o.kind==="int"?Oe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?Fj(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_finite,message:o.message}),a.dirty()):Oe.assertNever(o);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.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"&&Oe.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)}};Po.create=e=>new Po({checks:[],typeName:Ae.ZodNumber,coerce:e?.coerce||!1,...Fe(e)});var ko=class e extends Ie{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)!==se.bigint)return this._getInvalidInput(t);let n,a=new Ot;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):Oe.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ie(r,{code:Z.invalid_type,expected:se.bigint,received:r.parsedType}),ve}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(a)}]})}_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:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.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}};ko.create=e=>new ko({checks:[],typeName:Ae.ZodBigInt,coerce:e?.coerce??!1,...Fe(e)});var Oo=class extends Ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.boolean,received:n.parsedType}),ve}return Mt(t.data)}};Oo.create=e=>new Oo({typeName:Ae.ZodBoolean,coerce:e?.coerce||!1,...Fe(e)});var No=class e extends Ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){let o=this._getOrReturnCtx(t);return ie(o,{code:Z.invalid_type,expected:se.date,received:o.parsedType}),ve}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return ie(o,{code:Z.invalid_date}),ve}let n=new Ot,a;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),ie(a,{code:Z.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Oe.assertNever(o);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:de.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:de.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}};No.create=e=>new No({checks:[],coerce:e?.coerce||!1,typeName:Ae.ZodDate,...Fe(e)});var Ys=class extends Ie{_parse(t){if(this._getType(t)!==se.symbol){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.symbol,received:n.parsedType}),ve}return Mt(t.data)}};Ys.create=e=>new Ys({typeName:Ae.ZodSymbol,...Fe(e)});var _o=class extends Ie{_parse(t){if(this._getType(t)!==se.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.undefined,received:n.parsedType}),ve}return Mt(t.data)}};_o.create=e=>new _o({typeName:Ae.ZodUndefined,...Fe(e)});var Do=class extends Ie{_parse(t){if(this._getType(t)!==se.null){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.null,received:n.parsedType}),ve}return Mt(t.data)}};Do.create=e=>new Do({typeName:Ae.ZodNull,...Fe(e)});var Va=class extends Ie{constructor(){super(...arguments),this._any=!0}_parse(t){return Mt(t.data)}};Va.create=e=>new Va({typeName:Ae.ZodAny,...Fe(e)});var Jn=class extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Mt(t.data)}};Jn.create=e=>new Jn({typeName:Ae.ZodUnknown,...Fe(e)});var Mr=class extends Ie{_parse(t){let r=this._getOrReturnCtx(t);return ie(r,{code:Z.invalid_type,expected:se.never,received:r.parsedType}),ve}};Mr.create=e=>new Mr({typeName:Ae.ZodNever,...Fe(e)});var Js=class extends Ie{_parse(t){if(this._getType(t)!==se.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.void,received:n.parsedType}),ve}return Mt(t.data)}};Js.create=e=>new Js({typeName:Ae.ZodVoid,...Fe(e)});var Xn=class e extends Ie{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==se.array)return ie(r,{code:Z.invalid_type,expected:se.array,received:r.parsedType}),ve;if(a.exactLength!==null){let i=r.data.length>a.exactLength.value,p=r.data.length<a.exactLength.value;(i||p)&&(ie(r,{code:i?Z.too_big:Z.too_small,minimum:p?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(ie(r,{code:Z.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(ie(r,{code:Z.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>a.type._parseAsync(new Cr(r,i,r.path,p)))).then(i=>Ot.mergeArray(n,i));let o=[...r.data].map((i,p)=>a.type._parseSync(new Cr(r,i,r.path,p)));return Ot.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:de.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:de.toString(r)}})}nonempty(t){return this.min(1,t)}};Xn.create=(e,t)=>new Xn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...Fe(t)});function Ks(e){if(e instanceof Zt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=xr.create(Ks(n))}return new Zt({...e._def,shape:()=>t})}else return e instanceof Xn?new Xn({...e._def,type:Ks(e.element)}):e instanceof xr?xr.create(Ks(e.unwrap())):e instanceof nn?nn.create(Ks(e.unwrap())):e instanceof rn?rn.create(e.items.map(t=>Ks(t))):e}var Zt=class e extends Ie{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=Oe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==se.object){let m=this._getOrReturnCtx(t);return ie(m,{code:Z.invalid_type,expected:se.object,received:m.parsedType}),ve}let{status:n,ctx:a}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Mr&&this._def.unknownKeys==="strip"))for(let m in a.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=o[m],A=a.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Cr(a,A,a.path,m)),alwaysSet:m in a.data})}if(this._def.catchall instanceof Mr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(m==="strict")p.length>0&&(ie(a,{code:Z.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let A=a.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Cr(a,A,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let A=yield g.key,x=yield g.value;m.push({key:A,value:x,alwaysSet:g.alwaysSet})}return m})).then(m=>Ot.mergeObjectSync(n,m)):Ot.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:de.errToObj(t).message??a}:{message:a}}}:{})})}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:Ae.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 Oe.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 Oe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Ks(this)}partial(t){let r={};for(let n of Oe.objectKeys(this.shape)){let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Oe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof xr;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return jR(Oe.objectKeys(this.shape))}};Zt.create=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strip",catchall:Mr.create(),typeName:Ae.ZodObject,...Fe(t)});Zt.strictCreate=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strict",catchall:Mr.create(),typeName:Ae.ZodObject,...Fe(t)});Zt.lazycreate=(e,t)=>new Zt({shape:e,unknownKeys:"strip",catchall:Mr.create(),typeName:Ae.ZodObject,...Fe(t)});var qo=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(o){for(let p of o)if(p.result.status==="valid")return p.result;for(let p of o)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=o.map(p=>new Xt(p.ctx.common.issues));return ie(r,{code:Z.invalid_union,unionErrors:i}),ve}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(o){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x137){return _ref52.apply(this,arguments)}}())).then(a);{let o,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!o&&(o={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let p=i.map(f=>new Xt(f));return ie(r,{code:Z.invalid_union,unionErrors:p}),ve}}get options(){return this._def.options}};qo.create=(e,t)=>new qo({options:e,typeName:Ae.ZodUnion,...Fe(t)});var Yn=e=>e instanceof jo?Yn(e.schema):e instanceof br?Yn(e.innerType()):e instanceof Vo?[e.value]:e instanceof Lo?e.options:e instanceof Uo?Oe.objectValues(e.enum):e instanceof Qo?Yn(e._def.innerType):e instanceof _o?[void 0]:e instanceof Do?[null]:e instanceof xr?[void 0,...Yn(e.unwrap())]:e instanceof nn?[null,...Yn(e.unwrap())]:e instanceof yl||e instanceof Go?Yn(e.unwrap()):e instanceof Bo?Yn(e._def.innerType):[],yf=class e extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.object)return ie(r,{code:Z.invalid_type,expected:se.object,received:r.parsedType}),ve;let n=this.discriminator,a=r.data[n],o=this.optionsMap.get(a);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let o of r){let i=Yn(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(a.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);a.set(p,o)}}return new e({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...Fe(n)})}};function av(e,t){let r=tn(e),n=tn(t);if(e===t)return{valid:!0,data:e};if(r===se.object&&n===se.object){let a=Oe.objectKeys(t),o=Oe.objectKeys(e).filter(p=>a.indexOf(p)!==-1),i={...e,...t};for(let p of o){let f=av(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===se.array&&n===se.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let o=0;o<e.length;o++){let i=e[o],p=t[o],f=av(i,p);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return r===se.date&&n===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Mo=class extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=(o,i)=>{if(gf(o)||gf(i))return ve;let p=av(o.value,i.value);return p.valid?((hf(o)||hf(i))&&r.dirty(),{status:r.value,value:p.data}):(ie(n,{code:Z.invalid_intersection_types}),ve)};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(([o,i])=>a(o,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Mo.create=(e,t,r)=>new Mo({left:e,right:t,typeName:Ae.ZodIntersection,...Fe(r)});var rn=class e extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.array)return ie(n,{code:Z.invalid_type,expected:se.array,received:n.parsedType}),ve;if(n.data.length<this._def.items.length)return ie(n,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&n.data.length>this._def.items.length&&(ie(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Cr(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>Ot.mergeArray(r,i)):Ot.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};rn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rn({items:e,typeName:Ae.ZodTuple,rest:null,...Fe(t)})};var Sf=class e extends Ie{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!==se.object)return ie(n,{code:Z.invalid_type,expected:se.object,received:n.parsedType}),ve;let a=[],o=this._def.keyType,i=this._def.valueType;for(let p in n.data)a.push({key:o._parse(new Cr(n,p,n.path,p)),value:i._parse(new Cr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Ot.mergeObjectAsync(r,a):Ot.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ie?new e({keyType:t,valueType:r,typeName:Ae.ZodRecord,...Fe(n)}):new e({keyType:ja.create(),valueType:t,typeName:Ae.ZodRecord,...Fe(r)})}},Xs=class extends Ie{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!==se.map)return ie(n,{code:Z.invalid_type,expected:se.map,received:n.parsedType}),ve;let a=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:a._parse(new Cr(n,p,n.path,[m,"key"])),value:o._parse(new Cr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return ve;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return ve;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Xs.create=(e,t,r)=>new Xs({valueType:t,keyType:e,typeName:Ae.ZodMap,...Fe(r)});var Zs=class e extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.set)return ie(n,{code:Z.invalid_type,expected:se.set,received:n.parsedType}),ve;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(ie(n,{code:Z.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(ie(n,{code:Z.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let o=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return ve;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>o._parse(new Cr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:de.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Zs.create=(e,t)=>new Zs({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...Fe(t)});var vf=class e extends Ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.function)return ie(r,{code:Z.invalid_type,expected:se.function,received:r.parsedType}),ve;function n(p,f){return hl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zs(),Kn].filter(m=>!!m),issueData:{code:Z.invalid_arguments,argumentsError:f}})}function a(p,f){return hl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zs(),Kn].filter(m=>!!m),issueData:{code:Z.invalid_return_type,returnTypeError:f}})}let o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof La){let p=this;return Mt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new Xt([]),g=yield p._def.args.parseAsync(f,o).catch(h=>{throw m.addIssue(n(f,h)),m}),A=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(A,o).catch(h=>{throw m.addIssue(a(A,h)),m})}))}else{let p=this;return Mt(function(...f){let m=p._def.args.safeParse(f,o);if(!m.success)throw new Xt([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),A=p._def.returns.safeParse(g,o);if(!A.success)throw new Xt([a(g,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:rn.create(t).rest(Jn.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||rn.create([]).rest(Jn.create()),returns:r||Jn.create(),typeName:Ae.ZodFunction,...Fe(n)})}},jo=class extends Ie{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})}};jo.create=(e,t)=>new jo({getter:e,typeName:Ae.ZodLazy,...Fe(t)});var Vo=class extends Ie{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ie(r,{received:r.data,code:Z.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:t.data}}get value(){return this._def.value}};Vo.create=(e,t)=>new Vo({value:e,typeName:Ae.ZodLiteral,...Fe(t)});function jR(e,t){return new Lo({values:e,typeName:Ae.ZodEnum,...Fe(t)})}var Lo=class e extends Ie{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{expected:Oe.joinValues(n),received:r.parsedType,code:Z.invalid_type}),ve}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 ie(r,{received:r.data,code:Z.invalid_enum_value,options:n}),ve}return Mt(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})}};Lo.create=jR;var Uo=class extends Ie{_parse(t){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==se.string&&n.parsedType!==se.number){let a=Oe.objectValues(r);return ie(n,{expected:Oe.joinValues(a),received:n.parsedType,code:Z.invalid_type}),ve}if(this._cache||(this._cache=new Set(Oe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let a=Oe.objectValues(r);return ie(n,{received:n.data,code:Z.invalid_enum_value,options:a}),ve}return Mt(t.data)}get enum(){return this._def.values}};Uo.create=(e,t)=>new Uo({values:e,typeName:Ae.ZodNativeEnum,...Fe(t)});var La=class extends Ie{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.promise&&r.common.async===!1)return ie(r,{code:Z.invalid_type,expected:se.promise,received:r.parsedType}),ve;let n=r.parsedType===se.promise?r.data:Promise.resolve(r.data);return Mt(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};La.create=(e,t)=>new La({type:e,typeName:Ae.ZodPromise,...Fe(t)});var br=class extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:i=>{ie(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){let i=a.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return ve;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?ve:f.status==="dirty"?To(f.value):r.value==="dirty"?To(f.value):f});return function(_x138){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return ve;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?ve:p.status==="dirty"?To(p.value):r.value==="dirty"?To(p.value):p}}if(a.type==="refinement"){let i=p=>{let f=a.refinement(p,o);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?ve:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?ve:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(a.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ma(i))return ve;let p=a.transform(i.value,o);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ma(i)?Promise.resolve(a.transform(i.value,o)).then(p=>({status:r.value,value:p})):ve);Oe.assertNever(a)}};br.create=(e,t,r)=>new br({schema:e,typeName:Ae.ZodEffects,effect:t,...Fe(r)});br.createWithPreprocess=(e,t,r)=>new br({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...Fe(r)});var xr=class extends Ie{_parse(t){return this._getType(t)===se.undefined?Mt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};xr.create=(e,t)=>new xr({innerType:e,typeName:Ae.ZodOptional,...Fe(t)});var nn=class extends Ie{_parse(t){return this._getType(t)===se.null?Mt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};nn.create=(e,t)=>new nn({innerType:e,typeName:Ae.ZodNullable,...Fe(t)});var Qo=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===se.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Qo.create=(e,t)=>new Qo({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});var Bo=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ws(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xt(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Xt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Bo.create=(e,t)=>new Bo({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});var ec=class extends Ie{_parse(t){if(this._getType(t)!==se.nan){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.nan,received:n.parsedType}),ve}return{status:"valid",value:t.data}}};ec.create=e=>new ec({typeName:Ae.ZodNaN,...Fe(e)});var Ej=Symbol("zod_brand"),yl=class extends Ie{_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}},Sl=class e extends Ie{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let o=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ve:o.status==="dirty"?(r.dirty(),To(o.value)):_this27._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ve:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Ae.ZodPipeline})}},Go=class extends Ie{_parse(t){let r=this._def.innerType._parse(t),n=a=>(Ma(a)&&(a.value=Object.freeze(a.value)),a);return Ws(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};Go.create=(e,t)=>new Go({innerType:e,typeName:Ae.ZodReadonly,...Fe(t)});function _R(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function VR(e,t={},r){return e?Va.create().superRefine((n,a)=>{let o=e(n);if(o instanceof Promise)return o.then(i=>{if(!i){let p=_R(t,n),f=p.fatal??r??!0;a.addIssue({code:"custom",...p,fatal:f})}});if(!o){let i=_R(t,n),p=i.fatal??r??!0;a.addIssue({code:"custom",...i,fatal:p})}}):Va.create()}var Ij={object:Zt.lazycreate},Ae;(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"})(Ae||(Ae={}));var Tj=(e,t={message:`Input not instance of ${e.name}`})=>VR(r=>r instanceof e,t),LR=ja.create,UR=Po.create,Pj=ec.create,kj=ko.create,QR=Oo.create,Oj=No.create,Nj=Ys.create,_j=_o.create,Dj=Do.create,qj=Va.create,Mj=Jn.create,jj=Mr.create,Vj=Js.create,Lj=Xn.create,Uj=Zt.create,Qj=Zt.strictCreate,Bj=qo.create,Gj=yf.create,$j=Mo.create,Hj=rn.create,zj=Sf.create,Wj=Xs.create,Kj=Zs.create,Yj=vf.create,Jj=jo.create,Xj=Vo.create,Zj=Lo.create,eV=Uo.create,tV=La.create,rV=br.create,nV=xr.create,aV=nn.create,oV=br.createWithPreprocess,iV=Sl.create,sV=()=>LR().optional(),cV=()=>UR().optional(),uV=()=>QR().optional(),lV={string:e=>ja.create({...e,coerce:!0}),number:e=>Po.create({...e,coerce:!0}),boolean:e=>Oo.create({...e,coerce:!0}),bigint:e=>ko.create({...e,coerce:!0}),date:e=>No.create({...e,coerce:!0})};var dV=ve;var pV=I.object({name:I.string(),arguments:I.string()}),fV=I.object({id:I.string(),type:I.literal("function"),function:pV,encryptedValue:I.string().optional()}),Af=I.object({id:I.string(),role:I.string(),content:I.string().optional(),name:I.string().optional(),encryptedValue:I.string().optional()}),mV=I.object({type:I.literal("text"),text:I.string()}),BR=I.object({type:I.literal("binary"),mimeType:I.string(),id:I.string().optional(),url:I.string().optional(),data:I.string().optional(),filename:I.string().optional()}),GR=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:I.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},cde=BR.superRefine((e,t)=>{GR(e,t)}),gV=I.discriminatedUnion("type",[mV,BR]),hV=gV.superRefine((e,t)=>{e.type==="binary"&&GR(e,t)}),yV=Af.extend({role:I.literal("developer"),content:I.string()}),SV=Af.extend({role:I.literal("system"),content:I.string()}),vV=Af.extend({role:I.literal("assistant"),content:I.string().optional(),toolCalls:I.array(fV).optional()}),AV=Af.extend({role:I.literal("user"),content:I.union([I.string(),I.array(hV)])}),xV=I.object({id:I.string(),content:I.string(),role:I.literal("tool"),toolCallId:I.string(),error:I.string().optional(),encryptedValue:I.string().optional()}),CV=I.object({id:I.string(),role:I.literal("activity"),activityType:I.string(),content:I.record(I.any())}),bV=I.object({id:I.string(),role:I.literal("reasoning"),content:I.string(),encryptedValue:I.string().optional()}),$R=I.discriminatedUnion("role",[yV,SV,vV,AV,xV,CV,bV]),ude=I.union([I.literal("developer"),I.literal("system"),I.literal("assistant"),I.literal("user"),I.literal("tool"),I.literal("activity"),I.literal("reasoning")]),wV=I.object({description:I.string(),value:I.string()}),RV=I.object({name:I.string(),description:I.string(),parameters:I.any()}),FV=I.object({threadId:I.string(),runId:I.string(),parentRunId:I.string().optional(),state:I.any(),messages:I.array($R),tools:I.array(RV),context:I.array(wV),forwardedProps:I.any()}),EV=I.any(),et=class extends Error{constructor(e){super(e)}},ov=class extends et{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},HR=I.union([I.literal("developer"),I.literal("system"),I.literal("assistant"),I.literal("user")]),D=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),je=I.object({type:I.nativeEnum(D),timestamp:I.number().optional(),rawEvent:I.any().optional()}).passthrough(),IV=je.extend({type:I.literal(D.TEXT_MESSAGE_START),messageId:I.string(),role:HR.default("assistant")}),zR=je.extend({type:I.literal(D.TEXT_MESSAGE_CONTENT),messageId:I.string(),delta:I.string().refine(e=>e.length>0,"Delta must not be an empty string")}),TV=je.extend({type:I.literal(D.TEXT_MESSAGE_END),messageId:I.string()}),PV=je.extend({type:I.literal(D.TEXT_MESSAGE_CHUNK),messageId:I.string().optional(),role:HR.optional(),delta:I.string().optional()}),kV=je.extend({type:I.literal(D.THINKING_TEXT_MESSAGE_START)}),OV=zR.omit({messageId:!0,type:!0}).extend({type:I.literal(D.THINKING_TEXT_MESSAGE_CONTENT)}),NV=je.extend({type:I.literal(D.THINKING_TEXT_MESSAGE_END)}),_V=je.extend({type:I.literal(D.TOOL_CALL_START),toolCallId:I.string(),toolCallName:I.string(),parentMessageId:I.string().optional()}),DV=je.extend({type:I.literal(D.TOOL_CALL_ARGS),toolCallId:I.string(),delta:I.string()}),qV=je.extend({type:I.literal(D.TOOL_CALL_END),toolCallId:I.string()}),MV=je.extend({messageId:I.string(),type:I.literal(D.TOOL_CALL_RESULT),toolCallId:I.string(),content:I.string(),role:I.literal("tool").optional()}),jV=je.extend({type:I.literal(D.TOOL_CALL_CHUNK),toolCallId:I.string().optional(),toolCallName:I.string().optional(),parentMessageId:I.string().optional(),delta:I.string().optional()}),VV=je.extend({type:I.literal(D.THINKING_START),title:I.string().optional()}),LV=je.extend({type:I.literal(D.THINKING_END)}),UV=je.extend({type:I.literal(D.STATE_SNAPSHOT),snapshot:EV}),QV=je.extend({type:I.literal(D.STATE_DELTA),delta:I.array(I.any())}),BV=je.extend({type:I.literal(D.MESSAGES_SNAPSHOT),messages:I.array($R)}),GV=je.extend({type:I.literal(D.ACTIVITY_SNAPSHOT),messageId:I.string(),activityType:I.string(),content:I.record(I.any()),replace:I.boolean().optional().default(!0)}),$V=je.extend({type:I.literal(D.ACTIVITY_DELTA),messageId:I.string(),activityType:I.string(),patch:I.array(I.any())}),HV=je.extend({type:I.literal(D.RAW),event:I.any(),source:I.string().optional()}),zV=je.extend({type:I.literal(D.CUSTOM),name:I.string(),value:I.any()}),WV=je.extend({type:I.literal(D.RUN_STARTED),threadId:I.string(),runId:I.string(),parentRunId:I.string().optional(),input:FV.optional()}),KV=je.extend({type:I.literal(D.RUN_FINISHED),threadId:I.string(),runId:I.string(),result:I.any().optional()}),YV=je.extend({type:I.literal(D.RUN_ERROR),message:I.string(),code:I.string().optional()}),JV=je.extend({type:I.literal(D.STEP_STARTED),stepName:I.string()}),XV=je.extend({type:I.literal(D.STEP_FINISHED),stepName:I.string()}),ZV=I.union([I.literal("tool-call"),I.literal("message")]),eL=je.extend({type:I.literal(D.REASONING_START),messageId:I.string()}),tL=je.extend({type:I.literal(D.REASONING_MESSAGE_START),messageId:I.string(),role:I.literal("reasoning")}),rL=je.extend({type:I.literal(D.REASONING_MESSAGE_CONTENT),messageId:I.string(),delta:I.string().refine(e=>e.length>0,"Delta must not be an empty string")}),nL=je.extend({type:I.literal(D.REASONING_MESSAGE_END),messageId:I.string()}),aL=je.extend({type:I.literal(D.REASONING_MESSAGE_CHUNK),messageId:I.string().optional(),delta:I.string().optional()}),oL=je.extend({type:I.literal(D.REASONING_END),messageId:I.string()}),iL=je.extend({type:I.literal(D.REASONING_ENCRYPTED_VALUE),subtype:ZV,entityId:I.string(),encryptedValue:I.string()}),xf=I.discriminatedUnion("type",[IV,zR,TV,PV,VV,LV,kV,OV,NV,_V,DV,qV,jV,MV,UV,QV,BV,GV,$V,HV,zV,WV,KV,YV,JV,XV,eL,tL,rL,nL,aL,oL,iL]);d();c();l();u();var iv={};Ru(iv,{JsonPatchError:()=>nt,_areEquals:()=>xl,applyOperation:()=>$o,applyPatch:()=>Ua,applyReducer:()=>dL,deepClone:()=>uL,getValueByPointer:()=>Ff,validate:()=>KR,validator:()=>Ef});d();c();l();u();d();c();l();u();var sL=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)a.hasOwnProperty(o)&&(n[o]=a[o])},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)}}(),cL=Object.prototype.hasOwnProperty;function bf(e,t){return cL.call(e,t)}function wf(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 a in e)bf(e,a)&&n.push(a);return n}function Nt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Rf(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 an(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function vl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Cf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Cf(e[t]))return!0}else if(typeof e=="object"){for(var n=wf(e),a=n.length,o=0;o<a;o++)if(Cf(e[n[o]]))return!0}}return!1}function WR(e,t){var r=[e];for(var n in t){var a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(n+": "+a)}return r.join(`
32
- `)}var Al=function(e){sL(t,e);function t(r,n,a,o,i){var p=this.constructor,f=e.call(this,WR(r,{name:n,index:a,operation:o,tree:i}))||this;return f.name=n,f.index=a,f.operation=o,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=WR(r,{name:n,index:a,operation:o,tree:i}),f}return t}(Error);var nt=Al,uL=Nt,tc={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=Ff(r,this.path);n&&(n=Nt(n));var a=$o(r,{op:"remove",path:this.from}).removed;return $o(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Ff(r,this.from);return $o(r,{op:"add",path:this.path,value:Nt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:xl(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},lL={add:function(e,t,r){return Rf(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:tc.move,copy:tc.copy,test:tc.test,_get:tc._get};function Ff(e,t){if(t=="")return e;var r={op:"_get",path:t};return $o(e,r),r.value}function $o(e,t,r,n,a,o){if(r===void 0&&(r=!1),n===void 0&&(n=!0),a===void 0&&(a=!0),o===void 0&&(o=0),r&&(typeof r=="function"?r(t,0,e,t.path):Ef(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=Ff(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=xl(e,t.value),i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return i}}else{n||(e=Nt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,A=f.length,x=void 0,h=void 0,C=void 0;for(typeof r=="function"?C=r:C=Ef;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=vl(h)),a&&(h=="__proto__"||h=="prototype"&&g>0&&f[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&x===void 0&&(m[h]===void 0?x=f.slice(0,g).join("/"):g==A-1&&(x=t.path),x!==void 0&&C(t,0,e,x)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!Rf(h))throw new nt("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",o,t,e);Rf(h)&&(h=~~h)}if(g>=A){if(r&&t.op==="add"&&h>m.length)throw new nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var i=lL[t.op].call(t,m,h,e);if(i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return i}}else if(g>=A){var i=tc[t.op].call(t,m,h,e);if(i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return i}if(m=m[h],r&&g<A&&(!m||typeof m!="object"))throw new nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function Ua(e,t,r,n,a){if(n===void 0&&(n=!0),a===void 0&&(a=!0),r&&!Array.isArray(t))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Nt(e));for(var o=new Array(t.length),i=0,p=t.length;i<p;i++)o[i]=$o(e,t[i],r,!0,a,i),e=o[i].newDocument;return o.newDocument=e,o}function dL(e,t,r){var n=$o(e,t);if(n.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Ef(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(tc[e.op]){if(typeof e.path!="string")throw new nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new nt("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 nt("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 nt("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")&&Cf(e.value))throw new nt("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 a=e.path.split("/").length,o=n.split("/").length;if(a!==o+1&&a!==o)throw new nt("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 nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=KR([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function KR(e,t,r){try{if(!Array.isArray(e))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Ua(Nt(t),Nt(e),r||!0);else{r=r||Ef;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof nt)return a;throw a}}function xl(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),a,o,i;if(r&&n){if(o=e.length,o!=t.length)return!1;for(a=o;a--!==0;)if(!xl(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(o=p.length,o!==Object.keys(t).length)return!1;for(a=o;a--!==0;)if(!t.hasOwnProperty(p[a]))return!1;for(a=o;a--!==0;)if(i=p[a],!xl(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var lv={};Ru(lv,{compare:()=>vL,generate:()=>sv,observe:()=>SL,unobserve:()=>yL});d();c();l();u();var cv=new WeakMap,pL=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),fL=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function mL(e){return cv.get(e)}function gL(e,t){return e.observers.get(t)}function hL(e,t){e.observers.delete(t.callback)}function yL(e,t){t.unobserve()}function SL(e,t){var r=[],n,a=mL(e);if(!a)a=new pL(e),cv.set(e,a);else{var o=gL(a,t);n=o&&o.observer}if(n)return n;if(n={},a.value=Nt(e),t){n.callback=t,n.next=null;var i=function(){sv(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){sv(n),clearTimeout(n.next),hL(a,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},a.observers.set(t,new fL(t,n)),n}function sv(e,t){t===void 0&&(t=!1);var r=cv.get(e.object);uv(r.value,e.object,e.patches,"",t),e.patches.length&&Ua(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function uv(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=wf(t),i=wf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],A=e[g];if(bf(t,g)&&!(t[g]===void 0&&A!==void 0&&Array.isArray(t)===!1)){var x=t[g];typeof A=="object"&&A!=null&&typeof x=="object"&&x!=null&&Array.isArray(A)===Array.isArray(x)?uv(A,x,r,n+"/"+an(g),a):A!==x&&(p=!0,a&&r.push({op:"test",path:n+"/"+an(g),value:Nt(A)}),r.push({op:"replace",path:n+"/"+an(g),value:Nt(x)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+an(g),value:Nt(A)}),r.push({op:"remove",path:n+"/"+an(g)}),f=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&o.length==i.length))for(var m=0;m<o.length;m++){var g=o[m];!bf(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+an(g),value:Nt(t[g])})}}}function vL(e,t,r){r===void 0&&(r=!1);var n=[];return uv(e,t,n,"",r),n}var _de=Object.assign({},iv,lv,{JsonPatchError:Al,deepClone:Nt,escapePathComponent:an,unescapePathComponent:vl});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var dv=function(e,t){return dv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},dv(e,t)};function on(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");dv(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function YR(e,t,r,n){function a(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function p(g){try{m(n.next(g))}catch(A){i(A)}}function f(g){try{m(n.throw(g))}catch(A){i(A)}}function m(g){g.done?o(g.value):a(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function If(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,a&&(o=m[0]&2?a.return:m[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,m[1])).done)return o;switch(a=0,o&&(m=[m[0]&2,o.value]),m[0]){case 0:case 1:o=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,a=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!o||m[1]>o[0]&&m[1]<o[3])){r.label=m[1];break}if(m[0]===6&&r.label<o[1]){r.label=o[1],o=m;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(m);break}o[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],a=0}finally{n=o=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function Zn(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 rc(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,o=[],i;try{for(;(t===void 0||t-->0)&&!(a=n.next()).done;)o.push(a.value)}catch(p){i={error:p}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return o}function nc(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,o;n<a;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function Ho(e){return this instanceof Ho?(this.v=e,this):new Ho(e)}function JR(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),a,o=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),a[Symbol.asyncIterator]=function(){return this},a;function i(h){return function(C){return Promise.resolve(C).then(h,A)}}function p(h,C){n[h]&&(a[h]=function(R){return new Promise(function(w,b){o.push([h,R,w,b])>1||f(h,R)})},C&&(a[h]=C(a[h])))}function f(h,C){try{m(n[h](C))}catch(R){x(o[0][3],R)}}function m(h){h.value instanceof Ho?Promise.resolve(h.value.v).then(g,A):x(o[0][2],h)}function g(h){f("next",h)}function A(h){f("throw",h)}function x(h,C){h(C),o.shift(),o.length&&f(o[0][0],o[0][1])}}function XR(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 Zn=="function"?Zn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(i){return new Promise(function(p,f){i=e[o](i),a(p,f,i.done,i.value)})}}function a(o,i,p,f){Promise.resolve(f).then(function(m){o({value:m,done:p})},i)}}d();c();l();u();function Pe(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function ac(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 Tf=ac(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
33
- `+r.map(function(n,a){return a+1+") "+n.toString()}).join(`
34
- `):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Cl(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var oc=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,a,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=Zn(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(R){t={error:R}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var g=this.initialTeardown;if(Pe(g))try{g()}catch(R){o=R instanceof Tf?R.errors:[R]}var A=this._finalizers;if(A){this._finalizers=null;try{for(var x=Zn(A),h=x.next();!h.done;h=x.next()){var C=h.value;try{ZR(C)}catch(R){o=o??[],R instanceof Tf?o=nc(nc([],rc(o)),rc(R.errors)):o.push(R)}}}catch(R){n={error:R}}finally{try{h&&!h.done&&(a=x.return)&&a.call(x)}finally{if(n)throw n.error}}}if(o)throw new Tf(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)ZR(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)&&Cl(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Cl(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var pv=oc.EMPTY;function Pf(e){return e instanceof oc||e&&"closed"in e&&Pe(e.remove)&&Pe(e.add)&&Pe(e.unsubscribe)}function ZR(e){Pe(e)?e():e.unsubscribe()}d();c();l();u();var jr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var ic={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=ic.delegate;return a?.setTimeout?a.setTimeout.apply(a,nc([e,t],rc(r))):setTimeout.apply(void 0,nc([e,t],rc(r)))},clearTimeout:function(e){var t=ic.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function kf(e){ic.setTimeout(function(){var t=jr.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function bl(){}d();c();l();u();var eF=function(){return fv("C",void 0,void 0)}();function tF(e){return fv("E",void 0,e)}function rF(e){return fv("N",e,void 0)}function fv(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var zo=null;function sc(e){if(jr.useDeprecatedSynchronousErrorHandling){var t=!zo;if(t&&(zo={errorThrown:!1,error:null}),e(),t){var r=zo,n=r.errorThrown,a=r.error;if(zo=null,n)throw a}}else e()}function nF(e){jr.useDeprecatedSynchronousErrorHandling&&zo&&(zo.errorThrown=!0,zo.error=e)}var wl=function(e){on(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Pf(r)&&r.add(n)):n.destination=wL,n}return t.create=function(r,n,a){return new Nf(r,n,a)},t.prototype.next=function(r){this.isStopped?gv(rF(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?gv(tF(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?gv(eF,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}(oc);var xL=Function.prototype.bind;function mv(e,t){return xL.call(e,t)}var CL=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){Of(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Of(n)}else Of(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Of(r)}},e}(),Nf=function(e){on(t,e);function t(r,n,a){var o=e.call(this)||this,i;if(Pe(r)||!r)i={next:r??void 0,error:n??void 0,complete:a??void 0};else{var p;o&&jr.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return o.unsubscribe()},i={next:r.next&&mv(r.next,p),error:r.error&&mv(r.error,p),complete:r.complete&&mv(r.complete,p)}):i=r}return o.destination=new CL(i),o}return t}(wl);function Of(e){jr.useDeprecatedSynchronousErrorHandling?nF(e):kf(e)}function bL(e){throw e}function gv(e,t){var r=jr.onStoppedNotification;r&&ic.setTimeout(function(){return r(e,t)})}var wL={closed:!0,next:bl,error:bL,complete:bl};d();c();l();u();var cc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function uc(e){return e}function _f(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hv(e)}function hv(e){return e.length===0?uc:e.length===1?e[0]:function(r){return e.reduce(function(n,a){return a(n)},r)}}var We=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 a=this,o=FL(t)?t:new Nf(t,r,n);return sc(function(){var i=a,p=i.operator,f=i.source;o.add(p?p.call(o,f):f?a._subscribe(o):a._trySubscribe(o))}),o},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=aF(r),new r(function(a,o){var i=new Nf({next:function(p){try{t(p)}catch(f){o(f),i.unsubscribe()}},error:o,complete:a});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[cc]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return hv(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=aF(t),new t(function(n,a){var o;r.subscribe(function(i){return o=i},function(i){return a(i)},function(){return n(o)})})},e.create=function(t){return new e(t)},e}();function aF(e){var t;return(t=e??jr.Promise)!==null&&t!==void 0?t:Promise}function RL(e){return e&&Pe(e.next)&&Pe(e.error)&&Pe(e.complete)}function FL(e){return e&&e instanceof wl||RL(e)&&Pf(e)}d();c();l();u();function EL(e){return Pe(e?.lift)}function mt(e){return function(t){if(EL(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function St(e,t,r,n,a){return new IL(e,t,r,n,a)}var IL=function(e){on(t,e);function t(r,n,a,o,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(g){r.error(g)}}:e.prototype._next,f._error=o?function(m){try{o(m)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=a?function(){try{a()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(wl);d();c();l();u();d();c();l();u();var oF=ac(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var sn=function(e){on(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 iF(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new oF},t.prototype.next=function(r){var n=this;sc(function(){var a,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=Zn(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){a={error:m}}finally{try{p&&!p.done&&(o=i.return)&&o.call(i)}finally{if(a)throw a.error}}}})},t.prototype.error=function(r){var n=this;sc(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var a=n.observers;a.length;)a.shift().error(r)}})},t.prototype.complete=function(){var r=this;sc(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,a=this,o=a.hasError,i=a.isStopped,p=a.observers;return o||i?pv:(this.currentObservers=null,p.push(r),new oc(function(){n.currentObservers=null,Cl(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,a=n.hasError,o=n.thrownError,i=n.isStopped;a?r.error(o):i&&r.complete()},t.prototype.asObservable=function(){var r=new We;return r.source=this,r},t.create=function(r,n){return new iF(r,n)},t}(We);var iF=function(e){on(t,e);function t(r,n){var a=e.call(this)||this;return a.destination=r,a.source=n,a}return t.prototype.next=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.next)===null||a===void 0||a.call(n,r)},t.prototype.error=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.error)===null||a===void 0||a.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,a;return(a=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&a!==void 0?a:pv},t}(sn);d();c();l();u();d();c();l();u();var yv={now:function(){return(yv.delegate||Date).now()},delegate:void 0};var Df=function(e){on(t,e);function t(r,n,a){r===void 0&&(r=1/0),n===void 0&&(n=1/0),a===void 0&&(a=yv);var o=e.call(this)||this;return o._bufferSize=r,o._windowTime=n,o._timestampProvider=a,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=n===1/0,o._bufferSize=Math.max(1,r),o._windowTime=Math.max(1,n),o}return t.prototype.next=function(r){var n=this,a=n.isStopped,o=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;a||(o.push(r),!i&&o.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),a=this,o=a._infiniteTimeWindow,i=a._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=o?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,a=r._timestampProvider,o=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<o.length&&o.splice(0,o.length-p),!i){for(var f=a.now(),m=0,g=1;g<o.length&&o[g]<=f;g+=2)m=g;m&&o.splice(0,m+1)}},t}(sn);d();c();l();u();var qf=new We(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function sF(e){return e&&Pe(e.schedule)}function TL(e){return e[e.length-1]}function cF(e){return sF(TL(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Mf=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function jf(e){return Pe(e?.then)}d();c();l();u();function Vf(e){return Pe(e[cc])}d();c();l();u();function Lf(e){return Symbol.asyncIterator&&Pe(e?.[Symbol.asyncIterator])}d();c();l();u();function Uf(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function PL(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Qf=PL();function Bf(e){return Pe(e?.[Qf])}d();c();l();u();function Gf(e){return JR(this,arguments,function(){var r,n,a,o;return If(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,Ho(r.read())];case 3:return n=i.sent(),a=n.value,o=n.done,o?[4,Ho(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,Ho(a)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function $f(e){return Pe(e?.getReader)}function vt(e){if(e instanceof We)return e;if(e!=null){if(Vf(e))return kL(e);if(Mf(e))return OL(e);if(jf(e))return NL(e);if(Lf(e))return uF(e);if(Bf(e))return _L(e);if($f(e))return DL(e)}throw Uf(e)}function kL(e){return new We(function(t){var r=e[cc]();if(Pe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function OL(e){return new We(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function NL(e){return new We(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,kf)})}function _L(e){return new We(function(t){var r,n;try{for(var a=Zn(e),o=a.next();!o.done;o=a.next()){var i=o.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}t.complete()})}function uF(e){return new We(function(t){qL(e,t).catch(function(r){return t.error(r)})})}function DL(e){return uF(Gf(e))}function qL(e,t){var r,n,a,o;return YR(this,void 0,void 0,function(){var i,p;return If(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=XR(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),a={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function wr(e,t,r,n,a){n===void 0&&(n=0),a===void 0&&(a=!1);var o=t.schedule(function(){r(),a?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!a)return o}function Hf(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(St(n,function(a){return wr(n,e,function(){return n.next(a)},t)},function(){return wr(n,e,function(){return n.complete()},t)},function(a){return wr(n,e,function(){return n.error(a)},t)}))})}d();c();l();u();function zf(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function lF(e,t){return vt(e).pipe(zf(t),Hf(t))}d();c();l();u();function dF(e,t){return vt(e).pipe(zf(t),Hf(t))}d();c();l();u();function pF(e,t){return new We(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function fF(e,t){return new We(function(r){var n;return wr(r,t,function(){n=e[Qf](),wr(r,t,function(){var a,o,i;try{a=n.next(),o=a.value,i=a.done}catch(p){r.error(p);return}i?r.complete():r.next(o)},0,!0)}),function(){return Pe(n?.return)&&n.return()}})}d();c();l();u();function Wf(e,t){if(!e)throw new Error("Iterable cannot be null");return new We(function(r){wr(r,t,function(){var n=e[Symbol.asyncIterator]();wr(r,t,function(){n.next().then(function(a){a.done?r.complete():r.next(a.value)})},0,!0)})})}d();c();l();u();function mF(e,t){return Wf(Gf(e),t)}function gF(e,t){if(e!=null){if(Vf(e))return lF(e,t);if(Mf(e))return pF(e,t);if(jf(e))return dF(e,t);if(Lf(e))return Wf(e,t);if(Bf(e))return fF(e,t);if($f(e))return mF(e,t)}throw Uf(e)}function Wo(e,t){return t?gF(e,t):vt(e)}function tt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=cF(e);return Wo(e,r)}d();c();l();u();function Ke(e,t){var r=Pe(e)?e:function(){return e},n=function(a){return a.error(r())};return new We(t?function(a){return t.schedule(n,0,a)}:n)}d();c();l();u();d();c();l();u();var hF=ac(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Kf(e,t){var r=typeof t=="object";return new Promise(function(n,a){var o=!1,i;e.subscribe({next:function(p){i=p,o=!0},error:a,complete:function(){o?n(i):r?n(t.defaultValue):a(new hF)}})})}d();c();l();u();function Ko(e,t){return mt(function(r,n){var a=0;r.subscribe(St(n,function(o){n.next(e.call(t,o,a++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function yF(e,t,r,n,a,o,i,p){var f=[],m=0,g=0,A=!1,x=function(){A&&!f.length&&!m&&t.complete()},h=function(R){return m<n?C(R):f.push(R)},C=function(R){o&&t.next(R),m++;var w=!1;vt(r(R,g++)).subscribe(St(t,function(b){a?.(b),o?h(b):t.next(b)},function(){w=!0},void 0,function(){if(w)try{m--;for(var b=function(){var F=f.shift();i?wr(t,i,function(){return C(F)}):C(F)};f.length&&m<n;)b();x()}catch(F){t.error(F)}}))};return e.subscribe(St(t,h,function(){A=!0,x()})),function(){p?.()}}function er(e,t,r){return r===void 0&&(r=1/0),Pe(t)?er(function(n,a){return Ko(function(o,i){return t(n,o,a,i)})(vt(e(n,a)))},r):(typeof t=="number"&&(r=t),mt(function(n,a){return yF(n,a,e,r)}))}function Sv(e){return e===void 0&&(e=1/0),er(uc,e)}d();c();l();u();function vv(e){return new We(function(t){vt(e()).subscribe(t)})}d();c();l();u();function Rl(e){return mt(function(t,r){var n=null,a=!1,o;n=t.subscribe(St(r,void 0,void 0,function(i){o=vt(e(i,Rl(e)(t))),n?(n.unsubscribe(),n=null,o.subscribe(r)):a=!0})),a&&(n.unsubscribe(),n=null,o.subscribe(r))})}d();c();l();u();function Yf(e,t){return Pe(t)?er(e,t,1):er(e,1)}d();c();l();u();function Av(e){return mt(function(t,r){var n=!1;t.subscribe(St(r,function(a){n=!0,r.next(a)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function Yo(e){return mt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function xv(e,t){return mt(function(r,n){var a=null,o=0,i=!1,p=function(){return i&&!a&&n.complete()};r.subscribe(St(n,function(f){a?.unsubscribe();var m=0,g=o++;vt(e(f,g)).subscribe(a=St(n,function(A){return n.next(t?t(f,A,g,m++):A)},function(){a=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function Jf(e){return mt(function(t,r){vt(e).subscribe(St(r,function(){return r.complete()},bl)),!r.closed&&t.subscribe(r)})}d();c();l();u();function Cv(e,t,r){var n=Pe(e)||t||r?{next:e,error:t,complete:r}:e;return n?mt(function(a,o){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;a.subscribe(St(o,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),o.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),o.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),o.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):uc}d();c();l();u();d();c();l();u();function SF(e){return` \r
35
- `.indexOf(e)>=0}function Xf(e){for(var t=["topLevel"],r=0,n,a,o,i=function(F){return t.push(F)},p=function(F){return t[t.length-1]=F},f=function(F){n==null&&(n=r,a=t.length,o=F)},m=function(F){F===o&&(n=void 0,a=void 0,o=void 0)},g=function(){return t.pop()},A=function(){return r--},x=function(F){if("0"<=F&&F<="9"){i("number");return}switch(F){case"\"":i("string");return;case"-":i("numberNeedsDigit");return;case"t":i("true");return;case"f":i("false");return;case"n":i("null");return;case"[":i("arrayNeedsValue");return;case"{":i("objectNeedsKey");return}},h=e.length;r<h;r++){var C=e[r];switch(t[t.length-1]){case"topLevel":x(C);break;case"string":switch(C){case"\"":g();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":C==="u"?i("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":C==="."?p("numberNeedsDigit"):C==="e"||C==="E"?p("numberNeedsExponent"):(C<"0"||C>"9")&&(A(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(C==="+"||C==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(C<"a"||C>"z")&&(A(),g());break;case"arrayNeedsValue":C==="]"?g():SF(C)||(m("collectionItem"),p("arrayNeedsComma"),x(C));break;case"arrayNeedsComma":C==="]"?g():C===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":C==="}"?g():C==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":C===":"&&p("objectNeedsValue");break;case"objectNeedsValue":SF(C)||(m("collectionItem"),p("objectNeedsComma"),x(C));break;case"objectNeedsComma":C==="}"?g():C===","&&(f("collectionItem"),p("objectNeedsKey"));break}}a!=null&&(t.length=a);for(var R=[n!=null?e.slice(0,n):e],w=function(F){return R.push(F.slice(e.length-e.lastIndexOf(F[0])))},b=t.length-1;b>=0;b--)switch(t[b]){case"string":R.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":R.push("0");break;case"true":w("true");break;case"false":w("false");break;case"null":w("null");break;case"arrayNeedsValue":case"arrayNeedsComma":R.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":R.push("}");break}return R.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function AF(){let e=0,t=0;for(let n=0;n<28;n+=7){let a=this.buf[this.pos++];if(e|=(a&127)<<n,(a&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let a=this.buf[this.pos++];if(t|=(a&127)<<n,(a&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function em(e,t,r){for(let o=0;o<28;o=o+7){let i=e>>>o,p=!(!(i>>>7)&&t==0),f=(p?i|128:i)&255;if(r.push(f),!p)return}let n=e>>>28&15|(t&7)<<4,a=t>>3!=0;if(r.push((a?n|128:n)&255),!!a){for(let o=3;o<31;o=o+7){let i=t>>>o,p=!!(i>>>7),f=(p?i|128:i)&255;if(r.push(f),!p)return}r.push(t>>>31&1)}}var Zf=4294967296;function bv(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,a=0;function o(i,p){let f=Number(e.slice(i,p));a*=r,n=n*r+f,n>=Zf&&(a=a+(n/Zf|0),n=n%Zf)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?CF(n,a):Rv(n,a)}function xF(e,t){let r=Rv(e,t),n=r.hi&2147483648;n&&(r=CF(r.lo,r.hi));let a=wv(r.lo,r.hi);return n?"-"+a:a}function wv(e,t){if({lo:e,hi:t}=ML(e,t),t<=2097151)return String(Zf*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,a=t>>16&65535,o=r+n*6777216+a*6710656,i=n+a*8147497,p=a*2,f=1e7;return o>=f&&(i+=Math.floor(o/f),o%=f),i>=f&&(p+=Math.floor(i/f),i%=f),p.toString()+vF(i)+vF(o)}function ML(e,t){return{lo:e>>>0,hi:t>>>0}}function Rv(e,t){return{lo:e|0,hi:t|0}}function CF(e,t){return t=~t,e?e=~e+1:t+=1,Rv(e,t)}var vF=e=>{let t=String(e);return"0000000".slice(t.length)+t};function Fv(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function bF(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var Vr=jL();function jL(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!y.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),a=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>n||p<r)throw new Error(`invalid int64: ${i}`);return p},uParse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>o||p<a)throw new Error(`invalid uint64: ${i}`);return p},enc(i){return e.setBigInt64(0,this.parse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(i){return e.setBigInt64(0,this.uParse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),wF(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),RF(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),wF(r),bv(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),RF(r),bv(r)},dec(r,n){return xF(r,n)},uDec(r,n){return wv(r,n)}}}function wF(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function RF(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var Ev=Symbol.for("@bufbuild/protobuf/text-encoding");function Iv(){if(y[Ev]==null){let e=new y.TextEncoder,t=new y.TextDecoder;y[Ev]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return y[Ev]}var Qa;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Qa||(Qa={}));var VL=34028234663852886e22,LL=-34028234663852886e22,UL=4294967295,QL=2147483647,BL=-2147483648,Ve=class{constructor(t=Iv().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let a=0;a<this.chunks.length;a++)t+=this.chunks[a].length;let r=new Uint8Array(t),n=0;for(let a=0;a<this.chunks.length;a++)r.set(this.chunks[a],n),n+=this.chunks[a].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(FF(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Tv(t),Fv(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){GL(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){FF(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){Tv(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return Tv(t),t=(t<<1^t>>31)>>>0,Fv(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),a=Vr.enc(t);return n.setInt32(0,a.lo,!0),n.setInt32(4,a.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),a=Vr.uEnc(t);return n.setInt32(0,a.lo,!0),n.setInt32(4,a.hi,!0),this.raw(r)}int64(t){let r=Vr.enc(t);return em(r.lo,r.hi,this.buf),this}sint64(t){let r=Vr.enc(t),n=r.hi>>31,a=r.lo<<1^n,o=(r.hi<<1|r.lo>>>31)^n;return em(a,o,this.buf),this}uint64(t){let r=Vr.uEnc(t);return em(r.lo,r.hi,this.buf),this}},me=class{constructor(t,r=Iv().decodeUtf8){this.decodeUtf8=r,this.varint64=AF,this.uint32=bF,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case Qa.Varint:for(;this.buf[this.pos++]&128;);break;case Qa.Bit64:this.pos+=4;case Qa.Bit32:this.pos+=4;break;case Qa.LengthDelimited:let a=this.uint32();this.pos+=a;break;case Qa.StartGroup:for(;;){let[o,i]=this.tag();if(i===Qa.EndGroup){if(r!==void 0&&o!==r)throw new Error("invalid end group tag");break}this.skip(i,o)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Vr.dec(...this.varint64())}uint64(){return Vr.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,Vr.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Vr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Vr.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}};function Tv(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>QL||e<BL)throw new Error("invalid int32: "+e)}function FF(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>UL||e<0)throw new Error("invalid uint32: "+e)}function GL(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>VL||e<LL))throw new Error("invalid float32: "+e)}var $L=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function Pv(){return{fields:{}}}var Fl={encode(e,t=new Ve){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&Nv.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=Pv();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:{if(o!==10)break;let i=Nv.decode(r,r.uint32());i.value!==void 0&&(a.fields[i.key]=i.value);continue}}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return Fl.fromPartial(e??{})},fromPartial(e){let t=Pv();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,a])=>(a!==void 0&&(r[n]=a),r),{}),t},wrap(e){let t=Pv();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function EF(){return{key:"",value:void 0}}var Nv={encode(e,t=new Ve){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=EF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.key=r.string();continue;case 2:if(o!==18)break;a.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return Nv.fromPartial(e??{})},fromPartial(e){let t=EF();return t.key=e.key??"",t.value=e.value??void 0,t}};function kv(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var qe={encode(e,t=new Ve){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&Fl.encode(Fl.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&El.encode(El.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=kv();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==8)break;a.nullValue=r.int32();continue;case 2:if(o!==17)break;a.numberValue=r.double();continue;case 3:if(o!==26)break;a.stringValue=r.string();continue;case 4:if(o!==32)break;a.boolValue=r.bool();continue;case 5:if(o!==42)break;a.structValue=Fl.unwrap(Fl.decode(r,r.uint32()));continue;case 6:if(o!==50)break;a.listValue=El.unwrap(El.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return qe.fromPartial(e??{})},fromPartial(e){let t=kv();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=kv();if(e===null)t.nullValue=$L.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(y.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new y.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Ov(){return{values:[]}}var El={encode(e,t=new Ve){for(let r of e.values)qe.encode(qe.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=Ov();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.values.push(qe.unwrap(qe.decode(r,r.uint32())));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return El.fromPartial(e??{})},fromPartial(e){let t=Ov();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=Ov();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},HL=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function IF(){return{op:0,path:"",from:void 0,value:void 0}}var tm={encode(e,t=new Ve){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=IF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==8)break;a.op=r.int32();continue;case 2:if(o!==18)break;a.path=r.string();continue;case 3:if(o!==26)break;a.from=r.string();continue;case 4:if(o!==34)break;a.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return tm.fromPartial(e??{})},fromPartial(e){let t=IF();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function TF(){return{id:"",type:"",function:void 0}}var rm={encode(e,t=new Ve){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&nm.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=TF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.id=r.string();continue;case 2:if(o!==18)break;a.type=r.string();continue;case 3:if(o!==26)break;a.function=nm.decode(r,r.uint32());continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return rm.fromPartial(e??{})},fromPartial(e){let t=TF();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?nm.fromPartial(e.function):void 0,t}};function PF(){return{name:"",arguments:""}}var nm={encode(e,t=new Ve){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=PF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.name=r.string();continue;case 2:if(o!==18)break;a.arguments=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return nm.fromPartial(e??{})},fromPartial(e){let t=PF();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function kF(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var am={encode(e,t=new Ve){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)rm.encode(r,t.uint32(42).fork()).join();return e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=kF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.id=r.string();continue;case 2:if(o!==18)break;a.role=r.string();continue;case 3:if(o!==26)break;a.content=r.string();continue;case 4:if(o!==34)break;a.name=r.string();continue;case 5:if(o!==42)break;a.toolCalls.push(rm.decode(r,r.uint32()));continue;case 6:if(o!==50)break;a.toolCallId=r.string();continue;case 7:if(o!==58)break;a.error=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return am.fromPartial(e??{})},fromPartial(e){let t=kF();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>rm.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},zL=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function OF(){return{type:0,timestamp:void 0,rawEvent:void 0}}var ye={encode(e,t=new Ve){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&qe.encode(qe.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=OF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==8)break;a.type=r.int32();continue;case 2:if(o!==16)break;a.timestamp=WL(r.int64());continue;case 3:if(o!==26)break;a.rawEvent=qe.unwrap(qe.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return ye.fromPartial(e??{})},fromPartial(e){let t=OF();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function NF(){return{baseEvent:void 0,messageId:"",role:void 0}}var om={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=NF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.messageId=r.string();continue;case 3:if(o!==26)break;a.role=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return om.fromPartial(e??{})},fromPartial(e){let t=NF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function _F(){return{baseEvent:void 0,messageId:"",delta:""}}var im={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=_F();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.messageId=r.string();continue;case 3:if(o!==26)break;a.delta=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return im.fromPartial(e??{})},fromPartial(e){let t=_F();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function DF(){return{baseEvent:void 0,messageId:""}}var sm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=DF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.messageId=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return sm.fromPartial(e??{})},fromPartial(e){let t=DF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function qF(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var cm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=qF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.toolCallId=r.string();continue;case 3:if(o!==26)break;a.toolCallName=r.string();continue;case 4:if(o!==34)break;a.parentMessageId=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return cm.fromPartial(e??{})},fromPartial(e){let t=qF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function MF(){return{baseEvent:void 0,toolCallId:"",delta:""}}var um={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=MF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.toolCallId=r.string();continue;case 3:if(o!==26)break;a.delta=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return um.fromPartial(e??{})},fromPartial(e){let t=MF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function jF(){return{baseEvent:void 0,toolCallId:""}}var lm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=jF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.toolCallId=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return lm.fromPartial(e??{})},fromPartial(e){let t=jF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function VF(){return{baseEvent:void 0,snapshot:void 0}}var dm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&qe.encode(qe.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=VF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.snapshot=qe.unwrap(qe.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return dm.fromPartial(e??{})},fromPartial(e){let t=VF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function LF(){return{baseEvent:void 0,delta:[]}}var pm={encode(e,t=new Ve){e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)tm.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=LF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.delta.push(tm.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return pm.fromPartial(e??{})},fromPartial(e){let t=LF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>tm.fromPartial(r))||[],t}};function UF(){return{baseEvent:void 0,messages:[]}}var fm={encode(e,t=new Ve){e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)am.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=UF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.messages.push(am.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return fm.fromPartial(e??{})},fromPartial(e){let t=UF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>am.fromPartial(r))||[],t}};function QF(){return{baseEvent:void 0,event:void 0,source:void 0}}var mm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&qe.encode(qe.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=QF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.event=qe.unwrap(qe.decode(r,r.uint32()));continue;case 3:if(o!==26)break;a.source=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return mm.fromPartial(e??{})},fromPartial(e){let t=QF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function BF(){return{baseEvent:void 0,name:"",value:void 0}}var gm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=BF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.name=r.string();continue;case 3:if(o!==26)break;a.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return gm.fromPartial(e??{})},fromPartial(e){let t=BF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function GF(){return{baseEvent:void 0,threadId:"",runId:""}}var hm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=GF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.threadId=r.string();continue;case 3:if(o!==26)break;a.runId=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return hm.fromPartial(e??{})},fromPartial(e){let t=GF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function $F(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var ym={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&qe.encode(qe.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=$F();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.threadId=r.string();continue;case 3:if(o!==26)break;a.runId=r.string();continue;case 4:if(o!==34)break;a.result=qe.unwrap(qe.decode(r,r.uint32()));continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return ym.fromPartial(e??{})},fromPartial(e){let t=$F();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function HF(){return{baseEvent:void 0,code:void 0,message:""}}var Sm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=HF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.code=r.string();continue;case 3:if(o!==26)break;a.message=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return Sm.fromPartial(e??{})},fromPartial(e){let t=HF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function zF(){return{baseEvent:void 0,stepName:""}}var vm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=zF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.stepName=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return vm.fromPartial(e??{})},fromPartial(e){let t=zF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function WF(){return{baseEvent:void 0,stepName:""}}var Am={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=WF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.stepName=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return Am.fromPartial(e??{})},fromPartial(e){let t=WF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function KF(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var xm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=KF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.messageId=r.string();continue;case 3:if(o!==26)break;a.role=r.string();continue;case 4:if(o!==34)break;a.delta=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return xm.fromPartial(e??{})},fromPartial(e){let t=KF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function YF(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Cm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=YF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.toolCallId=r.string();continue;case 3:if(o!==26)break;a.toolCallName=r.string();continue;case 4:if(o!==34)break;a.parentMessageId=r.string();continue;case 5:if(o!==42)break;a.delta=r.string();continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return Cm.fromPartial(e??{})},fromPartial(e){let t=YF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function JF(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var XF={encode(e,t=new Ve){return e.textMessageStart!==void 0&&om.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&im.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&sm.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&cm.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&um.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&lm.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&dm.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&pm.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&fm.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&mm.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&gm.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&hm.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&ym.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Sm.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&vm.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Am.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&xm.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Cm.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,a=JF();for(;r.pos<n;){let o=r.uint32();switch(o>>>3){case 1:if(o!==10)break;a.textMessageStart=om.decode(r,r.uint32());continue;case 2:if(o!==18)break;a.textMessageContent=im.decode(r,r.uint32());continue;case 3:if(o!==26)break;a.textMessageEnd=sm.decode(r,r.uint32());continue;case 4:if(o!==34)break;a.toolCallStart=cm.decode(r,r.uint32());continue;case 5:if(o!==42)break;a.toolCallArgs=um.decode(r,r.uint32());continue;case 6:if(o!==50)break;a.toolCallEnd=lm.decode(r,r.uint32());continue;case 7:if(o!==58)break;a.stateSnapshot=dm.decode(r,r.uint32());continue;case 8:if(o!==66)break;a.stateDelta=pm.decode(r,r.uint32());continue;case 9:if(o!==74)break;a.messagesSnapshot=fm.decode(r,r.uint32());continue;case 10:if(o!==82)break;a.raw=mm.decode(r,r.uint32());continue;case 11:if(o!==90)break;a.custom=gm.decode(r,r.uint32());continue;case 12:if(o!==98)break;a.runStarted=hm.decode(r,r.uint32());continue;case 13:if(o!==106)break;a.runFinished=ym.decode(r,r.uint32());continue;case 14:if(o!==114)break;a.runError=Sm.decode(r,r.uint32());continue;case 15:if(o!==122)break;a.stepStarted=vm.decode(r,r.uint32());continue;case 16:if(o!==130)break;a.stepFinished=Am.decode(r,r.uint32());continue;case 17:if(o!==138)break;a.textMessageChunk=xm.decode(r,r.uint32());continue;case 18:if(o!==146)break;a.toolCallChunk=Cm.decode(r,r.uint32());continue}if((o&7)===4||o===0)break;r.skip(o&7)}return a},create(e){return XF.fromPartial(e??{})},fromPartial(e){let t=JF();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?om.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?im.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?sm.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?cm.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?um.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?lm.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?dm.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?pm.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?fm.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?mm.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?gm.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?hm.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?ym.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Sm.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?vm.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Am.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?xm.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Cm.fromPartial(e.toolCallChunk):void 0,t}};function WL(e){let t=y.Number(e.toString());if(t>y.Number.MAX_SAFE_INTEGER)throw new y.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<y.Number.MIN_SAFE_INTEGER)throw new y.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function ZF(e){let t=XF.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=zL[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===D.MESSAGES_SNAPSHOT)for(let n of r.messages){let a=n;a.toolCalls?.length===0&&(a.toolCalls=void 0)}if(r.type===D.STATE_DELTA)for(let n of r.delta)n.op=HL[n.op].toLowerCase(),Object.keys(n).forEach(a=>{n[a]===void 0&&delete n[a]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),xf.parse(r)}var eE="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var YL=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,_v=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(YL);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},tE=e=>e==="*"||e==="x"||e==="X",rE=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},JL=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],XL=(e,t)=>{if(tE(e)||tE(t))return 0;let[r,n]=JL(rE(e),rE(t));return r>n?1:r<n?-1:0},Dv=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=XL(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var bm=(e,t)=>{let r=_v(e),n=_v(t),a=r.pop(),o=n.pop(),i=Dv(r,n);return i!==0?i:a&&o?Dv(a.split("."),o.split(".")):a||o?a?-1:1:0};var Ge=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function Il(){return qa()}function Qe(_x139,_x140,_x141,_x142){return _Qe.apply(this,arguments)}function _Qe(){_Qe=_asyncToGenerator(function*(e,t,r,n){let a=t,o=r,i;for(let p of e)try{let f=yield n(p,Ge(a),Ge(o));if(f===void 0)continue;if(f.messages!==void 0&&(a=f.messages),f.state!==void 0&&(o=f.state),i=f.stopPropagation,i===!0)break}catch(f){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",f);continue}return{...(JSON.stringify(a)===JSON.stringify(t)?{}:{messages:a}),...(JSON.stringify(o)===JSON.stringify(r)?{}:{state:o}),...(i===void 0?{}:{stopPropagation:i})}});return _Qe.apply(this,arguments)}var cE=(e,t,r,n)=>{let a=Ge(r.messages),o=Ge(e.state),i={},p=m=>{m.messages!==void 0&&(a=m.messages,i.messages=m.messages),m.state!==void 0&&(o=m.state,i.state=m.state)},f=()=>{let m=Ge(i);return i={},m.messages!==void 0||m.state!==void 0?tt(m):qf};return t.pipe(Yf(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(m){let g=yield Qe(n,a,o,(A,x,h)=>A.onEvent?.({event:m,agent:r,input:e,messages:x,state:h}));if(p(g),g.stopPropagation===!0)return f();switch(m.type){case D.TEXT_MESSAGE_START:{let A=yield Qe(n,a,o,(x,h,C)=>x.onTextMessageStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let{messageId:x,role:h="assistant"}=m;if(!a.find(C=>C.id===x)){let C={id:x,role:h,content:""};a.push(C),p({messages:a})}}return f()}case D.TEXT_MESSAGE_CONTENT:{let{messageId:A,delta:x}=m,h=a.find(R=>R.id===A);if(!h)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${A}'`),f();let C=yield Qe(n,a,o,(R,w,b)=>R.onTextMessageContentEvent?.({event:m,messages:w,state:b,agent:r,input:e,textMessageBuffer:typeof h.content=="string"?h.content:""}));return p(C),C.stopPropagation!==!0&&(h.content=`${typeof h.content=="string"?h.content:""}${x}`,p({messages:a})),f()}case D.TEXT_MESSAGE_END:{let{messageId:A}=m,x=a.find(h=>h.id===A);return x?(p(yield Qe(n,a,o,(h,C,R)=>h.onTextMessageEndEvent?.({event:m,messages:C,state:R,agent:r,input:e,textMessageBuffer:typeof x.content=="string"?x.content:""}))),yield Promise.all(n.map(h=>{h.onNewMessage?.({message:x,messages:a,state:o,agent:r,input:e})})),f()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${A}'`),f())}case D.TOOL_CALL_START:{let A=yield Qe(n,a,o,(x,h,C)=>x.onToolCallStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let{toolCallId:x,toolCallName:h,parentMessageId:C}=m,R;C&&a.length>0&&a[a.length-1].id===C?R=a[a.length-1]:(R={id:C||x,role:"assistant",toolCalls:[]},a.push(R)),R.toolCalls??(R.toolCalls=[]),R.toolCalls.push({id:x,type:"function",function:{name:h,arguments:""}}),p({messages:a})}return f()}case D.TOOL_CALL_ARGS:{let{toolCallId:A,delta:x}=m,h=a.find(w=>w.toolCalls?.some(b=>b.id===A));if(!h)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${A}'`),f();let C=h.toolCalls?.find(w=>w.id===A);if(!C)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${A}'`),f();let R=yield Qe(n,a,o,(w,b,F)=>{let E=C.function.arguments,P=C.function.name,V={};try{V=Xf(E)}catch{}return w.onToolCallArgsEvent?.({event:m,messages:b,state:F,agent:r,input:e,toolCallBuffer:E,toolCallName:P,partialToolCallArgs:V})});return p(R),R.stopPropagation!==!0&&(C.function.arguments+=x,p({messages:a})),f()}case D.TOOL_CALL_END:{let{toolCallId:A}=m,x=a.find(C=>C.toolCalls?.some(R=>R.id===A));if(!x)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${A}'`),f();let h=x.toolCalls?.find(C=>C.id===A);return h?(p(yield Qe(n,a,o,(C,R,w)=>{let b=h.function.arguments,F=h.function.name,E={};try{E=JSON.parse(b)}catch{}return C.onToolCallEndEvent?.({event:m,messages:R,state:w,agent:r,input:e,toolCallName:F,toolCallArgs:E})})),yield Promise.all(n.map(C=>{C.onNewToolCall?.({toolCall:h,messages:a,state:o,agent:r,input:e})})),f()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${A}'`),f())}case D.TOOL_CALL_RESULT:{let A=yield Qe(n,a,o,(x,h,C)=>x.onToolCallResultEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let{messageId:x,toolCallId:h,content:C,role:R}=m,w={id:x,toolCallId:h,role:R||"tool",content:C};a.push(w),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:w,messages:a,state:o,agent:r,input:e})})),p({messages:a})}return f()}case D.STATE_SNAPSHOT:{let A=yield Qe(n,a,o,(x,h,C)=>x.onStateSnapshotEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let{snapshot:x}=m;o=x,p({state:o})}return f()}case D.STATE_DELTA:{let A=yield Qe(n,a,o,(x,h,C)=>x.onStateDeltaEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let{delta:x}=m;try{o=Ua(o,x,!0,!1).newDocument,p({state:o})}catch(h){let C=h instanceof Error?h.message:String(h);console.warn(`Failed to apply state patch:
36
- Current state: ${JSON.stringify(o,null,2)}
37
- Patch operations: ${JSON.stringify(x,null,2)}
38
- Error: ${C}`)}}return f()}case D.MESSAGES_SNAPSHOT:{let A=yield Qe(n,a,o,(x,h,C)=>x.onMessagesSnapshotEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let{messages:x}=m;a=x,p({messages:a})}return f()}case D.ACTIVITY_SNAPSHOT:{let A=m,x=a.findIndex(b=>b.id===A.messageId),h=x>=0?a[x]:void 0,C=h?.role==="activity"?h:void 0,R=A.replace??!0,w=yield Qe(n,a,o,(b,F,E)=>b.onActivitySnapshotEvent?.({event:A,messages:F,state:E,agent:r,input:e,activityMessage:C,existingMessage:h}));if(p(w),w.stopPropagation!==!0){let b={id:A.messageId,role:"activity",activityType:A.activityType,content:Ge(A.content)},F;x===-1?(a.push(b),F=b):C?R&&(a[x]={...C,activityType:A.activityType,content:Ge(A.content)}):R&&(a[x]=b,F=b),p({messages:a}),F&&(yield Promise.all(n.map(E=>E.onNewMessage?.({message:F,messages:a,state:o,agent:r,input:e}))))}return f()}case D.ACTIVITY_DELTA:{let A=m,x=a.findIndex(w=>w.id===A.messageId);if(x===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${A.messageId}' to apply patch`),f();let h=a[x];if(h.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${A.messageId}' is not an activity message`),f();let C=h,R=yield Qe(n,a,o,(w,b,F)=>w.onActivityDeltaEvent?.({event:A,messages:b,state:F,agent:r,input:e,activityMessage:C}));if(p(R),R.stopPropagation!==!0)try{let w=Ge(C.content??{}),b=Ua(w,A.patch??[],!0,!1).newDocument;a[x]={...C,content:Ge(b),activityType:A.activityType},p({messages:a})}catch(w){let b=w instanceof Error?w.message:String(w);console.warn(`Failed to apply activity patch for '${A.messageId}': ${b}`)}return f()}case D.RAW:return p(yield Qe(n,a,o,(A,x,h)=>A.onRawEvent?.({event:m,messages:x,state:h,agent:r,input:e}))),f();case D.CUSTOM:return p(yield Qe(n,a,o,(A,x,h)=>A.onCustomEvent?.({event:m,messages:x,state:h,agent:r,input:e}))),f();case D.RUN_STARTED:{let A=yield Qe(n,a,o,(x,h,C)=>x.onRunStartedEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let x=m;if(x.input?.messages){for(let h of x.input.messages)a.find(C=>C.id===h.id)||a.push(h);p({messages:a})}}return f()}case D.RUN_FINISHED:return p(yield Qe(n,a,o,(A,x,h)=>A.onRunFinishedEvent?.({event:m,messages:x,state:h,agent:r,input:e,result:m.result}))),f();case D.RUN_ERROR:return p(yield Qe(n,a,o,(A,x,h)=>A.onRunErrorEvent?.({event:m,messages:x,state:h,agent:r,input:e}))),f();case D.STEP_STARTED:return p(yield Qe(n,a,o,(A,x,h)=>A.onStepStartedEvent?.({event:m,messages:x,state:h,agent:r,input:e}))),f();case D.STEP_FINISHED:return p(yield Qe(n,a,o,(A,x,h)=>A.onStepFinishedEvent?.({event:m,messages:x,state:h,agent:r,input:e}))),f();case D.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case D.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case D.THINKING_START:return f();case D.THINKING_END:return f();case D.THINKING_TEXT_MESSAGE_START:return f();case D.THINKING_TEXT_MESSAGE_CONTENT:return f();case D.THINKING_TEXT_MESSAGE_END:return f();case D.REASONING_START:return p(yield Qe(n,a,o,(A,x,h)=>A.onReasoningStartEvent?.({event:m,messages:x,state:h,agent:r,input:e}))),f();case D.REASONING_MESSAGE_START:{let A=yield Qe(n,a,o,(x,h,C)=>x.onReasoningMessageStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(A),A.stopPropagation!==!0){let{messageId:x}=m;if(!a.find(h=>h.id===x)){let h={id:x,role:"reasoning",content:""};a.push(h),p({messages:a})}}return f()}case D.REASONING_MESSAGE_CONTENT:{let{messageId:A,delta:x}=m,h=a.find(R=>R.id===A);if(!h)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${A}'`),f();let C=yield Qe(n,a,o,(R,w,b)=>R.onReasoningMessageContentEvent?.({event:m,messages:w,state:b,agent:r,input:e,reasoningMessageBuffer:typeof h.content=="string"?h.content:""}));return p(C),C.stopPropagation!==!0&&(h.content=`${typeof h.content=="string"?h.content:""}${x}`,p({messages:a})),f()}case D.REASONING_MESSAGE_END:{let{messageId:A}=m,x=a.find(h=>h.id===A);return x?(p(yield Qe(n,a,o,(h,C,R)=>h.onReasoningMessageEndEvent?.({event:m,messages:C,state:R,agent:r,input:e,reasoningMessageBuffer:typeof x.content=="string"?x.content:""}))),yield Promise.all(n.map(h=>{h.onNewMessage?.({message:x,messages:a,state:o,agent:r,input:e})})),f()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${A}'`),f())}case D.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case D.REASONING_END:return p(yield Qe(n,a,o,(A,x,h)=>A.onReasoningEndEvent?.({event:m,messages:x,state:h,agent:r,input:e}))),f();case D.REASONING_ENCRYPTED_VALUE:{let{subtype:A,entityId:x,encryptedValue:h}=m,C=yield Qe(n,a,o,(R,w,b)=>R.onReasoningEncryptedValueEvent?.({event:m,messages:w,state:b,agent:r,input:e}));if(p(C),C.stopPropagation!==!0){let R=!1;if(A==="tool-call"){for(let w of a)if(w.role==="assistant"&&w.toolCalls){let b=w.toolCalls.find(F=>F.id===x);if(b){b.encryptedValue=h,R=!0;break}}}else{let w=a.find(b=>b.id===x);w?.role!=="activity"&&w&&(w.encryptedValue=h,R=!0)}R&&(i.messages=a)}return f()}}return m.type,f()});return function(_x143){return _ref57.apply(this,arguments)}}()),Sv(),n.length>0?Av({}):m=>m)},qv=e=>t=>{let r=new Map,n=new Map,a=!1,o=!1,i=!1,p=new Map,f=!1,m=!1,g=!1,A=()=>{r.clear(),n.clear(),p.clear(),f=!1,m=!1,a=!1,o=!1,g=!0};return t.pipe(er(x=>{let h=x.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(x)),o)return Ke(()=>new et(`Cannot send event type '${h}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&h!==D.RUN_ERROR&&h!==D.RUN_STARTED)return Ke(()=>new et(`Cannot send event type '${h}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(i){if(h===D.RUN_STARTED){if(g&&!a)return Ke(()=>new et("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));a&&A()}}else if(i=!0,h!==D.RUN_STARTED&&h!==D.RUN_ERROR)return Ke(()=>new et("First event must be 'RUN_STARTED'"));switch(h){case D.TEXT_MESSAGE_START:{let C=x.messageId;return r.has(C)?Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${C}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(C,!0),tt(x))}case D.TEXT_MESSAGE_CONTENT:{let C=x.messageId;return r.has(C)?tt(x):Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${C}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case D.TEXT_MESSAGE_END:{let C=x.messageId;return r.has(C)?(r.delete(C),tt(x)):Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${C}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case D.TOOL_CALL_START:{let C=x.toolCallId;return n.has(C)?Ke(()=>new et(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${C}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(C,!0),tt(x))}case D.TOOL_CALL_ARGS:{let C=x.toolCallId;return n.has(C)?tt(x):Ke(()=>new et(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${C}'. Start a tool call with 'TOOL_CALL_START' first.`))}case D.TOOL_CALL_END:{let C=x.toolCallId;return n.has(C)?(n.delete(C),tt(x)):Ke(()=>new et(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${C}'. A 'TOOL_CALL_START' event must be sent first.`))}case D.STEP_STARTED:{let C=x.stepName;return p.has(C)?Ke(()=>new et(`Step "${C}" is already active for 'STEP_STARTED'`)):(p.set(C,!0),tt(x))}case D.STEP_FINISHED:{let C=x.stepName;return p.has(C)?(p.delete(C),tt(x)):Ke(()=>new et(`Cannot send 'STEP_FINISHED' for step "${C}" that was not started`))}case D.RUN_STARTED:return g=!0,tt(x);case D.RUN_FINISHED:if(p.size>0){let C=Array.from(p.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while steps are still active: ${C}`))}if(r.size>0){let C=Array.from(r.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while text messages are still active: ${C}`))}if(n.size>0){let C=Array.from(n.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${C}`))}return a=!0,tt(x);case D.RUN_ERROR:return o=!0,tt(x);case D.CUSTOM:return tt(x);case D.THINKING_TEXT_MESSAGE_START:return f?m?Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(m=!0,tt(x)):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case D.THINKING_TEXT_MESSAGE_CONTENT:return m?tt(x):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case D.THINKING_TEXT_MESSAGE_END:return m?(m=!1,tt(x)):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case D.THINKING_START:return f?Ke(()=>new et("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(f=!0,tt(x));case D.THINKING_END:return f?(f=!1,tt(x)):Ke(()=>new et("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return tt(x)}}))},Jo=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),ZL=(e,t)=>vv(()=>Wo(S(e,t))).pipe(xv(r=>{if(!r.ok){let o=r.headers.get("content-type")||"";return Wo(r.text()).pipe(er(i=>{let p=i;if(o.includes("application/json"))try{p=JSON.parse(i)}catch{}let f=Error(`HTTP ${r.status}: ${typeof p=="string"?p:JSON.stringify(p)}`);return f.status=r.status,f.payload=p,Ke(()=>f)}))}let n={type:Jo.HEADERS,status:r.status,headers:r.headers},a=r.body?.getReader();return a?new We(o=>(o.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:p}=yield a.read();if(i)break;let f={type:Jo.DATA,data:p};o.next(f)}o.complete()}catch(i){o.error(i)}})(),()=>{a.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):Ke(()=>Error("Failed to getReader() from response"))})),eU=e=>{let t=new sn,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:o=>{if(o.type!==Jo.HEADERS&&o.type===Jo.DATA&&o.data){let i=r.decode(o.data,{stream:!0});n+=i;let p=n.split(/\n\n/);n=p.pop()||"";for(let f of p)a(f)}},error:o=>t.error(o),complete:()=>{n&&(n+=r.decode(),a(n)),t.complete()}});function a(o){let i=o.split(`
31
+ `;function sD(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var cD=["1",1,"yes",!0];function wd(){let e=[];return Ey()&&e.push(window.doNotTrack),Ly()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>cD.indexOf(t)!==-1)}var tb="v15",rb={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 uD(e=rb.default,t=tb,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 lD="38824e1f-37f5-42d3-8372-a4b8fa9df946",Gr=class{get defaultOptions(){return{endpoint:rb.default,isCustomEndpoint:!1,token:"",version:tb,beforeSendHooks:[],afterSendHooks:[]}}get version(){return JC}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=[X_,z_].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};wd()?this.runtime=new Rd:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Te.view,{newEventType:Te.view,addClientIdParameter:!0}),this.addEventTypeMapping(Te.click,{newEventType:Te.click,addClientIdParameter:!0}),this.addEventTypeMapping(Te.custom,{newEventType:Te.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Te.search,{newEventType:Te.search,addClientIdParameter:!0})}initRuntime(t){return Ey()&&Di()?new jy(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(sD()&&console.warn(iD),new Vy(t))}get storage(){return this.runtime.storage}determineVisitorId(){return V(this,void 0,void 0,function*(){try{return Ey()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||ca()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),ca()}})}getCurrentVisitorId(){return V(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return V(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return V(this,void 0,void 0,function*(){if(xd(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(jC(t,jC(r,lD)))}})}getParameters(t,...r){return V(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return V(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(ca()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(wd())return null;try{let r=new URL(t).searchParams.get(lo.cvo_cid);if(r==null)return null;let n=lo.fromString(r);return!n||!Di()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return V(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>V(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>V(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>a?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((C,w)=>V(this,void 0,void 0,function*(){let R=yield C;return yield w(t,R)}),h)].reduce((h,C)=>V(this,void 0,void 0,function*(){let w=yield h;return yield C(w)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return V(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[S=>this.setTrackingIdIfTrackingIdNotPresent(S),S=>this.removeEmptyPayloadValues(S,t),S=>this.validateParams(S,t),S=>n?Y0(S):S,S=>n?this.removeUnknownParameters(S):S,S=>n?this.processCustomParameters(S):this.mapCustomParametersToCustomData(S)].reduce((S,A)=>V(this,void 0,void 0,function*(){let h=yield S;return yield A(h)}),Promise.resolve(r))})}makeEvent(t,...r){return V(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>V(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return V(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return V(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 vd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(Te.search,t)})}sendSearchEvent(t){return V(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Mn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(Te.click,t)})}sendClickEvent(t){return V(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Mn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(Te.custom,t)})}sendCustomEvent(t){return V(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Mn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(Te.view,t)})}sendViewEvent(t){return V(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return V(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return V(this,void 0,void 0,function*(){return yield(yield v(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[Te.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(eD(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=Mn(t,["custom"]),o={};r&&Sd(r)&&(o=this.lowercaseKeys(r));let a=tD(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Mn(t,["custom"]);if(r&&Sd(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=Mn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Te.view||r==Te.click||r==Te.search||r==Te.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Te.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=Mn(t,["userId"]);return aD(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Mn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Sd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Sd(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"?f0(t,r):t}get baseUrl(){return uD(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},jn;(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"})(jn||(jn={}));var L;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(L||(L={}));var $C={[L.triggerNotify]:"queryPipelineTriggers",[L.triggerExecute]:"queryPipelineTriggers",[L.triggerQuery]:"queryPipelineTriggers",[L.triggerRedirect]:"queryPipelineTriggers",[L.queryErrorBack]:"errors",[L.queryErrorClear]:"errors",[L.queryErrorRetry]:"errors",[L.pagerNext]:"getMoreResults",[L.pagerPrevious]:"getMoreResults",[L.pagerNumber]:"getMoreResults",[L.pagerResize]:"getMoreResults",[L.pagerScrolling]:"getMoreResults",[L.facetSearch]:"facet",[L.facetShowLess]:"facet",[L.facetShowMore]:"facet",[L.recommendation]:"recommendation",[L.likeSmartSnippet]:"smartSnippet",[L.dislikeSmartSnippet]:"smartSnippet",[L.expandSmartSnippet]:"smartSnippet",[L.collapseSmartSnippet]:"smartSnippet",[L.openSmartSnippetFeedbackModal]:"smartSnippet",[L.closeSmartSnippetFeedbackModal]:"smartSnippet",[L.sendSmartSnippetReason]:"smartSnippet",[L.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.clearRecentQueries]:"recentQueries",[L.recentResultClick]:"recentlyClickedDocuments",[L.clearRecentResults]:"recentlyClickedDocuments",[L.showLessFoldedResults]:"folding",[L.caseDetach]:"case",[L.likeGeneratedAnswer]:"generatedAnswer",[L.dislikeGeneratedAnswer]:"generatedAnswer",[L.openGeneratedAnswerSource]:"generatedAnswer",[L.generatedAnswerStreamEnd]:"generatedAnswer",[L.generatedAnswerSourceHover]:"generatedAnswer",[L.generatedAnswerCopyToClipboard]:"generatedAnswer",[L.generatedAnswerHideAnswers]:"generatedAnswer",[L.generatedAnswerShowAnswers]:"generatedAnswer",[L.generatedAnswerExpand]:"generatedAnswer",[L.generatedAnswerCollapse]:"generatedAnswer",[L.generatedAnswerFeedbackSubmit]:"generatedAnswer",[L.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[jn.expandToFullUI]:"interface",[jn.openUserActions]:"User Actions",[jn.showPrecedingSessions]:"User Actions",[jn.showFollowingSessions]:"User Actions",[jn.clickViewedDocument]:"User Actions",[jn.clickPageView]:"User Actions",[jn.createArticle]:"createArticle"},ji=class{constructor(){this.runtime=new Rd,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(Te.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Te.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Te.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Te.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return JC}};function dD(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function pD(e){return e.map(t=>t.replace(/;/g,""))}function nb(e){let r=e.join(";");return r.length<=256?r:nb(e.slice(1))}var HC=e=>{let t=pD(e),r=dD(t);return nb(r)};function zC(e){let t=typeof e.partialQueries=="string"?e.partialQueries:HC(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:HC(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Fd=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||wd();this.coveoAnalyticsClient=n?new ji:new Gr(t)}disable(){this.coveoAnalyticsClient=new ji}enable(){this.coveoAnalyticsClient=new Gr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(L.interfaceLoad)}logInterfaceLoad(){return V(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(L.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(L.recommendation)}logRecommendation(){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(L.recommendationOpen,t,r)}logRecommendationOpen(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(L.staticFilterClearAll,t)}logStaticFilterClearAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(L.staticFilterSelect,t)}logStaticFilterSelect(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(L.staticFilterDeselect,t)}logStaticFilterDeselect(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(L.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return V(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(L.interfaceChange,t)}logInterfaceChange(t){return V(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(L.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return V(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(L.didyoumeanClick)}logDidYouMeanClick(){return V(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(L.resultsSort,t)}logResultsSort(t){return V(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(L.searchboxSubmit)}logSearchboxSubmit(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(L.searchboxClear)}logSearchboxClear(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(L.searchboxAsYouType)}logSearchboxAsYouType(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(L.breadcrumbFacet,t)}logBreadcrumbFacet(t){return V(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(L.breadcrumbResetAll)}logBreadcrumbResetAll(){return V(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(L.documentQuickview,t,r)}logDocumentQuickview(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(L.documentOpen,t,r)}logDocumentOpen(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(L.omniboxAnalytics,zC(t))}logOmniboxAnalytics(t){return V(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(L.omniboxFromLink,zC(t))}logOmniboxFromLink(t){return V(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(L.searchFromLink)}logSearchFromLink(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(L.triggerNotify,t)}logTriggerNotify(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(L.triggerExecute,t)}logTriggerExecute(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(L.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(L.undoTriggerQuery,t)}logUndoTriggerQuery(t){return V(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(L.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(L.pagerResize,t)}logPagerResize(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(L.pagerNumber,t)}logPagerNumber(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(L.pagerNext,t)}logPagerNext(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(L.pagerPrevious,t)}logPagerPrevious(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(L.pagerScrolling)}logPagerScrolling(){return V(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(L.facetClearAll,t)}logFacetClearAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(L.facetSearch,t)}logFacetSearch(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(L.facetSelect,t)}logFacetSelect(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(L.facetDeselect,t)}logFacetDeselect(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(L.facetExclude,t)}logFacetExclude(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(L.facetUnexclude,t)}logFacetUnexclude(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(L.facetSelectAll,t)}logFacetSelectAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(L.facetUpdateSort,t)}logFacetUpdateSort(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(L.facetShowMore,t)}logFacetShowMore(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(L.facetShowLess,t)}logFacetShowLess(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(L.queryError,t)}logQueryError(t){return V(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorBack);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorBack)})}})}logQueryErrorBack(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorRetry);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorRetry)})}})}logQueryErrorRetry(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorClear);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorClear)})}})}logQueryErrorClear(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(L.likeSmartSnippet)}logLikeSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(L.dislikeSmartSnippet)}logDislikeSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(L.expandSmartSnippet)}logExpandSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(L.collapseSmartSnippet)}logCollapseSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return V(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(L.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(L.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(L.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(L.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(L.copyToClipboard,t,r)}logCopyToClipboard(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(L.recentQueryClick)}logRecentQueryClick(){return V(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(L.clearRecentQueries)}logClearRecentQueries(){return V(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(L.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(L.clearRecentResults)}logClearRecentResults(){return V(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(L.noResultsBack)}logNoResultsBack(){return V(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(L.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(L.showLessFoldedResults)}logShowLessFoldedResults(){return V(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 V(this,arguments,void 0,function*(n,o,a=$C[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return V(this,arguments,void 0,function*(n,o,a=$C[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return V(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return V(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return V(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return V(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 V(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 Gr?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(L.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(L.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(L.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return V(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(L.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(L.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(L.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(L.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(L.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(L.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(L.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(L.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(L.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return V(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(L.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Ed=Object.assign({},Du),WC=Object.keys(Ed).map(e=>Ed[e]),qi=class extends Py{constructor({client:t,uuidGenerator:r=ca}){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])=>WC.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(WC.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Ed.pageview,{newEventType:Te.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Ed.event,{newEventType:Te.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return S0(this.ticket)}};qi.Id="svc";var Id;(function(e){e.click="click",e.flowStart="flowStart"})(Id||(Id={}));var dr;(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"})(dr||(dr={}));var Td;(function(e){e.quit="Quit",e.solved="Solved"})(Td||(Td={}));var Pd=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!wd();this.coveoAnalyticsClient=o?new Gr(t):new ji,this.svc=new qi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new ji,this.svc=new qi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Gr(this.options),this.svc=new qi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(dr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(dr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(dr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(dr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(dr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(dr.caseCancelled,{reason:Td.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(dr.caseSolved,{reason:Td.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(dr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Id.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Id.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return V(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 Gr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var po=()=>"default";var fD=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},ua=class{constructor(t){this.getState=t;Ne(this,"state");this.state=t()}getLanguage(){return fD(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=uo),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||po()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var ob=e=>new Gr(e).getCurrentVisitorId(),ju=(e,t)=>typeof t=="function"?(...r)=>{let n=Su(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Vu=(e,t)=>(...r)=>{let n=Su(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var Lu=class extends ua{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},ab=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new Lu(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Ft(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new Pd({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:ju(e,n),beforeSendHooks:[Vu(e,r),(S,A)=>(e.info({...A,type:S,endpoint:p,token:i},"Analytics request"),A)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Vi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function mD(e,t){return!!t&&t.facetId in e.facetSet}var Nr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),kd=(e,t)=>e.facetSet[t]?.request,Li=(e,t)=>{let r=Nr(e,t);return mD(e,r)?r:void 0},ib=(e,t)=>Li(e,t)?.values.filter(r=>r.state==="selected")||[],sb=(e,t)=>Li(e,t)?.values.filter(r=>r.state!=="idle")||[],$r=e=>e.search.isLoading;d();c();l();u();function cb(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function or(e){let{activeValue:t,ancestryMap:r}=gD(e);return t?hD(t,r):[]}function gD(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 hD(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function yD(e,t){return!!t&&t.facetId in e.categoryFacetSet}var By=(e,t)=>{let r=Nr(e,t);if(yD(e,r))return r},Gy=(e,t)=>e.categoryFacetSet[t]?.request,ub=(e,t)=>{let r=By(e,t);return or(r?.values??[])},$y=(e,t)=>{let r=Gy(e,t);return or(r?.currentValues??[])};d();c();l();u();function Ui(){return{}}d();c();l();u();function lb(e,t){return{request:e,tabs:t}}function Qi(){return{}}d();c();l();u();function db(e,t){return{request:e,tabs:t}}function Bi(){return{}}d();c();l();u();function pb(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function Gi(){return{}}var $i=(e,t)=>{let r=hb(t,e),n=r?r.field:"",o=zy(n,e);return{facetId:e,facetField:n,facetTitle:o}};function Hi(e,t){let{facetId:r,facetValue:n}=e,o=$i(r,t),a=yb(t,r);return{...o,facetValue:a==="hierarchical"?gb(t,r):n}}function ar(e){return{facetSet:e.facetSet??Gi(),categoryFacetSet:e.categoryFacetSet??Ui(),dateFacetSet:e.dateFacetSet??Qi(),numericFacetSet:e.numericFacetSet??Bi(),automaticFacetSet:e.automaticFacetSet??Vi()}}var Hy=e=>{let t=[];return xD(e).forEach((r,n)=>{let o=yb(e,r.facetId),a=wD(r,n+1);if(vD(r)){if(!!!$y(e,r.facetId).length)return;t.push({...a,...bD(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=fb(i,p+1,o),m=SD(r)?mb(i):CD(i);t.push({...a,...f,...m})})}),AD(e).forEach((r,n)=>{let o=RD(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=fb(a,i+1,"specific"),f=mb(a);t.push({...o,...p,...f})})}),t},SD=e=>e.type==="specific",vD=e=>e.type==="hierarchical",xD=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),AD=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),fb=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),CD=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),mb=e=>({displayValue:e.value,value:e.value}),gb=(e,t)=>$y(e,t).map(n=>n.value).join(";"),bD=(e,t)=>{let n=gb(e,t);return{value:n,valuePosition:1,displayValue:n}},RD=(e,t)=>({title:zy(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),wD=(e,t)=>({title:zy(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),zy=(e,t)=>`${e}_${t}`,hb=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,yb=(e,t)=>{let r=hb(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var Wy=e=>e.configuration.search.locale,Sb=e=>e.configuration.search.timezone,Od=e=>e.configuration.accessToken,Nd=e=>e.configuration.organizationId,_d=e=>e.configuration.environment,Dd=e=>e.configuration?.knowledge?.agentId;var $e=e=>{if(FD(e)||Ky(e))return e.generatedAnswer?.answerId;if(ED(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},FD=e=>"answer"in e&&"generatedAnswer"in e&&!ue(e.generatedAnswer?.answerConfigurationId),Ky=e=>{let t=Dd(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},ED=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",Yy=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Uu=Ye(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var lt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var Qu=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Qu||{}),la=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(la||{}),Hr=e=>{if(xi(e))return e.map(t=>Hr(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""}},zi=()=>({by:"relevancy"}),qd=e=>({by:"date",order:e}),Md=(e,t)=>({by:"field",order:t,field:e}),jd=()=>({by:"qre"}),Vd=()=>({by:"nosort"}),vb=new J({values:{by:new yu({enum:la,required:!0}),order:new yu({enum:Qu}),field:new j}});function fr(){return Hr(zi())}d();c();l();u();d();c();l();u();d();c();l();u();var Wi=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?Jy(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Jy(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Jy(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function ID(){return typeof navigator<"u"}function xb(){try{return typeof localStorage<"u"}catch{return!1}}function Ab(){try{return typeof sessionStorage<"u"}catch{return!1}}function Cb(){return!!(ID()&&navigator.cookieEnabled)}var bb=null;function Rb(){return bb||(xb()?localStorage:Cb()?new Xy:Ab()?sessionStorage:new Zy)}var Ki=class Ki{getItem(t){return Wi.get(`${Ki.prefix}${t}`)}removeItem(t){Wi.erase(`${Ki.prefix}${t}`)}setItem(t,r,n){Wi.set(`${Ki.prefix}${t}`,r,n)}};Ne(Ki,"prefix","coveo_");var Xy=Ki;var Zy=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Ld="__coveo.analytics.history",TD=20,PD=1e3*60,kD=75,da=class da{constructor(t){Ne(this,"store");this.store=t||Rb()}static getInstance(t){return da.instance||(da.instance=new da(t)),da.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(Ld);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Ld);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Ld,JSON.stringify(t.slice(0,TD)))}catch{}}clear(){try{this.store.removeItem(Ld)}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,kD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>PD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};Ne(da,"instance",null);var eS=da,Wt=eS;var Bu=class Bu extends ua{constructor(){super(...arguments);Ne(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 Hy(ar(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Bu.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||rr().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Bu.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=$e(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??fr()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||lt().q}get responseTime(){return this.state.search?.duration||rr().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||rr().response.totalCountFiltered}};Ne(Bu,"fallbackPipelineName","default");var fo=Bu,wb=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Ft(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new Fd({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:ju(e,n),beforeSendHooks:[Vu(e,r),(S,A)=>(e.info({...A,type:S,endpoint:p,token:i},"Analytics request"),A)]},o);return m||g.disable(),g},tS=()=>{let t=Wt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Ud(e){let t=Fb(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return Zx([e,...t,...r],o=>o.uniqueId)}function Fb(e){return e.childResults?e.childResults.flatMap(t=>[t,...Fb(t)]):[]}d();c();l();u();var Vn=()=>"";function Eb(e,t){return{...new fo(t).getBaseMetadata(),actionCause:e,type:e}}function OD(e){return Object.assign(e,{instantlyCallable:!0})}function ND(e,t){let r=a=>OD(Se(e,a)),n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(S,{getState:A,extra:h}){return yield g({state:A(),extra:h})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var Ib=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return qD(a)}return n},_D=e=>e.configuration.analytics.analyticsMode==="legacy",DD=e=>e.configuration.analytics.analyticsMode==="next",qD=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),ND(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let S=[],A={log:function(){var _ref14=_asyncToGenerator(function*({state:b}){for(let F of S)yield F(b)});return function log(_x25){return _ref14.apply(this,arguments)}}()},h=p(),C=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),w=yield t(C,p());A.description=w?.description,S.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(b){_D(b)&&(yield MD(w,r,b,g,C.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:R}=_u(h);return S.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(b){if(DD(b)&&o&&n){let F=n(b);yield HD(R,o,F)}});return function(_x27){return _ref16.apply(this,arguments)}}()),A});return function(_x24){return _ref13.apply(this,arguments)}}()));function MD(_x28,_x29,_x30,_x31,_x32){return _MD.apply(this,arguments)}function _MD(){_MD=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _MD.apply(this,arguments)}var jD=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),Y=Ib(e=>wb({...e,provider:e.provider||new fo(e.getState)}),e=>e,fo),v9=Ib(ab,jD("caseAssist"),Lu);var dt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Ob(e,o),n<0&&(n=$D(e,o)),n<0&&(n=0),LD(e,r(n),t)};var Tb=(e,t)=>({sourceName:VD(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Vn()});function VD(e){let t=e.source;return ue(t)?"unknown":t}var Pb=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function LD(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:BD(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:GD(e),queryPipeline:r.pipeline||Vn()}}var He=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||""}),kb={urihash:new j,sourcetype:new j,permanentid:new j},Qd={uniqueId:z,raw:new J({values:kb}),title:z,uri:z,clickUri:z,rankingModifier:new j({required:!1,emptyAllowed:!0})};function UD(e){return Object.assign({},...Object.keys(kb).map(t=>({[t]:e[t]})))}function QD(e){return Object.assign({},...Object.keys(Qd).map(t=>({[t]:e[t]})),{raw:UD(e.raw)})}function BD(e){let t=e.raw.author;return ue(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function GD(e){let t=e.raw.source;return ue(t)?"unknown":t}var Kt=e=>new ge(Qd).validate(QD(e));function $D(e,t){for(let[r,n]of t.entries()){let o=Ud(n);if(Ob(e,o)!==-1)return r}return-1}function Ob(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function HD(_x34,_x35,_x36){return _HD.apply(this,arguments)}function _HD(){_HD=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _HD.apply(this,arguments)}d();c();l();u();var rS=e=>O(e,{evt:z,type:it}),Nb=e=>Y("analytics/generic/search",t=>{rS(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),_b=e=>Y("analytics/generic/click",(t,r)=>(Kt(e.result),rS(e),t.makeClickEvent(e.evt,dt(e.result,r),He(e.result),e.meta))),Db=e=>Y("analytics/generic/custom",t=>(rS(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Bd=()=>Y("analytics/interface/load",e=>e.makeInterfaceLoad()),mo=()=>Y("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),Gd=()=>Y("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),$d=e=>Y("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),qb=()=>({actionCause:"interfaceLoad"}),Yi=()=>({actionCause:"interfaceChange"}),Mb=()=>({actionCause:"searchFromLink"}),jb=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var nS=()=>it,Vb=()=>z,zr=T("configuration/updateBasicConfiguration",e=>O(e,{accessToken:it,environment:new j({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:it})),mr=T("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new j({required:!1,url:!0}),pipeline:new j({required:!1,emptyAllowed:!0}),searchHub:it,timezone:it,locale:it,authenticationProviders:new ae({required:!1,each:z})})),zD={enabled:new ce({default:!0}),originContext:nS(),originLevel2:nS(),originLevel3:nS(),proxyBaseUrl:new j({required:!1,url:!0}),runtimeEnvironment:new Le,anonymous:new ce({default:!1}),deviceId:it,userDisplayName:it,documentLocation:it,trackingId:kA,analyticsMode:new j({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new J({options:{required:!1},values:DC.reduce((e,t)=>(e[t]=PA,e),{})})},go=T("configuration/updateAnalyticsConfiguration",e=>O(e,zD)),Ji=T("configuration/analytics/disable"),Xi=T("configuration/analytics/enable"),Hd=T("configuration/analytics/originlevel2",e=>O(e,{originLevel2:Vb()})),zd=T("configuration/analytics/originlevel3",e=>O(e,{originLevel3:Vb()})),Wd=T("knowledge/setAgentId",e=>O(e,new j({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Kd={q:new j,enableQuerySyntax:new ce,aq:new j,cq:new j,firstResult:new ee({min:0}),numberOfResults:new ee({min:0}),sortCriteria:new j,f:new J,fExcluded:new J,cf:new J,nf:new J,mnf:new J,df:new J,debug:new ce,sf:new J,tab:new j,af:new J};var De=T("searchParameters/restore",e=>O(e,Kd)),Zi=T("searchParameters/restoreTab",e=>O(e,z));d();c();l();u();var ho=T("debug/enable"),es=T("debug/disable");d();c();l();u();var yo=()=>!1;var ts=oe(yo(),e=>{e.addCase(ho,()=>!0).addCase(es,()=>!1).addCase(De,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var oS=T("history/undo"),aS=T("history/redo"),ir=T("history/snapshot"),Gu=Se("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(oS()),yield t(_e())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),Yd=Se("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(aS()),yield t(_e())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),_e=Se("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var rs=T("pipeline/set",e=>O(e,new j({required:!0,emptyAllowed:!0})));var ns=oe(Vn(),e=>{e.addCase(rs,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(mr,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var pt=T("breadcrumb/deselectAll"),os=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var Wr=T("facet/updateFacetAutoSelection",e=>O(e,{allow:new ce({required:!0})}));d();c();l();u();d();c();l();u();var $u=class extends fo{constructor(r){super(r);this.getState=r}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??lt().q}get responseTime(){return this.activeInstantResultCache?.duration??rr().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??rr().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Lb=e=>Y({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Kt(e),t.makeDocumentOpen(dt(e,r),He(e))),__legacy__provider:t=>new $u(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),Ub=()=>Y("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new $u(e)),Qb=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var iS={id:z},WD={...iS,q:Ue},as=T("instantResults/register",e=>O(e,iS)),Kr=T("instantResults/updateQuery",e=>O(e,WD)),is=T("instantResults/clearExpired",e=>O(e,iS));d();c();l();u();var Jd=new ee({required:!0,min:0}),ss=T("pagination/registerNumberOfResults",e=>O(e,Jd)),cs=T("pagination/updateNumberOfResults",e=>O(e,Jd)),us=T("pagination/registerPage",e=>O(e,Jd)),Yr=T("pagination/updatePage",e=>O(e,Jd)),ls=T("pagination/nextPage"),ds=T("pagination/previousPage");d();c();l();u();var Dt=T("query/updateQuery",e=>O(e,{q:new j,enableQuerySyntax:new ce}));d();c();l();u();d();c();l();u();var Ln=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:_i(e)}});var ps=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(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&&Ln(e.configuration.analytics,t,r)),...(e.excerptLength&&!ue(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();d();c();l();u();var fs=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield ob(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}),...(tS()&&{pageId:tS()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:_i(e)})}}});return function fs(_x43,_x44){return _ref21.apply(this,arguments)}}();var So=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(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:Wt.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 fs(e.configuration.analytics,t))),...(e.excerptLength&&!ue(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function So(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var _r=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var sS=()=>Y("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),vo=e=>Y("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||lt().q,aq:r.advancedSearchQueries?.aq||_r().aq,cq:r.advancedSearchQueries?.cq||_r().cq,dq:r.advancedSearchQueries?.dq||_r().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var zu=kr(Xd(),1),zb=kr(Bb(),1);d();c();l();u();var Zd=kr(Xd(),1),$b=kr(Gb(),1);Zd.default.extend($b.default);var ms="YYYY/MM/DD@HH:mm:ss",KD="1401-01-01";function pa(e,t){let r=(0,Zd.default)(e,t);return!r.isValid()&&!t?(0,Zd.default)(e,ms):r}function Hu(e){return e.format(ms)}function Hb(e){return Hu(pa(e))===e}function ep(e,t){let r=pa(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}`)}mS(r)}function mS(e){if(e.isBefore(KD))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}zu.default.extend(zb.default);var Wb=["past","now","next"],Kb=["minute","hour","day","week","month","quarter","year"],YD=e=>{let t=e==="now";return{amount:new ee({required:!t,min:1}),unit:new j({required:!t,constrainTo:Kb}),period:new j({required:!0,constrainTo:Wb})}};function xo(e){if(typeof e=="string"&&!Jr(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?gS(e):e;new ge(YD(t.period)).validate(t);let r=Jb(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);mS(r)}function Yb(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Jb(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,zu.default)().subtract(r,n);case"next":return(0,zu.default)().add(r,n);case"now":return(0,zu.default)()}}function Wu(e){return Hu(Jb(gS(e)))}function Xb(e){return e.toLocaleLowerCase().split("-")}function Jr(e){let[t,r,n]=Xb(e);if(t==="now")return!0;if(!Wb.includes(t)||!Kb.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function Zb(e){return!!e&&typeof e=="object"&&"period"in e}function gS(e){let[t,r,n]=Xb(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function eR(e){return xo(e),gS(e)}d();c();l();u();function tR(e){return e.type==="dateRange"}function rR(e){return`start${e}`}function nR(e){return`end${e}`}var hS=()=>({dateFacetValueMap:{}});function JD(e,t,r){let n=e.start,o=e.end;return Jr(n)&&(n=Wu(n),r.dateFacetValueMap[t][rR(n)]=e.start),Jr(o)&&(o=Wu(o),r.dateFacetValueMap[t][nR(o)]=e.end),{...e,start:n,end:o}}function yS(e,t){if(tR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>JD(o,r,t))}}return e}function Ao(e){let t=hS();return{request:{...e,facets:e.facets?.map(n=>yS(n,t))},mappings:t}}function XD(e,t,r){return{...e,start:r.dateFacetValueMap[t][rR(e.start)]||e.start,end:r.dateFacetValueMap[t][nR(e.end)]||e.end}}function ZD(e,t){return e.facetId in t.dateFacetValueMap}function eq(e,t){return ZD(e,t)?{...e,values:e.values.map(r=>XD(r,e.facetId,t))}:e}function tp(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>eq(n,t))}}:e}d();c();l();u();d();c();l();u();var gs=T("didYouMean/enable"),rp=T("didYouMean/disable"),hs=T("didYouMean/automaticCorrections/disable"),np=T("didYouMean/automaticCorrections/enable"),gr=T("didYouMean/correction",e=>O(e,z)),fa=T("didYouMean/automaticCorrections/mode",e=>O(e,new j({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var op=()=>Y("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),SS=()=>Y("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),oR=()=>({actionCause:"didYouMeanClick"}),aR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function ap(){return{contextValues:{}}}d();c();l();u();function ip(){return{contextValues:{}}}d();c();l();u();function vS(){return{enabled:!0,tabs:{}}}function sp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function cp(){return[]}d();c();l();u();function hr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function up(){return{}}d();c();l();u();function lp(){return{}}d();c();l();u();function dp(){return{}}function iR(){return Dr({})}function Dr(e){return{context:e.context||ap(),dictionaryFieldContext:e.dictionaryFieldContext||ip(),facetSet:e.facetSet||Gi(),numericFacetSet:e.numericFacetSet||Bi(),dateFacetSet:e.dateFacetSet||Qi(),categoryFacetSet:e.categoryFacetSet||Ui(),automaticFacetSet:e.automaticFacetSet??Vi(),pagination:e.pagination||hr(),query:e.query||lt(),tabSet:e.tabSet||dp(),advancedSearchQueries:e.advancedSearchQueries||_r(),staticFilterSet:e.staticFilterSet||lp(),querySet:e.querySet||up(),sortCriteria:e.sortCriteria||fr(),pipeline:e.pipeline||Vn(),searchHub:e.searchHub||po(),facetOptions:e.facetOptions||sp(),facetOrder:e.facetOrder??cp(),debug:e.debug??yo()}}d();c();l();u();var tq=new J({values:{undoneQuery:Ue},options:{required:!0}}),pp=()=>Y("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),fp=e=>Y("analytics/trigger/query/undo",t=>(O(e,tq),t.makeUndoTriggerQuery(e))),mp=()=>Y("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),gp=()=>Y("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),hp=()=>Y("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var Co=T("trigger/query/ignore",e=>O(e,new j({emptyAllowed:!0,required:!0}))),ys=T("trigger/query/modification",e=>O(e,new J({values:{originalQuery:it,modification:it}})));d();c();l();u();d();c();l();u();d();c();l();u();function bo(e){return Object.values(e).map(t=>t.request)}function Ku(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function sR(e){return bo(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var xS={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function rq(e){return bo(e).map(t=>{let r=xS[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function nq(e){return[...rq(e.facetSet??{}),...sR(e.numericFacetSet??{}),...sR(e.dateFacetSet??{}),...bo(e.categoryFacetSet??{})]}function oq(e){return nq(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function yp(e){return Ku(oq(e),e.facetOrder??[])}d();c();l();u();var Ro=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=sq(e),n=yp(e),o=aq(e),a=yield So(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Ao({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ro(_x47,_x48){return _ref23.apply(this,arguments)}}();function aq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(iq).filter(r=>r.currentValues.length>0):void 0}function iq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function sq(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=cq(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function cq(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var wo=class{constructor(t,r=n=>{this.dispatch(Dt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=tp(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ht(t.response)?(this.dispatch(vo(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!ue(f)&&!ue(f.correctedQuery);if(!m&&!g)return null;let A=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(ir(Dr(_this12.getState()))),A})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return ht(a.response)?(_this13.dispatch(vo(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(ir(Dr(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:SS()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:SS()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Co("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return ht(i.response)?(_this14.dispatch(vo(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(ir(Dr(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:pp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??lt().enableQuerySyntax},search:{...rr(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(ir(Dr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Xl(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Ro(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(gr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(ys({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Ro(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var cR=Se("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Sp(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),uR=Se("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield CS(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),lR=Se("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield bS(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),dR=Se("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield pq(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),pR=Se("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return AS(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),uq=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield Ro(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function uq(_x61,_x62){return _ref29.apply(this,arguments)}}(),lq=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield So(e);return Ao({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function lq(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),dq=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield Ro(e,t);return r.request.numberOfResults=0,r});return function dq(_x66,_x67){return _ref31.apply(this,arguments)}}(),fR=e=>{e.configuration.analytics.enabled&&Wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function AS(_x68,_x69){return _AS.apply(this,arguments)}function _AS(){_AS=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new wo({...t,analyticsAction:Ub()},m=>{t.dispatch(Kr({q:m,id:e.id}))}),i=yield lq(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _AS.apply(this,arguments)}function CS(_x70,_x71,_x72){return _CS.apply(this,arguments)}function _CS(){_CS=_asyncToGenerator(function*(e,t,r){fR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new wo({...t,analyticsAction:r}),f=yield Ro(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _CS.apply(this,arguments)}function bS(_x73,_x74){return _bS.apply(this,arguments)}function _bS(){_bS=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield sS().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new wo({...e,analyticsAction:sS()}),p=yield uq(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _bS.apply(this,arguments)}function pq(_x75,_x76,_x77){return _pq.apply(this,arguments)}function _pq(){_pq=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new wo({...e,analyticsAction:t}),f=yield dq(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _pq.apply(this,arguments)}function Sp(_x78,_x79,_x80){return _Sp.apply(this,arguments)}function _Sp(){_Sp=_asyncToGenerator(function*(e,t,r){fR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield Ro(e,i),f=new wo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Sp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var mR=Ye(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var yr=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=wS(e),o=fq(e),a=mq(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield So(e,r):ps(e,t,r);return Ao({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:RS(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function yr(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function RS(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function fq(e){return Ku(hq(e),e.facetOrder??[])}function mq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(gq).filter(r=>r.currentValues.length>0):void 0}function gq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function hq(e){return yq(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function yq(e){return[...Sq(e.facetSet??{}),...gR(e.numericFacetSet??{}),...gR(e.dateFacetSet??{}),...bo(e.categoryFacetSet??{})]}function Sq(e){return bo(e).map(t=>{let r=xS[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function gR(e){return bo(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function wS(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=mR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var Fo=class{constructor(t,r=n=>{this.dispatch(Dt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=tp(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ht(t.response)?(this.dispatch(vo(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!ue(f)&&!ue(f.correctedQuery);if(!m&&!g)return null;let A=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(ir(Dr(_this19.getState()))),A})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return ht(a.response)?(_this20.dispatch(vo(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(ir(Dr(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Co("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return ht(i.response)?(_this21.dispatch(vo(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(ir(Dr(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(ir(Dr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Xl(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=aR(),o=yield _this22.fetchFromAPI(yield yr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(gr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(ys({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield yr(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ss=Se("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new j,enableQuerySyntax:new ce,clearFilters:new ce}),e.clearFilters&&(r(pt()),r(os())),r(Wr({allow:!0})),r(Dt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Yr(1))}),hR=T("search/updateSearchAction"),G=Se("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Sp(r,t,e.legacy);yR(r);let n=e.next?SR(e.next):void 0,o=yield yr(r,t.extra.navigatorContext,n),a=new Fo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),qt=Se("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(yR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return CS(r,t,e.legacy);let n=new Fo({...t,analyticsAction:e.next}),o=yield yr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),Sr=Se("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return bS(t,r);let n=Eb("browseResults",t.getState),o=new Fo({...t,analyticsAction:n}),a=yield vq(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),vr=Se("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Sp(r,t,e.legacy);let n=new Fo({...t,analyticsAction:{}}),o=yield Aq(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),vs=Se("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return AS(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee});let{q:n,maxResultsPerQuery:o}=e,a=SR(Qb()),i=yield xq(r,t.extra.navigatorContext,n,o,a),p=new Fo({...t,analyticsAction:a},g=>{t.dispatch(Kr({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x94,_x95){return _ref37.apply(this,arguments)}}()),vq=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield yr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function vq(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),xq=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=ps(e,t,o);return Ao({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function xq(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),Aq=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield yr(e,t,r);return n.request.numberOfResults=0,n});return function Aq(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),yR=e=>{e.configuration.analytics.enabled&&Wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},SR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Eo=(e,t)=>{let r=e;return ue(r[t])?ue(e.raw[t])?null:e.raw[t]:r[t]},Cq=e=>t=>e.every(r=>!ue(Eo(t,r))),bq=e=>t=>e.every(r=>ue(Eo(t,r))),Rq=(e,t)=>r=>{let n=vR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},wq=(e,t)=>r=>{let n=vR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},vR=(e,t)=>{let r=Eo(t,e);return Ul(r)?r:[r]},xR={getResultProperty:Eo,fieldsMustBeDefined:Cq,fieldsMustNotBeDefined:bq,fieldMustMatch:Rq,fieldMustNotMatch:wq};function Yu(e){return e.search.response.searchUid!==""}function AR(e,t,r){return e.search.results.find(n=>Eo(n,t)===r)}var FS=Ye(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var xs=T("app/setError");function ES(e,t){let r=t.payload??null;r&&(e.response=rr().response,e.results=[],e.questionAnswer=Ri()),e.error=r,e.isLoading=!1}function IS(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function Fq(e,t){IS(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function CR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function Eq(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var fe=oe(rr(),e=>{e.addCase(G.rejected,(t,r)=>ES(t,r)),e.addCase(Sr.rejected,(t,r)=>ES(t,r)),e.addCase(qt.rejected,(t,r)=>ES(t,r)),e.addCase(G.fulfilled,(t,r)=>{Fq(t,r)}),e.addCase(Sr.fulfilled,(t,r)=>{IS(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(qt.fulfilled,(t,r)=>{IS(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(vr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(G.pending,CR),e.addCase(Sr.pending,Eq),e.addCase(qt.pending,CR),e.addCase(hR,(t,r)=>{t.searchAction=r.payload}),e.addCase(xs,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var As=T("searchHub/set",e=>O(e,new j({required:!0,emptyAllowed:!0})));var Cs=oe(po(),e=>{e.addCase(As,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(mr,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();function bR(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var RR=Qr;function qR(e,t){if(e===t||!(RR(e)&&RR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=qR(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function bs(e){let t=0;for(let r in e)t++;return t}var wR=e=>[].concat(...e);function Iq(e){return new RegExp("(^|:)//").test(e)}function Tq(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Ap(e){return e!=null}function Pq(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var kq=e=>e.replace(/\/$/,""),Oq=e=>e.replace(/^\//,"");function Nq(e,t){if(!e)return t;if(!t)return e;if(Iq(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=kq(e),t=Oq(t),`${e}${r}${t}`}function _q(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var FR=(...e)=>v(...e),Dq=e=>e.status>=200&&e.status<=299,qq=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ER(e){if(!Qr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function MR({baseUrl:e,prepareHeaders:t=S=>S,fetchFn:r=FR,paramsSerializer:n,isJsonContentType:o=qq,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof v>"u"&&r===FR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(A,h,C){let{getState:w,extra:R,endpoint:b,forced:F,type:E}=h,P,{url:M,headers:_=new x(g.headers),params:k=void 0,responseHandler:N=f??"json",validateStatus:q=m??Dq,timeout:U=p,...X}=typeof A=="string"?{url:A}:A,H,B=h.signal;U&&(H=new s.AbortController,h.signal.addEventListener("abort",H.abort),B=H.signal);let Q={...g,signal:B,...X};_=new x(ER(_)),Q.headers=(yield t(_,{getState:w,arg:A,extra:R,endpoint:b,forced:F,type:E,extraOptions:C}))||_;let K=Ae=>typeof Ae=="object"&&(Qr(Ae)||Array.isArray(Ae)||typeof Ae.toJSON=="function");if(!Q.headers.has("content-type")&&K(Q.body)&&Q.headers.set("content-type",a),K(Q.body)&&o(Q.headers)&&(Q.body=JSON.stringify(Q.body,i)),k){let Ae=~M.indexOf("?")?"&":"?",Ee=n?n(k):new URLSearchParams(ER(k));M+=Ae+Ee}M=Nq(e,M);let $=new Request(M,Q);P={request:new Request(M,Q)};let re,pe=!1,Re=H&&setTimeout(()=>{pe=!0,H.abort()},U);try{re=yield r($)}catch(Ae){return{error:{status:pe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ae)},meta:P}}finally{Re&&clearTimeout(Re),H?.signal.removeEventListener("abort",H.abort)}let ke=re.clone();P.response=ke;let Ce,we="";try{let Ae;if(yield Promise.all([S(re,N).then(Ee=>Ce=Ee,Ee=>Ae=Ee),ke.text().then(Ee=>we=Ee,()=>{})]),Ae)throw Ae}catch(Ae){return{error:{status:"PARSING_ERROR",originalStatus:re.status,data:we,error:String(Ae)},meta:P}}return q(re,Ce)?{data:Ce,meta:P}:{error:{status:re.status,data:Ce},meta:P}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function S(_x110,_x111){return _S2.apply(this,arguments)}function _S2(){_S2=_asyncToGenerator(function*(A,h){if(typeof h=="function")return h(A);if(h==="content-type"&&(h=o(A.headers)?"json":"text"),h==="json"){let C=yield A.text();return C.length?JSON.parse(C):null}return A.text()});return _S2.apply(this,arguments)}}var Rs=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function Mq(){return _Mq.apply(this,arguments)}function _Mq(){_Mq=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(a=>o(a),n))});return _Mq.apply(this,arguments)}function jq(e,t){throw Object.assign(new Rs({error:e,meta:t}),{throwImmediately:!0})}var IR={},Vq=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||IR).maxRetries,(o||IR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:Mq,retryCondition:(g,S,{attempt:A})=>A<=i,...t,...o},m=0;for(;;)try{let g=yield e(r,n,o);if(g.error)throw new Rs(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Rs)return g.value;throw g}if(g instanceof Rs&&!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value;yield f.backoff(m,f.maxRetries)}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),jR=Object.assign(Vq,{fail:jq}),OS=T("__rtkq/focused"),VR=T("__rtkq/unfocused"),NS=T("__rtkq/online"),LR=T("__rtkq/offline");function _S(e){return e.type==="query"}function Lq(e){return e.type==="mutation"}function DS(e){return e.type==="infinitequery"}function qS(e,t,r,n,o,a){return Uq(e)?e(t,r,n,o).filter(Ap).map(TS).map(a):Array.isArray(e)?e.map(TS).map(a):[]}function Uq(e){return typeof e=="function"}function TS(e){return typeof e=="string"?{type:e}:e}function Qq(e,t){return e.catch(t)}var Xu=Symbol("forceQueryFn"),PS=e=>typeof e[Xu]=="function";function Bq({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a}){let i=new Map,p=new Map,{unsubscribeQueryResult:f,removeMutationResult:m,updateSubscriptionOptions:g}=o.internalActions;return{buildInitiateQuery:b,buildInitiateInfiniteQuery:F,buildInitiateMutation:E,getRunningQueryThunk:S,getRunningMutationThunk:A,getRunningQueriesThunk:h,getRunningMutationsThunk:C};function S(P,M){return _=>{let k=a.endpointDefinitions[P],N=e({queryArgs:M,endpointDefinition:k,endpointName:P});return i.get(_)?.[N]}}function A(P,M){return _=>p.get(_)?.[M]}function h(){return P=>Object.values(i.get(P)||{}).filter(Ap)}function C(){return P=>Object.values(p.get(P)||{}).filter(Ap)}function w(P){}function R(P,M){let _=(k,{subscribe:N=!0,forceRefetch:q,subscriptionOptions:U,[Xu]:X,...H}={})=>(B,Q)=>{let K=e({queryArgs:k,endpointDefinition:M,endpointName:P}),$,te={...H,type:"query",subscribe:N,forceRefetch:q,subscriptionOptions:U,endpointName:P,originalArgs:k,queryCacheKey:K,[Xu]:X};if(_S(M))$=t(te);else{let{direction:Me,initialPageParam:Ze}=H;$=r({...te,direction:Me,initialPageParam:Ze})}let re=o.endpoints[P].select(k),pe=B($),Re=re(Q());let{requestId:ke,abort:Ce}=pe,we=Re.requestId!==ke,Ae=i.get(B)?.[K],Ee=()=>re(Q()),rt=Object.assign(X?pe.then(Ee):we&&!Ae?Promise.resolve(Re):Promise.all([Ae,pe]).then(Ee),{arg:k,requestId:ke,subscriptionOptions:U,queryCacheKey:K,abort:Ce,unwrap(){return _asyncToGenerator(function*(){let Me=yield rt;if(Me.isError)throw Me.error;return Me.data})()},refetch:()=>B(_(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){N&&B(f({queryCacheKey:K,requestId:ke}))},updateSubscriptionOptions(Me){rt.subscriptionOptions=Me,B(g({endpointName:P,requestId:ke,queryCacheKey:K,options:Me}))}});if(!Ae&&!we&&!X){let Me=_q(i,B,{});Me[K]=rt,rt.then(()=>{delete Me[K],bs(Me)||i.delete(B)})}return rt};return _}function b(P,M){return R(P,M)}function F(P,M){return R(P,M)}function E(P){return(M,{track:_=!0,fixedCacheKey:k}={})=>(N,q)=>{let U=n({type:"mutation",endpointName:P,originalArgs:M,track:_,fixedCacheKey:k}),X=N(U);let{requestId:H,abort:B,unwrap:Q}=X,K=Qq(X.unwrap().then(pe=>({data:pe})),pe=>({error:pe})),$=()=>{N(m({requestId:H,fixedCacheKey:k}))},te=Object.assign(K,{arg:X.arg,requestId:H,abort:B,unwrap:Q,reset:$}),re=p.get(N)||{};return p.set(N,re),re[H]=te,te.then(()=>{delete re[H],bs(re)||p.delete(N)}),k&&(re[k]=te,te.then(()=>{re[k]===te&&(delete re[k],bs(re)||p.delete(N))})),te}}}function Gq(e){return e}var vp=(e={})=>({...e,[Pu]:!0});function $q({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i}){let p=(N,q,U,X)=>(H,B)=>{let Q=r[N],K=n({queryArgs:q,endpointDefinition:Q,endpointName:N});if(H(o.internalActions.queryResultPatched({queryCacheKey:K,patches:U})),!X)return;let $=o.endpoints[N].select(q)(B()),te=qS(Q.providesTags,$.data,void 0,q,{},a);H(o.internalActions.updateProvidedBy({queryCacheKey:K,providedTags:te}))};function f(N,q,U=0){let X=[q,...N];return U&&X.length>U?X.slice(0,-1):X}function m(N,q,U=0){let X=[...N,q];return U&&X.length>U?X.slice(1):X}let g=(N,q,U,X=!0)=>(H,B)=>{let K=o.endpoints[N].select(q)(B()),$={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(N,q,$.inversePatches,X))};if(K.status==="uninitialized")return $;let te;if("data"in K)if(zt(K.data)){let[re,pe,Re]=id(K.data,U);$.patches.push(...pe),$.inversePatches.push(...Re),te=re}else te=U(K.data),$.patches.push({op:"replace",path:[],value:te}),$.inversePatches.push({op:"replace",path:[],value:K.data});return $.patches.length===0||H(o.util.patchQueryData(N,q,$.patches,X)),$},S=(N,q,U)=>X=>X(o.endpoints[N].initiate(q,{subscribe:!1,forceRefetch:!0,[Xu]:()=>({data:U})})),A=(N,q)=>N.query&&N[q]?N[q]:Gq,h=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(N,{signal:q,abort:U,rejectWithValue:X,fulfillWithValue:H,dispatch:B,getState:Q,extra:K}){let $=r[N.endpointName];try{let te=A($,"transformResponse"),re={signal:q,abort:U,dispatch:B,getState:Q,extra:K,endpoint:N.endpointName,type:N.type,forced:N.type==="query"?C(N,Q()):void 0,queryCacheKey:N.type==="query"?N.queryCacheKey:void 0},pe=N.type==="query"?N[Xu]:void 0,Re,ke=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(we,Ae,Ee,rt){if(Ae==null&&we.pages.length)return Promise.resolve({data:we});let Me={queryArg:N.originalArgs,pageParam:Ae},Ze=yield Ce(Me),at=rt?f:m;return{data:{pages:at(we.pages,Ze.data,Ee),pageParams:at(we.pageParams,Ae,Ee)}}});return function ke(_x117,_x118,_x119,_x120){return _ref44.apply(this,arguments)}}();function Ce(_x121){return _Ce.apply(this,arguments)}function _Ce(){_Ce=_asyncToGenerator(function*(we){let Ae,{extraOptions:Ee}=$;if(pe?Ae=pe():$.query?Ae=yield t($.query(we),re,Ee):Ae=yield $.queryFn(we,re,Ee,Me=>t(Me,re,Ee)),typeof process<"u",Ae.error)throw new Rs(Ae.error,Ae.meta);let rt=yield te(Ae.data,Ae.meta,we);return{...Ae,data:rt}});return _Ce.apply(this,arguments)}if(N.type==="query"&&"infiniteQueryOptions"in $){let{infiniteQueryOptions:we}=$,{maxPages:Ae=1/0}=we,Ee,rt={pages:[],pageParams:[]},Me=i.selectQueryEntry(Q(),N.queryCacheKey)?.data,at=C(N,Q())&&!N.direction||!Me?rt:Me;if("direction"in N&&N.direction&&at.pages.length){let $t=N.direction==="backward",no=($t?UR:kS)(we,at);Ee=yield ke(at,no,Ae,$t)}else{let{initialPageParam:$t=we.initialPageParam}=N,ur=Me?.pageParams??[],no=ur[0]??$t,gi=ur.length;Ee=yield ke(at,no,Ae),pe&&(Ee={data:Ee.data.pages[0]});for(let hi=1;hi<gi;hi++){let uu=kS(we,Ee.data);Ee=yield ke(Ee.data,uu,Ae)}}Re=Ee}else Re=yield Ce(N.originalArgs);return H(Re.data,vp({fulfilledTimeStamp:Date.now(),baseQueryMeta:Re.meta}))}catch(te){let re=te;if(re instanceof Rs){let pe=A($,"transformErrorResponse");try{return X(yield pe(re.value,re.meta,N.originalArgs),vp({baseQueryMeta:re.meta}))}catch(Re){re=Re}}throw typeof process<"u",console.error(re),re}});return function h(_x115,_x116){return _ref43.apply(this,arguments)}}();function C(N,q){let U=i.selectQueryEntry(q,N.queryCacheKey),X=i.selectConfig(q).refetchOnMountOrArgChange,H=U?.fulfilledTimeStamp,B=N.forceRefetch??(N.subscribe&&X);return B?B===!0||(Number(new Date)-Number(H))/1e3>=B:!1}let w=()=>Se(`${e}/executeQuery`,h,{getPendingMeta({arg:q}){let U=r[q.endpointName];return vp({startedTimeStamp:Date.now(),...(DS(U)?{direction:q.direction}:{})})},condition(q,{getState:U}){let X=U(),H=i.selectQueryEntry(X,q.queryCacheKey),B=H?.fulfilledTimeStamp,Q=q.originalArgs,K=H?.originalArgs,$=r[q.endpointName],te=q.direction;return PS(q)?!0:H?.status==="pending"?!1:C(q,X)||_S($)&&$?.forceRefetch?.({currentArg:Q,previousArg:K,endpointState:H,state:X})?!0:!(B&&!te)},dispatchConditionRejection:!0}),R=w(),b=w(),F=Se(`${e}/executeMutation`,h,{getPendingMeta(){return vp({startedTimeStamp:Date.now()})}}),E=N=>"force"in N,P=N=>"ifOlderThan"in N,M=(N,q,U)=>(X,H)=>{let B=E(U)&&U.force,Q=P(U)&&U.ifOlderThan,K=(te=!0)=>{let re={forceRefetch:te,isPrefetch:!0};return o.endpoints[N].initiate(q,re)},$=o.endpoints[N].select(q)(H());if(B)X(K());else if(Q){let te=$?.fulfilledTimeStamp;if(!te){X(K());return}(Number(new Date)-Number(new Date(te)))/1e3>=Q&&X(K())}else X(K(!1))};function _(N){return q=>q?.meta?.arg?.endpointName===N}function k(N,q){return{matchPending:Oi(pd(N),_(q)),matchFulfilled:Oi(qn(N),_(q)),matchRejected:Oi(ia(N),_(q))}}return{queryThunk:R,mutationThunk:F,infiniteQueryThunk:b,prefetch:M,updateQueryData:g,upsertQueryData:S,patchQueryData:p,buildMatchThunkActions:k}}function kS(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function UR(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function QR(e,t,r,n){return qS(r[e.meta.arg.endpointName][t],qn(e)?e.payload:void 0,Ou(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function xp(e,t,r){let n=e[t];n&&r(n)}function Zu(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function TR(e,t,r){let n=e[Zu(t)];n&&r(n)}var Ju={};function Hq({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=T(`${e}/resetApiState`);function S(_,k,N,q){var U;_[U=k.queryCacheKey]??(_[U]={status:"uninitialized",endpointName:k.endpointName}),xp(_,k.queryCacheKey,X=>{X.status="pending",X.requestId=N&&X.requestId?X.requestId:q.requestId,k.originalArgs!==void 0&&(X.originalArgs=k.originalArgs),X.startedTimeStamp=q.startedTimeStamp;let H=o[q.arg.endpointName];DS(H)&&"direction"in k&&(X.direction=k.direction)})}function A(_,k,N,q){xp(_,k.arg.queryCacheKey,U=>{if(U.requestId!==k.requestId&&!q)return;let{merge:X}=o[k.arg.endpointName];if(U.status="fulfilled",X){if(U.data!==void 0){let{fulfilledTimeStamp:H,arg:B,baseQueryMeta:Q,requestId:K}=k,$=Dn(U.data,te=>X(te,N,{arg:B.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:H,requestId:K}));U.data=$}else U.data=N;}else U.data=o[k.arg.endpointName].structuralSharing??!0?qR(nr(U.data)?uy(U.data):U.data,N):N;delete U.error,U.fulfilledTimeStamp=k.fulfilledTimeStamp})}let h=sa({name:`${e}/queries`,initialState:Ju,reducers:{removeQueryResult:{reducer(_,{payload:{queryCacheKey:k}}){delete _[k]},prepare:Ni()},cacheEntriesUpserted:{reducer(_,k){for(let N of k.payload){let{queryDescription:q,value:U}=N;S(_,q,!0,{arg:q,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),A(_,{arg:q,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},U,!0)}},prepare:_=>({payload:_.map(q=>{let{endpointName:U,arg:X,value:H}=q,B=o[U];return{queryDescription:{type:"query",endpointName:U,originalArgs:q.arg,queryCacheKey:n({queryArgs:X,endpointDefinition:B,endpointName:U})},value:H}}),meta:{[Pu]:!0,requestId:Nu(),timestamp:Date.now()}})},queryResultPatched:{reducer(_,{payload:{queryCacheKey:k,patches:N}}){xp(_,k,q=>{q.data=dy(q.data,N.concat())})},prepare:Ni()}},extraReducers(_){_.addCase(t.pending,(k,{meta:N,meta:{arg:q}})=>{let U=PS(q);S(k,q,U,N)}).addCase(t.fulfilled,(k,{meta:N,payload:q})=>{let U=PS(N.arg);A(k,N,q,U)}).addCase(t.rejected,(k,{meta:{condition:N,arg:q,requestId:U},error:X,payload:H})=>{xp(k,q.queryCacheKey,B=>{if(!N){if(B.requestId!==U)return;B.status="rejected",B.error=H??X}})}).addMatcher(p,(k,N)=>{let{queries:q}=i(N);for(let[U,X]of Object.entries(q))(X?.status==="fulfilled"||X?.status==="rejected")&&(k[U]=X)})}}),C=sa({name:`${e}/mutations`,initialState:Ju,reducers:{removeMutationResult:{reducer(_,{payload:k}){let N=Zu(k);N in _&&delete _[N]},prepare:Ni()}},extraReducers(_){_.addCase(r.pending,(k,{meta:N,meta:{requestId:q,arg:U,startedTimeStamp:X}})=>{U.track&&(k[Zu(N)]={requestId:q,status:"pending",endpointName:U.endpointName,startedTimeStamp:X})}).addCase(r.fulfilled,(k,{payload:N,meta:q})=>{q.arg.track&&TR(k,q,U=>{U.requestId===q.requestId&&(U.status="fulfilled",U.data=N,U.fulfilledTimeStamp=q.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:N,error:q,meta:U})=>{U.arg.track&&TR(k,U,X=>{X.requestId===U.requestId&&(X.status="rejected",X.error=N??q)})}).addMatcher(p,(k,N)=>{let{mutations:q}=i(N);for(let[U,X]of Object.entries(q))(X?.status==="fulfilled"||X?.status==="rejected")&&U!==X?.requestId&&(k[U]=X)})}}),w=sa({name:`${e}/invalidation`,initialState:Ju,reducers:{updateProvidedBy:{reducer(_,k){var U,X;let{queryCacheKey:N,providedTags:q}=k.payload;for(let H of Object.values(_))for(let B of Object.values(H)){let Q=B.indexOf(N);Q!==-1&&B.splice(Q,1)}for(let{type:H,id:B}of q){let Q=(U=_[H]??(_[H]={}))[X=B||"__internal_without_id"]??(U[X]=[]);Q.includes(N)||Q.push(N)}},prepare:Ni()}},extraReducers(_){_.addCase(h.actions.removeQueryResult,(k,{payload:{queryCacheKey:N}})=>{for(let q of Object.values(k))for(let U of Object.values(q)){let X=U.indexOf(N);X!==-1&&U.splice(X,1)}}).addMatcher(p,(k,N)=>{var U,X;let{provided:q}=i(N);for(let[H,B]of Object.entries(q))for(let[Q,K]of Object.entries(B)){let $=(U=k[H]??(k[H]={}))[X=Q||"__internal_without_id"]??(U[X]=[]);for(let te of K)$.includes(te)||$.push(te)}}).addMatcher(Br(qn(t),Ou(t)),(k,N)=>{let q=QR(N,"providesTags",o,f),{queryCacheKey:U}=N.meta.arg;w.caseReducers.updateProvidedBy(k,w.actions.updateProvidedBy({queryCacheKey:U,providedTags:q}))})}}),R=sa({name:`${e}/subscriptions`,initialState:Ju,reducers:{updateSubscriptionOptions(_,k){},unsubscribeQueryResult(_,k){},internal_getRTKQSubscriptions(){}}}),b=sa({name:`${e}/internalSubscriptions`,initialState:Ju,reducers:{subscriptionsUpdated:{reducer(_,k){return dy(_,k.payload)},prepare:Ni()}}}),F=sa({name:`${e}/config`,initialState:{online:Pq(),focused:Tq(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(_,{payload:k}){_.middlewareRegistered=_.middlewareRegistered==="conflict"||a!==k?"conflict":!0}},extraReducers:_=>{_.addCase(NS,k=>{k.online=!0}).addCase(LR,k=>{k.online=!1}).addCase(OS,k=>{k.focused=!0}).addCase(VR,k=>{k.focused=!1}).addMatcher(p,k=>({...k}))}}),E=wi({queries:h.reducer,mutations:C.reducer,provided:w.reducer,subscriptions:b.reducer,config:F.reducer}),P=(_,k)=>E(g.match(k)?void 0:_,k),M={...F.actions,...h.actions,...R.actions,...b.actions,...C.actions,...w.actions,resetApiState:g};return{reducer:P,actions:M}}var ga=Symbol.for("RTKQ/skipToken"),BR={status:"uninitialized"},PR=Dn(BR,()=>{}),kR=Dn(BR,()=>{});function zq({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>PR,o=E=>kR;return{buildQuerySelector:A,buildInfiniteQuerySelector:h,buildMutationSelector:C,selectInvalidatedBy:w,selectCachedArgsForQuery:R,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(E){return{...E,...bR(E.status)}}function i(E){return E[t]}function p(E){return i(E)?.queries}function f(E,P){return p(E)?.[P]}function m(E){return i(E)?.mutations}function g(E){return i(E)?.config}function S(E,P,M){return _=>{if(_===ga)return r(n,M);let k=e({queryArgs:_,endpointDefinition:P,endpointName:E});return r(q=>f(q,k)??PR,M)}}function A(E,P){return S(E,P,a)}function h(E,P){let{infiniteQueryOptions:M}=P;function _(k){let N={...k,...bR(k.status)},{isLoading:q,isError:U,direction:X}=N,H=X==="forward",B=X==="backward";return{...N,hasNextPage:b(M,N.data),hasPreviousPage:F(M,N.data),isFetchingNextPage:q&&H,isFetchingPreviousPage:q&&B,isFetchNextPageError:U&&H,isFetchPreviousPageError:U&&B}}return S(E,P,_)}function C(){return E=>{let P;return typeof E=="object"?P=Zu(E)??ga:P=E,r(P===ga?o:k=>i(k)?.mutations?.[P]??kR,a)}}function w(E,P){let M=E[t],_=new Set;for(let k of P.filter(Ap).map(TS)){let N=M.provided[k.type];if(!N)continue;let q=(k.id!==void 0?N[k.id]:wR(Object.values(N)))??[];for(let U of q)_.add(U)}return wR(Array.from(_.values()).map(k=>{let N=M.queries[k];return N?[{queryCacheKey:k,endpointName:N.endpointName,originalArgs:N.originalArgs}]:[]}))}function R(E,P){return Object.values(p(E)).filter(M=>M?.endpointName===P&&M.status!=="uninitialized").map(M=>M.originalArgs)}function b(E,P){return P?kS(E,P)!=null:!1}function F(E,P){return!P||!E.getPreviousPageParam?!1:UR(E,P)!=null}}var OR=WeakMap?new WeakMap:void 0,NR=({endpointName:e,queryArgs:t})=>{let r="",n=OR?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Qr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Qr(t)&&OR?.set(t,o),r=o}return`${e}(${r})`};function Wq(...e){return function(r){let n=Pi(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=NR;if("serializeQueryArgs"in m.endpointDefinition){let S=m.endpointDefinition.serializeQueryArgs;g=A=>{let h=S(A);return typeof h=="string"?h:NR({...A,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Nu(),extractRehydrationInfo:n,hasRehydrationInfo:Pi(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let S of m)o.tagTypes.includes(S)||o.tagTypes.push(S);if(g)for(let[S,A]of Object.entries(g))typeof A=="function"?A(a.endpointDefinitions[S]):Object.assign(a.endpointDefinitions[S]||{},A);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:S=>({...S,type:"query"}),mutation:S=>({...S,type:"mutation"}),infiniteQuery:S=>({...S,type:"infinitequery"})});for(let[S,A]of Object.entries(g)){if(m.overrideExisting!==!0&&S in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Bt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[S]=A;for(let h of p)h.injectEndpoint(S,A)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Un(e,...t){return Object.assign(e,...t)}var Kq=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,a=null,{updateSubscriptionOptions:i,unsubscribeQueryResult:p}=e.internalActions,f=(h,C)=>{var R,b;if(i.match(C)){let{queryCacheKey:F,requestId:E,options:P}=C.payload;return h?.[F]?.[E]&&(h[F][E]=P),!0}if(p.match(C)){let{queryCacheKey:F,requestId:E}=C.payload;return h[F]&&delete h[F][E],!0}if(e.internalActions.removeQueryResult.match(C))return delete h[C.payload.queryCacheKey],!0;if(t.pending.match(C)){let{meta:{arg:F,requestId:E}}=C,P=h[R=F.queryCacheKey]??(h[R]={});return P[`${E}_running`]={},F.subscribe&&(P[E]=F.subscriptionOptions??P[E]??{}),!0}let w=!1;if(t.fulfilled.match(C)||t.rejected.match(C)){let F=h[C.meta.arg.queryCacheKey]||{},E=`${C.meta.requestId}_running`;w||(w=!!F[E]),delete F[E]}if(t.rejected.match(C)){let{meta:{condition:F,arg:E,requestId:P}}=C;if(F&&E.subscribe){let M=h[b=E.queryCacheKey]??(h[b]={});M[P]=E.subscriptionOptions??M[P]??{},w=!0}}return w},m=()=>r.currentSubscriptions,A={getSubscriptions:m,getSubscriptionCount:h=>{let w=m()[h]??{};return bs(w)},isRequestSubscribed:(h,C)=>!!m()?.[h]?.[C]};return(h,C)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(h))return o=r.currentSubscriptions={},a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,A];let w=f(r.currentSubscriptions,h),R=!0;if(w){a||(a=setTimeout(()=>{let E=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,P]=id(o,()=>E);C.next(e.internalActions.subscriptionsUpdated(P)),o=E,a=null},500));let b=typeof h.type=="string"&&!!h.type.startsWith(n),F=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;R=!b&&!F}return[R,!1]}};function Yq(e){for(let t in e)return!1;return!0}var Jq=2147483647/1e3-1,Xq=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i}})=>{let{removeQueryResult:p,unsubscribeQueryResult:f,cacheEntriesUpserted:m}=t.internalActions,g=Br(f.match,r.fulfilled,r.rejected,m.match);function S(R){let b=o.currentSubscriptions[R];return!!b&&!Yq(b)}let A={},h=(R,b,F)=>{let E=b.getState(),P=i(E);if(g(R)){let M;if(m.match(R))M=R.payload.map(_=>_.queryDescription.queryCacheKey);else{let{queryCacheKey:_}=f.match(R)?R.payload:R.meta.arg;M=[_]}C(M,b,P)}if(t.util.resetApiState.match(R))for(let[M,_]of Object.entries(A))_&&clearTimeout(_),delete A[M];if(n.hasRehydrationInfo(R)){let{queries:M}=n.extractRehydrationInfo(R);C(Object.keys(M),b,P)}};function C(R,b,F){let E=b.getState();for(let P of R){let M=a(E,P);w(P,M?.endpointName,b,F)}}function w(R,b,F,E){let M=n.endpointDefinitions[b]?.keepUnusedDataFor??E.keepUnusedDataFor;if(M===1/0)return;let _=Math.max(0,Math.min(M,Jq));if(!S(R)){let k=A[R];k&&clearTimeout(k),A[R]=setTimeout(()=>{S(R)||F.dispatch(p({queryCacheKey:R})),delete A[R]},_*1e3)}}return h},_R=new Error("Promise never resolved before cacheEntryRemoved."),Zq=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=fd(n),m=fd(o),g=qn(n,o),S={};function A(b,F,E){let P=S[b];P?.valueResolved&&(P.valueResolved({data:F,meta:E}),delete P.valueResolved)}function h(b){let F=S[b];F&&(delete S[b],F.cacheEntryRemoved())}let C=(b,F,E)=>{let P=w(b);function M(_,k,N,q){let U=i(E,k),X=i(F.getState(),k);!U&&X&&R(_,q,k,F,N)}if(n.pending.match(b))M(b.meta.arg.endpointName,P,b.meta.requestId,b.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(b))for(let{queryDescription:_,value:k}of b.payload){let{endpointName:N,originalArgs:q,queryCacheKey:U}=_;M(N,U,b.meta.requestId,q),A(U,k,{})}else if(o.pending.match(b))F.getState()[t].mutations[P]&&R(b.meta.arg.endpointName,b.meta.arg.originalArgs,P,F,b.meta.requestId);else if(g(b))A(P,b.payload,b.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(b)||e.internalActions.removeMutationResult.match(b))h(P);else if(e.util.resetApiState.match(b))for(let _ of Object.keys(S))h(_)};function w(b){return f(b)?b.meta.arg.queryCacheKey:m(b)?b.meta.arg.fixedCacheKey??b.meta.requestId:e.internalActions.removeQueryResult.match(b)?b.payload.queryCacheKey:e.internalActions.removeMutationResult.match(b)?Zu(b.payload):""}function R(b,F,E,P,M){let _=r.endpointDefinitions[b],k=_?.onCacheEntryAdded;if(!k)return;let N={},q=new Promise(K=>{N.cacheEntryRemoved=K}),U=Promise.race([new Promise(K=>{N.valueResolved=K}),q.then(()=>{throw _R})]);U.catch(()=>{}),S[E]=N;let X=e.endpoints[b].select(_.type==="query"?F:E),H=P.dispatch((K,$,te)=>te),B={...P,getCacheEntry:()=>X(P.getState()),requestId:M,extra:H,updateCachedData:_.type==="query"?K=>P.dispatch(e.util.updateQueryData(b,F,K)):void 0,cacheDataLoaded:U,cacheEntryRemoved:q},Q=k(F,B);Promise.resolve(Q).catch(K=>{if(K!==_R)throw K})}return C},eM=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},tM=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Br(qn(n),Ou(n)),S=Br(qn(n,o),ia(n,o)),A=[],h=(R,b)=>{g(R)?w(QR(R,"invalidatesTags",r,i),b):S(R)?w([],b):a.util.invalidateTags.match(R)&&w(qS(R.payload,void 0,void 0,void 0,void 0,i),b)};function C(R){let{queries:b,mutations:F}=R;for(let E of[b,F])for(let P in E)if(E[P]?.status==="pending")return!0;return!1}function w(R,b){let F=b.getState(),E=F[e];if(A.push(...R),E.config.invalidationBehavior==="delayed"&&C(E))return;let P=A;if(A=[],P.length===0)return;let M=a.util.selectInvalidatedBy(F,P);t.batch(()=>{let _=Array.from(M.values());for(let{queryCacheKey:k}of _){let N=E.queries[k],q=f.currentSubscriptions[k]??{};N&&(bs(q)===0?b.dispatch(m({queryCacheKey:k})):N.status!=="uninitialized"&&b.dispatch(p(N)))}})}return h},rM=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let a={},i=(h,C)=>{(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&m(h.payload,C),(t.pending.match(h)||t.rejected.match(h)&&h.meta.condition)&&m(h.meta.arg,C),(t.fulfilled.match(h)||t.rejected.match(h)&&!h.meta.condition)&&f(h.meta.arg,C),r.util.resetApiState.match(h)&&S()};function p(h,C){let R=C.getState()[e].queries[h],b=o.currentSubscriptions[h];if(!(!R||R.status==="uninitialized"))return b}function f({queryCacheKey:h},C){let w=C.getState()[e],R=w.queries[h],b=o.currentSubscriptions[h];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:F,skipPollingIfUnfocused:E}=A(b);if(!Number.isFinite(F))return;let P=a[h];P?.timeout&&(clearTimeout(P.timeout),P.timeout=void 0);let M=Date.now()+F;a[h]={nextPollTimestamp:M,pollingInterval:F,timeout:setTimeout(()=>{(w.config.focused||!E)&&C.dispatch(n(R)),f({queryCacheKey:h},C)},F)}}function m({queryCacheKey:h},C){let R=C.getState()[e].queries[h],b=o.currentSubscriptions[h];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:F}=A(b);if(!Number.isFinite(F)){g(h);return}let E=a[h],P=Date.now()+F;(!E||P<E.nextPollTimestamp)&&f({queryCacheKey:h},C)}function g(h){let C=a[h];C?.timeout&&clearTimeout(C.timeout),delete a[h]}function S(){for(let h of Object.keys(a))g(h)}function A(h={}){let C=!1,w=Number.POSITIVE_INFINITY;for(let R in h)h[R].pollingInterval&&(w=Math.min(h[R].pollingInterval,w),C=h[R].skipPollingIfUnfocused||C);return{lowestPollingInterval:w,skipPollingIfUnfocused:C}}return i},nM=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=pd(r,n),a=ia(r,n),i=qn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:S,arg:{endpointName:A,originalArgs:h}}=m.meta,C=t.endpointDefinitions[A],w=C?.onQueryStarted;if(w){let R={},b=new Promise((M,_)=>{R.resolve=M,R.reject=_});b.catch(()=>{}),p[S]=R;let F=e.endpoints[A].select(C.type==="query"?h:S),E=g.dispatch((M,_,k)=>k),P={...g,getCacheEntry:()=>F(g.getState()),requestId:S,extra:E,updateCachedData:C.type==="query"?M=>g.dispatch(e.util.updateQueryData(A,h,M)):void 0,queryFulfilled:b};w(h,P)}}else if(i(m)){let{requestId:S,baseQueryMeta:A}=m.meta;p[S]?.resolve({data:m.payload,meta:A}),delete p[S]}else if(a(m)){let{requestId:S,rejectedWithValue:A,baseQueryMeta:h}=m.meta;p[S]?.reject({error:m.payload??m.error,isUnhandledError:!A,meta:h}),delete p[S]}}},oM=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{OS.match(f)&&p(m,"refetchOnFocus"),NS.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],S=g.queries,A=o.currentSubscriptions;t.batch(()=>{for(let h of Object.keys(A)){let C=S[h],w=A[h];if(!w||!C)continue;(Object.values(w).some(b=>b[m]===!0)||Object.values(w).every(b=>b[m]===void 0)&&g.config[m])&&(bs(w)===0?f.dispatch(a({queryCacheKey:h})):C.status!=="uninitialized"&&f.dispatch(n(C)))}})}return i};function aM(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:a}=o,i={invalidateTags:T(`${t}/invalidateTags`)},p=S=>S.type.startsWith(`${t}/`),f=[eM,Xq,tM,rM,Zq,nM];return{middleware:S=>{let A=!1,C={...e,internalState:{currentSubscriptions:{}},refetchQuery:g,isThisApiSliceAction:p},w=f.map(F=>F(C)),R=Kq(C),b=oM(C);return F=>E=>{if(!Ei(E))return F(E);A||(A=!0,S.dispatch(n.internalActions.middlewareRegistered(a)));let P={...S,next:F},M=S.getState(),[_,k]=R(E,P,M),N;if(_?N=F(E):N=k,S.getState()[t]&&(b(E,P,M),p(E)||o.hasRehydrationInfo(E)))for(let q of w)q(E,P,M);return N}},actions:i};function g(S){return e.api.endpoints[S.endpointName].initiate(S.originalArgs,{subscribe:!1,forceRefetch:!0})}}var DR=Symbol(),iM=({createSelector:e=Ye}={})=>({name:DR,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g},S){HA();let A=Ce=>(typeof process<"u",Ce);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:NS,onOffline:LR,onFocus:OS,onFocusLost:VR},util:{}});let h=zq({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:C,selectCachedArgsForQuery:w,buildQuerySelector:R,buildInfiniteQuerySelector:b,buildMutationSelector:F}=h;Un(t.util,{selectInvalidatedBy:C,selectCachedArgsForQuery:w});let{queryThunk:E,infiniteQueryThunk:P,mutationThunk:M,patchQueryData:_,updateQueryData:k,upsertQueryData:N,prefetch:q,buildMatchThunkActions:U}=$q({baseQuery:r,reducerPath:o,context:S,api:t,serializeQueryArgs:a,assertTagType:A,selectors:h}),{reducer:X,actions:H}=Hq({context:S,queryThunk:E,infiniteQueryThunk:P,mutationThunk:M,serializeQueryArgs:a,reducerPath:o,assertTagType:A,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Un(t.util,{patchQueryData:_,updateQueryData:k,upsertQueryData:N,prefetch:q,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),Un(t.internalActions,H);let{middleware:B,actions:Q}=aM({reducerPath:o,context:S,queryThunk:E,mutationThunk:M,infiniteQueryThunk:P,api:t,assertTagType:A,selectors:h});Un(t.util,Q),Un(t,{reducer:X,middleware:B});let{buildInitiateQuery:K,buildInitiateInfiniteQuery:$,buildInitiateMutation:te,getRunningMutationThunk:re,getRunningMutationsThunk:pe,getRunningQueriesThunk:Re,getRunningQueryThunk:ke}=Bq({queryThunk:E,mutationThunk:M,infiniteQueryThunk:P,api:t,serializeQueryArgs:a,context:S});return Un(t.util,{getRunningMutationThunk:re,getRunningMutationsThunk:pe,getRunningQueryThunk:ke,getRunningQueriesThunk:Re}),{name:DR,injectEndpoint(Ce,we){var rt;let Ee=(rt=t.endpoints)[Ce]??(rt[Ce]={});_S(we)&&Un(Ee,{name:Ce,select:R(Ce,we),initiate:K(Ce,we)},U(E,Ce)),Lq(we)&&Un(Ee,{name:Ce,select:F(),initiate:te(Ce)},U(M,Ce)),DS(we)&&Un(Ee,{name:Ce,select:b(Ce,we),initiate:$(Ce,we)},U(E,Ce))}}}}),GR=Wq(iM());d();c();l();u();d();c();l();u();var ha=e=>e.query,$R=e=>e.query?.enableQuerySyntax;var HR=Ye(e=>ha(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})),Cp=Ye(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var bp=e=>{if(e==="yes")return!0;if(e==="no")return!1},sM=()=>Y("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function cM(e,t){return Y({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??$e(n),a=Uu(n,e);return!o||!a?null:r.makeGeneratedAnswerCitationClick(Tb(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:Pb(a)})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=Uu(r,e);return{answerId:t??$e(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function uM(e,t,r){return Y({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??$e(o),i=Uu(o,e);return!a||!i?null:n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=Uu(n,e);return{answerId:r??$e(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function lM(e){return Y({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"like"})})}function dM(e){return Y({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"dislike"})})}var pM=e=>Y({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=$e(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=$e(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:bp(o),documented:bp(a),correctTopic:bp(p),hallucinationFree:bp(i)},additionalNotes:m,correctAnswerUrl:f}}}),ya=e=>Y({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=$e(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:$e(t)??"",answerGenerated:e??!1})}),ws=()=>Y({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})}),fM=()=>Y({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"show"})}),mM=()=>Y({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"hide"})}),gM=()=>Y({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"expand"})}),hM=()=>Y({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"collapse"})});function yM(e){return Y({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"copyToClipboard"})})}var Fs={logCopyGeneratedAnswer:yM,logGeneratedAnswerHideAnswers:mM,logGeneratedAnswerShowAnswers:fM,logGeneratedAnswerStreamEnd:ya,logGeneratedAnswerFeedback:pM,logDislikeGeneratedAnswer:dM,logLikeGeneratedAnswer:lM,logHoverCitation:uM,logOpenGeneratedAnswerSource:cM,logRetryGeneratedAnswer:sM,logGeneratedAnswerExpand:gM,logGeneratedAnswerCollapse:hM};d();c();l();u();d();c();l();u();var zR=Ye(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var WR=e=>e.context;d();c();l();u();var MS=e=>e.pipeline;d();c();l();u();var jS=e=>e.searchHub;d();c();l();u();var Gt=Ye(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),goe=Ye(e=>e,e=>{let t=Gt(e);return t&&e?e[t].expression:""});d();c();l();u();var KR=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var YR=e=>e.excerptLength?.length;d();c();l();u();var Xr=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,JR=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var XR=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var ZR=e=>e.sortCriteria;var ew=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Ft(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function ew(_x122){return _ref45.apply(this,arguments)}}(),tw=(e,t)=>{let r=ha(e)?.q,{aq:n,cq:o,dq:a,lq:i}=vM(e),p=WR(e),f=Ln(e.configuration.analytics,t,{actionCause:FS(e)}),m=jS(e),g=MS(e),S=Yy(e)??[],A=nw(e),h=Gt(e.tabSet)||"default",C=Wy(e),w=Sb(e),R=t.referrer||"",b=JR(e),F=ZR(e),E=SM(e),P=YR(e),M=XR(e),_=KR(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:$R(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:S}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(A.length&&{facets:A}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:RS(e),firstResult:e.pagination.firstResult}),tab:h,locale:C,timezone:w,...(e.debug!==void 0&&{debug:e.debug}),referrer:R,...E,...(M??{}),...(P&&{excerptLength:P}),...(_&&{dictionaryFieldContext:_}),sortCriteria:F,...(b&&{facetOptions:b}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},rw=(e,t)=>{let r=ha(e)?.q,n=nw(e),o=Ln(e.configuration.analytics,t,{actionCause:FS(e)}),a=Wy(e),i=jS(e),p=MS(e),f=Yy(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:f}},...(i?.length&&{searchHub:i}),...(p?.length&&{pipeline:p}),...o,locale:a}},nw=e=>yp(e)?.map(t=>yS(t,hS())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),SM=e=>({actionsHistory:e.configuration.analytics.enabled?Wt.getInstance().getHistory():[]}),vM=e=>{let t=zR(e),r=wS(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Rp=["searching","thinking","answering"];function wp(e){return e.toLowerCase()}function VS(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var ow=["text/plain","text/markdown"];var Es=new j({required:!0}),aw=new j,Is=new ce({required:!0}),LS={id:Es,title:Es,uri:Es,permanentid:Es,clickUri:aw},Fp=new j({required:!0,constrainTo:ow}),iw=new j({required:!0,constrainTo:Rp}),sw=e=>({...e,name:wp(e.name)}),Ts=T("generatedAnswer/setIsVisible",e=>O(e,Is)),Ps=T("generatedAnswer/setAnswerId",e=>O(e,z)),Ep=T("generatedAnswer/setAnswerGenerationMode",e=>O(e,new j({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),el=T("generatedAnswer/setIsEnabled",e=>O(e,Is)),va=T("generatedAnswer/updateMessage",e=>O(e,{textDelta:Es})),xa=T("generatedAnswer/updateCitations",e=>O(e,{citations:new ae({required:!0,each:new J({values:LS})})})),Aa=T("generatedAnswer/updateError",e=>O(e,{message:aw,code:new ee({min:0})})),sr=T("generatedAnswer/resetAnswer"),Ip=T("generatedAnswer/like"),Tp=T("generatedAnswer/dislike"),Pp=T("generatedAnswer/feedbackModal/open"),tl=T("generatedAnswer/expand"),kp=T("generatedAnswer/collapse"),Op=T("generatedAnswer/setId",e=>O(e,{id:new j({required:!0})})),Np=T("generatedAnswer/feedbackModal/close"),ks=T("generatedAnswer/sendFeedback"),Zr=T("generatedAnswer/setIsLoading",e=>O(e,Is)),Sa=T("generatedAnswer/setIsStreaming",e=>O(e,Is)),Ca=T("generatedAnswer/setAnswerContentFormat",e=>O(e,Fp)),_p=T("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ae({each:Fp,default:["text/plain"]})})),Dp=T("knowledge/updateAnswerConfigurationId",e=>O(e,Es)),qp=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,Zl)),rl=T("generatedAnswer/setIsAnswerGenerated",e=>O(e,Is)),ba=T("generatedAnswer/setCannotAnswer",e=>O(e,Is)),US=T("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new J({}))),Mp=T("generatedAnswer/startStep",e=>O(sw(e),{name:iw,startedAt:new ee({min:0,required:!0})})),jp=T("generatedAnswer/finishStep",e=>O(sw(e),{name:iw,finishedAt:new ee({min:0,required:!0})})),cw=Se("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield ew(r),g=(h,C)=>{switch(h){case"genqa.headerMessageType":{let w=JSON.parse(C);n(Ca(w.contentFormat));break}case"genqa.messageType":n(va(JSON.parse(C)));break;case"genqa.citationsType":n(xa(JSON.parse(C)));break;case"genqa.endOfStreamType":{let w=JSON.parse(C).answerGenerated,R=p.length!==0&&!w;n(ba(R)),n(Sa(!1)),n(rl(w)),n(ya(w)),n(ws());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(Zr(!0));let S=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,A=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{S(m)&&(n(Zr(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{S(m)&&n(Aa(h))},close:()=>{S(m)&&n(Sa(!1))},resetAnswer:()=>{S(m)&&n(sr())}});A?f(A):n(Zr(!1))});return function(_x123,_x124){return _ref46.apply(this,arguments)}}()),Vp=Se("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(sr());let a=t();if(a.generatedAnswer.answerConfigurationId){let i=tw(a,n);r(US(i)),yield r(Lp(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x125,_x126){return _ref47.apply(this,arguments)}}());d();c();l();u();var xM=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Ft(i,a);return{data:MR({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(S){if(S instanceof String)throw new Error("The provided 'request' must be a Request object.");let A=S.url,h={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(C=>{h[C]=S[C]}),h.duplex="half",h.body=yield S.text(),v(A,h)});return function fetchFn(_x130){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(m){return{error:m}}});return function xM(_x127,_x128,_x129){return _ref48.apply(this,arguments)}}(),Up=GR({reducerPath:"answer",baseQuery:jR(xM,{maxRetries:3}),endpoints:()=>({})});var AM=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},CM=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},bM=(e,t)=>{e.citations=t.citations},RM=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},wM=(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})`)},FM=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&wM(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(AM(t,o),r(Ca(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(CM(t,o),r(va({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(bM(t,o),r(xa({citations:o.citations})));break;case"genqa.endOfStreamType":RM(t,o),r(ya(o.answerGenerated??!1)),r(ws());break}},EM=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},Ra=Up.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(_x131,_x132){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:S}=i,A=Ft(m,g),h=EM(A,m,p.answerConfigurationId,f?.insightId);yield $l(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${S}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:v,onopen:function(){var _ref50=_asyncToGenerator(function*(C){let w=C.headers.get("x-answer-id");w&&o(R=>{R.answerId=w,a(Ps(w))})});return function onopen(_x133){return _ref50.apply(this,arguments)}}(),onmessage:C=>{o(w=>{FM(C,w,a)})},onerror:C=>{throw C},onclose:()=>{o(C=>{a(ba(!C.generated))})}})}).apply(this,arguments)}})})}),Lp=e=>Ra.endpoints.getAnswer.initiate(e),QS=e=>{let t=Cp(e);return Ra.endpoints.getAnswer.select(t??ga)(e)};d();c();l();u();var uw=oe(uo,e=>e);d();c();l();u();function IM(e){let t=e.payload?.analyticsAction;return lw(e)&&!ue(t)}function lw(e){return"type"in e}var dw=e=>t=>r=>{let n;IM(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return lw(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var Os=T("tab/register",e=>{let t=new J({values:{id:z,expression:Ue}});return O(e,t)}),gt=T("tab/updateActiveTab",e=>O(e,z));d();c();l();u();var Qp=kr(Xd(),1),mw=kr(pw(),1),gw=kr(fw(),1);Qp.default.extend(gw.default);Qp.default.extend(mw.default);var Ns=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Qp.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var TM=/(^|; )Coveo-Pendragon=([^;]*)/;function zS(){return typeof window>"u"?!1:TM.exec(document.cookie)?.pop()||null}var Bp=oe(Ns(),e=>e.addCase(zr,(t,r)=>{PM(t,r.payload)}).addCase(mr,(t,r)=>{kM(t,r.payload)}).addCase(go,(t,r)=>{OM(t,r.payload)}).addCase(Ji,t=>{t.analytics.enabled=!1}).addCase(Xi,t=>{t.analytics.enabled=!0}).addCase(Hd,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(zd,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(gt,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Zi,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(De,(t,r)=>{ue(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Wd,(t,{payload:r})=>{t.knowledge.agentId=r}));function PM(e,t){ue(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",ue(t.organizationId)||(e.organizationId=t.organizationId)}function kM(e,t){ue(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),ue(t.locale)||(e.search.locale=t.locale),ue(t.timezone)||(e.search.timezone=t.timezone),ue(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function OM(e,t){ue(t.enabled)||(e.analytics.enabled=t.enabled),ue(t.originContext)||(e.analytics.originContext=t.originContext),ue(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),ue(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),ue(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),ue(t.trackingId)||(e.analytics.trackingId=t.trackingId),ue(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),ue(t.source)||(e.analytics.source=t.source);try{let r=zS();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}ue(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),ue(t.anonymous)||(e.analytics.anonymous=t.anonymous),ue(t.deviceId)||(e.analytics.deviceId=t.deviceId),ue(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),ue(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var le=Bp;d();c();l();u();function NM(e){return e.instantlyCallable}var hw=()=>e=>t=>e(NM(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var kt=[];for(let e=0;e<256;++e)kt.push((e+256).toString(16).slice(1));function yw(e,t=0){return(kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]).toLowerCase()}d();c();l();u();var WS,_M=new Uint8Array(16);function KS(){if(!WS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");WS=crypto.getRandomValues.bind(crypto)}return WS(_M)}d();c();l();u();d();c();l();u();var DM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),YS={randomUUID:DM};function qM(e,t,r){if(YS.randomUUID&&!t&&!e)return YS.randomUUID();e=e||{};let n=e.random??e.rng?.()??KS();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 yw(n)}var Io=qM;d();c();l();u();d();c();l();u();var I={};pu(I,{BRAND:()=>cj,DIRTY:()=>wa,EMPTY_PATH:()=>LM,INVALID:()=>ve,NEVER:()=>Hj,OK:()=>Mt,ParseStatus:()=>Ot,Schema:()=>Ie,ZodAny:()=>ko,ZodArray:()=>$n,ZodBigInt:()=>Ea,ZodBoolean:()=>Ia,ZodBranded:()=>ol,ZodCatch:()=>Va,ZodDate:()=>Ta,ZodDefault:()=>ja,ZodDiscriminatedUnion:()=>Hp,ZodEffects:()=>Cr,ZodEnum:()=>qa,ZodError:()=>Jt,ZodFirstPartyTypeKind:()=>xe,ZodFunction:()=>Wp,ZodIntersection:()=>Na,ZodIssueCode:()=>Z,ZodLazy:()=>_a,ZodLiteral:()=>Da,ZodMap:()=>Vs,ZodNaN:()=>Us,ZodNativeEnum:()=>Ma,ZodNever:()=>qr,ZodNull:()=>ka,ZodNullable:()=>rn,ZodNumber:()=>Fa,ZodObject:()=>Xt,ZodOptional:()=>xr,ZodParsedType:()=>se,ZodPipeline:()=>al,ZodPromise:()=>Oo,ZodReadonly:()=>La,ZodRecord:()=>zp,ZodSchema:()=>Ie,ZodSet:()=>Ls,ZodString:()=>Po,ZodSymbol:()=>Ms,ZodTransformer:()=>Cr,ZodTuple:()=>tn,ZodType:()=>Ie,ZodUndefined:()=>Pa,ZodUnion:()=>Oa,ZodUnknown:()=>Gn,ZodVoid:()=>js,addIssueToContext:()=>ie,any:()=>yj,array:()=>Aj,bigint:()=>pj,boolean:()=>Iw,coerce:()=>$j,custom:()=>ww,date:()=>fj,datetimeRegex:()=>bw,defaultErrorMap:()=>Qn,discriminatedUnion:()=>wj,effect:()=>Mj,enum:()=>_j,function:()=>kj,getErrorMap:()=>_s,getParsedType:()=>en,instanceof:()=>lj,intersection:()=>Fj,isAborted:()=>Gp,isAsync:()=>Ds,isDirty:()=>$p,isValid:()=>To,late:()=>uj,lazy:()=>Oj,literal:()=>Nj,makeIssue:()=>nl,map:()=>Tj,nan:()=>dj,nativeEnum:()=>Dj,never:()=>vj,null:()=>hj,nullable:()=>Vj,number:()=>Ew,object:()=>Cj,objectUtil:()=>JS,oboolean:()=>Gj,onumber:()=>Bj,optional:()=>jj,ostring:()=>Qj,pipeline:()=>Uj,preprocess:()=>Lj,promise:()=>qj,quotelessJson:()=>MM,record:()=>Ij,set:()=>Pj,setErrorMap:()=>VM,strictObject:()=>bj,string:()=>Fw,symbol:()=>mj,transformer:()=>Mj,tuple:()=>Ej,undefined:()=>gj,union:()=>Rj,unknown:()=>Sj,util:()=>Oe,void:()=>xj});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Oe;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(Oe||(Oe={}));var JS;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(JS||(JS={}));var se=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),en=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return Number.isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}};var Z=Oe.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"]),MM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Jt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Jt.create=e=>new Jt(e);var jM=(e,t)=>{let r;switch(e.code){case Z.invalid_type:e.received===se.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Oe.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(e.keys,", ")}`;break;case Z.invalid_union:r="Invalid input";break;case Z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(e.options)}`;break;case Z.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:r="Invalid function arguments";break;case Z.invalid_return_type:r="Invalid function return type";break;case Z.invalid_date:r="Invalid date";break;case Z.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}"`:Oe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Z.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 Z.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 Z.custom:r="Invalid input";break;case Z.invalid_intersection_types:r="Intersection results could not be merged";break;case Z.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:r="Number must be finite";break;default:r=t.defaultError,Oe.assertNever(e)}return{message:r}},Qn=jM;var Sw=Qn;function VM(e){Sw=e}function _s(){return Sw}d();c();l();u();var nl=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},LM=[];function ie(e,t){let r=_s(),n=nl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Qn?void 0:Qn].filter(o=>!!o)});e.common.issues.push(n)}var Ot=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 ve;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return ve;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},ve=Object.freeze({status:"aborted"}),wa=e=>({status:"dirty",value:e}),Mt=e=>({status:"valid",value:e}),Gp=e=>e.status==="aborted",$p=e=>e.status==="dirty",To=e=>e.status==="valid",Ds=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var Ar=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}},vw=(e,t)=>{if(To(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 Jt(e.common.issues);return this._error=r,this._error}}};function Fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Ie=class{get description(){return this._def.description}_getType(t){return en(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:en(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ot,ctx:{common:t.parent.common,data:t.data,parsedType:en(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Ds(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:en(t)},o=this._parseSync({data:t,path:n.path,parent:n});return vw(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:en(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return To(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=>To(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:en(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Ds(o)?o:Promise.resolve(o);return vw(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:Z.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Cr({schema:this,typeName:xe.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 xr.create(this,this._def)}nullable(){return rn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $n.create(this)}promise(){return Oo.create(this,this._def)}or(t){return Oa.create([this,t],this._def)}and(t){return Na.create(this,t,this._def)}transform(t){return new Cr({...Fe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ja({...Fe(this._def),innerType:this,defaultValue:r,typeName:xe.ZodDefault})}brand(){return new ol({typeName:xe.ZodBranded,type:this,...Fe(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Va({...Fe(this._def),innerType:this,catchValue:r,typeName:xe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return al.create(this,t)}readonly(){return La.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},UM=/^c[^\s-]{8,}$/i,QM=/^[0-9a-z]+$/,BM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,GM=/^[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,$M=/^[a-z0-9_-]{21}$/i,HM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zM=/^[-+]?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)?)??$/,WM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",XS,YM=/^(?:(?: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])$/,JM=/^(?:(?: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])$/,XM=/^(([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]))$/,ZM=/^(([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])$/,ej=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Aw="((\\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])))",rj=new RegExp(`^${Aw}$`);function Cw(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 nj(e){return new RegExp(`^${Cw(e)}$`)}function bw(e){let t=`${Aw}T${Cw(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 oj(e,t){return!!((t==="v4"||!t)&&YM.test(e)||(t==="v6"||!t)&&XM.test(e))}function aj(e,t){if(!HM.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 ij(e,t){return!!((t==="v4"||!t)&&JM.test(e)||(t==="v6"||!t)&&ZM.test(e))}var Po=class e extends Ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.string,received:a.parsedType}),ve}let n=new Ot,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?ie(o,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ie(o,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")WM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"email",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")XS||(XS=new RegExp(KM,"u")),XS.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"emoji",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")GM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"uuid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")$M.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"nanoid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")UM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")QM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid2",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")BM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ulid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ie(o,{validation:"url",code:Z.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"regex",code:Z.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?bw(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?rj.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?nj(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?zM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"duration",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?oj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ip",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?aj(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"jwt",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?ij(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cidr",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?ej.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?tj.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64url",code:Z.invalid_string,message:a.message}),n.dirty()):Oe.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:Z.invalid_string,...de.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.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,...de.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,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...de.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...de.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...de.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...de.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...de.errToObj(r)})}nonempty(t){return this.min(1,de.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}};Po.create=e=>new Po({checks:[],typeName:xe.ZodString,coerce:e?.coerce??!1,...Fe(e)});function sj(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var Fa=class e extends Ie{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)!==se.number){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.number,received:a.parsedType}),ve}let n,o=new Ot;for(let a of this._def.checks)a.kind==="int"?Oe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?sj(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_finite,message:a.message}),o.dirty()):Oe.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.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"&&Oe.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)}};Fa.create=e=>new Fa({checks:[],typeName:xe.ZodNumber,coerce:e?.coerce||!1,...Fe(e)});var Ea=class e extends Ie{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)!==se.bigint)return this._getInvalidInput(t);let n,o=new Ot;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Oe.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ie(r,{code:Z.invalid_type,expected:se.bigint,received:r.parsedType}),ve}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.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:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.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}};Ea.create=e=>new Ea({checks:[],typeName:xe.ZodBigInt,coerce:e?.coerce??!1,...Fe(e)});var Ia=class extends Ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.boolean,received:n.parsedType}),ve}return Mt(t.data)}};Ia.create=e=>new Ia({typeName:xe.ZodBoolean,coerce:e?.coerce||!1,...Fe(e)});var Ta=class e extends Ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.date,received:a.parsedType}),ve}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_date}),ve}let n=new Ot,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Oe.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:de.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}};Ta.create=e=>new Ta({checks:[],coerce:e?.coerce||!1,typeName:xe.ZodDate,...Fe(e)});var Ms=class extends Ie{_parse(t){if(this._getType(t)!==se.symbol){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.symbol,received:n.parsedType}),ve}return Mt(t.data)}};Ms.create=e=>new Ms({typeName:xe.ZodSymbol,...Fe(e)});var Pa=class extends Ie{_parse(t){if(this._getType(t)!==se.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.undefined,received:n.parsedType}),ve}return Mt(t.data)}};Pa.create=e=>new Pa({typeName:xe.ZodUndefined,...Fe(e)});var ka=class extends Ie{_parse(t){if(this._getType(t)!==se.null){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.null,received:n.parsedType}),ve}return Mt(t.data)}};ka.create=e=>new ka({typeName:xe.ZodNull,...Fe(e)});var ko=class extends Ie{constructor(){super(...arguments),this._any=!0}_parse(t){return Mt(t.data)}};ko.create=e=>new ko({typeName:xe.ZodAny,...Fe(e)});var Gn=class extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Mt(t.data)}};Gn.create=e=>new Gn({typeName:xe.ZodUnknown,...Fe(e)});var qr=class extends Ie{_parse(t){let r=this._getOrReturnCtx(t);return ie(r,{code:Z.invalid_type,expected:se.never,received:r.parsedType}),ve}};qr.create=e=>new qr({typeName:xe.ZodNever,...Fe(e)});var js=class extends Ie{_parse(t){if(this._getType(t)!==se.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.void,received:n.parsedType}),ve}return Mt(t.data)}};js.create=e=>new js({typeName:xe.ZodVoid,...Fe(e)});var $n=class e extends Ie{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==se.array)return ie(r,{code:Z.invalid_type,expected:se.array,received:r.parsedType}),ve;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ie(r,{code:i?Z.too_big:Z.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ie(r,{code:Z.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&&(ie(r,{code:Z.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Ar(r,i,r.path,p)))).then(i=>Ot.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Ar(r,i,r.path,p)));return Ot.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:de.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:de.toString(r)}})}nonempty(t){return this.min(1,t)}};$n.create=(e,t)=>new $n({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Fe(t)});function qs(e){if(e instanceof Xt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=xr.create(qs(n))}return new Xt({...e._def,shape:()=>t})}else return e instanceof $n?new $n({...e._def,type:qs(e.element)}):e instanceof xr?xr.create(qs(e.unwrap())):e instanceof rn?rn.create(qs(e.unwrap())):e instanceof tn?tn.create(e.items.map(t=>qs(t))):e}var Xt=class e extends Ie{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=Oe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==se.object){let m=this._getOrReturnCtx(t);return ie(m,{code:Z.invalid_type,expected:se.object,received:m.parsedType}),ve}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof qr&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],S=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Ar(o,S,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof qr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(ie(o,{code:Z.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let S=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Ar(o,S,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let S=yield g.key,A=yield g.value;m.push({key:S,value:A,alwaysSet:g.alwaysSet})}return m})).then(m=>Ot.mergeObjectSync(n,m)):Ot.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return de.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:de.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:xe.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 Oe.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 Oe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return qs(this)}partial(t){let r={};for(let n of Oe.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 Oe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof xr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return Rw(Oe.objectKeys(this.shape))}};Xt.create=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strip",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});Xt.strictCreate=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strict",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});Xt.lazycreate=(e,t)=>new Xt({shape:e,unknownKeys:"strip",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});var Oa=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new Jt(p.ctx.common.issues));return ie(r,{code:Z.invalid_union,unionErrors:i}),ve}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x134){return _ref52.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new Jt(f));return ie(r,{code:Z.invalid_union,unionErrors:p}),ve}}get options(){return this._def.options}};Oa.create=(e,t)=>new Oa({options:e,typeName:xe.ZodUnion,...Fe(t)});var Bn=e=>e instanceof _a?Bn(e.schema):e instanceof Cr?Bn(e.innerType()):e instanceof Da?[e.value]:e instanceof qa?e.options:e instanceof Ma?Oe.objectValues(e.enum):e instanceof ja?Bn(e._def.innerType):e instanceof Pa?[void 0]:e instanceof ka?[null]:e instanceof xr?[void 0,...Bn(e.unwrap())]:e instanceof rn?[null,...Bn(e.unwrap())]:e instanceof ol||e instanceof La?Bn(e.unwrap()):e instanceof Va?Bn(e._def.innerType):[],Hp=class e extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.object)return ie(r,{code:Z.invalid_type,expected:se.object,received:r.parsedType}),ve;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=Bn(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:xe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Fe(n)})}};function ZS(e,t){let r=en(e),n=en(t);if(e===t)return{valid:!0,data:e};if(r===se.object&&n===se.object){let o=Oe.objectKeys(t),a=Oe.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=ZS(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===se.array&&n===se.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=ZS(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===se.date&&n===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Na=class extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(Gp(a)||Gp(i))return ve;let p=ZS(a.value,i.value);return p.valid?(($p(a)||$p(i))&&r.dirty(),{status:r.value,value:p.data}):(ie(n,{code:Z.invalid_intersection_types}),ve)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Na.create=(e,t,r)=>new Na({left:e,right:t,typeName:xe.ZodIntersection,...Fe(r)});var tn=class e extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.array)return ie(n,{code:Z.invalid_type,expected:se.array,received:n.parsedType}),ve;if(n.data.length<this._def.items.length)return ie(n,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&n.data.length>this._def.items.length&&(ie(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Ar(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Ot.mergeArray(r,i)):Ot.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};tn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tn({items:e,typeName:xe.ZodTuple,rest:null,...Fe(t)})};var zp=class e extends Ie{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!==se.object)return ie(n,{code:Z.invalid_type,expected:se.object,received:n.parsedType}),ve;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Ar(n,p,n.path,p)),value:i._parse(new Ar(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Ot.mergeObjectAsync(r,o):Ot.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ie?new e({keyType:t,valueType:r,typeName:xe.ZodRecord,...Fe(n)}):new e({keyType:Po.create(),valueType:t,typeName:xe.ZodRecord,...Fe(r)})}},Vs=class extends Ie{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!==se.map)return ie(n,{code:Z.invalid_type,expected:se.map,received:n.parsedType}),ve;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Ar(n,p,n.path,[m,"key"])),value:a._parse(new Ar(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return ve;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return ve;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Vs.create=(e,t,r)=>new Vs({valueType:t,keyType:e,typeName:xe.ZodMap,...Fe(r)});var Ls=class e extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.set)return ie(n,{code:Z.invalid_type,expected:se.set,received:n.parsedType}),ve;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ie(n,{code:Z.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&&(ie(n,{code:Z.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return ve;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Ar(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:de.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ls.create=(e,t)=>new Ls({valueType:e,minSize:null,maxSize:null,typeName:xe.ZodSet,...Fe(t)});var Wp=class e extends Ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.function)return ie(r,{code:Z.invalid_type,expected:se.function,received:r.parsedType}),ve;function n(p,f){return nl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_s(),Qn].filter(m=>!!m),issueData:{code:Z.invalid_arguments,argumentsError:f}})}function o(p,f){return nl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_s(),Qn].filter(m=>!!m),issueData:{code:Z.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Oo){let p=this;return Mt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new Jt([]),g=yield p._def.args.parseAsync(f,a).catch(h=>{throw m.addIssue(n(f,h)),m}),S=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(S,a).catch(h=>{throw m.addIssue(o(S,h)),m})}))}else{let p=this;return Mt(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new Jt([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),S=p._def.returns.safeParse(g,a);if(!S.success)throw new Jt([o(g,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:tn.create(t).rest(Gn.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||tn.create([]).rest(Gn.create()),returns:r||Gn.create(),typeName:xe.ZodFunction,...Fe(n)})}},_a=class extends Ie{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})}};_a.create=(e,t)=>new _a({getter:e,typeName:xe.ZodLazy,...Fe(t)});var Da=class extends Ie{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ie(r,{received:r.data,code:Z.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:t.data}}get value(){return this._def.value}};Da.create=(e,t)=>new Da({value:e,typeName:xe.ZodLiteral,...Fe(t)});function Rw(e,t){return new qa({values:e,typeName:xe.ZodEnum,...Fe(t)})}var qa=class e extends Ie{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{expected:Oe.joinValues(n),received:r.parsedType,code:Z.invalid_type}),ve}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 ie(r,{received:r.data,code:Z.invalid_enum_value,options:n}),ve}return Mt(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})}};qa.create=Rw;var Ma=class extends Ie{_parse(t){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==se.string&&n.parsedType!==se.number){let o=Oe.objectValues(r);return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:Z.invalid_type}),ve}if(this._cache||(this._cache=new Set(Oe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Oe.objectValues(r);return ie(n,{received:n.data,code:Z.invalid_enum_value,options:o}),ve}return Mt(t.data)}get enum(){return this._def.values}};Ma.create=(e,t)=>new Ma({values:e,typeName:xe.ZodNativeEnum,...Fe(t)});var Oo=class extends Ie{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.promise&&r.common.async===!1)return ie(r,{code:Z.invalid_type,expected:se.promise,received:r.parsedType}),ve;let n=r.parsedType===se.promise?r.data:Promise.resolve(r.data);return Mt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Oo.create=(e,t)=>new Oo({type:e,typeName:xe.ZodPromise,...Fe(t)});var Cr=class extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ie(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return ve;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?ve:f.status==="dirty"?wa(f.value):r.value==="dirty"?wa(f.value):f});return function(_x135){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return ve;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?ve:p.status==="dirty"?wa(p.value):r.value==="dirty"?wa(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?ve:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?ve:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!To(i))return ve;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>To(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):ve);Oe.assertNever(o)}};Cr.create=(e,t,r)=>new Cr({schema:e,typeName:xe.ZodEffects,effect:t,...Fe(r)});Cr.createWithPreprocess=(e,t,r)=>new Cr({schema:t,effect:{type:"preprocess",transform:e},typeName:xe.ZodEffects,...Fe(r)});var xr=class extends Ie{_parse(t){return this._getType(t)===se.undefined?Mt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};xr.create=(e,t)=>new xr({innerType:e,typeName:xe.ZodOptional,...Fe(t)});var rn=class extends Ie{_parse(t){return this._getType(t)===se.null?Mt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};rn.create=(e,t)=>new rn({innerType:e,typeName:xe.ZodNullable,...Fe(t)});var ja=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===se.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ja.create=(e,t)=>new ja({innerType:e,typeName:xe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});var Va=class extends Ie{_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 Ds(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Va.create=(e,t)=>new Va({innerType:e,typeName:xe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});var Us=class extends Ie{_parse(t){if(this._getType(t)!==se.nan){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.nan,received:n.parsedType}),ve}return{status:"valid",value:t.data}}};Us.create=e=>new Us({typeName:xe.ZodNaN,...Fe(e)});var cj=Symbol("zod_brand"),ol=class extends Ie{_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}},al=class e extends Ie{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ve:a.status==="dirty"?(r.dirty(),wa(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ve: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:xe.ZodPipeline})}},La=class extends Ie{_parse(t){let r=this._def.innerType._parse(t),n=o=>(To(o)&&(o.value=Object.freeze(o.value)),o);return Ds(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};La.create=(e,t)=>new La({innerType:e,typeName:xe.ZodReadonly,...Fe(t)});function xw(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ww(e,t={},r){return e?ko.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=xw(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=xw(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):ko.create()}var uj={object:Xt.lazycreate},xe;(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"})(xe||(xe={}));var lj=(e,t={message:`Input not instance of ${e.name}`})=>ww(r=>r instanceof e,t),Fw=Po.create,Ew=Fa.create,dj=Us.create,pj=Ea.create,Iw=Ia.create,fj=Ta.create,mj=Ms.create,gj=Pa.create,hj=ka.create,yj=ko.create,Sj=Gn.create,vj=qr.create,xj=js.create,Aj=$n.create,Cj=Xt.create,bj=Xt.strictCreate,Rj=Oa.create,wj=Hp.create,Fj=Na.create,Ej=tn.create,Ij=zp.create,Tj=Vs.create,Pj=Ls.create,kj=Wp.create,Oj=_a.create,Nj=Da.create,_j=qa.create,Dj=Ma.create,qj=Oo.create,Mj=Cr.create,jj=xr.create,Vj=rn.create,Lj=Cr.createWithPreprocess,Uj=al.create,Qj=()=>Fw().optional(),Bj=()=>Ew().optional(),Gj=()=>Iw().optional(),$j={string:e=>Po.create({...e,coerce:!0}),number:e=>Fa.create({...e,coerce:!0}),boolean:e=>Ia.create({...e,coerce:!0}),bigint:e=>Ea.create({...e,coerce:!0}),date:e=>Ta.create({...e,coerce:!0})};var Hj=ve;var zj=I.object({name:I.string(),arguments:I.string()}),Wj=I.object({id:I.string(),type:I.literal("function"),function:zj,encryptedValue:I.string().optional()}),Kp=I.object({id:I.string(),role:I.string(),content:I.string().optional(),name:I.string().optional(),encryptedValue:I.string().optional()}),Kj=I.object({type:I.literal("text"),text:I.string()}),Tw=I.object({type:I.literal("binary"),mimeType:I.string(),id:I.string().optional(),url:I.string().optional(),data:I.string().optional(),filename:I.string().optional()}),Pw=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:I.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},Jce=Tw.superRefine((e,t)=>{Pw(e,t)}),Yj=I.discriminatedUnion("type",[Kj,Tw]),Jj=Yj.superRefine((e,t)=>{e.type==="binary"&&Pw(e,t)}),Xj=Kp.extend({role:I.literal("developer"),content:I.string()}),Zj=Kp.extend({role:I.literal("system"),content:I.string()}),eV=Kp.extend({role:I.literal("assistant"),content:I.string().optional(),toolCalls:I.array(Wj).optional()}),tV=Kp.extend({role:I.literal("user"),content:I.union([I.string(),I.array(Jj)])}),rV=I.object({id:I.string(),content:I.string(),role:I.literal("tool"),toolCallId:I.string(),error:I.string().optional(),encryptedValue:I.string().optional()}),nV=I.object({id:I.string(),role:I.literal("activity"),activityType:I.string(),content:I.record(I.any())}),oV=I.object({id:I.string(),role:I.literal("reasoning"),content:I.string(),encryptedValue:I.string().optional()}),kw=I.discriminatedUnion("role",[Xj,Zj,eV,tV,rV,nV,oV]),Xce=I.union([I.literal("developer"),I.literal("system"),I.literal("assistant"),I.literal("user"),I.literal("tool"),I.literal("activity"),I.literal("reasoning")]),aV=I.object({description:I.string(),value:I.string()}),iV=I.object({name:I.string(),description:I.string(),parameters:I.any()}),sV=I.object({threadId:I.string(),runId:I.string(),parentRunId:I.string().optional(),state:I.any(),messages:I.array(kw),tools:I.array(iV),context:I.array(aV),forwardedProps:I.any()}),cV=I.any(),et=class extends Error{constructor(e){super(e)}},ev=class extends et{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},Ow=I.union([I.literal("developer"),I.literal("system"),I.literal("assistant"),I.literal("user")]),D=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),je=I.object({type:I.nativeEnum(D),timestamp:I.number().optional(),rawEvent:I.any().optional()}).passthrough(),uV=je.extend({type:I.literal(D.TEXT_MESSAGE_START),messageId:I.string(),role:Ow.default("assistant")}),Nw=je.extend({type:I.literal(D.TEXT_MESSAGE_CONTENT),messageId:I.string(),delta:I.string().refine(e=>e.length>0,"Delta must not be an empty string")}),lV=je.extend({type:I.literal(D.TEXT_MESSAGE_END),messageId:I.string()}),dV=je.extend({type:I.literal(D.TEXT_MESSAGE_CHUNK),messageId:I.string().optional(),role:Ow.optional(),delta:I.string().optional()}),pV=je.extend({type:I.literal(D.THINKING_TEXT_MESSAGE_START)}),fV=Nw.omit({messageId:!0,type:!0}).extend({type:I.literal(D.THINKING_TEXT_MESSAGE_CONTENT)}),mV=je.extend({type:I.literal(D.THINKING_TEXT_MESSAGE_END)}),gV=je.extend({type:I.literal(D.TOOL_CALL_START),toolCallId:I.string(),toolCallName:I.string(),parentMessageId:I.string().optional()}),hV=je.extend({type:I.literal(D.TOOL_CALL_ARGS),toolCallId:I.string(),delta:I.string()}),yV=je.extend({type:I.literal(D.TOOL_CALL_END),toolCallId:I.string()}),SV=je.extend({messageId:I.string(),type:I.literal(D.TOOL_CALL_RESULT),toolCallId:I.string(),content:I.string(),role:I.literal("tool").optional()}),vV=je.extend({type:I.literal(D.TOOL_CALL_CHUNK),toolCallId:I.string().optional(),toolCallName:I.string().optional(),parentMessageId:I.string().optional(),delta:I.string().optional()}),xV=je.extend({type:I.literal(D.THINKING_START),title:I.string().optional()}),AV=je.extend({type:I.literal(D.THINKING_END)}),CV=je.extend({type:I.literal(D.STATE_SNAPSHOT),snapshot:cV}),bV=je.extend({type:I.literal(D.STATE_DELTA),delta:I.array(I.any())}),RV=je.extend({type:I.literal(D.MESSAGES_SNAPSHOT),messages:I.array(kw)}),wV=je.extend({type:I.literal(D.ACTIVITY_SNAPSHOT),messageId:I.string(),activityType:I.string(),content:I.record(I.any()),replace:I.boolean().optional().default(!0)}),FV=je.extend({type:I.literal(D.ACTIVITY_DELTA),messageId:I.string(),activityType:I.string(),patch:I.array(I.any())}),EV=je.extend({type:I.literal(D.RAW),event:I.any(),source:I.string().optional()}),IV=je.extend({type:I.literal(D.CUSTOM),name:I.string(),value:I.any()}),TV=je.extend({type:I.literal(D.RUN_STARTED),threadId:I.string(),runId:I.string(),parentRunId:I.string().optional(),input:sV.optional()}),PV=je.extend({type:I.literal(D.RUN_FINISHED),threadId:I.string(),runId:I.string(),result:I.any().optional()}),kV=je.extend({type:I.literal(D.RUN_ERROR),message:I.string(),code:I.string().optional()}),OV=je.extend({type:I.literal(D.STEP_STARTED),stepName:I.string()}),NV=je.extend({type:I.literal(D.STEP_FINISHED),stepName:I.string()}),_V=I.union([I.literal("tool-call"),I.literal("message")]),DV=je.extend({type:I.literal(D.REASONING_START),messageId:I.string()}),qV=je.extend({type:I.literal(D.REASONING_MESSAGE_START),messageId:I.string(),role:I.literal("reasoning")}),MV=je.extend({type:I.literal(D.REASONING_MESSAGE_CONTENT),messageId:I.string(),delta:I.string().refine(e=>e.length>0,"Delta must not be an empty string")}),jV=je.extend({type:I.literal(D.REASONING_MESSAGE_END),messageId:I.string()}),VV=je.extend({type:I.literal(D.REASONING_MESSAGE_CHUNK),messageId:I.string().optional(),delta:I.string().optional()}),LV=je.extend({type:I.literal(D.REASONING_END),messageId:I.string()}),UV=je.extend({type:I.literal(D.REASONING_ENCRYPTED_VALUE),subtype:_V,entityId:I.string(),encryptedValue:I.string()}),Yp=I.discriminatedUnion("type",[uV,Nw,lV,dV,xV,AV,pV,fV,mV,gV,hV,yV,vV,SV,CV,bV,RV,wV,FV,EV,IV,TV,PV,kV,OV,NV,DV,qV,MV,jV,VV,LV,UV]);d();c();l();u();var tv={};pu(tv,{JsonPatchError:()=>nt,_areEquals:()=>cl,applyOperation:()=>Ua,applyPatch:()=>No,applyReducer:()=>HV,deepClone:()=>GV,getValueByPointer:()=>tf,validate:()=>Dw,validator:()=>rf});d();c();l();u();d();c();l();u();var QV=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),BV=Object.prototype.hasOwnProperty;function Xp(e,t){return BV.call(e,t)}function Zp(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)Xp(e,o)&&n.push(o);return n}function Nt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function ef(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 nn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function il(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Jp(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Jp(e[t]))return!0}else if(typeof e=="object"){for(var n=Zp(e),o=n.length,a=0;a<o;a++)if(Jp(e[n[a]]))return!0}}return!1}function _w(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
32
+ `)}var sl=function(e){QV(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,_w(r,{name:n,index:o,operation:a,tree:i}))||this;return f.name=n,f.index=o,f.operation=a,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=_w(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var nt=sl,GV=Nt,Qs={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=tf(r,this.path);n&&(n=Nt(n));var o=Ua(r,{op:"remove",path:this.from}).removed;return Ua(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=tf(r,this.from);return Ua(r,{op:"add",path:this.path,value:Nt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:cl(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},$V={add:function(e,t,r){return ef(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:Qs.move,copy:Qs.copy,test:Qs.test,_get:Qs._get};function tf(e,t){if(t=="")return e;var r={op:"_get",path:t};return Ua(e,r),r.value}function Ua(e,t,r,n,o,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(t,0,e,t.path):rf(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=tf(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=cl(e,t.value),i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=Nt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,S=f.length,A=void 0,h=void 0,C=void 0;for(typeof r=="function"?C=r:C=rf;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=il(h)),o&&(h=="__proto__"||h=="prototype"&&g>0&&f[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&A===void 0&&(m[h]===void 0?A=f.slice(0,g).join("/"):g==S-1&&(A=t.path),A!==void 0&&C(t,0,e,A)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!ef(h))throw new nt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);ef(h)&&(h=~~h)}if(g>=S){if(r&&t.op==="add"&&h>m.length)throw new nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var i=$V[t.op].call(t,m,h,e);if(i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(g>=S){var i=Qs[t.op].call(t,m,h,e);if(i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[h],r&&g<S&&(!m||typeof m!="object"))throw new nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function No(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Nt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=Ua(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function HV(e,t,r){var n=Ua(e,t);if(n.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function rf(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Qs[e.op]){if(typeof e.path!="string")throw new nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new nt("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 nt("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 nt("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")&&Jp(e.value))throw new nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,a=n.split("/").length;if(o!==a+1&&o!==a)throw new nt("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 nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=Dw([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Dw(e,t,r){try{if(!Array.isArray(e))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)No(Nt(t),Nt(e),r||!0);else{r=r||rf;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof nt)return o;throw o}}function cl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,a,i;if(r&&n){if(a=e.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!cl(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=a;o--!==0;)if(i=p[o],!cl(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var av={};pu(av,{compare:()=>eL,generate:()=>rv,observe:()=>ZV,unobserve:()=>XV});d();c();l();u();var nv=new WeakMap,zV=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),WV=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function KV(e){return nv.get(e)}function YV(e,t){return e.observers.get(t)}function JV(e,t){e.observers.delete(t.callback)}function XV(e,t){t.unobserve()}function ZV(e,t){var r=[],n,o=KV(e);if(!o)o=new zV(e),nv.set(e,o);else{var a=YV(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=Nt(e),t){n.callback=t,n.next=null;var i=function(){rv(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){rv(n),clearTimeout(n.next),JV(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new WV(t,n)),n}function rv(e,t){t===void 0&&(t=!1);var r=nv.get(e.object);ov(r.value,e.object,e.patches,"",t),e.patches.length&&No(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function ov(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Zp(t),i=Zp(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],S=e[g];if(Xp(t,g)&&!(t[g]===void 0&&S!==void 0&&Array.isArray(t)===!1)){var A=t[g];typeof S=="object"&&S!=null&&typeof A=="object"&&A!=null&&Array.isArray(S)===Array.isArray(A)?ov(S,A,r,n+"/"+nn(g),o):S!==A&&(p=!0,o&&r.push({op:"test",path:n+"/"+nn(g),value:Nt(S)}),r.push({op:"replace",path:n+"/"+nn(g),value:Nt(A)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+nn(g),value:Nt(S)}),r.push({op:"remove",path:n+"/"+nn(g)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&a.length==i.length))for(var m=0;m<a.length;m++){var g=a[m];!Xp(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+nn(g),value:Nt(t[g])})}}}function eL(e,t,r){r===void 0&&(r=!1);var n=[];return ov(e,t,n,"",r),n}var bue=Object.assign({},tv,av,{JsonPatchError:sl,deepClone:Nt,escapePathComponent:nn,unescapePathComponent:il});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var iv=function(e,t){return iv=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])},iv(e,t)};function on(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");iv(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function qw(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function nf(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function Hn(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 Bs(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)a.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Gs(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Qa(e){return this instanceof Qa?(this.v=e,this):new Qa(e)}function Mw(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(h){return function(C){return Promise.resolve(C).then(h,S)}}function p(h,C){n[h]&&(o[h]=function(w){return new Promise(function(R,b){a.push([h,w,R,b])>1||f(h,w)})},C&&(o[h]=C(o[h])))}function f(h,C){try{m(n[h](C))}catch(w){A(a[0][3],w)}}function m(h){h.value instanceof Qa?Promise.resolve(h.value.v).then(g,S):A(a[0][2],h)}function g(h){f("next",h)}function S(h){f("throw",h)}function A(h,C){h(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function jw(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 Hn=="function"?Hn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(p,f){i=e[a](i),o(p,f,i.done,i.value)})}}function o(a,i,p,f){Promise.resolve(f).then(function(m){a({value:m,done:p})},i)}}d();c();l();u();function Pe(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function $s(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 of=$s(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
33
+ `+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
34
+ `):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function ul(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Hs=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=Hn(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(w){t={error:w}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var g=this.initialTeardown;if(Pe(g))try{g()}catch(w){a=w instanceof of?w.errors:[w]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var A=Hn(S),h=A.next();!h.done;h=A.next()){var C=h.value;try{Vw(C)}catch(w){a=a??[],w instanceof of?a=Gs(Gs([],Bs(a)),Bs(w.errors)):a.push(w)}}}catch(w){n={error:w}}finally{try{h&&!h.done&&(o=A.return)&&o.call(A)}finally{if(n)throw n.error}}}if(a)throw new of(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Vw(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)&&ul(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ul(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var sv=Hs.EMPTY;function af(e){return e instanceof Hs||e&&"closed"in e&&Pe(e.remove)&&Pe(e.add)&&Pe(e.unsubscribe)}function Vw(e){Pe(e)?e():e.unsubscribe()}d();c();l();u();var Mr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var zs={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=zs.delegate;return o?.setTimeout?o.setTimeout.apply(o,Gs([e,t],Bs(r))):setTimeout.apply(void 0,Gs([e,t],Bs(r)))},clearTimeout:function(e){var t=zs.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function sf(e){zs.setTimeout(function(){var t=Mr.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function ll(){}d();c();l();u();var Lw=function(){return cv("C",void 0,void 0)}();function Uw(e){return cv("E",void 0,e)}function Qw(e){return cv("N",e,void 0)}function cv(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var Ba=null;function Ws(e){if(Mr.useDeprecatedSynchronousErrorHandling){var t=!Ba;if(t&&(Ba={errorThrown:!1,error:null}),e(),t){var r=Ba,n=r.errorThrown,o=r.error;if(Ba=null,n)throw o}}else e()}function Bw(e){Mr.useDeprecatedSynchronousErrorHandling&&Ba&&(Ba.errorThrown=!0,Ba.error=e)}var dl=function(e){on(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,af(r)&&r.add(n)):n.destination=aL,n}return t.create=function(r,n,o){return new uf(r,n,o)},t.prototype.next=function(r){this.isStopped?lv(Qw(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?lv(Uw(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?lv(Lw,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}(Hs);var rL=Function.prototype.bind;function uv(e,t){return rL.call(e,t)}var nL=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){cf(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){cf(n)}else cf(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){cf(r)}},e}(),uf=function(e){on(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(Pe(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&Mr.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&uv(r.next,p),error:r.error&&uv(r.error,p),complete:r.complete&&uv(r.complete,p)}):i=r}return a.destination=new nL(i),a}return t}(dl);function cf(e){Mr.useDeprecatedSynchronousErrorHandling?Bw(e):sf(e)}function oL(e){throw e}function lv(e,t){var r=Mr.onStoppedNotification;r&&zs.setTimeout(function(){return r(e,t)})}var aL={closed:!0,next:ll,error:oL,complete:ll};d();c();l();u();var Ks=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function Ys(e){return e}function lf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dv(e)}function dv(e){return e.length===0?Ys:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var We=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=sL(t)?t:new uf(t,r,n);return Ws(function(){var i=o,p=i.operator,f=i.source;a.add(p?p.call(a,f):f?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=Gw(r),new r(function(o,a){var i=new uf({next:function(p){try{t(p)}catch(f){a(f),i.unsubscribe()}},error:a,complete:o});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Ks]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return dv(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Gw(t),new t(function(n,o){var a;r.subscribe(function(i){return a=i},function(i){return o(i)},function(){return n(a)})})},e.create=function(t){return new e(t)},e}();function Gw(e){var t;return(t=e??Mr.Promise)!==null&&t!==void 0?t:Promise}function iL(e){return e&&Pe(e.next)&&Pe(e.error)&&Pe(e.complete)}function sL(e){return e&&e instanceof dl||iL(e)&&af(e)}d();c();l();u();function cL(e){return Pe(e?.lift)}function ft(e){return function(t){if(cL(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function yt(e,t,r,n,o){return new uL(e,t,r,n,o)}var uL=function(e){on(t,e);function t(r,n,o,a,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(g){r.error(g)}}:e.prototype._next,f._error=a?function(m){try{a(m)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(dl);d();c();l();u();d();c();l();u();var $w=$s(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var an=function(e){on(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 Hw(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new $w},t.prototype.next=function(r){var n=this;Ws(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=Hn(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Ws(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;Ws(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,i=o.isStopped,p=o.observers;return a||i?sv:(this.currentObservers=null,p.push(r),new Hs(function(){n.currentObservers=null,ul(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,i=n.isStopped;o?r.error(a):i&&r.complete()},t.prototype.asObservable=function(){var r=new We;return r.source=this,r},t.create=function(r,n){return new Hw(r,n)},t}(We);var Hw=function(e){on(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:sv},t}(an);d();c();l();u();d();c();l();u();var pv={now:function(){return(pv.delegate||Date).now()},delegate:void 0};var df=function(e){on(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=pv);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(a.push(r),!i&&a.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,i=o._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=a?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<a.length&&a.splice(0,a.length-p),!i){for(var f=o.now(),m=0,g=1;g<a.length&&a[g]<=f;g+=2)m=g;m&&a.splice(0,m+1)}},t}(an);d();c();l();u();var pf=new We(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function zw(e){return e&&Pe(e.schedule)}function lL(e){return e[e.length-1]}function Ww(e){return zw(lL(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ff=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function mf(e){return Pe(e?.then)}d();c();l();u();function gf(e){return Pe(e[Ks])}d();c();l();u();function hf(e){return Symbol.asyncIterator&&Pe(e?.[Symbol.asyncIterator])}d();c();l();u();function yf(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function dL(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Sf=dL();function vf(e){return Pe(e?.[Sf])}d();c();l();u();function xf(e){return Mw(this,arguments,function(){var r,n,o,a;return nf(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,Qa(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,Qa(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,Qa(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Af(e){return Pe(e?.getReader)}function St(e){if(e instanceof We)return e;if(e!=null){if(gf(e))return pL(e);if(ff(e))return fL(e);if(mf(e))return mL(e);if(hf(e))return Kw(e);if(vf(e))return gL(e);if(Af(e))return hL(e)}throw yf(e)}function pL(e){return new We(function(t){var r=e[Ks]();if(Pe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function fL(e){return new We(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function mL(e){return new We(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,sf)})}function gL(e){return new We(function(t){var r,n;try{for(var o=Hn(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function Kw(e){return new We(function(t){yL(e,t).catch(function(r){return t.error(r)})})}function hL(e){return Kw(xf(e))}function yL(e,t){var r,n,o,a;return qw(this,void 0,void 0,function(){var i,p;return nf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=jw(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function br(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function Cf(e,t){return t===void 0&&(t=0),ft(function(r,n){r.subscribe(yt(n,function(o){return br(n,e,function(){return n.next(o)},t)},function(){return br(n,e,function(){return n.complete()},t)},function(o){return br(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function bf(e,t){return t===void 0&&(t=0),ft(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function Yw(e,t){return St(e).pipe(bf(t),Cf(t))}d();c();l();u();function Jw(e,t){return St(e).pipe(bf(t),Cf(t))}d();c();l();u();function Xw(e,t){return new We(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function Zw(e,t){return new We(function(r){var n;return br(r,t,function(){n=e[Sf](),br(r,t,function(){var o,a,i;try{o=n.next(),a=o.value,i=o.done}catch(p){r.error(p);return}i?r.complete():r.next(a)},0,!0)}),function(){return Pe(n?.return)&&n.return()}})}d();c();l();u();function Rf(e,t){if(!e)throw new Error("Iterable cannot be null");return new We(function(r){br(r,t,function(){var n=e[Symbol.asyncIterator]();br(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function eF(e,t){return Rf(xf(e),t)}function tF(e,t){if(e!=null){if(gf(e))return Yw(e,t);if(ff(e))return Xw(e,t);if(mf(e))return Jw(e,t);if(hf(e))return Rf(e,t);if(vf(e))return Zw(e,t);if(Af(e))return eF(e,t)}throw yf(e)}function Ga(e,t){return t?tF(e,t):St(e)}function tt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Ww(e);return Ga(e,r)}d();c();l();u();function Ke(e,t){var r=Pe(e)?e:function(){return e},n=function(o){return o.error(r())};return new We(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var rF=$s(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function wf(e,t){var r=typeof t=="object";return new Promise(function(n,o){var a=!1,i;e.subscribe({next:function(p){i=p,a=!0},error:o,complete:function(){a?n(i):r?n(t.defaultValue):o(new rF)}})})}d();c();l();u();function $a(e,t){return ft(function(r,n){var o=0;r.subscribe(yt(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function nF(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,S=!1,A=function(){S&&!f.length&&!m&&t.complete()},h=function(w){return m<n?C(w):f.push(w)},C=function(w){a&&t.next(w),m++;var R=!1;St(r(w,g++)).subscribe(yt(t,function(b){o?.(b),a?h(b):t.next(b)},function(){R=!0},void 0,function(){if(R)try{m--;for(var b=function(){var F=f.shift();i?br(t,i,function(){return C(F)}):C(F)};f.length&&m<n;)b();A()}catch(F){t.error(F)}}))};return e.subscribe(yt(t,h,function(){S=!0,A()})),function(){p?.()}}function Zt(e,t,r){return r===void 0&&(r=1/0),Pe(t)?Zt(function(n,o){return $a(function(a,i){return t(n,a,o,i)})(St(e(n,o)))},r):(typeof t=="number"&&(r=t),ft(function(n,o){return nF(n,o,e,r)}))}function fv(e){return e===void 0&&(e=1/0),Zt(Ys,e)}d();c();l();u();function mv(e){return new We(function(t){St(e()).subscribe(t)})}d();c();l();u();function pl(e){return ft(function(t,r){var n=null,o=!1,a;n=t.subscribe(yt(r,void 0,void 0,function(i){a=St(e(i,pl(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();l();u();function Ff(e,t){return Pe(t)?Zt(e,t,1):Zt(e,1)}d();c();l();u();function gv(e){return ft(function(t,r){var n=!1;t.subscribe(yt(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function Ha(e){return ft(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function hv(e,t){return ft(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(yt(n,function(f){o?.unsubscribe();var m=0,g=a++;St(e(f,g)).subscribe(o=yt(n,function(S){return n.next(t?t(f,S,g,m++):S)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function Ef(e){return ft(function(t,r){St(e).subscribe(yt(r,function(){return r.complete()},ll)),!r.closed&&t.subscribe(r)})}d();c();l();u();function yv(e,t,r){var n=Pe(e)||t||r?{next:e,error:t,complete:r}:e;return n?ft(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(yt(a,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),a.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),a.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),a.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):Ys}d();c();l();u();d();c();l();u();function oF(e){return` \r
35
+ `.indexOf(e)>=0}function If(e){for(var t=["topLevel"],r=0,n,o,a,i=function(F){return t.push(F)},p=function(F){return t[t.length-1]=F},f=function(F){n==null&&(n=r,o=t.length,a=F)},m=function(F){F===a&&(n=void 0,o=void 0,a=void 0)},g=function(){return t.pop()},S=function(){return r--},A=function(F){if("0"<=F&&F<="9"){i("number");return}switch(F){case"\"":i("string");return;case"-":i("numberNeedsDigit");return;case"t":i("true");return;case"f":i("false");return;case"n":i("null");return;case"[":i("arrayNeedsValue");return;case"{":i("objectNeedsKey");return}},h=e.length;r<h;r++){var C=e[r];switch(t[t.length-1]){case"topLevel":A(C);break;case"string":switch(C){case"\"":g();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":C==="u"?i("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":C==="."?p("numberNeedsDigit"):C==="e"||C==="E"?p("numberNeedsExponent"):(C<"0"||C>"9")&&(S(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(C==="+"||C==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(C<"a"||C>"z")&&(S(),g());break;case"arrayNeedsValue":C==="]"?g():oF(C)||(m("collectionItem"),p("arrayNeedsComma"),A(C));break;case"arrayNeedsComma":C==="]"?g():C===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":C==="}"?g():C==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":C===":"&&p("objectNeedsValue");break;case"objectNeedsValue":oF(C)||(m("collectionItem"),p("objectNeedsComma"),A(C));break;case"objectNeedsComma":C==="}"?g():C===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var w=[n!=null?e.slice(0,n):e],R=function(F){return w.push(F.slice(e.length-e.lastIndexOf(F[0])))},b=t.length-1;b>=0;b--)switch(t[b]){case"string":w.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":w.push("0");break;case"true":R("true");break;case"false":R("false");break;case"null":R("null");break;case"arrayNeedsValue":case"arrayNeedsComma":w.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":w.push("}");break}return w.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function iF(){let e=0,t=0;for(let n=0;n<28;n+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Pf(e,t,r){for(let a=0;a<28;a=a+7){let i=e>>>a,p=!(!(i>>>7)&&t==0),f=(p?i|128:i)&255;if(r.push(f),!p)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let a=3;a<31;a=a+7){let i=t>>>a,p=!!(i>>>7),f=(p?i|128:i)&255;if(r.push(f),!p)return}r.push(t>>>31&1)}}var Tf=4294967296;function Sv(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function a(i,p){let f=Number(e.slice(i,p));o*=r,n=n*r+f,n>=Tf&&(o=o+(n/Tf|0),n=n%Tf)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?cF(n,o):xv(n,o)}function sF(e,t){let r=xv(e,t),n=r.hi&2147483648;n&&(r=cF(r.lo,r.hi));let o=vv(r.lo,r.hi);return n?"-"+o:o}function vv(e,t){if({lo:e,hi:t}=SL(e,t),t<=2097151)return String(Tf*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,a=r+n*6777216+o*6710656,i=n+o*8147497,p=o*2,f=1e7;return a>=f&&(i+=Math.floor(a/f),a%=f),i>=f&&(p+=Math.floor(i/f),i%=f),p.toString()+aF(i)+aF(a)}function SL(e,t){return{lo:e>>>0,hi:t>>>0}}function xv(e,t){return{lo:e|0,hi:t|0}}function cF(e,t){return t=~t,e?e=~e+1:t+=1,xv(e,t)}var aF=e=>{let t=String(e);return"0000000".slice(t.length)+t};function Av(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function uF(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var jr=vL();function vL(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!y.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>n||p<r)throw new Error(`invalid int64: ${i}`);return p},uParse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>a||p<o)throw new Error(`invalid uint64: ${i}`);return p},enc(i){return e.setBigInt64(0,this.parse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(i){return e.setBigInt64(0,this.uParse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),lF(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),dF(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),lF(r),Sv(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),dF(r),Sv(r)},dec(r,n){return sF(r,n)},uDec(r,n){return vv(r,n)}}}function lF(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function dF(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var Cv=Symbol.for("@bufbuild/protobuf/text-encoding");function bv(){if(y[Cv]==null){let e=new y.TextEncoder,t=new y.TextDecoder;y[Cv]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return y[Cv]}var _o;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(_o||(_o={}));var xL=34028234663852886e22,AL=-34028234663852886e22,CL=4294967295,bL=2147483647,RL=-2147483648,Ve=class{constructor(t=bv().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let o=0;o<this.chunks.length;o++)t+=this.chunks[o].length;let r=new Uint8Array(t),n=0;for(let o=0;o<this.chunks.length;o++)r.set(this.chunks[o],n),n+=this.chunks[o].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(pF(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Rv(t),Av(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){wL(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){pF(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){Rv(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return Rv(t),t=(t<<1^t>>31)>>>0,Av(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=jr.enc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=jr.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=jr.enc(t);return Pf(r.lo,r.hi,this.buf),this}sint64(t){let r=jr.enc(t),n=r.hi>>31,o=r.lo<<1^n,a=(r.hi<<1|r.lo>>>31)^n;return Pf(o,a,this.buf),this}uint64(t){let r=jr.uEnc(t);return Pf(r.lo,r.hi,this.buf),this}},me=class{constructor(t,r=bv().decodeUtf8){this.decodeUtf8=r,this.varint64=iF,this.uint32=uF,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case _o.Varint:for(;this.buf[this.pos++]&128;);break;case _o.Bit64:this.pos+=4;case _o.Bit32:this.pos+=4;break;case _o.LengthDelimited:let o=this.uint32();this.pos+=o;break;case _o.StartGroup:for(;;){let[a,i]=this.tag();if(i===_o.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(i,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return jr.dec(...this.varint64())}uint64(){return jr.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,jr.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return jr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return jr.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}};function Rv(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>bL||e<RL)throw new Error("invalid int32: "+e)}function pF(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>CL||e<0)throw new Error("invalid uint32: "+e)}function wL(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>xL||e<AL))throw new Error("invalid float32: "+e)}var FL=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function wv(){return{fields:{}}}var fl={encode(e,t=new Ve){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&Iv.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=wv();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=Iv.decode(r,r.uint32());i.value!==void 0&&(o.fields[i.key]=i.value);continue}}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return fl.fromPartial(e??{})},fromPartial(e){let t=wv();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=wv();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function fF(){return{key:"",value:void 0}}var Iv={encode(e,t=new Ve){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=fF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.key=r.string();continue;case 2:if(a!==18)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Iv.fromPartial(e??{})},fromPartial(e){let t=fF();return t.key=e.key??"",t.value=e.value??void 0,t}};function Fv(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var qe={encode(e,t=new Ve){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&fl.encode(fl.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&ml.encode(ml.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Fv();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.nullValue=r.int32();continue;case 2:if(a!==17)break;o.numberValue=r.double();continue;case 3:if(a!==26)break;o.stringValue=r.string();continue;case 4:if(a!==32)break;o.boolValue=r.bool();continue;case 5:if(a!==42)break;o.structValue=fl.unwrap(fl.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=ml.unwrap(ml.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qe.fromPartial(e??{})},fromPartial(e){let t=Fv();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=Fv();if(e===null)t.nullValue=FL.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(y.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new y.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Ev(){return{values:[]}}var ml={encode(e,t=new Ve){for(let r of e.values)qe.encode(qe.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Ev();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.values.push(qe.unwrap(qe.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ml.fromPartial(e??{})},fromPartial(e){let t=Ev();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=Ev();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},EL=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function mF(){return{op:0,path:"",from:void 0,value:void 0}}var kf={encode(e,t=new Ve){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=mF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.op=r.int32();continue;case 2:if(a!==18)break;o.path=r.string();continue;case 3:if(a!==26)break;o.from=r.string();continue;case 4:if(a!==34)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return kf.fromPartial(e??{})},fromPartial(e){let t=mF();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function gF(){return{id:"",type:"",function:void 0}}var Of={encode(e,t=new Ve){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&Nf.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=gF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.type=r.string();continue;case 3:if(a!==26)break;o.function=Nf.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Of.fromPartial(e??{})},fromPartial(e){let t=gF();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?Nf.fromPartial(e.function):void 0,t}};function hF(){return{name:"",arguments:""}}var Nf={encode(e,t=new Ve){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=hF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.name=r.string();continue;case 2:if(a!==18)break;o.arguments=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Nf.fromPartial(e??{})},fromPartial(e){let t=hF();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function yF(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var _f={encode(e,t=new Ve){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)Of.encode(r,t.uint32(42).fork()).join();return e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=yF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.role=r.string();continue;case 3:if(a!==26)break;o.content=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue;case 5:if(a!==42)break;o.toolCalls.push(Of.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.toolCallId=r.string();continue;case 7:if(a!==58)break;o.error=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return _f.fromPartial(e??{})},fromPartial(e){let t=yF();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>Of.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},IL=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function SF(){return{type:0,timestamp:void 0,rawEvent:void 0}}var ye={encode(e,t=new Ve){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&qe.encode(qe.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=SF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.type=r.int32();continue;case 2:if(a!==16)break;o.timestamp=TL(r.int64());continue;case 3:if(a!==26)break;o.rawEvent=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ye.fromPartial(e??{})},fromPartial(e){let t=SF();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function vF(){return{baseEvent:void 0,messageId:"",role:void 0}}var Df={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=vF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Df.fromPartial(e??{})},fromPartial(e){let t=vF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function xF(){return{baseEvent:void 0,messageId:"",delta:""}}var qf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=xF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qf.fromPartial(e??{})},fromPartial(e){let t=xF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function AF(){return{baseEvent:void 0,messageId:""}}var Mf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=AF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Mf.fromPartial(e??{})},fromPartial(e){let t=AF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function CF(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var jf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=CF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return jf.fromPartial(e??{})},fromPartial(e){let t=CF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function bF(){return{baseEvent:void 0,toolCallId:"",delta:""}}var Vf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=bF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Vf.fromPartial(e??{})},fromPartial(e){let t=bF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function RF(){return{baseEvent:void 0,toolCallId:""}}var Lf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=RF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Lf.fromPartial(e??{})},fromPartial(e){let t=RF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function wF(){return{baseEvent:void 0,snapshot:void 0}}var Uf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&qe.encode(qe.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=wF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.snapshot=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Uf.fromPartial(e??{})},fromPartial(e){let t=wF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function FF(){return{baseEvent:void 0,delta:[]}}var Qf={encode(e,t=new Ve){e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)kf.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=FF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(kf.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Qf.fromPartial(e??{})},fromPartial(e){let t=FF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>kf.fromPartial(r))||[],t}};function EF(){return{baseEvent:void 0,messages:[]}}var Bf={encode(e,t=new Ve){e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)_f.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=EF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(_f.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Bf.fromPartial(e??{})},fromPartial(e){let t=EF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>_f.fromPartial(r))||[],t}};function IF(){return{baseEvent:void 0,event:void 0,source:void 0}}var Gf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&qe.encode(qe.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=IF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.event=qe.unwrap(qe.decode(r,r.uint32()));continue;case 3:if(a!==26)break;o.source=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Gf.fromPartial(e??{})},fromPartial(e){let t=IF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function TF(){return{baseEvent:void 0,name:"",value:void 0}}var $f={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=TF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.name=r.string();continue;case 3:if(a!==26)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return $f.fromPartial(e??{})},fromPartial(e){let t=TF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function PF(){return{baseEvent:void 0,threadId:"",runId:""}}var Hf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=PF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Hf.fromPartial(e??{})},fromPartial(e){let t=PF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function kF(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var zf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&qe.encode(qe.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=kF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue;case 4:if(a!==34)break;o.result=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return zf.fromPartial(e??{})},fromPartial(e){let t=kF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function OF(){return{baseEvent:void 0,code:void 0,message:""}}var Wf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=OF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.code=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Wf.fromPartial(e??{})},fromPartial(e){let t=OF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function NF(){return{baseEvent:void 0,stepName:""}}var Kf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=NF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Kf.fromPartial(e??{})},fromPartial(e){let t=NF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function _F(){return{baseEvent:void 0,stepName:""}}var Yf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=_F();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Yf.fromPartial(e??{})},fromPartial(e){let t=_F();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function DF(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var Jf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=DF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Jf.fromPartial(e??{})},fromPartial(e){let t=DF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function qF(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Xf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=qF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue;case 5:if(a!==42)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Xf.fromPartial(e??{})},fromPartial(e){let t=qF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function MF(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var jF={encode(e,t=new Ve){return e.textMessageStart!==void 0&&Df.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&qf.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Mf.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&jf.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Vf.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Lf.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Uf.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Qf.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Bf.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Gf.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&$f.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Hf.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&zf.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Wf.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Kf.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Yf.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Jf.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Xf.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=MF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.textMessageStart=Df.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.textMessageContent=qf.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=Mf.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=jf.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=Vf.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=Lf.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=Uf.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=Qf.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=Bf.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=Gf.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=$f.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Hf.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=zf.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=Wf.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=Kf.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=Yf.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=Jf.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=Xf.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return jF.fromPartial(e??{})},fromPartial(e){let t=MF();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Df.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?qf.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Mf.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?jf.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Vf.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Lf.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Uf.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Qf.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Bf.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Gf.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?$f.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Hf.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?zf.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Wf.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Kf.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Yf.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Jf.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Xf.fromPartial(e.toolCallChunk):void 0,t}};function TL(e){let t=y.Number(e.toString());if(t>y.Number.MAX_SAFE_INTEGER)throw new y.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<y.Number.MIN_SAFE_INTEGER)throw new y.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function VF(e){let t=jF.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=IL[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===D.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===D.STATE_DELTA)for(let n of r.delta)n.op=EL[n.op].toLowerCase(),Object.keys(n).forEach(o=>{n[o]===void 0&&delete n[o]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),Yp.parse(r)}var LF="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var kL=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Tv=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(kL);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},UF=e=>e==="*"||e==="x"||e==="X",QF=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},OL=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],NL=(e,t)=>{if(UF(e)||UF(t))return 0;let[r,n]=OL(QF(e),QF(t));return r>n?1:r<n?-1:0},Pv=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=NL(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var Zf=(e,t)=>{let r=Tv(e),n=Tv(t),o=r.pop(),a=n.pop(),i=Pv(r,n);return i!==0?i:o&&a?Pv(o.split("."),a.split(".")):o||a?o?-1:1:0};var Ge=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function gl(){return Io()}function Qe(_x136,_x137,_x138,_x139){return _Qe.apply(this,arguments)}function _Qe(){_Qe=_asyncToGenerator(function*(e,t,r,n){let o=t,a=r,i;for(let p of e)try{let f=yield n(p,Ge(o),Ge(a));if(f===void 0)continue;if(f.messages!==void 0&&(o=f.messages),f.state!==void 0&&(a=f.state),i=f.stopPropagation,i===!0)break}catch(f){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",f);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(a)===JSON.stringify(r)?{}:{state:a}),...(i===void 0?{}:{stopPropagation:i})}});return _Qe.apply(this,arguments)}var WF=(e,t,r,n)=>{let o=Ge(r.messages),a=Ge(e.state),i={},p=m=>{m.messages!==void 0&&(o=m.messages,i.messages=m.messages),m.state!==void 0&&(a=m.state,i.state=m.state)},f=()=>{let m=Ge(i);return i={},m.messages!==void 0||m.state!==void 0?tt(m):pf};return t.pipe(Ff(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(m){let g=yield Qe(n,o,a,(S,A,h)=>S.onEvent?.({event:m,agent:r,input:e,messages:A,state:h}));if(p(g),g.stopPropagation===!0)return f();switch(m.type){case D.TEXT_MESSAGE_START:{let S=yield Qe(n,o,a,(A,h,C)=>A.onTextMessageStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:A,role:h="assistant"}=m;if(!o.find(C=>C.id===A)){let C={id:A,role:h,content:""};o.push(C),p({messages:o})}}return f()}case D.TEXT_MESSAGE_CONTENT:{let{messageId:S,delta:A}=m,h=o.find(w=>w.id===S);if(!h)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${S}'`),f();let C=yield Qe(n,o,a,(w,R,b)=>w.onTextMessageContentEvent?.({event:m,messages:R,state:b,agent:r,input:e,textMessageBuffer:typeof h.content=="string"?h.content:""}));return p(C),C.stopPropagation!==!0&&(h.content=`${typeof h.content=="string"?h.content:""}${A}`,p({messages:o})),f()}case D.TEXT_MESSAGE_END:{let{messageId:S}=m,A=o.find(h=>h.id===S);return A?(p(yield Qe(n,o,a,(h,C,w)=>h.onTextMessageEndEvent?.({event:m,messages:C,state:w,agent:r,input:e,textMessageBuffer:typeof A.content=="string"?A.content:""}))),yield Promise.all(n.map(h=>{h.onNewMessage?.({message:A,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${S}'`),f())}case D.TOOL_CALL_START:{let S=yield Qe(n,o,a,(A,h,C)=>A.onToolCallStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{toolCallId:A,toolCallName:h,parentMessageId:C}=m,w;C&&o.length>0&&o[o.length-1].id===C?w=o[o.length-1]:(w={id:C||A,role:"assistant",toolCalls:[]},o.push(w)),w.toolCalls??(w.toolCalls=[]),w.toolCalls.push({id:A,type:"function",function:{name:h,arguments:""}}),p({messages:o})}return f()}case D.TOOL_CALL_ARGS:{let{toolCallId:S,delta:A}=m,h=o.find(R=>R.toolCalls?.some(b=>b.id===S));if(!h)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${S}'`),f();let C=h.toolCalls?.find(R=>R.id===S);if(!C)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${S}'`),f();let w=yield Qe(n,o,a,(R,b,F)=>{let E=C.function.arguments,P=C.function.name,M={};try{M=If(E)}catch{}return R.onToolCallArgsEvent?.({event:m,messages:b,state:F,agent:r,input:e,toolCallBuffer:E,toolCallName:P,partialToolCallArgs:M})});return p(w),w.stopPropagation!==!0&&(C.function.arguments+=A,p({messages:o})),f()}case D.TOOL_CALL_END:{let{toolCallId:S}=m,A=o.find(C=>C.toolCalls?.some(w=>w.id===S));if(!A)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${S}'`),f();let h=A.toolCalls?.find(C=>C.id===S);return h?(p(yield Qe(n,o,a,(C,w,R)=>{let b=h.function.arguments,F=h.function.name,E={};try{E=JSON.parse(b)}catch{}return C.onToolCallEndEvent?.({event:m,messages:w,state:R,agent:r,input:e,toolCallName:F,toolCallArgs:E})})),yield Promise.all(n.map(C=>{C.onNewToolCall?.({toolCall:h,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${S}'`),f())}case D.TOOL_CALL_RESULT:{let S=yield Qe(n,o,a,(A,h,C)=>A.onToolCallResultEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:A,toolCallId:h,content:C,role:w}=m,R={id:A,toolCallId:h,role:w||"tool",content:C};o.push(R),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:R,messages:o,state:a,agent:r,input:e})})),p({messages:o})}return f()}case D.STATE_SNAPSHOT:{let S=yield Qe(n,o,a,(A,h,C)=>A.onStateSnapshotEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{snapshot:A}=m;a=A,p({state:a})}return f()}case D.STATE_DELTA:{let S=yield Qe(n,o,a,(A,h,C)=>A.onStateDeltaEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{delta:A}=m;try{a=No(a,A,!0,!1).newDocument,p({state:a})}catch(h){let C=h instanceof Error?h.message:String(h);console.warn(`Failed to apply state patch:
36
+ Current state: ${JSON.stringify(a,null,2)}
37
+ Patch operations: ${JSON.stringify(A,null,2)}
38
+ Error: ${C}`)}}return f()}case D.MESSAGES_SNAPSHOT:{let S=yield Qe(n,o,a,(A,h,C)=>A.onMessagesSnapshotEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messages:A}=m;o=A,p({messages:o})}return f()}case D.ACTIVITY_SNAPSHOT:{let S=m,A=o.findIndex(b=>b.id===S.messageId),h=A>=0?o[A]:void 0,C=h?.role==="activity"?h:void 0,w=S.replace??!0,R=yield Qe(n,o,a,(b,F,E)=>b.onActivitySnapshotEvent?.({event:S,messages:F,state:E,agent:r,input:e,activityMessage:C,existingMessage:h}));if(p(R),R.stopPropagation!==!0){let b={id:S.messageId,role:"activity",activityType:S.activityType,content:Ge(S.content)},F;A===-1?(o.push(b),F=b):C?w&&(o[A]={...C,activityType:S.activityType,content:Ge(S.content)}):w&&(o[A]=b,F=b),p({messages:o}),F&&(yield Promise.all(n.map(E=>E.onNewMessage?.({message:F,messages:o,state:a,agent:r,input:e}))))}return f()}case D.ACTIVITY_DELTA:{let S=m,A=o.findIndex(R=>R.id===S.messageId);if(A===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${S.messageId}' to apply patch`),f();let h=o[A];if(h.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${S.messageId}' is not an activity message`),f();let C=h,w=yield Qe(n,o,a,(R,b,F)=>R.onActivityDeltaEvent?.({event:S,messages:b,state:F,agent:r,input:e,activityMessage:C}));if(p(w),w.stopPropagation!==!0)try{let R=Ge(C.content??{}),b=No(R,S.patch??[],!0,!1).newDocument;o[A]={...C,content:Ge(b),activityType:S.activityType},p({messages:o})}catch(R){let b=R instanceof Error?R.message:String(R);console.warn(`Failed to apply activity patch for '${S.messageId}': ${b}`)}return f()}case D.RAW:return p(yield Qe(n,o,a,(S,A,h)=>S.onRawEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.CUSTOM:return p(yield Qe(n,o,a,(S,A,h)=>S.onCustomEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.RUN_STARTED:{let S=yield Qe(n,o,a,(A,h,C)=>A.onRunStartedEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let A=m;if(A.input?.messages){for(let h of A.input.messages)o.find(C=>C.id===h.id)||o.push(h);p({messages:o})}}return f()}case D.RUN_FINISHED:return p(yield Qe(n,o,a,(S,A,h)=>S.onRunFinishedEvent?.({event:m,messages:A,state:h,agent:r,input:e,result:m.result}))),f();case D.RUN_ERROR:return p(yield Qe(n,o,a,(S,A,h)=>S.onRunErrorEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.STEP_STARTED:return p(yield Qe(n,o,a,(S,A,h)=>S.onStepStartedEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.STEP_FINISHED:return p(yield Qe(n,o,a,(S,A,h)=>S.onStepFinishedEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case D.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case D.THINKING_START:return f();case D.THINKING_END:return f();case D.THINKING_TEXT_MESSAGE_START:return f();case D.THINKING_TEXT_MESSAGE_CONTENT:return f();case D.THINKING_TEXT_MESSAGE_END:return f();case D.REASONING_START:return p(yield Qe(n,o,a,(S,A,h)=>S.onReasoningStartEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.REASONING_MESSAGE_START:{let S=yield Qe(n,o,a,(A,h,C)=>A.onReasoningMessageStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:A}=m;if(!o.find(h=>h.id===A)){let h={id:A,role:"reasoning",content:""};o.push(h),p({messages:o})}}return f()}case D.REASONING_MESSAGE_CONTENT:{let{messageId:S,delta:A}=m,h=o.find(w=>w.id===S);if(!h)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${S}'`),f();let C=yield Qe(n,o,a,(w,R,b)=>w.onReasoningMessageContentEvent?.({event:m,messages:R,state:b,agent:r,input:e,reasoningMessageBuffer:typeof h.content=="string"?h.content:""}));return p(C),C.stopPropagation!==!0&&(h.content=`${typeof h.content=="string"?h.content:""}${A}`,p({messages:o})),f()}case D.REASONING_MESSAGE_END:{let{messageId:S}=m,A=o.find(h=>h.id===S);return A?(p(yield Qe(n,o,a,(h,C,w)=>h.onReasoningMessageEndEvent?.({event:m,messages:C,state:w,agent:r,input:e,reasoningMessageBuffer:typeof A.content=="string"?A.content:""}))),yield Promise.all(n.map(h=>{h.onNewMessage?.({message:A,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${S}'`),f())}case D.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case D.REASONING_END:return p(yield Qe(n,o,a,(S,A,h)=>S.onReasoningEndEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.REASONING_ENCRYPTED_VALUE:{let{subtype:S,entityId:A,encryptedValue:h}=m,C=yield Qe(n,o,a,(w,R,b)=>w.onReasoningEncryptedValueEvent?.({event:m,messages:R,state:b,agent:r,input:e}));if(p(C),C.stopPropagation!==!0){let w=!1;if(S==="tool-call"){for(let R of o)if(R.role==="assistant"&&R.toolCalls){let b=R.toolCalls.find(F=>F.id===A);if(b){b.encryptedValue=h,w=!0;break}}}else{let R=o.find(b=>b.id===A);R?.role!=="activity"&&R&&(R.encryptedValue=h,w=!0)}w&&(i.messages=o)}return f()}}return m.type,f()});return function(_x140){return _ref57.apply(this,arguments)}}()),fv(),n.length>0?gv({}):m=>m)},kv=e=>t=>{let r=new Map,n=new Map,o=!1,a=!1,i=!1,p=new Map,f=!1,m=!1,g=!1,S=()=>{r.clear(),n.clear(),p.clear(),f=!1,m=!1,o=!1,a=!1,g=!0};return t.pipe(Zt(A=>{let h=A.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(A)),a)return Ke(()=>new et(`Cannot send event type '${h}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&h!==D.RUN_ERROR&&h!==D.RUN_STARTED)return Ke(()=>new et(`Cannot send event type '${h}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(i){if(h===D.RUN_STARTED){if(g&&!o)return Ke(()=>new et("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));o&&S()}}else if(i=!0,h!==D.RUN_STARTED&&h!==D.RUN_ERROR)return Ke(()=>new et("First event must be 'RUN_STARTED'"));switch(h){case D.TEXT_MESSAGE_START:{let C=A.messageId;return r.has(C)?Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${C}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(C,!0),tt(A))}case D.TEXT_MESSAGE_CONTENT:{let C=A.messageId;return r.has(C)?tt(A):Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${C}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case D.TEXT_MESSAGE_END:{let C=A.messageId;return r.has(C)?(r.delete(C),tt(A)):Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${C}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case D.TOOL_CALL_START:{let C=A.toolCallId;return n.has(C)?Ke(()=>new et(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${C}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(C,!0),tt(A))}case D.TOOL_CALL_ARGS:{let C=A.toolCallId;return n.has(C)?tt(A):Ke(()=>new et(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${C}'. Start a tool call with 'TOOL_CALL_START' first.`))}case D.TOOL_CALL_END:{let C=A.toolCallId;return n.has(C)?(n.delete(C),tt(A)):Ke(()=>new et(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${C}'. A 'TOOL_CALL_START' event must be sent first.`))}case D.STEP_STARTED:{let C=A.stepName;return p.has(C)?Ke(()=>new et(`Step "${C}" is already active for 'STEP_STARTED'`)):(p.set(C,!0),tt(A))}case D.STEP_FINISHED:{let C=A.stepName;return p.has(C)?(p.delete(C),tt(A)):Ke(()=>new et(`Cannot send 'STEP_FINISHED' for step "${C}" that was not started`))}case D.RUN_STARTED:return g=!0,tt(A);case D.RUN_FINISHED:if(p.size>0){let C=Array.from(p.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while steps are still active: ${C}`))}if(r.size>0){let C=Array.from(r.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while text messages are still active: ${C}`))}if(n.size>0){let C=Array.from(n.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${C}`))}return o=!0,tt(A);case D.RUN_ERROR:return a=!0,tt(A);case D.CUSTOM:return tt(A);case D.THINKING_TEXT_MESSAGE_START:return f?m?Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(m=!0,tt(A)):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case D.THINKING_TEXT_MESSAGE_CONTENT:return m?tt(A):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case D.THINKING_TEXT_MESSAGE_END:return m?(m=!1,tt(A)):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case D.THINKING_START:return f?Ke(()=>new et("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(f=!0,tt(A));case D.THINKING_END:return f?(f=!1,tt(A)):Ke(()=>new et("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return tt(A)}}))},za=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),_L=(e,t)=>mv(()=>Ga(v(e,t))).pipe(hv(r=>{if(!r.ok){let a=r.headers.get("content-type")||"";return Ga(r.text()).pipe(Zt(i=>{let p=i;if(a.includes("application/json"))try{p=JSON.parse(i)}catch{}let f=Error(`HTTP ${r.status}: ${typeof p=="string"?p:JSON.stringify(p)}`);return f.status=r.status,f.payload=p,Ke(()=>f)}))}let n={type:za.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new We(a=>(a.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:p}=yield o.read();if(i)break;let f={type:za.DATA,data:p};a.next(f)}a.complete()}catch(i){a.error(i)}})(),()=>{o.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):Ke(()=>Error("Failed to getReader() from response"))})),DL=e=>{let t=new an,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:a=>{if(a.type!==za.HEADERS&&a.type===za.DATA&&a.data){let i=r.decode(a.data,{stream:!0});n+=i;let p=n.split(/\n\n/);n=p.pop()||"";for(let f of p)o(f)}},error:a=>t.error(a),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(a){let i=a.split(`
39
39
  `),p=[];for(let f of i)f.startsWith("data:")&&p.push(f.slice(5).replace(/^ /,""));if(p.length>0)try{let f=p.join(`
40
- `),m=JSON.parse(f);t.next(m)}catch(f){t.error(f)}}return t.asObservable()},tU=e=>{let t=new sn,r=new Uint8Array;e.subscribe({next:a=>{if(a.type!==Jo.HEADERS&&a.type===Jo.DATA&&a.data){let o=new Uint8Array(r.length+a.data.length);o.set(r,0),o.set(a.data,r.length),r=o,n()}},error:a=>t.error(a),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let a=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<a)break;try{let o=r.slice(4,a),i=ZF(o);t.next(i),r=r.slice(a)}catch(o){let i=o instanceof Error?o.message:String(o);t.error(Error(`Failed to decode protocol buffer message: ${i}`));return}}}return t.asObservable()},rU=e=>{let t=new sn,r=new Df,n=!1;return e.subscribe({next:a=>{r.next(a),a.type===Jo.HEADERS&&!n?(n=!0,a.headers.get("content-type")===eE?tU(r).subscribe({next:o=>t.next(o),error:o=>t.error(o),complete:()=>t.complete()}):eU(r).subscribe({next:o=>{try{let i=xf.parse(o);t.next(i)}catch(i){t.error(i)}},error:o=>{if(o?.name==="AbortError"){t.next({type:D.RUN_ERROR,message:o.message||"Request aborted",code:"abort",rawEvent:o}),t.complete();return}return t.error(o)},complete:()=>t.complete()})):n||t.error(Error("No headers event received before data events"))},error:a=>{r.error(a),t.error(a)},complete:()=>{r.complete()}}),t.asObservable()},ze=I.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),nU=I.enum(["LangGraphInterruptEvent","PredictState","Exit"]),aU=I.object({type:I.literal(ze.enum.TextMessageStart),messageId:I.string(),parentMessageId:I.string().optional(),role:I.string().optional()}),oU=I.object({type:I.literal(ze.enum.TextMessageContent),messageId:I.string(),content:I.string()}),iU=I.object({type:I.literal(ze.enum.TextMessageEnd),messageId:I.string()}),sU=I.object({type:I.literal(ze.enum.ActionExecutionStart),actionExecutionId:I.string(),actionName:I.string(),parentMessageId:I.string().optional()}),cU=I.object({type:I.literal(ze.enum.ActionExecutionArgs),actionExecutionId:I.string(),args:I.string()}),uU=I.object({type:I.literal(ze.enum.ActionExecutionEnd),actionExecutionId:I.string()}),lU=I.object({type:I.literal(ze.enum.ActionExecutionResult),actionName:I.string(),actionExecutionId:I.string(),result:I.string()}),dU=I.object({type:I.literal(ze.enum.AgentStateMessage),threadId:I.string(),agentName:I.string(),nodeName:I.string(),runId:I.string(),active:I.boolean(),role:I.string(),state:I.string(),running:I.boolean()}),pU=I.object({type:I.literal(ze.enum.MetaEvent),name:nU,value:I.any()}),fU=I.object({type:I.literal(ze.enum.RunError),message:I.string(),code:I.string().optional()});I.discriminatedUnion("type",[aU,oU,iU,sU,cU,uU,lU,dU,pU,fU]),I.object({id:I.string(),role:I.string(),content:I.string(),parentMessageId:I.string().optional()}),I.object({id:I.string(),name:I.string(),arguments:I.any(),parentMessageId:I.string().optional()}),I.object({id:I.string(),result:I.any(),actionExecutionId:I.string(),actionName:I.string()});var mU=e=>{if(typeof e=="string")return e;if(!Array.isArray(e))return;let t=e.filter(r=>r.type==="text").map(r=>r.text).filter(r=>r.length>0);if(t.length!==0)return t.join(`
41
- `)},gU=(e,t,r)=>n=>{let a={},o=!0,i=!0,p="",f=null,m=null,g=[],A={},x=h=>{typeof h=="object"&&h&&("messages"in h&&delete h.messages,a=h)};return n.pipe(er(h=>{switch(h.type){case D.TEXT_MESSAGE_START:{let C=h;return[{type:ze.enum.TextMessageStart,messageId:C.messageId,role:C.role}]}case D.TEXT_MESSAGE_CONTENT:{let C=h;return[{type:ze.enum.TextMessageContent,messageId:C.messageId,content:C.delta}]}case D.TEXT_MESSAGE_END:{let C=h;return[{type:ze.enum.TextMessageEnd,messageId:C.messageId}]}case D.TOOL_CALL_START:{let C=h;return g.push({id:C.toolCallId,type:"function",function:{name:C.toolCallName,arguments:""}}),i=!0,A[C.toolCallId]=C.toolCallName,[{type:ze.enum.ActionExecutionStart,actionExecutionId:C.toolCallId,actionName:C.toolCallName,parentMessageId:C.parentMessageId}]}case D.TOOL_CALL_ARGS:{let C=h,R=g.find(b=>b.id===C.toolCallId);if(!R)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${C.toolCallId}'`),[];R.function.arguments+=C.delta;let w=!1;if(m){let b=m.find(F=>F.tool==R.function.name);if(b)try{let F=JSON.parse(Xf(R.function.arguments));b.tool_argument&&b.tool_argument in F?(x({...a,[b.state_key]:F[b.tool_argument]}),w=!0):b.tool_argument||(x({...a,[b.state_key]:F}),w=!0)}catch{}}return[{type:ze.enum.ActionExecutionArgs,actionExecutionId:C.toolCallId,args:C.delta},...(w?[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:o,role:"assistant",state:JSON.stringify(a),active:i}]:[])]}case D.TOOL_CALL_END:{let C=h;return[{type:ze.enum.ActionExecutionEnd,actionExecutionId:C.toolCallId}]}case D.TOOL_CALL_RESULT:{let C=h;return[{type:ze.enum.ActionExecutionResult,actionExecutionId:C.toolCallId,result:C.content,actionName:A[C.toolCallId]||"unknown"}]}case D.RAW:return[];case D.CUSTOM:{let C=h;switch(C.name){case"Exit":o=!1;break;case"PredictState":m=C.value;break}return[{type:ze.enum.MetaEvent,name:C.name,value:C.value}]}case D.STATE_SNAPSHOT:return x(h.snapshot),[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:o,role:"assistant",state:JSON.stringify(a),active:i}];case D.STATE_DELTA:{let C=h,R=Ua(a,C.delta,!0,!1);return R?(x(R.newDocument),[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:o,role:"assistant",state:JSON.stringify(a),active:i}]):[]}case D.MESSAGES_SNAPSHOT:return f=h.messages,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:o,role:"assistant",state:JSON.stringify({...a,...(f?{messages:f}:{})}),active:!0}];case D.RUN_STARTED:return[];case D.RUN_FINISHED:return f&&(a.messages=f),Object.keys(a).length===0?[]:[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:o,role:"assistant",state:JSON.stringify({...a,...(f?{messages:hU(f)}:{})}),active:!1}];case D.RUN_ERROR:{let C=h;return[{type:ze.enum.RunError,message:C.message,code:C.code}]}case D.STEP_STARTED:return p=h.stepName,g=[],m=null,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:o,role:"assistant",state:JSON.stringify(a),active:!0}];case D.STEP_FINISHED:return g=[],m=null,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:o,role:"assistant",state:JSON.stringify(a),active:!1}];default:return[]}}))};function hU(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=mU(r.content);if(n){let a={id:r.id,role:r.role,content:n};t.push(a)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let a of r.toolCalls){let o={id:a.id,name:a.function.name,arguments:JSON.parse(a.function.arguments),parentMessageId:r.id};t.push(o)}}else if(r.role==="tool"){let n="unknown";for(let o of e)if(o.role==="assistant"&&o.toolCalls?.length){for(let i of o.toolCalls)if(i.id===r.toolCallId){n=i.function.name;break}}let a={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(a)}return t}var wm=e=>t=>{let r,n,a,o,i=()=>{if(!r||o!=="text")throw Error("No text message to close");let g={type:D.TEXT_MESSAGE_END,messageId:r.messageId};return o=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(g)),g},p=()=>{if(!n||o!=="tool")throw Error("No tool call to close");let g={type:D.TOOL_CALL_END,toolCallId:n.toolCallId};return o=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(g)),g},f=()=>{if(!a||o!=="reasoning")throw Error("No reasoning message to close");let g={type:D.REASONING_MESSAGE_END,messageId:a.messageId};return o=void 0,a=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(g)),g},m=()=>o==="text"?[i()]:o==="tool"?[p()]:o==="reasoning"?[f()]:[];return t.pipe(er(g=>{switch(g.type){case D.TEXT_MESSAGE_START:case D.TEXT_MESSAGE_CONTENT:case D.TEXT_MESSAGE_END:case D.TOOL_CALL_START:case D.TOOL_CALL_ARGS:case D.TOOL_CALL_END:case D.TOOL_CALL_RESULT:case D.STATE_SNAPSHOT:case D.STATE_DELTA:case D.MESSAGES_SNAPSHOT:case D.CUSTOM:case D.RUN_STARTED:case D.RUN_FINISHED:case D.RUN_ERROR:case D.STEP_STARTED:case D.STEP_FINISHED:case D.THINKING_START:case D.THINKING_END:case D.THINKING_TEXT_MESSAGE_START:case D.THINKING_TEXT_MESSAGE_CONTENT:case D.THINKING_TEXT_MESSAGE_END:case D.REASONING_START:case D.REASONING_MESSAGE_START:case D.REASONING_MESSAGE_CONTENT:case D.REASONING_MESSAGE_END:case D.REASONING_END:return[...m(),g];case D.RAW:case D.ACTIVITY_SNAPSHOT:case D.ACTIVITY_DELTA:case D.REASONING_ENCRYPTED_VALUE:return[g];case D.TEXT_MESSAGE_CHUNK:let A=g,x=[];if((o!=="text"||A.messageId!==void 0&&A.messageId!==r?.messageId)&&x.push(...m()),o!=="text"){if(A.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:A.messageId},o="text";let b={type:D.TEXT_MESSAGE_START,messageId:A.messageId,role:A.role||"assistant"};x.push(b),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(b))}if(A.delta!==void 0){let b={type:D.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:A.delta};x.push(b),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(b))}return x;case D.TOOL_CALL_CHUNK:let h=g,C=[];if((o!=="tool"||h.toolCallId!==void 0&&h.toolCallId!==n?.toolCallId)&&C.push(...m()),o!=="tool"){if(h.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(h.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");n={toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId},o="tool";let b={type:D.TOOL_CALL_START,toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId};C.push(b),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(b))}if(h.delta!==void 0){let b={type:D.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:h.delta};C.push(b),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(b))}return C;case D.REASONING_MESSAGE_CHUNK:let R=g,w=[];if((o!=="reasoning"||R.messageId&&R.messageId!==a?.messageId)&&w.push(...m()),o!=="reasoning"){if(R.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");a={messageId:R.messageId},o="reasoning";let b={type:D.REASONING_MESSAGE_START,messageId:R.messageId};w.push(b),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(b))}if(R.delta!==void 0){let b={type:D.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:R.delta};w.push(b),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(b))}return w}return g.type,[]}),Yo(()=>{m()}))},Mv=class{runNext(e,t){return t.run(e).pipe(wm(!1))}runNextWithState(e,t){let r=Ge(e.messages||[]),n=Ge(e.state||{}),a=new Df;return cE(e,a,t,[]).subscribe(o=>{o.messages!==void 0&&(r=o.messages),o.state!==void 0&&(n=o.state)}),this.runNext(e,t).pipe(Yf(/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(o){return a.next(o),yield new Promise(i=>setTimeout(i,0)),{event:o,messages:Ge(r),state:Ge(n)}});return function(_x144){return _ref59.apply(this,arguments)}}()))}},yU=class extends Mv{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function SU(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var vU=class extends Mv{run(e,t){let{parentRunId:r,...n}=e,a={...n,messages:n.messages.map(SU)};return this.runNext(a,t)}},nE="THINKING_START",aE="THINKING_END",oE="THINKING_TEXT_MESSAGE_START",iE="THINKING_TEXT_MESSAGE_CONTENT",sE="THINKING_TEXT_MESSAGE_END",AU=class extends Mv{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Ko(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case nE:{this.currentReasoningId=Il();let{title:t,...r}=e;return this.warnAboutTransformation(nE,D.REASONING_START),{...r,type:D.REASONING_START,messageId:this.currentReasoningId}}case oE:return this.currentMessageId=Il(),this.warnAboutTransformation(oE,D.REASONING_MESSAGE_START),{...e,type:D.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case iE:{let{delta:t,...r}=e;return this.warnAboutTransformation(iE,D.REASONING_MESSAGE_CONTENT),{...r,type:D.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Il(),delta:t}}case sE:{let t=this.currentMessageId??Il();return this.warnAboutTransformation(sE,D.REASONING_MESSAGE_END),{...e,type:D.REASONING_MESSAGE_END,messageId:t}}case aE:{let t=this.currentReasoningId??Il();return this.warnAboutTransformation(aE,D.REASONING_END),{...e,type:D.REASONING_END,messageId:t}}default:return e}}},xU="0.0.45",CU=class{get maxVersion(){return xU}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:a,debug:o}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??qa(),this.messages=Ge(n??[]),this.state=Ge(a??{}),this.debug=o??!1,bm(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new vU),bm(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new AU)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new yU(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this28=this;return _asyncToGenerator(function*(){try{_this28.isRunning=!0,_this28.agentId=_this28.agentId??qa();let r=_this28.prepareRunAgentInput(e),n,a=new Set(_this28.messages.map(f=>f.id)),o=[{onRunFinishedEvent:f=>{n=f.result}},..._this28.subscribers,t??{}];yield _this28.onInitialize(r,o),_this28.activeRunDetach$=new sn;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield Kf(_f(()=>_this28.middlewares.length===0?_this28.run(r):_this28.middlewares.reduceRight((f,m)=>({run:g=>m.run(g,f)}),_this28).run(r),wm(_this28.debug),qv(_this28.debug),f=>f.pipe(Jf(_this28.activeRunDetach$)),f=>_this28.apply(r,f,o),f=>_this28.processApplyEvents(r,f,o),Rl(f=>(_this28.isRunning=!1,_this28.onError(r,f,o))),Yo(()=>{_this28.isRunning=!1,_this28.onFinalize(r,o),i?.(),i=void 0,_this28.activeRunCompletionPromise=void 0,_this28.activeRunDetach$=void 0}))(tt(null)));let p=Ge(_this28.messages).filter(f=>!a.has(f.id));return{result:n,newMessages:p}}finally{_this28.isRunning=!1}})()}connect(e){throw new ov}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??qa();let r=_this29.prepareRunAgentInput(e),n,a=new Set(_this29.messages.map(f=>f.id)),o=[{onRunFinishedEvent:f=>{n=f.result}},..._this29.subscribers,t??{}];yield _this29.onInitialize(r,o),_this29.activeRunDetach$=new sn;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield Kf(_f(()=>_this29.connect(r),wm(_this29.debug),qv(_this29.debug),f=>f.pipe(Jf(_this29.activeRunDetach$)),f=>_this29.apply(r,f,o),f=>_this29.processApplyEvents(r,f,o),Rl(f=>(_this29.isRunning=!1,f instanceof ov?qf:_this29.onError(r,f,o))),Yo(()=>{_this29.isRunning=!1,_this29.onFinalize(r,o),i?.(),i=void 0,_this29.activeRunCompletionPromise=void 0,_this29.activeRunDetach$=void 0}))(tt(null)));let p=Ge(_this29.messages).filter(f=>!a.has(f.id));return{result:n,newMessages:p}}finally{_this29.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this30=this;return _asyncToGenerator(function*(){if(!_this30.activeRunDetach$)return;let e=_this30.activeRunCompletionPromise??Promise.resolve();_this30.activeRunDetach$.next(),_this30.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return cE(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(Cv(n=>{n.messages&&(this.messages=n.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=Ge(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||qa(),tools:Ge(e?.tools??[]),context:Ge(e?.context??[]),forwardedProps:Ge(e?.forwardedProps??{}),state:Ge(this.state),messages:t}}onInitialize(e,t){var _this31=this;return _asyncToGenerator(function*(){let r=yield Qe(t,_this31.messages,_this31.state,(n,a,o)=>n.onRunInitialized?.({messages:a,state:o,agent:_this31,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this31.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this31.messages,state:_this31.state,agent:_this31,input:e})})),r.state&&(_this31.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this31.state,messages:_this31.messages,agent:_this31,input:e})})))})()}onError(e,t,r){return Wo(Qe(r,this.messages,this.state,(n,a,o)=>n.onRunFailed?.({error:t,messages:a,state:o,agent:this,input:e}))).pipe(Ko(n=>{let a=n;if((a.messages!==void 0||a.state!==void 0)&&(a.messages!==void 0&&(this.messages=a.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),a.state!==void 0&&(this.state=a.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),a.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this32=this;return _asyncToGenerator(function*(){let r=yield Qe(t,_this32.messages,_this32.state,(n,a,o)=>n.onRunFinalized?.({messages:a,state:o,agent:_this32,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this32.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this32.messages,state:_this32.state,agent:_this32,input:e})})),r.state!==void 0&&(_this32.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this32.state,messages:_this32.messages,agent:_this32,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Ge(this.messages),e.state=Ge(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this33=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this33.subscribers)yield t.onNewMessage?.({message:e,messages:_this33.messages,state:_this33.state,agent:_this33});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this33.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this33.messages,state:_this33.state,agent:_this33});for(let t of _this33.subscribers)yield t.onMessagesChanged?.({messages:_this33.messages,state:_this33.state,agent:_this33})})()}addMessages(e){var _this34=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this34.subscribers)yield r.onNewMessage?.({message:t,messages:_this34.messages,state:_this34.state,agent:_this34});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this34.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this34.messages,state:_this34.state,agent:_this34})}for(let t of _this34.subscribers)yield t.onMessagesChanged?.({messages:_this34.messages,state:_this34.state,agent:_this34})})()}setMessages(e){var _this35=this;this.messages=Ge(e),_asyncToGenerator(function*(){for(let t of _this35.subscribers)yield t.onMessagesChanged?.({messages:_this35.messages,state:_this35.state,agent:_this35})})()}setState(e){var _this36=this;this.state=Ge(e),_asyncToGenerator(function*(){for(let t of _this36.subscribers)yield t.onStateChanged?.({messages:_this36.messages,state:_this36.state,agent:_this36})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??qa();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:a=>n.run(a,r)}),this).run(t)).pipe(wm(this.debug),qv(this.debug),gU(this.threadId,t.runId,this.agentId),r=>r.pipe(Ko(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},Rm=class extends CU{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=Ge(e.headers??{})}run(e){return rU(ZL(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=Ge(this.headers??{});let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var Fm=(e,t,r)=>{let n=it(t,r),a=e?.trim();if(!n||!t||!a)throw new Error("Missing required parameters for answer endpoint");let o=`/api/preview/organizations/${t}/agents`;return`${n}${o}/${a}`};var jv=class extends Rm{requestInit(t){let{params:r,accessToken:n}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(r),signal:this.abortController.signal}}},uE=(e,t,r)=>new jv({url:`${Fm(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var bU={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004};function Em(e){return e?bU[e]??1004:1004}var lE=e=>({onRunStartedEvent:({event:t})=>{e(Da(t.runId)),e(cr(!1)),e(Zr(!0)),e(ks(t.threadId))},onStepStartedEvent:({event:t})=>{e(uf({name:t.stepName,startedAt:t.timestamp??Date.now()}))},onStepFinishedEvent:({event:t})=>{e(lf({name:t.stepName,finishedAt:t.timestamp??Date.now()}))},onTextMessageContentEvent:({event:t})=>{e(Gn({textDelta:t.delta}))},onCustomEvent:({event:t})=>{let{name:r,value:n}=t;switch(r){case"header":{n?.contentFormat&&e(zn(n.contentFormat)),n?.followUpEnabled&&e(Ps(n.followUpEnabled));return}case"citations":{e($n({citations:n.citations}));return}}},onRunErrorEvent:({event:t})=>{let r=Em(t.code);e(Hn({message:t.message,code:r}))},onRunFinishedEvent:({event:t})=>{let r=t.result?.answerGenerated??!1;e(Eo(r)),e(Wn(!r)),e(Zr(!1))}});var dE=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,a,o){t();let i=va(n),p=$d(n),f=Hd(n),m=Gd(n),g=uE(i,p,f);e=g;let A=lE(a),x=Yp(n,o());try{a(cr(!0)),yield g.runAgent({forwardedProps:{params:x,accessToken:m}},A)}catch(h){a(cr(!1)),a(Hn({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",h)}});return function run(_x145,_x146,_x147){return _ref64.apply(this,arguments)}}(),abortRun:t}};var pE=e=>{let t=RC({extra:e}),r=dE();return t.startListening({actionCreator:G.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,a){let o=a.getState();if(!eS(o))return;r.abortRun(),a.dispatch(Jt()),a.dispatch($p());let i=Ro(o)?.q;!i||i.trim()===""||r.run(o,a.dispatch,e.getNavigatorContext)});return function effect(_x148,_x149){return _ref65.apply(this,arguments)}}()}),t};d();c();l();u();var fE=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let a=n.error;if(n.payload?.ignored||e.error({error:a,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},mE=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var Vv=(e,t)=>{let{referrer:r,userAgent:n,location:a,clientId:o}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:a,clientId:o}};d();c();l();u();function gE(e,t){let r={...e},n,a=o=>(i,p)=>{let f=o(i,p);return n?n(f,p):f};return{get combinedReducer(){let o=ox(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return a(Ti({...o,...r}))},containsAll(o){return Object.keys(o).every(p=>p in r)},add(o){Object.keys(o).filter(i=>!(i in r)).forEach(i=>{r[i]=o[i]})},addCrossReducer(o){n=o}}}d();c();l();u();d();c();l();u();function Lv(e){if(!e||!wU(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),a=decodeURIComponent(n.split("").map(o=>`%${`00${o.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(a)}catch{return null}}function hE(e,t=60){if(!e)return!1;let r=Lv(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function wU(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function SE(e,t){let r=0,n=null,a=nd(()=>{r=0},500),o=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(f,m=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(x){if(!m)throw x;return null}})().finally(()=>{n=null}));let A=yield n;return g&&A&&f.dispatch(Wr({accessToken:A})),A});return function o(_x150){return _ref66.apply(this,arguments)}}(),i=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(f){let m=f.getState(),g=FU(m);if(!(!g||!hE(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield o(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(A){e.warn(A,"Access token renewal failed. A retry will occur if necessary.")}}});return function i(_x151){return _ref68.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(f,m,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),yE(f,m.error),m;r++,a(),yield o(f,!0),f.dispatch(g)});return function p(_x152,_x153,_x154){return _ref69.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref70=_asyncToGenerator(function*(g){let A=typeof g=="function",x=typeof t=="function";if(!A)return m(g);x&&(yield i(f));let h=yield m(g);return RU(h)?x?yield p(f,h,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),yE(f,h.error),h):h});return function(_x155){return _ref70.apply(this,arguments)}}())}function RU(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Ei().name}function yE(e,t){e.dispatch(ws({status:401,statusCode:401,message:t.message,type:t.name}))}function FU(e){return e.configuration.accessToken}d();c();l();u();function vE({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:a}){return dC({reducer:e,preloadedState:t,devTools:{stateSanitizer:o=>o.history?{...o,history:"<<OMIT>>"}:o,name:a,shouldHotReload:!1},middleware:o=>o({thunk:{extraArgument:n}}).prepend(...r).concat(mE(n.logger))})}function EU(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...a}=r??{},o={...a,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return o.analyticsMode!=="next"&&ax()?(t.info("Analytics disabled since doNotTrack is active."),{...o,enabled:!1}):o}function AE(e,t){let r={...e.reducers,configuration:ue,version:bR},n=IU({...e,reducers:r},t,ue),{accessToken:a,environment:o,organizationId:i}=e.configuration;n.dispatch(Wr({accessToken:a,environment:o,organizationId:i}));let p=EU(e.configuration,n.logger);return p&&n.dispatch(Ca(p)),n}function IU(e,t,r){let{reducers:n,navigatorContextProvider:a}=e,o=gE({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&o.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return zu(m.state,a)},get navigatorContext(){return Vv(this.relay,a)}},f=TU(e,p,o),m={addReducers(g){o.containsAll(g)||(o.add(g),f.replaceReducer(o.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(rs())},disableAnalytics(){f.dispatch(ts())},get state(){return f.getState()},get relay(){return zu(this.state,a)},get navigatorContext(){return Vv(this.relay,a)},logger:i,store:f};return m}function TU(e,t,r){let{preloadedState:n,configuration:a}=e,o=a.name||"coveo-headless",i=PU(e,t.logger,()=>t.navigatorContext);return vE({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:o})}function PU(e,t,r){let{renewAccessToken:n}=e.configuration,a=SE(t,n),o=pE({getNavigatorContext:r});return[PR,a,fE(t),RR].concat(Io.middleware,Bn.middleware,o.middleware,e.middlewares||[])}var kU=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
40
+ `),m=JSON.parse(f);t.next(m)}catch(f){t.error(f)}}return t.asObservable()},qL=e=>{let t=new an,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==za.HEADERS&&o.type===za.DATA&&o.data){let a=new Uint8Array(r.length+o.data.length);a.set(r,0),a.set(o.data,r.length),r=a,n()}},error:o=>t.error(o),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let o=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<o)break;try{let a=r.slice(4,o),i=VF(a);t.next(i),r=r.slice(o)}catch(a){let i=a instanceof Error?a.message:String(a);t.error(Error(`Failed to decode protocol buffer message: ${i}`));return}}}return t.asObservable()},ML=e=>{let t=new an,r=new df,n=!1;return e.subscribe({next:o=>{r.next(o),o.type===za.HEADERS&&!n?(n=!0,o.headers.get("content-type")===LF?qL(r).subscribe({next:a=>t.next(a),error:a=>t.error(a),complete:()=>t.complete()}):DL(r).subscribe({next:a=>{try{let i=Yp.parse(a);t.next(i)}catch(i){t.error(i)}},error:a=>{if(a?.name==="AbortError"){t.next({type:D.RUN_ERROR,message:a.message||"Request aborted",code:"abort",rawEvent:a}),t.complete();return}return t.error(a)},complete:()=>t.complete()})):n||t.error(Error("No headers event received before data events"))},error:o=>{r.error(o),t.error(o)},complete:()=>{r.complete()}}),t.asObservable()},ze=I.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),jL=I.enum(["LangGraphInterruptEvent","PredictState","Exit"]),VL=I.object({type:I.literal(ze.enum.TextMessageStart),messageId:I.string(),parentMessageId:I.string().optional(),role:I.string().optional()}),LL=I.object({type:I.literal(ze.enum.TextMessageContent),messageId:I.string(),content:I.string()}),UL=I.object({type:I.literal(ze.enum.TextMessageEnd),messageId:I.string()}),QL=I.object({type:I.literal(ze.enum.ActionExecutionStart),actionExecutionId:I.string(),actionName:I.string(),parentMessageId:I.string().optional()}),BL=I.object({type:I.literal(ze.enum.ActionExecutionArgs),actionExecutionId:I.string(),args:I.string()}),GL=I.object({type:I.literal(ze.enum.ActionExecutionEnd),actionExecutionId:I.string()}),$L=I.object({type:I.literal(ze.enum.ActionExecutionResult),actionName:I.string(),actionExecutionId:I.string(),result:I.string()}),HL=I.object({type:I.literal(ze.enum.AgentStateMessage),threadId:I.string(),agentName:I.string(),nodeName:I.string(),runId:I.string(),active:I.boolean(),role:I.string(),state:I.string(),running:I.boolean()}),zL=I.object({type:I.literal(ze.enum.MetaEvent),name:jL,value:I.any()}),WL=I.object({type:I.literal(ze.enum.RunError),message:I.string(),code:I.string().optional()});I.discriminatedUnion("type",[VL,LL,UL,QL,BL,GL,$L,HL,zL,WL]),I.object({id:I.string(),role:I.string(),content:I.string(),parentMessageId:I.string().optional()}),I.object({id:I.string(),name:I.string(),arguments:I.any(),parentMessageId:I.string().optional()}),I.object({id:I.string(),result:I.any(),actionExecutionId:I.string(),actionName:I.string()});var KL=e=>{if(typeof e=="string")return e;if(!Array.isArray(e))return;let t=e.filter(r=>r.type==="text").map(r=>r.text).filter(r=>r.length>0);if(t.length!==0)return t.join(`
41
+ `)},YL=(e,t,r)=>n=>{let o={},a=!0,i=!0,p="",f=null,m=null,g=[],S={},A=h=>{typeof h=="object"&&h&&("messages"in h&&delete h.messages,o=h)};return n.pipe(Zt(h=>{switch(h.type){case D.TEXT_MESSAGE_START:{let C=h;return[{type:ze.enum.TextMessageStart,messageId:C.messageId,role:C.role}]}case D.TEXT_MESSAGE_CONTENT:{let C=h;return[{type:ze.enum.TextMessageContent,messageId:C.messageId,content:C.delta}]}case D.TEXT_MESSAGE_END:{let C=h;return[{type:ze.enum.TextMessageEnd,messageId:C.messageId}]}case D.TOOL_CALL_START:{let C=h;return g.push({id:C.toolCallId,type:"function",function:{name:C.toolCallName,arguments:""}}),i=!0,S[C.toolCallId]=C.toolCallName,[{type:ze.enum.ActionExecutionStart,actionExecutionId:C.toolCallId,actionName:C.toolCallName,parentMessageId:C.parentMessageId}]}case D.TOOL_CALL_ARGS:{let C=h,w=g.find(b=>b.id===C.toolCallId);if(!w)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${C.toolCallId}'`),[];w.function.arguments+=C.delta;let R=!1;if(m){let b=m.find(F=>F.tool==w.function.name);if(b)try{let F=JSON.parse(If(w.function.arguments));b.tool_argument&&b.tool_argument in F?(A({...o,[b.state_key]:F[b.tool_argument]}),R=!0):b.tool_argument||(A({...o,[b.state_key]:F}),R=!0)}catch{}}return[{type:ze.enum.ActionExecutionArgs,actionExecutionId:C.toolCallId,args:C.delta},...(R?[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]:[])]}case D.TOOL_CALL_END:{let C=h;return[{type:ze.enum.ActionExecutionEnd,actionExecutionId:C.toolCallId}]}case D.TOOL_CALL_RESULT:{let C=h;return[{type:ze.enum.ActionExecutionResult,actionExecutionId:C.toolCallId,result:C.content,actionName:S[C.toolCallId]||"unknown"}]}case D.RAW:return[];case D.CUSTOM:{let C=h;switch(C.name){case"Exit":a=!1;break;case"PredictState":m=C.value;break}return[{type:ze.enum.MetaEvent,name:C.name,value:C.value}]}case D.STATE_SNAPSHOT:return A(h.snapshot),[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}];case D.STATE_DELTA:{let C=h,w=No(o,C.delta,!0,!1);return w?(A(w.newDocument),[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]):[]}case D.MESSAGES_SNAPSHOT:return f=h.messages,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case D.RUN_STARTED:return[];case D.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:JL(f)}:{})}),active:!1}];case D.RUN_ERROR:{let C=h;return[{type:ze.enum.RunError,message:C.message,code:C.code}]}case D.STEP_STARTED:return p=h.stepName,g=[],m=null,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!0}];case D.STEP_FINISHED:return g=[],m=null,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function JL(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=KL(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let a={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(a)}}else if(r.role==="tool"){let n="unknown";for(let a of e)if(a.role==="assistant"&&a.toolCalls?.length){for(let i of a.toolCalls)if(i.id===r.toolCallId){n=i.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var em=e=>t=>{let r,n,o,a,i=()=>{if(!r||a!=="text")throw Error("No text message to close");let g={type:D.TEXT_MESSAGE_END,messageId:r.messageId};return a=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(g)),g},p=()=>{if(!n||a!=="tool")throw Error("No tool call to close");let g={type:D.TOOL_CALL_END,toolCallId:n.toolCallId};return a=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(g)),g},f=()=>{if(!o||a!=="reasoning")throw Error("No reasoning message to close");let g={type:D.REASONING_MESSAGE_END,messageId:o.messageId};return a=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(g)),g},m=()=>a==="text"?[i()]:a==="tool"?[p()]:a==="reasoning"?[f()]:[];return t.pipe(Zt(g=>{switch(g.type){case D.TEXT_MESSAGE_START:case D.TEXT_MESSAGE_CONTENT:case D.TEXT_MESSAGE_END:case D.TOOL_CALL_START:case D.TOOL_CALL_ARGS:case D.TOOL_CALL_END:case D.TOOL_CALL_RESULT:case D.STATE_SNAPSHOT:case D.STATE_DELTA:case D.MESSAGES_SNAPSHOT:case D.CUSTOM:case D.RUN_STARTED:case D.RUN_FINISHED:case D.RUN_ERROR:case D.STEP_STARTED:case D.STEP_FINISHED:case D.THINKING_START:case D.THINKING_END:case D.THINKING_TEXT_MESSAGE_START:case D.THINKING_TEXT_MESSAGE_CONTENT:case D.THINKING_TEXT_MESSAGE_END:case D.REASONING_START:case D.REASONING_MESSAGE_START:case D.REASONING_MESSAGE_CONTENT:case D.REASONING_MESSAGE_END:case D.REASONING_END:return[...m(),g];case D.RAW:case D.ACTIVITY_SNAPSHOT:case D.ACTIVITY_DELTA:case D.REASONING_ENCRYPTED_VALUE:return[g];case D.TEXT_MESSAGE_CHUNK:let S=g,A=[];if((a!=="text"||S.messageId!==void 0&&S.messageId!==r?.messageId)&&A.push(...m()),a!=="text"){if(S.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:S.messageId},a="text";let b={type:D.TEXT_MESSAGE_START,messageId:S.messageId,role:S.role||"assistant"};A.push(b),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(b))}if(S.delta!==void 0){let b={type:D.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:S.delta};A.push(b),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(b))}return A;case D.TOOL_CALL_CHUNK:let h=g,C=[];if((a!=="tool"||h.toolCallId!==void 0&&h.toolCallId!==n?.toolCallId)&&C.push(...m()),a!=="tool"){if(h.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(h.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");n={toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId},a="tool";let b={type:D.TOOL_CALL_START,toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId};C.push(b),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(b))}if(h.delta!==void 0){let b={type:D.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:h.delta};C.push(b),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(b))}return C;case D.REASONING_MESSAGE_CHUNK:let w=g,R=[];if((a!=="reasoning"||w.messageId&&w.messageId!==o?.messageId)&&R.push(...m()),a!=="reasoning"){if(w.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:w.messageId},a="reasoning";let b={type:D.REASONING_MESSAGE_START,messageId:w.messageId};R.push(b),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(b))}if(w.delta!==void 0){let b={type:D.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:w.delta};R.push(b),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(b))}return R}return g.type,[]}),Ha(()=>{m()}))},Ov=class{runNext(e,t){return t.run(e).pipe(em(!1))}runNextWithState(e,t){let r=Ge(e.messages||[]),n=Ge(e.state||{}),o=new df;return WF(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(Ff(/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(a){return o.next(a),yield new Promise(i=>setTimeout(i,0)),{event:a,messages:Ge(r),state:Ge(n)}});return function(_x141){return _ref59.apply(this,arguments)}}()))}},XL=class extends Ov{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function ZL(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var eU=class extends Ov{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(ZL)};return this.runNext(o,t)}},BF="THINKING_START",GF="THINKING_END",$F="THINKING_TEXT_MESSAGE_START",HF="THINKING_TEXT_MESSAGE_CONTENT",zF="THINKING_TEXT_MESSAGE_END",tU=class extends Ov{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe($a(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case BF:{this.currentReasoningId=gl();let{title:t,...r}=e;return this.warnAboutTransformation(BF,D.REASONING_START),{...r,type:D.REASONING_START,messageId:this.currentReasoningId}}case $F:return this.currentMessageId=gl(),this.warnAboutTransformation($F,D.REASONING_MESSAGE_START),{...e,type:D.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case HF:{let{delta:t,...r}=e;return this.warnAboutTransformation(HF,D.REASONING_MESSAGE_CONTENT),{...r,type:D.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??gl(),delta:t}}case zF:{let t=this.currentMessageId??gl();return this.warnAboutTransformation(zF,D.REASONING_MESSAGE_END),{...e,type:D.REASONING_MESSAGE_END,messageId:t}}case GF:{let t=this.currentReasoningId??gl();return this.warnAboutTransformation(GF,D.REASONING_END),{...e,type:D.REASONING_END,messageId:t}}default:return e}}},rU="0.0.45",nU=class{get maxVersion(){return rU}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:a}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Io(),this.messages=Ge(n??[]),this.state=Ge(o??{}),this.debug=a??!1,Zf(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new eU),Zf(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new tU)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new XL(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this28=this;return _asyncToGenerator(function*(){try{_this28.isRunning=!0,_this28.agentId=_this28.agentId??Io();let r=_this28.prepareRunAgentInput(e),n,o=new Set(_this28.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this28.subscribers,t??{}];yield _this28.onInitialize(r,a),_this28.activeRunDetach$=new an;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield wf(lf(()=>_this28.middlewares.length===0?_this28.run(r):_this28.middlewares.reduceRight((f,m)=>({run:g=>m.run(g,f)}),_this28).run(r),em(_this28.debug),kv(_this28.debug),f=>f.pipe(Ef(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),pl(f=>(_this28.isRunning=!1,_this28.onError(r,f,a))),Ha(()=>{_this28.isRunning=!1,_this28.onFinalize(r,a),i?.(),i=void 0,_this28.activeRunCompletionPromise=void 0,_this28.activeRunDetach$=void 0}))(tt(null)));let p=Ge(_this28.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this28.isRunning=!1}})()}connect(e){throw new ev}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??Io();let r=_this29.prepareRunAgentInput(e),n,o=new Set(_this29.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this29.subscribers,t??{}];yield _this29.onInitialize(r,a),_this29.activeRunDetach$=new an;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield wf(lf(()=>_this29.connect(r),em(_this29.debug),kv(_this29.debug),f=>f.pipe(Ef(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),pl(f=>(_this29.isRunning=!1,f instanceof ev?pf:_this29.onError(r,f,a))),Ha(()=>{_this29.isRunning=!1,_this29.onFinalize(r,a),i?.(),i=void 0,_this29.activeRunCompletionPromise=void 0,_this29.activeRunDetach$=void 0}))(tt(null)));let p=Ge(_this29.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this29.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this30=this;return _asyncToGenerator(function*(){if(!_this30.activeRunDetach$)return;let e=_this30.activeRunCompletionPromise??Promise.resolve();_this30.activeRunDetach$.next(),_this30.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return WF(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(yv(n=>{n.messages&&(this.messages=n.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=Ge(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Io(),tools:Ge(e?.tools??[]),context:Ge(e?.context??[]),forwardedProps:Ge(e?.forwardedProps??{}),state:Ge(this.state),messages:t}}onInitialize(e,t){var _this31=this;return _asyncToGenerator(function*(){let r=yield Qe(t,_this31.messages,_this31.state,(n,o,a)=>n.onRunInitialized?.({messages:o,state:a,agent:_this31,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this31.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this31.messages,state:_this31.state,agent:_this31,input:e})})),r.state&&(_this31.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this31.state,messages:_this31.messages,agent:_this31,input:e})})))})()}onError(e,t,r){return Ga(Qe(r,this.messages,this.state,(n,o,a)=>n.onRunFailed?.({error:t,messages:o,state:a,agent:this,input:e}))).pipe($a(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this32=this;return _asyncToGenerator(function*(){let r=yield Qe(t,_this32.messages,_this32.state,(n,o,a)=>n.onRunFinalized?.({messages:o,state:a,agent:_this32,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this32.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this32.messages,state:_this32.state,agent:_this32,input:e})})),r.state!==void 0&&(_this32.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this32.state,messages:_this32.messages,agent:_this32,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Ge(this.messages),e.state=Ge(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this33=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this33.subscribers)yield t.onNewMessage?.({message:e,messages:_this33.messages,state:_this33.state,agent:_this33});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this33.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this33.messages,state:_this33.state,agent:_this33});for(let t of _this33.subscribers)yield t.onMessagesChanged?.({messages:_this33.messages,state:_this33.state,agent:_this33})})()}addMessages(e){var _this34=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this34.subscribers)yield r.onNewMessage?.({message:t,messages:_this34.messages,state:_this34.state,agent:_this34});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this34.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this34.messages,state:_this34.state,agent:_this34})}for(let t of _this34.subscribers)yield t.onMessagesChanged?.({messages:_this34.messages,state:_this34.state,agent:_this34})})()}setMessages(e){var _this35=this;this.messages=Ge(e),_asyncToGenerator(function*(){for(let t of _this35.subscribers)yield t.onMessagesChanged?.({messages:_this35.messages,state:_this35.state,agent:_this35})})()}setState(e){var _this36=this;this.state=Ge(e),_asyncToGenerator(function*(){for(let t of _this36.subscribers)yield t.onStateChanged?.({messages:_this36.messages,state:_this36.state,agent:_this36})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Io();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r)}),this).run(t)).pipe(em(this.debug),kv(this.debug),YL(this.threadId,t.runId,this.agentId),r=>r.pipe($a(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},tm=class extends nU{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=Ge(e.headers??{})}run(e){return ML(_L(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=Ge(this.headers??{});let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var rm=(e,t,r)=>{let n=Ft(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let a=`/api/preview/organizations/${t}/agents`;return`${n}${a}/${o}`};var Nv=class extends tm{requestInit(t){let{params:r,accessToken:n}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(r),signal:this.abortController.signal}}},KF=(e,t,r)=>new Nv({url:`${rm(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var oU=new j({required:!0}),YF=new j({required:!0,constrainTo:Rp}),JF=e=>({...e,name:wp(e.name)}),nm=T("followUpAnswers/setIsEnabled",e=>O(e,new ce({required:!0}))),om=T("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,z)),am=T("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:z})),im=T("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,z)),sm=T("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:Fp,answerId:z})),cm=T("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new ce({required:!0}),answerId:z})),um=T("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new ce({required:!0}),answerId:z})),lm=T("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:oU,answerId:z})),dm=T("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new ae({required:!0,each:new J({values:LS})}),answerId:z})),pm=T("followUpAnswers/followUpCompleted",e=>O(e,{answerId:z,cannotAnswer:new ce({required:!1})})),fm=T("followUpAnswers/followUpFailed",e=>O(e,{message:new j,code:new ee({min:0}),answerId:z})),mm=T("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new j})),gm=T("followUpAnswers/likeFollowUp",e=>O(e,{answerId:z})),hm=T("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:z})),XF=T("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:z})),ym=T("followUpAnswers/resetFollowUpAnswers"),Sm=T("followUpAnswers/stepStarted",e=>O(JF(e),{answerId:z,name:YF,startedAt:new ee({min:0,required:!0})})),vm=T("followUpAnswers/stepFinished",e=>O(JF(e),{answerId:z,name:YF,finishedAt:new ee({min:0,required:!0})}));d();c();l();u();var aU={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004,"KNOWLEDGE:TURN_LIMIT_REACHED":1005};function xm(e){return e?aU[e]??1004:1004}function iU(e){let t=r=>e.code===r;return Object.defineProperties(e,{isMaxDurationExceededError:{value:()=>t(1e3),enumerable:!1},isFollowupNotSupportedError:{value:()=>t(1001),enumerable:!1},isConversationNotFoundError:{value:()=>t(1002),enumerable:!1},isSseModelNotAvailableError:{value:()=>t(1003),enumerable:!1},isSseInternalError:{value:()=>t(1004),enumerable:!1},isSseTurnLimitReachedError:{value:()=>t(1005),enumerable:!1}}),e}function Wa(e){if(e)return iU({...e})}var ZF=e=>({onRunStartedEvent:({event:t})=>{e(Ps(t.runId)),e(Zr(!1)),e(Sa(!0)),e(om(t.threadId))},onStepStartedEvent:({event:t})=>{e(Mp({name:t.stepName,startedAt:t.timestamp??Date.now()}))},onStepFinishedEvent:({event:t})=>{e(jp({name:t.stepName,finishedAt:t.timestamp??Date.now()}))},onTextMessageContentEvent:({event:t})=>{e(va({textDelta:t.delta}))},onCustomEvent:({event:t})=>{let{name:r,value:n}=t;switch(r){case"header":{n?.contentFormat&&e(Ca(n.contentFormat)),n?.followUpEnabled&&e(nm(n.followUpEnabled));return}case"citations":{e(xa({citations:n.citations}));return}}},onRunErrorEvent:({event:t})=>{let r=xm(t.code);e(Aa({message:t.message,code:r}))},onRunFinishedEvent:({event:t})=>{let r=t.result?.completionReason==="ANSWERED";e(rl(r)),e(ba(!r)),e(Sa(!1)),e(ya(r)),e(ws())}});var Am=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,o,a){t();let i=Dd(n),p=Nd(n),f=_d(n),m=Od(n),g=KF(i,p,f);e=g;let S=ZF(o),A=rw(n,a());try{o(Zr(!0)),yield g.runAgent({forwardedProps:{params:A,accessToken:m}},S)}catch(h){o(Zr(!1)),o(Aa({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",h)}});return function run(_x142,_x143,_x144){return _ref64.apply(this,arguments)}}(),abortRun:t}};var eE=e=>{let t=AC({extra:e}),r=Am();return t.startListening({actionCreator:G.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,o){let a=o.getState();if(!Ky(a))return;r.abortRun(),o.dispatch(sr()),o.dispatch(ym());let i=ha(a)?.q;!i||i.trim()===""||r.run(a,o.dispatch,e.getNavigatorContext)});return function effect(_x145,_x146){return _ref65.apply(this,arguments)}}()}),t};d();c();l();u();var tE=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},rE=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var _v=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:a}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:a}};d();c();l();u();function nE(e,t){let r={...e},n,o=a=>(i,p)=>{let f=a(i,p);return n?n(f,p):f};return{get combinedReducer(){let a=tA(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(wi({...a,...r}))},containsAll(a){return Object.keys(a).every(p=>p in r)},add(a){Object.keys(a).filter(i=>!(i in r)).forEach(i=>{r[i]=a[i]})},addCrossReducer(a){n=a}}}d();c();l();u();d();c();l();u();function Dv(e){if(!e||!sU(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function oE(e,t=60){if(!e)return!1;let r=Dv(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function sU(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function iE(e,t){let r=0,n=null,o=Gl(()=>{r=0},500),a=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(f,m=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(A){if(!m)throw A;return null}})().finally(()=>{n=null}));let S=yield n;return g&&S&&f.dispatch(zr({accessToken:S})),S});return function a(_x147){return _ref66.apply(this,arguments)}}(),i=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(f){let m=f.getState(),g=uU(m);if(!(!g||!oE(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield a(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(S){e.warn(S,"Access token renewal failed. A retry will occur if necessary.")}}});return function i(_x148){return _ref68.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(f,m,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),aE(f,m.error),m;r++,o(),yield a(f,!0),f.dispatch(g)});return function p(_x149,_x150,_x151){return _ref69.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref70=_asyncToGenerator(function*(g){let S=typeof g=="function",A=typeof t=="function";if(!S)return m(g);A&&(yield i(f));let h=yield m(g);return cU(h)?A?yield p(f,h,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),aE(f,h.error),h):h});return function(_x152){return _ref70.apply(this,arguments)}}())}function cU(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new bi().name}function aE(e,t){e.dispatch(xs({status:401,statusCode:401,message:t.message,type:t.name}))}function uU(e){return e.configuration.accessToken}d();c();l();u();function sE({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return sC({reducer:e,preloadedState:t,devTools:{stateSanitizer:a=>a.history?{...a,history:"<<OMIT>>"}:a,name:o,shouldHotReload:!1},middleware:a=>a({thunk:{extraArgument:n}}).prepend(...r).concat(rE(n.logger))})}function lU(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},a={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return a.analyticsMode!=="next"&&eA()?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):a}function cE(e,t){let r={...e.reducers,configuration:le,version:uw},n=dU({...e,reducers:r},t,le),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(zr({accessToken:o,environment:a,organizationId:i}));let p=lU(e.configuration,n.logger);return p&&n.dispatch(go(p)),n}function dU(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=nE({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return _u(m.state,o)},get navigatorContext(){return _v(this.relay,o)}},f=pU(e,p,a),m={addReducers(g){a.containsAll(g)||(a.add(g),f.replaceReducer(a.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(Xi())},disableAnalytics(){f.dispatch(Ji())},get state(){return f.getState()},get relay(){return _u(this.state,o)},get navigatorContext(){return _v(this.relay,o)},logger:i,store:f};return m}function pU(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=fU(e,t.logger,()=>t.navigatorContext);return sE({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function fU(e,t,r){let{renewAccessToken:n}=e.configuration,o=iE(t,n),a=eE({getNavigatorContext:r});return[hw,o,tE(t),dw].concat(Ra.middleware,a.middleware,e.middlewares||[])}var mU=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
42
42
  However, this mode is not available for Coveo for Service features, and this configuration may not work as expected.
43
43
  Please switch back to the "legacy" analytics mode to ensure proper functionality.
44
- For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function Ba(e){e==="next"&&console.warn(kU)}d();c();l();u();var TE=Or(IE(),1);function PE(e){return(0,TE.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function kE(e,t){let r=KU(e),n=dr,a=YU(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:a,logger:t}}function KU(e){let{analytics:t}=e,r=(n,a)=>a;return t?.analyticsClientMiddleware||r}function YU(e){return e.preprocessRequest||sd}d();c();l();u();var Hv=(e,t,r,n,a,o)=>{let i=e[t];le(i)||le(a)||a!==i&&a!==n&&(o.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),o.warn(`To remove this warning, make sure that access token value [${i}] matches engine configuration value [${r}]`))},zv=(e,t)=>!(le(e)||t===e),Pl=e=>{let t=Lv(e);return t||!1},_E=(e,t)=>(zv(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),OE=(e,t,r,n)=>(Hv(e,"searchHub",t.searchHub,Sa(),r,n),_E(e,t)),DE=(e,t)=>(zv(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),NE=(e,t,r,n)=>(Hv(e,"pipeline",t.pipeline,Ln(),r,n),DE(e,t)),qE=(e,t)=>(zv(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),JU=(e,t,r,n)=>(Hv(e,"userDisplayName",t.configuration.analytics.userDisplayName,Hs().analytics.userDisplayName,r,n),qE(e,t)),ME=e=>ae({},t=>{t.addCase(Rs,(r,n)=>{let a=Pl(r.configuration.accessToken);return a?OE(a,r,n.payload,e):r}).addCase(is,(r,n)=>{let a=Pl(r.configuration.accessToken);return a?NE(a,r,n.payload,e):r}).addCase(Wr,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:a}=n.payload;if(!a)return r;let o=Pl(a);return o?[DE,_E,qE].reduce((i,p)=>p(o,i),r):r}).addCase(gr,(r,n)=>{let a=Pl(r.configuration.accessToken);if(!a)return r;let o=OE(a,r,n.payload.searchHub,e);return NE(a,o,n.payload?.pipeline,e)}).addCase(Ca,(r,n)=>{let a=Pl(r.configuration.accessToken);return a?JU(a,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var jE={organizationId:z,accessToken:z,name:new M({required:!1,emptyAllowed:!1}),analytics:new J({options:{required:!1},values:{enabled:new ce({required:!1}),originContext:new M({required:!1}),originLevel2:new M({required:!1}),originLevel3:new M({required:!1}),analyticsMode:new M({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new M({required:!1,url:!0}),trackingId:new M({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new M({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function VE(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var LE=new ge({...jE,search:new J({options:{required:!1},values:{pipeline:new M({required:!1,emptyAllowed:!0}),searchHub:st,locale:st,timezone:st,authenticationProviders:new oe({required:!1,each:z}),proxyBaseUrl:new M({required:!1,url:!0})}})});function Wv(){return{...VE(),search:{searchHub:"default"}}}var XU={debug:os,pipeline:ss,searchHub:Fs,search:fe};function ZU(e){let{search:t,organizationId:r,environment:n}=e,a=t?.proxyBaseUrl?t.proxyBaseUrl:ut(r,n);return{...t,apiBaseUrl:a}}function UE(e){let t=PE(e.loggerOptions),{configuration:r}=e;eQ(r,t);let n=tQ(r,t),a=rQ(t),o={...kE(r,t),apiClient:n,streamingClient:a},i={...e,reducers:XU,crossReducer:ME(t)},p=AE(i,o),f=ZU(r);return f&&p.dispatch(gr(f)),{...p,get state(){return p.state},executeFirstSearch(m=ep()){if(ul(p.state))return;let g=G({legacy:m,next:Lb()});p.dispatch(g)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:g,metadata:A}=m;if(ul(p.state))return;let x=A&&g==="omniboxFromLink",h=G({legacy:x?rp(A):tp(),next:x?Qb():Ub()});p.dispatch(h)}}}function eQ(e,t){try{LE.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function tQ(e,t){let{search:r}=e;return new ud({logger:t,preprocessRequest:e.preprocessRequest||sd,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||kx,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||Ox,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||Nx})}function rQ(e){return new ad({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var Zo={value:z,numberOfResults:new ee({min:0}),state:z};d();c();l();u();var he=z;var iQ=new ee({min:1,default:8,required:!1}),sQ=new ee({min:1,max:20,default:5,required:!1}),cQ={desiredCount:sQ,numberOfValues:iQ},dc=T("automaticFacet/setOptions",e=>O(e,cQ)),pc=T("automaticFacet/deselectAll",e=>O(e,he)),uQ=z,cn=T("automaticFacet/toggleSelectValue",e=>O(e,{field:uQ,selection:new J({values:Zo})}));d();c();l();u();d();c();l();u();var lQ={state:new Le({required:!0}),numberOfResults:new ee({required:!0,min:0}),value:new M({required:!0,emptyAllowed:!0}),path:new oe({required:!0,each:z}),moreValuesAvailable:new ce({required:!1})};function Kv(e){e.children.forEach(t=>{Kv(t)}),dr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},lQ)}var fc={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),activeTab:new M({required:!1}),delimitingCharacter:new M({required:!1,emptyAllowed:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),basePath:new oe({required:!1,each:z}),filterByBasePath:new ce({required:!1})};var un=T("categoryFacet/register",e=>O(e,fc)),$a=T("categoryFacet/toggleSelectValue",e=>{try{return dr(e.facetId,z),Kv(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:Dn(t)}}}),ln=T("categoryFacet/deselectAll",e=>O(e,fc.facetId)),ei=T("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:fc.facetId,numberOfValues:fc.numberOfValues})),mc=T("categoryFacet/updateSortCriterion",e=>O(e,{facetId:fc.facetId,criterion:new Le})),Pm=T("categoryFacet/updateBasePath",e=>O(e,{facetId:fc.facetId,basePath:new oe({each:z})}));d();c();l();u();var dQ={categoryFacetId:he,categoryFacetPath:new oe({required:!0,each:z})},pQ=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let a=e.categoryFacetSet[t]?.request.field,o=`${a}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:a,categoryFacetTitle:o}},km=e=>Y("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,dQ),t.makeBreadcrumbFacet(pQ(r,e)))),QE=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var be=T("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new ce({required:!1})})),jt=T("facetOptions/facet/enable",e=>O(e,he)),Je=T("facetOptions/facet/disable",e=>O(e,he));d();c();l();u();var tr=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var kl={facetId:he,captions:new J({options:{required:!1}}),numberOfValues:new ee({required:!1,min:1}),query:new M({required:!1,emptyAllowed:!0})};var fQ={path:new oe({required:!0,each:z}),displayValue:Ue,rawValue:Ue,count:new ee({required:!0,min:0})},gc=T("categoryFacet/selectSearchResult",e=>O(e,{facetId:he,value:new J({values:fQ})})),hc=T("categoryFacetSearch/register",e=>O(e,kl));d();c();l();u();function yc(e,t){let{facetId:r,criterion:n}=t,a=e[r]?.request;a&&(a.sortCriteria=n)}function Sc(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function Om(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function Ol(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Nm(e,t,r){e.currentValues=mQ(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function mQ(e,t){if(!e.length)return[];let r=BE(e[0],t),n=r;for(let a of e.splice(1)){let o=BE(a,t);n.children.push(o),n=o}return n.state="selected",n.retrieveChildren=!0,[r]}function BE(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var dn=ae($i(),e=>{e.addCase(un,(t,r)=>{let n=r.payload,{facetId:a,tabs:o}=n;if(a in t)return;let i=hQ(n),p=i.numberOfValues;t[a]={request:i,initialNumberOfValues:p,tabs:o}}).addCase(_e.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.cf||{},a=r.payload.tab;Object.keys(t).forEach(o=>{let i=t[o],p=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!tr(i.tabs,a)){p.currentValues.length&&Nm(p,[],i.initialNumberOfValues);return}let m=n[o]||[];(m.length||p.currentValues.length)&&Nm(p,m,i.initialNumberOfValues)})}).addCase(mc,(t,r)=>{let{facetId:n,criterion:a}=r.payload,o=t[n]?.request;o&&(o.sortCriteria=a)}).addCase(Pm,(t,r)=>{let{facetId:n,basePath:a}=r.payload,o=t[n]?.request;o&&(o.basePath=[...a])}).addCase($a,(t,r)=>{let{facetId:n,selection:a,retrieveCount:o}=r.payload,i=t[n]?.request;if(!i)return;let{path:p}=a,f=p.slice(0,p.length-1),m=gQ(i,f,o);if(m.length){let A=m[0];A.retrieveChildren=!0,A.state="selected",A.previousState="idle",A.children=[];return}let g=$E(a.value,o);g.state="selected",g.previousState="idle",m.push(g),i.numberOfValues=1}).addCase(ln,(t,r)=>{let n=r.payload;Ol(t,n)}).addCase(ft,t=>{Object.keys(t).forEach(r=>Ol(t,r))}).addCase(Kr,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(ei,(t,r)=>{let{facetId:n,numberOfValues:a}=r.payload,o=t[n]?.request;if(o){if(!o.currentValues.length)return Om(o,a);yQ(t,r.payload)}}).addCase(gc,(t,r)=>{let{facetId:n,value:a}=r.payload,o=t[n];if(!o)return;let i=[...a.path,a.rawValue];Nm(o.request,i,o.initialNumberOfValues)}).addCase(Ar.fulfilled,(t,r)=>{GE(t,r.payload.response.facets)}).addCase(G.fulfilled,(t,r)=>{GE(t,r.payload.response.facets)}).addCase(Je,(t,r)=>{Ol(t,r.payload)}).addCase(ht,(t,r)=>{let n=r.payload;Object.keys(t).forEach(a=>{let o=t[a];(o.tabs?.included?.length||o.tabs?.excluded?.length)&&!tr(o.tabs,n)&&Ol(t,a)})})}),Nl={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function gQ(e,t,r){let n=e.currentValues;for(let a of t){let o=n[0];(!o||a!==o.value)&&(o=$E(a,r),n.length=0,n.push(o)),o.retrieveChildren=!1,o.previousState=void 0,o.state="idle",n=o.children}return n}function hQ(e){return{...Nl,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function $E(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function GE(e,t){t.forEach(r=>{if(!SQ(e,r))return;let n=r.facetId,a=e[n]?.request;if(!a)return;let o=vQ(a,r);a.currentValues=o?[]:a.currentValues,a.preventAutoSelect=!1})}function yQ(e,t){let{facetId:r,numberOfValues:n}=t,a=e[r]?.request.currentValues[0];if(a){for(;a.children.length&&a?.state!=="selected";)a=a.children[0];a.retrieveCount=n}}function SQ(e,t){return t.facetId in e}function vQ(e,t){let r=or(e.currentValues),n=or(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var pn=new M({regex:/^[a-zA-Z0-9-_]+$/}),fn=new M({required:!0}),HE=new oe({each:new M}),zE=new M,WE=new ce,mn=new ce,gn=new ee({min:0}),Lr=new ee({min:1}),_m=new ce({required:!0}),AQ=new J,xQ=new M,CQ={captions:AQ,numberOfValues:Lr,query:xQ},vc=new J({values:CQ}),Dm=new J({options:{required:!1},values:{type:new M({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new oe({required:!0,max:25,each:new M({emptyAllowed:!1,required:!0})})}}),KE=new ce,qm=new oe({min:1,max:25,required:!1,each:new M({emptyAllowed:!1,required:!0})});var bQ={facetId:he,field:new M({required:!0,emptyAllowed:!0}),tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),activeTab:new M({required:!1}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),resultsMustMatch:new Le({required:!1}),allowedValues:Dm,customSort:qm},hn=T("facet/register",e=>O(e,bQ)),yn=T("facet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:Zo})})),Sn=T("facet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:Zo})})),Xe=T("facet/deselectAll",e=>O(e,he)),Ac=T("facet/updateSortCriterion",e=>O(e,{facetId:he,criterion:new Le({required:!0})})),ti=T("facet/updateNumberOfValues",e=>O(e,{facetId:he,numberOfValues:new ee({required:!0,min:1})})),ri=T("facet/updateIsFieldExpanded",e=>O(e,{facetId:he,isFieldExpanded:new ce({required:!0})})),ta=T("facet/updateFreezeCurrentValues",e=>O(e,{facetId:he,freezeCurrentValues:new ce({required:!0})}));d();c();l();u();var xc=e=>Y("analytics/facet/showMore",(t,r)=>{O(e,he);let n=Ki(e,ir(r));return t.makeFacetShowMore(n)}),Cc=e=>Y("analytics/facet/showLess",(t,r)=>{O(e,he);let n=Ki(e,ir(r));return t.makeFacetShowLess(n)}),vn=e=>Y("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:he,criterion:new Le({required:!0})});let{facetId:n,criterion:a}=e,o=ir(r),p={...Ki(n,o),criteria:a};return t.makeFacetUpdateSort(p)}),At=e=>Y("analytics/facet/reset",(t,r)=>{O(e,he);let n=ir(r),a=Ki(e,n);return t.makeFacetClearAll(a)}),at=e=>Y("analytics/facet/select",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ir(r),a=Yi(e,n);return t.makeFacetSelect(a)}),ur=e=>Y("analytics/facet/exclude",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ir(r),a=Yi(e,n);return t.makeFacetExclude(a)}),Ur=e=>Y("analytics/facet/deselect",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ir(r),a=Yi(e,n);return t.makeFacetDeselect(a)}),ra=e=>Y("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ir(r),a=Yi(e,n);return t.makeFacetUnexclude(a)}),bc=e=>Y("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=Yi(e,ir(r));return t.makeBreadcrumbFacet(n)}),Vt=()=>({actionCause:"facetClearAll"}),gt=()=>({actionCause:"facetSelect"}),na=()=>({actionCause:"facetExclude"}),aa=()=>({actionCause:"facetDeselect"}),YE=()=>({actionCause:"facetUnexclude"}),Mm=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var JE={facetId:he,value:new J({values:{displayValue:Ue,rawValue:Ue,count:new ee({required:!0,min:0})}})},jm=T("facetSearch/register",e=>O(e,kl)),Ha=T("facetSearch/update",e=>O(e,kl)),ni=T("facetSearch/toggleSelectValue",e=>O(e,JE)),ai=T("facetSearch/toggleExcludeValue",e=>O(e,JE));var Rr=ae(Wi(),e=>{e.addCase(hn,(t,r)=>{let{facetId:n,tabs:a}=r.payload;n in t||(t[n]=hb(wQ(r.payload),a))}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(De,(t,r)=>{let n=r.payload.f||{},a=r.payload.fExcluded||{};Object.keys(t).forEach(i=>{let{request:p}=t[i],f=n[i]||[],m=a[i]||[],g=f.length+m.length,A=p.currentValues.filter(x=>!f.includes(x.value)&&!m.includes(x.value));p.currentValues=[...f.map(ZE),...m.map(eI),...A.map(FQ)],p.preventAutoSelect=g>0,p.numberOfValues=Math.max(g,p.numberOfValues)})}).addCase(yn,(t,r)=>{let{facetId:n,selection:a}=r.payload,o=t[n]?.request;if(!o)return;o.preventAutoSelect=!0;let i=o.currentValues.find(f=>f.value===a.value);if(!i){Vm(o,a);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",o.freezeCurrentValues=!0}).addCase(Sn,(t,r)=>{let{facetId:n,selection:a}=r.payload,o=t[n]?.request;if(!o)return;o.preventAutoSelect=!0;let i=o.currentValues.find(f=>f.value===a.value);if(!i){Vm(o,a);return}let p=i.state==="excluded";i.previousState=i.state,i.state=p?"idle":"excluded",o.freezeCurrentValues=!0}).addCase(ta,(t,r)=>{let{facetId:n,freezeCurrentValues:a}=r.payload,o=t[n]?.request;o&&(o.freezeCurrentValues=a)}).addCase(Xe,(t,r)=>{Sc(t[r.payload]?.request)}).addCase(ft,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>Sc(r))}).addCase(cs,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>Sc(r))}).addCase(Kr,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(Ac,(t,r)=>{yc(t,r.payload)}).addCase(ti,(t,r)=>{let{facetId:n,numberOfValues:a}=r.payload;Om(t[n]?.request,a)}).addCase(ri,(t,r)=>{let{facetId:n,isFieldExpanded:a}=r.payload,o=t[n]?.request;o&&(o.isFieldExpanded=a)}).addCase(G.fulfilled,(t,r)=>{r.payload.response.facets.forEach(a=>XE(t[a.facetId]?.request,a))}).addCase(Ar.fulfilled,(t,r)=>{r.payload.response.facets.forEach(a=>XE(t[a.facetId]?.request,a))}).addCase(ni,(t,r)=>{let{facetId:n,value:a}=r.payload,o=t[n]?.request;if(!o)return;let{rawValue:i}=a,{currentValues:p}=o,f=p.find(g=>g.value===i);if(f){f.state="selected";return}let m=ZE(i);Vm(o,m),o.freezeCurrentValues=!0,o.preventAutoSelect=!0}).addCase(ai,(t,r)=>{let{facetId:n,value:a}=r.payload,o=t[n]?.request;if(!o)return;let{rawValue:i}=a,{currentValues:p}=o,f=p.find(g=>g.value===i);if(f){f.state="excluded";return}let m=eI(i);Vm(o,m),o.freezeCurrentValues=!0,o.preventAutoSelect=!0}).addCase(Je,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];Sc(n)}).addCase(ht,(t,r)=>{let n=r.payload;Object.keys(t).forEach(a=>{let o=t[a];(o.tabs?.included?.length||o.tabs?.excluded?.length)&&!tr(o.tabs,n)&&Sc(o.request)})})});function Vm(e,t){let{currentValues:r}=e,n=r.findIndex(o=>o.state==="idle"),a=n===-1?r.length:n;e.currentValues.splice(a,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function XE(e,t){e&&(e.currentValues=t.values.map(RQ),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var _l={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function wQ(e){return{..._l,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function RQ(e){let{value:t,state:r}=e;return{value:t,state:r}}function ZE(e){return{value:e,state:"selected"}}function eI(e){return{value:e,state:"excluded"}}function FQ(e){return{...e,state:"idle"}}d();c();l();u();var Lm=()=>Y("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function za(e){let t=tI(e.start,e),r=tI(e.end,e),n=e.endInclusive??!1,a=e.state??"idle";return{start:t,end:r,endInclusive:n,state:a}}function tI(e,t){let{dateFormat:r}=t;return nw(e)?(Ea(e),ew(e)):typeof e=="string"&&Xr(e)?(Ea(e),e):(dp(e,r),ol(xo(e,r)))}d();c();l();u();var wc=T("rangeFacet/updateSortCriterion",e=>O(e,{facetId:he,criterion:new Le({required:!0})}));d();c();l();u();var oi={state:z,start:new ee({required:!0}),end:new ee({required:!0}),endInclusive:new ce({required:!0}),numberOfResults:new ee({required:!0,min:0})},ii={start:z,end:z,endInclusive:new ce({required:!0}),state:z,numberOfResults:new ee({required:!0,min:0})},si=e=>({facetId:he,selection:typeof e.start=="string"?new J({values:ii}):new J({values:oi})});var EQ={start:z,end:z,endInclusive:new ce({required:!0}),state:z},IQ={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),activeTab:new M({required:!1}),currentValues:new oe({required:!1,each:new J({values:EQ})}),generateAutomaticRanges:new ce({required:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),rangeAlgorithm:new Le({required:!1})};function rI(e){return Xr(e)?sl(e):e}function Um(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=za(t);if(xo(rI(r)).isAfter(xo(rI(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var An=T("dateFacet/register",e=>{try{return dr(e,IQ),Um(e),{payload:e,error:null}}catch(t){return{payload:e,error:Dn(t)}}}),xn=T("dateFacet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:ii})})),Cn=T("dateFacet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:ii})})),oa=T("dateFacet/updateFacetValues",e=>{try{return dr(e,{facetId:he,values:new oe({each:new J({values:ii})})}),Um({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Dn(t)}}}),Qm=wc,Bm=Xe;d();c();l();u();d();c();l();u();var Gm=(e,{facetId:t,selection:r})=>{let a=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,o=`${a}_${t}`;return{facetId:t,facetField:a,facetTitle:o,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},$m=()=>({actionCause:"breadcrumbFacet"});var Dl=e=>Y("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,si(e.selection));let n=Gm(r,e);return t.makeBreadcrumbFacet(n)}),Yv=$m;d();c();l();u();function TQ(e,t){return!!t&&t.facetId in e.dateFacetSet}var nI=(e,t)=>{let r=_r(e,t);if(TQ(e,r))return r},aI=(e,t)=>(nI(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),oI=(e,t)=>(nI(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var zm={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function Wm(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let a=iI(r);r.numberOfValues=a,e[n]=t}function Km(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=iI(n))}function Ym(e,t,r){let n=e[t]?.request;if(!n)return;let a=Hm(n.currentValues,r);if(!a)return;let o=a.state==="selected";a.previousState=a.state,a.state=o?"idle":"selected",n.preventAutoSelect=!0}function Jm(e,t,r){let n=e[t]?.request;if(!n)return;let a=Hm(n.currentValues,r);if(!a)return;let o=a.state==="excluded";a.previousState=a.state,a.state=o?"idle":"excluded",n.preventAutoSelect=!0}function bn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function Xm(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let a=t[r]||[];n.currentValues.forEach(p=>(!!Hm(a,p)&&(p.state="selected"),p));let o=a.filter(p=>!Hm(n.currentValues,p)),i=n.currentValues;i.push(...o),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function Zm(e,t,r){t.forEach(n=>{let a=n.facetId,o=e[a]?.request;if(!o)return;let i=r(n.values);o.currentValues=i,o.preventAutoSelect=!1})}function Hm(e,t){let{start:r,end:n}=t;return e.find(a=>a.start===r&&a.end===n)}function iI(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var wn=ae(Hi(),e=>{e.addCase(An,(t,r)=>{let{payload:n}=r,{tabs:a}=n,o=PQ(n);Wm(t,mb(o,a))}).addCase(_e.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.df||{};Xm(t,n)}).addCase(xn,(t,r)=>{let{facetId:n,selection:a}=r.payload;Ym(t,n,a)}).addCase(Cn,(t,r)=>{let{facetId:n,selection:a}=r.payload;Jm(t,n,a)}).addCase(oa,(t,r)=>{let{facetId:n,values:a}=r.payload;Km(t,n,a)}).addCase(Bm,(t,r)=>{bn(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{bn(t,r)})}).addCase(Qm,(t,r)=>{yc(t,r.payload)}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.facets;Zm(t,n,kQ)}).addCase(Je,(t,r)=>{bn(t,r.payload)}).addCase(ht,(t,r)=>{let n=r.payload;Object.keys(t).forEach(a=>{let o=t[a];(o.tabs?.included?.length||o.tabs?.excluded?.length)&&!tr(o.tabs,n)&&bn(t,a)})})});function PQ(e){return{...zm,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function kQ(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var OQ={state:z,start:new ee({required:!0}),end:new ee({required:!0}),endInclusive:new ce({required:!0})},NQ={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),activeTab:new M({required:!1}),currentValues:new oe({required:!1,each:new J({values:OQ})}),generateAutomaticRanges:new ce({required:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),rangeAlgorithm:new Le({required:!1})};function eg(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var Rn=T("numericFacet/register",e=>{try{return O(e,NQ),eg(e),{payload:e,error:null}}catch(t){return{payload:e,error:Dn(t)}}}),Fn=T("numericFacet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:oi})})),En=T("numericFacet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:oi})})),ia=T("numericFacet/updateFacetValues",e=>{try{return dr(e,{facetId:he,values:new oe({each:new J({values:oi})})}),eg({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Dn(t)}}}),tg=wc,rg=Xe;d();c();l();u();var ql=e=>Y("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,si(e.selection));let n=Gm(r,e);return t.makeBreadcrumbFacet(n)}),Jv=$m;d();c();l();u();function _Q(e,t){return!!t&&t.facetId in e.numericFacetSet}var sI=(e,t)=>{let r=_r(e,t);if(_Q(e,r))return r},cI=(e,t)=>(sI(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),uI=(e,t)=>(sI(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var Fr=ae(zi(),e=>{e.addCase(Rn,(t,r)=>{let{payload:n}=r,{tabs:a}=n,o=DQ(n);Wm(t,gb(o,a))}).addCase(_e.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.nf||{};Xm(t,n)}).addCase(Fn,(t,r)=>{let{facetId:n,selection:a}=r.payload;Ym(t,n,a)}).addCase(En,(t,r)=>{let{facetId:n,selection:a}=r.payload;Jm(t,n,a)}).addCase(ia,(t,r)=>{let{facetId:n,values:a}=r.payload;Km(t,n,a)}).addCase(rg,(t,r)=>{bn(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{bn(t,r)})}).addCase(tg,(t,r)=>{yc(t,r.payload)}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.facets;Zm(t,n,qQ)}).addCase(Je,(t,r)=>{bn(t,r.payload)}).addCase(ht,(t,r)=>{let n=r.payload;Object.keys(t).forEach(a=>{let o=t[a];(o.tabs?.included?.length||o.tabs?.excluded?.length)&&!tr(o.tabs,n)&&bn(t,a)})})});function DQ(e){return{...zm,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function qQ(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var ci=z,ng=new J({options:{required:!0},values:{caption:Ue,expression:Ue,state:new M({constrainTo:["idle","selected","excluded"]})}}),ag=new oe({required:!0,each:ng});var Rc=T("staticFilter/register",e=>O(e,{id:ci,values:ag})),sa=T("staticFilter/toggleSelect",e=>O(e,{id:ci,value:ng})),ca=T("staticFilter/toggleExclude",e=>O(e,{id:ci,value:ng})),Wa=T("staticFilter/deselectAllFilterValues",e=>O(e,ci)),og=e=>Y("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),Fc=e=>Y("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),ig=e=>Y("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e));d();c();l();u();d();c();l();u();function ne(e){let t,r=new Map,n=()=>r.size===0,a=o=>{try{let i=JSON.stringify(o),p=t!==i;return t=i,p}catch(i){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",i),!0}};return{subscribe(o){o();let i=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{a(this.state)&&r.forEach(f=>f())})),r.set(i,o),()=>{r.delete(i),n()&&p?.()}},get state(){return{}}}}var sg=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function lI(e){let t=ne(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(ft())},deselectBreadcrumb(n){n.deselect()}}}function dI(e){if(!MQ(e))throw W;let t=lI(e),{dispatch:r}=e,n=()=>e.state,a=()=>{let w={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:b,selection:F})=>{r(yn({facetId:b,selection:F})),r(ta({facetId:b,freezeCurrentValues:!1})),r(G({legacy:bc({facetId:b,facetValue:F.value}),next:Mm()}))},executeToggleExclude:({facetId:b,selection:F})=>{r(Sn({facetId:b,selection:F})),r(ta({facetId:b,freezeCurrentValues:!1})),r(G({legacy:bc({facetId:b,facetValue:F.value}),next:Mm()}))},facetValuesSelector:db};return sg(w)},o=()=>{let w={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:b=>{r(Fn(b)),r(G({legacy:ql(b),next:Jv()}))},executeToggleExclude:b=>{r(En(b)),r(G({legacy:ql(b),next:Jv()}))},facetValuesSelector:cI};return sg(w)},i=()=>{let w={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:b=>{r(xn(b)),r(G({legacy:Dl(b),next:Yv()}))},executeToggleExclude:b=>{r(Cn(b)),r(G({legacy:Dl(b),next:Yv()}))},facetValuesSelector:oI};return sg(w)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(w=>w.path.length),f=w=>{let b=fb(n(),w);return{facetId:w,field:n().categoryFacetSet[w].request.field,path:b,deselect:()=>{r(ln(w)),r(G({legacy:km({categoryFacetPath:b.map(F=>F.value),categoryFacetId:w}),next:QE()}))}}},m=()=>{let w=n().staticFilterSet??{};return Object.values(w).map(g)},g=w=>{let{id:b,values:F}=w,E=F.filter(P=>P.state!=="idle").map(P=>A(b,P));return{id:b,values:E}},A=(w,b)=>({value:b,deselect:()=>{let{caption:F,expression:E}=b;b.state==="selected"?r(sa({id:w,value:b})):b.state==="excluded"&&r(ca({id:w,value:b})),r(G({legacy:Fc({staticFilterId:w,staticFilterValue:{caption:F,expression:E}})}))}}),x=()=>{let w=n().automaticFacetSet?.set??{};return Object.values(w).map(b=>h(b.response)).filter(b=>b.values.length>0)},h=w=>{let{field:b,label:F}=w,E=w.values.filter(P=>P.state!=="idle").map(P=>C(b,P));return{facetId:b,field:b,label:F,values:E}},C=(w,b)=>({value:b,deselect:()=>{r(cn({field:w,selection:b})),r(G({legacy:bc({facetId:w,facetValue:b.value}),next:Mm()}))}});function R(){return!![...a(),...o(),...i(),...p(),...m(),...x()].length}return{...t,get state(){return{facetBreadcrumbs:a(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:o(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:x(),hasBreadcrumbs:R()}},deselectAll:()=>{t.deselectAll(),r(G({legacy:Lm(),next:{actionCause:"breadcrumbResetAll"}}))}}}function MQ(e){return e.addReducers({configuration:ue,search:fe,facetSet:Rr,numericFacetSet:Fr,dateFacetSet:wn,categoryFacetSet:dn}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var jQ=new oe({each:z,required:!0}),pI=(e,t)=>(O(e,z),Ci(t)?O(t,z):O(t,jQ),{payload:{contextKey:e,contextValue:t}}),ui=T("context/set",e=>{for(let[t,r]of Object.entries(e))pI(t,r);return{payload:e}}),li=T("context/add",e=>pI(e.contextKey,e.contextValue)),di=T("context/remove",e=>O(e,z));d();c();l();u();var cg=ae(hp(),e=>{e.addCase(ui,(t,r)=>{t.contextValues=r.payload}).addCase(li,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(di,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();var VQ=["caseId","caseNumber"],LQ={caseId:"caseContext",caseNumber:"caseContext"},Ml=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${LQ[t]} to set this value.}`)}};function Xv(e){return VQ.includes(e)}var UQ=new ge({values:new J({options:{required:!1}})});function fI(e,t={}){if(!GQ(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state,o=lt(e,UQ,t.initialState,"buildContext");return o.values&&n(ui(o.values)),{...r,get state(){return{values:a().context.contextValues}},set(i){n(ui(i))},...(a().configuration.analytics.analyticsMode==="legacy"?QQ(n):BQ(n))}}var QQ=e=>({add(t,r){e(li({contextKey:t,contextValue:r}))},remove(t){e(di(t))}}),BQ=e=>({add(t,r){if(Xv(t))throw new Ml(t);e(li({contextKey:t,contextValue:r}))},remove(t){if(Xv(t))throw new Ml(t);e(di(t))}});function GQ(e){return e.addReducers({context:cg}),!0}function mI(e,t){return fI(e,t)}d();c();l();u();d();c();l();u();var xt=ae(Sp(),e=>{e.addCase(be,(t,r)=>({...t,...r.payload})).addCase(G.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(G.rejected,t=>{t.freezeFacetOrder=!1}).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(un,(t,r)=>{let{facetId:n,tabs:a}=r.payload;ug(a,t,n)}).addCase(hn,(t,r)=>{let{facetId:n,tabs:a}=r.payload;ug(a,t,n)}).addCase(An,(t,r)=>{let{facetId:n,tabs:a}=r.payload;ug(a,t,n)}).addCase(Rn,(t,r)=>{let{facetId:n,tabs:a}=r.payload;ug(a,t,n)}).addCase(jt,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(Je,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(De,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=wS()),t.facets[n].enabled=!0})})});function ug(e,t,r){let n={...wS(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var Ec=ae(Cp(),e=>{e.addCase($s,(t,r)=>{let n=r.payload,{id:a}=n;a in t||(t[a]={...n,isActive:!1})}).addCase(ht,(t,r)=>{let n=r.payload;gI(t,n)}).addCase(ns,(t,r)=>{let n=r.payload;gI(t,n)}).addCase(_e.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(De,(t,r)=>{let n=r.payload.tab;le(n)||Object.keys(t).forEach(a=>{t[a].isActive=a===n})})});function gI(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function lg(e){if(!$Q(e))throw W;let t=ne(e),r=Ye(n=>n.tabSet,n=>Object.values(n).find(o=>o.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function $Q(e){return e.addReducers({tabSet:Ec}),!0}function hI(e,t){if(!HQ(e))throw W;let r=lg(e),n=C=>e.state.facetOptions.facets[C]?.enabled??!1,a=C=>e.state.facetSet?.[C]?.request?.currentValues??e.state.categoryFacetSet?.[C]?.request?.currentValues??e.state.numericFacetSet?.[C]?.request?.currentValues??e.state.dateFacetSet?.[C]?.request?.currentValues??null,o=C=>C in e.state.facetOptions.facets,i=C=>e.state.facetOptions.facets[C]?.tabs,p=()=>wi({isFacetRegistered:o(t.facetId),parentFacets:t.conditions.map(({parentFacetId:C})=>o(C)?{enabled:n(C),values:a(C)}:null),isTabEnabled:tr(i(t.facetId),r.state.activeTab)}),f=()=>{let C=p();return C===x?!1:(x=C,!0)},m=()=>t.conditions.length>0?t.conditions.some(C=>{if(!n(C.parentFacetId))return!1;let R=a(C.parentFacetId);return R===null?!1:C.condition(R)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([C,R])=>R.request.freezeCurrentValues&&e.dispatch(ta({facetId:C,freezeCurrentValues:!1})))},A=()=>{if(!o(t.facetId))return;let C=n(t.facetId),R=m(),w=tr(i(t.facetId),r.state.activeTab),b=R&&w;C!==b&&(e.dispatch(b?jt(t.facetId):Je(t.facetId)),g())},x=p(),h=e.subscribe(()=>{f()&&A()});return A(),{stopWatching(){h()}}}function HQ(e){return e.addReducers({facetOptions:xt}),!0}d();c();l();u();d();c();l();u();var Ic=T("dictionaryFieldContext/set",e=>{let t=new J({options:{required:!0}}),r=O(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),a=new oe({each:Ue}),o=O(n,a).error;return o?{payload:e,error:o}:{payload:e}}),Tc=T("dictionaryFieldContext/add",e=>{let t=new J({options:{required:!0},values:{field:Ue,key:Ue}});return O(e,t)}),Pc=T("dictionaryFieldContext/remove",e=>O(e,Ue));d();c();l();u();var dg=ae(yp(),e=>{e.addCase(Ic,(t,r)=>{t.contextValues=r.payload}).addCase(Tc,(t,r)=>{let{field:n,key:a}=r.payload;t.contextValues[n]=a}).addCase(Pc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function yI(e){if(!zQ(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(a){r(Ic(a))},add(a,o){r(Tc({field:a,key:o}))},remove(a){r(Pc(a))}}}function zQ(e){return e.addReducers({dictionaryFieldContext:dg}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var SI=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var pg=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),vI=()=>({correctedQuery:"",corrections:[],originalQuery:""});function AI(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:pg(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var xI=(e,t)=>{let r={...vI(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var fg=ae(AI(),e=>{e.addCase(vs,t=>{t.enableDidYouMean=!0}).addCase(fp,t=>{t.enableDidYouMean=!1}).addCase(mp,t=>{t.automaticallyCorrectQuery=!0}).addCase(As,t=>{t.automaticallyCorrectQuery=!1}).addCase(G.pending,t=>{t.queryCorrection=pg(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(G.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:a}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let o=a?.[0]?a[0]:pg();t.queryCorrection=o}t.queryCorrectionMode==="next"&&xI(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(hr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(Co,(t,r)=>{t.queryCorrectionMode=r.payload})});function CI(e,t={}){if(!WQ(e))throw W;let r=ne(e),{dispatch:n}=e;n(vs()),t.options?.automaticallyCorrectQuery===!1&&n(As()),n(Co(t.options?.queryCorrectionMode||"next"));let a=()=>e.state,o=()=>SI(a().didYouMean);return{...r,get state(){let i=a();return{originalQuery:i.didYouMean.originalQuery,wasCorrectedTo:i.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:i.didYouMean.wasAutomaticallyCorrected,queryCorrection:i.didYouMean.queryCorrection,hasQueryCorrection:o()}},applyCorrection(){n(hr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(Co(i))}}}function WQ(e){return e.addReducers({configuration:ue,didYouMean:fg}),!0}function bI(e,t={}){let r=CI(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(G({legacy:gp(),next:cw()}))}}}d();c();l();u();d();c();l();u();function wI(e){if(!KQ(e))throw W;let t=ne(e),r=()=>e.state;return{...t,sort(n){return cl(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(o=>o.facetId)}}}}function KQ(e){return e.addReducers({search:fe,facetOptions:xt}),!0}function RI(e){return wI(e)}d();c();l();u();d();c();l();u();var mg=ae(Bi(),e=>{e.addCase(G.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(a=>{t.set[a.field]={response:a}})}).addCase(dc,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(cn,(t,r)=>{let{field:n,selection:a}=r.payload,o=t.set[n]?.response;if(!o)return;let i=o.values.find(f=>f.value===a.value);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(pc,(t,r)=>{let n=r.payload,a=t.set[n]?.response;if(a)for(let o of a.values)o.state="idle"}).addCase(De,(t,r)=>{let n=r.payload.af??{},a=Object.keys(t.set);for(let o in n)if(!t.set[o]){let i=YQ(o),p=n[o].map(f=>FI(f));i.values.push(...p),t.set[o]={response:i}}for(let o of a)if(!(o in n)){let i=t.set[o]?.response;for(let p of i.values)p.state="idle"}for(let o in n){let i=t.set[o]?.response;if(i){let p=i.values,f=new Set(n[o]);for(let m of p)f.has(m.value)?(m.state="selected",f.delete(m.value)):m.state="idle";for(let m of f)i.values.push(FI(m))}}}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.automaticFacetSet.set).length!==0)return r.payload.automaticFacetSet}).addCase(ft,t=>{Object.values(t.set).forEach(({response:r})=>{r.values.forEach(n=>{n.state="idle"})})})});function YQ(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function FI(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var gg=e=>e.state==="selected",hg=e=>e.state==="excluded",yg=(e,t)=>{let r={facetId:e,facetValue:t.value};return gg(t)?Ur(r):at(r)},Sg=e=>gg(e)?aa():gt(),EI=(e,t)=>{let r={facetId:e,facetValue:t.value};return hg(t)?ra(r):ur(r)},II=e=>hg(e)?YE():na();function TI(e,t){let{dispatch:r}=e,n=ne(e),{field:a}=t;return{...n,toggleSelect(o){r(cn({field:a,selection:o})),r(G({legacy:yg(a,o),next:Sg(o)}))},deselectAll(){r(pc(a)),r(G({legacy:At(a),next:Vt()}))},get state(){let o=e.state.automaticFacetSet?.set[a]?.response;return o?{field:o.field,label:o.label,values:o.values}:{field:"",values:[],label:""}}}}d();c();l();u();function PI(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function kI(e,t){if(!JQ(e))throw W;let{dispatch:r}=e,n=PI(t.options);return r(dc(n)),{...ne(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>TI(e,{field:i.field}))??[]}}}}function JQ(e){return e.addReducers({automaticFacetSet:mg,configuration:ue,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function vg(e,t,r){let{facetId:n}=t;if(e[n])return;let a=!1,o={...In,...t},i=r();e[n]={options:o,isLoading:a,response:i,initialNumberOfValues:o.numberOfValues,requestId:""}}function Ag(e,t){let{facetId:r,...n}=t,a=e[r];a&&(a.options={...a.options,...n})}function xg(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function Cg(e,t){let r=e[t];r&&(r.isLoading=!1)}function bg(e,t,r){let{facetId:n,response:a}=t,o=e[n];o&&o.requestId===r&&(o.isLoading=!1,o.response=a)}function jl(e,t,r){let{facetId:n}=t,a=e[n];a&&(a.requestId="",a.isLoading=!1,a.response=r(),a.options.numberOfValues=a.initialNumberOfValues,a.options.query=In.query)}function wg(e,t){Object.keys(e).forEach(r=>jl(e,{facetId:r},t))}var In={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var OI=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(e,t,r,n){let a=t.categoryFacetSearchSet[e].options,o=t.categoryFacetSet[e].request,{captions:i,query:p,numberOfValues:f}=a,{field:m,delimitingCharacter:g,basePath:A,filterFacetCount:x}=o,h=XQ(o),C=h.length?[h]:[],R=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??ut(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:A,captions:i,numberOfValues:f,query:R,field:m,delimitingCharacter:g,ignorePaths:C,filterFacetCount:x,type:"hierarchical",...(n?{}:{searchContext:(yield Sr(t,r)).request})}});return function OI(_x156,_x157,_x158,_x159){return _ref71.apply(this,arguments)}}(),XQ=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var NI=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(e,t,r,n){let{captions:a,query:o,numberOfValues:i}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,g=f.filter(x=>x.state!=="idle").map(x=>x.value),A=`*${o}*`;return{url:t.configuration.search.apiBaseUrl??ut(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:a,numberOfValues:i,query:A,field:p,ignoreValues:g,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield Sr(t,r)).request})}});return function NI(_x160,_x161,_x162,_x163){return _ref72.apply(this,arguments)}}();var _I=e=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:a,navigatorContext:o}}){let i=r(),p;a(t,z),ZQ(i,t)?p=yield NI(t,i,o,e):p=yield OI(t,i,o,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x164,_x165){return _ref73.apply(this,arguments)}}()),Ct=Se("facetSearch/executeSearch",_I(!1)),Tn=Se("facetSearch/executeSearch",_I(!0)),kc=T("facetSearch/clearResults",e=>O(e,{facetId:he})),ZQ=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function DI(){return{}}var Oc=ae(DI(),e=>{e.addCase(hc,(t,r)=>{let n=r.payload;vg(t,n,Zv)}).addCase(Ha,(t,r)=>{Ag(t,r.payload)}).addCase(Ct.pending,(t,r)=>{let n=r.meta.arg;xg(t,n,r.meta.requestId)}).addCase(Ct.rejected,(t,r)=>{let n=r.meta.arg;Cg(t,n)}).addCase(Ct.fulfilled,(t,r)=>{bg(t,r.payload,r.meta.requestId)}).addCase(kc,(t,{payload:{facetId:r}})=>{jl(t,{facetId:r},Zv)}).addCase(G.fulfilled,t=>{wg(t,Zv)})});function Zv(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function qI(e,t){let{field:r,state:n}=e;if(!eB(e))return r;let a=`${r}_`,o=tB(a,n);return nB(r,t),`${a}${o}`}function eB(e){let{field:t,state:r}=e;return MI(r).some(a=>a&&t in a)}function tB(e,t){let n=MI(t).map(a=>Object.keys(a||{})).reduce((a,o)=>a.concat(o),[]);return rB(n,e)+1}function MI(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:a}=e;return[t,r,n,a]}function rB(e,t){return e.map(o=>{let i=o.split(t)[1],p=parseInt(i,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function nB(e,t){let r=`A facet with field "${e}" already exists.
45
- To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function Lt(e,t){let{state:r,logger:n}=e,{field:a,facetId:o}=t;return o||qI({field:a,state:r},n)}d();c();l();u();d();c();l();u();var jI=["alphanumeric","occurrences"];var VI=new ge({field:fn,tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),basePath:HE,delimitingCharacter:zE,facetId:pn,facetSearch:vc,filterByBasePath:WE,filterFacetCount:mn,injectionDepth:gn,numberOfValues:Lr,sortCriteria:new M({constrainTo:jI})});function LI(e,t){if(!aB(e))throw W;let r=ne(e),{dispatch:n}=e,a=Lt(e,t.options),o=t.options.tabs??{},i=Gt(e.state.tabSet),p={...Nl,...rd("facetSearch",t.options),field:t.options.field,facetId:a,tabs:o,activeTab:i},f={facetSearch:{...In,...t.options.facetSearch},...p};Be(e,VI,f,"buildCategoryFacet");let m=()=>Ky(e.state,a),g=()=>Wy(e.state,a),A=()=>Hr(e.state),x=()=>en(e.state,a);return n(un(p)),{...r,toggleSelect(h){let C=f.numberOfValues;n($a({facetId:a,selection:h,retrieveCount:C})),n(be())},deselectAll(){n(ln(a)),n(be())},sortBy(h){n(mc({facetId:a,criterion:h})),n(be())},isSortedBy(h){return m().sortCriteria===h},showMoreValues(){let{numberOfValues:h}=f,{activeValue:C,valuesAsTrees:R}=this.state,w=(C?.children.length??R.length)+h;n(ei({facetId:a,numberOfValues:w})),n(be())},showLessValues(){let{numberOfValues:h}=f;n(ei({facetId:a,numberOfValues:h})),n(be())},enable(){n(jt(a))},disable(){n(Je(a))},get state(){let h=m(),C=g(),R=A(),w=x(),b=C?.values??[],F=b.some(U=>U.children.length>0)??!1,{parents:E,values:P}=pb(C?.values),V=or(b),_=V.length?V[V.length-1]:void 0,k=!!_,N=_?.moreValuesAvailable??C?.moreValuesAvailable??!1,q=_?_.children.length>f.numberOfValues:b.length>f.numberOfValues;return{facetId:a,parents:E,selectedValueAncestry:V,values:P,isHierarchical:F,valuesAsTrees:b,activeValue:_,isLoading:R,hasActiveValues:k,canShowMoreValues:N,canShowLessValues:q,sortCriteria:h.sortCriteria,enabled:w}}}}function aB(e){return e.addReducers({categoryFacetSet:dn,categoryFacetSearchSet:Oc,facetOptions:xt,configuration:ue,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var oB="coveo-headless-internal-state",Rg=Symbol.for(oB);d();c();l();u();function Nc(e,t){let r=e.dispatch,{options:n,getFacetSearch:a,executeFacetSearchActionCreator:o,executeFieldSuggestActionCreator:i}=t,{facetId:p}=n;return{updateText(f){r(Ha({facetId:p,query:f,numberOfValues:a().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:f,options:m}=a();r(Ha({facetId:p,numberOfValues:m.numberOfValues+f})),r(t.isForFieldSuggestions?i(p):o(p))},search(){r(t.isForFieldSuggestions?i(p):o(p))},clear(){r(kc({facetId:p}))},updateCaptions(f){r(Ha({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:g}=a(),{query:A}=g,x=f.values;return{...f,values:x,isLoading:m,query:A}}}}function UI(e,t){let{dispatch:r}=e,n={...In,...t.options},{facetId:a}=n,o=()=>"state"in e?e.state.categoryFacetSearchSet[a]:e[Rg].categoryFacetSearchSet[a];r(hc(n));let i=Nc(e,{options:n,getFacetSearch:o,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(gc({facetId:a,value:p})),t.select(p)},get state(){return i.state}}}function Fg(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:a,isForFieldSuggestions:o}=t,{dispatch:i}=e,p={...In,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],g=UI(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:a,isForFieldSuggestions:o});i(hc(p));let A=Nc(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:Ct,executeFieldSuggestActionCreator:Tn});return{...A,...g,get state(){return{...A.state,...g.state}}}}function QI(e,t){if(!iB(e))throw W;let r=LI(e,t),{dispatch:n}=e,a=()=>r.state.facetId,o=Fg(e,{options:{facetId:a(),...t.options.facetSearch},executeFacetSearchActionCreator:Ct,executeFieldSuggestActionCreator:Tn,select:f=>{n(be()),n(G({legacy:at({facetId:a(),facetValue:f.rawValue}),next:gt()}))},isForFieldSuggestions:!1}),{state:i,...p}=o;return{...r,facetSearch:p,toggleSelect(f){r.toggleSelect(f),n(G({legacy:sB(a(),f),next:cB(f)}))},deselectAll(){r.deselectAll(),n(G({legacy:At(a()),next:Vt()}))},sortBy(f){r.sortBy(f),n(G({legacy:vn({facetId:a(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(Ar({legacy:xc(a())}))},showLessValues(){r.showLessValues(),n(Ar({legacy:Cc(a())}))},get state(){return{...r.state,facetSearch:o.state}}}}function iB(e){return e.addReducers({categoryFacetSet:dn,categoryFacetSearchSet:Oc,configuration:ue,search:fe}),!0}function sB(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Ur(r):at(r)}function cB(e){return e.state==="selected"?aa():gt()}d();c();l();u();d();c();l();u();d();c();l();u();function BI(){return{}}var _c=ae(BI(),e=>{e.addCase(jm,(t,r)=>{let n=r.payload;vg(t,n,eA)}).addCase(Ha,(t,r)=>{Ag(t,r.payload)}).addCase(Ct.pending,(t,r)=>{let n=r.meta.arg;xg(t,n,r.meta.requestId)}).addCase(Ct.rejected,(t,r)=>{let n=r.meta.arg;Cg(t,n)}).addCase(Ct.fulfilled,(t,r)=>{bg(t,r.payload,r.meta.requestId)}).addCase(kc,(t,{payload:r})=>{jl(t,r,eA)}).addCase(G.fulfilled,t=>{wg(t,eA)})});function eA(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var GI={facetId:he,selection:new J({values:Zo})},$I=Se("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:a}}=r;a({facetId:e,selection:t},GI),n(yn({facetId:e,selection:t})),n(be())}),HI=Se("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:a}}=r;a({facetId:e,selection:t},GI),n(Sn({facetId:e,selection:t})),n(be())});d();c();l();u();d();c();l();u();var Dc=["allValues","atLeastOneValue"];d();c();l();u();var Eg=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var zI=new ge({facetId:pn,tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),field:fn,filterFacetCount:mn,injectionDepth:gn,numberOfValues:Lr,sortCriteria:new M({constrainTo:Eg}),resultsMustMatch:new M({constrainTo:Dc}),facetSearch:vc});function WI(e,t,r=zI){if(!uB(e))throw W;let{dispatch:n}=e,a=ne(e),o=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={..._l,...rd("facetSearch",t.options),field:t.options.field,facetId:o,tabs:i,activeTab:p},m={facetSearch:{...In,...t.options.facetSearch},...f};Be(e,r,m,"buildFacet");let g=()=>Bd(e.state,o),A=()=>Gi(e.state,o),x=()=>Hr(e.state),h=()=>en(e.state,o),C=()=>{let{currentValues:w}=g();return w.filter(b=>b.state!=="idle").length},R=()=>{let{currentValues:w}=g(),b=m.numberOfValues,F=!!w.find(E=>E.state==="idle");return b<w.length&&F};return n(hn(f)),{...a,toggleSelect:w=>n($I({facetId:m.facetId,selection:w})),toggleExclude:w=>n(HI({facetId:m.facetId,selection:w})),toggleSingleSelect:function(w){w.state==="idle"&&n(Xe(o)),this.toggleSelect(w)},toggleSingleExclude:function(w){w.state==="idle"&&n(Xe(o)),this.toggleExclude(w)},isValueSelected:gg,isValueExcluded:hg,deselectAll(){n(Xe(o)),n(be())},sortBy(w){n(Ac({facetId:o,criterion:w})),n(be())},isSortedBy(w){return this.state.sortCriterion===w},showMoreValues(){let w=g().numberOfValues,b=m.numberOfValues,F=b-w%b,E=w+F;n(ti({facetId:o,numberOfValues:E})),n(ri({facetId:o,isFieldExpanded:!0})),n(be())},showLessValues(){let w=m.numberOfValues,b=Math.max(w,C());n(ti({facetId:o,numberOfValues:b})),n(ri({facetId:o,isFieldExpanded:!1})),n(be())},enable(){n(jt(o))},disable(){n(Je(o))},get state(){let w=g(),b=A(),F=x(),E=h(),P;typeof w.sortCriteria=="object"?P=w.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":P=w.sortCriteria;let V=b?b.values:[],_=V.some(q=>q.state!=="idle"),k=b?b.moreValuesAvailable:!1,N=w.resultsMustMatch;return{label:b?.label,facetId:o,tabs:i,values:V,sortCriterion:P,resultsMustMatch:N,isLoading:F,hasActiveValues:_,canShowMoreValues:k,canShowLessValues:R(),enabled:E}}}}function uB(e){return e.addReducers({facetSet:Rr,facetOptions:xt,configuration:ue,facetSearchSet:_c}),!0}d();c();l();u();function Ig(e,t){let{dispatch:r}=e,{options:n,select:a,exclude:o,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f}=t,{facetId:m}=n,g=()=>"state"in e?e.state.facetSearchSet[m]:e[Rg].facetSearchSet[m];r(jm(n));let A=Nc(e,{options:n,getFacetSearch:g,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...A,select(x){r(ni({facetId:m,value:x})),a(x)},exclude(x){r(ai({facetId:m,value:x})),o(x)},singleSelect(x){r(Xe(m)),r(ni({facetId:m,value:x})),a(x)},singleExclude(x){r(Xe(m)),r(ai({facetId:m,value:x})),o(x)},get state(){let{values:x}=A.state;return{...A.state,values:x.map(({count:h,displayValue:C,rawValue:R})=>({count:h,displayValue:C,rawValue:R}))}}}}d();c();l();u();var KI=new ge({facetId:pn,field:fn,tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),filterFacetCount:mn,injectionDepth:gn,numberOfValues:Lr,sortCriteria:new M({constrainTo:Eg}),resultsMustMatch:new M({constrainTo:Dc}),facetSearch:vc,allowedValues:Dm,hasBreadcrumbs:KE,customSort:qm});function YI(e,t){if(!lB(e))throw W;let{dispatch:r}=e,n=WI(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},KI),a=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return Ig(e,{options:{facetId:a(),...m},select:g=>{r(be()),r(G({legacy:at({facetId:a(),facetValue:g.rawValue}),next:gt()}))},exclude:g=>{r(be()),r(G({legacy:ur({facetId:a(),facetValue:g.rawValue}),next:na()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:Ct,executeFieldSuggestActionCreator:Tn})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(G({legacy:yg(a(),m),next:Sg(m)}))},toggleExclude(m){n.toggleExclude(m),r(G({legacy:EI(a(),m),next:II(m)}))},deselectAll(){n.deselectAll(),r(G({legacy:At(a()),next:Vt()}))},sortBy(m){n.sortBy(m),r(G({legacy:vn({facetId:a(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(Ar({legacy:xc(a())}))},showLessValues(){n.showLessValues(),r(Ar({legacy:Cc(a())}))},get state(){return{...n.state,facetSearch:i.state}}}}function lB(e){return e.addReducers({facetSet:Rr,configuration:ue,facetSearchSet:_c,search:fe}),!0}d();c();l();u();d();c();l();u();var Tg=e=>e.state==="selected",tA=e=>e.state==="excluded",Pg=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Tg(t)?Ur(n):at(n)},kg=e=>Tg(e)?aa():gt(),JI=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return tA(t)?ra(n):ur(n)};d();c();l();u();d();c();l();u();d();c();l();u();var Og=T("rangeFacet/executeToggleSelect",e=>O(e,si(e.selection))),Ng=T("rangeFacet/executeToggleExclude",e=>O(e,si(e.selection)));var XI={facetId:he,selection:new J({values:ii})},ZI=Se("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,XI),t(xn(e)),t(Og(e)),t(be())}),eT=Se("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,XI),t(Cn(e)),t(Ng(e)),t(be())});d();c();l();u();function _g(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function Dg(e,t){let{facetId:r,getRequest:n}=t,a=ne(e),o=e.dispatch,i=()=>en(e.state,r);return{...a,isValueSelected:Tg,isValueExcluded:tA,deselectAll(){o(Xe(r)),o(be())},sortBy(p){o(wc({facetId:r,criterion:p})),o(be())},isSortedBy(p){return this.state.sortCriterion===p},enable(){o(jt(r))},disable(){o(Je(r))},get state(){let p=n(),f=_r(e.state,r),m=p.sortCriteria,g=p.resultsMustMatch,A=f?f.values:[],x=Hr(e.state),h=i(),C=A.some(w=>w.state!=="idle"),R=f?.domain;return{facetId:r,values:A,sortCriterion:m,resultsMustMatch:g,hasActiveValues:C,isLoading:x,enabled:h,domain:R}}}}d();c();l();u();d();c();l();u();var qg=["idle","selected","excluded"];d();c();l();u();var Mg=["ascending","descending"],jg=["even","equiprobable"];var dB={start:new M,end:new M,endInclusive:new ce,state:new M({constrainTo:qg})},pB=new ge({facetId:pn,field:fn,tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),generateAutomaticRanges:_m,filterFacetCount:mn,injectionDepth:gn,numberOfValues:Lr,currentValues:new oe({each:new J({values:dB})}),sortCriteria:new M({constrainTo:Mg}),rangeAlgorithm:new M({constrainTo:jg})});function Vg(e,t){Be(e,pB,t,"buildDateFacet"),Um(t)}function tT(e,t){if(!fB(e))throw W;_g(t.options,"buildDateFacet");let r=e.dispatch,n=Lt(e,t.options),a=t.options.tabs??{},o=Gt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:a,activeTab:o};Vg(e,i),r(An(i));let p=Dg(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(ZI({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(Xe(n)),this.toggleSelect(f)},toggleExclude:f=>r(eT({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(Xe(n)),this.toggleExclude(f)},get state(){return p.state}}}function fB(e){return e.addReducers({configuration:ue,search:fe,dateFacetSet:wn,facetOptions:xt}),!0}function rT(e,t){let r=tT(e,t),n=e.dispatch,a=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(G({legacy:At(a()),next:Vt()}))},sortBy(o){r.sortBy(o),n(G({legacy:vn({facetId:a(),criterion:o})}))},toggleSelect:o=>{r.toggleSelect(o),n(G({legacy:Pg(a(),o),next:kg(o)}))},toggleExclude:o=>{r.toggleExclude(o),n(G({legacy:JI(a(),o)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function nT(e,t){if(!mB(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state,o=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:o,tabs:i,activeTab:p};Vg(e,f),n(An(f));let m=()=>en(e.state,o);return{...r,clear:()=>{n(oa({facetId:o,values:[]})),n(be())},setRange:g=>{let A={...g,state:"selected",numberOfResults:0,endInclusive:!0},x=oa({facetId:o,values:[A]});return x.error?!1:(n(x),n(be()),!0)},enable(){n(jt(o))},disable(){n(Je(o))},get state(){let g=Hr(a()),A=m(),x=aI(a(),o),h=x.length?x[0]:void 0;return{facetId:o,isLoading:g,range:h,enabled:A}}}}function mB(e){return e.addReducers({dateFacetSet:wn,facetOptions:xt,configuration:ue,search:fe}),!0}function aT(e,t){if(!gB(e))throw W;let r=nT(e,t),{dispatch:n}=e,a=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(G({legacy:At(a()),next:Vt()}))},setRange:o=>{let i=r.setRange(o);return i&&n(G({legacy:at({facetId:a(),facetValue:`${o.start}..${o.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function gB(e){return e.addReducers({dateFacetSet:wn,configuration:ue,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var oT={facetId:he,selection:new J({values:oi})},iT=Se("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,oT),t(Fn(e)),t(Og(e)),t(be())}),ZUe=Se("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,oT),t(En(e)),t(Ng(e)),t(be())});d();c();l();u();var hB={start:new ee,end:new ee,endInclusive:new ce,state:new M({constrainTo:qg})},yB=new ge({facetId:pn,tabs:new J({options:{required:!1},values:{included:new oe({each:new M}),excluded:new oe({each:new M})}}),field:fn,generateAutomaticRanges:_m,filterFacetCount:mn,injectionDepth:gn,numberOfValues:Lr,currentValues:new oe({each:new J({values:hB})}),sortCriteria:new M({constrainTo:Mg}),resultsMustMatch:new M({constrainTo:Dc}),rangeAlgorithm:new M({constrainTo:jg})});function Lg(e,t){Be(e,yB,t,"buildNumericFacet"),eg(t)}d();c();l();u();function qc(e){return{endInclusive:!1,state:"idle",...e}}function sT(e,t){if(!SB(e))throw W;_g(t.options,"buildNumericFacet");let r=e.dispatch,n=Lt(e,t.options),a=t.options.tabs??{},o=Gt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:a,activeTab:o};Lg(e,i),r(Rn(i));let p=Dg(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(iT({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(Xe(n)),this.toggleSelect(f)},get state(){return p.state}}}function SB(e){return e.addReducers({numericFacetSet:Fr,facetOptions:xt,configuration:ue,search:fe}),!0}function cT(e,t){if(!vB(e))throw W;let r=sT(e,t),n=e.dispatch,a=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(G({legacy:At(a()),next:Vt()}))},sortBy(o){r.sortBy(o),n(G({legacy:vn({facetId:a(),criterion:o})}))},toggleSelect:o=>{r.toggleSelect(o),n(G({legacy:Pg(a(),o),next:kg(o)}))},get state(){return{...r.state}}}}function vB(e){return e.addReducers({numericFacetSet:Fr,configuration:ue,search:fe}),!0}d();c();l();u();d();c();l();u();function uT(e,t){if(!AB(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state,o=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:o,tabs:i,activeTab:p};Lg(e,f),n(Rn(f));let m=()=>en(e.state,o);return{...r,clear:()=>{n(ia({facetId:o,values:[]})),n(be())},setRange:g=>{let A={...g,state:"selected",numberOfResults:0,endInclusive:!0},x=ia({facetId:o,values:[A]});return x.error?!1:(n(x),n(be()),!0)},enable(){n(jt(o))},disable(){n(Je(o))},get state(){let g=Hr(a()),A=m(),x=uI(a(),o),h=x.length?x[0]:void 0;return{facetId:o,isLoading:g,range:h,enabled:A}}}}function AB(e){return e.addReducers({numericFacetSet:Fr,facetOptions:xt,configuration:ue,search:fe}),!0}function lT(e,t){if(!xB(e))throw W;let r=uT(e,t),{dispatch:n}=e,a=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(G({legacy:At(a()),next:Vt()}))},setRange:o=>{let i=r.setRange(o);return i&&n(G({legacy:at({facetId:a(),facetValue:`${o.start}..${o.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function xB(e){return e.addReducers({numericFacetSet:Fr,configuration:ue,search:fe}),!0}d();c();l();u();function dT(e,t){if(!CB(e))throw W;let{facetSearch:r,...n}=t.options.facet,a=Lt(e,n);e.dispatch(un({...Nl,...n,facetId:a}));let o=Fg(e,{options:{...r,facetId:a},executeFacetSearchActionCreator:Ct,executeFieldSuggestActionCreator:Tn,select:p=>{e.dispatch(be()),e.dispatch(G({legacy:at({facetId:a,facetValue:p.rawValue}),next:gt()}))},isForFieldSuggestions:!0});return{...ne(e),...o,updateText:p=>{o.updateText(p),o.search()},get state(){return o.state}}}function CB(e){return e.addReducers({categoryFacetSet:dn,configuration:ue,categoryFacetSearchSet:Oc,search:fe}),!0}d();c();l();u();function pT(e,t){if(!bB(e))throw W;let{facetSearch:r,allowedValues:n,...a}=t.options.facet,o=Lt(e,a);e.dispatch(hn({..._l,...a,facetId:o,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=Ig(e,{options:{...r,facetId:o},select:f=>{e.dispatch(be()),e.dispatch(G({legacy:at({facetId:o,facetValue:f.rawValue}),next:gt()}))},exclude:f=>{e.dispatch(be()),e.dispatch(G({legacy:ur({facetId:o,facetValue:f.rawValue}),next:na()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:Ct,executeFieldSuggestActionCreator:Tn});return{...ne(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function bB(e){return e.addReducers({facetSet:Rr,configuration:ue,facetSearchSet:_c,search:fe}),!0}d();c();l();u();d();c();l();u();var rA={collectionField:new M({emptyAllowed:!1,required:!1}),parentField:new M({emptyAllowed:!1,required:!1}),childField:new M({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new ee({min:0,required:!1})},Ka=T("folding/register",e=>O(e,rA)),Ya=Se("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:a}}){let o=t(),i=o.configuration.analytics.analyticsMode==="legacy"?yield Ra(o):hs(o,a),p=yield n.search({...i,q:wB(o),enableQuerySyntax:!0,cq:`@${o.folding.fields.collection}="${e}"`,filterField:o.folding.fields.collection,childField:o.folding.fields.parent,parentField:o.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return yt(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:o.folding.collections[e].result}});return function(_x166,_x167){return _ref74.apply(this,arguments)}}());function wB(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var RB=e=>Y("analytics/folding/showMore",(t,r)=>(Kt(e),t.makeShowMoreFoldedResults(pt(e,r),He(e)))),FB=()=>Y("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),fT={logShowMoreFoldedResults:RB,logShowLessFoldedResults:FB};d();c();l();u();d();c();l();u();d();c();l();u();var Ug=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function EB(e,t){return e.raw[t.collection]}function nA(e,t){return e.raw[t.parent]}function Vl(e,t){let r=e.raw[t.child];return ed(r)?r[0]:r}function IB(e,t){return(e||t)!==void 0&&e===t}function gT(e,t,r,n=[]){let a=Vl(e,r);return a?n.indexOf(a)!==-1?[]:t.filter(o=>{let i=Vl(o,r)===Vl(e,r);return nA(o,r)===a&&!i}).map(o=>{let i={...o,searchUid:e.searchUid};return{result:i,children:gT(i,t,r,[...n,a])}}):[]}function TB(e,t){return e.find(r=>{let n=nA(r,t)===void 0,a=IB(nA(r,t),Vl(r,t));return n||a})}function hT(e){return e.parentResult?hT(e.parentResult):e}function PB(e,t,r,n){let a=Xd(e),i={...(n??TB(a,t)??hT(e)),searchUid:r};return{result:i,children:gT(i,a,t),moreResultsAvailable:e.totalNumberOfChildResults>1,isLoadingMoreResults:!1}}function Qg(e,t,r,n){let a={};return e.forEach(o=>{let i=EB(o,t);i&&(!Vl(o,t)&&!o.parentResult||(a[i]=PB(o,t,r,n)))}),a}function mT(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var Bg=ae(Ug(),e=>e.addCase(G.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Qg(r.response.results,t.fields,r.response.searchUid):{}}).addCase(qt.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Qg(r.response.results,t.fields,r.response.searchUid):{}}).addCase(vr.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...Qg(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Ka,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Ya.pending,(t,{meta:r})=>{let n=r.arg;mT(t,n).isLoadingMoreResults=!0}).addCase(Ya.rejected,(t,{meta:r})=>{let n=r.arg;mT(t,n).isLoadingMoreResults=!1}).addCase(Ya.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:a,searchUid:o}})=>{let i=Qg(n,t.fields,o,a);if(!i||!i[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=i[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var Ll={id:z},Mc=T("querySuggest/register",e=>O(e,{...Ll,count:new ee({min:0})})),yT=T("querySuggest/unregister",e=>O(e,Ll)),Pn=T("querySuggest/selectSuggestion",e=>O(e,{...Ll,expression:Ue})),Ja=T("querySuggest/clear",e=>O(e,Ll)),Xa=Se("querySuggest/fetch",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:a,navigatorContext:o}}){a(e,Ll);let i=e.id,p=yield kB(i,t(),o),f=yield n.querySuggest(p);return yt(f)?r(f.error):{id:i,q:p.q,...f.success}});return function(_x168,_x169){return _ref75.apply(this,arguments)}}()),kB=/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??ut(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Wt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield ys(t.configuration.analytics):Un(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function kB(_x170,_x171,_x172){return _ref76.apply(this,arguments)}}();var bt=ae(dt(),e=>e.addCase(Dt,(t,r)=>({...t,...r.payload})).addCase(hr,(t,r)=>{t.q=r.payload}).addCase(Pn,(t,r)=>{t.q=r.payload.expression}).addCase(_e.fulfilled,(t,r)=>r.payload?.query??t).addCase(De,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var Za=T("fields/registerFieldsToInclude",e=>O(e,dd)),jc=T("fields/fetchall/enable"),pi=T("fields/fetchall/disable"),Vc=Se("fields/fetchDescription",/*#__PURE__*/function(){var _ref77=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let a=r(),{accessToken:o,environment:i,organizationId:p}=a.configuration,{apiBaseUrl:f}=a.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:o,organizationId:p,url:f??ut(p,i)});return yt(m)?n(m.error):m.success.fields});return function(_x173,_x174){return _ref77.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Gg=["author","language","urihash","objecttype","collection","source","permanentid"],aA=[...Gg,"date","filetype","parents"],ST=[...aA,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],vT=()=>({fieldsToInclude:Gg,fetchAllFields:!1,fieldsDescription:[]});var eo=ae(vT(),e=>e.addCase(Za,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(jc,t=>{t.fetchAllFields=!0}).addCase(pi,t=>{t.fetchAllFields=!1}).addCase(Vc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Ka,(t,{payload:r})=>{let n=Ug().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function Lc(e){if(!OB(e))throw W;let t=ne(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:ul(n)}}}}function OB(e){return e.addReducers({search:fe}),!0}var NB=new ge({fieldsToInclude:new oe({required:!1,each:new M({required:!0,emptyAllowed:!1})})});function $g(e,t){if(!_B(e))throw W;let r=ne(e),n=Lc(e),{dispatch:a}=e,o=()=>e.state,i=Be(e,NB,t?.options,"buildCoreResultList");i.fieldsToInclude&&a(Za(i.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,g=5,A=200,x=!1;return{...r,get state(){let C=o();return{...n.state,results:C.search.results,moreResultsAvailable:p(),searchResponseId:C.search.searchResponseId}},fetchMoreResults:function(){var _ref78=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<A){if(m++,m>=g){f=Date.now(),!x&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${g} times, with little delay. Please verify the conditions under which the function is called.`),x=!0;return}}else m=0;x=!1,t?.fetchMoreResultsActionCreator&&(yield a(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref78.apply(this,arguments)}}()}}function _B(e){return e.addReducers({search:fe,configuration:ue,fields:eo}),!0}var DB=new ge(rA);function AT(e,t,r){if(!qB(e))throw W;let n=$g(e,t),{dispatch:a}=e,o=()=>e.state,i=t.options?.folding?Be(e,DB,t.options.folding,"buildFoldedResultList"):{};return a(Ka({...i})),{...n,loadCollection:p=>{a(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),a(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{a(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{a(r.logShowLessFoldedResults())},findResultById(p){return oA(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return oA(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=o();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function qB(e){return e.addReducers({search:fe,configuration:mf,folding:Bg,query:bt}),!0}function oA(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let a=oA(n.children,t);if(a)return a}}return null}function xT(e,t={}){let r=AT(e,{...t,loadCollectionActionCreator:Ya,fetchMoreResultsActionCreator:vr},fT);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Uc(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var Qc=ae(BS(),e=>e.addCase(Bs,(t,{payload:r})=>{t.isVisible=r}).addCase(ml,(t,{payload:r})=>{t.isEnabled=r}).addCase(rf,(t,{payload:r})=>{t.id=r.id}).addCase(Gn,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.answer||(t.answer=""),t.answer+=r.textDelta,delete t.error}).addCase($n,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Uc([...t.citations,...r.citations]),delete t.error}).addCase(Hn,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===zh},t.citations=[],delete t.answer}).addCase(Xp,t=>{t.liked=!0,t.disliked=!1}).addCase(Zp,t=>{t.liked=!1,t.disliked=!0}).addCase(ef,t=>{t.feedbackModalOpen=!0}).addCase(nf,t=>{t.feedbackModalOpen=!1}).addCase(Gs,t=>{t.feedbackSubmitted=!0}).addCase(Jt,t=>({...BS(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase(cr,(t,{payload:r})=>{t.isLoading=r}).addCase(Zr,(t,{payload:r})=>{t.isStreaming=r}).addCase(zn,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(af,(t,{payload:r})=>{t.responseFormat=r}).addCase(sf,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(Eo,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(gl,t=>{t.expanded=!0}).addCase(tf,t=>{t.expanded=!1}).addCase(of,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(Wn,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(cf,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Da,(t,{payload:r})=>{t.answerId=r}).addCase(Jp,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(uf,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(lf,(t,{payload:r})=>{let n=t.generationSteps.findLast(a=>a.name===r.name&&a.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}));d();c();l();u();function Bc(e,t,r={}){if(!MB(e))throw W;let{dispatch:n}=e,a=ne(e),o=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(Bs(i));let p=r.initialState?.responseFormat;p&&n(af(p));let f=r.fieldsToIncludeInCitations;return f&&n(sf(f)),r.initialState?.expanded&&n(gl()),{...a,get state(){return o().generatedAnswer},like(g){this.state.liked||(n(Xp()),n(t.logLikeGeneratedAnswer(g)))},dislike(g){this.state.disliked||(n(Zp()),n(t.logDislikeGeneratedAnswer(g)))},openFeedbackModal(){n(ef())},closeFeedbackModal(){n(nf())},sendFeedback(g){n(t.logGeneratedAnswerFeedback(g)),n(Gs())},logCitationClick(g,A){n(t.logOpenGeneratedAnswerSource(g,A))},logCitationHover(g,A,x){n(t.logHoverCitation(g,A,x))},show(){this.state.isVisible||(n(Bs(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(Bs(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(gl()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(tf()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(ml(!0))},disable(){this.state.isEnabled&&n(ml(!1))},logCopyToClipboard(g){n(t.logCopyGeneratedAnswer(g))},retry(){}}}function MB(e){return e.addReducers({generatedAnswer:Qc}),!0}var Ut={engines:{},setAbortControllerRef:(e,t)=>{Ut.engines[t].abortController=e},getIsStreamInProgress:e=>!Ut.engines[e].abortController||Ut.engines[e].abortController?.signal.aborted?(Ut.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,a=r.search.extendedResults.generativeQuestionAnsweringId,o=r.generatedAnswer.id;if(Ut.engines[o].lastRequestId!==n){if(Ut.engines[o].lastRequestId=n,Ut.engines[o].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(Jt())}if(!Ut.getIsStreamInProgress(o)&&a&&a!==Ut.engines[o].lastStreamId){if(Ut.engines[o].lastStreamId=a,r.generatedAnswer.isEnabled===!1)return;e.dispatch(xR({setAbortControllerRef:p=>Ut.setAbortControllerRef(p,o)}))}};return e.subscribe(t)}};function CT(e,t,r={}){if(!jB(e))throw W;let n=Bc(e,t,r),a=()=>e.state;if(e.state.generatedAnswer.id&&!Ut.engines[e.state.generatedAnswer.id]&&(Ut.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let i=da("genQA-",12);e.dispatch(rf({id:i}))}Ut.engines[e.state.generatedAnswer.id]||(Ut.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),Ut.subscribeToSearchRequests(e);let o=i=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in i;return{...n,get state(){return a().generatedAnswer},retry(){o(e)&&e.dispatch(G({legacy:t.logRetryGeneratedAnswer()}))}}}function jB(e){return e.addReducers({generatedAnswer:Qc}),!0}d();c();l();u();d();c();l();u();var bT=Dp.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Hg=e=>e==="yes"?!0:e==="no"?!1:null,VB=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:Hg(t.correctTopic),documented:Hg(t.documented),hallucinationFree:Hg(t.hallucinationFree),readable:Hg(t.readable)},helpful:t.helpful,question:r}),LB=e=>{let t="",r=()=>{let n=e.state,a=Ww(n),o=a.requestId;o!==t&&(t=o,e.dispatch(Jt()),a.q?.length>0&&e.dispatch(df()))};e.subscribe(r)};function wT(e,t,r={}){if(!UB(e))throw W;Ba(e.state.configuration.analytics.analyticsMode);let{...n}=Bc(e,t,r),a=()=>e.state;return e.dispatch(of(r.answerConfigurationId)),LB(e),{...n,get state(){let o=zS(e.state).data,i=a().generatedAnswer;return{...i,answer:o?.answer,citations:Uc(o?.citations??[]),error:{message:o?.error?.message,statusCode:o?.error?.code},isLoading:o?.isLoading??!1,isStreaming:o?.isStreaming??!1,answerContentFormat:o?.contentFormat??"text/plain",isAnswerGenerated:o?.generated??!1,cannotAnswer:i.cannotAnswer||o?.generated===!1&&!o?.isLoading&&!o?.isStreaming}},retry(){let o=qp(a());e.dispatch(pf(o??wo))},reset(){e.dispatch(Jt())},sendFeedback(o){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(o));let i=VB({query:a().query.q,feedback:o,answerApiState:zS(e.state).data});e.dispatch(bT.endpoints.post.initiate(i)),e.dispatch(Gs())})()}}}function UB(e){return e.addReducers({[Io.reducerPath]:Io.reducer,query:bt}),!0}d();c();l();u();d();c();l();u();var iA=class extends Rm{requestInit(t){let{q:r,conversationId:n,accessToken:a}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${a}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({q:r,conversationId:n}),signal:this.abortController.signal}}},RT=(e,t,r)=>new iA({url:`${Fm(e,t,r)}/follow-up`});d();c();l();u();var FT=e=>{let t="";return{onRunStartedEvent:({event:r})=>{t=r.runId,e(Os(t)),e(_s({answerId:t,isLoading:!1})),e(Up({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:r})=>{e(Hp({name:r.stepName,startedAt:r.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:r})=>{e(zp({name:r.stepName,finishedAt:r.timestamp??Date.now(),answerId:t}))},onTextMessageContentEvent:({event:r})=>{e(Ds({textDelta:r.delta,answerId:t}))},onCustomEvent:({event:r})=>{let{name:n,value:a}=r;switch(n){case"header":{a?.contentFormat&&e(Ns({contentFormat:a.contentFormat,answerId:t}));return}case"citations":{e(qs({citations:a.citations,answerId:t}));return}}},onRunErrorEvent:({event:r})=>{let n=Em(r.code);e(js({message:r.message,code:n,answerId:t})),t=""},onRunFinishedEvent:({event:r})=>{let n=r.result?.answerGenerated??!1;e(Ms({cannotAnswer:!n,answerId:t})),t=""}}};d();c();l();u();d();c();l();u();function ET(){return{conversationId:"",isEnabled:!1,followUpAnswers:[]}}var IT=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function sA(e){return e.followUpAnswers.find(t=>t.isActive)}function Er(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var TT=ae(ET(),e=>e.addCase(Ps,(t,{payload:r})=>{t.isEnabled=r}).addCase(ks,(t,{payload:r})=>{t.conversationId=r}).addCase(fl,(t,{payload:r})=>{let n=sA(t);n&&(n.isActive=!1),t.followUpAnswers.push(IT(r.question))}).addCase(Os,(t,{payload:r})=>{let n=sA(t);!n||n.answerId||(n.answerId=r)}).addCase(Ns,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(_s,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(Up,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(Ds,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(qs,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.citations=Uc([...n.citations,...r.citations]),delete n.error)}).addCase(Ms,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(js,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(Qp,(t,{payload:r})=>{let n=sA(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(Bp,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(Gp,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(aR,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(Hp,(t,{payload:r})=>{let n=Er(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(zp,(t,{payload:r})=>{let n=Er(t,r.answerId);if(!n)return;let a=n.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");a&&(a.status="completed",a.finishedAt=r.finishedAt)}).addCase($p,t=>{t.followUpAnswers=[],t.conversationId="",t.isEnabled=!1}));function PT(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!QB(e))throw W;let{...n}=Bc(e,t,r),a=()=>e.state;e.dispatch(op(r.agentId));let o=$d(a()),i=Gd(a()),p=Hd(a()),f=RT(r.agentId,o,p),m=FT(e.dispatch);return{...n,get state(){let g=a().followUpAnswers;return{...a().generatedAnswer,followUpAnswers:g}},retry(){e.dispatch(CR())},like(g){if(!g||this.state.answerId===g){n.like();return}this.state.liked||(e.dispatch(Bp({answerId:g})),e.dispatch(t.logLikeGeneratedAnswer(g)))},dislike(g){if(!g||this.state.answerId===g){n.dislike();return}this.state.disliked||(e.dispatch(Gp({answerId:g})),e.dispatch(t.logDislikeGeneratedAnswer(g)))},logCopyToClipboard(g){if(!g||this.state.answerId===g){n.logCopyToClipboard();return}e.dispatch(t.logCopyGeneratedAnswer(g))},logCitationClick(g,A){if(!A||this.state.answerId===A){n.logCitationClick(g);return}e.dispatch(t.logOpenGeneratedAnswerSource(g,A))},logCitationHover(g,A,x){if(!x||this.state.answerId===x){n.logCitationHover(g,A);return}e.dispatch(t.logHoverCitation(g,A,x))},askFollowUp(g){var _this37=this;return _asyncToGenerator(function*(){if(!g||g.trim()==="")return;let A=_this37.state.followUpAnswers.conversationId;if(!A){console.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}f.abortRun(),e.dispatch(fl({question:g}));try{yield f.runAgent({forwardedProps:{q:g,conversationId:A,accessToken:i}},m)}catch(x){e.dispatch(Qp({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",x)}})()}}}function QB(e){return e.addReducers({[Bn.reducerPath]:Bn.reducer,followUpAnswers:TT}),!0}function kT(e,t={}){Ba(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=PT(e,Ls,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=wT(e,Ls,t):r=CT(e,Ls,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function rr(e,t,r){if(!BB(e))throw W;let n=1e3,a={selectionDelay:n,debounceWait:n,...t.options},o;return{select:nd(r,a.debounceWait,{isImmediate:!0}),beginDelayedSelect(){o=setTimeout(r,a.selectionDelay)},cancelPendingSelect(){o&&clearTimeout(o)}}}function BB(e){return e.addReducers({configuration:ue}),!0}function OT(e,t,r){let n=!1,a=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id)))};return rr(e,r,()=>{a()})}function NT(e,t){return OT(e,Ls,t)}d();c();l();u();d();c();l();u();var Gc=ae(vp(),e=>{e.addCase(G.fulfilled,GB).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function GB(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var zg=()=>Y("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),Wg=()=>Y("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Kg=()=>Y("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var _T=e=>({past:[],present:e,future:[]}),$B=e=>{let{past:t,present:r,future:n}=e;if(!r||t.length===0)return e;let a=t[t.length-1];return{past:t.slice(0,t.length-1),present:a,future:[r,...n]}},HB=e=>{let{past:t,present:r,future:n}=e;if(!r||n.length===0)return e;let a=n[0],o=n.slice(1);return{past:[...t,r],present:a,future:o}},zB=e=>{let{action:t,state:r,reducer:n}=e,{past:a,present:o}=r,i=n(o,t);return o?o===i?r:{past:[...a,o].slice(-10),present:i,future:[]}:_T(i)},DT=e=>{let{actionTypes:t,reducer:r}=e,n=_T();return(a=n,o)=>{switch(o.type){case t.undo:return $B(a);case t.redo:return HB(a);case t.snapshot:return zB({state:a,reducer:r,action:o});default:return a}}};d();c();l();u();d();c();l();u();var WB=Object.getOwnPropertyNames,KB=Object.getOwnPropertySymbols,YB=Object.prototype.hasOwnProperty;function qT(e,t){return function(n,a,o){return e(n,a,o)&&t(n,a,o)}}function Yg(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);var o=a.cache,i=o.get(r),p=o.get(n);if(i&&p)return i===n&&p===r;o.set(r,n),o.set(n,r);var f=e(r,n,a);return o.delete(r),o.delete(n),f}}function MT(e){return WB(e).concat(KB(e))}var JB=Object.hasOwn||function(e,t){return YB.call(e,t)};function fi(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var XB="__v",ZB="__o",e1="_owner",jT=Object.getOwnPropertyDescriptor,VT=Object.keys;function t1(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function r1(e,t){return fi(e.getTime(),t.getTime())}function n1(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function a1(e,t){return e===t}function LT(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),o=e.entries(),i,p,f=0;(i=o.next())&&!i.done;){for(var m=t.entries(),g=!1,A=0;(p=m.next())&&!p.done;){if(a[A]){A++;continue}var x=i.value,h=p.value;if(r.equals(x[0],h[0],f,A,e,t,r)&&r.equals(x[1],h[1],x[0],h[0],e,t,r)){g=a[A]=!0;break}A++}if(!g)return!1;f++}return!0}var o1=fi;function i1(e,t,r){var n=VT(e),a=n.length;if(VT(t).length!==a)return!1;for(;a-->0;)if(!GT(e,t,r,n[a]))return!1;return!0}function Ul(e,t,r){var n=MT(e),a=n.length;if(MT(t).length!==a)return!1;for(var o,i,p;a-->0;)if(o=n[a],!GT(e,t,r,o)||(i=jT(e,o),p=jT(t,o),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function s1(e,t){return fi(e.valueOf(),t.valueOf())}function c1(e,t){return e.source===t.source&&e.flags===t.flags}function UT(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),o=e.values(),i,p;(i=o.next())&&!i.done;){for(var f=t.values(),m=!1,g=0;(p=f.next())&&!p.done;){if(!a[g]&&r.equals(i.value,p.value,i.value,p.value,e,t,r)){m=a[g]=!0;break}g++}if(!m)return!1}return!0}function u1(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function l1(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function GT(e,t,r,n){return(n===e1||n===ZB||n===XB)&&(e.$$typeof||t.$$typeof)?!0:JB(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var d1="[object Arguments]",p1="[object Boolean]",f1="[object Date]",m1="[object Error]",g1="[object Map]",h1="[object Number]",y1="[object Object]",S1="[object RegExp]",v1="[object Set]",A1="[object String]",x1="[object URL]",C1=Array.isArray,QT=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,BT=Object.assign,b1=Object.prototype.toString.call.bind(Object.prototype.toString);function w1(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,a=e.areFunctionsEqual,o=e.areMapsEqual,i=e.areNumbersEqual,p=e.areObjectsEqual,f=e.arePrimitiveWrappersEqual,m=e.areRegExpsEqual,g=e.areSetsEqual,A=e.areTypedArraysEqual,x=e.areUrlsEqual;return function(C,R,w){if(C===R)return!0;if(C==null||R==null)return!1;var b=typeof C;if(b!==typeof R)return!1;if(b!=="object")return b==="number"?i(C,R,w):b==="function"?a(C,R,w):!1;var F=C.constructor;if(F!==R.constructor)return!1;if(F===Object)return p(C,R,w);if(C1(C))return t(C,R,w);if(QT!=null&&QT(C))return A(C,R,w);if(F===Date)return r(C,R,w);if(F===RegExp)return m(C,R,w);if(F===Map)return o(C,R,w);if(F===Set)return g(C,R,w);var E=b1(C);return E===f1?r(C,R,w):E===S1?m(C,R,w):E===g1?o(C,R,w):E===v1?g(C,R,w):E===y1?typeof C.then!="function"&&typeof R.then!="function"&&p(C,R,w):E===x1?x(C,R,w):E===m1?n(C,R,w):E===d1?p(C,R,w):E===p1||E===h1||E===A1?f(C,R,w):!1}}function R1(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,a={areArraysEqual:n?Ul:t1,areDatesEqual:r1,areErrorsEqual:n1,areFunctionsEqual:a1,areMapsEqual:n?qT(LT,Ul):LT,areNumbersEqual:o1,areObjectsEqual:n?Ul:i1,arePrimitiveWrappersEqual:s1,areRegExpsEqual:c1,areSetsEqual:n?qT(UT,Ul):UT,areTypedArraysEqual:n?Ul:u1,areUrlsEqual:l1};if(r&&(a=BT({},a,r(a))),t){var o=Yg(a.areArraysEqual),i=Yg(a.areMapsEqual),p=Yg(a.areObjectsEqual),f=Yg(a.areSetsEqual);a=BT({},a,{areArraysEqual:o,areMapsEqual:i,areObjectsEqual:p,areSetsEqual:f})}return a}function F1(e){return function(t,r,n,a,o,i,p){return e(t,r,p)}}function E1(e){var t=e.circular,r=e.comparator,n=e.createState,a=e.equals,o=e.strict;if(n)return function(f,m){var g=n(),A=g.cache,x=A===void 0?t?new WeakMap:void 0:A,h=g.meta;return r(f,m,{cache:x,equals:a,meta:h,strict:o})};if(t)return function(f,m){return r(f,m,{cache:new WeakMap,equals:a,meta:void 0,strict:o})};var i={cache:void 0,equals:a,meta:void 0,strict:o};return function(f,m){return r(f,m,i)}}var x3e=kn(),C3e=kn({strict:!0}),b3e=kn({circular:!0}),w3e=kn({circular:!0,strict:!0}),R3e=kn({createInternalComparator:function(){return fi}}),F3e=kn({strict:!0,createInternalComparator:function(){return fi}}),E3e=kn({circular:!0,createInternalComparator:function(){return fi}}),I3e=kn({circular:!0,createInternalComparator:function(){return fi},strict:!0});function kn(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,a=e.createState,o=e.strict,i=o===void 0?!1:o,p=R1(e),f=w1(p),m=n?n(f):F1(f);return E1({circular:r,comparator:f,createState:a,equals:m,strict:i})}function mi(e,t,r=(n,a)=>n===a){return e.length===t.length&&e.findIndex((n,a)=>!r(t[a],n))===-1}function I1(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>Ql(r,n))!==-1)}var Ql=kn({createCustomConfig:e=>({...e,areArraysEqual:I1})});var T1=ae(lw(),e=>{e.addCase(sr,(t,r)=>P1(t,r.payload)?void 0:r.payload)}),P1=(e,t)=>k1(e.context,t.context)&&O1(e.dictionaryFieldContext,t.dictionaryFieldContext)&&V1(e.advancedSearchQueries,t.advancedSearchQueries)&&N1(e.tabSet,t.tabSet)&&_1(e.staticFilterSet,t.staticFilterSet)&&cA(e.facetSet,t.facetSet)&&cA(e.dateFacetSet,t.dateFacetSet)&&cA(e.numericFacetSet,t.numericFacetSet)&&q1(e.automaticFacetSet,t.automaticFacetSet)&&D1(e.categoryFacetSet,t.categoryFacetSet)&&M1(e.pagination,t.pagination)&&j1(e.query,t.query)&&L1(e,t)&&U1(e.pipeline,t.pipeline)&&Q1(e.searchHub,t.searchHub)&&B1(e.facetOrder,t.facetOrder)&&G1(e.debug,t.debug),k1=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),O1=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),N1=(e,t)=>{let r=$T(e),n=$T(t);return r?.id===n?.id},$T=e=>Object.values(e).find(t=>t.isActive),_1=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let a=HT(e[r]),o=HT(n);if(JSON.stringify(a)!==JSON.stringify(o))return!1}return!0},HT=e=>e.values.filter(t=>t.state!=="idle"),cA=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let a=e[r].request.currentValues.filter(i=>i.state!=="idle"),o=n.request.currentValues.filter(i=>i.state!=="idle");if(JSON.stringify(a)!==JSON.stringify(o))return!1}return!0},D1=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let a=or(e[r]?.request.currentValues).map(({value:i})=>i),o=or(n?.request.currentValues).map(({value:i})=>i);if(JSON.stringify(a)!==JSON.stringify(o))return!1}return!0},q1=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let a=e.set[r].response.values.filter(i=>i.state!=="idle"),o=n.response.values.filter(i=>i.state!=="idle");if(JSON.stringify(a)!==JSON.stringify(o))return!1}return!0},M1=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,j1=(e,t)=>JSON.stringify(e)===JSON.stringify(t),V1=(e,t)=>JSON.stringify(e)===JSON.stringify(t),L1=(e,t)=>e.sortCriteria===t.sortCriteria,U1=(e,t)=>e===t,Q1=(e,t)=>e===t,B1=(e,t)=>mi(e,t),G1=(e,t)=>e===t,Jg=DT({actionTypes:{redo:lS.type,undo:uS.type,snapshot:sr.type},reducer:T1});function zT(e){if(!$1(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,a=o=>o.past.length>0&&!le(o.present);return{...t,subscribe(o){o();let i=JSON.stringify(n().history.present),p=()=>{let f=JSON.stringify(n().history.present);i!==f&&(i=f,o())};return e.subscribe(()=>p())},get state(){return n().history},back(){var _this38=this;return _asyncToGenerator(function*(){a(_this38.state)&&(yield r(nl()),r(G({legacy:Wg()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(sp()),r(G({legacy:zg()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){a(_this40.state)&&(yield r(nl()),r(G({legacy:Kg()})))})()}}}function $1(e){return e.addReducers({history:Jg,configuration:ue,facetOrder:Gc}),!0}d();c();l();u();d();c();l();u();var H1={results:new oe({required:!0,each:new J({values:Zd})}),maxLength:new ee({required:!0,min:1,default:10})},$c=T("recentResults/registerRecentResults",e=>O(e,H1)),Ir=T("recentResults/pushRecentResult",e=>(Kt(e),{payload:e})),Hc=T("recentResults/clearRecentResults");function WT(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Gb(t.options.result)))};return rr(e,t,()=>{n(),e.dispatch(Ir(t.options.result))})}d();c();l();u();d();c();l();u();function Xg(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var KT=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},YT=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},JT=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,a])=>{Xg(a)&&delete t[r].cache[n]})},XT=(e,t,r)=>{for(let a in t)for(let o in t[a].cache)t[a].cache[o].isActive=!1;if(!uA(e,t)){z1(e,t,r);return}let n=uA(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},ZT=(e,t,r)=>{let{id:n,q:a,searchUid:o,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[a]={...uA(e,t),...r,isActive:!0,searchUid:o,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},eP=(e,t)=>{let{id:r,q:n,error:a}=e;t[r].cache[n].error=a||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1},uA=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},z1=(e,t,r)=>{let{q:n,id:a}=e;t[a].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}};d();c();l();u();function tP(){return{}}var Zg=ae(tP(),e=>{e.addCase(us,(t,r)=>{KT(r.payload,t)}),e.addCase(Yr,(t,r)=>{YT(r.payload,t)}),e.addCase(ls,(t,r)=>{JT(r.payload,t)}),e.addCase(bs.pending,(t,r)=>{XT(r.meta.arg,t,{results:[]})}),e.addCase(bs.fulfilled,(t,r)=>{let n=r.payload.results.map(a=>({...a,searchUid:r.payload.searchUid}));ZT({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(bs.rejected,(t,r)=>{eP(r.meta.arg,t)})});d();c();l();u();var W1={searchBoxId:st,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee},rP=new ge(W1);function nP(e,t){if(!K1(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state,o={searchBoxId:t.options.searchBoxId||da("instant-results-"),cacheTimeout:t.options.cacheTimeout||6e4,maxResultsPerQuery:t.options.maxResultsPerQuery};Be(e,rP,o,"buildInstantResults");let i=o.searchBoxId;n(us({id:i}));let p=()=>a().instantResults[i],f=A=>p().cache[A],m=()=>p().q,g=()=>{let A=f(m());return A?A.isLoading?[]:A.results:[]};return{...r,updateQuery(A){if(!A)return;let x=f(A);(!x||!x.isLoading&&(x.error||Xg(x)))&&n(bs({id:i,q:A,maxResultsPerQuery:o.maxResultsPerQuery,cacheTimeout:o.cacheTimeout})),n(Yr({id:i,q:A}))},clearExpired(){n(ls({id:i}))},get state(){let A=m(),x=f(A);return{q:A,isLoading:x?.isLoading||!1,error:x?.error||null,results:g()}}}}function K1(e){return e.addReducers({instantResults:Zg}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Tr=ae(yr(),e=>{e.addCase(ds,(t,r)=>{let n=lA(t),a=r.payload;t.defaultNumberOfResults=t.numberOfResults=a,t.firstResult=Bl(n,a)}).addCase(ps,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(ht,t=>{t.firstResult=0}).addCase(fs,(t,r)=>{let n=r.payload;t.firstResult=Bl(n,t.numberOfResults)}).addCase(Jr,(t,r)=>{let n=r.payload;t.firstResult=Bl(n,t.numberOfResults)}).addCase(gs,t=>{let r=lA(t),n=Math.max(r-1,1);t.firstResult=Bl(n,t.numberOfResults)}).addCase(ms,t=>{let r=lA(t),n=Y1(t),a=Math.min(r+1,n);t.firstResult=Bl(a,t.numberOfResults)}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(De,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(G.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(qt.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Xe,t=>{Qt(t)}).addCase(Cn,t=>{Qt(t)}).addCase(Sn,t=>{Qt(t)}).addCase(En,t=>{Qt(t)}).addCase(ai,t=>{Qt(t)}).addCase(yn,t=>{Qt(t)}).addCase(ln,t=>{Qt(t)}).addCase($a,t=>{Qt(t)}).addCase(gc,t=>{Qt(t)}).addCase(xn,t=>{Qt(t)}).addCase(Fn,t=>{Qt(t)}).addCase(ft,t=>{Qt(t)}).addCase(oa,t=>{Qt(t)}).addCase(ia,t=>{Qt(t)}).addCase(ni,t=>{Qt(t)}).addCase(cn,t=>{Qt(t)})});function Qt(e){e.firstResult=yr().firstResult}function lA(e){let{firstResult:t,numberOfResults:r}=e;return dA(t,r)}function Y1(e){let{totalCountFiltered:t,numberOfResults:r}=e;return pA(t,r)}function Bl(e,t){return(e-1)*t}function dA(e,t){return Math.round(e/t)+1}function pA(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function J1(e){return e.pagination.firstResult}function aP(e){return e.pagination.numberOfResults}function X1(e){return e.pagination.totalCountFiltered}var ua=e=>{let t=J1(e),r=aP(e);return dA(t,r)},Gl=e=>{let t=X1(e),r=aP(e);return pA(t,r)},eh=(e,t)=>{let r=ua(e),n=Gl(e),a=Z1(r,t);return a=eG(a),a=tG(a,n),rG(a)};function Z1(e,t){let r=t%2===0,n=Math.floor(t/2),a=r?n-1:n,o=e-n,i=e+a;return{start:o,end:i}}function eG(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function tG(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),a=e.end-r;return{start:n,end:a}}function rG(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Wc=()=>Y("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||yr().numberOfResults})),Kc=()=>Y("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:ua(t)})),th=()=>Y("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:ua(t)})),rh=()=>Y("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:ua(t)})),Yc=()=>({actionCause:"browseResults"});d();c();l();u();var nG=new ge({numberOfPages:new ee({default:5,min:0})}),aG=new ge({page:new ee({min:1})});function oP(e,t={}){if(!oG(e))throw W;let r=ne(e),{dispatch:n}=e,a=Be(e,nG,t.options,"buildPager"),i=lt(e,aG,t.initialState,"buildPager").page;i&&n(fs(i));let p=()=>ua(e.state),f=()=>{let{numberOfPages:g}=a;return eh(e.state,g)},m=()=>Gl(e.state);return{...r,get state(){let g=p(),A=m(),x=g>1&&A>0,h=g<A;return{currentPage:g,currentPages:f(),maxPage:A,hasPreviousPage:x,hasNextPage:h}},selectPage(g){n(Jr(g))},nextPage(){n(ms())},previousPage(){n(gs())},isCurrentPage(g){return g===this.state.currentPage}}}function oG(e){return e.addReducers({configuration:ue,pagination:Tr}),!0}function iP(e,t={}){let{dispatch:r}=e,n=oP(e,t);return{...n,get state(){return n.state},selectPage(a){n.selectPage(a),r(qt({legacy:Kc(),next:Yc()}))},nextPage(){n.nextPage(),r(qt({legacy:th(),next:Yc()}))},previousPage(){n.previousPage(),r(qt({legacy:rh(),next:Yc()}))}}}d();c();l();u();d();c();l();u();function sP(e){if(!iG(e))throw W;let t=ne(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function iG(e){return e.addReducers({search:fe}),!0}function cP(e){return sP(e)}d();c();l();u();d();c();l();u();function uP(e){if(!sG(e))throw W;let t=ne(e),r=Lc(e),n=()=>e.state,a=()=>{let o=n().search.duration/1e3;return Math.round((o+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:a(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function sG(e){return e.addReducers({search:fe,pagination:Tr}),!0}function lP(e){return uP(e)}d();c();l();u();d();c();l();u();d();c();l();u();function nh(_x175,_x176){return _nh.apply(this,arguments)}function _nh(){_nh=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:a}=e.configuration,o=e.query?.q||"";return{url:r.apiBaseUrl??ut(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:a,enableNavigation:!1,q:o,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _nh.apply(this,arguments)}var gi=Se("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let a=r(),o=yield nh(a,e),i=yield t.apiClient.html(o);return yt(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x177,_x178){return _ref79.apply(this,arguments)}}()),Jc=T("resultPreview/next"),Xc=T("resultPreview/previous"),Zc=T("resultPreview/prepare",e=>O(e,{results:new oe({required:!0})})),dP=2048,eu=Se("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),a=Ex(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return a?.length>dP&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${dP} characters.`),{contentURL:a}});return function(_x179,_x180){return _ref80.apply(this,arguments)}}());d();c();l();u();var pP=e=>Y({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Kt(e);let n=pt(e,r),a=He(e);return t.makeDocumentQuickview(n,a)},analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});d();c();l();u();d();c();l();u();d();c();l();u();function fA(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var mA=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:a}=fA();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=a},gA=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),ah=ae(fA(),e=>{e.addCase(gi.pending,t=>{t.isLoading=!0}).addCase(gi.fulfilled,(t,r)=>{let{content:n,uniqueId:a}=r.payload;t.position=t.resultsWithPreview.indexOf(a),t.content=n,t.uniqueId=a,t.isLoading=!1}).addCase(G.fulfilled,(t,r)=>{mA(t),t.resultsWithPreview=gA(r.payload.response.results)}).addCase(vr.fulfilled,(t,r)=>{mA(t),t.resultsWithPreview=t.resultsWithPreview.concat(gA(r.payload.response.results))}).addCase(qt.fulfilled,mA).addCase(Zc,(t,r)=>{t.resultsWithPreview=gA(r.payload.results)}).addCase(Jc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(Xc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(eu.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function fP(e,t,r,n,a){if(!cG(e))throw W;let{dispatch:o}=e,i=()=>e.state,p=ne(e),{result:f,maximumPreviewSize:m}=t.options,g=()=>{let{resultsWithPreview:x,position:h}=i().resultPreview;return x[h]},A=x=>{o(eu({uniqueId:x,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||o(gi({uniqueId:x,requestedOutputSize:m})),a&&a()};return{...p,fetchResultContent(){A(f.uniqueId)},next(){o(Jc()),A(g())},previous(){o(Xc()),A(g())},get state(){let x=i(),h=f.hasHtmlVersion,C=x.resultPreview,R=f.uniqueId===C.uniqueId?C.content:"",w=C.isLoading,b=C.contentURL,F=g();return{content:R,resultHasPreview:h,isLoading:w,contentURL:b,currentResultUniqueId:F}}}}function cG(e){return e.addReducers({configuration:ue,resultPreview:ah}),!0}function mP(e,t){if(!uG(e))throw W;let{dispatch:r}=e,n=()=>e.state,a=()=>n().search.results,p=fP(e,t,nh,"/html",()=>{e.dispatch(pP(t.options.result))});return r(Zc({results:a()})),{...p,get state(){return{...p.state,currentResult:a().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:a().length}}}}function uG(e){return e.addReducers({search:fe}),!0}d();c();l();u();d();c();l();u();var gP=()=>Y("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),hP=()=>Y("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var lG={queries:new oe({required:!0,each:new M({emptyAllowed:!1})}),maxLength:new ee({required:!0,min:1,default:10})},hi=T("recentQueries/registerRecentQueries",e=>O(e,lG)),tu=T("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function yP(){return{queries:[],maxLength:10}}var oh=ae(yP(),e=>{e.addCase(hi,dG).addCase(tu,pG).addCase(G.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,a=r.payload.response.results;!n.length||!a.length||fG(n,t)})});function dG(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function pG(e){e.queries=[]}function fG(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(a=>a.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var mG={queries:[]},gG={maxLength:10,clearFilters:!0},hG=new ge({queries:new oe({required:!0})}),yG=new ge({maxLength:new ee({required:!0,min:1}),clearFilters:new ce});function SG(e,t){Be(e,yG,t?.options,"buildRecentQueriesList"),lt(e,hG,t?.initialState,"buildRecentQueriesList")}function SP(e,t){if(!vG(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state,o={...gG,...t?.options},i={...mG,...t?.initialState};SG(e,{options:o,initialState:i});let p={queries:i.queries,maxLength:o.maxLength};return n(hi(p)),{...r,get state(){let f=a();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(tu())},updateRecentQueries(f){let m=new oe({required:!0,each:new M({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(hi({queries:f,maxLength:o.maxLength}))},executeRecentQuery(f){let m=new ee({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let g={q:this.state.queries[f],clearFilters:o.clearFilters};Zl(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(Cs(g))}}}function vG(e){return e.addReducers({search:fe,recentQueries:oh,query:bt}),!0}function vP(e,t){let r=SP(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(gP()),r.clear()},executeRecentQuery(a){r.executeRecentQuery(a),n(G({legacy:hP(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var AP=e=>Y("analytics/recentResults/click",(t,r)=>(Kt(e),t.makeRecentResultClick(pt(e,r),He(e)))),xP=()=>Y("analytics/recentResults/clear",e=>e.makeClearRecentResults());function CP(e,t){return rr(e,t,()=>e.dispatch(AP(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function bP(){return{results:[],maxLength:10}}var ih=ae(bP(),e=>{e.addCase($c,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Hc,t=>{t.results=[]}).addCase(Ir,(t,r)=>{let n=r.payload;t.results=t.results.filter(o=>o.uniqueId!==n.uniqueId);let a=t.results.slice(0,t.maxLength-1);t.results=[n,...a]})});var AG={initialState:{results:[]},options:{maxLength:10}},xG=new ge({results:new oe({required:!0})}),CG=new ge({maxLength:new ee({required:!0,min:1})});function bG(e,t){Be(e,CG,t?.options,"buildRecentResultsList"),lt(e,xG,t?.initialState,"buildRecentResultsList")}function wP(e,t){if(!wG(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state,o={...AG,...t};bG(e,o);let i={results:o.initialState.results,maxLength:o.options.maxLength};return n($c(i)),{...r,get state(){return a().recentResults},clear(){n(xP()),n(Hc())}}}function wG(e){return e.addReducers({recentResults:ih}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var FP=e=>{let t=/Document weights:\n((?:.)*?)\n+/g,r=/Terms weights:\n((?:.|\n)*)\n+/g,n=/Total weight: ([0-9]+)/g;if(!e)return null;let a=t.exec(e),o=r.exec(e),i=n.exec(e),p=FG(e),f=EP(a?a[1]:null),m=RG(o),g=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:g,qreWeights:p}},EP=e=>{let t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,r=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(!e)return null;let n=e.match(t);if(!n)return null;let a={};for(let o of n){let i=o.match(r);if(i){let p=i[1],f=i[2];a[p]=Number(f)}}return a},RP=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},RG=e=>{let t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,r=/([^:]+): ([0-9]+), ([0-9]+); /g;if(!e||!e[1])return null;let n=RP(e[1],t);if(!n)return null;let a={};for(let o of n){let i=RP(o[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=EP(o[2]);a[Object.keys(p).join(", ")]={terms:p,Weights:f}}return a},FG=e=>{let t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,r=t.exec(e),n=[];for(;r;)n.push({expression:r[1],score:parseInt(r[2],10)}),r=t.exec(e);return n};function IP(e){return e.search.response.results.map(r=>{let n=FP(r.rankingInfo);return{result:r,ranking:n}})}var EG=new ge({enabled:new ce({default:!1})});function TP(e,t={}){if(!IG(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state;lt(e,EG,t.initialState,"buildRelevanceInspector").enabled&&n(ba());let i=p=>{e.logger.warn(`Flag [ ${p} ] is now activated. This should *not* be used in any production environment as it negatively impact performance.`)};return{...r,get state(){let p=a(),f=p.debug;if(!p.debug)return{isEnabled:f};let{executionReport:m,basicExpression:g,advancedExpression:A,constantExpression:x,userIdentities:h,rankingExpressions:C}=p.search.response,{fieldsDescription:R,fetchAllFields:w}=p.fields;return{isEnabled:f,rankingInformation:IP(p),executionReport:m,expressions:{basicExpression:g,advancedExpression:A,constantExpression:x},userIdentities:h,rankingExpressions:C,fieldsDescription:R,fetchAllFields:w}},enable(){n(ba()),i("debug")},disable(){n(as()),n(pi())},enableFetchAllFields(){n(jc()),i("fetchAllFields")},disableFetchAllFields(){n(pi())},fetchFieldsDescription(){!this.state.isEnabled&&n(ba()),n(Vc()),i("fieldsDescription"),e.logger.warn(`For production environment, please specify the necessary fields either when instantiating a ResultList controller, or by dispatching a registerFieldsToInclude action.
44
+ For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function Do(e){e==="next"&&console.warn(mU)}d();c();l();u();var yE=kr(hE(),1);function SE(e){return(0,yE.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function vE(e,t){let r=OU(e),n=lr,o=NU(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function OU(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function NU(e){return e.preprocessRequest||Kl}d();c();l();u();var Uv=(e,t,r,n,o,a)=>{let i=e[t];ue(i)||ue(o)||o!==i&&o!==n&&(a.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),a.warn(`To remove this warning, make sure that access token value [${i}] matches engine configuration value [${r}]`))},Qv=(e,t)=>!(ue(e)||t===e),yl=e=>{let t=Dv(e);return t||!1},CE=(e,t)=>(Qv(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),xE=(e,t,r,n)=>(Uv(e,"searchHub",t.searchHub,po(),r,n),CE(e,t)),bE=(e,t)=>(Qv(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),AE=(e,t,r,n)=>(Uv(e,"pipeline",t.pipeline,Vn(),r,n),bE(e,t)),RE=(e,t)=>(Qv(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),_U=(e,t,r,n)=>(Uv(e,"userDisplayName",t.configuration.analytics.userDisplayName,Ns().analytics.userDisplayName,r,n),RE(e,t)),wE=e=>oe({},t=>{t.addCase(As,(r,n)=>{let o=yl(r.configuration.accessToken);return o?xE(o,r,n.payload,e):r}).addCase(rs,(r,n)=>{let o=yl(r.configuration.accessToken);return o?AE(o,r,n.payload,e):r}).addCase(zr,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:o}=n.payload;if(!o)return r;let a=yl(o);return a?[bE,CE,RE].reduce((i,p)=>p(a,i),r):r}).addCase(mr,(r,n)=>{let o=yl(r.configuration.accessToken);if(!o)return r;let a=xE(o,r,n.payload.searchHub,e);return AE(o,a,n.payload?.pipeline,e)}).addCase(go,(r,n)=>{let o=yl(r.configuration.accessToken);return o?_U(o,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var FE={organizationId:z,accessToken:z,name:new j({required:!1,emptyAllowed:!1}),analytics:new J({options:{required:!1},values:{enabled:new ce({required:!1}),originContext:new j({required:!1}),originLevel2:new j({required:!1}),originLevel3:new j({required:!1}),analyticsMode:new j({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new j({required:!1,url:!0}),trackingId:new j({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new j({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function EE(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var IE=new ge({...FE,search:new J({options:{required:!1},values:{pipeline:new j({required:!1,emptyAllowed:!0}),searchHub:it,locale:it,timezone:it,authenticationProviders:new ae({required:!1,each:z}),proxyBaseUrl:new j({required:!1,url:!0})}})});function Bv(){return{...EE(),search:{searchHub:"default"}}}var DU={debug:ts,pipeline:ns,searchHub:Cs,search:fe};function qU(e){let{search:t,organizationId:r,environment:n}=e,o=t?.proxyBaseUrl?t.proxyBaseUrl:ct(r,n);return{...t,apiBaseUrl:o}}function TE(e){let t=SE(e.loggerOptions),{configuration:r}=e;MU(r,t);let n=jU(r,t),o=VU(t),a={...vE(r,t),apiClient:n,streamingClient:o},i={...e,reducers:DU,crossReducer:wE(t)},p=cE(i,a),f=qU(r);return f&&p.dispatch(mr(f)),{...p,get state(){return p.state},executeFirstSearch(m=Bd()){if(Yu(p.state))return;let g=G({legacy:m,next:qb()});p.dispatch(g)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:g,metadata:S}=m;if(Yu(p.state))return;let A=S&&g==="omniboxFromLink",h=G({legacy:A?$d(S):Gd(),next:A?jb():Mb()});p.dispatch(h)}}}function MU(e,t){try{IE.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function jU(e,t){let{search:r}=e;return new Jl({logger:t,preprocessRequest:e.preprocessRequest||Kl,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||EA,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||IA,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||TA})}function VU(e){return new Hl({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var Ya={value:z,numberOfResults:new ee({min:0}),state:z};d();c();l();u();var he=z;var BU=new ee({min:1,default:8,required:!1}),GU=new ee({min:1,max:20,default:5,required:!1}),$U={desiredCount:GU,numberOfValues:BU},Xs=T("automaticFacet/setOptions",e=>O(e,$U)),Zs=T("automaticFacet/deselectAll",e=>O(e,he)),HU=z,sn=T("automaticFacet/toggleSelectValue",e=>O(e,{field:HU,selection:new J({values:Ya})}));d();c();l();u();d();c();l();u();var zU={state:new Le({required:!0}),numberOfResults:new ee({required:!0,min:0}),value:new j({required:!0,emptyAllowed:!0}),path:new ae({required:!0,each:z}),moreValuesAvailable:new ce({required:!1})};function Gv(e){e.children.forEach(t=>{Gv(t)}),lr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},zU)}var ec={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),activeTab:new j({required:!1}),delimitingCharacter:new j({required:!1,emptyAllowed:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),basePath:new ae({required:!1,each:z}),filterByBasePath:new ce({required:!1})};var cn=T("categoryFacet/register",e=>O(e,ec)),Mo=T("categoryFacet/toggleSelectValue",e=>{try{return lr(e.facetId,z),Gv(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),un=T("categoryFacet/deselectAll",e=>O(e,ec.facetId)),Ja=T("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:ec.facetId,numberOfValues:ec.numberOfValues})),tc=T("categoryFacet/updateSortCriterion",e=>O(e,{facetId:ec.facetId,criterion:new Le})),Rm=T("categoryFacet/updateBasePath",e=>O(e,{facetId:ec.facetId,basePath:new ae({each:z})}));d();c();l();u();var WU={categoryFacetId:he,categoryFacetPath:new ae({required:!0,each:z})},KU=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},wm=e=>Y("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,WU),t.makeBreadcrumbFacet(KU(r,e)))),PE=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var be=T("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new ce({required:!1})})),jt=T("facetOptions/facet/enable",e=>O(e,he)),Je=T("facetOptions/facet/disable",e=>O(e,he));d();c();l();u();var er=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var Sl={facetId:he,captions:new J({options:{required:!1}}),numberOfValues:new ee({required:!1,min:1}),query:new j({required:!1,emptyAllowed:!0})};var YU={path:new ae({required:!0,each:z}),displayValue:Ue,rawValue:Ue,count:new ee({required:!0,min:0})},rc=T("categoryFacet/selectSearchResult",e=>O(e,{facetId:he,value:new J({values:YU})})),nc=T("categoryFacetSearch/register",e=>O(e,Sl));d();c();l();u();function oc(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function ac(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function Fm(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function vl(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Em(e,t,r){e.currentValues=JU(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function JU(e,t){if(!e.length)return[];let r=kE(e[0],t),n=r;for(let o of e.splice(1)){let a=kE(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function kE(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var ln=oe(Ui(),e=>{e.addCase(cn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=ZU(n),p=i.numberOfValues;t[o]={request:i,initialNumberOfValues:p,tabs:a}}).addCase(_e.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(a=>{let i=t[a],p=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!er(i.tabs,o)){p.currentValues.length&&Em(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&Em(p,m,i.initialNumberOfValues)})}).addCase(tc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(Rm,(t,r)=>{let{facetId:n,basePath:o}=r.payload,a=t[n]?.request;a&&(a.basePath=[...o])}).addCase(Mo,(t,r)=>{let{facetId:n,selection:o,retrieveCount:a}=r.payload,i=t[n]?.request;if(!i)return;let{path:p}=o,f=p.slice(0,p.length-1),m=XU(i,f,a);if(m.length){let S=m[0];S.retrieveChildren=!0,S.state="selected",S.previousState="idle",S.children=[];return}let g=NE(o.value,a);g.state="selected",g.previousState="idle",m.push(g),i.numberOfValues=1}).addCase(un,(t,r)=>{let n=r.payload;vl(t,n)}).addCase(pt,t=>{Object.keys(t).forEach(r=>vl(t,r))}).addCase(Wr,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(Ja,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,a=t[n]?.request;if(a){if(!a.currentValues.length)return Fm(a,o);eQ(t,r.payload)}}).addCase(rc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];Em(a.request,i,a.initialNumberOfValues)}).addCase(vr.fulfilled,(t,r)=>{OE(t,r.payload.response.facets)}).addCase(G.fulfilled,(t,r)=>{OE(t,r.payload.response.facets)}).addCase(Je,(t,r)=>{vl(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&vl(t,o)})})}),xl={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function XU(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=NE(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function ZU(e){return{...xl,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function NE(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function OE(e,t){t.forEach(r=>{if(!tQ(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=rQ(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function eQ(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function tQ(e,t){return t.facetId in e}function rQ(e,t){let r=or(e.currentValues),n=or(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var dn=new j({regex:/^[a-zA-Z0-9-_]+$/}),pn=new j({required:!0}),_E=new ae({each:new j}),DE=new j,qE=new ce,fn=new ce,mn=new ee({min:0}),Vr=new ee({min:1}),Im=new ce({required:!0}),nQ=new J,oQ=new j,aQ={captions:nQ,numberOfValues:Vr,query:oQ},ic=new J({values:aQ}),Tm=new J({options:{required:!1},values:{type:new j({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ae({required:!0,max:25,each:new j({emptyAllowed:!1,required:!0})})}}),ME=new ce,Pm=new ae({min:1,max:25,required:!1,each:new j({emptyAllowed:!1,required:!0})});var iQ={facetId:he,field:new j({required:!0,emptyAllowed:!0}),tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),activeTab:new j({required:!1}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),resultsMustMatch:new Le({required:!1}),allowedValues:Tm,customSort:Pm},gn=T("facet/register",e=>O(e,iQ)),hn=T("facet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:Ya})})),yn=T("facet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:Ya})})),Xe=T("facet/deselectAll",e=>O(e,he)),sc=T("facet/updateSortCriterion",e=>O(e,{facetId:he,criterion:new Le({required:!0})})),Xa=T("facet/updateNumberOfValues",e=>O(e,{facetId:he,numberOfValues:new ee({required:!0,min:1})})),Za=T("facet/updateIsFieldExpanded",e=>O(e,{facetId:he,isFieldExpanded:new ce({required:!0})})),Wn=T("facet/updateFreezeCurrentValues",e=>O(e,{facetId:he,freezeCurrentValues:new ce({required:!0})}));d();c();l();u();var cc=e=>Y("analytics/facet/showMore",(t,r)=>{O(e,he);let n=$i(e,ar(r));return t.makeFacetShowMore(n)}),uc=e=>Y("analytics/facet/showLess",(t,r)=>{O(e,he);let n=$i(e,ar(r));return t.makeFacetShowLess(n)}),Sn=e=>Y("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:he,criterion:new Le({required:!0})});let{facetId:n,criterion:o}=e,a=ar(r),p={...$i(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),vt=e=>Y("analytics/facet/reset",(t,r)=>{O(e,he);let n=ar(r),o=$i(e,n);return t.makeFacetClearAll(o)}),ot=e=>Y("analytics/facet/select",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=Hi(e,n);return t.makeFacetSelect(o)}),cr=e=>Y("analytics/facet/exclude",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=Hi(e,n);return t.makeFacetExclude(o)}),Lr=e=>Y("analytics/facet/deselect",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=Hi(e,n);return t.makeFacetDeselect(o)}),Kn=e=>Y("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=Hi(e,n);return t.makeFacetUnexclude(o)}),lc=e=>Y("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=Hi(e,ar(r));return t.makeBreadcrumbFacet(n)}),Vt=()=>({actionCause:"facetClearAll"}),mt=()=>({actionCause:"facetSelect"}),Yn=()=>({actionCause:"facetExclude"}),Jn=()=>({actionCause:"facetDeselect"}),jE=()=>({actionCause:"facetUnexclude"}),km=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var VE={facetId:he,value:new J({values:{displayValue:Ue,rawValue:Ue,count:new ee({required:!0,min:0})}})},Om=T("facetSearch/register",e=>O(e,Sl)),jo=T("facetSearch/update",e=>O(e,Sl)),ei=T("facetSearch/toggleSelectValue",e=>O(e,VE)),ti=T("facetSearch/toggleExcludeValue",e=>O(e,VE));var Rr=oe(Gi(),e=>{e.addCase(gn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=pb(sQ(r.payload),o))}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(De,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(i=>{let{request:p}=t[i],f=n[i]||[],m=o[i]||[],g=f.length+m.length,S=p.currentValues.filter(A=>!f.includes(A.value)&&!m.includes(A.value));p.currentValues=[...f.map(UE),...m.map(QE),...S.map(uQ)],p.preventAutoSelect=g>0,p.numberOfValues=Math.max(g,p.numberOfValues)})}).addCase(hn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){Nm(a,o);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",a.freezeCurrentValues=!0}).addCase(yn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){Nm(a,o);return}let p=i.state==="excluded";i.previousState=i.state,i.state=p?"idle":"excluded",a.freezeCurrentValues=!0}).addCase(Wn,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,a=t[n]?.request;a&&(a.freezeCurrentValues=o)}).addCase(Xe,(t,r)=>{ac(t[r.payload]?.request)}).addCase(pt,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>ac(r))}).addCase(os,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>ac(r))}).addCase(Wr,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(sc,(t,r)=>{oc(t,r.payload)}).addCase(Xa,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;Fm(t[n]?.request,o)}).addCase(Za,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,a=t[n]?.request;a&&(a.isFieldExpanded=o)}).addCase(G.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>LE(t[o.facetId]?.request,o))}).addCase(vr.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>LE(t[o.facetId]?.request,o))}).addCase(ei,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="selected";return}let m=UE(i);Nm(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(ti,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="excluded";return}let m=QE(i);Nm(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(Je,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];ac(n)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&ac(a.request)})})});function Nm(e,t){let{currentValues:r}=e,n=r.findIndex(a=>a.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function LE(e,t){e&&(e.currentValues=t.values.map(cQ),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var Al={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function sQ(e){return{...Al,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function cQ(e){let{value:t,state:r}=e;return{value:t,state:r}}function UE(e){return{value:e,state:"selected"}}function QE(e){return{value:e,state:"excluded"}}function uQ(e){return{...e,state:"idle"}}d();c();l();u();var _m=()=>Y("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function Vo(e){let t=BE(e.start,e),r=BE(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function BE(e,t){let{dateFormat:r}=t;return Zb(e)?(xo(e),Yb(e)):typeof e=="string"&&Jr(e)?(xo(e),e):(ep(e,r),Hu(pa(e,r)))}d();c();l();u();var dc=T("rangeFacet/updateSortCriterion",e=>O(e,{facetId:he,criterion:new Le({required:!0})}));d();c();l();u();var ri={state:z,start:new ee({required:!0}),end:new ee({required:!0}),endInclusive:new ce({required:!0}),numberOfResults:new ee({required:!0,min:0})},ni={start:z,end:z,endInclusive:new ce({required:!0}),state:z,numberOfResults:new ee({required:!0,min:0})},oi=e=>({facetId:he,selection:typeof e.start=="string"?new J({values:ni}):new J({values:ri})});var lQ={start:z,end:z,endInclusive:new ce({required:!0}),state:z},dQ={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),activeTab:new j({required:!1}),currentValues:new ae({required:!1,each:new J({values:lQ})}),generateAutomaticRanges:new ce({required:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),rangeAlgorithm:new Le({required:!1})};function GE(e){return Jr(e)?Wu(e):e}function Dm(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Vo(t);if(pa(GE(r)).isAfter(pa(GE(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var vn=T("dateFacet/register",e=>{try{return lr(e,dQ),Dm(e),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),xn=T("dateFacet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:ni})})),An=T("dateFacet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:ni})})),Xn=T("dateFacet/updateFacetValues",e=>{try{return lr(e,{facetId:he,values:new ae({each:new J({values:ni})})}),Dm({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),qm=dc,Mm=Xe;d();c();l();u();d();c();l();u();var jm=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,a=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:a,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},Vm=()=>({actionCause:"breadcrumbFacet"});var Cl=e=>Y("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,oi(e.selection));let n=jm(r,e);return t.makeBreadcrumbFacet(n)}),$v=Vm;d();c();l();u();function pQ(e,t){return!!t&&t.facetId in e.dateFacetSet}var $E=(e,t)=>{let r=Nr(e,t);if(pQ(e,r))return r},HE=(e,t)=>($E(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),zE=(e,t)=>($E(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var Um={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function Qm(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=WE(r);r.numberOfValues=o,e[n]=t}function Bm(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=WE(n))}function Gm(e,t,r){let n=e[t]?.request;if(!n)return;let o=Lm(n.currentValues,r);if(!o)return;let a=o.state==="selected";o.previousState=o.state,o.state=a?"idle":"selected",n.preventAutoSelect=!0}function $m(e,t,r){let n=e[t]?.request;if(!n)return;let o=Lm(n.currentValues,r);if(!o)return;let a=o.state==="excluded";o.previousState=o.state,o.state=a?"idle":"excluded",n.preventAutoSelect=!0}function Cn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function Hm(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(Lm(o,p)&&(p.state="selected"),p));let a=o.filter(p=>!Lm(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function zm(e,t,r){t.forEach(n=>{let o=n.facetId,a=e[o]?.request;if(!a)return;let i=r(n.values);a.currentValues=i,a.preventAutoSelect=!1})}function Lm(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function WE(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var bn=oe(Qi(),e=>{e.addCase(vn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=fQ(n);Qm(t,lb(a,o))}).addCase(_e.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.df||{};Hm(t,n)}).addCase(xn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Gm(t,n,o)}).addCase(An,(t,r)=>{let{facetId:n,selection:o}=r.payload;$m(t,n,o)}).addCase(Xn,(t,r)=>{let{facetId:n,values:o}=r.payload;Bm(t,n,o)}).addCase(Mm,(t,r)=>{Cn(t,r.payload)}).addCase(pt,t=>{Object.keys(t).forEach(r=>{Cn(t,r)})}).addCase(qm,(t,r)=>{oc(t,r.payload)}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.facets;zm(t,n,mQ)}).addCase(Je,(t,r)=>{Cn(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&Cn(t,o)})})});function fQ(e){return{...Um,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function mQ(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var gQ={state:z,start:new ee({required:!0}),end:new ee({required:!0}),endInclusive:new ce({required:!0})},hQ={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),activeTab:new j({required:!1}),currentValues:new ae({required:!1,each:new J({values:gQ})}),generateAutomaticRanges:new ce({required:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),rangeAlgorithm:new Le({required:!1})};function Wm(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var Rn=T("numericFacet/register",e=>{try{return O(e,hQ),Wm(e),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),wn=T("numericFacet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:ri})})),Fn=T("numericFacet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:ri})})),Zn=T("numericFacet/updateFacetValues",e=>{try{return lr(e,{facetId:he,values:new ae({each:new J({values:ri})})}),Wm({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),Km=dc,Ym=Xe;d();c();l();u();var bl=e=>Y("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,oi(e.selection));let n=jm(r,e);return t.makeBreadcrumbFacet(n)}),Hv=Vm;d();c();l();u();function yQ(e,t){return!!t&&t.facetId in e.numericFacetSet}var KE=(e,t)=>{let r=Nr(e,t);if(yQ(e,r))return r},YE=(e,t)=>(KE(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),JE=(e,t)=>(KE(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var wr=oe(Bi(),e=>{e.addCase(Rn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=SQ(n);Qm(t,db(a,o))}).addCase(_e.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.nf||{};Hm(t,n)}).addCase(wn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Gm(t,n,o)}).addCase(Fn,(t,r)=>{let{facetId:n,selection:o}=r.payload;$m(t,n,o)}).addCase(Zn,(t,r)=>{let{facetId:n,values:o}=r.payload;Bm(t,n,o)}).addCase(Ym,(t,r)=>{Cn(t,r.payload)}).addCase(pt,t=>{Object.keys(t).forEach(r=>{Cn(t,r)})}).addCase(Km,(t,r)=>{oc(t,r.payload)}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.facets;zm(t,n,vQ)}).addCase(Je,(t,r)=>{Cn(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&Cn(t,o)})})});function SQ(e){return{...Um,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function vQ(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var ai=z,Jm=new J({options:{required:!0},values:{caption:Ue,expression:Ue,state:new j({constrainTo:["idle","selected","excluded"]})}}),Xm=new ae({required:!0,each:Jm});var pc=T("staticFilter/register",e=>O(e,{id:ai,values:Xm})),eo=T("staticFilter/toggleSelect",e=>O(e,{id:ai,value:Jm})),to=T("staticFilter/toggleExclude",e=>O(e,{id:ai,value:Jm})),Lo=T("staticFilter/deselectAllFilterValues",e=>O(e,ai)),Zm=e=>Y("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),fc=e=>Y("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),eg=e=>Y("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e));d();c();l();u();d();c();l();u();function ne(e){let t,r=new Map,n=()=>r.size===0,o=a=>{try{let i=JSON.stringify(a),p=t!==i;return t=i,p}catch(i){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",i),!0}};return{subscribe(a){a();let i=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(i,a),()=>{r.delete(i),n()&&p?.()}},get state(){return{}}}}var tg=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function XE(e){let t=ne(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(pt())},deselectBreadcrumb(n){n.deselect()}}}function ZE(e){if(!xQ(e))throw W;let t=XE(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let R={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:b,selection:F})=>{r(hn({facetId:b,selection:F})),r(Wn({facetId:b,freezeCurrentValues:!1})),r(G({legacy:lc({facetId:b,facetValue:F.value}),next:km()}))},executeToggleExclude:({facetId:b,selection:F})=>{r(yn({facetId:b,selection:F})),r(Wn({facetId:b,freezeCurrentValues:!1})),r(G({legacy:lc({facetId:b,facetValue:F.value}),next:km()}))},facetValuesSelector:sb};return tg(R)},a=()=>{let R={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:b=>{r(wn(b)),r(G({legacy:bl(b),next:Hv()}))},executeToggleExclude:b=>{r(Fn(b)),r(G({legacy:bl(b),next:Hv()}))},facetValuesSelector:YE};return tg(R)},i=()=>{let R={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:b=>{r(xn(b)),r(G({legacy:Cl(b),next:$v()}))},executeToggleExclude:b=>{r(An(b)),r(G({legacy:Cl(b),next:$v()}))},facetValuesSelector:zE};return tg(R)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(R=>R.path.length),f=R=>{let b=ub(n(),R);return{facetId:R,field:n().categoryFacetSet[R].request.field,path:b,deselect:()=>{r(un(R)),r(G({legacy:wm({categoryFacetPath:b.map(F=>F.value),categoryFacetId:R}),next:PE()}))}}},m=()=>{let R=n().staticFilterSet??{};return Object.values(R).map(g)},g=R=>{let{id:b,values:F}=R,E=F.filter(P=>P.state!=="idle").map(P=>S(b,P));return{id:b,values:E}},S=(R,b)=>({value:b,deselect:()=>{let{caption:F,expression:E}=b;b.state==="selected"?r(eo({id:R,value:b})):b.state==="excluded"&&r(to({id:R,value:b})),r(G({legacy:fc({staticFilterId:R,staticFilterValue:{caption:F,expression:E}})}))}}),A=()=>{let R=n().automaticFacetSet?.set??{};return Object.values(R).map(b=>h(b.response)).filter(b=>b.values.length>0)},h=R=>{let{field:b,label:F}=R,E=R.values.filter(P=>P.state!=="idle").map(P=>C(b,P));return{facetId:b,field:b,label:F,values:E}},C=(R,b)=>({value:b,deselect:()=>{r(sn({field:R,selection:b})),r(G({legacy:lc({facetId:R,facetValue:b.value}),next:km()}))}});function w(){return!![...o(),...a(),...i(),...p(),...m(),...A()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:a(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:A(),hasBreadcrumbs:w()}},deselectAll:()=>{t.deselectAll(),r(G({legacy:_m(),next:{actionCause:"breadcrumbResetAll"}}))}}}function xQ(e){return e.addReducers({configuration:le,search:fe,facetSet:Rr,numericFacetSet:wr,dateFacetSet:bn,categoryFacetSet:ln}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var AQ=new ae({each:z,required:!0}),eI=(e,t)=>(O(e,z),vi(t)?O(t,z):O(t,AQ),{payload:{contextKey:e,contextValue:t}}),ii=T("context/set",e=>{for(let[t,r]of Object.entries(e))eI(t,r);return{payload:e}}),si=T("context/add",e=>eI(e.contextKey,e.contextValue)),ci=T("context/remove",e=>O(e,z));d();c();l();u();var rg=oe(ap(),e=>{e.addCase(ii,(t,r)=>{t.contextValues=r.payload}).addCase(si,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(ci,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();var CQ=["caseId","caseNumber"],bQ={caseId:"caseContext",caseNumber:"caseContext"},Rl=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${bQ[t]} to set this value.}`)}};function zv(e){return CQ.includes(e)}var RQ=new ge({values:new J({options:{required:!1}})});function tI(e,t={}){if(!EQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=ut(e,RQ,t.initialState,"buildContext");return a.values&&n(ii(a.values)),{...r,get state(){return{values:o().context.contextValues}},set(i){n(ii(i))},...(o().configuration.analytics.analyticsMode==="legacy"?wQ(n):FQ(n))}}var wQ=e=>({add(t,r){e(si({contextKey:t,contextValue:r}))},remove(t){e(ci(t))}}),FQ=e=>({add(t,r){if(zv(t))throw new Rl(t);e(si({contextKey:t,contextValue:r}))},remove(t){if(zv(t))throw new Rl(t);e(ci(t))}});function EQ(e){return e.addReducers({context:rg}),!0}function rI(e,t){return tI(e,t)}d();c();l();u();d();c();l();u();var xt=oe(sp(),e=>{e.addCase(be,(t,r)=>({...t,...r.payload})).addCase(G.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(G.rejected,t=>{t.freezeFacetOrder=!1}).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(cn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;ng(o,t,n)}).addCase(gn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;ng(o,t,n)}).addCase(vn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;ng(o,t,n)}).addCase(Rn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;ng(o,t,n)}).addCase(jt,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(Je,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(De,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=vS()),t.facets[n].enabled=!0})})});function ng(e,t,r){let n={...vS(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var mc=oe(dp(),e=>{e.addCase(Os,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(gt,(t,r)=>{let n=r.payload;nI(t,n)}).addCase(Zi,(t,r)=>{let n=r.payload;nI(t,n)}).addCase(_e.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(De,(t,r)=>{let n=r.payload.tab;ue(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function nI(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function og(e){if(!IQ(e))throw W;let t=ne(e),r=Ye(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function IQ(e){return e.addReducers({tabSet:mc}),!0}function oI(e,t){if(!TQ(e))throw W;let r=og(e),n=C=>e.state.facetOptions.facets[C]?.enabled??!1,o=C=>e.state.facetSet?.[C]?.request?.currentValues??e.state.categoryFacetSet?.[C]?.request?.currentValues??e.state.numericFacetSet?.[C]?.request?.currentValues??e.state.dateFacetSet?.[C]?.request?.currentValues??null,a=C=>C in e.state.facetOptions.facets,i=C=>e.state.facetOptions.facets[C]?.tabs,p=()=>Ai({isFacetRegistered:a(t.facetId),parentFacets:t.conditions.map(({parentFacetId:C})=>a(C)?{enabled:n(C),values:o(C)}:null),isTabEnabled:er(i(t.facetId),r.state.activeTab)}),f=()=>{let C=p();return C===A?!1:(A=C,!0)},m=()=>t.conditions.length>0?t.conditions.some(C=>{if(!n(C.parentFacetId))return!1;let w=o(C.parentFacetId);return w===null?!1:C.condition(w)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([C,w])=>w.request.freezeCurrentValues&&e.dispatch(Wn({facetId:C,freezeCurrentValues:!1})))},S=()=>{if(!a(t.facetId))return;let C=n(t.facetId),w=m(),R=er(i(t.facetId),r.state.activeTab),b=w&&R;C!==b&&(e.dispatch(b?jt(t.facetId):Je(t.facetId)),g())},A=p(),h=e.subscribe(()=>{f()&&S()});return S(),{stopWatching(){h()}}}function TQ(e){return e.addReducers({facetOptions:xt}),!0}d();c();l();u();d();c();l();u();var gc=T("dictionaryFieldContext/set",e=>{let t=new J({options:{required:!0}}),r=O(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ae({each:Ue}),a=O(n,o).error;return a?{payload:e,error:a}:{payload:e}}),hc=T("dictionaryFieldContext/add",e=>{let t=new J({options:{required:!0},values:{field:Ue,key:Ue}});return O(e,t)}),yc=T("dictionaryFieldContext/remove",e=>O(e,Ue));d();c();l();u();var ag=oe(ip(),e=>{e.addCase(gc,(t,r)=>{t.contextValues=r.payload}).addCase(hc,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(yc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function aI(e){if(!PQ(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(gc(o))},add(o,a){r(hc({field:o,key:a}))},remove(o){r(yc(o))}}}function PQ(e){return e.addReducers({dictionaryFieldContext:ag}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var iI=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var ig=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),sI=()=>({correctedQuery:"",corrections:[],originalQuery:""});function cI(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:ig(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var uI=(e,t)=>{let r={...sI(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var sg=oe(cI(),e=>{e.addCase(gs,t=>{t.enableDidYouMean=!0}).addCase(rp,t=>{t.enableDidYouMean=!1}).addCase(np,t=>{t.automaticallyCorrectQuery=!0}).addCase(hs,t=>{t.automaticallyCorrectQuery=!1}).addCase(G.pending,t=>{t.queryCorrection=ig(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(G.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let a=o?.[0]?o[0]:ig();t.queryCorrection=a}t.queryCorrectionMode==="next"&&uI(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(gr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(fa,(t,r)=>{t.queryCorrectionMode=r.payload})});function lI(e,t={}){if(!kQ(e))throw W;let r=ne(e),{dispatch:n}=e;n(gs()),t.options?.automaticallyCorrectQuery===!1&&n(hs()),n(fa(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>iI(o().didYouMean);return{...r,get state(){let i=o();return{originalQuery:i.didYouMean.originalQuery,wasCorrectedTo:i.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:i.didYouMean.wasAutomaticallyCorrected,queryCorrection:i.didYouMean.queryCorrection,hasQueryCorrection:a()}},applyCorrection(){n(gr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(fa(i))}}}function kQ(e){return e.addReducers({configuration:le,didYouMean:sg}),!0}function dI(e,t={}){let r=lI(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(G({legacy:op(),next:oR()}))}}}d();c();l();u();d();c();l();u();function pI(e){if(!OQ(e))throw W;let t=ne(e),r=()=>e.state;return{...t,sort(n){return Ku(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function OQ(e){return e.addReducers({search:fe,facetOptions:xt}),!0}function fI(e){return pI(e)}d();c();l();u();d();c();l();u();var cg=oe(Vi(),e=>{e.addCase(G.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(Xs,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(sn,(t,r)=>{let{field:n,selection:o}=r.payload,a=t.set[n]?.response;if(!a)return;let i=a.values.find(f=>f.value===o.value);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(Zs,(t,r)=>{let n=r.payload,o=t.set[n]?.response;if(o)for(let a of o.values)a.state="idle"}).addCase(De,(t,r)=>{let n=r.payload.af??{},o=Object.keys(t.set);for(let a in n)if(!t.set[a]){let i=NQ(a),p=n[a].map(f=>mI(f));i.values.push(...p),t.set[a]={response:i}}for(let a of o)if(!(a in n)){let i=t.set[a]?.response;for(let p of i.values)p.state="idle"}for(let a in n){let i=t.set[a]?.response;if(i){let p=i.values,f=new Set(n[a]);for(let m of p)f.has(m.value)?(m.state="selected",f.delete(m.value)):m.state="idle";for(let m of f)i.values.push(mI(m))}}}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.automaticFacetSet.set).length!==0)return r.payload.automaticFacetSet}).addCase(pt,t=>{Object.values(t.set).forEach(({response:r})=>{r.values.forEach(n=>{n.state="idle"})})})});function NQ(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function mI(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var ug=e=>e.state==="selected",lg=e=>e.state==="excluded",dg=(e,t)=>{let r={facetId:e,facetValue:t.value};return ug(t)?Lr(r):ot(r)},pg=e=>ug(e)?Jn():mt(),gI=(e,t)=>{let r={facetId:e,facetValue:t.value};return lg(t)?Kn(r):cr(r)},hI=e=>lg(e)?jE():Yn();function yI(e,t){let{dispatch:r}=e,n=ne(e),{field:o}=t;return{...n,toggleSelect(a){r(sn({field:o,selection:a})),r(G({legacy:dg(o,a),next:pg(a)}))},deselectAll(){r(Zs(o)),r(G({legacy:vt(o),next:Vt()}))},get state(){let a=e.state.automaticFacetSet?.set[o]?.response;return a?{field:a.field,label:a.label,values:a.values}:{field:"",values:[],label:""}}}}d();c();l();u();function SI(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function vI(e,t){if(!_Q(e))throw W;let{dispatch:r}=e,n=SI(t.options);return r(Xs(n)),{...ne(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>yI(e,{field:i.field}))??[]}}}}function _Q(e){return e.addReducers({automaticFacetSet:cg,configuration:le,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function fg(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,a={...En,...t},i=r();e[n]={options:a,isLoading:o,response:i,initialNumberOfValues:a.numberOfValues,requestId:""}}function mg(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function gg(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function hg(e,t){let r=e[t];r&&(r.isLoading=!1)}function yg(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function wl(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=En.query)}function Sg(e,t){Object.keys(e).forEach(r=>wl(e,{facetId:r},t))}var En={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var xI=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,a=t.categoryFacetSet[e].request,{captions:i,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:g,basePath:S,filterFacetCount:A}=a,h=DQ(a),C=h.length?[h]:[],w=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:S,captions:i,numberOfValues:f,query:w,field:m,delimitingCharacter:g,ignorePaths:C,filterFacetCount:A,type:"hierarchical",...(n?{}:{searchContext:(yield yr(t,r)).request})}});return function xI(_x153,_x154,_x155,_x156){return _ref71.apply(this,arguments)}}(),DQ=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var AI=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:a,numberOfValues:i}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,g=f.filter(A=>A.state!=="idle").map(A=>A.value),S=`*${a}*`;return{url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:i,query:S,field:p,ignoreValues:g,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield yr(t,r)).request})}});return function AI(_x157,_x158,_x159,_x160){return _ref72.apply(this,arguments)}}();var CI=e=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,z),qQ(i,t)?p=yield AI(t,i,a,e):p=yield xI(t,i,a,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x161,_x162){return _ref73.apply(this,arguments)}}()),At=Se("facetSearch/executeSearch",CI(!1)),In=Se("facetSearch/executeSearch",CI(!0)),Sc=T("facetSearch/clearResults",e=>O(e,{facetId:he})),qQ=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function bI(){return{}}var vc=oe(bI(),e=>{e.addCase(nc,(t,r)=>{let n=r.payload;fg(t,n,Wv)}).addCase(jo,(t,r)=>{mg(t,r.payload)}).addCase(At.pending,(t,r)=>{let n=r.meta.arg;gg(t,n,r.meta.requestId)}).addCase(At.rejected,(t,r)=>{let n=r.meta.arg;hg(t,n)}).addCase(At.fulfilled,(t,r)=>{yg(t,r.payload,r.meta.requestId)}).addCase(Sc,(t,{payload:{facetId:r}})=>{wl(t,{facetId:r},Wv)}).addCase(G.fulfilled,t=>{Sg(t,Wv)})});function Wv(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function RI(e,t){let{field:r,state:n}=e;if(!MQ(e))return r;let o=`${r}_`,a=jQ(o,n);return LQ(r,t),`${o}${a}`}function MQ(e){let{field:t,state:r}=e;return wI(r).some(o=>o&&t in o)}function jQ(e,t){let n=wI(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return VQ(n,e)+1}function wI(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function VQ(e,t){return e.map(a=>{let i=a.split(t)[1],p=parseInt(i,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function LQ(e,t){let r=`A facet with field "${e}" already exists.
45
+ To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function Lt(e,t){let{state:r,logger:n}=e,{field:o,facetId:a}=t;return a||RI({field:o,state:r},n)}d();c();l();u();d();c();l();u();var FI=["alphanumeric","occurrences"];var EI=new ge({field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),basePath:_E,delimitingCharacter:DE,facetId:dn,facetSearch:ic,filterByBasePath:qE,filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,sortCriteria:new j({constrainTo:FI})});function II(e,t){if(!UQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=Lt(e,t.options),a=t.options.tabs??{},i=Gt(e.state.tabSet),p={...xl,...Bl("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...En,...t.options.facetSearch},...p};Be(e,EI,f,"buildCategoryFacet");let m=()=>Gy(e.state,o),g=()=>By(e.state,o),S=()=>$r(e.state),A=()=>Xr(e.state,o);return n(cn(p)),{...r,toggleSelect(h){let C=f.numberOfValues;n(Mo({facetId:o,selection:h,retrieveCount:C})),n(be())},deselectAll(){n(un(o)),n(be())},sortBy(h){n(tc({facetId:o,criterion:h})),n(be())},isSortedBy(h){return m().sortCriteria===h},showMoreValues(){let{numberOfValues:h}=f,{activeValue:C,valuesAsTrees:w}=this.state,R=(C?.children.length??w.length)+h;n(Ja({facetId:o,numberOfValues:R})),n(be())},showLessValues(){let{numberOfValues:h}=f;n(Ja({facetId:o,numberOfValues:h})),n(be())},enable(){n(jt(o))},disable(){n(Je(o))},get state(){let h=m(),C=g(),w=S(),R=A(),b=C?.values??[],F=b.some(U=>U.children.length>0)??!1,{parents:E,values:P}=cb(C?.values),M=or(b),_=M.length?M[M.length-1]:void 0,k=!!_,N=_?.moreValuesAvailable??C?.moreValuesAvailable??!1,q=_?_.children.length>f.numberOfValues:b.length>f.numberOfValues;return{facetId:o,parents:E,selectedValueAncestry:M,values:P,isHierarchical:F,valuesAsTrees:b,activeValue:_,isLoading:w,hasActiveValues:k,canShowMoreValues:N,canShowLessValues:q,sortCriteria:h.sortCriteria,enabled:R}}}}function UQ(e){return e.addReducers({categoryFacetSet:ln,categoryFacetSearchSet:vc,facetOptions:xt,configuration:le,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var QQ="coveo-headless-internal-state",vg=Symbol.for(QQ);d();c();l();u();function xc(e,t){let r=e.dispatch,{options:n,getFacetSearch:o,executeFacetSearchActionCreator:a,executeFieldSuggestActionCreator:i}=t,{facetId:p}=n;return{updateText(f){r(jo({facetId:p,query:f,numberOfValues:o().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:f,options:m}=o();r(jo({facetId:p,numberOfValues:m.numberOfValues+f})),r(t.isForFieldSuggestions?i(p):a(p))},search(){r(t.isForFieldSuggestions?i(p):a(p))},clear(){r(Sc({facetId:p}))},updateCaptions(f){r(jo({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:g}=o(),{query:S}=g,A=f.values;return{...f,values:A,isLoading:m,query:S}}}}function TI(e,t){let{dispatch:r}=e,n={...En,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[vg].categoryFacetSearchSet[o];r(nc(n));let i=xc(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(rc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function xg(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a}=t,{dispatch:i}=e,p={...En,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],g=TI(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(nc(p));let S=xc(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In});return{...S,...g,get state(){return{...S.state,...g.state}}}}function PI(e,t){if(!BQ(e))throw W;let r=II(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=xg(e,{options:{facetId:o(),...t.options.facetSearch},executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In,select:f=>{n(be()),n(G({legacy:ot({facetId:o(),facetValue:f.rawValue}),next:mt()}))},isForFieldSuggestions:!1}),{state:i,...p}=a;return{...r,facetSearch:p,toggleSelect(f){r.toggleSelect(f),n(G({legacy:GQ(o(),f),next:$Q(f)}))},deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:Vt()}))},sortBy(f){r.sortBy(f),n(G({legacy:Sn({facetId:o(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(vr({legacy:cc(o())}))},showLessValues(){r.showLessValues(),n(vr({legacy:uc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function BQ(e){return e.addReducers({categoryFacetSet:ln,categoryFacetSearchSet:vc,configuration:le,search:fe}),!0}function GQ(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Lr(r):ot(r)}function $Q(e){return e.state==="selected"?Jn():mt()}d();c();l();u();d();c();l();u();d();c();l();u();function kI(){return{}}var Ac=oe(kI(),e=>{e.addCase(Om,(t,r)=>{let n=r.payload;fg(t,n,Kv)}).addCase(jo,(t,r)=>{mg(t,r.payload)}).addCase(At.pending,(t,r)=>{let n=r.meta.arg;gg(t,n,r.meta.requestId)}).addCase(At.rejected,(t,r)=>{let n=r.meta.arg;hg(t,n)}).addCase(At.fulfilled,(t,r)=>{yg(t,r.payload,r.meta.requestId)}).addCase(Sc,(t,{payload:r})=>{wl(t,r,Kv)}).addCase(G.fulfilled,t=>{Sg(t,Kv)})});function Kv(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var OI={facetId:he,selection:new J({values:Ya})},NI=Se("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},OI),n(hn({facetId:e,selection:t})),n(be())}),_I=Se("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},OI),n(yn({facetId:e,selection:t})),n(be())});d();c();l();u();d();c();l();u();var Cc=["allValues","atLeastOneValue"];d();c();l();u();var Ag=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var DI=new ge({facetId:dn,tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),field:pn,filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,sortCriteria:new j({constrainTo:Ag}),resultsMustMatch:new j({constrainTo:Cc}),facetSearch:ic});function qI(e,t,r=DI){if(!HQ(e))throw W;let{dispatch:n}=e,o=ne(e),a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...Al,...Bl("facetSearch",t.options),field:t.options.field,facetId:a,tabs:i,activeTab:p},m={facetSearch:{...En,...t.options.facetSearch},...f};Be(e,r,m,"buildFacet");let g=()=>kd(e.state,a),S=()=>Li(e.state,a),A=()=>$r(e.state),h=()=>Xr(e.state,a),C=()=>{let{currentValues:R}=g();return R.filter(b=>b.state!=="idle").length},w=()=>{let{currentValues:R}=g(),b=m.numberOfValues,F=!!R.find(E=>E.state==="idle");return b<R.length&&F};return n(gn(f)),{...o,toggleSelect:R=>n(NI({facetId:m.facetId,selection:R})),toggleExclude:R=>n(_I({facetId:m.facetId,selection:R})),toggleSingleSelect:function(R){R.state==="idle"&&n(Xe(a)),this.toggleSelect(R)},toggleSingleExclude:function(R){R.state==="idle"&&n(Xe(a)),this.toggleExclude(R)},isValueSelected:ug,isValueExcluded:lg,deselectAll(){n(Xe(a)),n(be())},sortBy(R){n(sc({facetId:a,criterion:R})),n(be())},isSortedBy(R){return this.state.sortCriterion===R},showMoreValues(){let R=g().numberOfValues,b=m.numberOfValues,F=b-R%b,E=R+F;n(Xa({facetId:a,numberOfValues:E})),n(Za({facetId:a,isFieldExpanded:!0})),n(be())},showLessValues(){let R=m.numberOfValues,b=Math.max(R,C());n(Xa({facetId:a,numberOfValues:b})),n(Za({facetId:a,isFieldExpanded:!1})),n(be())},enable(){n(jt(a))},disable(){n(Je(a))},get state(){let R=g(),b=S(),F=A(),E=h(),P;typeof R.sortCriteria=="object"?P=R.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":P=R.sortCriteria;let M=b?b.values:[],_=M.some(q=>q.state!=="idle"),k=b?b.moreValuesAvailable:!1,N=R.resultsMustMatch;return{label:b?.label,facetId:a,tabs:i,values:M,sortCriterion:P,resultsMustMatch:N,isLoading:F,hasActiveValues:_,canShowMoreValues:k,canShowLessValues:w(),enabled:E}}}}function HQ(e){return e.addReducers({facetSet:Rr,facetOptions:xt,configuration:le,facetSearchSet:Ac}),!0}d();c();l();u();function Cg(e,t){let{dispatch:r}=e,{options:n,select:o,exclude:a,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f}=t,{facetId:m}=n,g=()=>"state"in e?e.state.facetSearchSet[m]:e[vg].facetSearchSet[m];r(Om(n));let S=xc(e,{options:n,getFacetSearch:g,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...S,select(A){r(ei({facetId:m,value:A})),o(A)},exclude(A){r(ti({facetId:m,value:A})),a(A)},singleSelect(A){r(Xe(m)),r(ei({facetId:m,value:A})),o(A)},singleExclude(A){r(Xe(m)),r(ti({facetId:m,value:A})),a(A)},get state(){let{values:A}=S.state;return{...S.state,values:A.map(({count:h,displayValue:C,rawValue:w})=>({count:h,displayValue:C,rawValue:w}))}}}}d();c();l();u();var MI=new ge({facetId:dn,field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,sortCriteria:new j({constrainTo:Ag}),resultsMustMatch:new j({constrainTo:Cc}),facetSearch:ic,allowedValues:Tm,hasBreadcrumbs:ME,customSort:Pm});function jI(e,t){if(!zQ(e))throw W;let{dispatch:r}=e,n=qI(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},MI),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return Cg(e,{options:{facetId:o(),...m},select:g=>{r(be()),r(G({legacy:ot({facetId:o(),facetValue:g.rawValue}),next:mt()}))},exclude:g=>{r(be()),r(G({legacy:cr({facetId:o(),facetValue:g.rawValue}),next:Yn()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(G({legacy:dg(o(),m),next:pg(m)}))},toggleExclude(m){n.toggleExclude(m),r(G({legacy:gI(o(),m),next:hI(m)}))},deselectAll(){n.deselectAll(),r(G({legacy:vt(o()),next:Vt()}))},sortBy(m){n.sortBy(m),r(G({legacy:Sn({facetId:o(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(vr({legacy:cc(o())}))},showLessValues(){n.showLessValues(),r(vr({legacy:uc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function zQ(e){return e.addReducers({facetSet:Rr,configuration:le,facetSearchSet:Ac,search:fe}),!0}d();c();l();u();d();c();l();u();var bg=e=>e.state==="selected",Yv=e=>e.state==="excluded",Rg=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return bg(t)?Lr(n):ot(n)},wg=e=>bg(e)?Jn():mt(),VI=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Yv(t)?Kn(n):cr(n)};d();c();l();u();d();c();l();u();d();c();l();u();var Fg=T("rangeFacet/executeToggleSelect",e=>O(e,oi(e.selection))),Eg=T("rangeFacet/executeToggleExclude",e=>O(e,oi(e.selection)));var LI={facetId:he,selection:new J({values:ni})},UI=Se("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,LI),t(xn(e)),t(Fg(e)),t(be())}),QI=Se("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,LI),t(An(e)),t(Eg(e)),t(be())});d();c();l();u();function Ig(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function Tg(e,t){let{facetId:r,getRequest:n}=t,o=ne(e),a=e.dispatch,i=()=>Xr(e.state,r);return{...o,isValueSelected:bg,isValueExcluded:Yv,deselectAll(){a(Xe(r)),a(be())},sortBy(p){a(dc({facetId:r,criterion:p})),a(be())},isSortedBy(p){return this.state.sortCriterion===p},enable(){a(jt(r))},disable(){a(Je(r))},get state(){let p=n(),f=Nr(e.state,r),m=p.sortCriteria,g=p.resultsMustMatch,S=f?f.values:[],A=$r(e.state),h=i(),C=S.some(R=>R.state!=="idle"),w=f?.domain;return{facetId:r,values:S,sortCriterion:m,resultsMustMatch:g,hasActiveValues:C,isLoading:A,enabled:h,domain:w}}}}d();c();l();u();d();c();l();u();var Pg=["idle","selected","excluded"];d();c();l();u();var kg=["ascending","descending"],Og=["even","equiprobable"];var WQ={start:new j,end:new j,endInclusive:new ce,state:new j({constrainTo:Pg})},KQ=new ge({facetId:dn,field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),generateAutomaticRanges:Im,filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,currentValues:new ae({each:new J({values:WQ})}),sortCriteria:new j({constrainTo:kg}),rangeAlgorithm:new j({constrainTo:Og})});function Ng(e,t){Be(e,KQ,t,"buildDateFacet"),Dm(t)}function BI(e,t){if(!YQ(e))throw W;Ig(t.options,"buildDateFacet");let r=e.dispatch,n=Lt(e,t.options),o=t.options.tabs??{},a=Gt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Ng(e,i),r(vn(i));let p=Tg(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(UI({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(Xe(n)),this.toggleSelect(f)},toggleExclude:f=>r(QI({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(Xe(n)),this.toggleExclude(f)},get state(){return p.state}}}function YQ(e){return e.addReducers({configuration:le,search:fe,dateFacetSet:bn,facetOptions:xt}),!0}function GI(e,t){let r=BI(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:Vt()}))},sortBy(a){r.sortBy(a),n(G({legacy:Sn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(G({legacy:Rg(o(),a),next:wg(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(G({legacy:VI(o(),a)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function $I(e,t){if(!JQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Ng(e,f),n(vn(f));let m=()=>Xr(e.state,a);return{...r,clear:()=>{n(Xn({facetId:a,values:[]})),n(be())},setRange:g=>{let S={...g,state:"selected",numberOfResults:0,endInclusive:!0},A=Xn({facetId:a,values:[S]});return A.error?!1:(n(A),n(be()),!0)},enable(){n(jt(a))},disable(){n(Je(a))},get state(){let g=$r(o()),S=m(),A=HE(o(),a),h=A.length?A[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:S}}}}function JQ(e){return e.addReducers({dateFacetSet:bn,facetOptions:xt,configuration:le,search:fe}),!0}function HI(e,t){if(!XQ(e))throw W;let r=$I(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(G({legacy:vt(o()),next:Vt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(G({legacy:ot({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:mt()})),i},get state(){return{...r.state}}}}function XQ(e){return e.addReducers({dateFacetSet:bn,configuration:le,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var zI={facetId:he,selection:new J({values:ri})},WI=Se("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,zI),t(wn(e)),t(Fg(e)),t(be())}),XVe=Se("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,zI),t(Fn(e)),t(Eg(e)),t(be())});d();c();l();u();var ZQ={start:new ee,end:new ee,endInclusive:new ce,state:new j({constrainTo:Pg})},eB=new ge({facetId:dn,tabs:new J({options:{required:!1},values:{included:new ae({each:new j}),excluded:new ae({each:new j})}}),field:pn,generateAutomaticRanges:Im,filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,currentValues:new ae({each:new J({values:ZQ})}),sortCriteria:new j({constrainTo:kg}),resultsMustMatch:new j({constrainTo:Cc}),rangeAlgorithm:new j({constrainTo:Og})});function _g(e,t){Be(e,eB,t,"buildNumericFacet"),Wm(t)}d();c();l();u();function bc(e){return{endInclusive:!1,state:"idle",...e}}function KI(e,t){if(!tB(e))throw W;Ig(t.options,"buildNumericFacet");let r=e.dispatch,n=Lt(e,t.options),o=t.options.tabs??{},a=Gt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};_g(e,i),r(Rn(i));let p=Tg(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(WI({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(Xe(n)),this.toggleSelect(f)},get state(){return p.state}}}function tB(e){return e.addReducers({numericFacetSet:wr,facetOptions:xt,configuration:le,search:fe}),!0}function YI(e,t){if(!rB(e))throw W;let r=KI(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:Vt()}))},sortBy(a){r.sortBy(a),n(G({legacy:Sn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(G({legacy:Rg(o(),a),next:wg(a)}))},get state(){return{...r.state}}}}function rB(e){return e.addReducers({numericFacetSet:wr,configuration:le,search:fe}),!0}d();c();l();u();d();c();l();u();function JI(e,t){if(!nB(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};_g(e,f),n(Rn(f));let m=()=>Xr(e.state,a);return{...r,clear:()=>{n(Zn({facetId:a,values:[]})),n(be())},setRange:g=>{let S={...g,state:"selected",numberOfResults:0,endInclusive:!0},A=Zn({facetId:a,values:[S]});return A.error?!1:(n(A),n(be()),!0)},enable(){n(jt(a))},disable(){n(Je(a))},get state(){let g=$r(o()),S=m(),A=JE(o(),a),h=A.length?A[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:S}}}}function nB(e){return e.addReducers({numericFacetSet:wr,facetOptions:xt,configuration:le,search:fe}),!0}function XI(e,t){if(!oB(e))throw W;let r=JI(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(G({legacy:vt(o()),next:Vt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(G({legacy:ot({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:mt()})),i},get state(){return{...r.state}}}}function oB(e){return e.addReducers({numericFacetSet:wr,configuration:le,search:fe}),!0}d();c();l();u();function ZI(e,t){if(!aB(e))throw W;let{facetSearch:r,...n}=t.options.facet,o=Lt(e,n);e.dispatch(cn({...xl,...n,facetId:o}));let a=xg(e,{options:{...r,facetId:o},executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In,select:p=>{e.dispatch(be()),e.dispatch(G({legacy:ot({facetId:o,facetValue:p.rawValue}),next:mt()}))},isForFieldSuggestions:!0});return{...ne(e),...a,updateText:p=>{a.updateText(p),a.search()},get state(){return a.state}}}function aB(e){return e.addReducers({categoryFacetSet:ln,configuration:le,categoryFacetSearchSet:vc,search:fe}),!0}d();c();l();u();function eT(e,t){if(!iB(e))throw W;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Lt(e,o);e.dispatch(gn({...Al,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=Cg(e,{options:{...r,facetId:a},select:f=>{e.dispatch(be()),e.dispatch(G({legacy:ot({facetId:a,facetValue:f.rawValue}),next:mt()}))},exclude:f=>{e.dispatch(be()),e.dispatch(G({legacy:cr({facetId:a,facetValue:f.rawValue}),next:Yn()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In});return{...ne(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function iB(e){return e.addReducers({facetSet:Rr,configuration:le,facetSearchSet:Ac,search:fe}),!0}d();c();l();u();d();c();l();u();var Jv={collectionField:new j({emptyAllowed:!1,required:!1}),parentField:new j({emptyAllowed:!1,required:!1}),childField:new j({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new ee({min:0,required:!1})},Uo=T("folding/register",e=>O(e,Jv)),Qo=Se("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let a=t(),i=a.configuration.analytics.analyticsMode==="legacy"?yield So(a):ps(a,o),p=yield n.search({...i,q:sB(a),enableQuerySyntax:!0,cq:`@${a.folding.fields.collection}="${e}"`,filterField:a.folding.fields.collection,childField:a.folding.fields.parent,parentField:a.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return ht(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:a.folding.collections[e].result}});return function(_x163,_x164){return _ref74.apply(this,arguments)}}());function sB(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var cB=e=>Y("analytics/folding/showMore",(t,r)=>(Kt(e),t.makeShowMoreFoldedResults(dt(e,r),He(e)))),uB=()=>Y("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),tT={logShowMoreFoldedResults:cB,logShowLessFoldedResults:uB};d();c();l();u();d();c();l();u();d();c();l();u();var Dg=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function lB(e,t){return e.raw[t.collection]}function Xv(e,t){return e.raw[t.parent]}function Fl(e,t){let r=e.raw[t.child];return Ul(r)?r[0]:r}function dB(e,t){return(e||t)!==void 0&&e===t}function nT(e,t,r,n=[]){let o=Fl(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=Fl(a,r)===Fl(e,r);return Xv(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:nT(i,t,r,[...n,o])}}):[]}function pB(e,t){return e.find(r=>{let n=Xv(r,t)===void 0,o=dB(Xv(r,t),Fl(r,t));return n||o})}function oT(e){return e.parentResult?oT(e.parentResult):e}function fB(e,t,r,n){let o=Ud(e),i={...(n??pB(o,t)??oT(e)),searchUid:r},p=nT(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function qg(e,t,r,n){let o={};return e.forEach(a=>{let i=lB(a,t);i&&(!Fl(a,t)&&!a.parentResult||(o[i]=fB(a,t,r,n)))}),o}function rT(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var Mg=oe(Dg(),e=>e.addCase(G.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?qg(r.response.results,t.fields,r.response.searchUid):{}}).addCase(qt.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?qg(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Sr.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...qg(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Uo,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Qo.pending,(t,{meta:r})=>{let n=r.arg;rT(t,n).isLoadingMoreResults=!0}).addCase(Qo.rejected,(t,{meta:r})=>{let n=r.arg;rT(t,n).isLoadingMoreResults=!1}).addCase(Qo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=qg(n,t.fields,a,o);if(!i||!i[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=i[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var El={id:z},Rc=T("querySuggest/register",e=>O(e,{...El,count:new ee({min:0})})),aT=T("querySuggest/unregister",e=>O(e,El)),Tn=T("querySuggest/selectSuggestion",e=>O(e,{...El,expression:Ue})),Bo=T("querySuggest/clear",e=>O(e,El)),Go=Se("querySuggest/fetch",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,El);let i=e.id,p=yield mB(i,t(),a),f=yield n.querySuggest(p);return ht(f)?r(f.error):{id:i,q:p.q,...f.success}});return function(_x165,_x166){return _ref75.apply(this,arguments)}}()),mB=/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Wt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield fs(t.configuration.analytics):Ln(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function mB(_x167,_x168,_x169){return _ref76.apply(this,arguments)}}();var Ct=oe(lt(),e=>e.addCase(Dt,(t,r)=>({...t,...r.payload})).addCase(gr,(t,r)=>{t.q=r.payload}).addCase(Tn,(t,r)=>{t.q=r.payload.expression}).addCase(_e.fulfilled,(t,r)=>r.payload?.query??t).addCase(De,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var $o=T("fields/registerFieldsToInclude",e=>O(e,Zl)),wc=T("fields/fetchall/enable"),ui=T("fields/fetchall/disable"),Fc=Se("fields/fetchDescription",/*#__PURE__*/function(){var _ref77=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:a,environment:i,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:a,organizationId:p,url:f??ct(p,i)});return ht(m)?n(m.error):m.success.fields});return function(_x170,_x171){return _ref77.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var jg=["author","language","urihash","objecttype","collection","source","permanentid"],Zv=[...jg,"date","filetype","parents"],iT=[...Zv,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],sT=()=>({fieldsToInclude:jg,fetchAllFields:!1,fieldsDescription:[]});var Ho=oe(sT(),e=>e.addCase($o,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(wc,t=>{t.fetchAllFields=!0}).addCase(ui,t=>{t.fetchAllFields=!1}).addCase(Fc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Uo,(t,{payload:r})=>{let n=Dg().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function Ec(e){if(!gB(e))throw W;let t=ne(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:Yu(n)}}}}function gB(e){return e.addReducers({search:fe}),!0}var hB=new ge({fieldsToInclude:new ae({required:!1,each:new j({required:!0,emptyAllowed:!1})})});function Vg(e,t){if(!yB(e))throw W;let r=ne(e),n=Ec(e),{dispatch:o}=e,a=()=>e.state,i=Be(e,hB,t?.options,"buildCoreResultList");i.fieldsToInclude&&o($o(i.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,g=5,S=200,A=!1;return{...r,get state(){let C=a();return{...n.state,results:C.search.results,moreResultsAvailable:p(),searchResponseId:C.search.searchResponseId}},fetchMoreResults:function(){var _ref78=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<S){if(m++,m>=g){f=Date.now(),!A&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${g} times, with little delay. Please verify the conditions under which the function is called.`),A=!0;return}}else m=0;A=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref78.apply(this,arguments)}}()}}function yB(e){return e.addReducers({search:fe,configuration:le,fields:Ho}),!0}var SB=new ge(Jv);function cT(e,t,r){if(!vB(e))throw W;let n=Vg(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?Be(e,SB,t.options.folding,"buildFoldedResultList"):{};return o(Uo({...i})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return ex(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return ex(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=a();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function vB(e){return e.addReducers({search:fe,configuration:Bp,folding:Mg,query:Ct}),!0}function ex(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=ex(n.children,t);if(o)return o}}return null}function uT(e,t={}){let r=cT(e,{...t,loadCollectionActionCreator:Qo,fetchMoreResultsActionCreator:Sr},tT);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Ic(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var Tc=oe(VS(),e=>e.addCase(Ts,(t,{payload:r})=>{t.isVisible=r}).addCase(el,(t,{payload:r})=>{t.isEnabled=r}).addCase(Op,(t,{payload:r})=>{t.id=r.id}).addCase(va,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.answer||(t.answer=""),t.answer+=r.textDelta,delete t.error}).addCase(xa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Ic([...t.citations,...r.citations]),delete t.error}).addCase(Aa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===Qh},t.citations=[],delete t.answer}).addCase(Ip,t=>{t.liked=!0,t.disliked=!1}).addCase(Tp,t=>{t.liked=!1,t.disliked=!0}).addCase(Pp,t=>{t.feedbackModalOpen=!0}).addCase(Np,t=>{t.feedbackModalOpen=!1}).addCase(ks,t=>{t.feedbackSubmitted=!0}).addCase(sr,t=>({...VS(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase(Zr,(t,{payload:r})=>{t.isLoading=r}).addCase(Sa,(t,{payload:r})=>{t.isStreaming=r}).addCase(Ca,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(_p,(t,{payload:r})=>{t.responseFormat=r}).addCase(qp,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(rl,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(tl,t=>{t.expanded=!0}).addCase(kp,t=>{t.expanded=!1}).addCase(Dp,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(ba,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(US,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Ps,(t,{payload:r})=>{t.answerId=r}).addCase(Ep,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(Mp,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(jp,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}));d();c();l();u();function Pc(e,t,r={}){if(!xB(e))throw W;let{dispatch:n}=e,o=ne(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(Ts(i));let p=r.initialState?.responseFormat;p&&n(_p(p));let f=r.fieldsToIncludeInCitations;return f&&n(qp(f)),r.initialState?.expanded&&n(tl()),{...o,get state(){let g=a().generatedAnswer;return{...g,error:Wa(g.error)}},like(g){this.state.liked||(n(Ip()),n(t.logLikeGeneratedAnswer(g)))},dislike(g){this.state.disliked||(n(Tp()),n(t.logDislikeGeneratedAnswer(g)))},openFeedbackModal(){n(Pp())},closeFeedbackModal(){n(Np())},sendFeedback(g){n(t.logGeneratedAnswerFeedback(g)),n(ks())},logCitationClick(g,S){n(t.logOpenGeneratedAnswerSource(g,S))},logCitationHover(g,S,A){n(t.logHoverCitation(g,S,A))},show(){this.state.isVisible||(n(Ts(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(Ts(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(tl()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(kp()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(el(!0))},disable(){this.state.isEnabled&&n(el(!1))},logCopyToClipboard(g){n(t.logCopyGeneratedAnswer(g))},retry(){}}}function xB(e){return e.addReducers({generatedAnswer:Tc}),!0}var Ut={engines:{},setAbortControllerRef:(e,t)=>{Ut.engines[t].abortController=e},getIsStreamInProgress:e=>!Ut.engines[e].abortController||Ut.engines[e].abortController?.signal.aborted?(Ut.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,a=r.generatedAnswer.id;if(Ut.engines[a].lastRequestId!==n){if(Ut.engines[a].lastRequestId=n,Ut.engines[a].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(sr())}if(!Ut.getIsStreamInProgress(a)&&o&&o!==Ut.engines[a].lastStreamId){if(Ut.engines[a].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(cw({setAbortControllerRef:p=>Ut.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function lT(e,t,r={}){if(!AB(e))throw W;let n=Pc(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!Ut.engines[e.state.generatedAnswer.id]&&(Ut.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let i=oo("genQA-",12);e.dispatch(Op({id:i}))}Ut.engines[e.state.generatedAnswer.id]||(Ut.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),Ut.subscribeToSearchRequests(e);let a=i=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in i;return{...n,get state(){return o().generatedAnswer},retry(){a(e)&&e.dispatch(G({legacy:t.logRetryGeneratedAnswer()}))}}}function AB(e){return e.addReducers({generatedAnswer:Tc}),!0}d();c();l();u();d();c();l();u();var dT=Up.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Lg=e=>e==="yes"?!0:e==="no"?!1:null,CB=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:Lg(t.correctTopic),documented:Lg(t.documented),hallucinationFree:Lg(t.hallucinationFree),readable:Lg(t.readable)},helpful:t.helpful,question:r}),bB=e=>{let t="",r=()=>{let n=e.state,o=HR(n),a=o.requestId;a!==t&&(t=a,e.dispatch(sr()),o.q?.length>0&&e.dispatch(Vp()))};e.subscribe(r)};function pT(e,t,r={}){if(!RB(e))throw W;Do(e.state.configuration.analytics.analyticsMode);let{...n}=Pc(e,t,r),o=()=>e.state;return e.dispatch(Dp(r.answerConfigurationId)),bB(e),{...n,get state(){let a=QS(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:Ic(a?.citations??[]),error:Wa({message:a?.error?.message,code:a?.error?.code}),isLoading:a?.isLoading??!1,isStreaming:a?.isStreaming??!1,answerContentFormat:a?.contentFormat??"text/plain",isAnswerGenerated:a?.generated??!1,cannotAnswer:i.cannotAnswer||a?.generated===!1&&!a?.isLoading&&!a?.isStreaming}},retry(){let a=Cp(o());e.dispatch(Lp(a??ga))},reset(){e.dispatch(sr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=CB({query:o().query.q,feedback:a,answerApiState:QS(e.state).data});e.dispatch(dT.endpoints.post.initiate(i)),e.dispatch(ks())})()}}}function RB(e){return e.addReducers({[Ra.reducerPath]:Ra.reducer,query:Ct}),!0}d();c();l();u();d();c();l();u();var tx=class extends tm{requestInit(t){let{q:r,conversationId:n,accessToken:o}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${o}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({q:r,conversationId:n}),signal:this.abortController.signal}}},fT=(e,t,r)=>new tx({url:`${rm(e,t,r)}/follow-up`});d();c();l();u();var mT=e=>{let t="";return{onRunStartedEvent:({event:r})=>{t=r.runId,e(im(t)),e(cm({answerId:t,isLoading:!1})),e(um({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:r})=>{e(Sm({name:r.stepName,startedAt:r.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:r})=>{e(vm({name:r.stepName,finishedAt:r.timestamp??Date.now(),answerId:t}))},onTextMessageContentEvent:({event:r})=>{e(lm({textDelta:r.delta,answerId:t}))},onCustomEvent:({event:r})=>{let{name:n,value:o}=r;switch(n){case"header":{o?.contentFormat&&e(sm({contentFormat:o.contentFormat,answerId:t}));return}case"citations":{e(dm({citations:o.citations,answerId:t}));return}}},onRunErrorEvent:({event:r})=>{let n=xm(r.code);e(fm({message:r.message,code:n,answerId:t})),t=""},onRunFinishedEvent:({event:r})=>{let n=r.result?.completionReason==="ANSWERED";e(pm({cannotAnswer:!n,answerId:t})),t=""}}};d();c();l();u();d();c();l();u();function gT(){return{conversationId:"",isEnabled:!1,followUpAnswers:[]}}var hT=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function rx(e){return e.followUpAnswers.find(t=>t.isActive)}function Fr(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var yT=oe(gT(),e=>e.addCase(nm,(t,{payload:r})=>{t.isEnabled=r}).addCase(om,(t,{payload:r})=>{t.conversationId=r}).addCase(am,(t,{payload:r})=>{let n=rx(t);n&&(n.isActive=!1),t.followUpAnswers.push(hT(r.question))}).addCase(im,(t,{payload:r})=>{let n=rx(t);!n||n.answerId||(n.answerId=r)}).addCase(sm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(cm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(um,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(lm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(dm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.citations=Ic([...n.citations,...r.citations]),delete n.error)}).addCase(pm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(fm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(mm,(t,{payload:r})=>{let n=rx(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(gm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(hm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(XF,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(Sm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(vm,(t,{payload:r})=>{let n=Fr(t,r.answerId);if(!n)return;let o=n.generationSteps.findLast(a=>a.name===r.name&&a.status==="active");o&&(o.status="completed",o.finishedAt=r.finishedAt)}).addCase(ym,t=>{t.followUpAnswers=[],t.conversationId="",t.isEnabled=!1}));function ST(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!wB(e))throw W;let{...n}=Pc(e,t,r),o=()=>e.state;e.dispatch(Wd(r.agentId));let a=Nd(o()),i=Od(o()),p=_d(o()),f=fT(r.agentId,a,p),m=mT(e.dispatch),g=Am();return{...n,get state(){let S=o().followUpAnswers,A=o().generatedAnswer;return{...A,error:Wa(A.error),followUpAnswers:{...S,followUpAnswers:S.followUpAnswers.map(h=>({...h,error:Wa(h.error)}))}}},retry(){g.run(e.state,e.dispatch,()=>e.navigatorContext)},like(S){if(!S||this.state.answerId===S){n.like();return}this.state.liked||(e.dispatch(gm({answerId:S})),e.dispatch(t.logLikeGeneratedAnswer(S)))},dislike(S){if(!S||this.state.answerId===S){n.dislike();return}this.state.disliked||(e.dispatch(hm({answerId:S})),e.dispatch(t.logDislikeGeneratedAnswer(S)))},logCopyToClipboard(S){if(!S||this.state.answerId===S){n.logCopyToClipboard();return}e.dispatch(t.logCopyGeneratedAnswer(S))},logCitationClick(S,A){if(!A||this.state.answerId===A){n.logCitationClick(S);return}e.dispatch(t.logOpenGeneratedAnswerSource(S,A))},logCitationHover(S,A,h){if(!h||this.state.answerId===h){n.logCitationHover(S,A);return}e.dispatch(t.logHoverCitation(S,A,h))},askFollowUp(S){var _this37=this;return _asyncToGenerator(function*(){if(!S||S.trim()==="")return;let A=_this37.state.followUpAnswers.conversationId;if(!A){console.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}f.abortRun(),e.dispatch(am({question:S}));try{yield f.runAgent({forwardedProps:{q:S,conversationId:A,accessToken:i}},m)}catch(h){e.dispatch(mm({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",h)}})()}}}function wB(e){return e.addReducers({followUpAnswers:yT}),!0}function vT(e,t={}){Do(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=ST(e,Fs,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=pT(e,Fs,t):r=lT(e,Fs,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function tr(e,t,r){if(!FB(e))throw W;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:Gl(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function FB(e){return e.addReducers({configuration:le}),!0}function xT(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id,r.options.answerId)))};return tr(e,r,()=>{o()})}function AT(e,t){return xT(e,Fs,t)}d();c();l();u();d();c();l();u();var kc=oe(cp(),e=>{e.addCase(G.fulfilled,EB).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function EB(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var Ug=()=>Y("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),Qg=()=>Y("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Bg=()=>Y("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var CT=e=>({past:[],present:e,future:[]}),IB=e=>{let{past:t,present:r,future:n}=e;if(!r||t.length===0)return e;let o=t[t.length-1];return{past:t.slice(0,t.length-1),present:o,future:[r,...n]}},TB=e=>{let{past:t,present:r,future:n}=e;if(!r||n.length===0)return e;let o=n[0],a=n.slice(1);return{past:[...t,r],present:o,future:a}},PB=e=>{let{action:t,state:r,reducer:n}=e,{past:o,present:a}=r,i=n(a,t);return a?a===i?r:{past:[...o,a].slice(-10),present:i,future:[]}:CT(i)},bT=e=>{let{actionTypes:t,reducer:r}=e,n=CT();return(o=n,a)=>{switch(a.type){case t.undo:return IB(o);case t.redo:return TB(o);case t.snapshot:return PB({state:o,reducer:r,action:a});default:return o}}};d();c();l();u();d();c();l();u();var{getOwnPropertyNames:kB,getOwnPropertySymbols:OB}=Object,{hasOwnProperty:NB}=Object.prototype;function nx(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function Gg(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);let{cache:a}=o,i=a.get(r),p=a.get(n);if(i&&p)return i===n&&p===r;a.set(r,n),a.set(n,r);let f=e(r,n,o);return a.delete(r),a.delete(n),f}}function _B(e){return e?.[Symbol.toStringTag]}function RT(e){return kB(e).concat(OB(e))}var DB=Object.hasOwn||((e,t)=>NB.call(e,t));function li(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var qB="__v",MB="__o",jB="_owner",{getOwnPropertyDescriptor:wT,keys:FT}=Object;function VB(e,t){return e.byteLength===t.byteLength&&$g(new Uint8Array(e),new Uint8Array(t))}function LB(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function UB(e,t){return e.byteLength===t.byteLength&&$g(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function QB(e,t){return li(e.getTime(),t.getTime())}function BB(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function GB(e,t){return e===t}function ET(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.entries(),i,p,f=0;for(;(i=a.next())&&!i.done;){let m=t.entries(),g=!1,S=0;for(;(p=m.next())&&!p.done;){if(o[S]){S++;continue}let A=i.value,h=p.value;if(r.equals(A[0],h[0],f,S,e,t,r)&&r.equals(A[1],h[1],A[0],h[0],e,t,r)){g=o[S]=!0;break}S++}if(!g)return!1;f++}return!0}var $B=li;function HB(e,t,r){let n=FT(e),o=n.length;if(FT(t).length!==o)return!1;for(;o-->0;)if(!TT(e,t,r,n[o]))return!1;return!0}function Il(e,t,r){let n=RT(e),o=n.length;if(RT(t).length!==o)return!1;let a,i,p;for(;o-->0;)if(a=n[o],!TT(e,t,r,a)||(i=wT(e,a),p=wT(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function zB(e,t){return li(e.valueOf(),t.valueOf())}function WB(e,t){return e.source===t.source&&e.flags===t.flags}function IT(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.values(),i,p;for(;(i=a.next())&&!i.done;){let f=t.values(),m=!1,g=0;for(;(p=f.next())&&!p.done;){if(!o[g]&&r.equals(i.value,p.value,i.value,p.value,e,t,r)){m=o[g]=!0;break}g++}if(!m)return!1}return!0}function $g(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function KB(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function TT(e,t,r,n){return(n===jB||n===MB||n===qB)&&(e.$$typeof||t.$$typeof)?!0:DB(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var YB="[object ArrayBuffer]",JB="[object Arguments]",XB="[object Boolean]",ZB="[object DataView]",e1="[object Date]",t1="[object Error]",r1="[object Map]",n1="[object Number]",o1="[object Object]",a1="[object RegExp]",i1="[object Set]",s1="[object String]",c1={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},u1="[object URL]",l1=Object.prototype.toString;function d1({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:a,areMapsEqual:i,areNumbersEqual:p,areObjectsEqual:f,arePrimitiveWrappersEqual:m,areRegExpsEqual:g,areSetsEqual:S,areTypedArraysEqual:A,areUrlsEqual:h,unknownTagComparators:C}){return function(R,b,F){if(R===b)return!0;if(R==null||b==null)return!1;let E=typeof R;if(E!==typeof b)return!1;if(E!=="object")return E==="number"?p(R,b,F):E==="function"?a(R,b,F):!1;let P=R.constructor;if(P!==b.constructor)return!1;if(P===Object)return f(R,b,F);if(Array.isArray(R))return t(R,b,F);if(P===Date)return n(R,b,F);if(P===RegExp)return g(R,b,F);if(P===Map)return i(R,b,F);if(P===Set)return S(R,b,F);let M=l1.call(R);if(M===e1)return n(R,b,F);if(M===a1)return g(R,b,F);if(M===r1)return i(R,b,F);if(M===i1)return S(R,b,F);if(M===o1)return typeof R.then!="function"&&typeof b.then!="function"&&f(R,b,F);if(M===u1)return h(R,b,F);if(M===t1)return o(R,b,F);if(M===JB)return f(R,b,F);if(c1[M])return A(R,b,F);if(M===YB)return e(R,b,F);if(M===ZB)return r(R,b,F);if(M===XB||M===n1||M===s1)return m(R,b,F);if(C){let _=C[M];if(!_){let k=_B(R);k&&(_=C[k])}if(_)return _(R,b,F)}return!1}}function p1({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:VB,areArraysEqual:r?Il:LB,areDataViewsEqual:UB,areDatesEqual:QB,areErrorsEqual:BB,areFunctionsEqual:GB,areMapsEqual:r?nx(ET,Il):ET,areNumbersEqual:$B,areObjectsEqual:r?Il:HB,arePrimitiveWrappersEqual:zB,areRegExpsEqual:WB,areSetsEqual:r?nx(IT,Il):IT,areTypedArraysEqual:r?nx($g,Il):$g,areUrlsEqual:KB,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=Gg(n.areArraysEqual),a=Gg(n.areMapsEqual),i=Gg(n.areObjectsEqual),p=Gg(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:p})}return n}function f1(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function m1({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(p,f){let{cache:m=e?new WeakMap:void 0,meta:g}=r();return t(p,f,{cache:m,equals:n,meta:g,strict:o})};if(e)return function(p,f){return t(p,f,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};let a={cache:void 0,equals:n,meta:void 0,strict:o};return function(p,f){return t(p,f,a)}}var C$e=Pn(),b$e=Pn({strict:!0}),R$e=Pn({circular:!0}),w$e=Pn({circular:!0,strict:!0}),F$e=Pn({createInternalComparator:()=>li}),E$e=Pn({strict:!0,createInternalComparator:()=>li}),I$e=Pn({circular:!0,createInternalComparator:()=>li}),T$e=Pn({circular:!0,createInternalComparator:()=>li,strict:!0});function Pn(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=p1(e),i=d1(a),p=r?r(i):f1(i);return m1({circular:t,comparator:i,createState:n,equals:p,strict:o})}function di(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function g1(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>Tl(r,n))!==-1)}var Tl=Pn({createCustomConfig:e=>({...e,areArraysEqual:g1})});var h1=oe(iR(),e=>{e.addCase(ir,(t,r)=>y1(t,r.payload)?void 0:r.payload)}),y1=(e,t)=>S1(e.context,t.context)&&v1(e.dictionaryFieldContext,t.dictionaryFieldContext)&&F1(e.advancedSearchQueries,t.advancedSearchQueries)&&x1(e.tabSet,t.tabSet)&&A1(e.staticFilterSet,t.staticFilterSet)&&ox(e.facetSet,t.facetSet)&&ox(e.dateFacetSet,t.dateFacetSet)&&ox(e.numericFacetSet,t.numericFacetSet)&&b1(e.automaticFacetSet,t.automaticFacetSet)&&C1(e.categoryFacetSet,t.categoryFacetSet)&&R1(e.pagination,t.pagination)&&w1(e.query,t.query)&&E1(e,t)&&I1(e.pipeline,t.pipeline)&&T1(e.searchHub,t.searchHub)&&P1(e.facetOrder,t.facetOrder)&&k1(e.debug,t.debug),S1=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),v1=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),x1=(e,t)=>{let r=PT(e),n=PT(t);return r?.id===n?.id},PT=e=>Object.values(e).find(t=>t.isActive),A1=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=kT(e[r]),a=kT(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},kT=e=>e.values.filter(t=>t.state!=="idle"),ox=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=e[r].request.currentValues.filter(i=>i.state!=="idle"),a=n.request.currentValues.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},C1=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=or(e[r]?.request.currentValues).map(({value:i})=>i),a=or(n?.request.currentValues).map(({value:i})=>i);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},b1=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let o=e.set[r].response.values.filter(i=>i.state!=="idle"),a=n.response.values.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},R1=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,w1=(e,t)=>JSON.stringify(e)===JSON.stringify(t),F1=(e,t)=>JSON.stringify(e)===JSON.stringify(t),E1=(e,t)=>e.sortCriteria===t.sortCriteria,I1=(e,t)=>e===t,T1=(e,t)=>e===t,P1=(e,t)=>di(e,t),k1=(e,t)=>e===t,Hg=bT({actionTypes:{redo:aS.type,undo:oS.type,snapshot:ir.type},reducer:h1});function OT(e){if(!O1(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=a=>a.past.length>0&&!ue(a.present);return{...t,subscribe(a){a();let i=JSON.stringify(n().history.present),p=()=>{let f=JSON.stringify(n().history.present);i!==f&&(i=f,a())};return e.subscribe(()=>p())},get state(){return n().history},back(){var _this38=this;return _asyncToGenerator(function*(){o(_this38.state)&&(yield r(Gu()),r(G({legacy:Qg()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(Yd()),r(G({legacy:Ug()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r(Gu()),r(G({legacy:Bg()})))})()}}}function O1(e){return e.addReducers({history:Hg,configuration:le,facetOrder:kc}),!0}d();c();l();u();d();c();l();u();var N1={results:new ae({required:!0,each:new J({values:Qd})}),maxLength:new ee({required:!0,min:1,default:10})},Oc=T("recentResults/registerRecentResults",e=>O(e,N1)),Er=T("recentResults/pushRecentResult",e=>(Kt(e),{payload:e})),Nc=T("recentResults/clearRecentResults");function NT(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Lb(t.options.result)))};return tr(e,t,()=>{n(),e.dispatch(Er(t.options.result))})}d();c();l();u();d();c();l();u();function zg(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var _T=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},DT=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},qT=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{zg(o)&&delete t[r].cache[n]})},MT=(e,t,r)=>{for(let o in t)for(let a in t[o].cache)t[o].cache[a].isActive=!1;if(!ax(e,t)){_1(e,t,r);return}let n=ax(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},jT=(e,t,r)=>{let{id:n,q:o,searchUid:a,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[o]={...ax(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},VT=(e,t)=>{let{id:r,q:n,error:o}=e;t[r].cache[n].error=o||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1},ax=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},_1=(e,t,r)=>{let{q:n,id:o}=e;t[o].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}};d();c();l();u();function LT(){return{}}var Wg=oe(LT(),e=>{e.addCase(as,(t,r)=>{_T(r.payload,t)}),e.addCase(Kr,(t,r)=>{DT(r.payload,t)}),e.addCase(is,(t,r)=>{qT(r.payload,t)}),e.addCase(vs.pending,(t,r)=>{MT(r.meta.arg,t,{results:[]})}),e.addCase(vs.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));jT({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(vs.rejected,(t,r)=>{VT(r.meta.arg,t)})});d();c();l();u();var D1={searchBoxId:it,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee},UT=new ge(D1);function QT(e,t){if(!q1(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={searchBoxId:t.options.searchBoxId||oo("instant-results-"),cacheTimeout:t.options.cacheTimeout||6e4,maxResultsPerQuery:t.options.maxResultsPerQuery};Be(e,UT,a,"buildInstantResults");let i=a.searchBoxId;n(as({id:i}));let p=()=>o().instantResults[i],f=S=>p().cache[S],m=()=>p().q,g=()=>{let S=f(m());return S?S.isLoading?[]:S.results:[]};return{...r,updateQuery(S){if(!S)return;let A=f(S);(!A||!A.isLoading&&(A.error||zg(A)))&&n(vs({id:i,q:S,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(Kr({id:i,q:S}))},clearExpired(){n(is({id:i}))},get state(){let S=m(),A=f(S);return{q:S,isLoading:A?.isLoading||!1,error:A?.error||null,results:g()}}}}function q1(e){return e.addReducers({instantResults:Wg}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Ir=oe(hr(),e=>{e.addCase(ss,(t,r)=>{let n=ix(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Pl(n,o)}).addCase(cs,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(gt,t=>{t.firstResult=0}).addCase(us,(t,r)=>{let n=r.payload;t.firstResult=Pl(n,t.numberOfResults)}).addCase(Yr,(t,r)=>{let n=r.payload;t.firstResult=Pl(n,t.numberOfResults)}).addCase(ds,t=>{let r=ix(t),n=Math.max(r-1,1);t.firstResult=Pl(n,t.numberOfResults)}).addCase(ls,t=>{let r=ix(t),n=M1(t),o=Math.min(r+1,n);t.firstResult=Pl(o,t.numberOfResults)}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(De,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(G.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(qt.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Xe,t=>{Qt(t)}).addCase(An,t=>{Qt(t)}).addCase(yn,t=>{Qt(t)}).addCase(Fn,t=>{Qt(t)}).addCase(ti,t=>{Qt(t)}).addCase(hn,t=>{Qt(t)}).addCase(un,t=>{Qt(t)}).addCase(Mo,t=>{Qt(t)}).addCase(rc,t=>{Qt(t)}).addCase(xn,t=>{Qt(t)}).addCase(wn,t=>{Qt(t)}).addCase(pt,t=>{Qt(t)}).addCase(Xn,t=>{Qt(t)}).addCase(Zn,t=>{Qt(t)}).addCase(ei,t=>{Qt(t)}).addCase(sn,t=>{Qt(t)})});function Qt(e){e.firstResult=hr().firstResult}function ix(e){let{firstResult:t,numberOfResults:r}=e;return sx(t,r)}function M1(e){let{totalCountFiltered:t,numberOfResults:r}=e;return cx(t,r)}function Pl(e,t){return(e-1)*t}function sx(e,t){return Math.round(e/t)+1}function cx(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function j1(e){return e.pagination.firstResult}function BT(e){return e.pagination.numberOfResults}function V1(e){return e.pagination.totalCountFiltered}var ro=e=>{let t=j1(e),r=BT(e);return sx(t,r)},kl=e=>{let t=V1(e),r=BT(e);return cx(t,r)},Kg=(e,t)=>{let r=ro(e),n=kl(e),o=L1(r,t);return o=U1(o),o=Q1(o,n),B1(o)};function L1(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,a=e-n,i=e+o;return{start:a,end:i}}function U1(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function Q1(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function B1(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Dc=()=>Y("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||hr().numberOfResults})),qc=()=>Y("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:ro(t)})),Yg=()=>Y("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:ro(t)})),Jg=()=>Y("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:ro(t)})),Mc=()=>({actionCause:"browseResults"});d();c();l();u();var G1=new ge({numberOfPages:new ee({default:5,min:0})}),$1=new ge({page:new ee({min:1})});function GT(e,t={}){if(!H1(e))throw W;let r=ne(e),{dispatch:n}=e,o=Be(e,G1,t.options,"buildPager"),i=ut(e,$1,t.initialState,"buildPager").page;i&&n(us(i));let p=()=>ro(e.state),f=()=>{let{numberOfPages:g}=o;return Kg(e.state,g)},m=()=>kl(e.state);return{...r,get state(){let g=p(),S=m(),A=g>1&&S>0,h=g<S;return{currentPage:g,currentPages:f(),maxPage:S,hasPreviousPage:A,hasNextPage:h}},selectPage(g){n(Yr(g))},nextPage(){n(ls())},previousPage(){n(ds())},isCurrentPage(g){return g===this.state.currentPage}}}function H1(e){return e.addReducers({configuration:le,pagination:Ir}),!0}function $T(e,t={}){let{dispatch:r}=e,n=GT(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(qt({legacy:qc(),next:Mc()}))},nextPage(){n.nextPage(),r(qt({legacy:Yg(),next:Mc()}))},previousPage(){n.previousPage(),r(qt({legacy:Jg(),next:Mc()}))}}}d();c();l();u();d();c();l();u();function HT(e){if(!z1(e))throw W;let t=ne(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function z1(e){return e.addReducers({search:fe}),!0}function zT(e){return HT(e)}d();c();l();u();d();c();l();u();function WT(e){if(!W1(e))throw W;let t=ne(e),r=Ec(e),n=()=>e.state,o=()=>{let a=n().search.duration/1e3;return Math.round((a+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function W1(e){return e.addReducers({search:fe,pagination:Ir}),!0}function KT(e){return WT(e)}d();c();l();u();d();c();l();u();d();c();l();u();function Xg(_x172,_x173){return _Xg.apply(this,arguments)}function _Xg(){_Xg=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??ct(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Xg.apply(this,arguments)}var pi=Se("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield Xg(o,e),i=yield t.apiClient.html(a);return ht(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x174,_x175){return _ref79.apply(this,arguments)}}()),jc=T("resultPreview/next"),Vc=T("resultPreview/previous"),Lc=T("resultPreview/prepare",e=>O(e,{results:new ae({required:!0})})),YT=2048,Uc=Se("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=bA(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>YT&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${YT} characters.`),{contentURL:o}});return function(_x176,_x177){return _ref80.apply(this,arguments)}}());d();c();l();u();var JT=e=>Y({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Kt(e);let n=dt(e,r),o=He(e);return t.makeDocumentQuickview(n,o)},analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});d();c();l();u();d();c();l();u();d();c();l();u();function ux(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var lx=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=ux();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},dx=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),Zg=oe(ux(),e=>{e.addCase(pi.pending,t=>{t.isLoading=!0}).addCase(pi.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(G.fulfilled,(t,r)=>{lx(t),t.resultsWithPreview=dx(r.payload.response.results)}).addCase(Sr.fulfilled,(t,r)=>{lx(t),t.resultsWithPreview=t.resultsWithPreview.concat(dx(r.payload.response.results))}).addCase(qt.fulfilled,lx).addCase(Lc,(t,r)=>{t.resultsWithPreview=dx(r.payload.results)}).addCase(jc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(Vc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Uc.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function XT(e,t,r,n,o){if(!K1(e))throw W;let{dispatch:a}=e,i=()=>e.state,p=ne(e),{result:f,maximumPreviewSize:m}=t.options,g=()=>{let{resultsWithPreview:A,position:h}=i().resultPreview;return A[h]},S=A=>{a(Uc({uniqueId:A,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(pi({uniqueId:A,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){S(f.uniqueId)},next(){a(jc()),S(g())},previous(){a(Vc()),S(g())},get state(){let A=i(),h=f.hasHtmlVersion,C=A.resultPreview,w=f.uniqueId===C.uniqueId?C.content:"",R=C.isLoading,b=C.contentURL,F=g();return{content:w,resultHasPreview:h,isLoading:R,contentURL:b,currentResultUniqueId:F}}}}function K1(e){return e.addReducers({configuration:le,resultPreview:Zg}),!0}function ZT(e,t){if(!Y1(e))throw W;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=XT(e,t,Xg,"/html",()=>{e.dispatch(JT(t.options.result))});return r(Lc({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function Y1(e){return e.addReducers({search:fe}),!0}d();c();l();u();d();c();l();u();var eP=()=>Y("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),tP=()=>Y("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var J1={queries:new ae({required:!0,each:new j({emptyAllowed:!1})}),maxLength:new ee({required:!0,min:1,default:10})},fi=T("recentQueries/registerRecentQueries",e=>O(e,J1)),Qc=T("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function rP(){return{queries:[],maxLength:10}}var eh=oe(rP(),e=>{e.addCase(fi,X1).addCase(Qc,Z1).addCase(G.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||eG(n,t)})});function X1(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function Z1(e){e.queries=[]}function eG(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var tG={queries:[]},rG={maxLength:10,clearFilters:!0},nG=new ge({queries:new ae({required:!0})}),oG=new ge({maxLength:new ee({required:!0,min:1}),clearFilters:new ce});function aG(e,t){Be(e,oG,t?.options,"buildRecentQueriesList"),ut(e,nG,t?.initialState,"buildRecentQueriesList")}function nP(e,t){if(!iG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={...rG,...t?.options},i={...tG,...t?.initialState};aG(e,{options:a,initialState:i});let p={queries:i.queries,maxLength:a.maxLength};return n(fi(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(Qc())},updateRecentQueries(f){let m=new ae({required:!0,each:new j({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(fi({queries:f,maxLength:a.maxLength}))},executeRecentQuery(f){let m=new ee({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let g={q:this.state.queries[f],clearFilters:a.clearFilters};Ll(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(Ss(g))}}}function iG(e){return e.addReducers({search:fe,recentQueries:eh,query:Ct}),!0}function oP(e,t){let r=nP(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(eP()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(G({legacy:tP(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var aP=e=>Y("analytics/recentResults/click",(t,r)=>(Kt(e),t.makeRecentResultClick(dt(e,r),He(e)))),iP=()=>Y("analytics/recentResults/clear",e=>e.makeClearRecentResults());function sP(e,t){return tr(e,t,()=>e.dispatch(aP(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function cP(){return{results:[],maxLength:10}}var th=oe(cP(),e=>{e.addCase(Oc,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Nc,t=>{t.results=[]}).addCase(Er,(t,r)=>{let n=r.payload;t.results=t.results.filter(a=>a.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});var sG={initialState:{results:[]},options:{maxLength:10}},cG=new ge({results:new ae({required:!0})}),uG=new ge({maxLength:new ee({required:!0,min:1})});function lG(e,t){Be(e,uG,t?.options,"buildRecentResultsList"),ut(e,cG,t?.initialState,"buildRecentResultsList")}function uP(e,t){if(!dG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={...sG,...t};lG(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n(Oc(i)),{...r,get state(){return o().recentResults},clear(){n(iP()),n(Nc())}}}function dG(e){return e.addReducers({recentResults:th}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var dP=e=>{let t=/Document weights:\n((?:.)*?)\n+/g,r=/Terms weights:\n((?:.|\n)*)\n+/g,n=/Total weight: ([0-9]+)/g;if(!e)return null;let o=t.exec(e),a=r.exec(e),i=n.exec(e),p=fG(e),f=pP(o?o[1]:null),m=pG(a),g=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:g,qreWeights:p}},pP=e=>{let t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,r=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(!e)return null;let n=e.match(t);if(!n)return null;let o={};for(let a of n){let i=a.match(r);if(i){let p=i[1],f=i[2];o[p]=Number(f)}}return o},lP=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},pG=e=>{let t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,r=/([^:]+): ([0-9]+), ([0-9]+); /g;if(!e||!e[1])return null;let n=lP(e[1],t);if(!n)return null;let o={};for(let a of n){let i=lP(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=pP(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},fG=e=>{let t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,r=t.exec(e),n=[];for(;r;)n.push({expression:r[1],score:parseInt(r[2],10)}),r=t.exec(e);return n};function fP(e){return e.search.response.results.map(r=>{let n=dP(r.rankingInfo);return{result:r,ranking:n}})}var mG=new ge({enabled:new ce({default:!1})});function mP(e,t={}){if(!gG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state;ut(e,mG,t.initialState,"buildRelevanceInspector").enabled&&n(ho());let i=p=>{e.logger.warn(`Flag [ ${p} ] is now activated. This should *not* be used in any production environment as it negatively impact performance.`)};return{...r,get state(){let p=o(),f=p.debug;if(!p.debug)return{isEnabled:f};let{executionReport:m,basicExpression:g,advancedExpression:S,constantExpression:A,userIdentities:h,rankingExpressions:C}=p.search.response,{fieldsDescription:w,fetchAllFields:R}=p.fields;return{isEnabled:f,rankingInformation:fP(p),executionReport:m,expressions:{basicExpression:g,advancedExpression:S,constantExpression:A},userIdentities:h,rankingExpressions:C,fieldsDescription:w,fetchAllFields:R}},enable(){n(ho()),i("debug")},disable(){n(es()),n(ui())},enableFetchAllFields(){n(wc()),i("fetchAllFields")},disableFetchAllFields(){n(ui())},fetchFieldsDescription(){!this.state.isEnabled&&n(ho()),n(Fc()),i("fieldsDescription"),e.logger.warn(`For production environment, please specify the necessary fields either when instantiating a ResultList controller, or by dispatching a registerFieldsToInclude action.
46
46
 
47
47
  https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.ResultListOptions.html
48
- https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function IG(e){return e.addReducers({debug:os,search:fe,configuration:ue,fields:eo}),!0}d();c();l();u();d();c();l();u();var sh=e=>Y({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Kt(e),t.makeDocumentOpen(pt(e,r),He(e))),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});function PP(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(sh(t.options.result)))};return rr(e,t,()=>{n(),e.dispatch(Ir(t.options.result))})}d();c();l();u();function kP(e,t){return $g(e,{...t,fetchMoreResultsActionCreator:vr})}d();c();l();u();d();c();l();u();var TG=new ge({numberOfResults:new ee({min:0})});function OP(e,t={}){if(!PG(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state,i=lt(e,TG,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(ds(i)),{...r,get state(){return{numberOfResults:a().pagination.numberOfResults}},set(p){n(ps(p))},isSetTo(p){return p===this.state.numberOfResults}}}function PG(e){return e.addReducers({pagination:Tr,configuration:ue}),!0}function NP(e,t={}){if(!kG(e))throw W;let r=OP(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(a){r.set(a),n(qt({legacy:Wc(),next:Yc()}))}}}function kG(e){return e.addReducers({pagination:Tr,configuration:ue}),!0}d();c();l();u();d();c();l();u();var to=()=>Y("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),ch=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var _P={id:z,query:Ue},ru=T("querySet/register",e=>O(e,_P)),yi=T("querySet/update",e=>O(e,_P));d();c();l();u();var ro=ae(Ap(),e=>{e.addCase(ru,(t,r)=>NG(t,r.payload)).addCase(yi,(t,r)=>{let{id:n,query:a}=r.payload;hA(t,n,a)}).addCase(Pn,(t,r)=>{let{id:n,expression:a}=r.payload;hA(t,n,a)}).addCase(G.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;DP(t,n)}).addCase(De,OG).addCase(_e.fulfilled,(t,r)=>{if(r.payload)for(let[n,a]of Object.entries(r.payload.querySet))hA(t,n,a)})});function OG(e,t){le(t.payload.q)||DP(e,t.payload.q)}function DP(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var hA=(e,t,r)=>{t in e&&(e[t]=r)},NG=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var uh=e=>Y("analytics/querySuggest",(t,r)=>{let n=yA(r,e);return t.makeOmniboxAnalytics(n)}),qP=()=>({actionCause:"omniboxAnalytics"});function yA(e,t){let{id:r,suggestion:n}=t,a=e.querySuggest?.[r];if(!a)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let o=a.completions.map(m=>m.expression),i=a.partialQueries.length-1,p=a.partialQueries[i]||"",f=a.responseId;return{suggestionRanking:o.indexOf(n),partialQuery:p,partialQueries:a.partialQueries,suggestions:o,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function MP(e,t){let r=t.id;r in e||(e[r]=_G(t))}function jP(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function VP(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function LP(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function _G(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var UP=()=>({});var nu=ae(UP(),e=>e.addCase(Mc,(t,r)=>{MP(t,r.payload)}).addCase(yT,(t,r)=>{delete t[r.payload.id]}).addCase(Xa.pending,jP).addCase(Xa.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:a}=r.payload;a&&n.partialQueries.push(a.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(Xa.rejected,VP).addCase(Ja,(t,r)=>{LP(t,r.payload)}).addCase(ws,(t,r)=>{Object.keys(t).forEach(n=>{let a=t[n];a&&(a.error=r.payload,a.isLoading=!1)})}));d();c();l();u();var lh={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},SA={open:new M,close:new M},vA={id:z,numberOfSuggestions:new ee({min:0}),enableQuerySyntax:new ce,highlightOptions:new J({values:{notMatchDelimiters:new J({values:SA}),exactMatchDelimiters:new J({values:SA}),correctionDelimiters:new J({values:SA})}}),clearFilters:new ce},QP=new ge(vA);function BP(e,t){if(!qG(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state,o=t.options?.id||da("search_box"),i={id:o,highlightOptions:{...t.options?.highlightOptions},...lh,...t.options};Be(e,QP,i,"buildSearchBox"),n(ru({id:o,query:e.state.query.q})),i.numberOfSuggestions&&n(Mc({id:o,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(Dt({enableQuerySyntax:i.enableQuerySyntax}));let p=()=>e.state.querySet[i.id],f=/*#__PURE__*/function(){var _ref81=_asyncToGenerator(function*(m){let{enableQuerySyntax:g,clearFilters:A}=i;n(Cs({q:p(),enableQuerySyntax:g,clearFilters:A})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x181){return _ref81.apply(this,arguments)}}();return{...r,updateText(m){n(yi({id:o,query:m})),this.showSuggestions()},clear(){n(yi({id:o,query:""})),n(Ja({id:o}))},showSuggestions(){i.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:o}))},selectSuggestion(m){n(Pn({id:o,expression:m})),f({legacy:uh({id:o,suggestion:m}),next:qP()}).then(()=>{n(Ja({id:o}))})},submit(m=to(),g){f({legacy:m,next:g}),n(Ja({id:o}))},get state(){let m=a(),g=m.querySuggest[i.id],A=DG(g,i.highlightOptions),x=g?g.isLoading:!1;return{searchBoxId:o,value:p(),suggestions:A,isLoading:m.search.isLoading,isLoadingSuggestions:x}}}}function DG(e,t){return e?e.completions.map(r=>({highlightedValue:Qh(r.highlighted,t),rawValue:r.expression})):[]}function qG(e){return e.addReducers({query:bt,querySuggest:nu,configuration:ue,querySet:ro,search:fe}),!0}function dh(e,t={}){let r=BP(e,{...t,executeSearchActionCreator:G,fetchQuerySuggestionsActionCreator:Xa,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(to(),ch())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var au=()=>Y("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||mr()})),ph=()=>({actionCause:"resultsSort"});function $P(e,t){return e.q!==t.q?to():e.sortCriteria!==t.sortCriteria?au():e.firstResult!==t.firstResult?Kc():e.numberOfResults!==t.numberOfResults?Wc():Pr(e.f,t.f)?$l(e.f,t.f):Pr(e.fExcluded,t.fExcluded)?$l(e.fExcluded,t.fExcluded,!0):Pr(e.cf,t.cf)?$l(e.cf,t.cf):Pr(e.af,t.af)?$l(e.af,t.af):Pr(e.nf,t.nf)?GP(e.nf,t.nf):Pr(e.df,t.df)?GP(e.df,t.df):xa()}function $l(e={},t={},r=!1){let n=Object.keys(e),a=Object.keys(t),o=n.filter(x=>!a.includes(x));if(o.length){let x=o[0];switch(!0){case e[x].length>1:return At(x);case r:return ra({facetId:x,facetValue:e[x][0]});default:return Ur({facetId:x,facetValue:e[x][0]})}}let i=a.filter(x=>!n.includes(x));if(i.length){let x=i[0];return r?ur({facetId:x,facetValue:t[x][0]}):at({facetId:x,facetValue:t[x][0]})}let p=a.find(x=>t[x].filter(h=>e[x].includes(h)));if(!p)return xa();let f=e[p],m=t[p],g=m.filter(x=>!f.includes(x));if(g.length)return r?ur({facetId:p,facetValue:g[0]}):at({facetId:p,facetValue:g[0]});let A=f.filter(x=>!m.includes(x));return A.length?r?ra({facetId:p,facetValue:A[0]}):Ur({facetId:p,facetValue:A[0]}):xa()}function GP(e={},t={}){return $l(iu(e),iu(t))}function HP(e,t){return e.q!==t.q?ch():e.sortCriteria!==t.sortCriteria?ph():Pr(e.f,t.f)?ou(e.f,t.f):Pr(e.fExcluded,t.fExcluded)?ou(e.fExcluded,t.fExcluded,!0):Pr(e.cf,t.cf)?ou(e.cf,t.cf):Pr(e.af,t.af)?ou(e.af,t.af):Pr(e.nf,t.nf)?ou(iu(e.nf),iu(t.nf)):Pr(e.df,t.df)?ou(iu(e.df),iu(t.df)):es()}function Pr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function ou(e={},t={},r=!1){let n=Object.keys(e),a=Object.keys(t),o=n.filter(x=>!a.includes(x));if(o.length){let x=o[0];return e[x].length>1?Vt():aa()}if(a.filter(x=>!n.includes(x)).length)return r?na():gt();let p=a.find(x=>t[x].filter(h=>e[x].includes(h)));if(!p)return es();let f=e[p],m=t[p];return m.filter(x=>!f.includes(x)).length?r?na():gt():f.filter(x=>!m.includes(x)).length?aa():es()}function iu(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();function zP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function WP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{sortCriteria:n}:{}}function fh(e,t,r,n){if(e===void 0)return{};let a=Object.entries(e).filter(([o])=>t(o)).map(([o,{request:i}])=>{let p=r(i);return p.length?{[o]:p}:{}}).reduce((o,i)=>({...o,...i}),{});return Object.keys(a).length?{[n]:a}:{}}function KP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function YP(e){return{q:dt().q,enableQuerySyntax:dt().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??Dr().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??Dr().defaultFilters.cq,firstResult:yr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??yr().defaultNumberOfResults,sortCriteria:mr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:wa(),sf:{},tab:"",af:{},mnf:{}}}var MG=new ge({parameters:new J({options:{required:!0},values:ip})});function XP(e,t){let{dispatch:r}=e,n=ne(e);lt(e,MG,t.initialState,"buildSearchParameterManager");let a=JP(e.state.tabSet,t.initialState.parameters);return r(De(a)),{...n,synchronize(o){let i=JP(e.state.tabSet,mh(e,o));r(De(i))},get state(){return{parameters:AA(e)}}}}function mh(e,t){return{...YP(e.state),...t}}function JP(e,t){if(t.tab&&e){let r=Object.values(e).some(a=>a.id===t.tab),n=Object.values(e).find(a=>a.isActive);if(!r&&n)return{...t,tab:n.id};if(!r)return{...t,tab:""}}return t}function AA(e){let t=e.state;return{...zP(t.query,r=>r.q,dt().q),...KP(t.tabSet,r=>{let n=Object.values(r??{}).find(a=>a.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...WP(t.sortCriteria,r=>r,mr()),...VG(t),...LG(t),...UG(t),...QG(t),...BG(t)}}function jG(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function gh(e){let t=jG(e);return r=>{let n=e.facetOptions?.facets[r],a=n?.enabled??!0,o=tr(n?.tabs,t);return a&&o}}function ZP(e){return e.currentValues.filter(t=>t.state==="selected")}function VG(e){let t=e.facetSet;if(t===void 0)return{};let r=gh(e),n={},a={};for(let[o,{request:i}]of Object.entries(t)){if(!r(o))continue;let p=i.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=i.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[o]=p),f.length&&(a[o]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(a).length?{fExcluded:a}:{})}}function LG(e){return fh(e.categoryFacetSet,gh(e),t=>or(t.currentValues).map(r=>r.value),"cf")}function UG(e){return fh(e.numericFacetSet,gh(e),ZP,"nf")}function QG(e){return fh(e.dateFacetSet,gh(e),ZP,"df")}function BG(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:a}])=>{let o=GG(a);return o.length?{[n]:o}:{}}).reduce((n,a)=>({...n,...a}),{});return Object.keys(r).length?{af:r}:{}}function GG(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function hh(e,t){let{dispatch:r}=e,n=XP(e,t);return{...n,synchronize(a){let o=ek(e),i=mh(e,o),p=mh(e,a);Ql(i,p)||(n.synchronize(a),r(G({legacy:$P(i,p),next:HP(i,p)})))},get state(){return{parameters:ek(e)}}}}function ek(e){let t=e.state;return{...AA(e),...$G(t),...HG(t),...zG(t),...WG(t),...KG(t),...XG(t),...YG(t)}}function $G(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==dt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function HG(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function zG(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function WG(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==yr().firstResult?{firstResult:t}:{}}function KG(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function YG(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let a=JG(n.values);return a.length?{[r]:a}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function JG(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function XG(e){if(e.debug===void 0)return{};let t=e.debug;return t!==wa()?{debug:t}:{}}d();c();l();u();function tk(e){return Lc(e)}d();c();l();u();d();c();l();u();d();c();l();u();var yh=()=>new J({values:{questionAnswerId:z},options:{required:!0}}),xA=()=>new J({values:{linkText:Ue,linkURL:Ue},options:{required:!0}});function su(e){return O(e,yh())}d();c();l();u();function ct(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&Rw(e,r.contentIdKey,r.contentIdValue)}function Qr(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(a=>a.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var CA=()=>Y({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),bA=()=>Y({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),wA=()=>Y({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),RA=()=>Y({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),FA=()=>Y({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=ct(t);return e.makeOpenSmartSnippetSource(pt(r,t),He(r))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=ct(e),r=He(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Hl=e=>Y({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,xA());let n=ct(r);return n?t.makeOpenSmartSnippetInlineLink(pt(n,r),{...He(n),...e}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=ct(t),n=He(r),a=t.search?.response.searchUid;if(a)return{snippetType:"SmartSnippet",responseId:a,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),EA=()=>Y("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),IA=()=>Y("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),ZG={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},TA=e=>Y({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=He(r),a=t.search?.response.searchUid;if(a)return{responseId:a,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:ZG[e]}}}),PA=e=>Y({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=He(r),a=t.search?.response.searchUid;if(a)return{responseId:a,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),kA=e=>Y({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{su(e);let n=Qr(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Qr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let a=ct(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),OA=e=>Y({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{su(e);let n=Qr(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Qr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let a=ct(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),zl=e=>Y({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,yh());let n=Qr(r,e.questionAnswerId);if(!n)return null;let a=ct(r,n.documentId);return a?t.makeOpenSmartSnippetSuggestionSource(pt(a,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Qr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let a=ct(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),Sh=(e,t)=>Y({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,yh()),O(t,xA());let a=Qr(n,e.questionAnswerId);if(!a)return null;let o=ct(n,a.documentId);return o?r.makeOpenSmartSnippetSuggestionInlineLink(pt(o,n),{question:a.question,answerSnippet:a.answerSnippet,documentId:a.documentId,linkText:t.linkText,linkURL:t.linkURL}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Qr(r,e.questionAnswerId),a=r.search?.response.searchUid;if(a&&n){let o=ct(r,n.documentId);return{responseId:a,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),vh={logExpandSmartSnippet:CA,logCollapseSmartSnippet:bA,logLikeSmartSnippet:wA,logDislikeSmartSnippet:RA,logOpenSmartSnippetSource:FA,logOpenSmartSnippetInlineLink:Hl,logOpenSmartSnippetFeedbackModal:EA,logCloseSmartSnippetFeedbackModal:IA,logSmartSnippetFeedback:TA,logSmartSnippetDetailedFeedback:PA,logExpandSmartSnippetSuggestion:kA,logCollapseSmartSnippetSuggestion:OA,logOpenSmartSnippetSuggestionSource:zl};d();c();l();u();d();c();l();u();var cu=T("smartSnippet/expand"),uu=T("smartSnippet/collapse"),lu=T("smartSnippet/like"),du=T("smartSnippet/dislike"),pu=T("smartSnippet/feedbackModal/open"),no=T("smartSnippet/feedbackModal/close"),fu=T("smartSnippet/related/expand",e=>su(e)),mu=T("smartSnippet/related/collapse",e=>su(e));d();c();l();u();d();c();l();u();var NA=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var rk=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function nk({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return wi({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function e$(e,t){let r=nk(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var On=ae(NA(),e=>e.addCase(cu,t=>{t.expanded=!0}).addCase(uu,t=>{t.expanded=!1}).addCase(lu,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(du,t=>{t.liked=!1,t.disliked=!0}).addCase(pu,t=>{t.feedbackModalOpen=!0}).addCase(no,t=>{t.feedbackModalOpen=!1}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((o,i)=>e$(o,t.relatedQuestions[i])),a=nk(r.payload.response.questionAnswer);return t.questionAnswerId===a?{...t,relatedQuestions:n}:{...NA(),relatedQuestions:n,questionAnswerId:a}}).addCase(fu,(t,r)=>{let n=rk(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(mu,(t,r)=>{let n=rk(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function ak(e,t,r){if(!t$(e))throw W;let n=ne(e),a=()=>e.state,o=()=>ct(a()),i=null,p=rr(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=o();if(!f){i=null;return}let{searchResponseId:m}=a().search;i!==m&&(i=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(Ir(f)))});return{...n,get state(){let f=a();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:o()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(cu())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(uu())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(lu())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(du())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(pu())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(no())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(no())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(no())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function t$(e){return e.addReducers({search:fe,questionAnswering:On}),!0}d();c();l();u();function Ah(e,t){if(!r$(e))throw W;let r=()=>e.state,n=new Set,a=g=>n.has(g)?!0:(n.add(g),!1),o=null,i=g=>{o!==g&&(o=g,f={},n.clear())},p=(g,A,x)=>rr(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(A)||e.dispatch(x?Sh({questionAnswerId:x},g):Hl(g))}),f={},m=(g,A)=>{let{searchResponseId:x}=r().search;i(x);let h=wi({...g,questionAnswerId:A});return h in f||(f[h]=p(g,h,A)),f[h]};return{selectInlineLink(g,A){m(g,A)?.select()},beginDelayedSelectInlineLink(g,A){m(g,A)?.beginDelayedSelect()},cancelPendingSelectInlineLink(g,A){m(g,A)?.cancelPendingSelect()}}}function r$(e){return e.addReducers({search:fe,questionAnswering:On}),!0}function ok(e,t){Ba(e.state.configuration.analytics.analyticsMode);let r=ak(e,vh,t),n=Ah(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(a){n.selectInlineLink(a)},beginDelayedSelectInlineLink(a){n.beginDelayedSelectInlineLink(a)},cancelPendingSelectInlineLink(a){n.cancelPendingSelectInlineLink(a)}}}d();c();l();u();d();c();l();u();function ik(e,t){if(!n$(e))throw W;let r=ne(e),n=()=>e.state,a=o=>{let{contentIdKey:i,contentIdValue:p}=o;return e.state.search.results.find(f=>_a(f,i)===p)};return{...r,get state(){let o=n();return{questions:o.search.questionAnswer.relatedQuestions.map((i,p)=>({question:i.question,answer:i.answerSnippet,documentId:i.documentId,questionAnswerId:o.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:o.questionAnswering.relatedQuestions[p].expanded,source:a(i.documentId)}))}},expand(o){let i={questionAnswerId:o};e.dispatch(t.logExpandSmartSnippetSuggestion(i)),e.dispatch(fu(i))},collapse(o){let i={questionAnswerId:o};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(mu(i))}}}function n$(e){return e.addReducers({search:fe,questionAnswering:On}),!0}d();c();l();u();function sk(e,t){if(!a$(e))throw W;let r=()=>e.state,n=A=>{let x=r(),h=Qr(x,A);return h?ct(x,h.documentId):null},a=new Set,o=A=>a.has(A)?!0:(a.add(A),!1),i=null,p=A=>{i!==A&&(i=A,m={},a.clear())},f=(A,x)=>rr(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(x)||(e.dispatch(zl({questionAnswerId:x})),e.dispatch(Ir(A)))}),m={},g=A=>{let{searchResponseId:x}=r().search;p(x);let h=n(A);return h?(A in m||(m[A]=f(h,A)),m[A]):null};return{selectSource(A){g(A)?.select()},beginDelayedSelectSource(A){g(A)?.beginDelayedSelect()},cancelPendingSelectSource(A){g(A)?.cancelPendingSelect()}}}function a$(e){return e.addReducers({search:fe,questionAnswering:On}),!0}function ck(e,t){Ba(e.state.configuration.analytics.analyticsMode);let r=ik(e,vh),n=Ah(e,{options:{selectionDelay:t?.options?.selectionDelay}}),a=sk(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(o){a.selectSource(o)},beginDelayedSelectSource(o){a.beginDelayedSelectSource(o)},cancelPendingSelectSource(o){a.cancelPendingSelectSource(o)},selectInlineLink(o,i){n.selectInlineLink(i,o)},beginDelayedSelectInlineLink(o,i){n.beginDelayedSelectInlineLink(i,o)},cancelPendingSelectInlineLink(o,i){n.cancelPendingSelectInlineLink(i,o)}}}d();c();l();u();d();c();l();u();d();c();l();u();var uk={by:new Pu({enum:vo,required:!0})},gu=T("sortCriteria/register",e=>lk(e)),hu=T("sortCriteria/update",e=>lk(e)),lk=e=>bi(e)?(e.forEach(t=>O(t,uk)),{payload:e}):O(e,uk);d();c();l();u();var xh=ae(mr(),e=>{e.addCase(gu,(t,r)=>zr(r.payload)).addCase(hu,(t,r)=>zr(r.payload)).addCase(_e.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(De,(t,r)=>r.payload.sortCriteria??t)});function o$(e,t){if(!t)return;let r=new ge({criterion:new oe({each:bb})}),n=i$(t),a={...t,criterion:n};lt(e,r,a,"buildSort")}function i$(e){return e.criterion?bi(e.criterion)?e.criterion:[e.criterion]:[]}function dk(e,t){if(!s$(e))throw W;let r=ne(e),{dispatch:n}=e,a=()=>e.state;o$(e,t.initialState);let o=t.initialState?.criterion;return o&&n(gu(o)),{...r,sortBy(i){n(hu(i)),n(Jr(1))},isSortedBy(i){return this.state.sortCriteria===zr(i)},get state(){return{sortCriteria:a().sortCriteria}}}}function s$(e){return e.addReducers({configuration:ue,sortCriteria:xh}),!0}function pk(e,t={}){let{dispatch:r}=e,n=dk(e,t),a=()=>r(G({legacy:au(),next:ph()}));return{...n,get state(){return n.state},sortBy(o){n.sortBy(o),a()}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function fk(e){return e.type==="redirect"}var Ch=class{constructor(t){this.response=t}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let t=this.response.preprocessingOutput.triggers.filter(fk);return t.length?t[0].content:null}};var yu=T("standaloneSearchBox/register",e=>O(e,{id:z,redirectionUrl:z,overwrite:new ce({required:!1})})),Su=T("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:z,redirectionUrl:z})),vu=T("standaloneSearchBox/reset",e=>O(e,{id:z})),Au=T("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:z})),xu=T("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),ao=Se("standaloneSearchBox/fetchRedirect",/*#__PURE__*/function(){var _ref82=_asyncToGenerator(function*(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:a,validatePayload:o,navigatorContext:i}}){o(e,{id:new M({emptyAllowed:!1})});let p=yield u$(r(),i),f=yield a.plan(p);if(yt(f))return n(f.error);let{redirectionUrl:m}=new Ch(f.success);return m&&t(c$(m)),m||""});return function(_x182,_x183){return _ref82.apply(this,arguments)}}()),c$=e=>Y("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),u$=/*#__PURE__*/function(){var _ref83=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ut(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...(e.context&&{context:e.context.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield ys(e.configuration.analytics):Un(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function u$(_x184,_x185){return _ref83.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function mk(){return{}}var bh=ae(mk(),e=>e.addCase(yu,(t,r)=>{let{id:n,redirectionUrl:a,overwrite:o}=r.payload;!o&&n in t||(t[n]=_A(a))}).addCase(vu,(t,r)=>{let{id:n}=r.payload,a=t[n];if(a){t[n]=_A(a.defaultRedirectionUrl);return}}).addCase(Su,(t,r)=>{let{id:n,redirectionUrl:a}=r.payload;n in t&&(t[n]=_A(a))}).addCase(ao.pending,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!0)}).addCase(ao.fulfilled,(t,r)=>{let n=r.payload,a=t[r.meta.arg.id];a&&(a.redirectTo=n||a.defaultRedirectionUrl,a.isLoading=!1)}).addCase(ao.rejected,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!1)}).addCase(Au,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(xu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function _A(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var gk=new ge({...vA,redirectionUrl:new M({required:!0,emptyAllowed:!1}),overwrite:new ce({required:!1})});function hk(e,t){if(!l$(e))throw W;let{dispatch:r}=e,n=()=>e.state,a=t.options.id||da("standalone_search_box"),o={id:a,highlightOptions:{...t.options.highlightOptions},...lh,overwrite:!1,...t.options};Be(e,gk,o,"buildStandaloneSearchBox");let i=dh(e,{options:o});return r(yu({id:a,redirectionUrl:o.redirectionUrl,overwrite:o.overwrite})),{...i,updateText(p){i.updateText(p),r(Au({id:a}))},selectSuggestion(p){let f=yA(n(),{id:a,suggestion:p});r(Pn({id:a,expression:p})),r(xu({id:a,metadata:f})),this.submit()},afterRedirection(){r(vu({id:a}))},updateRedirectUrl(p){r(Su({id:a,redirectionUrl:p}))},submit(){r(Dt({q:this.state.value,enableQuerySyntax:o.enableQuerySyntax})),r(ao({id:a}))},get state(){let f=n().standaloneSearchBoxSet[a];return{...i.state,isLoading:f.isLoading,redirectTo:f.redirectTo,analytics:f.analytics}}}}function l$(e){return e.addReducers({standaloneSearchBoxSet:bh,configuration:ue,query:bt,querySuggest:nu}),!0}d();c();l();u();d();c();l();u();var wh=ae(xp(),e=>e.addCase(Rc,(t,r)=>{let n=r.payload,{id:a}=n;a in t||(t[a]=n)}).addCase(sa,(t,r)=>{let{id:n,value:a}=r.payload,o=t[n];if(!o)return;let i=o.values.find(f=>f.caption===a.caption);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(ca,(t,r)=>{let{id:n,value:a}=r.payload,o=t[n];if(!o)return;let i=o.values.find(f=>f.caption===a.caption);if(!i)return;let p=i.state==="excluded";i.state=p?"idle":"excluded"}).addCase(Wa,(t,r)=>{let n=r.payload,a=t[n];a&&a.values.forEach(o=>{o.state="idle"})}).addCase(ft,t=>{Object.values(t).forEach(r=>{r.values.forEach(n=>{n.state="idle"})})}).addCase(De,(t,r)=>{let n=r.payload.sf||{};Object.entries(t).forEach(([a,o])=>{let i=n[a]||[];o.values.forEach(p=>{p.state=i.includes(p.caption)?"selected":"idle"})})}));d();c();l();u();function DA(e){return{state:"idle",...e}}var d$=new ge({id:ci,values:ag});function yk(e,t){if(!p$(e))throw W;Be(e,d$,t.options,"buildStaticFilter");let r=ne(e),{dispatch:n}=e,a=()=>e.state,{id:o}=t.options;return n(Rc(t.options)),{...r,toggleSelect(i){n(sa({id:o,value:i})),n(G({legacy:Rh(o,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Wa(o)),n(sa({id:o,value:i})),n(G({legacy:Rh(o,i)}))},toggleExclude(i){n(ca({id:o,value:i})),n(G({legacy:Rh(o,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Wa(o)),n(ca({id:o,value:i})),n(G({legacy:Rh(o,i)}))},deselectAll(){n(Wa(o)),n(G({legacy:ig({staticFilterId:o})}))},isValueSelected(i){return i.state==="selected"},isValueExcluded(i){return i.state==="excluded"},get state(){let i=a().staticFilterSet[o]?.values||[],p=i.some(f=>f.state!=="idle");return{id:o,values:i,hasActiveValues:p}}}}function p$(e){return e.addReducers({staticFilterSet:wh}),!0}function Rh(e,t){let{caption:r,expression:n,state:a}=t;return(a==="idle"?og:Fc)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var f$=new ge({expression:Ue,id:z,clearFiltersOnTabChange:new ce}),m$=new ge({isActive:new ce});function Sk(e,t){if(h$(t.options.id),!g$(e))throw W;let r=ne(e),{dispatch:n}=e;Be(e,f$,t.options,"buildTab");let a=lt(e,m$,t.initialState,"buildTab"),{id:o,expression:i}=t.options;return n($s({id:o,expression:i})),Object.keys(e.state.tabSet).length===1&&(a.isActive=!0),a.isActive&&n(ht(o)),{...r,select(){t.options.clearFiltersOnTabChange&&n(Cs({q:"",clearFilters:!0})),n(ht(o))},get state(){return{isActive:e.state.tabSet[o]?.isActive}}}}function g$(e){return e.addReducers({configuration:ue,tabSet:Ec}),!0}function h$(e){let t=Hs().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function vk(e,t){let{dispatch:r}=e,n=Sk(e,t),a=()=>r(G({legacy:xa(),next:es()}));return{...n,get state(){return n.state},select(){n.select(),a()}}}d();c();l();u();function Ak(e){let t=lg(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function xk(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function Ck(e,t){let r=[],n=[],a=[],o=[];return t.forEach(i=>{switch(i.type){case"redirect":r.push(i.content);break;case"query":n.push(i.content);break;case"execute":a.push({functionName:i.content.name,params:i.content.params});break;case"notify":o.push(i.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=a,e.notifications=o,e}function bk(e,t){return e.queryModification={...t,queryToIgnore:""},e}function wk(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var Rk=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var oo=ae(Rk(),e=>e.addCase(G.pending,xk).addCase(G.fulfilled,(t,r)=>Ck(t,r.payload.response.triggers)).addCase(xs,(t,r)=>bk(t,r.payload)).addCase(Ta,(t,r)=>wk(t,r.payload)));function Fk(e){if(!y$(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,a=n().triggers.executions;return{...t,subscribe(o){let i=()=>{let p=!mi(this.state.executions,a,(f,m)=>f.functionName===m.functionName&&mi(f.params,m.params));a=this.state.executions,p&&this.state.executions.length&&(o(),r(Ep()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function y$(e){return e.addReducers({triggers:oo}),!0}d();c();l();u();d();c();l();u();function Ek(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!S$(e))throw W;let n=ne(e),{dispatch:a}=e,o=()=>e.state,i=o().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!mi(i,this.state.notifications);i=this.state.notifications,m&&(p(),a(r()))};return f(),e.subscribe(f)},get state(){return{notifications:o().triggers.notifications}}}}function S$(e){return e.addReducers({triggers:oo}),!0}function Ik(e){return Ek(e,{options:{logNotifyTriggerActionCreator:Rp}})}d();c();l();u();function Tk(e){if(!v$(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,a=()=>n().triggers.queryModification.newQuery,o=()=>n().triggers.queryModification.originalQuery;return{...t,get state(){return{newQuery:a(),originalQuery:o(),wasQueryModified:a()!==""}},undo(){r(Ta(a())),r(Dt({q:o()})),r(G({legacy:wp({undoneQuery:a()})}))}}}function v$(e){return e.addReducers({triggers:oo,query:bt}),!0}d();c();l();u();function Pk(e){if(!A$(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,a=n().triggers.redirectTo;return{...t,subscribe(o){let i=()=>{let p=a!==this.state.redirectTo;a=this.state.redirectTo,p&&this.state.redirectTo&&(o(),r(Fp()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function A$(e){return e.addReducers({triggers:oo}),!0}d();c();l();u();d();c();l();u();var Ok="..",qA="...",x$=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,C$={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},Fh="&",Wl="=";function Kl(){return{serialize:R$(F$),deserialize:O$}}function Yl(e){return e in C$}function b$(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function w$(e){let r=e in{nf:!0,df:!0,mnf:!0};return Yl(e)&&r}function Nk(e){return b$(e)||Yl(e)}var R$=e=>t=>Object.entries(t).map(e).filter(r=>r).join(Fh);function F$(e){let[t,r]=e;return Nk(t)?Yl(t)&&!w$(t)?I$(r)?P$(t,r):"":t==="nf"||t==="df"?T$(r)?k$(t,r):"":E$(t,r):""}function E$(e,t){return`${e}${Wl}${encodeURIComponent(t)}`}function I$(e){return MA(e)?_k(e,r=>typeof r=="string"):!1}function T$(e){return MA(e)?_k(e,r=>MA(r)&&"start"in r&&"end"in r):!1}function MA(e){return!!(e&&typeof e=="object")}function _k(e,t){return Object.entries(e).filter(n=>{let a=n[1];return!Array.isArray(a)||!a.every(t)}).length===0}function P$(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${Wl}${n.map(a=>encodeURIComponent(a)).join(",")}`).join(Fh)}function k$(e,t){return Object.entries(t).map(([r,n])=>{let a=n.map(({start:o,end:i,endInclusive:p})=>`${o}${p?qA:Ok}${i}`).join(",");return`${e}-${r}${Wl}${a}`}).join(Fh)}function O$(e){return e.split(Fh).map(n=>N$(n)).map(n=>_$(n)).filter(j$).map(n=>V$(n)).reduce((n,a)=>{let[o,i]=a;if(Yl(o)){let p={...n[o],...i};return{...n,[o]:p}}return{...n,[o]:i}},{})}function N$(e){let[t,...r]=e.split(Wl),n=r.join(Wl);return[t,n]}function _$(e,t=x$){let[r,n]=e,a=t.exec(r);if(!a)return e;let o=a[1],i=a[2],p=n.split(","),f=D$(o,p),m={[i]:f};return[o,JSON.stringify(m)]}function D$(e,t){return e==="nf"||e==="mnf"?q$(t,"selected"):e==="df"?M$(t,"selected"):t}function q$(e,t){let r=[];for(let n of e){let{startAsString:a,endAsString:o,isEndInclusive:i}=Dk(n),p=parseFloat(a),f=parseFloat(o);!Number.isFinite(p)||!Number.isFinite(f)||r.push(qc({start:p,end:f,state:t,endInclusive:i}))}return r}function kk(e){try{return Yb(e)?(dp(e,Ss),!0):Xr(e)?(Ea(e),!0):!1}catch{return!1}}function M$(e,t){let r=[];for(let n of e){let{isEndInclusive:a,startAsString:o,endAsString:i}=Dk(n);!kk(o)||!kk(i)||r.push(za({start:o,end:i,state:t,endInclusive:a}))}return r}function j$(e){let t=Nk(e[0]),r=e.length===2;return t&&r}function V$(e,t=!0){let[r,n]=e;return r==="enableQuerySyntax"?[r,n==="true"]:r==="debug"?[r,n==="true"]:r==="firstResult"?[r,parseInt(n)]:r==="numberOfResults"?[r,parseInt(n)]:Yl(r)?[r,L$(n)]:[r,t?decodeURIComponent(n):n]}function L$(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[a,o]=n;r[a]=o.map(i=>Ci(i)?decodeURIComponent(i):i)}),r}function Dk(e){let t=e.indexOf(qA)!==-1,[r,n]=e.split(t?qA:Ok);return{isEndInclusive:t,startAsString:r,endAsString:n}}var U$=new ge({fragment:new M});function qk(e,t){let r;function n(){r=e.state.search.requestId}function a(){return r!==e.state.search.requestId}if(!B$(e))throw W;lt(e,U$,t.initialState,"buildUrlManager");let o=ne(e),i=t.initialState.fragment;n();let p=hh(e,{initialState:{parameters:Eh(i)}});return{...o,subscribe(f){let m=()=>{let g=this.state.fragment;!Q$(i,g)&&a()&&(i=g,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:Kl().serialize(p.state.parameters)}},synchronize(f){i=f;let m=Eh(f);p.synchronize(m)}}}function Q$(e,t){if(e===t)return!0;let r=Eh(e),n=Eh(t);return Ql(r,n)}function Eh(e){return Kl().deserialize(e)}function B$(e){return e.addReducers({configuration:ue}),!0}d();c();l();u();d();c();l();u();var Mk=Se("analytics/addPageViewEntry",/*#__PURE__*/function(){var _ref84=_asyncToGenerator(function*(e,{getState:t}){t().configuration.analytics.enabled&&Wt.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});return function(_x186,_x187){return _ref84.apply(this,arguments)}}());function G$(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:Mk}}d();c();l();u();d();c();l();u();d();c();l();u();var io=()=>new M({required:!1,emptyAllowed:!0}),Ih=T("advancedSearchQueries/update",e=>O(e,{aq:io(),cq:io(),lq:io(),dq:io()})),Th=T("advancedSearchQueries/register",e=>O(e,{aq:io(),cq:io(),lq:io(),dq:io()}));var jk=ae(Dr(),e=>{e.addCase(Ih,(t,r)=>{let{aq:n,cq:a,lq:o,dq:i}=r.payload;Ft(n)||(t.aq=n,t.aqWasSet=!0),Ft(a)||(t.cq=a,t.cqWasSet=!0),Ft(o)||(t.lq=o,t.lqWasSet=!0),Ft(i)||(t.dq=i,t.dqWasSet=!0)}).addCase(Th,(t,r)=>{let{aq:n,cq:a,lq:o,dq:i}=r.payload;Ft(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Ft(a)||(t.defaultFilters.cq=a,t.cqWasSet||(t.cq=a)),Ft(o)||(t.defaultFilters.lq=o,t.lqWasSet||(t.lq=o)),Ft(i)||(t.defaultFilters.dq=i,t.dqWasSet||(t.dq=i))}).addCase(_e.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(De,(t,r)=>{let{aq:n,cq:a}=r.payload;Ft(n)||(t.aq=n,t.aqWasSet=!0),Ft(a)||(t.cq=a,t.cqWasSet=!0)})});function $$(e){return e.addReducers({advancedSearchQueries:jk}),{updateAdvancedSearchQueries:Ih,registerAdvancedSearchQueries:Th}}d();c();l();u();function H$(e){return e.addReducers({}),{logDocumentOpen:sh,logOpenSmartSnippetSource:FA,logOpenSmartSnippetSuggestionSource:zl,logOpenSmartSnippetInlineLink:Hl,logOpenSmartSnippetSuggestionInlineLink:Sh}}d();c();l();u();function z$(e){return e.addReducers({}),{logSearchEvent:Mb,logClickEvent:jb,logCustomEvent:Vb}}d();c();l();u();function W$(e){return e.addReducers({}),{logClearBreadcrumbs:Lm,logInterfaceLoad:ep,logSearchFromLink:tp,logOmniboxFromLink:rp,logInterfaceChange:xa,logDidYouMeanClick:gp,logCategoryFacetBreadcrumb:km,logFacetBreadcrumb:bc,logFacetClearAll:At,logFacetUnexclude:ra,logFacetExclude:ur,logFacetDeselect:Ur,logFacetSelect:at,logFacetShowLess:Cc,logFacetShowMore:xc,logFacetUpdateSort:vn,logDateFacetBreadcrumb:Dl,logNumericFacetBreadcrumb:ql,logNavigateBackward:Wg,logNavigateForward:zg,logPageNext:th,logPageNumber:Kc,logPagePrevious:rh,logPagerResize:Wc,logSearchboxSubmit:to,logQuerySuggestionClick:uh,logResultsSort:au,logDislikeSmartSnippet:RA,logLikeSmartSnippet:wA,logOpenSmartSnippetFeedbackModal:EA,logCloseSmartSnippetFeedbackModal:IA,logSmartSnippetFeedback:TA,logSmartSnippetDetailedFeedback:PA,logExpandSmartSnippet:CA,logCollapseSmartSnippet:bA,logExpandSmartSnippetSuggestion:kA,logCollapseSmartSnippetSuggestion:OA,logNoResultsBack:Kg,logStaticFilterSelect:og,logStaticFilterDeselect:Fc,logStaticFilterClearAll:ig,logTriggerQuery:bp,logUndoTriggerQuery:wp,logNotifyTrigger:Rp,logTriggerRedirect:Fp,logTriggerExecute:Ep}}d();c();l();u();function K$(e){return e.addReducers({}),{deselectAllBreadcrumbs:ft,deselectAllNonBreadcrumbs:cs}}d();c();l();u();function Y$(e){return e.addReducers({configuration:ue}),{disableAnalytics:ts,enableAnalytics:rs,setOriginLevel2:np,setOriginLevel3:ap,updateAnalyticsConfiguration:Ca,updateBasicConfiguration:Wr}}d();c();l();u();function J$(e){return e.addReducers({configuration:ue,pipeline:ss,searchHub:Fs}),{updateSearchConfiguration:gr}}d();c();l();u();function X$(e){return e.addReducers({context:cg}),{addContext:li,removeContext:di,setContext:ui}}d();c();l();u();function Z$(e){return e.addReducers({debug:os}),{disableDebug:as,enableDebug:ba}}d();c();l();u();function e2(e){return e.addReducers({dictionaryFieldContext:dg}),{addContext:Tc,removeContext:Pc,setContext:Ic}}d();c();l();u();function t2(e){return e.addReducers({didYouMean:fg,query:bt}),{applyDidYouMeanCorrection:hr,disableDidYouMean:fp,enableDidYouMean:vs,enableAutomaticQueryCorrection:mp,disableAutomaticQueryCorrection:As,setCorrectionMode:Co}}d();c();l();u();d();c();l();u();d();c();l();u();var Ph=T("excerptLength/set",e=>O(e,new ee({min:0,required:!0})));d();c();l();u();function Vk(){return{length:void 0}}var Lk=ae(Vk(),e=>{e.addCase(Ph,(t,r)=>{t.length=r.payload})});function r2(e){return e.addReducers({excerptLength:Lk}),{setExcerptLength:Ph}}d();c();l();u();function n2(e){return e.addReducers({facetOptions:xt}),{updateFacetOptions:be,enableFacet:jt,disableFacet:Je}}d();c();l();u();function a2(e){return e.addReducers({automaticFacetSet:mg}),{setOptions:dc,deselectAllAutomaticFacetValues:pc,toggleSelectAutomaticFacetValue:cn}}d();c();l();u();function o2(e){return e.addReducers({categoryFacetSet:dn}),{deselectAllCategoryFacetValues:ln,registerCategoryFacet:un,toggleSelectCategoryFacetValue:$a,updateCategoryFacetNumberOfValues:ei,updateCategoryFacetSortCriterion:mc,updateFacetAutoSelection:Kr,updateCategoryFacetBasePath:Pm}}d();c();l();u();function i2(e){return e.addReducers({facetSet:Rr}),{deselectAllFacetValues:Xe,registerFacet:hn,toggleSelectFacetValue:yn,toggleExcludeFacetValue:Sn,updateFacetIsFieldExpanded:ri,updateFacetNumberOfValues:ti,updateFacetSortCriterion:Ac,updateFreezeCurrentValues:ta,updateFacetAutoSelection:Kr}}d();c();l();u();function s2(e){return e.addReducers({dateFacetSet:wn}),{deselectAllDateFacetValues:Bm,registerDateFacet:An,toggleSelectDateFacetValue:xn,toggleExcludeDateFacetValue:Cn,updateDateFacetSortCriterion:Qm,updateDateFacetValues:oa}}d();c();l();u();function c2(e){return e.addReducers({numericFacetSet:Fr}),{deselectAllNumericFacetValues:rg,registerNumericFacet:Rn,toggleSelectNumericFacetValue:Fn,toggleExcludeNumericFacetValue:En,updateNumericFacetSortCriterion:tg,updateNumericFacetValues:ia}}d();c();l();u();function u2(e){return e.addReducers({fields:eo}),{registerFieldsToInclude:Za,enableFetchAllFields:jc,disableFetchAllFields:pi,fetchFieldsDescription:Vc}}d();c();l();u();function l2(e){return e.addReducers({folding:Bg}),{registerFolding:Ka,loadCollection:Ya}}d();c();l();u();function d2(e){return e.addReducers({generatedAnswer:Qc}),{generateAnswer:df,resetAnswer:Jt,setAnswerGenerationMode:Jp}}d();c();l();u();function p2(e){return e.addReducers({history:Jg,facetOrder:Gc}),{back:nl,forward:sp}}d();c();l();u();function f2(e){return e.addReducers({instantResults:Zg}),{registerInstantResults:us,updateInstantResultsQuery:Yr,clearExpiredResults:ls}}d();c();l();u();function m2(e){return e.addReducers({pagination:Tr}),{nextPage:ms,previousPage:gs,registerNumberOfResults:ds,registerPage:fs,updateNumberOfResults:ps,updatePage:Jr}}d();c();l();u();function g2(e){return e.addReducers({pipeline:ss}),{setPipeline:is}}d();c();l();u();function h2(e){return e.addReducers({query:bt}),{updateQuery:Dt}}d();c();l();u();function y2(e){return e.addReducers({querySet:ro}),{registerQuerySetQuery:ru,updateQuerySetQuery:yi}}d();c();l();u();function S2(e){return e.addReducers({querySuggest:nu,querySet:ro}),{clearQuerySuggest:Ja,fetchQuerySuggestions:Xa,registerQuerySuggest:Mc,selectQuerySuggestion:Pn}}d();c();l();u();function v2(e){return e.addReducers({questionAnswering:On}),{collapseSmartSnippet:uu,expandSmartSnippet:cu,dislikeSmartSnippet:du,likeSmartSnippet:lu,openFeedbackModal:pu,closeFeedbackModal:no,expandSmartSnippetRelatedQuestion:fu,collapseSmartSnippetRelatedQuestion:mu}}d();c();l();u();function A2(e){return e.addReducers({recentQueries:oh}),{registerRecentQueries:hi,clearRecentQueries:tu}}d();c();l();u();function x2(e){return e.addReducers({recentResults:ih}),{registerRecentResults:$c,clearRecentResults:Hc,pushRecentResult:Ir}}d();c();l();u();function C2(e){return e.addReducers({resultPreview:ah}),{fetchResultContent:gi,updateContentURL:eu,nextPreview:Jc,previousPreview:Xc,preparePreviewPagination:Zc}}d();c();l();u();d();c();l();u();var b2=new ge({content:new Le({required:!0}),conditions:new Le({required:!0}),priority:new ee({required:!1,default:0,min:0}),fields:new oe({required:!1,each:z})});function Uk(){let e=[],t=r=>{let n=b2.validate(r);if(!r.conditions.every(o=>o instanceof Function))throw new Tu("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let a={...t(n),fields:n.fields||[]};e.push(a)}),e.sort((n,a)=>a.priority-n.priority)},selectTemplate(r){let n=e.find(a=>a.conditions.every(o=>o(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(a=>a.conditions.every(o=>o(r)));return n?n.linkContent:null}}}function Qk(e){if(!w2(e))throw W;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Uk();return{registerTemplates:(...a)=>{t(...a);let o=[];a.forEach(i=>{i.fields&&o.push(...i.fields)}),e.dispatch(Za(o))},selectTemplate:r,selectLinkTemplate:n}}function w2(e){return e.addReducers({fields:eo}),!0}d();c();l();u();function R2(e){return e.addReducers({search:fe}),{executeSearch:pw,fetchMoreResults:mw,fetchFacetValues:gw,fetchPage:fw,fetchInstantResults:hw}}d();c();l();u();function F2(e){return e.addReducers({searchHub:Fs}),{setSearchHub:Rs}}d();c();l();u();function E2(e){return e.addReducers({facetOrder:Gc,facetSet:Rr,pagination:Tr,query:bt,querySet:ro}),{restoreSearchParameters:De,restoreTab:ns}}d();c();l();u();function I2(e){return e.addReducers({sortCriteria:xh}),{registerSortCriterion:gu,updateSortCriterion:hu}}d();c();l();u();function T2(e){return e.addReducers({standaloneSearchBoxSet:bh}),{registerStandaloneSearchBox:yu,fetchRedirectUrl:ao,updateStandaloneSearchBoxRedirectionUrl:Su,updateAnalyticsToSearchFromLink:Au,updateAnalyticsToOmniboxFromLink:xu,resetStandaloneSearchBox:vu}}d();c();l();u();function P2(e){return e.addReducers({staticFilterSet:wh}),{registerStaticFilter:Rc,toggleSelectStaticFilterValue:sa,toggleExcludeStaticFilterValue:ca,deselectAllStaticFilterValues:Wa}}d();c();l();u();function k2(e){return e.addReducers({tabSet:Ec}),{registerTab:$s,updateActiveTab:ht}}d();c();l();u();function O2(e){let{by:t,order:r}=e;switch(t){case"relevancy":return Ji();case"qre":return Kd();case"nosort":return Yd();case"date":if(!r)throw new Error("An order (i.e., ascending or descending) should be specified for a sort criterion sorted by \"date\"");return zd(r);default:if(!r)throw new Error(`An order (i.e., ascending or descending) should be specified for a sort criterion sorted by a field, such as "${t}"`);return Wd(t,r)}}function N2(e){return e===void 0||e==="ascending"||e==="descending"}function Bk(e){let t=e.split(","),r=new Error(`Wrong criterion expression format for "${e}"`);if(!t.length)throw r;return t.map(n=>{let a=n.trim().split(" "),o=a[0].toLowerCase(),i=a[1]?.toLowerCase();if(a.length>2||o==="")throw r;if(!N2(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return O2({by:o,order:i})})}d();c();l();u();d();c();l();u();d();c();l();u();function wt(e){return e.negate?"NOT ":""}d();c();l();u();function kr(e){return{contains:"=",differentThan:"<>",fuzzyMatch:"~=",greaterThan:">",greaterThanOrEqual:">=",isExactly:"==",lowerThan:"<",lowerThanOrEqual:"<=",phoneticMatch:"%=",regexMatch:"/=",wildcardMatch:"*="}[e]}function Gk(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=kr(e.operator);return`${wt(e)}@${t}${n}${r}`}}}d();c();l();u();function $k(e){return{toQuerySyntax(){let t=wt(e),{field:r,from:n,to:a}=e,o=kr("isExactly");return`${t}@${r}${o}${n}..${a}`}}}d();c();l();u();function Hk(e){return{toQuerySyntax(){let t=wt(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function zk(e){return{toQuerySyntax(){let t=wt(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function Wk(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function Kk(e){return{toQuerySyntax(){let t=wt(e),{startTerm:r,otherTerms:n}=e,a=_2(n),o=`${r} ${a}`;return e.negate?`${t}(${o})`:o}}}function _2(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function Yk(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=wt(e),a=kr(e.operator);return`${n}@${t}${a}${r}`}}}d();c();l();u();function Jk(e){return{toQuerySyntax(){let t=wt(e),{field:r,from:n,to:a}=e,o=kr("isExactly");return`${t}@${r}${o}${n}..${a}`}}}d();c();l();u();function Xk(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=D2(r);return`$${t}(${n})`}}}function D2(e){return Object.entries(e).map(t=>{let[r,n]=t,a=typeof n=="string"?n:n.toQuerySyntax();return`${r}: ${a}`}).join(", ")}d();c();l();u();function Zk(e){return{toQuerySyntax(){let t=wt(e),{field:r,operator:n,value:a}=e,o=kr(n),i=n==="fuzzyMatch"?` $quoteVar(value: ${a})`:`("${a}")`;return`${t}@${r}${o}${i}`}}}d();c();l();u();function eO(e){return{toQuerySyntax(){let{field:t}=e,r=wt(e),n=kr(e.operator),a=e.values.map(i=>`"${i}"`),o=a.length===1?a[0]:`(${a.join(",")})`;return`${r}@${t}${n}${o}`}}}function q2(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(Wk(r)),this},addNear(r){return e.push(Kk(r)),this},addExactMatch(r){return e.push(Hk(r)),this},addFieldExists(r){return e.push(zk(r)),this},addStringField(r){return e.push(eO(r)),this},addStringFacetField(r){return e.push(Zk(r)),this},addNumericField(r){return e.push(Yk(r)),this},addNumericRangeField(r){return e.push(Jk(r)),this},addDateField(r){return e.push(Gk(r)),this},addDateRangeField(r){return e.push($k(r)),this},addQueryExtension(r){return e.push(Xk(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=M2(t),n=e.map(a=>a.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function M2(e){return e==="and"?"AND":"OR"}/**
48
+ https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function gG(e){return e.addReducers({debug:ts,search:fe,configuration:le,fields:Ho}),!0}d();c();l();u();d();c();l();u();var rh=e=>Y({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Kt(e),t.makeDocumentOpen(dt(e,r),He(e))),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});function gP(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(rh(t.options.result)))};return tr(e,t,()=>{n(),e.dispatch(Er(t.options.result))})}d();c();l();u();function hP(e,t){return Vg(e,{...t,fetchMoreResultsActionCreator:Sr})}d();c();l();u();d();c();l();u();var hG=new ge({numberOfResults:new ee({min:0})});function yP(e,t={}){if(!yG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,i=ut(e,hG,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(ss(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(cs(p))},isSetTo(p){return p===this.state.numberOfResults}}}function yG(e){return e.addReducers({pagination:Ir,configuration:le}),!0}function SP(e,t={}){if(!SG(e))throw W;let r=yP(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(qt({legacy:Dc(),next:Mc()}))}}}function SG(e){return e.addReducers({pagination:Ir,configuration:le}),!0}d();c();l();u();d();c();l();u();var zo=()=>Y("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),nh=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var vP={id:z,query:Ue},Bc=T("querySet/register",e=>O(e,vP)),mi=T("querySet/update",e=>O(e,vP));d();c();l();u();var Wo=oe(up(),e=>{e.addCase(Bc,(t,r)=>xG(t,r.payload)).addCase(mi,(t,r)=>{let{id:n,query:o}=r.payload;px(t,n,o)}).addCase(Tn,(t,r)=>{let{id:n,expression:o}=r.payload;px(t,n,o)}).addCase(G.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;xP(t,n)}).addCase(De,vG).addCase(_e.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))px(t,n,o)})});function vG(e,t){ue(t.payload.q)||xP(e,t.payload.q)}function xP(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var px=(e,t,r)=>{t in e&&(e[t]=r)},xG=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var oh=e=>Y("analytics/querySuggest",(t,r)=>{let n=fx(r,e);return t.makeOmniboxAnalytics(n)}),AP=()=>({actionCause:"omniboxAnalytics"});function fx(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:a,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function CP(e,t){let r=t.id;r in e||(e[r]=AG(t))}function bP(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function RP(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function wP(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function AG(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var FP=()=>({});var Gc=oe(FP(),e=>e.addCase(Rc,(t,r)=>{CP(t,r.payload)}).addCase(aT,(t,r)=>{delete t[r.payload.id]}).addCase(Go.pending,bP).addCase(Go.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(Go.rejected,RP).addCase(Bo,(t,r)=>{wP(t,r.payload)}).addCase(xs,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var ah={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},mx={open:new j,close:new j},gx={id:z,numberOfSuggestions:new ee({min:0}),enableQuerySyntax:new ce,highlightOptions:new J({values:{notMatchDelimiters:new J({values:mx}),exactMatchDelimiters:new J({values:mx}),correctionDelimiters:new J({values:mx})}}),clearFilters:new ce},EP=new ge(gx);function IP(e,t){if(!bG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=t.options?.id||oo("search_box"),i={id:a,highlightOptions:{...t.options?.highlightOptions},...ah,...t.options};Be(e,EP,i,"buildSearchBox"),n(Bc({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(Rc({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(Dt({enableQuerySyntax:i.enableQuerySyntax}));let p=()=>e.state.querySet[i.id],f=/*#__PURE__*/function(){var _ref81=_asyncToGenerator(function*(m){let{enableQuerySyntax:g,clearFilters:S}=i;n(Ss({q:p(),enableQuerySyntax:g,clearFilters:S})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x178){return _ref81.apply(this,arguments)}}();return{...r,updateText(m){n(mi({id:a,query:m})),this.showSuggestions()},clear(){n(mi({id:a,query:""})),n(Bo({id:a}))},showSuggestions(){i.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:a}))},selectSuggestion(m){n(Tn({id:a,expression:m})),f({legacy:oh({id:a,suggestion:m}),next:AP()}).then(()=>{n(Bo({id:a}))})},submit(m=zo(),g){f({legacy:m,next:g}),n(Bo({id:a}))},get state(){let m=o(),g=m.querySuggest[i.id],S=CG(g,i.highlightOptions),A=g?g.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:S,isLoading:m.search.isLoading,isLoadingSuggestions:A}}}}function CG(e,t){return e?e.completions.map(r=>({highlightedValue:Mh(r.highlighted,t),rawValue:r.expression})):[]}function bG(e){return e.addReducers({query:Ct,querySuggest:Gc,configuration:le,querySet:Wo,search:fe}),!0}function ih(e,t={}){let r=IP(e,{...t,executeSearchActionCreator:G,fetchQuerySuggestionsActionCreator:Go,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(zo(),nh())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var $c=()=>Y("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||fr()})),sh=()=>({actionCause:"resultsSort"});function PP(e,t){return e.q!==t.q?zo():e.sortCriteria!==t.sortCriteria?$c():e.firstResult!==t.firstResult?qc():e.numberOfResults!==t.numberOfResults?Dc():Tr(e.f,t.f)?Ol(e.f,t.f):Tr(e.fExcluded,t.fExcluded)?Ol(e.fExcluded,t.fExcluded,!0):Tr(e.cf,t.cf)?Ol(e.cf,t.cf):Tr(e.af,t.af)?Ol(e.af,t.af):Tr(e.nf,t.nf)?TP(e.nf,t.nf):Tr(e.df,t.df)?TP(e.df,t.df):mo()}function Ol(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(A=>!o.includes(A));if(a.length){let A=a[0];switch(!0){case e[A].length>1:return vt(A);case r:return Kn({facetId:A,facetValue:e[A][0]});default:return Lr({facetId:A,facetValue:e[A][0]})}}let i=o.filter(A=>!n.includes(A));if(i.length){let A=i[0];return r?cr({facetId:A,facetValue:t[A][0]}):ot({facetId:A,facetValue:t[A][0]})}let p=o.find(A=>t[A].filter(h=>e[A].includes(h)));if(!p)return mo();let f=e[p],m=t[p],g=m.filter(A=>!f.includes(A));if(g.length)return r?cr({facetId:p,facetValue:g[0]}):ot({facetId:p,facetValue:g[0]});let S=f.filter(A=>!m.includes(A));return S.length?r?Kn({facetId:p,facetValue:S[0]}):Lr({facetId:p,facetValue:S[0]}):mo()}function TP(e={},t={}){return Ol(zc(e),zc(t))}function kP(e,t){return e.q!==t.q?nh():e.sortCriteria!==t.sortCriteria?sh():Tr(e.f,t.f)?Hc(e.f,t.f):Tr(e.fExcluded,t.fExcluded)?Hc(e.fExcluded,t.fExcluded,!0):Tr(e.cf,t.cf)?Hc(e.cf,t.cf):Tr(e.af,t.af)?Hc(e.af,t.af):Tr(e.nf,t.nf)?Hc(zc(e.nf),zc(t.nf)):Tr(e.df,t.df)?Hc(zc(e.df),zc(t.df)):Yi()}function Tr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function Hc(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(A=>!o.includes(A));if(a.length){let A=a[0];return e[A].length>1?Vt():Jn()}if(o.filter(A=>!n.includes(A)).length)return r?Yn():mt();let p=o.find(A=>t[A].filter(h=>e[A].includes(h)));if(!p)return Yi();let f=e[p],m=t[p];return m.filter(A=>!f.includes(A)).length?r?Yn():mt():f.filter(A=>!m.includes(A)).length?Jn():Yi()}function zc(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();function OP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function NP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{sortCriteria:n}:{}}function ch(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([a])=>t(a)).map(([a,{request:i}])=>{let p=r(i);return p.length?{[a]:p}:{}}).reduce((a,i)=>({...a,...i}),{});return Object.keys(o).length?{[n]:o}:{}}function _P(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function DP(e){return{q:lt().q,enableQuerySyntax:lt().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??_r().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??_r().defaultFilters.cq,firstResult:hr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??hr().defaultNumberOfResults,sortCriteria:fr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:yo(),sf:{},tab:"",af:{},mnf:{}}}var RG=new ge({parameters:new J({options:{required:!0},values:Kd})});function jP(e,t){let{dispatch:r}=e,n=ne(e);ut(e,RG,t.initialState,"buildSearchParameterManager");let o=qP(e.state.tabSet,t.initialState.parameters);return r(De(o)),{...n,synchronize(a){let i=qP(e.state.tabSet,uh(e,a));r(De(i))},get state(){return{parameters:hx(e)}}}}function uh(e,t){return{...DP(e.state),...t}}function qP(e,t){if(ue(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:MP(e)};if(!Object.values(e).some(n=>n.id===t.tab)){let n=Object.values(e).find(o=>o.isActive);return{...t,tab:n?.id??MP(e)}}return t}function MP(e){return Object.keys(e)[0]??""}function hx(e){let t=e.state;return{...OP(t.query,r=>r.q,lt().q),..._P(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...NP(t.sortCriteria,r=>r,fr()),...FG(t),...EG(t),...IG(t),...TG(t),...PG(t)}}function wG(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function lh(e){let t=wG(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=er(n?.tabs,t);return o&&a}}function VP(e){return e.currentValues.filter(t=>t.state==="selected")}function FG(e){let t=e.facetSet;if(t===void 0)return{};let r=lh(e),n={},o={};for(let[a,{request:i}]of Object.entries(t)){if(!r(a))continue;let p=i.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=i.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[a]=p),f.length&&(o[a]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function EG(e){return ch(e.categoryFacetSet,lh(e),t=>or(t.currentValues).map(r=>r.value),"cf")}function IG(e){return ch(e.numericFacetSet,lh(e),VP,"nf")}function TG(e){return ch(e.dateFacetSet,lh(e),VP,"df")}function PG(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=kG(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function kG(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function dh(e,t){let{dispatch:r}=e,n=jP(e,t);return{...n,synchronize(o){let a=LP(e),i=uh(e,a),p=uh(e,o);Tl(i,p)||(n.synchronize(o),r(G({legacy:PP(i,p),next:kP(i,p)})))},get state(){return{parameters:LP(e)}}}}function LP(e){let t=e.state;return{...hx(e),...OG(t),...NG(t),..._G(t),...DG(t),...qG(t),...VG(t),...MG(t)}}function OG(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==lt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function NG(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function _G(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function DG(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==hr().firstResult?{firstResult:t}:{}}function qG(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function MG(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=jG(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function jG(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function VG(e){if(e.debug===void 0)return{};let t=e.debug;return t!==yo()?{debug:t}:{}}d();c();l();u();function UP(e){return Ec(e)}d();c();l();u();d();c();l();u();d();c();l();u();var ph=()=>new J({values:{questionAnswerId:z},options:{required:!0}}),yx=()=>new J({values:{linkText:Ue,linkURL:Ue},options:{required:!0}});function Wc(e){return O(e,ph())}d();c();l();u();function st(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&AR(e,r.contentIdKey,r.contentIdValue)}function Ur(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var Sx=()=>Y({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),vx=()=>Y({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),xx=()=>Y({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Ax=()=>Y({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Cx=()=>Y({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=st(t);return e.makeOpenSmartSnippetSource(dt(r,t),He(r))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Nl=e=>Y({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,yx());let n=st(r);return n?t.makeOpenSmartSnippetInlineLink(dt(n,r),{...He(n),...e}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),bx=()=>Y("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),Rx=()=>Y("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),LG={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},wx=e=>Y({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:LG[e]}}}),Fx=e=>Y({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),Ex=e=>Y({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{Wc(e);let n=Ur(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),Ix=e=>Y({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{Wc(e);let n=Ur(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),_l=e=>Y({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,ph());let n=Ur(r,e.questionAnswerId);if(!n)return null;let o=st(r,n.documentId);return o?t.makeOpenSmartSnippetSuggestionSource(dt(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),fh=(e,t)=>Y({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,ph()),O(t,yx());let o=Ur(n,e.questionAnswerId);if(!o)return null;let a=st(n,o.documentId);return a?r.makeOpenSmartSnippetSuggestionInlineLink(dt(a,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Ur(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let a=st(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),mh={logExpandSmartSnippet:Sx,logCollapseSmartSnippet:vx,logLikeSmartSnippet:xx,logDislikeSmartSnippet:Ax,logOpenSmartSnippetSource:Cx,logOpenSmartSnippetInlineLink:Nl,logOpenSmartSnippetFeedbackModal:bx,logCloseSmartSnippetFeedbackModal:Rx,logSmartSnippetFeedback:wx,logSmartSnippetDetailedFeedback:Fx,logExpandSmartSnippetSuggestion:Ex,logCollapseSmartSnippetSuggestion:Ix,logOpenSmartSnippetSuggestionSource:_l};d();c();l();u();d();c();l();u();var Kc=T("smartSnippet/expand"),Yc=T("smartSnippet/collapse"),Jc=T("smartSnippet/like"),Xc=T("smartSnippet/dislike"),Zc=T("smartSnippet/feedbackModal/open"),Ko=T("smartSnippet/feedbackModal/close"),eu=T("smartSnippet/related/expand",e=>Wc(e)),tu=T("smartSnippet/related/collapse",e=>Wc(e));d();c();l();u();d();c();l();u();var Tx=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var QP=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function BP({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return Ai({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function UG(e,t){let r=BP(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var kn=oe(Tx(),e=>e.addCase(Kc,t=>{t.expanded=!0}).addCase(Yc,t=>{t.expanded=!1}).addCase(Jc,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(Xc,t=>{t.liked=!1,t.disliked=!0}).addCase(Zc,t=>{t.feedbackModalOpen=!0}).addCase(Ko,t=>{t.feedbackModalOpen=!1}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((a,i)=>UG(a,t.relatedQuestions[i])),o=BP(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...Tx(),relatedQuestions:n,questionAnswerId:o}}).addCase(eu,(t,r)=>{let n=QP(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(tu,(t,r)=>{let n=QP(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function GP(e,t,r){if(!QG(e))throw W;let n=ne(e),o=()=>e.state,a=()=>st(o()),i=null,p=tr(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=a();if(!f){i=null;return}let{searchResponseId:m}=o().search;i!==m&&(i=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(Er(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:a()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(Kc())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(Yc())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(Jc())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(Xc())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(Zc())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(Ko())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(Ko())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(Ko())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function QG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}d();c();l();u();function gh(e,t){if(!BG(e))throw W;let r=()=>e.state,n=new Set,o=g=>n.has(g)?!0:(n.add(g),!1),a=null,i=g=>{a!==g&&(a=g,f={},n.clear())},p=(g,S,A)=>tr(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(S)||e.dispatch(A?fh({questionAnswerId:A},g):Nl(g))}),f={},m=(g,S)=>{let{searchResponseId:A}=r().search;i(A);let h=Ai({...g,questionAnswerId:S});return h in f||(f[h]=p(g,h,S)),f[h]};return{selectInlineLink(g,S){m(g,S)?.select()},beginDelayedSelectInlineLink(g,S){m(g,S)?.beginDelayedSelect()},cancelPendingSelectInlineLink(g,S){m(g,S)?.cancelPendingSelect()}}}function BG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}function $P(e,t){Do(e.state.configuration.analytics.analyticsMode);let r=GP(e,mh,t),n=gh(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();l();u();d();c();l();u();function HP(e,t){if(!GG(e))throw W;let r=ne(e),n=()=>e.state,o=a=>{let{contentIdKey:i,contentIdValue:p}=a;return e.state.search.results.find(f=>Eo(f,i)===p)};return{...r,get state(){let a=n();return{questions:a.search.questionAnswer.relatedQuestions.map((i,p)=>({question:i.question,answer:i.answerSnippet,documentId:i.documentId,questionAnswerId:a.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:a.questionAnswering.relatedQuestions[p].expanded,source:o(i.documentId)}))}},expand(a){let i={questionAnswerId:a};e.dispatch(t.logExpandSmartSnippetSuggestion(i)),e.dispatch(eu(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(tu(i))}}}function GG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}d();c();l();u();function zP(e,t){if(!$G(e))throw W;let r=()=>e.state,n=S=>{let A=r(),h=Ur(A,S);return h?st(A,h.documentId):null},o=new Set,a=S=>o.has(S)?!0:(o.add(S),!1),i=null,p=S=>{i!==S&&(i=S,m={},o.clear())},f=(S,A)=>tr(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(A)||(e.dispatch(_l({questionAnswerId:A})),e.dispatch(Er(S)))}),m={},g=S=>{let{searchResponseId:A}=r().search;p(A);let h=n(S);return h?(S in m||(m[S]=f(h,S)),m[S]):null};return{selectSource(S){g(S)?.select()},beginDelayedSelectSource(S){g(S)?.beginDelayedSelect()},cancelPendingSelectSource(S){g(S)?.cancelPendingSelect()}}}function $G(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}function WP(e,t){Do(e.state.configuration.analytics.analyticsMode);let r=HP(e,mh),n=gh(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=zP(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(a){o.selectSource(a)},beginDelayedSelectSource(a){o.beginDelayedSelectSource(a)},cancelPendingSelectSource(a){o.cancelPendingSelectSource(a)},selectInlineLink(a,i){n.selectInlineLink(i,a)},beginDelayedSelectInlineLink(a,i){n.beginDelayedSelectInlineLink(i,a)},cancelPendingSelectInlineLink(a,i){n.cancelPendingSelectInlineLink(i,a)}}}d();c();l();u();d();c();l();u();d();c();l();u();var KP={by:new yu({enum:la,required:!0})},ru=T("sortCriteria/register",e=>YP(e)),nu=T("sortCriteria/update",e=>YP(e)),YP=e=>xi(e)?(e.forEach(t=>O(t,KP)),{payload:e}):O(e,KP);d();c();l();u();var hh=oe(fr(),e=>{e.addCase(ru,(t,r)=>Hr(r.payload)).addCase(nu,(t,r)=>Hr(r.payload)).addCase(_e.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(De,(t,r)=>r.payload.sortCriteria??t)});function HG(e,t){if(!t)return;let r=new ge({criterion:new ae({each:vb})}),n=zG(t),o={...t,criterion:n};ut(e,r,o,"buildSort")}function zG(e){return e.criterion?xi(e.criterion)?e.criterion:[e.criterion]:[]}function JP(e,t){if(!WG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state;HG(e,t.initialState);let a=t.initialState?.criterion;return a&&n(ru(a)),{...r,sortBy(i){n(nu(i)),n(Yr(1))},isSortedBy(i){return this.state.sortCriteria===Hr(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function WG(e){return e.addReducers({configuration:le,sortCriteria:hh}),!0}function XP(e,t={}){let{dispatch:r}=e,n=JP(e,t),o=()=>r(G({legacy:$c(),next:sh()}));return{...n,get state(){return n.state},sortBy(a){n.sortBy(a),o()}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function ZP(e){return e.type==="redirect"}var yh=class{constructor(t){this.response=t}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let t=this.response.preprocessingOutput.triggers.filter(ZP);return t.length?t[0].content:null}};var ou=T("standaloneSearchBox/register",e=>O(e,{id:z,redirectionUrl:z,overwrite:new ce({required:!1})})),au=T("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:z,redirectionUrl:z})),iu=T("standaloneSearchBox/reset",e=>O(e,{id:z})),su=T("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:z})),cu=T("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),Yo=Se("standaloneSearchBox/fetchRedirect",/*#__PURE__*/function(){var _ref82=_asyncToGenerator(function*(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:o,validatePayload:a,navigatorContext:i}}){a(e,{id:new j({emptyAllowed:!1})});let p=yield YG(r(),i),f=yield o.plan(p);if(ht(f))return n(f.error);let{redirectionUrl:m}=new yh(f.success);return m&&t(KG(m)),m||""});return function(_x179,_x180){return _ref82.apply(this,arguments)}}()),KG=e=>Y("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),YG=/*#__PURE__*/function(){var _ref83=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...(e.context&&{context:e.context.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield fs(e.configuration.analytics):Ln(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function YG(_x181,_x182){return _ref83.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function ek(){return{}}var Sh=oe(ek(),e=>e.addCase(ou,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=Px(o))}).addCase(iu,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=Px(o.defaultRedirectionUrl);return}}).addCase(au,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=Px(o))}).addCase(Yo.pending,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!0)}).addCase(Yo.fulfilled,(t,r)=>{let n=r.payload,o=t[r.meta.arg.id];o&&(o.redirectTo=n||o.defaultRedirectionUrl,o.isLoading=!1)}).addCase(Yo.rejected,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!1)}).addCase(su,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(cu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function Px(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var tk=new ge({...gx,redirectionUrl:new j({required:!0,emptyAllowed:!1}),overwrite:new ce({required:!1})});function rk(e,t){if(!JG(e))throw W;let{dispatch:r}=e,n=()=>e.state,o=t.options.id||oo("standalone_search_box"),a={id:o,highlightOptions:{...t.options.highlightOptions},...ah,overwrite:!1,...t.options};Be(e,tk,a,"buildStandaloneSearchBox");let i=ih(e,{options:a});return r(ou({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(su({id:o}))},selectSuggestion(p){let f=fx(n(),{id:o,suggestion:p});r(Tn({id:o,expression:p})),r(cu({id:o,metadata:f})),this.submit()},afterRedirection(){r(iu({id:o}))},updateRedirectUrl(p){r(au({id:o,redirectionUrl:p}))},submit(){r(Dt({q:this.state.value,enableQuerySyntax:a.enableQuerySyntax})),r(Yo({id:o}))},get state(){let f=n().standaloneSearchBoxSet[o];return{...i.state,isLoading:f.isLoading,redirectTo:f.redirectTo,analytics:f.analytics}}}}function JG(e){return e.addReducers({standaloneSearchBoxSet:Sh,configuration:le,query:Ct,querySuggest:Gc}),!0}d();c();l();u();d();c();l();u();var vh=oe(lp(),e=>e.addCase(pc,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]=n)}).addCase(eo,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(to,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="excluded";i.state=p?"idle":"excluded"}).addCase(Lo,(t,r)=>{let n=r.payload,o=t[n];o&&o.values.forEach(a=>{a.state="idle"})}).addCase(pt,t=>{Object.values(t).forEach(r=>{r.values.forEach(n=>{n.state="idle"})})}).addCase(De,(t,r)=>{let n=r.payload.sf||{};Object.entries(t).forEach(([o,a])=>{let i=n[o]||[];a.values.forEach(p=>{p.state=i.includes(p.caption)?"selected":"idle"})})}));d();c();l();u();function kx(e){return{state:"idle",...e}}var XG=new ge({id:ai,values:Xm});function nk(e,t){if(!ZG(e))throw W;Be(e,XG,t.options,"buildStaticFilter");let r=ne(e),{dispatch:n}=e,o=()=>e.state,{id:a}=t.options;return n(pc(t.options)),{...r,toggleSelect(i){n(eo({id:a,value:i})),n(G({legacy:xh(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Lo(a)),n(eo({id:a,value:i})),n(G({legacy:xh(a,i)}))},toggleExclude(i){n(to({id:a,value:i})),n(G({legacy:xh(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Lo(a)),n(to({id:a,value:i})),n(G({legacy:xh(a,i)}))},deselectAll(){n(Lo(a)),n(G({legacy:eg({staticFilterId:a})}))},isValueSelected(i){return i.state==="selected"},isValueExcluded(i){return i.state==="excluded"},get state(){let i=o().staticFilterSet[a]?.values||[],p=i.some(f=>f.state!=="idle");return{id:a,values:i,hasActiveValues:p}}}}function ZG(e){return e.addReducers({staticFilterSet:vh}),!0}function xh(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?Zm:fc)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var e2=new ge({expression:Ue,id:z,clearFiltersOnTabChange:new ce}),t2=new ge({isActive:new ce});function ok(e,t){if(n2(t.options.id),!r2(e))throw W;let r=ne(e),{dispatch:n}=e;Be(e,e2,t.options,"buildTab");let o=ut(e,t2,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n(Os({id:a,expression:i})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(gt(a)),{...r,select(){t.options.clearFiltersOnTabChange&&n(Ss({q:"",clearFilters:!0})),n(gt(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function r2(e){return e.addReducers({configuration:le,tabSet:mc}),!0}function n2(e){let t=Ns().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function ak(e,t){let{dispatch:r}=e,n=ok(e,t),o=()=>r(G({legacy:mo(),next:Yi()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();function ik(e){let t=og(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function sk(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function ck(e,t){let r=[],n=[],o=[],a=[];return t.forEach(i=>{switch(i.type){case"redirect":r.push(i.content);break;case"query":n.push(i.content);break;case"execute":o.push({functionName:i.content.name,params:i.content.params});break;case"notify":a.push(i.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=a,e}function uk(e,t){return e.queryModification={...t,queryToIgnore:""},e}function lk(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var dk=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var Jo=oe(dk(),e=>e.addCase(G.pending,sk).addCase(G.fulfilled,(t,r)=>ck(t,r.payload.response.triggers)).addCase(ys,(t,r)=>uk(t,r.payload)).addCase(Co,(t,r)=>lk(t,r.payload)));function pk(e){if(!o2(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.executions;return{...t,subscribe(a){let i=()=>{let p=!di(this.state.executions,o,(f,m)=>f.functionName===m.functionName&&di(f.params,m.params));o=this.state.executions,p&&this.state.executions.length&&(a(),r(hp()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function o2(e){return e.addReducers({triggers:Jo}),!0}d();c();l();u();d();c();l();u();function fk(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!a2(e))throw W;let n=ne(e),{dispatch:o}=e,a=()=>e.state,i=a().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!di(i,this.state.notifications);i=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:a().triggers.notifications}}}}function a2(e){return e.addReducers({triggers:Jo}),!0}function mk(e){return fk(e,{options:{logNotifyTriggerActionCreator:mp}})}d();c();l();u();function gk(e){if(!i2(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=()=>n().triggers.queryModification.newQuery,a=()=>n().triggers.queryModification.originalQuery;return{...t,get state(){return{newQuery:o(),originalQuery:a(),wasQueryModified:o()!==""}},undo(){r(Co(o())),r(Dt({q:a()})),r(G({legacy:fp({undoneQuery:o()})}))}}}function i2(e){return e.addReducers({triggers:Jo,query:Ct}),!0}d();c();l();u();function hk(e){if(!s2(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.redirectTo;return{...t,subscribe(a){let i=()=>{let p=o!==this.state.redirectTo;o=this.state.redirectTo,p&&this.state.redirectTo&&(a(),r(gp()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function s2(e){return e.addReducers({triggers:Jo}),!0}d();c();l();u();d();c();l();u();var Sk="..",Ox="...",c2=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,u2={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},Ah="&",Dl="=";function ql(){return{serialize:p2(f2),deserialize:v2}}function Ml(e){return e in u2}function l2(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function d2(e){let r=e in{nf:!0,df:!0,mnf:!0};return Ml(e)&&r}function vk(e){return l2(e)||Ml(e)}var p2=e=>t=>Object.entries(t).map(e).filter(r=>r).join(Ah);function f2(e){let[t,r]=e;return vk(t)?Ml(t)&&!d2(t)?g2(r)?y2(t,r):"":t==="nf"||t==="df"?h2(r)?S2(t,r):"":m2(t,r):""}function m2(e,t){return`${e}${Dl}${encodeURIComponent(t)}`}function g2(e){return Nx(e)?xk(e,r=>typeof r=="string"):!1}function h2(e){return Nx(e)?xk(e,r=>Nx(r)&&"start"in r&&"end"in r):!1}function Nx(e){return!!(e&&typeof e=="object")}function xk(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function y2(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${Dl}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(Ah)}function S2(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?Ox:Sk}${i}`).join(",");return`${e}-${r}${Dl}${o}`}).join(Ah)}function v2(e){return e.split(Ah).map(n=>x2(n)).map(n=>A2(n)).filter(w2).map(n=>F2(n)).reduce((n,o)=>{let[a,i]=o;if(Ml(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function x2(e){let[t,...r]=e.split(Dl),n=r.join(Dl);return[t,n]}function A2(e,t=c2){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=C2(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function C2(e,t){return e==="nf"||e==="mnf"?b2(t,"selected"):e==="df"?R2(t,"selected"):t}function b2(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=Ak(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(bc({start:p,end:f,state:t,endInclusive:i}))}return r}function yk(e){try{return Hb(e)?(ep(e,ms),!0):Jr(e)?(xo(e),!0):!1}catch{return!1}}function R2(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=Ak(n);!yk(a)||!yk(i)||r.push(Vo({start:a,end:i,state:t,endInclusive:o}))}return r}function w2(e){let t=vk(e[0]),r=e.length===2;return t&&r}function F2(e,t=!0){let[r,n]=e;return r==="enableQuerySyntax"?[r,n==="true"]:r==="debug"?[r,n==="true"]:r==="firstResult"?[r,parseInt(n,10)]:r==="numberOfResults"?[r,parseInt(n,10)]:Ml(r)?[r,E2(n)]:[r,t?decodeURIComponent(n):n]}function E2(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[o,a]=n;r[o]=a.map(i=>vi(i)?decodeURIComponent(i):i)}),r}function Ak(e){let t=e.indexOf(Ox)!==-1,[r,n]=e.split(t?Ox:Sk);return{isEndInclusive:t,startAsString:r,endAsString:n}}var I2=new ge({fragment:new j});function Ck(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!P2(e))throw W;ut(e,I2,t.initialState,"buildUrlManager");let a=ne(e),i=t.initialState.fragment;n();let p=dh(e,{initialState:{parameters:Ch(i)}});return{...a,subscribe(f){let m=()=>{let g=this.state.fragment;!T2(i,g)&&o()&&(i=g,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:ql().serialize(p.state.parameters)}},synchronize(f){i=f;let m=Ch(f);p.synchronize(m)}}}function T2(e,t){if(e===t)return!0;let r=Ch(e),n=Ch(t);return Tl(r,n)}function Ch(e){return ql().deserialize(e)}function P2(e){return e.addReducers({configuration:le}),!0}d();c();l();u();d();c();l();u();var bk=Se("analytics/addPageViewEntry",/*#__PURE__*/function(){var _ref84=_asyncToGenerator(function*(e,{getState:t}){t().configuration.analytics.enabled&&Wt.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});return function(_x183,_x184){return _ref84.apply(this,arguments)}}());function k2(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:bk}}d();c();l();u();d();c();l();u();d();c();l();u();var Xo=()=>new j({required:!1,emptyAllowed:!0}),bh=T("advancedSearchQueries/update",e=>O(e,{aq:Xo(),cq:Xo(),lq:Xo(),dq:Xo()})),Rh=T("advancedSearchQueries/register",e=>O(e,{aq:Xo(),cq:Xo(),lq:Xo(),dq:Xo()}));var Rk=oe(_r(),e=>{e.addCase(bh,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;wt(n)||(t.aq=n,t.aqWasSet=!0),wt(o)||(t.cq=o,t.cqWasSet=!0),wt(a)||(t.lq=a,t.lqWasSet=!0),wt(i)||(t.dq=i,t.dqWasSet=!0)}).addCase(Rh,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;wt(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),wt(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),wt(a)||(t.defaultFilters.lq=a,t.lqWasSet||(t.lq=a)),wt(i)||(t.defaultFilters.dq=i,t.dqWasSet||(t.dq=i))}).addCase(_e.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(De,(t,r)=>{let{aq:n,cq:o}=r.payload;wt(n)||(t.aq=n,t.aqWasSet=!0),wt(o)||(t.cq=o,t.cqWasSet=!0)})});function O2(e){return e.addReducers({advancedSearchQueries:Rk}),{updateAdvancedSearchQueries:bh,registerAdvancedSearchQueries:Rh}}d();c();l();u();function N2(e){return e.addReducers({}),{logDocumentOpen:rh,logOpenSmartSnippetSource:Cx,logOpenSmartSnippetSuggestionSource:_l,logOpenSmartSnippetInlineLink:Nl,logOpenSmartSnippetSuggestionInlineLink:fh}}d();c();l();u();function _2(e){return e.addReducers({}),{logSearchEvent:Nb,logClickEvent:_b,logCustomEvent:Db}}d();c();l();u();function D2(e){return e.addReducers({}),{logClearBreadcrumbs:_m,logInterfaceLoad:Bd,logSearchFromLink:Gd,logOmniboxFromLink:$d,logInterfaceChange:mo,logDidYouMeanClick:op,logCategoryFacetBreadcrumb:wm,logFacetBreadcrumb:lc,logFacetClearAll:vt,logFacetUnexclude:Kn,logFacetExclude:cr,logFacetDeselect:Lr,logFacetSelect:ot,logFacetShowLess:uc,logFacetShowMore:cc,logFacetUpdateSort:Sn,logDateFacetBreadcrumb:Cl,logNumericFacetBreadcrumb:bl,logNavigateBackward:Qg,logNavigateForward:Ug,logPageNext:Yg,logPageNumber:qc,logPagePrevious:Jg,logPagerResize:Dc,logSearchboxSubmit:zo,logQuerySuggestionClick:oh,logResultsSort:$c,logDislikeSmartSnippet:Ax,logLikeSmartSnippet:xx,logOpenSmartSnippetFeedbackModal:bx,logCloseSmartSnippetFeedbackModal:Rx,logSmartSnippetFeedback:wx,logSmartSnippetDetailedFeedback:Fx,logExpandSmartSnippet:Sx,logCollapseSmartSnippet:vx,logExpandSmartSnippetSuggestion:Ex,logCollapseSmartSnippetSuggestion:Ix,logNoResultsBack:Bg,logStaticFilterSelect:Zm,logStaticFilterDeselect:fc,logStaticFilterClearAll:eg,logTriggerQuery:pp,logUndoTriggerQuery:fp,logNotifyTrigger:mp,logTriggerRedirect:gp,logTriggerExecute:hp}}d();c();l();u();function q2(e){return e.addReducers({}),{deselectAllBreadcrumbs:pt,deselectAllNonBreadcrumbs:os}}d();c();l();u();function M2(e){return e.addReducers({configuration:le}),{disableAnalytics:Ji,enableAnalytics:Xi,setOriginLevel2:Hd,setOriginLevel3:zd,updateAnalyticsConfiguration:go,updateBasicConfiguration:zr}}d();c();l();u();function j2(e){return e.addReducers({configuration:le,pipeline:ns,searchHub:Cs}),{updateSearchConfiguration:mr}}d();c();l();u();function V2(e){return e.addReducers({context:rg}),{addContext:si,removeContext:ci,setContext:ii}}d();c();l();u();function L2(e){return e.addReducers({debug:ts}),{disableDebug:es,enableDebug:ho}}d();c();l();u();function U2(e){return e.addReducers({dictionaryFieldContext:ag}),{addContext:hc,removeContext:yc,setContext:gc}}d();c();l();u();function Q2(e){return e.addReducers({didYouMean:sg,query:Ct}),{applyDidYouMeanCorrection:gr,disableDidYouMean:rp,enableDidYouMean:gs,enableAutomaticQueryCorrection:np,disableAutomaticQueryCorrection:hs,setCorrectionMode:fa}}d();c();l();u();d();c();l();u();d();c();l();u();var wh=T("excerptLength/set",e=>O(e,new ee({min:0,required:!0})));d();c();l();u();function wk(){return{length:void 0}}var Fk=oe(wk(),e=>{e.addCase(wh,(t,r)=>{t.length=r.payload})});function B2(e){return e.addReducers({excerptLength:Fk}),{setExcerptLength:wh}}d();c();l();u();function G2(e){return e.addReducers({facetOptions:xt}),{updateFacetOptions:be,enableFacet:jt,disableFacet:Je}}d();c();l();u();function $2(e){return e.addReducers({automaticFacetSet:cg}),{setOptions:Xs,deselectAllAutomaticFacetValues:Zs,toggleSelectAutomaticFacetValue:sn}}d();c();l();u();function H2(e){return e.addReducers({categoryFacetSet:ln}),{deselectAllCategoryFacetValues:un,registerCategoryFacet:cn,toggleSelectCategoryFacetValue:Mo,updateCategoryFacetNumberOfValues:Ja,updateCategoryFacetSortCriterion:tc,updateFacetAutoSelection:Wr,updateCategoryFacetBasePath:Rm}}d();c();l();u();function z2(e){return e.addReducers({facetSet:Rr}),{deselectAllFacetValues:Xe,registerFacet:gn,toggleSelectFacetValue:hn,toggleExcludeFacetValue:yn,updateFacetIsFieldExpanded:Za,updateFacetNumberOfValues:Xa,updateFacetSortCriterion:sc,updateFreezeCurrentValues:Wn,updateFacetAutoSelection:Wr}}d();c();l();u();function W2(e){return e.addReducers({dateFacetSet:bn}),{deselectAllDateFacetValues:Mm,registerDateFacet:vn,toggleSelectDateFacetValue:xn,toggleExcludeDateFacetValue:An,updateDateFacetSortCriterion:qm,updateDateFacetValues:Xn}}d();c();l();u();function K2(e){return e.addReducers({numericFacetSet:wr}),{deselectAllNumericFacetValues:Ym,registerNumericFacet:Rn,toggleSelectNumericFacetValue:wn,toggleExcludeNumericFacetValue:Fn,updateNumericFacetSortCriterion:Km,updateNumericFacetValues:Zn}}d();c();l();u();function Y2(e){return e.addReducers({fields:Ho}),{registerFieldsToInclude:$o,enableFetchAllFields:wc,disableFetchAllFields:ui,fetchFieldsDescription:Fc}}d();c();l();u();function J2(e){return e.addReducers({folding:Mg}),{registerFolding:Uo,loadCollection:Qo}}d();c();l();u();function X2(e){return e.addReducers({generatedAnswer:Tc}),{generateAnswer:Vp,resetAnswer:sr,setAnswerGenerationMode:Ep}}d();c();l();u();function Z2(e){return e.addReducers({history:Hg,facetOrder:kc}),{back:Gu,forward:Yd}}d();c();l();u();function e$(e){return e.addReducers({instantResults:Wg}),{registerInstantResults:as,updateInstantResultsQuery:Kr,clearExpiredResults:is}}d();c();l();u();function t$(e){return e.addReducers({pagination:Ir}),{nextPage:ls,previousPage:ds,registerNumberOfResults:ss,registerPage:us,updateNumberOfResults:cs,updatePage:Yr}}d();c();l();u();function r$(e){return e.addReducers({pipeline:ns}),{setPipeline:rs}}d();c();l();u();function n$(e){return e.addReducers({query:Ct}),{updateQuery:Dt}}d();c();l();u();function o$(e){return e.addReducers({querySet:Wo}),{registerQuerySetQuery:Bc,updateQuerySetQuery:mi}}d();c();l();u();function a$(e){return e.addReducers({querySuggest:Gc,querySet:Wo}),{clearQuerySuggest:Bo,fetchQuerySuggestions:Go,registerQuerySuggest:Rc,selectQuerySuggestion:Tn}}d();c();l();u();function i$(e){return e.addReducers({questionAnswering:kn}),{collapseSmartSnippet:Yc,expandSmartSnippet:Kc,dislikeSmartSnippet:Xc,likeSmartSnippet:Jc,openFeedbackModal:Zc,closeFeedbackModal:Ko,expandSmartSnippetRelatedQuestion:eu,collapseSmartSnippetRelatedQuestion:tu}}d();c();l();u();function s$(e){return e.addReducers({recentQueries:eh}),{registerRecentQueries:fi,clearRecentQueries:Qc}}d();c();l();u();function c$(e){return e.addReducers({recentResults:th}),{registerRecentResults:Oc,clearRecentResults:Nc,pushRecentResult:Er}}d();c();l();u();function u$(e){return e.addReducers({resultPreview:Zg}),{fetchResultContent:pi,updateContentURL:Uc,nextPreview:jc,previousPreview:Vc,preparePreviewPagination:Lc}}d();c();l();u();d();c();l();u();var l$=new ge({content:new Le({required:!0}),conditions:new Le({required:!0}),priority:new ee({required:!1,default:0,min:0}),fields:new ae({required:!1,each:z})});function Ek(){let e=[],t=r=>{let n=l$.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new hu("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.linkContent:null}}}function Ik(e){if(!d$(e))throw W;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Ek();return{registerTemplates:(...o)=>{t(...o);let a=[];o.forEach(i=>{i.fields&&a.push(...i.fields)}),e.dispatch($o(a))},selectTemplate:r,selectLinkTemplate:n}}function d$(e){return e.addReducers({fields:Ho}),!0}d();c();l();u();function p$(e){return e.addReducers({search:fe}),{executeSearch:cR,fetchMoreResults:lR,fetchFacetValues:dR,fetchPage:uR,fetchInstantResults:pR}}d();c();l();u();function f$(e){return e.addReducers({searchHub:Cs}),{setSearchHub:As}}d();c();l();u();function m$(e){return e.addReducers({facetOrder:kc,facetSet:Rr,pagination:Ir,query:Ct,querySet:Wo}),{restoreSearchParameters:De,restoreTab:Zi}}d();c();l();u();function g$(e){let{by:t,order:r}=e;switch(t){case"relevancy":return zi();case"qre":return jd();case"nosort":return Vd();case"date":if(!r)throw new Error("An order (i.e., ascending or descending) should be specified for a sort criterion sorted by \"date\"");return qd(r);default:if(!r)throw new Error(`An order (i.e., ascending or descending) should be specified for a sort criterion sorted by a field, such as "${t}"`);return Md(t,r)}}function h$(e){return e===void 0||e==="ascending"||e==="descending"}function Tk(e){let t=e.split(","),r=new Error(`Wrong criterion expression format for "${e}"`);if(!t.length)throw r;return t.map(n=>{let o=n.trim().split(" "),a=o[0].toLowerCase(),i=o[1]?.toLowerCase();if(o.length>2||a==="")throw r;if(!h$(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return g$({by:a,order:i})})}d();c();l();u();function y$(e){return e.addReducers({sortCriteria:hh}),{registerSortCriterion:ru,updateSortCriterion:nu}}d();c();l();u();function S$(e){return e.addReducers({standaloneSearchBoxSet:Sh}),{registerStandaloneSearchBox:ou,fetchRedirectUrl:Yo,updateStandaloneSearchBoxRedirectionUrl:au,updateAnalyticsToSearchFromLink:su,updateAnalyticsToOmniboxFromLink:cu,resetStandaloneSearchBox:iu}}d();c();l();u();function v$(e){return e.addReducers({staticFilterSet:vh}),{registerStaticFilter:pc,toggleSelectStaticFilterValue:eo,toggleExcludeStaticFilterValue:to,deselectAllStaticFilterValues:Lo}}d();c();l();u();function x$(e){return e.addReducers({tabSet:mc}),{registerTab:Os,updateActiveTab:gt}}d();c();l();u();d();c();l();u();d();c();l();u();function bt(e){return e.negate?"NOT ":""}d();c();l();u();function Pr(e){return{contains:"=",differentThan:"<>",fuzzyMatch:"~=",greaterThan:">",greaterThanOrEqual:">=",isExactly:"==",lowerThan:"<",lowerThanOrEqual:"<=",phoneticMatch:"%=",regexMatch:"/=",wildcardMatch:"*="}[e]}function Pk(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Pr(e.operator);return`${bt(e)}@${t}${n}${r}`}}}d();c();l();u();function kk(e){return{toQuerySyntax(){let t=bt(e),{field:r,from:n,to:o}=e,a=Pr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function Ok(e){return{toQuerySyntax(){let t=bt(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function Nk(e){return{toQuerySyntax(){let t=bt(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function _k(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function Dk(e){return{toQuerySyntax(){let t=bt(e),{startTerm:r,otherTerms:n}=e,o=A$(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function A$(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function qk(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=bt(e),o=Pr(e.operator);return`${n}@${t}${o}${r}`}}}d();c();l();u();function Mk(e){return{toQuerySyntax(){let t=bt(e),{field:r,from:n,to:o}=e,a=Pr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function jk(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=C$(r);return`$${t}(${n})`}}}function C$(e){return Object.entries(e).map(t=>{let[r,n]=t,o=typeof n=="string"?n:n.toQuerySyntax();return`${r}: ${o}`}).join(", ")}d();c();l();u();function Vk(e){return{toQuerySyntax(){let t=bt(e),{field:r,operator:n,value:o}=e,a=Pr(n),i=n==="fuzzyMatch"?` $quoteVar(value: ${o})`:`("${o}")`;return`${t}@${r}${a}${i}`}}}d();c();l();u();function Lk(e){return{toQuerySyntax(){let{field:t}=e,r=bt(e),n=Pr(e.operator),o=e.values.map(i=>`"${i}"`),a=o.length===1?o[0]:`(${o.join(",")})`;return`${r}@${t}${n}${a}`}}}function b$(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(_k(r)),this},addNear(r){return e.push(Dk(r)),this},addExactMatch(r){return e.push(Ok(r)),this},addFieldExists(r){return e.push(Nk(r)),this},addStringField(r){return e.push(Lk(r)),this},addStringFacetField(r){return e.push(Vk(r)),this},addNumericField(r){return e.push(qk(r)),this},addNumericRangeField(r){return e.push(Mk(r)),this},addDateField(r){return e.push(Pk(r)),this},addDateRangeField(r){return e.push(kk(r)),this},addQueryExtension(r){return e.push(jk(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=R$(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function R$(e){return e==="and"?"AND":"OR"}/**
49
49
  * @license
50
50
  *
51
51
  * Copyright 2026 Coveo Solutions Inc.
@@ -78,4 +78,4 @@ fast-json-patch/module/duplex.mjs:
78
78
  *)
79
79
  */if(__exports!=exports)module.exports=exports;return module.exports});
80
80
 
81
- window.coveoQuanticVersion = '3.36.7';
81
+ window.coveoQuanticVersion = '3.36.9';