algoliasearch 5.8.1 → 5.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/builds/browser.ts +69 -20
- package/builds/fetch.ts +69 -20
- package/builds/models.ts +65 -18
- package/builds/node.ts +69 -20
- package/dist/algoliasearch.umd.js +15 -8
- package/dist/browser.d.ts +32 -21
- package/dist/browser.js +53 -6
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/fetch.d.ts +32 -21
- package/dist/fetch.js +53 -6
- package/dist/fetch.js.map +1 -1
- package/dist/lite/browser.d.ts +12 -8
- package/dist/lite/builds/browser.js +1 -1
- package/dist/lite/builds/browser.js.map +1 -1
- package/dist/lite/builds/browser.min.js +1 -1
- package/dist/lite/builds/browser.min.js.map +1 -1
- package/dist/lite/builds/browser.umd.js +1 -1
- package/dist/lite/builds/node.cjs +1 -1
- package/dist/lite/builds/node.cjs.map +1 -1
- package/dist/lite/builds/node.js +1 -1
- package/dist/lite/builds/node.js.map +1 -1
- package/dist/lite/node.d.cts +12 -8
- package/dist/lite/node.d.ts +12 -8
- package/dist/lite/src/liteClient.cjs +1 -1
- package/dist/lite/src/liteClient.cjs.map +1 -1
- package/dist/lite/src/liteClient.js +1 -1
- package/dist/lite/src/liteClient.js.map +1 -1
- package/dist/node.cjs +52 -9
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +32 -21
- package/dist/node.d.ts +32 -21
- package/dist/node.js +53 -6
- package/dist/node.js.map +1 -1
- package/lite/model/baseGetApiKeyResponse.ts +1 -1
- package/lite/model/baseIndexSettings.ts +2 -2
- package/lite/model/baseRecommendIndexSettings.ts +1 -1
- package/lite/model/baseSearchResponse.ts +5 -0
- package/lite/model/indexSettingsAsSearchParams.ts +1 -1
- package/lite/model/recommendHit.ts +1 -1
- package/lite/model/trendingFacetHit.ts +1 -1
- package/lite/src/liteClient.ts +1 -1
- package/package.json +18 -14
package/dist/browser.js
CHANGED
|
@@ -19,30 +19,48 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
19
19
|
// builds/browser.ts
|
|
20
20
|
var browser_exports = {};
|
|
21
21
|
__export(browser_exports, {
|
|
22
|
+
EventType: () => EventType,
|
|
23
|
+
Status: () => Status,
|
|
22
24
|
algoliasearch: () => algoliasearch,
|
|
23
25
|
apiClientVersion: () => apiClientVersion
|
|
24
26
|
});
|
|
27
|
+
import { searchClient } from "@algolia/client-search";
|
|
25
28
|
import { abtestingClient } from "@algolia/client-abtesting";
|
|
26
29
|
import { analyticsClient } from "@algolia/client-analytics";
|
|
30
|
+
import { insightsClient } from "@algolia/client-insights";
|
|
27
31
|
import { personalizationClient } from "@algolia/client-personalization";
|
|
28
|
-
import {
|
|
32
|
+
import { querySuggestionsClient } from "@algolia/client-query-suggestions";
|
|
33
|
+
import { ingestionClient } from "@algolia/ingestion";
|
|
34
|
+
import { monitoringClient } from "@algolia/monitoring";
|
|
29
35
|
import { recommendClient } from "@algolia/recommend";
|
|
30
36
|
|
|
31
37
|
// builds/models.ts
|
|
32
38
|
var models_exports = {};
|
|
33
39
|
__export(models_exports, {
|
|
40
|
+
EventType: () => EventType,
|
|
41
|
+
Status: () => Status,
|
|
34
42
|
apiClientVersion: () => apiClientVersion
|
|
35
43
|
});
|
|
36
44
|
__reExport(models_exports, client_abtesting_star);
|
|
37
45
|
__reExport(models_exports, client_analytics_star);
|
|
46
|
+
__reExport(models_exports, client_insights_star);
|
|
38
47
|
__reExport(models_exports, client_personalization_star);
|
|
48
|
+
__reExport(models_exports, client_query_suggestions_star);
|
|
39
49
|
__reExport(models_exports, client_search_star);
|
|
50
|
+
__reExport(models_exports, ingestion_star);
|
|
51
|
+
__reExport(models_exports, monitoring_star);
|
|
40
52
|
__reExport(models_exports, recommend_star);
|
|
53
|
+
import { Status } from "@algolia/client-abtesting";
|
|
54
|
+
import { EventType } from "@algolia/client-personalization";
|
|
41
55
|
import { apiClientVersion } from "@algolia/client-search";
|
|
42
56
|
import * as client_abtesting_star from "@algolia/client-abtesting";
|
|
43
57
|
import * as client_analytics_star from "@algolia/client-analytics";
|
|
58
|
+
import * as client_insights_star from "@algolia/client-insights";
|
|
44
59
|
import * as client_personalization_star from "@algolia/client-personalization";
|
|
60
|
+
import * as client_query_suggestions_star from "@algolia/client-query-suggestions";
|
|
45
61
|
import * as client_search_star from "@algolia/client-search";
|
|
62
|
+
import * as ingestion_star from "@algolia/ingestion";
|
|
63
|
+
import * as monitoring_star from "@algolia/monitoring";
|
|
46
64
|
import * as recommend_star from "@algolia/recommend";
|
|
47
65
|
|
|
48
66
|
// builds/browser.ts
|
|
@@ -63,10 +81,15 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
63
81
|
get _ua() {
|
|
64
82
|
return client.transporter.algoliaAgent.value;
|
|
65
83
|
},
|
|
66
|
-
|
|
67
|
-
return
|
|
84
|
+
initAbtesting: (initOptions) => {
|
|
85
|
+
return abtestingClient(
|
|
86
|
+
initOptions.appId || appId,
|
|
87
|
+
initOptions.apiKey || apiKey,
|
|
88
|
+
initOptions.region,
|
|
89
|
+
initOptions.options
|
|
90
|
+
);
|
|
68
91
|
},
|
|
69
|
-
initAnalytics: (initOptions
|
|
92
|
+
initAnalytics: (initOptions) => {
|
|
70
93
|
return analyticsClient(
|
|
71
94
|
initOptions.appId || appId,
|
|
72
95
|
initOptions.apiKey || apiKey,
|
|
@@ -74,14 +97,25 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
74
97
|
initOptions.options
|
|
75
98
|
);
|
|
76
99
|
},
|
|
77
|
-
|
|
78
|
-
return
|
|
100
|
+
initIngestion: (initOptions) => {
|
|
101
|
+
return ingestionClient(
|
|
79
102
|
initOptions.appId || appId,
|
|
80
103
|
initOptions.apiKey || apiKey,
|
|
81
104
|
initOptions.region,
|
|
82
105
|
initOptions.options
|
|
83
106
|
);
|
|
84
107
|
},
|
|
108
|
+
initInsights: (initOptions) => {
|
|
109
|
+
return insightsClient(
|
|
110
|
+
initOptions.appId || appId,
|
|
111
|
+
initOptions.apiKey || apiKey,
|
|
112
|
+
initOptions.region,
|
|
113
|
+
initOptions.options
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
initMonitoring: (initOptions) => {
|
|
117
|
+
return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
|
118
|
+
},
|
|
85
119
|
initPersonalization: (initOptions) => {
|
|
86
120
|
return personalizationClient(
|
|
87
121
|
initOptions.appId || appId,
|
|
@@ -89,10 +123,23 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
89
123
|
initOptions.region,
|
|
90
124
|
initOptions.options
|
|
91
125
|
);
|
|
126
|
+
},
|
|
127
|
+
initQuerySuggestions: (initOptions) => {
|
|
128
|
+
return querySuggestionsClient(
|
|
129
|
+
initOptions.appId || appId,
|
|
130
|
+
initOptions.apiKey || apiKey,
|
|
131
|
+
initOptions.region,
|
|
132
|
+
initOptions.options
|
|
133
|
+
);
|
|
134
|
+
},
|
|
135
|
+
initRecommend: (initOptions) => {
|
|
136
|
+
return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
|
|
92
137
|
}
|
|
93
138
|
};
|
|
94
139
|
}
|
|
95
140
|
export {
|
|
141
|
+
EventType,
|
|
142
|
+
Status,
|
|
96
143
|
algoliasearch,
|
|
97
144
|
apiClientVersion
|
|
98
145
|
};
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../builds/browser.ts","../builds/models.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport type { SearchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\n\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport { searchClient } from '@algolia/client-search';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type { InitClientOptions, InitClientRegion } from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initRecommend: (initOptions?: InitClientOptions) => RecommendClient;\n initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<AnalyticsRegion>) => AnalyticsClient;\n initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<AbtestingRegion>) => AbtestingClient;\n initPersonalization: (\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ) => PersonalizationClient;\n};\n\nexport function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n const client = searchClient(appId, apiKey, options);\n\n return {\n ...client,\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return client.transporter.algoliaAgent.value;\n },\n initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n\n initAnalytics: (initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient => {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initAbtesting: (initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient => {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initPersonalization: (\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ): PersonalizationClient => {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { Region as AbTestingRegion } from '@algolia/client-abtesting';\nimport type { Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n Banner,\n BannerImage,\n BannerImageUrl,\n BannerLink,\n BaseIndexSettings,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchedGeoLocation,\n MatchLevel,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n Redirect,\n RedirectRuleIndexData,\n RedirectRuleIndexMetadata,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n ReRankingApplyFilter,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TimeRange,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n Widgets,\n} from '@algolia/client-search';\nimport { apiClientVersion } from '@algolia/client-search';\n\ntype Region = AbTestingRegion | AnalyticsRegion;\n\nexport * from '@algolia/client-abtesting';\nexport * from '@algolia/client-analytics';\nexport * from '@algolia/client-personalization';\nexport * from '@algolia/client-search';\nexport * from '@algolia/recommend';\n\nexport {\n AbTestingRegion,\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n AnalyticsRegion,\n Anchoring,\n apiClientVersion,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n Banner,\n BannerImage,\n BannerImageUrl,\n BannerLink,\n BaseIndexSettings,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchedGeoLocation,\n MatchLevel,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n Redirect,\n RedirectRuleIndexData,\n RedirectRuleIndexMetadata,\n RedirectURL,\n Region,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n ReRankingApplyFilter,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TimeRange,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n Widgets,\n};\n\n/**\n * Options forwarded to the client initialized via the `init` method.\n */\nexport type InitClientOptions = Partial<{\n /**\n * App to target with the initialized client, defaults to the `algoliasearch` appId.\n */\n appId: string;\n /**\n * API key of the targeted app ID, defaults to the `algoliasearch` apiKey.\n */\n apiKey: string;\n options: ClientOptions;\n}>;\n\nexport type InitClientRegion<TRegion> = Partial<{\n /**\n * Available regions of the initialized client.\n */\n region: TRegion;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;;;ACbhC;AAAA;AAAA;AAAA;AA0FA;AACA;AACA;AACA;AACA;AARA,SAAS,wBAAwB;AAIjC,uCAAc;AACd,uCAAc;AACd,6CAAc;AACd,oCAAc;AACd,gCAAc;;;AD7Ed,4BAAc;AAWP,SAAS,cAAc,OAAe,QAAgB,SAAwC;AACnG,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,QAAM,SAAS,aAAa,OAAO,QAAQ,OAAO;AAElD,SAAO;AAAA,IACL,GAAG;AAAA;AAAA;AAAA;AAAA,IAIH,IAAI,MAAc;AAChB,aAAO,OAAO,YAAY,aAAa;AAAA,IACzC;AAAA,IACA,eAAe,CAAC,cAAiC,CAAC,MAAuB;AACvE,aAAO,gBAAgB,YAAY,SAAS,OAAO,YAAY,UAAU,QAAQ,YAAY,OAAO;AAAA,IACtG;AAAA,IAEA,eAAe,CAAC,cAAqE,CAAC,MAAuB;AAC3G,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,eAAe,CAAC,cAAqE,CAAC,MAAuB;AAC3G,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,qBAAqB,CACnB,gBAC0B;AAC1B,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../builds/browser.ts","../builds/models.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { SearchClient } from '@algolia/client-search';\nimport { searchClient } from '@algolia/client-search';\n\nimport type { AbtestingClient } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport type { InsightsClient } from '@algolia/client-insights';\nimport { insightsClient } from '@algolia/client-insights';\nimport type { PersonalizationClient } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport type { QuerySuggestionsClient } from '@algolia/client-query-suggestions';\nimport { querySuggestionsClient } from '@algolia/client-query-suggestions';\nimport type { IngestionClient } from '@algolia/ingestion';\nimport { ingestionClient } from '@algolia/ingestion';\nimport type { MonitoringClient } from '@algolia/monitoring';\nimport { monitoringClient } from '@algolia/monitoring';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type {\n AbtestingRegionOptions,\n AnalyticsRegionOptions,\n IngestionRegionOptions,\n InitClientOptions,\n InsightsRegionOptions,\n PersonalizationRegionOptions,\n QuerySuggestionsRegionOptions,\n} from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions) => AbtestingClient;\n initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions) => AnalyticsClient;\n initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions) => IngestionClient;\n initInsights: (initOptions: InitClientOptions & InsightsRegionOptions) => InsightsClient;\n initMonitoring: (initOptions: InitClientOptions) => MonitoringClient;\n initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions) => PersonalizationClient;\n initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions) => QuerySuggestionsClient;\n initRecommend: (initOptions: InitClientOptions) => RecommendClient;\n};\n\nexport function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n const client = searchClient(appId, apiKey, options);\n\n return {\n ...client,\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return client.transporter.algoliaAgent.value;\n },\n\n initAbtesting: (initOptions: InitClientOptions & AbtestingRegionOptions): AbtestingClient => {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initAnalytics: (initOptions: InitClientOptions & AnalyticsRegionOptions): AnalyticsClient => {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initIngestion: (initOptions: InitClientOptions & IngestionRegionOptions): IngestionClient => {\n return ingestionClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initInsights: (initOptions: InitClientOptions & InsightsRegionOptions): InsightsClient => {\n return insightsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initMonitoring: (initOptions: InitClientOptions): MonitoringClient => {\n return monitoringClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n\n initPersonalization: (initOptions: InitClientOptions & PersonalizationRegionOptions): PersonalizationClient => {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initQuerySuggestions: (initOptions: InitClientOptions & QuerySuggestionsRegionOptions): QuerySuggestionsClient => {\n return querySuggestionsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initRecommend: (initOptions: InitClientOptions): RecommendClient => {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { Region as AbtestingRegion, RegionOptions as AbtestingRegionOptions } from '@algolia/client-abtesting';\nimport type { Region as AnalyticsRegion, RegionOptions as AnalyticsRegionOptions } from '@algolia/client-analytics';\nimport type { Region as InsightsRegion, RegionOptions as InsightsRegionOptions } from '@algolia/client-insights';\nimport type { Region as IngestionRegion, RegionOptions as IngestionRegionOptions } from '@algolia/ingestion';\n\nimport type {\n Region as PersonalizationRegion,\n RegionOptions as PersonalizationRegionOptions,\n} from '@algolia/client-personalization';\nimport type {\n Region as QuerySuggestionsRegion,\n RegionOptions as QuerySuggestionsRegionOptions,\n} from '@algolia/client-query-suggestions';\n\nimport { Status } from '@algolia/client-abtesting';\nimport type { ClientOptions } from '@algolia/client-common';\nimport { EventType } from '@algolia/client-personalization';\nimport type {\n Action,\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n Banner,\n BannerImage,\n BannerImageUrl,\n BannerLink,\n BaseIndexSettings,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteSourceProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n FacetStats,\n Facets,\n GetTaskProps,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n Languages,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexData,\n RedirectRuleIndexMetadata,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n Source,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TimeRange,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n Widgets,\n} from '@algolia/client-search';\nimport { apiClientVersion } from '@algolia/client-search';\n\ntype Region =\n | AbtestingRegion\n | AnalyticsRegion\n | IngestionRegion\n | InsightsRegion\n | PersonalizationRegion\n | QuerySuggestionsRegion;\ntype RegionOptions =\n | AbtestingRegionOptions\n | AnalyticsRegionOptions\n | IngestionRegionOptions\n | InsightsRegionOptions\n | PersonalizationRegionOptions\n | QuerySuggestionsRegionOptions;\n\nexport * from '@algolia/client-abtesting';\nexport * from '@algolia/client-analytics';\nexport * from '@algolia/client-insights';\nexport * from '@algolia/client-personalization';\nexport * from '@algolia/client-query-suggestions';\nexport * from '@algolia/client-search';\nexport * from '@algolia/ingestion';\nexport * from '@algolia/monitoring';\nexport * from '@algolia/recommend';\n\nexport {\n AbtestingRegion,\n AbtestingRegionOptions,\n Action,\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n AnalyticsRegion,\n AnalyticsRegionOptions,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n Banner,\n BannerImage,\n BannerImageUrl,\n BannerLink,\n BaseIndexSettings,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteSourceProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n EventType,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n FacetStats,\n Facets,\n GetTaskProps,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n IngestionRegion,\n IngestionRegionOptions,\n InsightsRegion,\n InsightsRegionOptions,\n Languages,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n PersonalizationRegion,\n PersonalizationRegionOptions,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QuerySuggestionsRegion,\n QuerySuggestionsRegionOptions,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexData,\n RedirectRuleIndexMetadata,\n RedirectURL,\n Region,\n RegionOptions,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n Source,\n Status,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TimeRange,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n Widgets,\n apiClientVersion,\n};\n\n/**\n * Options forwarded to the client initialized via the `init` method.\n */\nexport type InitClientOptions = Partial<{\n /**\n * App to target with the initialized client, defaults to the `algoliasearch` appId.\n */\n appId: string;\n /**\n * API key of the targeted app ID, defaults to the `algoliasearch` apiKey.\n */\n apiKey: string;\n options: ClientOptions;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAS,oBAAoB;AAG7B,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB;AAEhC,SAAS,sBAAsB;AAE/B,SAAS,6BAA6B;AAEtC,SAAS,8BAA8B;AAEvC,SAAS,uBAAuB;AAEhC,SAAS,wBAAwB;AAEjC,SAAS,uBAAuB;;;ACrBhC;AAAA;AAAA;AAAA;AAAA;AAAA;AA0HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAlHA,SAAS,cAAc;AAEvB,SAAS,iBAAiB;AAuF1B,SAAS,wBAAwB;AAiBjC,uCAAc;AACd,uCAAc;AACd,sCAAc;AACd,6CAAc;AACd,+CAAc;AACd,oCAAc;AACd,gCAAc;AACd,iCAAc;AACd,gCAAc;;;ADjGd,4BAAc;AAaP,SAAS,cAAc,OAAe,QAAgB,SAAwC;AACnG,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,QAAM,SAAS,aAAa,OAAO,QAAQ,OAAO;AAElD,SAAO;AAAA,IACL,GAAG;AAAA;AAAA;AAAA;AAAA,IAKH,IAAI,MAAc;AAChB,aAAO,OAAO,YAAY,aAAa;AAAA,IACzC;AAAA,IAEA,eAAe,CAAC,gBAA6E;AAC3F,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,eAAe,CAAC,gBAA6E;AAC3F,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,eAAe,CAAC,gBAA6E;AAC3F,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,cAAc,CAAC,gBAA2E;AACxF,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,gBAAgB,CAAC,gBAAqD;AACpE,aAAO,iBAAiB,YAAY,SAAS,OAAO,YAAY,UAAU,QAAQ,YAAY,OAAO;AAAA,IACvG;AAAA,IAEA,qBAAqB,CAAC,gBAAyF;AAC7G,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,sBAAsB,CAAC,gBAA2F;AAChH,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,eAAe,CAAC,gBAAoD;AAClE,aAAO,gBAAgB,YAAY,SAAS,OAAO,YAAY,UAAU,QAAQ,YAAY,OAAO;AAAA,IACtG;AAAA,EACF;AACF;","names":[]}
|
package/dist/browser.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function v(){function i(u){return new Promise(d=>{let m=new XMLHttpRequest;m.open(u.method,u.url,!0),Object.keys(u.headers).forEach(r=>m.setRequestHeader(r,u.headers[r]));let g=(r,e)=>setTimeout(()=>{m.abort(),d({status:0,content:e,isTimedOut:!0})},r),w=g(u.connectTimeout,"Connection timeout"),l;m.onreadystatechange=()=>{m.readyState>m.OPENED&&l===void 0&&(clearTimeout(w),l=g(u.responseTimeout,"Socket timeout"))},m.onerror=()=>{m.status===0&&(clearTimeout(w),clearTimeout(l),d({content:m.responseText||"Network request failed",status:m.status,isTimedOut:!1}))},m.onload=()=>{clearTimeout(w),clearTimeout(l),d({content:m.responseText,status:m.status,isTimedOut:!1})},m.send(u.data)})}return{send:i}}function C(i){let u,d=`algolia-client-js-${i.key}`;function m(){return u===void 0&&(u=i.localStorage||window.localStorage),u}function g(){return JSON.parse(m().getItem(d)||"{}")}function w(r){m().setItem(d,JSON.stringify(r))}function l(){let r=i.timeToLive?i.timeToLive*1e3:null,e=g(),t=Object.fromEntries(Object.entries(e).filter(([,s])=>s.timestamp!==void 0));if(w(t),!r)return;let a=Object.fromEntries(Object.entries(t).filter(([,s])=>{let n=new Date().getTime();return!(s.timestamp+r<n)}));w(a)}return{get(r,e,t={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(l(),g()[JSON.stringify(r)])).then(a=>Promise.all([a?a.value:e(),a!==void 0])).then(([a,s])=>Promise.all([a,s||t.miss(a)])).then(([a])=>a)},set(r,e){return Promise.resolve().then(()=>{let t=g();return t[JSON.stringify(r)]={timestamp:new Date().getTime(),value:e},m().setItem(d,JSON.stringify(t)),e})},delete(r){return Promise.resolve().then(()=>{let e=g();delete e[JSON.stringify(r)],m().setItem(d,JSON.stringify(e))})},clear(){return Promise.resolve().then(()=>{m().removeItem(d)})}}}function de(){return{get(i,u,d={miss:()=>Promise.resolve()}){return u().then(g=>Promise.all([g,d.miss(g)])).then(([g])=>g)},set(i,u){return Promise.resolve(u)},delete(i){return Promise.resolve()},clear(){return Promise.resolve()}}}function R(i){let u=[...i.caches],d=u.shift();return d===void 0?de():{get(m,g,w={miss:()=>Promise.resolve()}){return d.get(m,g,w).catch(()=>R({caches:u}).get(m,g,w))},set(m,g){return d.set(m,g).catch(()=>R({caches:u}).set(m,g))},delete(m){return d.delete(m).catch(()=>R({caches:u}).delete(m))},clear(){return d.clear().catch(()=>R({caches:u}).clear())}}}function E(i={serializable:!0}){let u={};return{get(d,m,g={miss:()=>Promise.resolve()}){let w=JSON.stringify(d);if(w in u)return Promise.resolve(i.serializable?JSON.parse(u[w]):u[w]);let l=m();return l.then(r=>g.miss(r)).then(()=>l)},set(d,m){return u[JSON.stringify(d)]=i.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(d){return delete u[JSON.stringify(d)],Promise.resolve()},clear(){return u={},Promise.resolve()}}}var A=1e3,b=2e3,I=3e4;function me(i){let u={value:`Algolia for JavaScript (${i})`,add(d){let m=`; ${d.segment}${d.version!==void 0?` (${d.version})`:""}`;return u.value.indexOf(m)===-1&&(u.value=`${u.value}${m}`),u}};return u}function x(i,u,d="WithinHeaders"){let m={"x-algolia-api-key":u,"x-algolia-application-id":i};return{headers(){return d==="WithinHeaders"?m:{}},queryParameters(){return d==="WithinQueryParameters"?m:{}}}}function k({func:i,validate:u,aggregator:d,error:m,timeout:g=()=>0}){let w=l=>new Promise((r,e)=>{i(l).then(t=>(d&&d(t),u(t)?r(t):m&&m.validate(t)?e(new Error(m.message(t))):setTimeout(()=>{w(t).then(r).catch(e)},g()))).catch(t=>{e(t)})});return w()}function O({algoliaAgents:i,client:u,version:d}){let m=me(d).add({segment:u,version:d});return i.forEach(g=>m.add(g)),m}function U(){return{debug(i,u){return Promise.resolve()},info(i,u){return Promise.resolve()},error(i,u){return Promise.resolve()}}}var K=2*60*1e3;function J(i,u="up"){let d=Date.now();function m(){return u==="up"||Date.now()-d>K}function g(){return u==="timed out"&&Date.now()-d<=K}return{...i,status:u,lastUpdate:d,isUp:m,isTimedOut:g}}var V=class extends Error{name="AlgoliaError";constructor(i,u){super(i),u&&(this.name=u)}},X=class extends V{stackTrace;constructor(i,u,d){super(i,d),this.stackTrace=u}},ge=class extends X{constructor(i){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",i,"RetryError")}},_=class extends X{status;constructor(i,u,d,m="ApiError"){super(i,d,m),this.status=u}},qe=class extends V{response;constructor(i,u){super(i,"DeserializationError"),this.response=u}},Pe=class extends _{error;constructor(i,u,d,m){super(i,u,m,"DetailedApiError"),this.error=d}};function F(i){let u=i;for(let d=i.length-1;d>0;d--){let m=Math.floor(Math.random()*(d+1)),g=i[d];u[d]=i[m],u[m]=g}return u}function pe(i,u,d){let m=we(d),g=`${i.protocol}://${i.url}${i.port?`:${i.port}`:""}/${u.charAt(0)==="/"?u.substring(1):u}`;return m.length&&(g+=`?${m}`),g}function we(i){return Object.keys(i).filter(u=>i[u]!==void 0).sort().map(u=>`${u}=${encodeURIComponent(Object.prototype.toString.call(i[u])==="[object Array]"?i[u].join(","):i[u]).replace(/\+/g,"%20")}`).join("&")}function fe(i,u){if(i.method==="GET"||i.data===void 0&&u.data===void 0)return;let d=Array.isArray(i.data)?i.data:{...i.data,...u.data};return JSON.stringify(d)}function ye(i,u,d){let m={Accept:"application/json",...i,...u,...d},g={};return Object.keys(m).forEach(w=>{let l=m[w];g[w.toLowerCase()]=l}),g}function Ee(i){try{return JSON.parse(i.content)}catch(u){throw new qe(u.message,i)}}function Se({content:i,status:u},d){try{let m=JSON.parse(i);return"error"in m?new Pe(m.message,u,m.error,d):new _(m.message,u,d)}catch{}return new _(i,u,d)}function Te({isTimedOut:i,status:u}){return!i&&~~u===0}function Re({isTimedOut:i,status:u}){return i||Te({isTimedOut:i,status:u})||~~(u/100)!==2&&~~(u/100)!==4}function ve({status:i}){return~~(i/100)===2}function Ce(i){return i.map(u=>Y(u))}function Y(i){let u=i.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...i,request:{...i.request,headers:{...i.request.headers,...u}}}}function D({hosts:i,hostsCache:u,baseHeaders:d,logger:m,baseQueryParameters:g,algoliaAgent:w,timeouts:l,requester:r,requestsCache:e,responsesCache:t}){async function a(o){let c=await Promise.all(o.map(f=>u.get(f,()=>Promise.resolve(J(f))))),h=c.filter(f=>f.isUp()),q=c.filter(f=>f.isTimedOut()),P=[...h,...q];return{hosts:P.length>0?P:o,getTimeout(f,y){return(q.length===0&&f===0?1:q.length+3+f)*y}}}async function s(o,c,h=!0){let q=[],P=fe(o,c),p=ye(d,o.headers,c.headers),f=o.method==="GET"?{...o.data,...c.data}:{},y={...g,...o.queryParameters,...f};if(w.value&&(y["x-algolia-agent"]=w.value),c&&c.queryParameters)for(let T of Object.keys(c.queryParameters))!c.queryParameters[T]||Object.prototype.toString.call(c.queryParameters[T])==="[object Object]"?y[T]=c.queryParameters[T]:y[T]=c.queryParameters[T].toString();let S=0,B=async(T,G)=>{let j=T.pop();if(j===void 0)throw new ge(Ce(q));let L={...l,...c.timeouts},H={data:P,headers:p,method:o.method,url:pe(j,o.path,y),connectTimeout:G(S,L.connect),responseTimeout:G(S,h?L.read:L.write)},M=W=>{let Q={request:H,response:W,host:j,triesLeft:T.length};return q.push(Q),Q},N=await r.send(H);if(Re(N)){let W=M(N);return N.isTimedOut&&S++,m.info("Retryable failure",Y(W)),await u.set(j,J(j,N.isTimedOut?"timed out":"down")),B(T,G)}if(ve(N))return Ee(N);throw M(N),Se(N,q)},le=i.filter(T=>T.accept==="readWrite"||(h?T.accept==="read":T.accept==="write")),z=await a(le);return B([...z.hosts].reverse(),z.getTimeout)}function n(o,c={}){let h=o.useReadTransporter||o.method==="GET";if(!h)return s(o,c,h);let q=()=>s(o,c);if((c.cacheable||o.cacheable)!==!0)return q();let p={request:o,requestOptions:c,transporter:{queryParameters:g,headers:d}};return t.get(p,()=>e.get(p,()=>e.set(p,q()).then(f=>Promise.all([e.delete(p),f]),f=>Promise.all([e.delete(p),Promise.reject(f)])).then(([f,y])=>y)),{miss:f=>t.set(p,f)})}return{hostsCache:u,requester:r,timeouts:l,logger:m,algoliaAgent:w,baseHeaders:d,baseQueryParameters:g,hosts:i,request:n,requestsCache:e,responsesCache:t}}var ee="5.8.1",Z=["de","us"];function Ae(i){return[{url:i?"analytics.{region}.algolia.com".replace("{region}",i):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function be({appId:i,apiKey:u,authMode:d,algoliaAgents:m,region:g,...w}){let l=x(i,u,d),r=D({hosts:Ae(g),...w,algoliaAgent:O({algoliaAgents:m,client:"Abtesting",version:ee}),baseHeaders:{"content-type":"text/plain",...l.headers(),...w.baseHeaders},baseQueryParameters:{...l.queryParameters(),...w.baseQueryParameters}});return{transporter:r,appId:i,clearCache(){return Promise.all([r.requestsCache.clear(),r.responsesCache.clear()]).then(()=>{})},get _ua(){return r.algoliaAgent.value},addAlgoliaAgent(e,t){r.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?r.baseHeaders["x-algolia-api-key"]=e:r.baseQueryParameters["x-algolia-api-key"]=e},addABTests(e,t){if(!e)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!e.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");let o={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e};return r.request(o,t)},customDelete({path:e,parameters:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let c={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return r.request(c,a)},customGet({path:e,parameters:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let c={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return r.request(c,a)},customPost({path:e,parameters:t,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:a||{}};return r.request(h,s)},customPut({path:e,parameters:t,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:a||{}};return r.request(h,s)},deleteABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let o={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return r.request(o,t)},getABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");let o={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return r.request(o,t)},listABTests({offset:e,limit:t,indexPrefix:a,indexSuffix:s}={},n=void 0){let o="/2/abtests",c={},h={};e!==void 0&&(h.offset=e.toString()),t!==void 0&&(h.limit=t.toString()),a!==void 0&&(h.indexPrefix=a.toString()),s!==void 0&&(h.indexSuffix=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},scheduleABTest(e,t){if(!e)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!e.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!e.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!e.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!e.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");let o={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:e};return r.request(o,t)},stopABTest({id:e},t){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");let o={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return r.request(o,t)}}}function re(i,u,d,m){if(!i||typeof i!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(d&&(typeof d!="string"||!Z.includes(d)))throw new Error(`\`region\` must be one of the following: ${Z.join(", ")}`);return be({appId:i,apiKey:u,region:d,timeouts:{connect:A,read:b,write:I},logger:U(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:R({caches:[C({key:`${ee}-${i}`}),E()]}),...m})}var ae="5.8.1",te=["de","us"];function Ie(i){return[{url:i?"analytics.{region}.algolia.com".replace("{region}",i):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function xe({appId:i,apiKey:u,authMode:d,algoliaAgents:m,region:g,...w}){let l=x(i,u,d),r=D({hosts:Ie(g),...w,algoliaAgent:O({algoliaAgents:m,client:"Analytics",version:ae}),baseHeaders:{"content-type":"text/plain",...l.headers(),...w.baseHeaders},baseQueryParameters:{...l.queryParameters(),...w.baseQueryParameters}});return{transporter:r,appId:i,clearCache(){return Promise.all([r.requestsCache.clear(),r.responsesCache.clear()]).then(()=>{})},get _ua(){return r.algoliaAgent.value},addAlgoliaAgent(e,t){r.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?r.baseHeaders["x-algolia-api-key"]=e:r.baseQueryParameters["x-algolia-api-key"]=e},customDelete({path:e,parameters:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let c={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return r.request(c,a)},customGet({path:e,parameters:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let c={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return r.request(c,a)},customPost({path:e,parameters:t,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:a||{}};return r.request(h,s)},customPut({path:e,parameters:t,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:a||{}};return r.request(h,s)},getAddToCartRate({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");let o="/2/conversions/addToCartRate",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getAverageClickPosition({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");let o="/2/clicks/averageClickPosition",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getClickPositions({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");let o="/2/clicks/positions",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getClickThroughRate({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");let o="/2/clicks/clickThroughRate",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getConversionRate({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getConversionRate`.");let o="/2/conversions/conversionRate",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getNoClickRate({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");let o="/2/searches/noClickRate",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getNoResultsRate({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");let o="/2/searches/noResultRate",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getPurchaseRate({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");let o="/2/conversions/purchaseRate",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getRevenue({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getRevenue`.");let o="/2/conversions/revenue",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getSearchesCount({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");let o="/2/searches/count",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)},getSearchesNoClicks({index:e,startDate:t,endDate:a,limit:s,offset:n,tags:o},c){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");let h="/2/searches/noClicks",q={},P={};e!==void 0&&(P.index=e.toString()),t!==void 0&&(P.startDate=t.toString()),a!==void 0&&(P.endDate=a.toString()),s!==void 0&&(P.limit=s.toString()),n!==void 0&&(P.offset=n.toString()),o!==void 0&&(P.tags=o.toString());let p={method:"GET",path:h,queryParameters:P,headers:q};return r.request(p,c)},getSearchesNoResults({index:e,startDate:t,endDate:a,limit:s,offset:n,tags:o},c){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");let h="/2/searches/noResults",q={},P={};e!==void 0&&(P.index=e.toString()),t!==void 0&&(P.startDate=t.toString()),a!==void 0&&(P.endDate=a.toString()),s!==void 0&&(P.limit=s.toString()),n!==void 0&&(P.offset=n.toString()),o!==void 0&&(P.tags=o.toString());let p={method:"GET",path:h,queryParameters:P,headers:q};return r.request(p,c)},getStatus({index:e},t){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");let a="/2/status",s={},n={};e!==void 0&&(n.index=e.toString());let o={method:"GET",path:a,queryParameters:n,headers:s};return r.request(o,t)},getTopCountries({index:e,startDate:t,endDate:a,limit:s,offset:n,tags:o},c){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");let h="/2/countries",q={},P={};e!==void 0&&(P.index=e.toString()),t!==void 0&&(P.startDate=t.toString()),a!==void 0&&(P.endDate=a.toString()),s!==void 0&&(P.limit=s.toString()),n!==void 0&&(P.offset=n.toString()),o!==void 0&&(P.tags=o.toString());let p={method:"GET",path:h,queryParameters:P,headers:q};return r.request(p,c)},getTopFilterAttributes({index:e,search:t,startDate:a,endDate:s,limit:n,offset:o,tags:c},h){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");let q="/2/filters",P={},p={};e!==void 0&&(p.index=e.toString()),t!==void 0&&(p.search=t.toString()),a!==void 0&&(p.startDate=a.toString()),s!==void 0&&(p.endDate=s.toString()),n!==void 0&&(p.limit=n.toString()),o!==void 0&&(p.offset=o.toString()),c!==void 0&&(p.tags=c.toString());let f={method:"GET",path:q,queryParameters:p,headers:P};return r.request(f,h)},getTopFilterForAttribute({attribute:e,index:t,search:a,startDate:s,endDate:n,limit:o,offset:c,tags:h},q){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!t)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");let P="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),p={},f={};t!==void 0&&(f.index=t.toString()),a!==void 0&&(f.search=a.toString()),s!==void 0&&(f.startDate=s.toString()),n!==void 0&&(f.endDate=n.toString()),o!==void 0&&(f.limit=o.toString()),c!==void 0&&(f.offset=c.toString()),h!==void 0&&(f.tags=h.toString());let y={method:"GET",path:P,queryParameters:f,headers:p};return r.request(y,q)},getTopFiltersNoResults({index:e,search:t,startDate:a,endDate:s,limit:n,offset:o,tags:c},h){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");let q="/2/filters/noResults",P={},p={};e!==void 0&&(p.index=e.toString()),t!==void 0&&(p.search=t.toString()),a!==void 0&&(p.startDate=a.toString()),s!==void 0&&(p.endDate=s.toString()),n!==void 0&&(p.limit=n.toString()),o!==void 0&&(p.offset=o.toString()),c!==void 0&&(p.tags=c.toString());let f={method:"GET",path:q,queryParameters:p,headers:P};return r.request(f,h)},getTopHits({index:e,search:t,clickAnalytics:a,revenueAnalytics:s,startDate:n,endDate:o,limit:c,offset:h,tags:q},P){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");let p="/2/hits",f={},y={};e!==void 0&&(y.index=e.toString()),t!==void 0&&(y.search=t.toString()),a!==void 0&&(y.clickAnalytics=a.toString()),s!==void 0&&(y.revenueAnalytics=s.toString()),n!==void 0&&(y.startDate=n.toString()),o!==void 0&&(y.endDate=o.toString()),c!==void 0&&(y.limit=c.toString()),h!==void 0&&(y.offset=h.toString()),q!==void 0&&(y.tags=q.toString());let S={method:"GET",path:p,queryParameters:y,headers:f};return r.request(S,P)},getTopSearches({index:e,clickAnalytics:t,revenueAnalytics:a,startDate:s,endDate:n,orderBy:o,direction:c,limit:h,offset:q,tags:P},p){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");let f="/2/searches",y={},S={};e!==void 0&&(S.index=e.toString()),t!==void 0&&(S.clickAnalytics=t.toString()),a!==void 0&&(S.revenueAnalytics=a.toString()),s!==void 0&&(S.startDate=s.toString()),n!==void 0&&(S.endDate=n.toString()),o!==void 0&&(S.orderBy=o.toString()),c!==void 0&&(S.direction=c.toString()),h!==void 0&&(S.limit=h.toString()),q!==void 0&&(S.offset=q.toString()),P!==void 0&&(S.tags=P.toString());let B={method:"GET",path:f,queryParameters:S,headers:y};return r.request(B,p)},getUsersCount({index:e,startDate:t,endDate:a,tags:s},n){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");let o="/2/users/count",c={},h={};e!==void 0&&(h.index=e.toString()),t!==void 0&&(h.startDate=t.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let q={method:"GET",path:o,queryParameters:h,headers:c};return r.request(q,n)}}}function se(i,u,d,m){if(!i||typeof i!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(d&&(typeof d!="string"||!te.includes(d)))throw new Error(`\`region\` must be one of the following: ${te.join(", ")}`);return xe({appId:i,apiKey:u,region:d,timeouts:{connect:A,read:b,write:I},logger:U(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:R({caches:[C({key:`${ae}-${i}`}),E()]}),...m})}var oe="5.8.1",ne=["eu","us"];function Oe(i){return[{url:"personalization.{region}.algolia.com".replace("{region}",i),accept:"readWrite",protocol:"https"}]}function Ue({appId:i,apiKey:u,authMode:d,algoliaAgents:m,region:g,...w}){let l=x(i,u,d),r=D({hosts:Oe(g),...w,algoliaAgent:O({algoliaAgents:m,client:"Personalization",version:oe}),baseHeaders:{"content-type":"text/plain",...l.headers(),...w.baseHeaders},baseQueryParameters:{...l.queryParameters(),...w.baseQueryParameters}});return{transporter:r,appId:i,clearCache(){return Promise.all([r.requestsCache.clear(),r.responsesCache.clear()]).then(()=>{})},get _ua(){return r.algoliaAgent.value},addAlgoliaAgent(e,t){r.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?r.baseHeaders["x-algolia-api-key"]=e:r.baseQueryParameters["x-algolia-api-key"]=e},customDelete({path:e,parameters:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let c={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return r.request(c,a)},customGet({path:e,parameters:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let c={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return r.request(c,a)},customPost({path:e,parameters:t,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:a||{}};return r.request(h,s)},customPut({path:e,parameters:t,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:a||{}};return r.request(h,s)},deleteUserProfile({userToken:e},t){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserProfile`.");let o={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return r.request(o,t)},getPersonalizationStrategy(e){let n={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return r.request(n,e)},getUserTokenProfile({userToken:e},t){if(!e)throw new Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");let o={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return r.request(o,t)},setPersonalizationStrategy(e,t){if(!e)throw new Error("Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.");if(!e.eventScoring)throw new Error("Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.");if(!e.facetScoring)throw new Error("Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.");if(!e.personalizationImpact)throw new Error("Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.");let o={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:e};return r.request(o,t)}}}function ie(i,u,d,m){if(!i||typeof i!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!ne.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${ne.join(", ")}`);return Ue({appId:i,apiKey:u,region:d,timeouts:{connect:A,read:b,write:I},logger:U(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:R({caches:[C({key:`${oe}-${i}`}),E()]}),...m})}var $="5.8.1";function De(i){return[{url:`${i}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${i}.algolia.net`,accept:"write",protocol:"https"}].concat(F([{url:`${i}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${i}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${i}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function Ne({appId:i,apiKey:u,authMode:d,algoliaAgents:m,...g}){let w=x(i,u,d),l=D({hosts:De(i),...g,algoliaAgent:O({algoliaAgents:m,client:"Search",version:$}),baseHeaders:{"content-type":"text/plain",...w.headers(),...g.baseHeaders},baseQueryParameters:{...w.queryParameters(),...g.baseQueryParameters}});return{transporter:l,appId:i,clearCache(){return Promise.all([l.requestsCache.clear(),l.responsesCache.clear()]).then(()=>{})},get _ua(){return l.algoliaAgent.value},addAlgoliaAgent(r,e){l.algoliaAgent.add({segment:r,version:e})},setClientApiKey({apiKey:r}){!d||d==="WithinHeaders"?l.baseHeaders["x-algolia-api-key"]=r:l.baseQueryParameters["x-algolia-api-key"]=r},waitForTask({indexName:r,taskID:e,maxRetries:t=50,timeout:a=n=>Math.min(n*200,5e3)},s){let n=0;return k({func:()=>this.getTask({indexName:r,taskID:e},s),validate:o=>o.status==="published",aggregator:()=>n+=1,error:{validate:()=>n>=t,message:()=>`The maximum number of retries exceeded. (${n}/${t})`},timeout:()=>a(n)})},waitForAppTask({taskID:r,maxRetries:e=50,timeout:t=s=>Math.min(s*200,5e3)},a){let s=0;return k({func:()=>this.getAppTask({taskID:r},a),validate:n=>n.status==="published",aggregator:()=>s+=1,error:{validate:()=>s>=e,message:()=>`The maximum number of retries exceeded. (${s}/${e})`},timeout:()=>t(s)})},waitForApiKey({operation:r,key:e,apiKey:t,maxRetries:a=50,timeout:s=o=>Math.min(o*200,5e3)},n){let o=0,c={aggregator:()=>o+=1,error:{validate:()=>o>=a,message:()=>`The maximum number of retries exceeded. (${o}/${a})`},timeout:()=>s(o)};if(r==="update"){if(!t)throw new Error("`apiKey` is required when waiting for an `update` operation.");return k({...c,func:()=>this.getApiKey({key:e},n),validate:h=>{for(let q of Object.keys(t)){let P=t[q],p=h[q];if(Array.isArray(P)&&Array.isArray(p)){if(P.length!==p.length||P.some((f,y)=>f!==p[y]))return!1}else if(P!==p)return!1}return!0}})}return k({...c,func:()=>this.getApiKey({key:e},n).catch(h=>{if(h.status!==404)throw h}),validate:h=>r==="add"?h!==void 0:h===void 0})},browseObjects({indexName:r,browseParams:e,...t},a){return k({func:s=>this.browse({indexName:r,browseParams:{cursor:s?s.cursor:void 0,...e}},a),validate:s=>s.cursor===void 0,...t})},browseRules({indexName:r,searchRulesParams:e,...t},a){let s={hitsPerPage:1e3,...e};return k({func:n=>this.searchRules({indexName:r,searchRulesParams:{...s,page:n?n.page+1:s.page||0}},a),validate:n=>n.nbHits<s.hitsPerPage,...t})},browseSynonyms({indexName:r,searchSynonymsParams:e,...t},a){let s={page:0,...e,hitsPerPage:1e3};return k({func:n=>{let o=this.searchSynonyms({indexName:r,searchSynonymsParams:{...s,page:s.page}},a);return s.page+=1,o},validate:n=>n.nbHits<s.hitsPerPage,...t})},async chunkedBatch({indexName:r,objects:e,action:t="addObject",waitForTasks:a,batchSize:s=1e3},n){let o=[],c=[],h=e.entries();for(let[q,P]of h)o.push({action:t,body:P}),(o.length===s||q===e.length-1)&&(c.push(await this.batch({indexName:r,batchWriteParams:{requests:o}},n)),o=[]);if(a)for(let q of c)await this.waitForTask({indexName:r,taskID:q.taskID});return c},async saveObjects({indexName:r,objects:e},t){return await this.chunkedBatch({indexName:r,objects:e,action:"addObject"},t)},async deleteObjects({indexName:r,objectIDs:e},t){return await this.chunkedBatch({indexName:r,objects:e.map(a=>({objectID:a})),action:"deleteObject"},t)},async partialUpdateObjects({indexName:r,objects:e,createIfNotExists:t},a){return await this.chunkedBatch({indexName:r,objects:e,action:t?"partialUpdateObject":"partialUpdateObjectNoCreate"},a)},async replaceAllObjects({indexName:r,objects:e,batchSize:t},a){let s=Math.floor(Math.random()*1e6)+1e5,n=`${r}_tmp_${s}`,o=await this.operationIndex({indexName:r,operationIndexParams:{operation:"copy",destination:n,scope:["settings","rules","synonyms"]}},a),c=await this.chunkedBatch({indexName:n,objects:e,waitForTasks:!0,batchSize:t},a);await this.waitForTask({indexName:n,taskID:o.taskID}),o=await this.operationIndex({indexName:r,operationIndexParams:{operation:"copy",destination:n,scope:["settings","rules","synonyms"]}},a),await this.waitForTask({indexName:n,taskID:o.taskID});let h=await this.operationIndex({indexName:n,operationIndexParams:{operation:"move",destination:r}},a);return await this.waitForTask({indexName:n,taskID:h.taskID}),{copyOperationResponse:o,batchResponses:c,moveOperationResponse:h}},async indexExists({indexName:r}){try{await this.getSettings({indexName:r})}catch(e){if(e instanceof _&&e.status===404)return!1;throw e}return!0},searchForHits(r,e){return this.search(r,e)},searchForFacets(r,e){return this.search(r,e)},addApiKey(r,e){if(!r)throw new Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!r.acl)throw new Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");let n={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:r};return l.request(n,e)},addOrUpdateObject({indexName:r,objectID:e,body:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!t)throw new Error("Parameter `body` is required when calling `addOrUpdateObject`.");let c={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return l.request(c,a)},appendSource(r,e){if(!r)throw new Error("Parameter `source` is required when calling `appendSource`.");if(!r.source)throw new Error("Parameter `source.source` is required when calling `appendSource`.");let n={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:r};return l.request(n,e)},assignUserId({xAlgoliaUserID:r,assignUserIdParams:e},t){if(!r)throw new Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!e)throw new Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!e.cluster)throw new Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");let a="/1/clusters/mapping",s={},n={};r!==void 0&&(s["X-Algolia-User-ID"]=r.toString());let o={method:"POST",path:a,queryParameters:n,headers:s,data:e};return l.request(o,t)},batch({indexName:r,batchWriteParams:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `batch`.");if(!e)throw new Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!e.requests)throw new Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");let o={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e};return l.request(o,t)},batchAssignUserIds({xAlgoliaUserID:r,batchAssignUserIdsParams:e},t){if(!r)throw new Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!e)throw new Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!e.cluster)throw new Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!e.users)throw new Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");let a="/1/clusters/mapping/batch",s={},n={};r!==void 0&&(s["X-Algolia-User-ID"]=r.toString());let o={method:"POST",path:a,queryParameters:n,headers:s,data:e};return l.request(o,t)},batchDictionaryEntries({dictionaryName:r,batchDictionaryEntriesParams:e},t){if(!r)throw new Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!e)throw new Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!e.requests)throw new Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");let o={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e};return l.request(o,t)},browse({indexName:r,browseParams:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `browse`.");let o={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e||{},useReadTransporter:!0};return l.request(o,t)},clearObjects({indexName:r},e){if(!r)throw new Error("Parameter `indexName` is required when calling `clearObjects`.");let n={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},clearRules({indexName:r,forwardToReplicas:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `clearRules`.");let a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(r)),s={},n={};e!==void 0&&(n.forwardToReplicas=e.toString());let o={method:"POST",path:a,queryParameters:n,headers:s};return l.request(o,t)},clearSynonyms({indexName:r,forwardToReplicas:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `clearSynonyms`.");let a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(r)),s={},n={};e!==void 0&&(n.forwardToReplicas=e.toString());let o={method:"POST",path:a,queryParameters:n,headers:s};return l.request(o,t)},customDelete({path:r,parameters:e},t){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");let o={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:e||{},headers:{}};return l.request(o,t)},customGet({path:r,parameters:e},t){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");let o={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:e||{},headers:{}};return l.request(o,t)},customPost({path:r,parameters:e,body:t},a){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");let c={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:e||{},headers:{},data:t||{}};return l.request(c,a)},customPut({path:r,parameters:e,body:t},a){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");let c={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:e||{},headers:{},data:t||{}};return l.request(c,a)},deleteApiKey({key:r},e){if(!r)throw new Error("Parameter `key` is required when calling `deleteApiKey`.");let n={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},deleteBy({indexName:r,deleteByParams:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `deleteBy`.");if(!e)throw new Error("Parameter `deleteByParams` is required when calling `deleteBy`.");let o={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e};return l.request(o,t)},deleteIndex({indexName:r},e){if(!r)throw new Error("Parameter `indexName` is required when calling `deleteIndex`.");let n={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},deleteObject({indexName:r,objectID:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `deleteObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteObject`.");let o={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(o,t)},deleteRule({indexName:r,objectID:e,forwardToReplicas:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `deleteRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteRule`.");let s="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),n={},o={};t!==void 0&&(o.forwardToReplicas=t.toString());let c={method:"DELETE",path:s,queryParameters:o,headers:n};return l.request(c,a)},deleteSource({source:r},e){if(!r)throw new Error("Parameter `source` is required when calling `deleteSource`.");let n={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},deleteSynonym({indexName:r,objectID:e,forwardToReplicas:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteSynonym`.");let s="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),n={},o={};t!==void 0&&(o.forwardToReplicas=t.toString());let c={method:"DELETE",path:s,queryParameters:o,headers:n};return l.request(c,a)},getApiKey({key:r},e){if(!r)throw new Error("Parameter `key` is required when calling `getApiKey`.");let n={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},getAppTask({taskID:r},e){if(!r)throw new Error("Parameter `taskID` is required when calling `getAppTask`.");let n={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},getDictionaryLanguages(r){let s={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return l.request(s,r)},getDictionarySettings(r){let s={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return l.request(s,r)},getLogs({offset:r,length:e,indexName:t,type:a}={},s=void 0){let n="/1/logs",o={},c={};r!==void 0&&(c.offset=r.toString()),e!==void 0&&(c.length=e.toString()),t!==void 0&&(c.indexName=t.toString()),a!==void 0&&(c.type=a.toString());let h={method:"GET",path:n,queryParameters:c,headers:o};return l.request(h,s)},getObject({indexName:r,objectID:e,attributesToRetrieve:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `getObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getObject`.");let s="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),n={},o={};t!==void 0&&(o.attributesToRetrieve=t.toString());let c={method:"GET",path:s,queryParameters:o,headers:n};return l.request(c,a)},getObjects(r,e){if(!r)throw new Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!r.requests)throw new Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");let n={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return l.request(n,e)},getRule({indexName:r,objectID:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `getRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getRule`.");let o={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(o,t)},getSettings({indexName:r},e){if(!r)throw new Error("Parameter `indexName` is required when calling `getSettings`.");let n={method:"GET",path:"/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},getSources(r){let s={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return l.request(s,r)},getSynonym({indexName:r,objectID:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `getSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getSynonym`.");let o={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(o,t)},getTask({indexName:r,taskID:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `getTask`.");if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let o={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(r)).replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(o,t)},getTopUserIds(r){let s={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return l.request(s,r)},getUserId({userID:r},e){if(!r)throw new Error("Parameter `userID` is required when calling `getUserId`.");let n={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},hasPendingMappings({getClusters:r}={},e=void 0){let t="/1/clusters/mapping/pending",a={},s={};r!==void 0&&(s.getClusters=r.toString());let n={method:"GET",path:t,queryParameters:s,headers:a};return l.request(n,e)},listApiKeys(r){let s={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return l.request(s,r)},listClusters(r){let s={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return l.request(s,r)},listIndices({page:r,hitsPerPage:e}={},t=void 0){let a="/1/indexes",s={},n={};r!==void 0&&(n.page=r.toString()),e!==void 0&&(n.hitsPerPage=e.toString());let o={method:"GET",path:a,queryParameters:n,headers:s};return l.request(o,t)},listUserIds({page:r,hitsPerPage:e}={},t=void 0){let a="/1/clusters/mapping",s={},n={};r!==void 0&&(n.page=r.toString()),e!==void 0&&(n.hitsPerPage=e.toString());let o={method:"GET",path:a,queryParameters:n,headers:s};return l.request(o,t)},multipleBatch(r,e){if(!r)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!r.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");let n={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:r};return l.request(n,e)},operationIndex({indexName:r,operationIndexParams:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `operationIndex`.");if(!e)throw new Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!e.operation)throw new Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!e.destination)throw new Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");let o={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e};return l.request(o,t)},partialUpdateObject({indexName:r,objectID:e,attributesToUpdate:t,createIfNotExists:a},s){if(!r)throw new Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!t)throw new Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");let n="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),o={},c={};a!==void 0&&(c.createIfNotExists=a.toString());let h={method:"POST",path:n,queryParameters:c,headers:o,data:t};return l.request(h,s)},removeUserId({userID:r},e){if(!r)throw new Error("Parameter `userID` is required when calling `removeUserId`.");let n={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},replaceSources({source:r},e){if(!r)throw new Error("Parameter `source` is required when calling `replaceSources`.");let n={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:r};return l.request(n,e)},restoreApiKey({key:r},e){if(!r)throw new Error("Parameter `key` is required when calling `restoreApiKey`.");let n={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(n,e)},saveObject({indexName:r,body:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `saveObject`.");if(!e)throw new Error("Parameter `body` is required when calling `saveObject`.");let o={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e};return l.request(o,t)},saveRule({indexName:r,objectID:e,rule:t,forwardToReplicas:a},s){if(!r)throw new Error("Parameter `indexName` is required when calling `saveRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `saveRule`.");if(!t)throw new Error("Parameter `rule` is required when calling `saveRule`.");if(!t.objectID)throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");let n="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),o={},c={};a!==void 0&&(c.forwardToReplicas=a.toString());let h={method:"PUT",path:n,queryParameters:c,headers:o,data:t};return l.request(h,s)},saveRules({indexName:r,rules:e,forwardToReplicas:t,clearExistingRules:a},s){if(!r)throw new Error("Parameter `indexName` is required when calling `saveRules`.");if(!e)throw new Error("Parameter `rules` is required when calling `saveRules`.");let n="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(r)),o={},c={};t!==void 0&&(c.forwardToReplicas=t.toString()),a!==void 0&&(c.clearExistingRules=a.toString());let h={method:"POST",path:n,queryParameters:c,headers:o,data:e};return l.request(h,s)},saveSynonym({indexName:r,objectID:e,synonymHit:t,forwardToReplicas:a},s){if(!r)throw new Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!t)throw new Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!t.objectID)throw new Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!t.type)throw new Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");let n="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(e)),o={},c={};a!==void 0&&(c.forwardToReplicas=a.toString());let h={method:"PUT",path:n,queryParameters:c,headers:o,data:t};return l.request(h,s)},saveSynonyms({indexName:r,synonymHit:e,forwardToReplicas:t,replaceExistingSynonyms:a},s){if(!r)throw new Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!e)throw new Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");let n="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(r)),o={},c={};t!==void 0&&(c.forwardToReplicas=t.toString()),a!==void 0&&(c.replaceExistingSynonyms=a.toString());let h={method:"POST",path:n,queryParameters:c,headers:o,data:e};return l.request(h,s)},search(r,e){if(r&&Array.isArray(r)&&(r={requests:r.map(({params:c,...h})=>h.type==="facet"?{...h,...c,type:"facet"}:{...h,...c,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),!r)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!r.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");let n={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return l.request(n,e)},searchDictionaryEntries({dictionaryName:r,searchDictionaryEntriesParams:e},t){if(!r)throw new Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!e)throw new Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!e.query)throw new Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");let o={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return l.request(o,t)},searchForFacetValues({indexName:r,facetName:e,searchForFacetValuesRequest:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!e)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");let c={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(r)).replace("{facetName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0};return l.request(c,a)},searchRules({indexName:r,searchRulesParams:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `searchRules`.");let o={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e||{},useReadTransporter:!0,cacheable:!0};return l.request(o,t)},searchSingleIndex({indexName:r,searchParams:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `searchSingleIndex`.");let o={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e||{},useReadTransporter:!0,cacheable:!0};return l.request(o,t)},searchSynonyms({indexName:r,searchSynonymsParams:e},t){if(!r)throw new Error("Parameter `indexName` is required when calling `searchSynonyms`.");let o={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e||{},useReadTransporter:!0,cacheable:!0};return l.request(o,t)},searchUserIds(r,e){if(!r)throw new Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!r.query)throw new Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");let n={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return l.request(n,e)},setDictionarySettings(r,e){if(!r)throw new Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!r.disableStandardEntries)throw new Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");let n={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:r};return l.request(n,e)},setSettings({indexName:r,indexSettings:e,forwardToReplicas:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `setSettings`.");if(!e)throw new Error("Parameter `indexSettings` is required when calling `setSettings`.");let s="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(r)),n={},o={};t!==void 0&&(o.forwardToReplicas=t.toString());let c={method:"PUT",path:s,queryParameters:o,headers:n,data:e};return l.request(c,a)},updateApiKey({key:r,apiKey:e},t){if(!r)throw new Error("Parameter `key` is required when calling `updateApiKey`.");if(!e)throw new Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!e.acl)throw new Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");let o={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(r)),queryParameters:{},headers:{},data:e};return l.request(o,t)}}}function ce(i,u,d){if(!i||typeof i!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");return Ne({appId:i,apiKey:u,timeouts:{connect:A,read:b,write:I},logger:U(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:R({caches:[C({key:`${$}-${i}`}),E()]}),...d})}var ue="5.8.1";function ke(i){return[{url:`${i}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${i}.algolia.net`,accept:"write",protocol:"https"}].concat(F([{url:`${i}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${i}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${i}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function je({appId:i,apiKey:u,authMode:d,algoliaAgents:m,...g}){let w=x(i,u,d),l=D({hosts:ke(i),...g,algoliaAgent:O({algoliaAgents:m,client:"Recommend",version:ue}),baseHeaders:{"content-type":"text/plain",...w.headers(),...g.baseHeaders},baseQueryParameters:{...w.queryParameters(),...g.baseQueryParameters}});return{transporter:l,appId:i,clearCache(){return Promise.all([l.requestsCache.clear(),l.responsesCache.clear()]).then(()=>{})},get _ua(){return l.algoliaAgent.value},addAlgoliaAgent(r,e){l.algoliaAgent.add({segment:r,version:e})},setClientApiKey({apiKey:r}){!d||d==="WithinHeaders"?l.baseHeaders["x-algolia-api-key"]=r:l.baseQueryParameters["x-algolia-api-key"]=r},batchRecommendRules({indexName:r,model:e,recommendRule:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `batchRecommendRules`.");if(!e)throw new Error("Parameter `model` is required when calling `batchRecommendRules`.");let c={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}",encodeURIComponent(r)).replace("{model}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return l.request(c,a)},customDelete({path:r,parameters:e},t){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");let o={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:e||{},headers:{}};return l.request(o,t)},customGet({path:r,parameters:e},t){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");let o={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:e||{},headers:{}};return l.request(o,t)},customPost({path:r,parameters:e,body:t},a){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");let c={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:e||{},headers:{},data:t||{}};return l.request(c,a)},customPut({path:r,parameters:e,body:t},a){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");let c={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:e||{},headers:{},data:t||{}};return l.request(c,a)},deleteRecommendRule({indexName:r,model:e,objectID:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!e)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!t)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");let c={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{model}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(c,a)},getRecommendRule({indexName:r,model:e,objectID:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!e)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!t)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");let c={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(r)).replace("{model}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(c,a)},getRecommendStatus({indexName:r,model:e,taskID:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!e)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!t)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");let c={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(r)).replace("{model}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(c,a)},getRecommendations(r,e){if(r&&Array.isArray(r)&&(r={requests:r}),!r)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!r.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");let n={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return l.request(n,e)},searchRecommendRules({indexName:r,model:e,searchRecommendRulesParams:t},a){if(!r)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!e)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");let c={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(r)).replace("{model}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0};return l.request(c,a)}}}function he(i,u,d){if(!i||typeof i!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");return je({appId:i,apiKey:u,timeouts:{connect:A,read:b,write:I},logger:U(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:R({caches:[C({key:`${ue}-${i}`}),E()]}),...d})}function Tr(i,u,d){if(!i||typeof i!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");let m=ce(i,u,d);return{...m,get _ua(){return m.transporter.algoliaAgent.value},initRecommend:(g={})=>he(g.appId||i,g.apiKey||u,g.options),initAnalytics:(g={})=>se(g.appId||i,g.apiKey||u,g.region,g.options),initAbtesting:(g={})=>re(g.appId||i,g.apiKey||u,g.region,g.options),initPersonalization:g=>ie(g.appId||i,g.apiKey||u,g.region,g.options)}}export{re as abtestingClient,Tr as algoliasearch,se as analyticsClient,$ as apiClientVersion,ie as personalizationClient,he as recommendClient,ce as searchClient};
|
|
1
|
+
function R(){function c(h){return new Promise(d=>{let m=new XMLHttpRequest;m.open(h.method,h.url,!0),Object.keys(h.headers).forEach(t=>m.setRequestHeader(t,h.headers[t]));let q=(t,e)=>setTimeout(()=>{m.abort(),d({status:0,content:e,isTimedOut:!0})},t),f=q(h.connectTimeout,"Connection timeout"),l;m.onreadystatechange=()=>{m.readyState>m.OPENED&&l===void 0&&(clearTimeout(f),l=q(h.responseTimeout,"Socket timeout"))},m.onerror=()=>{m.status===0&&(clearTimeout(f),clearTimeout(l),d({content:m.responseText||"Network request failed",status:m.status,isTimedOut:!1}))},m.onload=()=>{clearTimeout(f),clearTimeout(l),d({content:m.responseText,status:m.status,isTimedOut:!1})},m.send(h.data)})}return{send:c}}function I(c){let h,d=`algolia-client-js-${c.key}`;function m(){return h===void 0&&(h=c.localStorage||window.localStorage),h}function q(){return JSON.parse(m().getItem(d)||"{}")}function f(t){m().setItem(d,JSON.stringify(t))}function l(){let t=c.timeToLive?c.timeToLive*1e3:null,e=q(),r=Object.fromEntries(Object.entries(e).filter(([,n])=>n.timestamp!==void 0));if(f(r),!t)return;let a=Object.fromEntries(Object.entries(r).filter(([,n])=>{let o=new Date().getTime();return!(n.timestamp+t<o)}));f(a)}return{get(t,e,r={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(l(),q()[JSON.stringify(t)])).then(a=>Promise.all([a?a.value:e(),a!==void 0])).then(([a,n])=>Promise.all([a,n||r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve().then(()=>{let r=q();return r[JSON.stringify(t)]={timestamp:new Date().getTime(),value:e},m().setItem(d,JSON.stringify(r)),e})},delete(t){return Promise.resolve().then(()=>{let e=q();delete e[JSON.stringify(t)],m().setItem(d,JSON.stringify(e))})},clear(){return Promise.resolve().then(()=>{m().removeItem(d)})}}}function Se(){return{get(c,h,d={miss:()=>Promise.resolve()}){return h().then(q=>Promise.all([q,d.miss(q)])).then(([q])=>q)},set(c,h){return Promise.resolve(h)},delete(c){return Promise.resolve()},clear(){return Promise.resolve()}}}function S(c){let h=[...c.caches],d=h.shift();return d===void 0?Se():{get(m,q,f={miss:()=>Promise.resolve()}){return d.get(m,q,f).catch(()=>S({caches:h}).get(m,q,f))},set(m,q){return d.set(m,q).catch(()=>S({caches:h}).set(m,q))},delete(m){return d.delete(m).catch(()=>S({caches:h}).delete(m))},clear(){return d.clear().catch(()=>S({caches:h}).clear())}}}function E(c={serializable:!0}){let h={};return{get(d,m,q={miss:()=>Promise.resolve()}){let f=JSON.stringify(d);if(f in h)return Promise.resolve(c.serializable?JSON.parse(h[f]):h[f]);let l=m();return l.then(t=>q.miss(t)).then(()=>l)},set(d,m){return h[JSON.stringify(d)]=c.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(d){return delete h[JSON.stringify(d)],Promise.resolve()},clear(){return h={},Promise.resolve()}}}var v=1e3,C=2e3,A=3e4;function Re(c){let h={value:`Algolia for JavaScript (${c})`,add(d){let m=`; ${d.segment}${d.version!==void 0?` (${d.version})`:""}`;return h.value.indexOf(m)===-1&&(h.value=`${h.value}${m}`),h}};return h}function D(c,h,d="WithinHeaders"){let m={"x-algolia-api-key":h,"x-algolia-application-id":c};return{headers(){return d==="WithinHeaders"?m:{}},queryParameters(){return d==="WithinQueryParameters"?m:{}}}}function N({func:c,validate:h,aggregator:d,error:m,timeout:q=()=>0}){let f=l=>new Promise((t,e)=>{c(l).then(r=>(d&&d(r),h(r)?t(r):m&&m.validate(r)?e(new Error(m.message(r))):setTimeout(()=>{f(r).then(t).catch(e)},q()))).catch(r=>{e(r)})});return f()}function b({algoliaAgents:c,client:h,version:d}){let m=Re(d).add({segment:h,version:d});return c.forEach(q=>m.add(q)),m}function O(){return{debug(c,h){return Promise.resolve()},info(c,h){return Promise.resolve()},error(c,h){return Promise.resolve()}}}var V=2*60*1e3;function K(c,h="up"){let d=Date.now();function m(){return h==="up"||Date.now()-d>V}function q(){return h==="timed out"&&Date.now()-d<=V}return{...c,status:h,lastUpdate:d,isUp:m,isTimedOut:q}}var J=class extends Error{name="AlgoliaError";constructor(c,h){super(c),h&&(this.name=h)}},X=class extends J{stackTrace;constructor(c,h,d){super(c,d),this.stackTrace=h}},Ie=class extends X{constructor(c){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",c,"RetryError")}},G=class extends X{status;constructor(c,h,d,m="ApiError"){super(c,d,m),this.status=h}},ve=class extends J{response;constructor(c,h){super(c,"DeserializationError"),this.response=h}},Ce=class extends G{error;constructor(c,h,d,m){super(c,h,m,"DetailedApiError"),this.error=d}};function L(c){let h=c;for(let d=c.length-1;d>0;d--){let m=Math.floor(Math.random()*(d+1)),q=c[d];h[d]=c[m],h[m]=q}return h}function Ae(c,h,d){let m=De(d),q=`${c.protocol}://${c.url}${c.port?`:${c.port}`:""}/${h.charAt(0)==="/"?h.substring(1):h}`;return m.length&&(q+=`?${m}`),q}function De(c){return Object.keys(c).filter(h=>c[h]!==void 0).sort().map(h=>`${h}=${encodeURIComponent(Object.prototype.toString.call(c[h])==="[object Array]"?c[h].join(","):c[h]).replace(/\+/g,"%20")}`).join("&")}function be(c,h){if(c.method==="GET"||c.data===void 0&&h.data===void 0)return;let d=Array.isArray(c.data)?c.data:{...c.data,...h.data};return JSON.stringify(d)}function Oe(c,h,d){let m={Accept:"application/json",...c,...h,...d},q={};return Object.keys(m).forEach(f=>{let l=m[f];q[f.toLowerCase()]=l}),q}function Ue(c){try{return JSON.parse(c.content)}catch(h){throw new ve(h.message,c)}}function ke({content:c,status:h},d){try{let m=JSON.parse(c);return"error"in m?new Ce(m.message,h,m.error,d):new G(m.message,h,d)}catch{}return new G(c,h,d)}function xe({isTimedOut:c,status:h}){return!c&&~~h===0}function Ne({isTimedOut:c,status:h}){return c||xe({isTimedOut:c,status:h})||~~(h/100)!==2&&~~(h/100)!==4}function _e({status:c}){return~~(c/100)===2}function Ge(c){return c.map(h=>Y(h))}function Y(c){let h=c.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...c,request:{...c.request,headers:{...c.request.headers,...h}}}}function U({hosts:c,hostsCache:h,baseHeaders:d,logger:m,baseQueryParameters:q,algoliaAgent:f,timeouts:l,requester:t,requestsCache:e,responsesCache:r}){async function a(s){let i=await Promise.all(s.map(y=>h.get(y,()=>Promise.resolve(K(y))))),u=i.filter(y=>y.isUp()),g=i.filter(y=>y.isTimedOut()),P=[...u,...g];return{hosts:P.length>0?P:s,getTimeout(y,p){return(g.length===0&&y===0?1:g.length+3+y)*p}}}async function n(s,i,u=!0){let g=[],P=be(s,i),w=Oe(d,s.headers,i.headers),y=s.method==="GET"?{...s.data,...i.data}:{},p={...q,...s.queryParameters,...y};if(f.value&&(p["x-algolia-agent"]=f.value),i&&i.queryParameters)for(let k of Object.keys(i.queryParameters))!i.queryParameters[k]||Object.prototype.toString.call(i.queryParameters[k])==="[object Object]"?p[k]=i.queryParameters[k]:p[k]=i.queryParameters[k].toString();let T=0,B=async(k,F)=>{let _=k.pop();if(_===void 0)throw new Ie(Ge(g));let j={...l,...i.timeouts},M={data:P,headers:w,method:s.method,url:Ae(_,s.path,p),connectTimeout:F(T,j.connect),responseTimeout:F(T,u?j.read:j.write)},$=W=>{let z={request:M,response:W,host:_,triesLeft:k.length};return g.push(z),z},x=await t.send(M);if(Ne(x)){let W=$(x);return x.isTimedOut&&T++,m.info("Retryable failure",Y(W)),await h.set(_,K(_,x.isTimedOut?"timed out":"down")),B(k,F)}if(_e(x))return Ue(x);throw $(x),ke(x,g)},Te=c.filter(k=>k.accept==="readWrite"||(u?k.accept==="read":k.accept==="write")),Q=await a(Te);return B([...Q.hosts].reverse(),Q.getTimeout)}function o(s,i={}){let u=s.useReadTransporter||s.method==="GET";if(!u)return n(s,i,u);let g=()=>n(s,i);if((i.cacheable||s.cacheable)!==!0)return g();let w={request:s,requestOptions:i,transporter:{queryParameters:q,headers:d}};return r.get(w,()=>e.get(w,()=>e.set(w,g()).then(y=>Promise.all([e.delete(w),y]),y=>Promise.all([e.delete(w),Promise.reject(y)])).then(([y,p])=>p)),{miss:y=>r.set(w,y)})}return{hostsCache:h,requester:t,timeouts:l,logger:m,algoliaAgent:f,baseHeaders:d,baseQueryParameters:q,hosts:c,request:o,requestsCache:e,responsesCache:r}}var H="5.9.1";function Be(c){return[{url:`${c}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${c}.algolia.net`,accept:"write",protocol:"https"}].concat(L([{url:`${c}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function Le({appId:c,apiKey:h,authMode:d,algoliaAgents:m,...q}){let f=D(c,h,d),l=U({hosts:Be(c),...q,algoliaAgent:b({algoliaAgents:m,client:"Search",version:H}),baseHeaders:{"content-type":"text/plain",...f.headers(),...q.baseHeaders},baseQueryParameters:{...f.queryParameters(),...q.baseQueryParameters}});return{transporter:l,appId:c,clearCache(){return Promise.all([l.requestsCache.clear(),l.responsesCache.clear()]).then(()=>{})},get _ua(){return l.algoliaAgent.value},addAlgoliaAgent(t,e){l.algoliaAgent.add({segment:t,version:e})},setClientApiKey({apiKey:t}){!d||d==="WithinHeaders"?l.baseHeaders["x-algolia-api-key"]=t:l.baseQueryParameters["x-algolia-api-key"]=t},waitForTask({indexName:t,taskID:e,maxRetries:r=50,timeout:a=o=>Math.min(o*200,5e3)},n){let o=0;return N({func:()=>this.getTask({indexName:t,taskID:e},n),validate:s=>s.status==="published",aggregator:()=>o+=1,error:{validate:()=>o>=r,message:()=>`The maximum number of retries exceeded. (${o}/${r})`},timeout:()=>a(o)})},waitForAppTask({taskID:t,maxRetries:e=50,timeout:r=n=>Math.min(n*200,5e3)},a){let n=0;return N({func:()=>this.getAppTask({taskID:t},a),validate:o=>o.status==="published",aggregator:()=>n+=1,error:{validate:()=>n>=e,message:()=>`The maximum number of retries exceeded. (${n}/${e})`},timeout:()=>r(n)})},waitForApiKey({operation:t,key:e,apiKey:r,maxRetries:a=50,timeout:n=s=>Math.min(s*200,5e3)},o){let s=0,i={aggregator:()=>s+=1,error:{validate:()=>s>=a,message:()=>`The maximum number of retries exceeded. (${s}/${a})`},timeout:()=>n(s)};if(t==="update"){if(!r)throw new Error("`apiKey` is required when waiting for an `update` operation.");return N({...i,func:()=>this.getApiKey({key:e},o),validate:u=>{for(let g of Object.keys(r)){let P=r[g],w=u[g];if(Array.isArray(P)&&Array.isArray(w)){if(P.length!==w.length||P.some((y,p)=>y!==w[p]))return!1}else if(P!==w)return!1}return!0}})}return N({...i,func:()=>this.getApiKey({key:e},o).catch(u=>{if(u.status!==404)throw u}),validate:u=>t==="add"?u!==void 0:u===void 0})},browseObjects({indexName:t,browseParams:e,...r},a){return N({func:n=>this.browse({indexName:t,browseParams:{cursor:n?n.cursor:void 0,...e}},a),validate:n=>n.cursor===void 0,...r})},browseRules({indexName:t,searchRulesParams:e,...r},a){let n={hitsPerPage:1e3,...e};return N({func:o=>this.searchRules({indexName:t,searchRulesParams:{...n,page:o?o.page+1:n.page||0}},a),validate:o=>o.nbHits<n.hitsPerPage,...r})},browseSynonyms({indexName:t,searchSynonymsParams:e,...r},a){let n={page:0,...e,hitsPerPage:1e3};return N({func:o=>{let s=this.searchSynonyms({indexName:t,searchSynonymsParams:{...n,page:n.page}},a);return n.page+=1,s},validate:o=>o.nbHits<n.hitsPerPage,...r})},async chunkedBatch({indexName:t,objects:e,action:r="addObject",waitForTasks:a,batchSize:n=1e3},o){let s=[],i=[],u=e.entries();for(let[g,P]of u)s.push({action:r,body:P}),(s.length===n||g===e.length-1)&&(i.push(await this.batch({indexName:t,batchWriteParams:{requests:s}},o)),s=[]);if(a)for(let g of i)await this.waitForTask({indexName:t,taskID:g.taskID});return i},async saveObjects({indexName:t,objects:e},r){return await this.chunkedBatch({indexName:t,objects:e,action:"addObject"},r)},async deleteObjects({indexName:t,objectIDs:e},r){return await this.chunkedBatch({indexName:t,objects:e.map(a=>({objectID:a})),action:"deleteObject"},r)},async partialUpdateObjects({indexName:t,objects:e,createIfNotExists:r},a){return await this.chunkedBatch({indexName:t,objects:e,action:r?"partialUpdateObject":"partialUpdateObjectNoCreate"},a)},async replaceAllObjects({indexName:t,objects:e,batchSize:r},a){let n=Math.floor(Math.random()*1e6)+1e5,o=`${t}_tmp_${n}`,s=await this.operationIndex({indexName:t,operationIndexParams:{operation:"copy",destination:o,scope:["settings","rules","synonyms"]}},a),i=await this.chunkedBatch({indexName:o,objects:e,waitForTasks:!0,batchSize:r},a);await this.waitForTask({indexName:o,taskID:s.taskID}),s=await this.operationIndex({indexName:t,operationIndexParams:{operation:"copy",destination:o,scope:["settings","rules","synonyms"]}},a),await this.waitForTask({indexName:o,taskID:s.taskID});let u=await this.operationIndex({indexName:o,operationIndexParams:{operation:"move",destination:t}},a);return await this.waitForTask({indexName:o,taskID:u.taskID}),{copyOperationResponse:s,batchResponses:i,moveOperationResponse:u}},async indexExists({indexName:t}){try{await this.getSettings({indexName:t})}catch(e){if(e instanceof G&&e.status===404)return!1;throw e}return!0},searchForHits(t,e){return this.search(t,e)},searchForFacets(t,e){return this.search(t,e)},addApiKey(t,e){if(!t)throw new Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!t.acl)throw new Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");let o={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:t};return l.request(o,e)},addOrUpdateObject({indexName:t,objectID:e,body:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!r)throw new Error("Parameter `body` is required when calling `addOrUpdateObject`.");let i={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return l.request(i,a)},appendSource(t,e){if(!t)throw new Error("Parameter `source` is required when calling `appendSource`.");if(!t.source)throw new Error("Parameter `source.source` is required when calling `appendSource`.");let o={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:t};return l.request(o,e)},assignUserId({xAlgoliaUserID:t,assignUserIdParams:e},r){if(!t)throw new Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!e)throw new Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!e.cluster)throw new Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");let a="/1/clusters/mapping",n={},o={};t!==void 0&&(n["X-Algolia-User-ID"]=t.toString());let s={method:"POST",path:a,queryParameters:o,headers:n,data:e};return l.request(s,r)},batch({indexName:t,batchWriteParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `batch`.");if(!e)throw new Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!e.requests)throw new Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");let s={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(s,r)},batchAssignUserIds({xAlgoliaUserID:t,batchAssignUserIdsParams:e},r){if(!t)throw new Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!e)throw new Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!e.cluster)throw new Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!e.users)throw new Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");let a="/1/clusters/mapping/batch",n={},o={};t!==void 0&&(n["X-Algolia-User-ID"]=t.toString());let s={method:"POST",path:a,queryParameters:o,headers:n,data:e};return l.request(s,r)},batchDictionaryEntries({dictionaryName:t,batchDictionaryEntriesParams:e},r){if(!t)throw new Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!e)throw new Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!e.requests)throw new Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");let s={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(s,r)},browse({indexName:t,browseParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `browse`.");let s={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e||{},useReadTransporter:!0};return l.request(s,r)},clearObjects({indexName:t},e){if(!t)throw new Error("Parameter `indexName` is required when calling `clearObjects`.");let o={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},clearRules({indexName:t,forwardToReplicas:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `clearRules`.");let a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(t)),n={},o={};e!==void 0&&(o.forwardToReplicas=e.toString());let s={method:"POST",path:a,queryParameters:o,headers:n};return l.request(s,r)},clearSynonyms({indexName:t,forwardToReplicas:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `clearSynonyms`.");let a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(t)),n={},o={};e!==void 0&&(o.forwardToReplicas=e.toString());let s={method:"POST",path:a,queryParameters:o,headers:n};return l.request(s,r)},customDelete({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customDelete`.");let s={method:"DELETE",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(s,r)},customGet({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customGet`.");let s={method:"GET",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(s,r)},customPost({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPost`.");let i={method:"POST",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},customPut({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPut`.");let i={method:"PUT",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},deleteApiKey({key:t},e){if(!t)throw new Error("Parameter `key` is required when calling `deleteApiKey`.");let o={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},deleteBy({indexName:t,deleteByParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteBy`.");if(!e)throw new Error("Parameter `deleteByParams` is required when calling `deleteBy`.");let s={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(s,r)},deleteIndex({indexName:t},e){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteIndex`.");let o={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},deleteObject({indexName:t,objectID:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteObject`.");let s={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(s,r)},deleteRule({indexName:t,objectID:e,forwardToReplicas:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteRule`.");let n="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),o={},s={};r!==void 0&&(s.forwardToReplicas=r.toString());let i={method:"DELETE",path:n,queryParameters:s,headers:o};return l.request(i,a)},deleteSource({source:t},e){if(!t)throw new Error("Parameter `source` is required when calling `deleteSource`.");let o={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},deleteSynonym({indexName:t,objectID:e,forwardToReplicas:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteSynonym`.");let n="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),o={},s={};r!==void 0&&(s.forwardToReplicas=r.toString());let i={method:"DELETE",path:n,queryParameters:s,headers:o};return l.request(i,a)},getApiKey({key:t},e){if(!t)throw new Error("Parameter `key` is required when calling `getApiKey`.");let o={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getAppTask({taskID:t},e){if(!t)throw new Error("Parameter `taskID` is required when calling `getAppTask`.");let o={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getDictionaryLanguages(t){let n={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return l.request(n,t)},getDictionarySettings(t){let n={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return l.request(n,t)},getLogs({offset:t,length:e,indexName:r,type:a}={},n=void 0){let o="/1/logs",s={},i={};t!==void 0&&(i.offset=t.toString()),e!==void 0&&(i.length=e.toString()),r!==void 0&&(i.indexName=r.toString()),a!==void 0&&(i.type=a.toString());let u={method:"GET",path:o,queryParameters:i,headers:s};return l.request(u,n)},getObject({indexName:t,objectID:e,attributesToRetrieve:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `getObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getObject`.");let n="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),o={},s={};r!==void 0&&(s.attributesToRetrieve=r.toString());let i={method:"GET",path:n,queryParameters:s,headers:o};return l.request(i,a)},getObjects(t,e){if(!t)throw new Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!t.requests)throw new Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");let o={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:t,useReadTransporter:!0,cacheable:!0};return l.request(o,e)},getRule({indexName:t,objectID:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `getRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getRule`.");let s={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(s,r)},getSettings({indexName:t},e){if(!t)throw new Error("Parameter `indexName` is required when calling `getSettings`.");let o={method:"GET",path:"/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getSources(t){let n={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return l.request(n,t)},getSynonym({indexName:t,objectID:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `getSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getSynonym`.");let s={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(s,r)},getTask({indexName:t,taskID:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `getTask`.");if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let s={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(s,r)},getTopUserIds(t){let n={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return l.request(n,t)},getUserId({userID:t},e){if(!t)throw new Error("Parameter `userID` is required when calling `getUserId`.");let o={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},hasPendingMappings({getClusters:t}={},e=void 0){let r="/1/clusters/mapping/pending",a={},n={};t!==void 0&&(n.getClusters=t.toString());let o={method:"GET",path:r,queryParameters:n,headers:a};return l.request(o,e)},listApiKeys(t){let n={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return l.request(n,t)},listClusters(t){let n={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return l.request(n,t)},listIndices({page:t,hitsPerPage:e}={},r=void 0){let a="/1/indexes",n={},o={};t!==void 0&&(o.page=t.toString()),e!==void 0&&(o.hitsPerPage=e.toString());let s={method:"GET",path:a,queryParameters:o,headers:n};return l.request(s,r)},listUserIds({page:t,hitsPerPage:e}={},r=void 0){let a="/1/clusters/mapping",n={},o={};t!==void 0&&(o.page=t.toString()),e!==void 0&&(o.hitsPerPage=e.toString());let s={method:"GET",path:a,queryParameters:o,headers:n};return l.request(s,r)},multipleBatch(t,e){if(!t)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!t.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");let o={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:t};return l.request(o,e)},operationIndex({indexName:t,operationIndexParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `operationIndex`.");if(!e)throw new Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!e.operation)throw new Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!e.destination)throw new Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");let s={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(s,r)},partialUpdateObject({indexName:t,objectID:e,attributesToUpdate:r,createIfNotExists:a},n){if(!t)throw new Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!r)throw new Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");let o="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),s={},i={};a!==void 0&&(i.createIfNotExists=a.toString());let u={method:"POST",path:o,queryParameters:i,headers:s,data:r};return l.request(u,n)},removeUserId({userID:t},e){if(!t)throw new Error("Parameter `userID` is required when calling `removeUserId`.");let o={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},replaceSources({source:t},e){if(!t)throw new Error("Parameter `source` is required when calling `replaceSources`.");let o={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:t};return l.request(o,e)},restoreApiKey({key:t},e){if(!t)throw new Error("Parameter `key` is required when calling `restoreApiKey`.");let o={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},saveObject({indexName:t,body:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `saveObject`.");if(!e)throw new Error("Parameter `body` is required when calling `saveObject`.");let s={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(s,r)},saveRule({indexName:t,objectID:e,rule:r,forwardToReplicas:a},n){if(!t)throw new Error("Parameter `indexName` is required when calling `saveRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `saveRule`.");if(!r)throw new Error("Parameter `rule` is required when calling `saveRule`.");if(!r.objectID)throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");let o="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),s={},i={};a!==void 0&&(i.forwardToReplicas=a.toString());let u={method:"PUT",path:o,queryParameters:i,headers:s,data:r};return l.request(u,n)},saveRules({indexName:t,rules:e,forwardToReplicas:r,clearExistingRules:a},n){if(!t)throw new Error("Parameter `indexName` is required when calling `saveRules`.");if(!e)throw new Error("Parameter `rules` is required when calling `saveRules`.");let o="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString()),a!==void 0&&(i.clearExistingRules=a.toString());let u={method:"POST",path:o,queryParameters:i,headers:s,data:e};return l.request(u,n)},saveSynonym({indexName:t,objectID:e,synonymHit:r,forwardToReplicas:a},n){if(!t)throw new Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!r)throw new Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!r.objectID)throw new Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!r.type)throw new Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");let o="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),s={},i={};a!==void 0&&(i.forwardToReplicas=a.toString());let u={method:"PUT",path:o,queryParameters:i,headers:s,data:r};return l.request(u,n)},saveSynonyms({indexName:t,synonymHit:e,forwardToReplicas:r,replaceExistingSynonyms:a},n){if(!t)throw new Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!e)throw new Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");let o="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(t)),s={},i={};r!==void 0&&(i.forwardToReplicas=r.toString()),a!==void 0&&(i.replaceExistingSynonyms=a.toString());let u={method:"POST",path:o,queryParameters:i,headers:s,data:e};return l.request(u,n)},search(t,e){if(t&&Array.isArray(t)&&(t={requests:t.map(({params:i,...u})=>u.type==="facet"?{...u,...i,type:"facet"}:{...u,...i,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),!t)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!t.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");let o={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:t,useReadTransporter:!0,cacheable:!0};return l.request(o,e)},searchDictionaryEntries({dictionaryName:t,searchDictionaryEntriesParams:e},r){if(!t)throw new Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!e)throw new Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!e.query)throw new Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");let s={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return l.request(s,r)},searchForFacetValues({indexName:t,facetName:e,searchForFacetValuesRequest:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!e)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");let i={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(t)).replace("{facetName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return l.request(i,a)},searchRules({indexName:t,searchRulesParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `searchRules`.");let s={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e||{},useReadTransporter:!0,cacheable:!0};return l.request(s,r)},searchSingleIndex({indexName:t,searchParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `searchSingleIndex`.");let s={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e||{},useReadTransporter:!0,cacheable:!0};return l.request(s,r)},searchSynonyms({indexName:t,searchSynonymsParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `searchSynonyms`.");let s={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e||{},useReadTransporter:!0,cacheable:!0};return l.request(s,r)},searchUserIds(t,e){if(!t)throw new Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!t.query)throw new Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");let o={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:t,useReadTransporter:!0,cacheable:!0};return l.request(o,e)},setDictionarySettings(t,e){if(!t)throw new Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!t.disableStandardEntries)throw new Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");let o={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:t};return l.request(o,e)},setSettings({indexName:t,indexSettings:e,forwardToReplicas:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `setSettings`.");if(!e)throw new Error("Parameter `indexSettings` is required when calling `setSettings`.");let n="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(t)),o={},s={};r!==void 0&&(s.forwardToReplicas=r.toString());let i={method:"PUT",path:n,queryParameters:s,headers:o,data:e};return l.request(i,a)},updateApiKey({key:t,apiKey:e},r){if(!t)throw new Error("Parameter `key` is required when calling `updateApiKey`.");if(!e)throw new Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!e.acl)throw new Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");let s={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(s,r)}}}function Z(c,h,d){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");return Le({appId:c,apiKey:h,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${H}-${c}`}),E()]}),...d})}var re="5.9.1",ee=["de","us"];function Fe(c){return[{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function je({appId:c,apiKey:h,authMode:d,algoliaAgents:m,region:q,...f}){let l=D(c,h,d),t=U({hosts:Fe(q),...f,algoliaAgent:b({algoliaAgents:m,client:"Abtesting",version:re}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return{transporter:t,appId:c,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e},addABTests(e,r){if(!e)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!e.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");let s={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e};return t.request(s,r)},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let u={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},customPut({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let u={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},deleteABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let s={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");let s={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},listABTests({offset:e,limit:r,indexPrefix:a,indexSuffix:n}={},o=void 0){let s="/2/abtests",i={},u={};e!==void 0&&(u.offset=e.toString()),r!==void 0&&(u.limit=r.toString()),a!==void 0&&(u.indexPrefix=a.toString()),n!==void 0&&(u.indexSuffix=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},scheduleABTest(e,r){if(!e)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!e.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!e.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!e.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!e.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");let s={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:e};return t.request(s,r)},stopABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");let s={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)}}}function te(c,h,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");if(d&&(typeof d!="string"||!ee.includes(d)))throw new Error(`\`region\` must be one of the following: ${ee.join(", ")}`);return je({appId:c,apiKey:h,region:d,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${re}-${c}`}),E()]}),...m})}var se="5.9.1",ae=["de","us"];function We(c){return[{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function He({appId:c,apiKey:h,authMode:d,algoliaAgents:m,region:q,...f}){let l=D(c,h,d),t=U({hosts:We(q),...f,algoliaAgent:b({algoliaAgents:m,client:"Analytics",version:se}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return{transporter:t,appId:c,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let u={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},customPut({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let u={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},getAddToCartRate({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");let s="/2/conversions/addToCartRate",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getAverageClickPosition({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");let s="/2/clicks/averageClickPosition",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getClickPositions({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");let s="/2/clicks/positions",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getClickThroughRate({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");let s="/2/clicks/clickThroughRate",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getConversionRate({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getConversionRate`.");let s="/2/conversions/conversionRate",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getNoClickRate({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");let s="/2/searches/noClickRate",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getNoResultsRate({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");let s="/2/searches/noResultRate",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getPurchaseRate({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");let s="/2/conversions/purchaseRate",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getRevenue({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getRevenue`.");let s="/2/conversions/revenue",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getSearchesCount({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");let s="/2/searches/count",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},getSearchesNoClicks({index:e,startDate:r,endDate:a,limit:n,offset:o,tags:s},i){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");let u="/2/searches/noClicks",g={},P={};e!==void 0&&(P.index=e.toString()),r!==void 0&&(P.startDate=r.toString()),a!==void 0&&(P.endDate=a.toString()),n!==void 0&&(P.limit=n.toString()),o!==void 0&&(P.offset=o.toString()),s!==void 0&&(P.tags=s.toString());let w={method:"GET",path:u,queryParameters:P,headers:g};return t.request(w,i)},getSearchesNoResults({index:e,startDate:r,endDate:a,limit:n,offset:o,tags:s},i){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");let u="/2/searches/noResults",g={},P={};e!==void 0&&(P.index=e.toString()),r!==void 0&&(P.startDate=r.toString()),a!==void 0&&(P.endDate=a.toString()),n!==void 0&&(P.limit=n.toString()),o!==void 0&&(P.offset=o.toString()),s!==void 0&&(P.tags=s.toString());let w={method:"GET",path:u,queryParameters:P,headers:g};return t.request(w,i)},getStatus({index:e},r){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");let a="/2/status",n={},o={};e!==void 0&&(o.index=e.toString());let s={method:"GET",path:a,queryParameters:o,headers:n};return t.request(s,r)},getTopCountries({index:e,startDate:r,endDate:a,limit:n,offset:o,tags:s},i){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");let u="/2/countries",g={},P={};e!==void 0&&(P.index=e.toString()),r!==void 0&&(P.startDate=r.toString()),a!==void 0&&(P.endDate=a.toString()),n!==void 0&&(P.limit=n.toString()),o!==void 0&&(P.offset=o.toString()),s!==void 0&&(P.tags=s.toString());let w={method:"GET",path:u,queryParameters:P,headers:g};return t.request(w,i)},getTopFilterAttributes({index:e,search:r,startDate:a,endDate:n,limit:o,offset:s,tags:i},u){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");let g="/2/filters",P={},w={};e!==void 0&&(w.index=e.toString()),r!==void 0&&(w.search=r.toString()),a!==void 0&&(w.startDate=a.toString()),n!==void 0&&(w.endDate=n.toString()),o!==void 0&&(w.limit=o.toString()),s!==void 0&&(w.offset=s.toString()),i!==void 0&&(w.tags=i.toString());let y={method:"GET",path:g,queryParameters:w,headers:P};return t.request(y,u)},getTopFilterForAttribute({attribute:e,index:r,search:a,startDate:n,endDate:o,limit:s,offset:i,tags:u},g){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!r)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");let P="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),w={},y={};r!==void 0&&(y.index=r.toString()),a!==void 0&&(y.search=a.toString()),n!==void 0&&(y.startDate=n.toString()),o!==void 0&&(y.endDate=o.toString()),s!==void 0&&(y.limit=s.toString()),i!==void 0&&(y.offset=i.toString()),u!==void 0&&(y.tags=u.toString());let p={method:"GET",path:P,queryParameters:y,headers:w};return t.request(p,g)},getTopFiltersNoResults({index:e,search:r,startDate:a,endDate:n,limit:o,offset:s,tags:i},u){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");let g="/2/filters/noResults",P={},w={};e!==void 0&&(w.index=e.toString()),r!==void 0&&(w.search=r.toString()),a!==void 0&&(w.startDate=a.toString()),n!==void 0&&(w.endDate=n.toString()),o!==void 0&&(w.limit=o.toString()),s!==void 0&&(w.offset=s.toString()),i!==void 0&&(w.tags=i.toString());let y={method:"GET",path:g,queryParameters:w,headers:P};return t.request(y,u)},getTopHits({index:e,search:r,clickAnalytics:a,revenueAnalytics:n,startDate:o,endDate:s,limit:i,offset:u,tags:g},P){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");let w="/2/hits",y={},p={};e!==void 0&&(p.index=e.toString()),r!==void 0&&(p.search=r.toString()),a!==void 0&&(p.clickAnalytics=a.toString()),n!==void 0&&(p.revenueAnalytics=n.toString()),o!==void 0&&(p.startDate=o.toString()),s!==void 0&&(p.endDate=s.toString()),i!==void 0&&(p.limit=i.toString()),u!==void 0&&(p.offset=u.toString()),g!==void 0&&(p.tags=g.toString());let T={method:"GET",path:w,queryParameters:p,headers:y};return t.request(T,P)},getTopSearches({index:e,clickAnalytics:r,revenueAnalytics:a,startDate:n,endDate:o,orderBy:s,direction:i,limit:u,offset:g,tags:P},w){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");let y="/2/searches",p={},T={};e!==void 0&&(T.index=e.toString()),r!==void 0&&(T.clickAnalytics=r.toString()),a!==void 0&&(T.revenueAnalytics=a.toString()),n!==void 0&&(T.startDate=n.toString()),o!==void 0&&(T.endDate=o.toString()),s!==void 0&&(T.orderBy=s.toString()),i!==void 0&&(T.direction=i.toString()),u!==void 0&&(T.limit=u.toString()),g!==void 0&&(T.offset=g.toString()),P!==void 0&&(T.tags=P.toString());let B={method:"GET",path:y,queryParameters:T,headers:p};return t.request(B,w)},getUsersCount({index:e,startDate:r,endDate:a,tags:n},o){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");let s="/2/users/count",i={},u={};e!==void 0&&(u.index=e.toString()),r!==void 0&&(u.startDate=r.toString()),a!==void 0&&(u.endDate=a.toString()),n!==void 0&&(u.tags=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)}}}function ne(c,h,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");if(d&&(typeof d!="string"||!ae.includes(d)))throw new Error(`\`region\` must be one of the following: ${ae.join(", ")}`);return He({appId:c,apiKey:h,region:d,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${se}-${c}`}),E()]}),...m})}var ie="5.9.1",oe=["de","us"];function Qe(c){return[{url:c?"insights.{region}.algolia.io".replace("{region}",c):"insights.algolia.io",accept:"readWrite",protocol:"https"}]}function Me({appId:c,apiKey:h,authMode:d,algoliaAgents:m,region:q,...f}){let l=D(c,h,d),t=U({hosts:Qe(q),...f,algoliaAgent:b({algoliaAgents:m,client:"Insights",version:ie}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return{transporter:t,appId:c,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let u={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},customPut({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let u={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},deleteUserToken({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");let s={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},pushEvents(e,r){if(!e)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!e.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");let s={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:e};return t.request(s,r)}}}function ce(c,h,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");if(d&&(typeof d!="string"||!oe.includes(d)))throw new Error(`\`region\` must be one of the following: ${oe.join(", ")}`);return Me({appId:c,apiKey:h,region:d,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${ie}-${c}`}),E()]}),...m})}var he="5.9.1",ue=["eu","us"];function $e(c){return[{url:"personalization.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]}function ze({appId:c,apiKey:h,authMode:d,algoliaAgents:m,region:q,...f}){let l=D(c,h,d),t=U({hosts:$e(q),...f,algoliaAgent:b({algoliaAgents:m,client:"Personalization",version:he}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return{transporter:t,appId:c,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let u={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},customPut({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let u={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},deleteUserProfile({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserProfile`.");let s={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getPersonalizationStrategy(e){let o={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return t.request(o,e)},getUserTokenProfile({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");let s={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},setPersonalizationStrategy(e,r){if(!e)throw new Error("Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.");if(!e.eventScoring)throw new Error("Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.");if(!e.facetScoring)throw new Error("Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.");if(!e.personalizationImpact)throw new Error("Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.");let s={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:e};return t.request(s,r)}}}function de(c,h,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!ue.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${ue.join(", ")}`);return ze({appId:c,apiKey:h,region:d,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${he}-${c}`}),E()]}),...m})}var me="5.9.1",le=["eu","us"];function Ve(c){return[{url:"query-suggestions.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]}function Ke({appId:c,apiKey:h,authMode:d,algoliaAgents:m,region:q,...f}){let l=D(c,h,d),t=U({hosts:Ve(q),...f,algoliaAgent:b({algoliaAgents:m,client:"QuerySuggestions",version:me}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return{transporter:t,appId:c,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e},createConfig(e,r){if(!e)throw new Error("Parameter `configurationWithIndex` is required when calling `createConfig`.");let s={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return t.request(s,r)},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let u={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},customPut({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let u={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},deleteConfig({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");let s={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getAllConfigs(e){let o={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return t.request(o,e)},getConfig({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfig`.");let s={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getConfigStatus({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");let s={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getLogFile({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");let s={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},updateConfig({indexName:e,configuration:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!r)throw new Error("Parameter `configuration` is required when calling `updateConfig`.");if(!r.sourceIndices)throw new Error("Parameter `configuration.sourceIndices` is required when calling `updateConfig`.");let i={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)}}}function qe(c,h,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!le.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${le.join(", ")}`);return Ke({appId:c,apiKey:h,region:d,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${me}-${c}`}),E()]}),...m})}var Pe="1.9.1",ge=["eu","us"];function Je(c){return[{url:"data.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]}function Gr(c){return c.type==="onDemand"}function Br(c){return c.type==="schedule"}function Lr(c){return c.type==="subscription"}function Xe({appId:c,apiKey:h,authMode:d,algoliaAgents:m,region:q,...f}){let l=D(c,h,d),t=U({hosts:Je(q),...f,algoliaAgent:b({algoliaAgents:m,client:"Ingestion",version:Pe}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return{transporter:t,appId:c,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");let s={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return t.request(s,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");let s={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return t.request(s,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");let s={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return t.request(s,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");let s={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return t.request(s,r)},createTaskV1(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");let s={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return t.request(s,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");let s={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return t.request(s,r)},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let u={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},customPut({path:e,parameters:r,body:a},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let u={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(u,n)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");let s={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");let s={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");let s={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");let s={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},deleteTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");let s={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");let s={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");let s={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},disableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");let s={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");let s={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},enableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");let s={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");let s={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");let s={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getEvent({runID:e,eventID:r},a){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");let i={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return t.request(i,a)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");let s={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");let s={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let s={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");let s={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");let s={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},listAuthentications({itemsPerPage:e,page:r,type:a,platform:n,sort:o,order:s}={},i=void 0){let u="/1/authentications",g={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),r!==void 0&&(P.page=r.toString()),a!==void 0&&(P.type=a.toString()),n!==void 0&&(P.platform=n.toString()),o!==void 0&&(P.sort=o.toString()),s!==void 0&&(P.order=s.toString());let w={method:"GET",path:u,queryParameters:P,headers:g};return t.request(w,i)},listDestinations({itemsPerPage:e,page:r,type:a,authenticationID:n,transformationID:o,sort:s,order:i}={},u=void 0){let g="/1/destinations",P={},w={};e!==void 0&&(w.itemsPerPage=e.toString()),r!==void 0&&(w.page=r.toString()),a!==void 0&&(w.type=a.toString()),n!==void 0&&(w.authenticationID=n.toString()),o!==void 0&&(w.transformationID=o.toString()),s!==void 0&&(w.sort=s.toString()),i!==void 0&&(w.order=i.toString());let y={method:"GET",path:g,queryParameters:w,headers:P};return t.request(y,u)},listEvents({runID:e,itemsPerPage:r,page:a,status:n,type:o,sort:s,order:i,startDate:u,endDate:g},P){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let w="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),y={},p={};r!==void 0&&(p.itemsPerPage=r.toString()),a!==void 0&&(p.page=a.toString()),n!==void 0&&(p.status=n.toString()),o!==void 0&&(p.type=o.toString()),s!==void 0&&(p.sort=s.toString()),i!==void 0&&(p.order=i.toString()),u!==void 0&&(p.startDate=u.toString()),g!==void 0&&(p.endDate=g.toString());let T={method:"GET",path:w,queryParameters:p,headers:y};return t.request(T,P)},listRuns({itemsPerPage:e,page:r,status:a,type:n,taskID:o,sort:s,order:i,startDate:u,endDate:g}={},P=void 0){let w="/1/runs",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),a!==void 0&&(p.status=a.toString()),n!==void 0&&(p.type=n.toString()),o!==void 0&&(p.taskID=o.toString()),s!==void 0&&(p.sort=s.toString()),i!==void 0&&(p.order=i.toString()),u!==void 0&&(p.startDate=u.toString()),g!==void 0&&(p.endDate=g.toString());let T={method:"GET",path:w,queryParameters:p,headers:y};return t.request(T,P)},listSources({itemsPerPage:e,page:r,type:a,authenticationID:n,sort:o,order:s}={},i=void 0){let u="/1/sources",g={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),r!==void 0&&(P.page=r.toString()),a!==void 0&&(P.type=a.toString()),n!==void 0&&(P.authenticationID=n.toString()),o!==void 0&&(P.sort=o.toString()),s!==void 0&&(P.order=s.toString());let w={method:"GET",path:u,queryParameters:P,headers:g};return t.request(w,i)},listTasks({itemsPerPage:e,page:r,action:a,enabled:n,sourceID:o,destinationID:s,triggerType:i,sort:u,order:g}={},P=void 0){let w="/2/tasks",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),a!==void 0&&(p.action=a.toString()),n!==void 0&&(p.enabled=n.toString()),o!==void 0&&(p.sourceID=o.toString()),s!==void 0&&(p.destinationID=s.toString()),i!==void 0&&(p.triggerType=i.toString()),u!==void 0&&(p.sort=u.toString()),g!==void 0&&(p.order=g.toString());let T={method:"GET",path:w,queryParameters:p,headers:y};return t.request(T,P)},listTasksV1({itemsPerPage:e,page:r,action:a,enabled:n,sourceID:o,destinationID:s,triggerType:i,sort:u,order:g}={},P=void 0){let w="/1/tasks",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),a!==void 0&&(p.action=a.toString()),n!==void 0&&(p.enabled=n.toString()),o!==void 0&&(p.sourceID=o.toString()),s!==void 0&&(p.destinationID=s.toString()),i!==void 0&&(p.triggerType=i.toString()),u!==void 0&&(p.sort=u.toString()),g!==void 0&&(p.order=g.toString());let T={method:"GET",path:w,queryParameters:p,headers:y};return t.request(T,P)},listTransformations({itemsPerPage:e,page:r,sort:a,order:n}={},o=void 0){let s="/1/transformations",i={},u={};e!==void 0&&(u.itemsPerPage=e.toString()),r!==void 0&&(u.page=r.toString()),a!==void 0&&(u.sort=a.toString()),n!==void 0&&(u.order=n.toString());let g={method:"GET",path:s,queryParameters:u,headers:i};return t.request(g,o)},pushTask({taskID:e,pushTaskPayload:r},a){if(!e)throw new Error("Parameter `taskID` is required when calling `pushTask`.");if(!r)throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!r.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!r.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");let i={method:"POST",path:"/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},runSource({sourceID:e,runSourcePayload:r},a){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");let i={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return t.request(i,a)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");let s={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},runTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");let s={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");let s={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return t.request(s,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");let s={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return t.request(s,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");let s={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return t.request(s,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");let s={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return t.request(s,r)},searchTasksV1(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");let s={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return t.request(s,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationIDs)throw new Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");let s={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return t.request(s,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");let s={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(s,r)},tryTransformation(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");let s={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return t.request(s,r)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:r},a){if(!e)throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!r)throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!r.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");if(!r.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");let i={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateAuthentication({authenticationID:e,authenticationUpdate:r},a){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");let i={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateDestination({destinationID:e,destinationUpdate:r},a){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");let i={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateSource({sourceID:e,sourceUpdate:r},a){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");let i={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateTask({taskID:e,taskUpdate:r},a){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");let i={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateTaskV1({taskID:e,taskUpdate:r},a){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");let i={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateTransformation({transformationID:e,transformationCreate:r},a){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");let i={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},validateSource(e,r=void 0){let s={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return t.request(s,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},a){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");let i={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)}}}function pe(c,h,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!ge.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${ge.join(", ")}`);return Xe({appId:c,apiKey:h,region:d,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${Pe}-${c}`}),E()]}),...m})}var we="1.9.1";function Ye(){return[{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function Ze({appId:c,apiKey:h,authMode:d,algoliaAgents:m,...q}){let f=D(c,h,d),l=U({hosts:Ye(),...q,algoliaAgent:b({algoliaAgents:m,client:"Monitoring",version:we}),baseHeaders:{"content-type":"text/plain",...f.headers(),...q.baseHeaders},baseQueryParameters:{...f.queryParameters(),...q.baseQueryParameters}});return{transporter:l,appId:c,clearCache(){return Promise.all([l.requestsCache.clear(),l.responsesCache.clear()]).then(()=>{})},get _ua(){return l.algoliaAgent.value},addAlgoliaAgent(t,e){l.algoliaAgent.add({segment:t,version:e})},setClientApiKey({apiKey:t}){!d||d==="WithinHeaders"?l.baseHeaders["x-algolia-api-key"]=t:l.baseQueryParameters["x-algolia-api-key"]=t},customDelete({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customDelete`.");let s={method:"DELETE",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(s,r)},customGet({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customGet`.");let s={method:"GET",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(s,r)},customPost({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPost`.");let i={method:"POST",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},customPut({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPut`.");let i={method:"PUT",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},getClusterIncidents({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");let o={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getClusterStatus({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");let o={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getIncidents(t){let n={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return l.request(n,t)},getIndexingTime({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");let o={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getLatency({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getLatency`.");let o={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getMetrics({metric:t,period:e},r){if(!t)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!e)throw new Error("Parameter `period` is required when calling `getMetrics`.");let s={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(t)).replace("{period}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(s,r)},getReachability({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getReachability`.");let o={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getServers(t){let n={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return l.request(n,t)},getStatus(t){let n={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return l.request(n,t)}}}function fe(c,h,d){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");return Ze({appId:c,apiKey:h,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${we}-${c}`}),E()]}),...d})}var ye="5.9.1";function er(c){return[{url:`${c}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${c}.algolia.net`,accept:"write",protocol:"https"}].concat(L([{url:`${c}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function rr({appId:c,apiKey:h,authMode:d,algoliaAgents:m,...q}){let f=D(c,h,d),l=U({hosts:er(c),...q,algoliaAgent:b({algoliaAgents:m,client:"Recommend",version:ye}),baseHeaders:{"content-type":"text/plain",...f.headers(),...q.baseHeaders},baseQueryParameters:{...f.queryParameters(),...q.baseQueryParameters}});return{transporter:l,appId:c,clearCache(){return Promise.all([l.requestsCache.clear(),l.responsesCache.clear()]).then(()=>{})},get _ua(){return l.algoliaAgent.value},addAlgoliaAgent(t,e){l.algoliaAgent.add({segment:t,version:e})},setClientApiKey({apiKey:t}){!d||d==="WithinHeaders"?l.baseHeaders["x-algolia-api-key"]=t:l.baseQueryParameters["x-algolia-api-key"]=t},batchRecommendRules({indexName:t,model:e,recommendRule:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `batchRecommendRules`.");if(!e)throw new Error("Parameter `model` is required when calling `batchRecommendRules`.");let i={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return l.request(i,a)},customDelete({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customDelete`.");let s={method:"DELETE",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(s,r)},customGet({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customGet`.");let s={method:"GET",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(s,r)},customPost({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPost`.");let i={method:"POST",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},customPut({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPut`.");let i={method:"PUT",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},deleteRecommendRule({indexName:t,model:e,objectID:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!e)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");let i={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(i,a)},getRecommendRule({indexName:t,model:e,objectID:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!e)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");let i={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(i,a)},getRecommendStatus({indexName:t,model:e,taskID:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!e)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");let i={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(i,a)},getRecommendations(t,e){if(t&&Array.isArray(t)&&(t={requests:t}),!t)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!t.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");let o={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:t,useReadTransporter:!0,cacheable:!0};return l.request(o,e)},searchRecommendRules({indexName:t,model:e,searchRecommendRulesParams:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!e)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");let i={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return l.request(i,a)}}}function Ee(c,h,d){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");return rr({appId:c,apiKey:h,timeouts:{connect:v,read:C,write:A},logger:O(),requester:R(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:!1}),hostsCache:S({caches:[I({key:`${ye}-${c}`}),E()]}),...d})}function ft(c,h,d){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!h||typeof h!="string")throw new Error("`apiKey` is missing.");let m=Z(c,h,d);return{...m,get _ua(){return m.transporter.algoliaAgent.value},initAbtesting:q=>te(q.appId||c,q.apiKey||h,q.region,q.options),initAnalytics:q=>ne(q.appId||c,q.apiKey||h,q.region,q.options),initIngestion:q=>pe(q.appId||c,q.apiKey||h,q.region,q.options),initInsights:q=>ce(q.appId||c,q.apiKey||h,q.region,q.options),initMonitoring:q=>fe(q.appId||c,q.apiKey||h,q.options),initPersonalization:q=>de(q.appId||c,q.apiKey||h,q.region,q.options),initQuerySuggestions:q=>qe(q.appId||c,q.apiKey||h,q.region,q.options),initRecommend:q=>Ee(q.appId||c,q.apiKey||h,q.options)}}export{te as abtestingClient,ft as algoliasearch,ne as analyticsClient,H as apiClientVersion,pe as ingestionClient,ce as insightsClient,Gr as isOnDemandTrigger,Br as isScheduleTrigger,Lr as isSubscriptionTrigger,fe as monitoringClient,de as personalizationClient,qe as querySuggestionsClient,Ee as recommendClient,Z as searchClient};
|
|
2
2
|
//# sourceMappingURL=browser.min.js.map
|