@wix/stores 1.0.959 → 1.0.960

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/_sdk-exports/context-category-by-id-context-provider/runtime.d.ts +4026 -0
  2. package/_sdk-exports/context-category-by-id-context-provider/runtime.js +2 -0
  3. package/_sdk-exports/context-category-by-slug-context-provider/runtime.d.ts +4046 -0
  4. package/_sdk-exports/context-category-by-slug-context-provider/runtime.js +2 -0
  5. package/_sdk-exports/context-category-info-context-provider/runtime.d.ts +3530 -0
  6. package/_sdk-exports/context-category-info-context-provider/runtime.js +2 -0
  7. package/_sdk-exports/context-category-list-context-provider/runtime.d.ts +101 -0
  8. package/_sdk-exports/context-category-list-context-provider/runtime.js +2 -0
  9. package/_sdk-exports/context-product-by-id-context-provider/runtime.d.ts +4221 -0
  10. package/_sdk-exports/context-product-by-id-context-provider/runtime.js +2 -0
  11. package/_sdk-exports/context-product-by-slug-context-provider/runtime.d.ts +4217 -0
  12. package/_sdk-exports/context-product-by-slug-context-provider/runtime.js +2 -0
  13. package/_sdk-exports/context-product-context-provider/runtime.d.ts +4449 -0
  14. package/_sdk-exports/context-product-context-provider/runtime.js +2 -0
  15. package/_sdk-exports/context-product-item-context-provider/runtime.d.ts +4102 -0
  16. package/_sdk-exports/context-product-item-context-provider/runtime.js +2 -0
  17. package/_sdk-exports/context-product-list-context-provider/runtime.d.ts +3969 -0
  18. package/_sdk-exports/context-product-list-context-provider/runtime.js +2 -0
  19. package/_sdk-exports/context-promotion-item-context-provider/runtime.d.ts +85 -0
  20. package/_sdk-exports/context-promotion-item-context-provider/runtime.js +2 -0
  21. package/build/cjs/context-category-by-id-context-provider.d.ts +4026 -0
  22. package/build/cjs/context-category-by-id-context-provider.js +3572 -0
  23. package/build/cjs/context-category-by-id-context-provider.js.map +1 -0
  24. package/build/cjs/context-category-by-slug-context-provider.d.ts +4046 -0
  25. package/build/cjs/context-category-by-slug-context-provider.js +3674 -0
  26. package/build/cjs/context-category-by-slug-context-provider.js.map +1 -0
  27. package/build/cjs/context-category-info-context-provider.d.ts +3530 -0
  28. package/build/cjs/context-category-info-context-provider.js +1201 -0
  29. package/build/cjs/context-category-info-context-provider.js.map +1 -0
  30. package/build/cjs/context-category-list-context-provider.d.ts +101 -0
  31. package/build/cjs/context-category-list-context-provider.js +587 -0
  32. package/build/cjs/context-category-list-context-provider.js.map +1 -0
  33. package/build/cjs/context-product-by-id-context-provider.d.ts +4221 -0
  34. package/build/cjs/context-product-by-id-context-provider.js +3454 -0
  35. package/build/cjs/context-product-by-id-context-provider.js.map +1 -0
  36. package/build/cjs/context-product-by-slug-context-provider.d.ts +4217 -0
  37. package/build/cjs/context-product-by-slug-context-provider.js +3477 -0
  38. package/build/cjs/context-product-by-slug-context-provider.js.map +1 -0
  39. package/build/cjs/context-product-context-provider.d.ts +4449 -0
  40. package/build/cjs/context-product-context-provider.js +587 -0
  41. package/build/cjs/context-product-context-provider.js.map +1 -0
  42. package/build/cjs/context-product-item-context-provider.d.ts +4102 -0
  43. package/build/cjs/context-product-item-context-provider.js +4396 -0
  44. package/build/cjs/context-product-item-context-provider.js.map +1 -0
  45. package/build/cjs/context-product-list-context-provider.d.ts +3970 -0
  46. package/build/cjs/context-product-list-context-provider.js +587 -0
  47. package/build/cjs/context-product-list-context-provider.js.map +1 -0
  48. package/build/cjs/context-promotion-item-context-provider.d.ts +85 -0
  49. package/build/cjs/context-promotion-item-context-provider.js +592 -0
  50. package/build/cjs/context-promotion-item-context-provider.js.map +1 -0
  51. package/build/es/context-category-by-id-context-provider.d.mts +4026 -0
  52. package/build/es/context-category-by-id-context-provider.mjs +3532 -0
  53. package/build/es/context-category-by-id-context-provider.mjs.map +1 -0
  54. package/build/es/context-category-by-slug-context-provider.d.mts +4046 -0
  55. package/build/es/context-category-by-slug-context-provider.mjs +3634 -0
  56. package/build/es/context-category-by-slug-context-provider.mjs.map +1 -0
  57. package/build/es/context-category-info-context-provider.d.mts +3530 -0
  58. package/build/es/context-category-info-context-provider.mjs +1172 -0
  59. package/build/es/context-category-info-context-provider.mjs.map +1 -0
  60. package/build/es/context-category-list-context-provider.d.mts +101 -0
  61. package/build/es/context-category-list-context-provider.mjs +558 -0
  62. package/build/es/context-category-list-context-provider.mjs.map +1 -0
  63. package/build/es/context-product-by-id-context-provider.d.mts +4221 -0
  64. package/build/es/context-product-by-id-context-provider.mjs +3415 -0
  65. package/build/es/context-product-by-id-context-provider.mjs.map +1 -0
  66. package/build/es/context-product-by-slug-context-provider.d.mts +4217 -0
  67. package/build/es/context-product-by-slug-context-provider.mjs +3437 -0
  68. package/build/es/context-product-by-slug-context-provider.mjs.map +1 -0
  69. package/build/es/context-product-context-provider.d.mts +4449 -0
  70. package/build/es/context-product-context-provider.mjs +558 -0
  71. package/build/es/context-product-context-provider.mjs.map +1 -0
  72. package/build/es/context-product-item-context-provider.d.mts +4102 -0
  73. package/build/es/context-product-item-context-provider.mjs +4356 -0
  74. package/build/es/context-product-item-context-provider.mjs.map +1 -0
  75. package/build/es/context-product-list-context-provider.d.mts +3970 -0
  76. package/build/es/context-product-list-context-provider.mjs +558 -0
  77. package/build/es/context-product-list-context-provider.mjs.map +1 -0
  78. package/build/es/context-promotion-item-context-provider.d.mts +85 -0
  79. package/build/es/context-promotion-item-context-provider.mjs +563 -0
  80. package/build/es/context-promotion-item-context-provider.mjs.map +1 -0
  81. package/build/internal/cjs/context-category-by-id-context-provider.d.ts +4026 -0
  82. package/build/internal/cjs/context-category-by-slug-context-provider.d.ts +4046 -0
  83. package/build/internal/cjs/context-category-info-context-provider.d.ts +3530 -0
  84. package/build/internal/cjs/context-category-list-context-provider.d.ts +101 -0
  85. package/build/internal/cjs/context-product-by-id-context-provider.d.ts +4221 -0
  86. package/build/internal/cjs/context-product-by-slug-context-provider.d.ts +4217 -0
  87. package/build/internal/cjs/context-product-context-provider.d.ts +4449 -0
  88. package/build/internal/cjs/context-product-item-context-provider.d.ts +4102 -0
  89. package/build/internal/cjs/context-product-list-context-provider.d.ts +3970 -0
  90. package/build/internal/cjs/context-promotion-item-context-provider.d.ts +85 -0
  91. package/build/internal/es/context-category-by-id-context-provider.d.mts +4026 -0
  92. package/build/internal/es/context-category-by-slug-context-provider.d.mts +4046 -0
  93. package/build/internal/es/context-category-info-context-provider.d.mts +3530 -0
  94. package/build/internal/es/context-category-list-context-provider.d.mts +101 -0
  95. package/build/internal/es/context-product-by-id-context-provider.d.mts +4221 -0
  96. package/build/internal/es/context-product-by-slug-context-provider.d.mts +4217 -0
  97. package/build/internal/es/context-product-context-provider.d.mts +4449 -0
  98. package/build/internal/es/context-product-item-context-provider.d.mts +4102 -0
  99. package/build/internal/es/context-product-list-context-provider.d.mts +3970 -0
  100. package/build/internal/es/context-promotion-item-context-provider.d.mts +85 -0
  101. package/category-by-id-context-provider/package.json +3 -0
  102. package/category-by-slug-context-provider/package.json +3 -0
  103. package/category-info-context-provider/package.json +3 -0
  104. package/category-list-context-provider/package.json +3 -0
  105. package/context/category-by-id-context-provider/package.json +3 -0
  106. package/context/category-by-slug-context-provider/package.json +3 -0
  107. package/context/category-info-context-provider/package.json +3 -0
  108. package/context/category-list-context-provider/package.json +3 -0
  109. package/context/product-by-id-context-provider/package.json +3 -0
  110. package/context/product-by-slug-context-provider/package.json +3 -0
  111. package/context/product-context-provider/package.json +3 -0
  112. package/context/product-item-context-provider/package.json +3 -0
  113. package/context/product-list-context-provider/package.json +3 -0
  114. package/context/promotion-item-context-provider/package.json +3 -0
  115. package/package.json +159 -24
  116. package/product-by-id-context-provider/package.json +3 -0
  117. package/product-by-slug-context-provider/package.json +3 -0
  118. package/product-context-provider/package.json +3 -0
  119. package/product-item-context-provider/package.json +3 -0
  120. package/product-list-context-provider/package.json +3 -0
  121. package/promotion-item-context-provider/package.json +3 -0
@@ -0,0 +1,1201 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // context-category-info-context-provider.ts
21
+ var context_category_info_context_provider_exports = {};
22
+ __export(context_category_info_context_provider_exports, {
23
+ CategoryInfoContextProvider: () => rr,
24
+ default: () => rr,
25
+ injectAccessTokenGetter: () => ir,
26
+ useCategoryInfoContext: () => er
27
+ });
28
+ module.exports = __toCommonJS(context_category_info_context_provider_exports);
29
+
30
+ // _sdk-exports/context-category-info-context-provider/runtime.js
31
+ var import_react = require("react");
32
+ var import_services_manager_react = require("@wix/services-manager-react");
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var l = {};
35
+ function u(e2, t2 = false, n2 = (e3) => e3) {
36
+ return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
37
+ }
38
+ var d = (e2) => {
39
+ switch (e2) {
40
+ case `get`:
41
+ case `GET`:
42
+ return `GET`;
43
+ case `post`:
44
+ case `POST`:
45
+ return `POST`;
46
+ case `put`:
47
+ case `PUT`:
48
+ return `PUT`;
49
+ case `delete`:
50
+ case `DELETE`:
51
+ return `DELETE`;
52
+ case `patch`:
53
+ case `PATCH`:
54
+ return `PATCH`;
55
+ case `head`:
56
+ case `HEAD`:
57
+ return `HEAD`;
58
+ case `options`:
59
+ case `OPTIONS`:
60
+ return `OPTIONS`;
61
+ default:
62
+ throw Error(`Unknown method: ${e2}`);
63
+ }
64
+ };
65
+ var ee = (e2) => (t2) => async (n2) => {
66
+ let r2, i2 = (t3) => {
67
+ if (r2 = e2(n2)(t3), r2.url === void 0) throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);
68
+ let { method: i3, url: a2, params: o2 } = r2;
69
+ return { ...r2, method: d(i3), url: a2, data: r2.data, params: o2 };
70
+ };
71
+ try {
72
+ let e3 = await t2.request(i2);
73
+ if (r2 === void 0) throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);
74
+ let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 = e3.data;
75
+ return n3.forEach((t3) => {
76
+ t3 && (a2 = t3(e3.data, e3.headers));
77
+ }), a2;
78
+ } catch (e3) {
79
+ throw typeof e3 == `object` && e3 && `response` in e3 && typeof e3.response == `object` && e3.response !== null && `data` in e3.response ? e3.response.data : e3;
80
+ }
81
+ };
82
+ var te = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
83
+ var ne = `__metadata`;
84
+ var re = `edge.wixapis.com`;
85
+ var ie = class extends Error {
86
+ message;
87
+ response;
88
+ constructor(e2, t2) {
89
+ super(e2), this.message = e2, this.response = t2;
90
+ }
91
+ async details() {
92
+ let e2 = await this.response.json();
93
+ return f(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
94
+ }
95
+ };
96
+ var f = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
97
+ var ae = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
98
+ var oe = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
99
+ var se = (e2) => e2.__type === `host`;
100
+ function ce(e2, t2) {
101
+ return e2.create(t2);
102
+ }
103
+ var p = `x-wix-bi-gateway`;
104
+ function m(e2, t2, n2) {
105
+ return { [p]: le({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
106
+ }
107
+ function le(e2) {
108
+ return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
109
+ }
110
+ function h(e2) {
111
+ let t2 = globalThis.__wix_context__, n2 = { client: l.client, elevatedClient: l.elevatedClient }, r2;
112
+ globalThis.__wix_context__ = void 0, l.client = void 0, l.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
113
+ try {
114
+ return e2();
115
+ } finally {
116
+ globalThis.__wix_context__ = t2, l.client = n2.client, l.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
117
+ }
118
+ }
119
+ var g = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
120
+ function _(e2) {
121
+ return pe(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
122
+ }
123
+ var ue = /([\p{Ll}\d])(\p{Lu})/gu;
124
+ var de = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
125
+ var v = `$1\0$2`;
126
+ var fe = /[^\p{L}\d]+/giu;
127
+ function pe(e2) {
128
+ let t2 = e2.trim();
129
+ t2 = t2.replace(ue, v).replace(de, v), t2 = t2.replace(fe, `\0`);
130
+ let n2 = 0, r2 = t2.length;
131
+ for (; t2.charAt(n2) === `\0`; ) n2++;
132
+ if (n2 === r2) return [];
133
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
134
+ return t2.slice(n2, r2).split(/\0/g);
135
+ }
136
+ var me = (e2) => `validationError` in (e2.response?.data?.details ?? {});
137
+ var he = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
138
+ var ge = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
139
+ function _e(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
140
+ if (typeof e2 != `object` || !e2) throw e2;
141
+ if (me(e2)) return ve(e2, t2, n2);
142
+ if (he(e2)) return ye(e2);
143
+ if (ge(e2)) {
144
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: _(n3), data: {} }, requestId: e2.requestId };
145
+ return y(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
146
+ }
147
+ return be(e2);
148
+ }
149
+ var ve = (e2, t2, n2) => {
150
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = xe(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
151
+ return y(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
152
+ };
153
+ var y = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
154
+ var ye = (e2) => {
155
+ let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? _(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
156
+ return y(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
157
+ };
158
+ var be = (e2) => y(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: _(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
159
+ var xe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
160
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
161
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
162
+ let r3 = t2[e3.field];
163
+ if (r3) return { ...e3, field: b(r3, i2) };
164
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
165
+ if (s2) {
166
+ let t3 = a2[s2];
167
+ if (t3) return { ...e3, field: e3.field.replace(s2, b(t3, i2)) };
168
+ }
169
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
170
+ });
171
+ };
172
+ var b = (e2, t2) => {
173
+ let n2 = Se(e2);
174
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
175
+ };
176
+ var Se = (e2) => {
177
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
178
+ return t2 && t2.groups && Number(t2.groups.argIndex);
179
+ };
180
+ function Ce(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
181
+ return h(() => e2({ request: async (e3) => {
182
+ let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
183
+ a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
184
+ let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? re : o3}${a3.url}`;
185
+ a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
186
+ try {
187
+ let e4 = m(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
188
+ if (s3.status !== 200) {
189
+ let e5 = null;
190
+ try {
191
+ e5 = await s3.json();
192
+ } catch {
193
+ }
194
+ let t3 = Te(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = _e(t3);
195
+ throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
196
+ }
197
+ let l3 = await s3.json();
198
+ return { data: a3.migrationOptions?.optInTransformResponse && a3.transformResponse ? Array.isArray(a3.transformResponse) ? a3.transformResponse[0](l3) : a3.transformResponse(l3) : l3, headers: s3.headers, status: s3.status, statusText: s3.statusText };
199
+ } catch (e4) {
200
+ throw e4.message?.includes(`fetch is not defined`) && console.error(`Node.js v18+ is required`), e4;
201
+ }
202
+ }, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
203
+ }
204
+ var we = class extends Error {
205
+ response;
206
+ requestId;
207
+ constructor(e2) {
208
+ super(), this.response = e2.response, this.requestId = e2.requestId;
209
+ }
210
+ };
211
+ var Te = (e2, t2, n2, r2) => new we({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
212
+ var Ee = `.`;
213
+ function De(e2, t2, n2) {
214
+ if (e2 == null) throw Error(`Cannot set value on null or undefined`);
215
+ let r2 = x(t2), i2 = e2;
216
+ for (let e3 = 0; e3 < r2.length; e3++) {
217
+ let t3 = r2[e3];
218
+ if (e3 === r2.length - 1) {
219
+ i2[t3] = n2;
220
+ break;
221
+ }
222
+ let a2 = r2[e3 + 1];
223
+ (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
224
+ }
225
+ return e2;
226
+ }
227
+ function x(e2) {
228
+ return Array.isArray(e2) ? e2 : e2.split(Ee).map((e3) => Oe(e3) ? Number(e3) : e3);
229
+ }
230
+ function Oe(e2) {
231
+ return /^\d+$/.test(e2);
232
+ }
233
+ function ke(e2) {
234
+ let t2 = {};
235
+ for (let [n2, r2] of Object.entries(e2)) Ae(n2) || De(t2, x(n2), r2);
236
+ return t2;
237
+ }
238
+ function Ae(e2) {
239
+ return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
240
+ }
241
+ var je = class {
242
+ BRACKET_PATTERN = /\[(\d+)\]/g;
243
+ NUMERIC_PATTERN = /^\d+$/;
244
+ ESCAPED_DOT_PATTERN = /\\\./g;
245
+ ESCAPED_LEFT_BRACKET_PATTERN = /\\\[/g;
246
+ ESCAPED_RIGHT_BRACKET_PATTERN = /\\\]/g;
247
+ SPLIT_PATTERN = /\.|\[(\d+)\]/g;
248
+ DOT_BEFORE_BRACKET_PATTERN = /\.\[/g;
249
+ ESCAPED_DOT_PLACEHOLDER = `__DOT__`;
250
+ ESCAPED_RIGHT_BRACKET_PLACEHOLDER = `__RB__`;
251
+ ESCAPED_LEFT_BRACKET_PLACEHOLDER = `__LB__`;
252
+ modifiedFields;
253
+ cleanedModifiedFields;
254
+ constructor(e2) {
255
+ this.modifiedFields = e2;
256
+ }
257
+ replaceEscapedCharacters(e2) {
258
+ return e2.replace(this.ESCAPED_DOT_PATTERN, this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN, this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN, this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER);
259
+ }
260
+ restoreEscapedCharacters(e2) {
261
+ return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
262
+ }
263
+ unflatten() {
264
+ return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), ke(this.cleanedModifiedFields);
265
+ }
266
+ flatten(e2) {
267
+ let t2 = {};
268
+ for (let n2 of Object.keys(this.cleanedModifiedFields)) {
269
+ let r2 = this.splitPath(n2), i2 = this.navigatePath(e2, r2);
270
+ t2 = { ...t2, ...i2 };
271
+ }
272
+ return Object.fromEntries(Object.entries(t2).map(([e3, t3]) => [this.restoreEscapedCharacters(e3), t3]));
273
+ }
274
+ splitPath(e2) {
275
+ let t2 = [], n2 = 0, r2 = Array.from(e2.matchAll(this.SPLIT_PATTERN));
276
+ for (let i2 of r2) i2.index > n2 && t2.push(e2.substring(n2, i2.index)), i2[1] && t2.push(i2[1]), n2 = i2.index + i2[0].length;
277
+ return n2 < e2.length && t2.push(e2.substring(n2)), t2;
278
+ }
279
+ navigatePath(e2, t2) {
280
+ let n2 = e2, r2 = [], i2 = (e3) => {
281
+ if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
282
+ r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
283
+ }, a2 = (e3, t3) => {
284
+ let i3 = e3 in g ? g[e3] : void 0;
285
+ if (i3 && i3 in t3) {
286
+ r2.push(i3), n2 = t3[i3];
287
+ return;
288
+ }
289
+ let a3 = Fe(e3);
290
+ if (a3 && a3 in t3) {
291
+ r2.push(a3), n2 = t3[a3];
292
+ return;
293
+ }
294
+ throw Error(`Cannot find key '${e3}' or its transformations at path ${this.buildPathString(r2)}`);
295
+ }, o2 = (e3, t3) => {
296
+ r2.push(e3), n2 = t3[e3];
297
+ };
298
+ for (let e3 of t2) {
299
+ if (this.NUMERIC_PATTERN.test(e3)) {
300
+ i2(e3);
301
+ continue;
302
+ }
303
+ if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e3}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
304
+ let t3 = n2;
305
+ if (e3 in n2) {
306
+ o2(e3, t3);
307
+ continue;
308
+ }
309
+ a2(e3, t3);
310
+ }
311
+ return { [this.buildPathString(r2)]: n2 };
312
+ }
313
+ buildPathString(e2) {
314
+ return e2.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN, `[`);
315
+ }
316
+ bracketToDotNotation(e2) {
317
+ return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
318
+ }
319
+ };
320
+ function Me(e2, t2) {
321
+ let n2 = e2?.modifiedFields;
322
+ if (!n2) return null;
323
+ let r2 = Ne(n2);
324
+ if (!r2) return null;
325
+ let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
326
+ e2 = { ...e2, modifiedFields: i2 };
327
+ let o2 = t2(e2), s2 = o2?.modifiedFields;
328
+ if (!s2) return null;
329
+ let c2 = Pe(s2, a2);
330
+ return c2 === null ? null : (o2.modifiedFields = c2, o2);
331
+ }
332
+ function Ne(e2) {
333
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
334
+ let t2 = new je(e2);
335
+ return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
336
+ } catch {
337
+ return null;
338
+ }
339
+ return null;
340
+ }
341
+ function Pe(e2, t2) {
342
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
343
+ return t2.flatten(e2);
344
+ } catch {
345
+ return null;
346
+ }
347
+ return null;
348
+ }
349
+ function Fe(e2) {
350
+ return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
351
+ }
352
+ function S() {
353
+ return { emit(e2, ...t2) {
354
+ for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
355
+ }, events: {}, on(e2, t2) {
356
+ return (this.events[e2] ||= []).push(t2), () => {
357
+ this.events[e2] = this.events[e2]?.filter((e3) => t2 !== e3);
358
+ };
359
+ } };
360
+ }
361
+ var Ie = (e2) => e2.__type === `event-definition`;
362
+ function C(e2, t2, n2, r2) {
363
+ let i2;
364
+ if (e2.isDomainEvent) {
365
+ let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
366
+ i2 = e3 ? e3?.deletedEntity ? { entity: e3?.deletedEntity, metadata: c2 } : { metadata: c2 } : t3 ? { data: t3.body, metadata: c2 } : o3 ? { entity: o3.currentEntity, metadata: c2, ...o3.modifiedFields ? { modifiedFields: o3.modifiedFields } : {} } : { entity: a3?.entity, metadata: c2 };
367
+ } else i2 = { data: n2, metadata: r2 };
368
+ let a2 = e2.transformations ?? ((e3) => e3), o2 = i2, s2 = i2;
369
+ if (s2.modifiedFields) {
370
+ let e3 = s2.modifiedFields;
371
+ if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
372
+ o2 = structuredClone(i2);
373
+ let e4 = Me(s2, a2);
374
+ if (e4) return t2(e4);
375
+ }
376
+ }
377
+ return t2(a2(o2));
378
+ }
379
+ function Le(e2) {
380
+ let t2 = /* @__PURE__ */ new Map(), n2 = S();
381
+ return { initModule(e3) {
382
+ return (r2) => {
383
+ let i2 = t2.get(e3.type) ?? [];
384
+ i2.push({ eventDefinition: e3, handler: r2 }), t2.set(e3.type, i2), n2.emit(`registered`, e3);
385
+ };
386
+ }, client: { ...n2, getRegisteredEvents: () => t2, async process(e3, n3 = { expectedEvents: [] }) {
387
+ let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e3), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e4) => ({ type: e4 }))];
388
+ if (c2.length > 0 && !c2.some(({ type: e4 }) => e4 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e4) => e4.type).join(`, `)}`);
389
+ let l2 = t2.get(r2) ?? [];
390
+ return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => C(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
391
+ }, async processRequest(e3, t3) {
392
+ let n3 = await e3.text();
393
+ return this.process(n3, t3);
394
+ }, async parseJWT(t3) {
395
+ let n3 = e2();
396
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
397
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3);
398
+ if (!i2) throw Error(`JWT is not valid`);
399
+ if (typeof r2.data != `string`) throw Error(`Unexpected type of JWT data: expected string, got ${typeof r2.data}`);
400
+ let a2 = JSON.parse(r2.data), o2 = a2.eventType, s2 = a2.accountInfo, c2 = a2.instanceId, l2 = a2.identity ? JSON.parse(a2.identity) : void 0;
401
+ return { instanceId: c2, eventType: o2, payload: JSON.parse(a2.data), identity: l2, accountInfo: s2 };
402
+ }, async parseRequest(e3) {
403
+ let t3 = await e3.text();
404
+ return this.parseJWT(t3);
405
+ }, async executeHandlers(e3) {
406
+ let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
407
+ if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e3.eventType)) throw Error(`Unexpected event type: ${e3.eventType}. Expected one of: ${n3.map((e4) => e4.type).join(`, `)}`);
408
+ let r2 = t2.get(e3.eventType) ?? [];
409
+ await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => C(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
410
+ }, apps: { AppInstalled: u(`AppInstalled`)(), AppRemoved: u(`AppRemoved`)() } } };
411
+ }
412
+ var Re = (e2) => e2.__type === `service-plugin-definition`;
413
+ function ze(e2) {
414
+ let t2 = /* @__PURE__ */ new Map(), n2 = S();
415
+ return { initModule(e3) {
416
+ return (r2) => {
417
+ let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
418
+ i2.push({ servicePluginDefinition: e3, implementation: r2 }), t2.set(e3.componentType.toLowerCase(), i2), n2.emit(`registered`, e3);
419
+ };
420
+ }, client: { ...n2, getRegisteredServicePlugins: () => t2, async parseJWT(t3) {
421
+ let n3 = e2();
422
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
423
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3, true);
424
+ if (!i2) throw Error(`JWT is not valid`);
425
+ if (typeof r2.data != `object` || r2.data === null || !(`metadata` in r2.data) || typeof r2.data.metadata != `object` || r2.data.metadata === null || !(`appExtensionType` in r2.data.metadata) || typeof r2.data.metadata.appExtensionType != `string`) throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);
426
+ return r2.data;
427
+ }, async process(e3) {
428
+ let t3 = await this.parseJWT(e3.body);
429
+ return this.executeHandler(t3, e3.url);
430
+ }, async parseRequest(e3) {
431
+ let t3 = await e3.text();
432
+ return this.parseJWT(t3);
433
+ }, async processRequest(e3) {
434
+ let t3 = await this.parseRequest(e3);
435
+ return this.processParsedRequest(t3, e3.url);
436
+ }, async processParsedRequest(e3, t3) {
437
+ try {
438
+ let n3 = await this.executeHandler(e3, t3);
439
+ return Response.json(n3);
440
+ } catch (e4) {
441
+ if (e4.errorType === `SPI` && e4.applicationCode && e4.httpCode) return Response.json({ applicationError: { code: e4.applicationCode, data: e4.data } }, { status: e4.httpCode });
442
+ throw e4;
443
+ }
444
+ }, async executeHandler(e3, n3) {
445
+ let r2 = e3.metadata.appExtensionType.toLowerCase(), i2 = t2.get(r2) ?? [];
446
+ if (i2.length === 0) throw Error(`No service plugin implementations found for component type ${r2}`);
447
+ if (i2.length > 1) throw Error(`Multiple service plugin implementations found for component type ${r2}. This is currently not supported`);
448
+ let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((e4) => n3.endsWith(e4.primaryHttpMappingPath));
449
+ if (!s2) throw Error(`Unexpect request: request url did not match any method: ` + n3);
450
+ let c2 = a2[s2.name];
451
+ if (!c2) throw Error(`Got request for service plugin method ${s2.name} but no implementation was provided. Available methods: ${Object.keys(a2).join(`, `)}`);
452
+ return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
453
+ } } };
454
+ }
455
+ var w = `X-Wix-Consistent`;
456
+ function Be(e2) {
457
+ let t2 = e2.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e3) => Promise.resolve({ headers: {} }) }, r2 = e2.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e2.host), o2 = () => e2.fetch ?? fetch, s2 = async (n3, r3) => {
458
+ let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [w]: t2[w] } : {} }, l2 = e2.host?.getErrorHandler?.();
459
+ try {
460
+ if (typeof n3 == `string` || n3 instanceof URL) {
461
+ let e3 = await i3(n3, { ...r3, headers: c3 });
462
+ l2?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
463
+ let a3 = T(e3);
464
+ return a3 && (t2[w] = a3), e3;
465
+ }
466
+ {
467
+ for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
468
+ let e3 = await i3(n3, r3);
469
+ l2?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
470
+ let a3 = T(e3);
471
+ return a3 && (t2[w] = a3), e3;
472
+ }
473
+ } catch (e3) {
474
+ throw l2?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
475
+ }
476
+ }, { client: c2, initModule: u2 } = ze(i2), { client: d2, initModule: re2 } = Le(i2), f2 = async (n3, r3) => {
477
+ let i3 = o2(), s3 = await a2(), c3 = ae(r3), l2 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [w]: t2[w] } : {} } }), u3 = T(l2);
478
+ return u3 && (t2[w] = u3), l2;
479
+ }, p2 = (t3, n3) => {
480
+ if (Ie(t3)) return re2(t3);
481
+ if (Re(t3)) return u2(t3);
482
+ if (se(t3) && e2.host) return ce(t3, e2.host);
483
+ if (typeof t3 == `function`) {
484
+ if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
485
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
486
+ return Ce(h(() => te(t3)) ? ee(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
487
+ let n4 = new URL(e3, `https://${r3}`);
488
+ return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
489
+ }, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
490
+ }
491
+ return oe(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[ne])])) : t3;
492
+ }, m2 = (e3) => {
493
+ for (let n3 in e3) t2[n3] = e3[n3];
494
+ };
495
+ return { ...e2.modules ? p2(e2.modules) : {}, get auth() {
496
+ let t3 = i2();
497
+ return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e2.host), t3;
498
+ }, setHeaders: m2, use: p2, enableContext(e3, t3 = { elevated: false }) {
499
+ e3 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ? l.elevatedClient = this : l.client = this;
500
+ }, fetch: (t3, n3) => {
501
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
502
+ return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
503
+ }, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
504
+ let i3 = e2?.host?.apiBaseUrl ?? `www.wixapis.com`, a3 = await f2(`https://${i3}/graphql/${r3.apiVersion}`, { method: `POST`, headers: { "Content-Type": `application/json` }, body: JSON.stringify({ query: t3, variables: n3 }) });
505
+ if (a3.status !== 200) throw new ie(`GraphQL request failed with status ${a3.status}`, a3);
506
+ let { data: o3, errors: s3 } = await a3.json();
507
+ return { data: o3 ?? {}, errors: s3 };
508
+ }, webhooks: d2, servicePlugins: c2 };
509
+ }
510
+ function T(e2) {
511
+ return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
512
+ }
513
+ var E = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
514
+ var Ve = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
515
+ var He = E;
516
+ function Ue(e2, t2) {
517
+ return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
518
+ }
519
+ function D(e2, { transformSystemFields: t2 = true } = {}) {
520
+ return t2 ? Ue(e2, He) : e2;
521
+ }
522
+ var We = `sort.fieldName`;
523
+ function Ge(e2, t2, n2) {
524
+ return (e2 === We || e2.endsWith(`.${We}`)) && typeof t2 == `string` ? Ue(t2, n2) : t2;
525
+ }
526
+ function O(e2, t2, n2) {
527
+ let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
528
+ if (Array.isArray(e3)) e3.forEach((e4) => {
529
+ i2(e4, n3);
530
+ });
531
+ else if (typeof e3 == `object` && e3) {
532
+ let a2 = e3;
533
+ Object.keys(a2).forEach((e4) => {
534
+ let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
535
+ if (r2(o2)) return;
536
+ let s2 = Ke(e4, t2);
537
+ s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = Ge(o2, a2[s2], t2), i2(a2[s2], o2);
538
+ });
539
+ }
540
+ };
541
+ return i2(e2, ``), e2;
542
+ }
543
+ function Ke(e2, t2) {
544
+ let n2;
545
+ return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
546
+ }
547
+ function qe(e2, t2 = []) {
548
+ return O(e2, E, t2);
549
+ }
550
+ function k(e2, t2 = []) {
551
+ return O(e2, Ve, t2);
552
+ }
553
+ function A(e2) {
554
+ return e2 ? new Date(e2) : void 0;
555
+ }
556
+ var j = /* @__PURE__ */ new WeakMap();
557
+ function M() {
558
+ return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
559
+ }
560
+ function N(e2, t2) {
561
+ let n2 = e2.get(t2);
562
+ return n2 || (n2 = M(), e2.set(t2, n2)), n2;
563
+ }
564
+ function Je(e2, t2) {
565
+ return t2 === `*` ? (e2.anyField ??= M(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), N(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), N(e2.fields, t2));
566
+ }
567
+ function Ye(e2) {
568
+ let t2 = M();
569
+ for (let n2 of e2) {
570
+ let e3 = n2.path.split(`.`).reduce(Je, t2);
571
+ e3.leaves ??= [], e3.leaves.push(n2);
572
+ }
573
+ return t2;
574
+ }
575
+ function Xe(e2) {
576
+ let t2 = j.get(e2);
577
+ return t2 || (t2 = Ye(e2), j.set(e2, t2)), t2;
578
+ }
579
+ function P(e2) {
580
+ return typeof e2 == `object` && !!e2;
581
+ }
582
+ function Ze(e2, { isRepeated: t2, isMap: n2 }, r2) {
583
+ return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? P(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
584
+ }
585
+ function F(e2, t2, n2) {
586
+ P(e2) && I(e2, t2, n2);
587
+ }
588
+ function Qe(e2, t2, n2) {
589
+ for (let [r2, i2] of t2) {
590
+ if (!(r2 in e2)) continue;
591
+ if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = Ze(e2[r2], t4, n2);
592
+ let t3 = e2[r2];
593
+ Array.isArray(t3) ? t3.forEach((e3) => F(e3, i2, n2)) : F(t3, i2, n2);
594
+ }
595
+ }
596
+ function $e(e2, t2, n2) {
597
+ for (let [r2, i2] of t2) {
598
+ let t3 = e2[r2];
599
+ P(t3) && Object.values(t3).forEach((e3) => F(e3, i2, n2));
600
+ }
601
+ }
602
+ function I(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
603
+ t2 && Qe(e2, t2, i2), n2 && $e(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => F(e3, r2, i2));
604
+ }
605
+ function L(e2, t2) {
606
+ if (!P(e2)) return e2;
607
+ for (let { paths: n2, transformFn: r2 } of t2) I(e2, Xe(n2), r2);
608
+ return e2;
609
+ }
610
+ function R(e2) {
611
+ return rt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
612
+ }
613
+ var et = /([\p{Ll}\d])(\p{Lu})/gu;
614
+ var tt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
615
+ var z = `$1\0$2`;
616
+ var nt = /[^\p{L}\d]+/giu;
617
+ function rt(e2) {
618
+ let t2 = e2.trim();
619
+ t2 = t2.replace(et, z).replace(tt, z), t2 = t2.replace(nt, `\0`);
620
+ let n2 = 0, r2 = t2.length;
621
+ for (; t2.charAt(n2) === `\0`; ) n2++;
622
+ if (n2 === r2) return [];
623
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
624
+ return t2.slice(n2, r2).split(/\0/g);
625
+ }
626
+ var it = (e2) => `validationError` in (e2.response?.data?.details ?? {});
627
+ var at = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
628
+ var ot = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
629
+ function st(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
630
+ if (typeof e2 != `object` || !e2) throw e2;
631
+ if (it(e2)) return ct(e2, t2, n2);
632
+ if (at(e2)) return lt(e2);
633
+ if (ot(e2)) {
634
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: R(n3), data: {} }, requestId: e2.requestId };
635
+ return B(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
636
+ }
637
+ return ut(e2);
638
+ }
639
+ var ct = (e2, t2, n2) => {
640
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = dt(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
641
+ return B(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
642
+ };
643
+ var B = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
644
+ var lt = (e2) => {
645
+ let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? R(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
646
+ return B(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
647
+ };
648
+ var ut = (e2) => B(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: R(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
649
+ var dt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
650
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
651
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
652
+ let r3 = t2[e3.field];
653
+ if (r3) return { ...e3, field: V(r3, i2) };
654
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
655
+ if (s2) {
656
+ let t3 = a2[s2];
657
+ if (t3) return { ...e3, field: e3.field.replace(s2, V(t3, i2)) };
658
+ }
659
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
660
+ });
661
+ };
662
+ var V = (e2, t2) => {
663
+ let n2 = ft(e2);
664
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
665
+ };
666
+ var ft = (e2) => {
667
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
668
+ return t2 && t2.groups && Number(t2.groups.argIndex);
669
+ };
670
+ function H() {
671
+ let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
672
+ if (e2) return { initWixModules(t3, n3) {
673
+ return U(() => e2(t3, n3));
674
+ }, fetchWithAuth() {
675
+ throw Error(`fetchWithAuth is not available in this context`);
676
+ }, graphql() {
677
+ throw Error(`graphql is not available in this context`);
678
+ } };
679
+ let t2 = typeof $wixContext < `u` ? $wixContext.client : l.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : l.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : l.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : l.elevatedClient;
680
+ if (t2 || n2) return { initWixModules(e3, r2) {
681
+ if (r2) {
682
+ if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
683
+ return U(() => n2.use(e3));
684
+ }
685
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
686
+ return U(() => t2.use(e3));
687
+ }, fetchWithAuth: (e3, n3) => {
688
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
689
+ return t2.fetchWithAuth(e3, n3);
690
+ }, getAuth() {
691
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
692
+ return t2.auth;
693
+ }, async graphql(e3, n3, r2) {
694
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
695
+ return t2.graphql(e3, n3, r2);
696
+ } };
697
+ }
698
+ function U(e2) {
699
+ let t2 = globalThis.__wix_context__, n2 = { client: l.client, elevatedClient: l.elevatedClient }, r2;
700
+ globalThis.__wix_context__ = void 0, l.client = void 0, l.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
701
+ try {
702
+ return e2();
703
+ } finally {
704
+ globalThis.__wix_context__ = t2, l.client = n2.client, l.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
705
+ }
706
+ }
707
+ function pt(e2, t2) {
708
+ return (...n2) => {
709
+ let r2 = H();
710
+ return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
711
+ };
712
+ }
713
+ function mt(e2) {
714
+ let t2 = (...t3) => {
715
+ let n2 = H();
716
+ return n2 ? n2.initWixModules(e2).apply(void 0, t3) : () => ({ slug: e2.type });
717
+ };
718
+ return t2.__type = e2.__type, t2.type = e2.type, t2.isDomainEvent = e2.isDomainEvent, t2.transformations = e2.transformations, t2;
719
+ }
720
+ function ht(e2, t2 = false) {
721
+ return pt(e2, t2);
722
+ }
723
+ function gt(e2, t2) {
724
+ let n2 = W(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
725
+ return t2 && r2 ? new URLSearchParams({ ".r": yt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
726
+ r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
727
+ }), e3), new URLSearchParams());
728
+ }
729
+ function _t(e2) {
730
+ let t2 = Mt(At(e2.host), e2.domainToMappings);
731
+ return Vt(Rt(e2.protoPath, e2.data || {}), t2);
732
+ }
733
+ function W(e2, t2 = ``) {
734
+ let n2 = {};
735
+ return Object.entries(e2).forEach(([e3, r2]) => {
736
+ let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = vt(t2, e3);
737
+ if (i2) {
738
+ let e4 = W(r2, a2);
739
+ Object.assign(n2, e4);
740
+ } else n2[a2] = r2;
741
+ }), n2;
742
+ }
743
+ function vt(e2, t2) {
744
+ return `${e2}${e2 ? `.` : ``}${t2}`;
745
+ }
746
+ var yt = (e2) => {
747
+ let t2 = new TextEncoder().encode(e2);
748
+ return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
749
+ };
750
+ var bt = [`wix.com`, `editorx.com`];
751
+ var xt = `_`;
752
+ var St = `*.`;
753
+ var Ct = RegExp(`\\.(${bt.join(`|`)})$`);
754
+ var wt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
755
+ var Tt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
756
+ var Et = `dev.wix-code.com`;
757
+ var Dt = /{(.*)}/;
758
+ var Ot = RegExp(`\\.(${wt.join(`|`)})$`);
759
+ var kt = RegExp(`.*\\.${Et}$`);
760
+ function At(e2) {
761
+ return jt(e2).replace(Ct, `._base_domain_`).replace(Ot, `._api_base_domain_`).replace(kt, `*.dev.wix-code.com`);
762
+ }
763
+ function jt(e2) {
764
+ return Tt[e2] ?? e2;
765
+ }
766
+ function Mt(e2, t2) {
767
+ let n2 = t2[e2];
768
+ if (n2) return n2;
769
+ let r2 = Nt(e2, t2) ?? Pt(e2, t2);
770
+ if (!r2) {
771
+ if (It(e2)) {
772
+ let e3 = t2[Lt];
773
+ if (e3) return e3;
774
+ }
775
+ let n3 = t2[xt];
776
+ if (n3) return n3;
777
+ }
778
+ return r2 ?? [];
779
+ }
780
+ function Nt(e2, t2) {
781
+ return Object.entries(t2).find(([t3]) => {
782
+ let [, ...n2] = e2.split(`.`);
783
+ return n2.join(`.`) === t3;
784
+ })?.[1];
785
+ }
786
+ function Pt(e2, t2) {
787
+ let [n2] = Object.entries(t2).filter(([t3]) => Ft(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
788
+ if (!n2) return;
789
+ let [, r2] = n2;
790
+ return r2;
791
+ }
792
+ function Ft(e2, t2) {
793
+ if (!t2.startsWith(St)) return false;
794
+ let n2 = t2.slice(1);
795
+ return e2.length > n2.length && e2.endsWith(n2);
796
+ }
797
+ function It(e2) {
798
+ return !!e2.match(/\._base_domain_$/);
799
+ }
800
+ var Lt = `www._base_domain_`;
801
+ function Rt(e2, t2) {
802
+ return e2.split(`/`).map((e3) => zt(e3, t2)).join(`/`);
803
+ }
804
+ function zt(e2, t2) {
805
+ let n2 = e2.match(Dt) || [], r2 = n2[1];
806
+ return r2 ? Bt(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
807
+ }
808
+ function Bt(e2, t2, n2, r2) {
809
+ let i2 = e2;
810
+ for (let e3 of t2.split(`.`)) {
811
+ if (!i2) return n2;
812
+ i2 = i2[e3];
813
+ }
814
+ return `${i2}${r2}`;
815
+ }
816
+ function Vt(e2, t2) {
817
+ let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
818
+ return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
819
+ }
820
+ function G(e2) {
821
+ return mt(e2);
822
+ }
823
+ function K(e2) {
824
+ return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
825
+ }
826
+ var Ht = `x-wix-linguist`;
827
+ var Ut = `00000000-0000-0000-0000-000000000000`;
828
+ var Wt = `false`;
829
+ var Gt = () => {
830
+ let e2 = q(`language`), t2 = q(`locale`);
831
+ if (e2) return { [Ht]: [e2, t2 || e2, Wt, Ut].join(`|`) };
832
+ };
833
+ function Kt() {
834
+ let e2 = null, t2 = null;
835
+ return { promise: new Promise((n2, r2) => {
836
+ e2 = n2, t2 = r2;
837
+ }), resolve: e2, reject: t2 };
838
+ }
839
+ var qt = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
840
+ var q = (e2) => qt()?.[e2];
841
+ var Jt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
842
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = Xt();
843
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: q(`language`), locale: q(`locale`), get passThroughHeaders() {
844
+ return Gt();
845
+ } } };
846
+ }, auth: (e3) => {
847
+ let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
848
+ !e3 && Yt() && (e3 = t2?.getAccessTokenFunction?.());
849
+ let n2 = false, { resolve: r2, promise: i2 } = Kt();
850
+ return { getAuthHeaders: async () => {
851
+ if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
852
+ return { headers: { Authorization: await e3() } };
853
+ }, getAccessTokenInjector: () => (n2 = true, (e4) => {
854
+ r2(e4);
855
+ }) };
856
+ } });
857
+ function Yt() {
858
+ return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
859
+ }
860
+ function Xt() {
861
+ let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
862
+ if (!e2) return;
863
+ let t2 = new URL(e2);
864
+ return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
865
+ }
866
+ var Zt = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
867
+ if (!e2) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
868
+ return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
869
+ }, getAccessToken: () => {
870
+ throw Error(`Not implemented`);
871
+ }, observeState: () => ({ disconnect: () => {
872
+ } }) });
873
+ var J = Jt({ createHost: function(e2) {
874
+ let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
875
+ if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
876
+ return { channel: Zt({ clientSdk: t2, applicationId: n2 }), close: () => {
877
+ } };
878
+ } });
879
+ var Qt = (e2, t2) => {
880
+ let n2 = J.host({ applicationId: e2, componentId: t2 }), r2 = J.auth();
881
+ return Be({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
882
+ };
883
+ var $t = (e2) => Qt(`215238eb-22a5-4c36-9e7b-e7c08025e04e`, e2);
884
+ function en(e2) {
885
+ if (e2.status === `fulfilled`) return e2.value;
886
+ throw e2.status === `rejected` ? e2.reason : e2.status === `pending` ? e2 : (e2.status = `pending`, e2.then((t2) => {
887
+ e2.status = `fulfilled`, e2.value = t2;
888
+ }, (t2) => {
889
+ e2.status = `rejected`, e2.reason = t2;
890
+ }), e2);
891
+ }
892
+ function Y(e2) {
893
+ return e2;
894
+ }
895
+ var tn = Y(`@wix/site-service-warmup-data`);
896
+ async function nn(e2, t2, n2) {
897
+ let r2 = typeof window > `u`;
898
+ if (!r2 && e2) try {
899
+ let n3 = await e2.get(t2);
900
+ if (n3 !== null) return n3;
901
+ } catch {
902
+ }
903
+ let i2 = await n2();
904
+ if (r2 && e2) try {
905
+ e2.set(t2, i2);
906
+ } catch {
907
+ }
908
+ return i2;
909
+ }
910
+ function rn(e2, t2) {
911
+ let n2 = (0, import_services_manager_react.useGetService)(), [r2] = (0, import_react.useState)(() => {
912
+ let r3;
913
+ try {
914
+ r3 = n2(tn);
915
+ } catch {
916
+ r3 = null;
917
+ }
918
+ return nn(r3, e2, t2);
919
+ });
920
+ return r2;
921
+ }
922
+ function X(e2) {
923
+ if (!e2) return;
924
+ let t2 = ``;
925
+ return (e2.filename || e2.altText) && (t2 = `/${encodeURIComponent(e2.filename || e2.altText)}`), e2.id ? `wix:image://v1/${e2.id}${t2}#originWidth=${e2.width}&originHeight=${e2.height}` : e2.url;
926
+ }
927
+ function an(e2, t2, n2 = {}) {
928
+ let r2 = (r3, i3) => an(e2, t2, { ...n2, [r3]: i3 }), i2 = () => Object.keys(n2).length === 0 ? {} : { [D(e2, t2)]: n2 };
929
+ return { get filter() {
930
+ return i2();
931
+ }, eq: (e3) => r2(`$eq`, e3), ne: (e3) => r2(`$ne`, e3), gt: (e3) => r2(`$gt`, e3), gte: (e3) => r2(`$gte`, e3), lt: (e3) => r2(`$lt`, e3), lte: (e3) => r2(`$lte`, e3), startsWith: (e3) => r2(`$startsWith`, e3), endsWith: (e3) => r2(`$endsWith`, e3), contains: (e3) => r2(`$contains`, e3), in: (e3) => r2(`$in`, e3), nin: (e3) => r2(`$nin`, e3), hasSome: (e3) => r2(`$hasSome`, e3), hasAll: (e3) => r2(`$hasAll`, e3), exists: (e3 = true) => r2(`$exists`, e3), isEmpty: (e3 = true) => r2(`$isEmpty`, e3), isNotEmpty: () => r2(`$ne`, null) };
932
+ }
933
+ function on(e2) {
934
+ return Object.assign((t2) => an(t2, e2), { and: (...e3) => ({ filter: { $and: e3.map((e4) => e4.filter) } }), or: (...e3) => ({ filter: { $or: e3.map((e4) => e4.filter) } }), not: (e3) => ({ filter: { $not: e3.filter } }) });
935
+ }
936
+ function sn(e2) {
937
+ return (t2) => ({ asc: () => ({ sort: { fieldName: D(t2, e2), order: `ASC` } }), desc: () => ({ sort: { fieldName: D(t2, e2), order: `DESC` } }) });
938
+ }
939
+ function cn(e2) {
940
+ return () => {
941
+ let t2 = {}, n2 = { withFilter(e3) {
942
+ return t2 = { ...t2, filter: e3.filter }, n2;
943
+ }, withFields(...r2) {
944
+ return t2 = { ...t2, fields: r2.map((t3) => D(t3, e2)) }, n2;
945
+ }, withSorting(...e3) {
946
+ return t2 = { ...t2, sort: e3.map((e4) => e4.sort) }, n2;
947
+ }, withPaging(e3) {
948
+ return t2 = { ...t2, paging: e3 }, n2;
949
+ }, build() {
950
+ return t2;
951
+ } };
952
+ return n2;
953
+ };
954
+ }
955
+ function ln(e2) {
956
+ return { QueryBuilder: cn(e2), Filter: on(e2), Sort: sn(e2) };
957
+ }
958
+ function un(e2) {
959
+ let t2 = {}, n2 = { get search() {
960
+ return t2;
961
+ }, expression(e3) {
962
+ return t2 = { ...t2, expression: e3 }, n2;
963
+ }, mode(e3) {
964
+ return t2 = { ...t2, mode: e3 }, n2;
965
+ }, fields(r2) {
966
+ return t2 = { ...t2, fields: r2.map((t3) => D(t3, e2)) }, n2;
967
+ }, fuzzy(e3 = true) {
968
+ return t2 = { ...t2, fuzzy: e3 }, n2;
969
+ } };
970
+ return n2;
971
+ }
972
+ function dn(e2) {
973
+ return (t2) => {
974
+ let n2 = un(e2);
975
+ return t2 === void 0 ? n2 : n2.expression(t2);
976
+ };
977
+ }
978
+ function fn(e2) {
979
+ let t2 = { ...e2, type: `VALUE`, value: { ...e2.value } }, n2 = { get aggregation() {
980
+ return t2;
981
+ }, sortBy(e3, r2) {
982
+ return t2 = { ...t2, value: { ...t2.value, sortType: e3, sortDirection: r2 } }, n2;
983
+ }, limit(e3) {
984
+ return t2 = { ...t2, value: { ...t2.value, limit: e3 } }, n2;
985
+ }, excludeMissingValues() {
986
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `EXCLUDE` } }, n2;
987
+ }, includeMissingValues() {
988
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `INCLUDE` } }, n2;
989
+ }, includeValues(e3) {
990
+ return t2 = { ...t2, value: { ...t2.value, includeOptions: { addToBucket: e3 } } }, n2;
991
+ } };
992
+ return n2;
993
+ }
994
+ function pn(e2) {
995
+ let t2 = { ...e2, type: `RANGE`, range: { buckets: [] } }, n2 = { get aggregation() {
996
+ return t2;
997
+ }, withBuckets(...e3) {
998
+ return t2 = { ...t2, range: { buckets: e3 } }, n2;
999
+ } };
1000
+ return n2;
1001
+ }
1002
+ function mn(e2) {
1003
+ let t2 = { ...e2, type: `DATE_HISTOGRAM`, dateHistogram: {} }, n2 = { get aggregation() {
1004
+ return t2;
1005
+ }, interval(e3) {
1006
+ return t2 = { ...t2, dateHistogram: { interval: e3 } }, n2;
1007
+ } };
1008
+ return n2;
1009
+ }
1010
+ function hn(e2) {
1011
+ let t2 = { ...e2, type: `SCALAR`, scalar: {} }, n2 = { get aggregation() {
1012
+ return t2;
1013
+ }, type(e3) {
1014
+ return t2 = { ...t2, scalar: { type: e3 } }, n2;
1015
+ } };
1016
+ return n2;
1017
+ }
1018
+ function gn(e2) {
1019
+ let t2 = { ...e2, type: `NESTED`, nested: { nestedAggregations: [] } }, n2 = { get aggregation() {
1020
+ return t2;
1021
+ }, addNestedAggregation(e3) {
1022
+ let r2 = e3.aggregation, i2 = [...t2.nested?.nestedAggregations ?? [], r2];
1023
+ return t2 = { ...t2, nested: { nestedAggregations: i2 } }, n2;
1024
+ } };
1025
+ return n2;
1026
+ }
1027
+ function _n(e2, t2) {
1028
+ let n2 = { name: e2 }, r2 = { get aggregation() {
1029
+ return n2;
1030
+ }, ofType(e3) {
1031
+ return n2 = { ...n2, type: e3 }, r2;
1032
+ }, onField(e3) {
1033
+ return n2 = { ...n2, fieldPath: D(e3, t2) }, r2;
1034
+ }, asValueAggregation() {
1035
+ return fn(n2);
1036
+ }, asRangeAggregation() {
1037
+ return pn(n2);
1038
+ }, asDateHistogramAggregation() {
1039
+ return mn(n2);
1040
+ }, asScalarAggregation() {
1041
+ return hn(n2);
1042
+ }, asNestedAggregation() {
1043
+ return gn(n2);
1044
+ } };
1045
+ return r2;
1046
+ }
1047
+ function vn(e2) {
1048
+ return (t2) => _n(t2, e2);
1049
+ }
1050
+ function yn() {
1051
+ return () => {
1052
+ let e2 = {}, t2 = { withFilter(n2) {
1053
+ return e2 = { ...e2, filter: n2.filter }, t2;
1054
+ }, withSearchClause(n2) {
1055
+ return e2 = { ...e2, search: n2.search }, t2;
1056
+ }, withSorting(...n2) {
1057
+ return e2 = { ...e2, sort: n2.map((e3) => e3.sort) }, t2;
1058
+ }, withAggregation(...n2) {
1059
+ return e2 = { ...e2, aggregations: n2.map((e3) => e3.aggregation) }, t2;
1060
+ }, withPaging(n2) {
1061
+ return e2 = { ...e2, paging: n2 }, t2;
1062
+ }, withTimeZone(n2) {
1063
+ return e2 = { ...e2, timeZone: n2 }, t2;
1064
+ }, build() {
1065
+ return e2;
1066
+ } };
1067
+ return t2;
1068
+ };
1069
+ }
1070
+ function bn(e2) {
1071
+ return { SearchBuilder: yn(), Filter: on(e2), Sort: sn(e2), SearchParams: dn(e2), Aggregation: vn(e2) };
1072
+ }
1073
+ function xn(e2) {
1074
+ return _t(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/categories`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/categories/v1/bulk/categories`, destPath: `/v1/bulk/categories` }, { srcPath: `/categories/v1/categories`, destPath: `/v1/categories` }], "manage._base_domain_": [{ srcPath: `/_api/categories`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/categories-service`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/categories-service`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/categories-service`, destPath: `` }], _: [{ srcPath: `/categories/v1/bulk/categories`, destPath: `/v1/bulk/categories` }, { srcPath: `/categories/v1/categories`, destPath: `/v1/categories` }] } }));
1075
+ }
1076
+ var Sn = `@wix/auto_sdk_categories_categories`;
1077
+ function Cn(e2) {
1078
+ function t2({ host: t3 }) {
1079
+ return { entityFqdn: `wix.categories.v1.category`, method: `GET`, methodFqn: `com.wix.categories.api.v1.CategoriesService.GetCategory`, packageName: Sn, migrationOptions: { optInTransformResponse: true }, url: xn({ protoPath: `/v1/categories/{categoryId}`, data: e2, host: t3 }), params: gt(e2), transformResponse: (e3) => L(e3, [{ transformFn: A, paths: [{ path: `category.createdDate` }, { path: `category.updatedDate` }, { path: `category.image.urlExpirationDate` }, { path: `category.richContentDescription.metadata.createdTimestamp` }, { path: `category.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: K, paths: [{ path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `category.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `category.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `category.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `category.richContentDescription.nodes.imageData.image.duration` }, { path: `category.richContentDescription.nodes.imageData.crop.x` }, { path: `category.richContentDescription.nodes.imageData.crop.y` }, { path: `category.richContentDescription.nodes.imageData.crop.width` }, { path: `category.richContentDescription.nodes.imageData.crop.height` }, { path: `category.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `category.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `category.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `category.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `category.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `category.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `category.richContentDescription.nodes.videoData.video.duration` }, { path: `category.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `category.richContentDescription.nodes.audioData.audio.duration` }, { path: `category.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `category.richContentDescription.nodes.shapeData.shape.duration` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.tocData.fontSize` }, { path: `category.richContentDescription.nodes.tocData.itemSpacing` }, { path: `category.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }]) };
1080
+ }
1081
+ return t2;
1082
+ }
1083
+ var Z = ((e2) => (e2.BREADCRUMBS_INFO = `BREADCRUMBS_INFO`, e2.DESCRIPTION = `DESCRIPTION`, e2.RICH_CONTENT_DESCRIPTION = `RICH_CONTENT_DESCRIPTION`, e2))(Z || {});
1084
+ async function wn(e2, t2, n2) {
1085
+ let { httpClient: r2, sideEffects: i2 } = arguments[3], a2 = Cn(qe({ categoryId: e2, treeReference: t2, fields: n2?.fields }, []));
1086
+ i2?.onSiteCall?.();
1087
+ try {
1088
+ let e3 = await r2.request(a2);
1089
+ return i2?.onSuccess?.(e3), k(L(e3.data, [{ transformFn: X, paths: [{ path: `category.image` }] }]), [`category.richContentDescription`])?.category;
1090
+ } catch (e3) {
1091
+ let t3 = st(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { categoryId: `$[0]`, treeReference: `$[1]`, fields: `$[2].fields` }, singleArgumentUnchanged: false }, [`categoryId`, `treeReference`, `options`]);
1092
+ throw i2?.onError?.(e3), t3;
1093
+ }
1094
+ }
1095
+ ({ ...ln() }, { ...bn() });
1096
+ function Tn(e2) {
1097
+ return (t2, n2, r2) => wn(t2, n2, r2, { httpClient: e2 });
1098
+ }
1099
+ var En = u(`wix.categories.v1.category_category_moved`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
1100
+ var Dn = u(`wix.categories.v1.category_created`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: X, paths: [{ path: `entity.image` }] }, { transformFn: K, paths: [{ path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `entity.richContentDescription.nodes.imageData.image.duration` }, { path: `entity.richContentDescription.nodes.imageData.crop.x` }, { path: `entity.richContentDescription.nodes.imageData.crop.y` }, { path: `entity.richContentDescription.nodes.imageData.crop.width` }, { path: `entity.richContentDescription.nodes.imageData.crop.height` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `entity.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `entity.richContentDescription.nodes.videoData.video.duration` }, { path: `entity.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.audioData.audio.duration` }, { path: `entity.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.shapeData.shape.duration` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.tocData.fontSize` }, { path: `entity.richContentDescription.nodes.tocData.itemSpacing` }, { path: `entity.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
1101
+ var On = u(`wix.categories.v1.category_deleted`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `undefined.createdDate` }, { path: `undefined.updatedDate` }, { path: `undefined.richContentDescription.metadata.createdTimestamp` }, { path: `undefined.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: X, paths: [{ path: `undefined.image` }] }, { transformFn: K, paths: [{ path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `undefined.richContentDescription.nodes.imageData.image.duration` }, { path: `undefined.richContentDescription.nodes.imageData.crop.x` }, { path: `undefined.richContentDescription.nodes.imageData.crop.y` }, { path: `undefined.richContentDescription.nodes.imageData.crop.width` }, { path: `undefined.richContentDescription.nodes.imageData.crop.height` }, { path: `undefined.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `undefined.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `undefined.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `undefined.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `undefined.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `undefined.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `undefined.richContentDescription.nodes.videoData.video.duration` }, { path: `undefined.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `undefined.richContentDescription.nodes.audioData.audio.duration` }, { path: `undefined.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.shapeData.shape.duration` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.tocData.fontSize` }, { path: `undefined.richContentDescription.nodes.tocData.itemSpacing` }, { path: `undefined.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
1102
+ var kn = u(`wix.categories.v1.category_item_added_to_category`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
1103
+ var An = u(`wix.categories.v1.category_item_removed_from_category`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
1104
+ var jn = u(`wix.categories.v1.category_items_arranged_in_category`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
1105
+ var Mn = u(`wix.categories.v1.category_updated`, true, (e2) => k(L(e2, [{ transformFn: A, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }, { path: `modifiedFields.richContentDescription.metadata.createdTimestamp` }, { path: `modifiedFields.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: X, paths: [{ path: `entity.image` }, { path: `modifiedFields.image` }] }, { transformFn: K, paths: [{ path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `entity.richContentDescription.nodes.imageData.image.duration` }, { path: `entity.richContentDescription.nodes.imageData.crop.x` }, { path: `entity.richContentDescription.nodes.imageData.crop.y` }, { path: `entity.richContentDescription.nodes.imageData.crop.width` }, { path: `entity.richContentDescription.nodes.imageData.crop.height` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `entity.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `entity.richContentDescription.nodes.videoData.video.duration` }, { path: `entity.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.audioData.audio.duration` }, { path: `entity.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.shapeData.shape.duration` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.tocData.fontSize` }, { path: `entity.richContentDescription.nodes.tocData.itemSpacing` }, { path: `entity.richContentDescription.nodes.smartBlockCellData.shape.duration` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `modifiedFields.richContentDescription.nodes.imageData.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.x` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.y` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.width` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.height` }, { path: `modifiedFields.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `modifiedFields.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `modifiedFields.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.videoData.video.duration` }, { path: `modifiedFields.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `modifiedFields.richContentDescription.nodes.audioData.audio.duration` }, { path: `modifiedFields.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.shapeData.shape.duration` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.tocData.fontSize` }, { path: `modifiedFields.richContentDescription.nodes.tocData.itemSpacing` }, { path: `modifiedFields.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
1106
+ var Nn = ht(Tn);
1107
+ G(En), G(Dn), G(On), G(kn), G(An), G(jn), G(Mn);
1108
+ function Pn(e2) {
1109
+ if (!e2) return null;
1110
+ let t2 = e2.match(/image:\/\/v1\/([^/#]+)/);
1111
+ return t2?.[1] ? t2[1] : e2.match(/\/media\/([^/]+)/)?.[1] ?? null;
1112
+ }
1113
+ function Fn(e2) {
1114
+ if (!e2) return null;
1115
+ let t2 = e2.match(/#originWidth=(\d+)&originHeight=(\d+)/);
1116
+ return t2 ? { width: parseInt(t2[1], 10), height: parseInt(t2[2], 10) } : null;
1117
+ }
1118
+ var In = (e2) => `/category/${e2}`;
1119
+ var Ln = (e2) => ({ ...e2, nodes: e2.nodes ?? [] });
1120
+ var Rn = (e2) => {
1121
+ if (!e2) return;
1122
+ let t2 = Fn(e2);
1123
+ return { uri: Pn(e2) ?? void 0, url: e2, width: t2?.width, height: t2?.height };
1124
+ };
1125
+ var zn = (e2) => e2.filter((e3) => e3.categoryId).map((e3) => {
1126
+ let t2 = e3.categorySlug ?? ``;
1127
+ return { id: e3.categoryId ?? ``, name: e3.categoryName ?? ``, slug: t2, href: In(t2) };
1128
+ });
1129
+ var Bn = (e2) => ({ type: e2.type, props: e2.props ?? void 0, meta: e2.meta ?? void 0, children: e2.children, custom: e2.custom, disabled: e2.disabled });
1130
+ var Vn = (e2) => {
1131
+ if (e2) return { preventAutoRedirect: e2.preventAutoRedirect, keywords: e2.keywords?.map((e3) => ({ term: e3.term, isMain: e3.isMain, origin: e3.origin ?? void 0 })) };
1132
+ };
1133
+ var Hn = (e2) => {
1134
+ if (e2) return { tags: e2.tags?.map(Bn), settings: Vn(e2.settings) };
1135
+ };
1136
+ function Un(e2) {
1137
+ return { id: e2._id ?? ``, name: e2.name ?? ``, slug: e2.slug ?? ``, description: e2.description ?? void 0, itemCounter: e2.itemCounter, parentCategoryId: e2.parentCategory?._id ?? void 0, seoData: Hn(e2.seoData), richContentDescription: e2.richContentDescription ? Ln(e2.richContentDescription) : void 0, image: Rn(e2.image), breadcrumbs: zn(e2.breadcrumbsInfo?.breadcrumbs ?? []) };
1138
+ }
1139
+ var Wn = { appNamespace: `@wix/stores`, treeKey: null };
1140
+ var Gn = [Z.BREADCRUMBS_INFO, Z.DESCRIPTION, Z.RICH_CONTENT_DESCRIPTION];
1141
+ var Kn = (e2, t2) => {
1142
+ if (!e2?._id || e2.visible === false) throw Error(t2);
1143
+ return Un(e2);
1144
+ };
1145
+ async function qn(e2) {
1146
+ return Kn(await Nn(e2, Wn, { fields: Gn }), `Category not found for id: ${e2}`);
1147
+ }
1148
+ var Jn = `wixstores-storefront-builder:category-info-context-data`;
1149
+ function Yn(e2) {
1150
+ return rn(`${Jn}:${e2}`, () => qn(e2));
1151
+ }
1152
+ var Xn = Y(`@wix/site-service-url`);
1153
+ var Q = `215238eb-22a5-4c36-9e7b-e7c08025e04e`;
1154
+ `${Q}`, `${Q}`;
1155
+ var Zn = function(e2) {
1156
+ return e2.SIDE_CART = `ecom_side_cart`, e2.CART = `shopping_cart`, e2.CHECKOUT = `checkout`, e2.PRODUCT_PAGE = `product-page-builder`, e2.CATEGORY_PAGE = `category-page-builder`, e2;
1157
+ }({});
1158
+ var Qn = () => {
1159
+ let e2 = (0, import_services_manager_react.useService)(Xn), t2 = (0, import_react.useCallback)((t3, n2) => {
1160
+ let r2 = e2.appSectionRelativeUrl(Q, t3, true);
1161
+ if (r2) return `./${r2.replace(/^\//, ``).replace(/\/$/, ``)}/${encodeURIComponent(n2)}`;
1162
+ }, [e2]);
1163
+ return { getPageRelativeUrl: t2, getPageAbsoluteUrl: (0, import_react.useCallback)((n2, r2) => {
1164
+ let i2 = t2(n2, r2);
1165
+ if (i2) return new URL(i2, `${e2.siteUrl.replace(/\/$/, ``)}/`).href;
1166
+ }, [t2, e2]) };
1167
+ };
1168
+ function $n(e2) {
1169
+ let { getPageAbsoluteUrl: t2 } = Qn(), n2 = (0, import_react.useMemo)(() => {
1170
+ if (!e2.slug) return;
1171
+ let n3 = t2(Zn.CATEGORY_PAGE, e2.slug);
1172
+ return n3 ? { href: n3 } : void 0;
1173
+ }, [e2.slug, t2]);
1174
+ return (0, import_react.useMemo)(() => ({ id: e2.id, name: e2.name, slug: e2.slug, link: n2, description: e2.description, richContentDescription: e2.richContentDescription, image: e2.image, breadcrumbs: e2.breadcrumbs }), [e2, n2]);
1175
+ }
1176
+ var $ = (0, import_react.createContext)(null);
1177
+ $.displayName = `CategoryInfoContext`;
1178
+ function er() {
1179
+ let e2 = (0, import_react.useContext)($);
1180
+ if (!e2) throw Error(`useCategoryInfoContext must be used within a category info context provider`);
1181
+ return e2;
1182
+ }
1183
+ function tr({ categoryPromise: e2, children: t2 }) {
1184
+ let n2 = $n(en(e2));
1185
+ return (0, import_jsx_runtime.jsx)($.Provider, { value: n2, children: t2 });
1186
+ }
1187
+ function nr({ categoryId: t2, children: n2 }) {
1188
+ let r2 = Yn(t2);
1189
+ return (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: (0, import_jsx_runtime.jsx)(tr, { categoryPromise: r2, children: n2 }) });
1190
+ }
1191
+ function rr({ children: e2, value: t2, categoryId: n2 }) {
1192
+ return t2 === void 0 ? n2 ? (0, import_jsx_runtime.jsx)(nr, { categoryId: n2, children: e2 }, n2) : null : (0, import_jsx_runtime.jsx)($.Provider, { value: t2, children: e2 });
1193
+ }
1194
+ var ir = $t(`0d8869b2-7691-4ee2-9d0b-90d72f34edd0`);
1195
+ // Annotate the CommonJS export names for ESM import in node:
1196
+ 0 && (module.exports = {
1197
+ CategoryInfoContextProvider,
1198
+ injectAccessTokenGetter,
1199
+ useCategoryInfoContext
1200
+ });
1201
+ //# sourceMappingURL=context-category-info-context-provider.js.map