@faststore/core 2.2.42 → 2.2.44

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 (45) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/eslint/.cache_1gneedd +1 -1
  6. package/.next/cache/next-server.js.nft.json +1 -1
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/next-server.js.nft.json +1 -1
  12. package/.next/prerender-manifest.json +1 -1
  13. package/.next/routes-manifest.json +1 -1
  14. package/.next/server/chunks/117.js +1 -1
  15. package/.next/server/chunks/312.js +4 -4
  16. package/.next/server/chunks/350.js +2650 -16
  17. package/.next/server/chunks/390.js +1 -1
  18. package/.next/server/chunks/404.js +434 -0
  19. package/.next/server/chunks/57.js +434 -0
  20. package/.next/server/chunks/732.js +3 -3
  21. package/.next/server/chunks/74.js +5 -5
  22. package/.next/server/chunks/988.js +1 -1
  23. package/.next/server/middleware-build-manifest.js +1 -1
  24. package/.next/server/pages/[...slug].js +13 -21
  25. package/.next/server/pages/[...slug].js.nft.json +1 -1
  26. package/.next/server/pages/[slug]/p.js +15 -23
  27. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  28. package/.next/server/pages/api/graphql.js +2631 -96
  29. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  30. package/.next/server/pages/en-US/404.html +2 -2
  31. package/.next/server/pages/en-US/500.html +2 -2
  32. package/.next/server/pages/en-US/account.html +2 -2
  33. package/.next/server/pages/en-US/checkout.html +2 -2
  34. package/.next/server/pages/en-US/login.html +2 -2
  35. package/.next/server/pages/en-US/s.html +2 -2
  36. package/.next/server/pages/en-US.html +2 -2
  37. package/.next/server/pages-manifest.json +2 -2
  38. package/.next/trace +80 -78
  39. package/.turbo/turbo-build.log +1 -1
  40. package/.turbo/turbo-test.log +11 -16
  41. package/package.json +20 -16
  42. package/.next/server/chunks/52.js +0 -4007
  43. package/.next/server/chunks/817.js +0 -4007
  44. /package/.next/static/{A0luZO19pCRpHHJjixWd9 → MJDhrWnxP4OY6Sz-u3PEu}/_buildManifest.js +0 -0
  45. /package/.next/static/{A0luZO19pCRpHHJjixWd9 → MJDhrWnxP4OY6Sz-u3PEu}/_ssgManifest.js +0 -0
@@ -3,27 +3,2654 @@ exports.id = 350;
3
3
  exports.ids = [350];
4
4
  exports.modules = {
5
5
 
6
- /***/ 4850:
7
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6
+ /***/ 8608:
7
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
8
+
9
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
10
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
+ /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
12
+ /* harmony export */ });
13
+ /* unused harmony export stringify */
14
+ /* harmony import */ var _graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8722);
15
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__]);
16
+ _graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
17
+
18
+ const NAME = "cacheControl";
19
+ const stringify = ({ scope = "private", sMaxAge = 0, staleWhileRevalidate = 0 }) => `${scope}, s-maxage=${sMaxAge}, stale-while-revalidate=${staleWhileRevalidate}`;
20
+ const min = (a, b) => {
21
+ if (typeof a === "number" && typeof b === "number") {
22
+ return a > b ? b : a;
23
+ }
24
+ if (typeof a === "number") {
25
+ return a;
26
+ }
27
+ return b;
28
+ };
29
+ const minScope = (a, b) => {
30
+ if (typeof a === "string" && typeof b === "string") {
31
+ return a === "public" && b === "public" ? "public" : "private";
32
+ }
33
+ return a || b;
34
+ };
35
+ const directive = {
36
+ typeDefs: `directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION`,
37
+ transformer: (schema) => (0,_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__.mapSchema)(schema, {
38
+ [_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__.MapperKind.OBJECT_FIELD]: (fieldConfig) => {
39
+ const cacheControl = (0,_graphql_tools_utils__WEBPACK_IMPORTED_MODULE_0__.getDirective)(schema, fieldConfig, NAME)?.[0];
40
+ if (cacheControl) {
41
+ const { sMaxAge, staleWhileRevalidate, scope } = cacheControl;
42
+ const resolver = fieldConfig.resolve;
43
+ fieldConfig.resolve = (obj, args, ctx, info) => {
44
+ ctx.cacheControl = {
45
+ sMaxAge: min(ctx.cacheControl?.sMaxAge, sMaxAge),
46
+ staleWhileRevalidate: min(ctx.cacheControl?.staleWhileRevalidate, staleWhileRevalidate),
47
+ scope: minScope(ctx.cacheControl?.scope, scope),
48
+ };
49
+ return resolver?.(obj, args, ctx, info);
50
+ };
51
+ }
52
+ return fieldConfig;
53
+ },
54
+ }),
55
+ };
56
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (directive);
57
+ //# sourceMappingURL=cacheControl.js.map
58
+ __webpack_async_result__();
59
+ } catch(e) { __webpack_async_result__(e); } });
60
+
61
+ /***/ }),
62
+
63
+ /***/ 7397:
64
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
65
+
66
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
67
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68
+ /* harmony export */ "E9": () => (/* binding */ getContextFactory),
69
+ /* harmony export */ "T9": () => (/* reexport safe */ _platforms_errors__WEBPACK_IMPORTED_MODULE_3__.T9),
70
+ /* harmony export */ "XD": () => (/* reexport safe */ _platforms_errors__WEBPACK_IMPORTED_MODULE_3__.XD),
71
+ /* harmony export */ "yd": () => (/* binding */ getResolvers)
72
+ /* harmony export */ });
73
+ /* unused harmony exports getTypeDefs, getSchema */
74
+ /* harmony import */ var _platforms_vtex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8815);
75
+ /* harmony import */ var _typeDefs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3999);
76
+ /* harmony import */ var _directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8608);
77
+ /* harmony import */ var _platforms_errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(782);
78
+ /* harmony import */ var _telemetry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(941);
79
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_typeDefs__WEBPACK_IMPORTED_MODULE_1__, _directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__]);
80
+ ([_typeDefs__WEBPACK_IMPORTED_MODULE_1__, _directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ const platforms = {
90
+ vtex: {
91
+ getResolvers: _platforms_vtex__WEBPACK_IMPORTED_MODULE_0__/* .getResolvers */ .y,
92
+ getContextFactory: _platforms_vtex__WEBPACK_IMPORTED_MODULE_0__/* .getContextFactory */ .E,
93
+ },
94
+ };
95
+ const directives = [
96
+ _directives_cacheControl__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z
97
+ ];
98
+ const getTypeDefs = () => [typeDefs, ...directives.map(d => d.typeDefs)];
99
+ const getResolvers = (options) => platforms[options.platform].getResolvers(options);
100
+ const getContextFactory = (options) => platforms[options.platform].getContextFactory(options);
101
+ const getSchema = async (options) => {
102
+ const schema = makeExecutableSchema({
103
+ resolvers: getResolvers(options),
104
+ typeDefs: getTypeDefs(),
105
+ });
106
+ return directives.reduce((s, d) => d.transformer(s), schema);
107
+ };
108
+
109
+ //# sourceMappingURL=index.js.map
110
+ __webpack_async_result__();
111
+ } catch(e) { __webpack_async_result__(e); } });
112
+
113
+ /***/ }),
114
+
115
+ /***/ 782:
116
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
117
+
118
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
119
+ /* harmony export */ "T9": () => (/* binding */ isFastStoreError),
120
+ /* harmony export */ "XD": () => (/* binding */ isNotFoundError),
121
+ /* harmony export */ "dR": () => (/* binding */ NotFoundError),
122
+ /* harmony export */ "oY": () => (/* binding */ BadRequestError)
123
+ /* harmony export */ });
124
+ /* unused harmony export isBadRequestError */
125
+ class FastStoreError extends Error {
126
+ extensions;
127
+ constructor(extensions, message) {
128
+ super(message);
129
+ this.extensions = extensions;
130
+ this.name = 'FastStoreError';
131
+ }
132
+ }
133
+ class BadRequestError extends FastStoreError {
134
+ constructor(message) {
135
+ super({ status: 400, type: 'BadRequestError' }, message);
136
+ }
137
+ }
138
+ class NotFoundError extends FastStoreError {
139
+ constructor(message) {
140
+ super({ status: 404, type: 'NotFoundError' }, message);
141
+ }
142
+ }
143
+ const isFastStoreError = (error) => error?.name === 'FastStoreError';
144
+ const isNotFoundError = (error) => error?.extensions?.type === 'NotFoundError';
145
+ const isBadRequestError = (error) => error?.extensions?.type === 'BadRequestError';
146
+ //# sourceMappingURL=errors.js.map
147
+
148
+ /***/ }),
149
+
150
+ /***/ 8815:
151
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
152
+
153
+
154
+ // EXPORTS
155
+ __webpack_require__.d(__webpack_exports__, {
156
+ "E": () => (/* binding */ getContextFactory),
157
+ "y": () => (/* binding */ getResolvers)
158
+ });
159
+
160
+ // EXTERNAL MODULE: external "isomorphic-unfetch"
161
+ var external_isomorphic_unfetch_ = __webpack_require__(7881);
162
+ var external_isomorphic_unfetch_default = /*#__PURE__*/__webpack_require__.n(external_isomorphic_unfetch_);
163
+ // EXTERNAL MODULE: ../api/dist/esm/package.json
164
+ var esm_package = __webpack_require__(2828);
165
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/fetch.js
166
+
167
+
168
+ const USER_AGENT = `${esm_package/* name */.u2}@${esm_package/* version */.i8}`;
169
+ const fetchAPI = async (info, init) => {
170
+ const response = await external_isomorphic_unfetch_default()(info, {
171
+ ...init,
172
+ headers: {
173
+ ...init?.headers,
174
+ 'User-Agent': USER_AGENT,
175
+ },
176
+ });
177
+ if (response.ok) {
178
+ return response.status !== 204 ? response.json() : undefined;
179
+ }
180
+ console.error(info, init, response);
181
+ const text = await response.text();
182
+ throw new Error(text);
183
+ };
184
+ //# sourceMappingURL=fetch.js.map
185
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/commerce/index.js
186
+
187
+ const BASE_INIT = {
188
+ method: 'POST',
189
+ headers: {
190
+ 'content-type': 'application/json',
191
+ },
192
+ };
193
+ const VtexCommerce = ({ account, environment, incrementAddress }, ctx) => {
194
+ const base = `https://${account}.${environment}.com.br`;
195
+ return {
196
+ catalog: {
197
+ salesChannel: (sc) => fetchAPI(`${base}/api/catalog_system/pub/saleschannel/${sc}`),
198
+ brand: {
199
+ list: () => fetchAPI(`${base}/api/catalog_system/pub/brand/list`),
200
+ },
201
+ category: {
202
+ tree: (depth = 3) => fetchAPI(`${base}/api/catalog_system/pub/category/tree/${depth}`),
203
+ },
204
+ portal: {
205
+ pagetype: (slug) => fetchAPI(`${base}/api/catalog_system/pub/portal/pagetype/${slug}`),
206
+ },
207
+ products: {
208
+ crossselling: ({ type, productId, groupByProduct = true, }) => {
209
+ const params = new URLSearchParams({
210
+ sc: ctx.storage.channel.salesChannel,
211
+ groupByProduct: groupByProduct.toString(),
212
+ });
213
+ return fetchAPI(`${base}/api/catalog_system/pub/products/crossselling/${type}/${productId}?${params}`);
214
+ },
215
+ },
216
+ },
217
+ checkout: {
218
+ simulation: (args, { salesChannel } = ctx.storage.channel) => {
219
+ const params = new URLSearchParams({
220
+ sc: salesChannel,
221
+ });
222
+ return fetchAPI(`${base}/api/checkout/pub/orderForms/simulation?${params.toString()}`, {
223
+ ...BASE_INIT,
224
+ body: JSON.stringify(args),
225
+ });
226
+ },
227
+ shippingData: ({ id, index, deliveryMode, selectedAddresses, }, setDeliveryWindow) => {
228
+ const deliveryWindow = setDeliveryWindow
229
+ ? {
230
+ startDateUtc: deliveryMode?.deliveryWindow?.startDate,
231
+ endDateUtc: deliveryMode?.deliveryWindow?.endDate,
232
+ }
233
+ : null;
234
+ const mappedBody = {
235
+ logisticsInfo: Array.from({ length: index }, (_, itemIndex) => ({
236
+ itemIndex,
237
+ selectedDeliveryChannel: deliveryMode?.deliveryChannel || null,
238
+ selectedSla: deliveryMode?.deliveryMethod || null,
239
+ deliveryWindow: deliveryWindow,
240
+ })),
241
+ selectedAddresses: selectedAddresses,
242
+ clearAddressIfPostalCodeNotFound: incrementAddress,
243
+ };
244
+ return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/attachments/shippingData`, {
245
+ ...BASE_INIT,
246
+ body: JSON.stringify(mappedBody),
247
+ headers: {
248
+ 'content-type': 'application/json',
249
+ cookie: ctx.headers.cookie,
250
+ },
251
+ });
252
+ },
253
+ orderForm: ({ id, refreshOutdatedData = true, channel = ctx.storage.channel, }) => {
254
+ const { salesChannel } = channel;
255
+ const params = new URLSearchParams({
256
+ refreshOutdatedData: refreshOutdatedData.toString(),
257
+ sc: salesChannel,
258
+ });
259
+ const requestInit = ctx.headers
260
+ ? {
261
+ ...BASE_INIT,
262
+ headers: {
263
+ 'content-type': 'application/json',
264
+ cookie: ctx.headers.cookie,
265
+ },
266
+ }
267
+ : BASE_INIT;
268
+ return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}?${params.toString()}`, requestInit);
269
+ },
270
+ clearOrderFormMessages: ({ id }) => {
271
+ return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/messages/clear`, {
272
+ ...BASE_INIT,
273
+ body: '{}',
274
+ });
275
+ },
276
+ updateOrderFormItems: ({ id, orderItems, allowOutdatedData = 'paymentData', salesChannel = ctx.storage.channel.salesChannel, shouldSplitItem = true, }) => {
277
+ const params = new URLSearchParams({
278
+ allowOutdatedData,
279
+ sc: salesChannel,
280
+ });
281
+ const items = JSON.stringify({
282
+ orderItems,
283
+ noSplitItem: !shouldSplitItem,
284
+ });
285
+ const requestInit = ctx.headers
286
+ ? {
287
+ headers: {
288
+ 'content-type': 'application/json',
289
+ cookie: ctx.headers.cookie,
290
+ },
291
+ body: items,
292
+ method: 'PATCH',
293
+ }
294
+ : {
295
+ headers: {
296
+ 'content-type': 'application/json',
297
+ },
298
+ body: items,
299
+ method: 'PATCH',
300
+ };
301
+ return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/items?${params}`, requestInit);
302
+ },
303
+ setCustomData: ({ id, appId, key, value, }) => {
304
+ return fetchAPI(`${base}/api/checkout/pub/orderForm/${id}/customData/${appId}/${key}`, {
305
+ ...BASE_INIT,
306
+ body: JSON.stringify({ value }),
307
+ method: 'PUT',
308
+ });
309
+ },
310
+ region: async ({ postalCode, geoCoordinates, country, salesChannel, }) => {
311
+ const params = new URLSearchParams({
312
+ country: country,
313
+ sc: salesChannel ?? '',
314
+ });
315
+ postalCode
316
+ ? params.append('postalCode', postalCode)
317
+ : params.append('geoCoordinates', `${geoCoordinates?.longitude};${geoCoordinates?.latitude}`);
318
+ const url = `${base}/api/checkout/pub/regions/?${params.toString()}`;
319
+ return fetchAPI(url);
320
+ },
321
+ address: async ({ postalCode, country, }) => {
322
+ return fetchAPI(`${base}/api/checkout/pub/postal-code/${country}/${postalCode}`);
323
+ },
324
+ },
325
+ session: (search) => {
326
+ const params = new URLSearchParams(search);
327
+ params.set('items', 'profile.id,profile.email,profile.firstName,profile.lastName,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol');
328
+ return fetchAPI(`${base}/api/sessions?${params.toString()}`, {
329
+ method: 'POST',
330
+ headers: {
331
+ 'content-type': 'application/json',
332
+ cookie: ctx.headers.cookie,
333
+ },
334
+ body: '{}',
335
+ });
336
+ },
337
+ subscribeToNewsletter: (data) => {
338
+ return fetchAPI(`${base}/api/dataentities/NL/documents/`, {
339
+ ...BASE_INIT,
340
+ body: JSON.stringify({ ...data, isNewsletterOptIn: true }),
341
+ method: 'PATCH',
342
+ });
343
+ },
344
+ };
345
+ };
346
+ //# sourceMappingURL=index.js.map
347
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/search/index.js
348
+
349
+ const POLICY_KEY = 'trade-policy';
350
+ const REGION_KEY = 'region-id';
351
+ const CHANNEL_KEYS = new Set([POLICY_KEY, REGION_KEY]);
352
+ const isFacetBoolean = (facet) => facet.type === 'TEXT';
353
+ const IntelligentSearch = ({ account, environment, hideUnavailableItems }, ctx) => {
354
+ const base = `https://${account}.${environment}.com.br/api/io`;
355
+ const getPolicyFacet = () => {
356
+ const { salesChannel } = ctx.storage.channel;
357
+ if (!salesChannel) {
358
+ return null;
359
+ }
360
+ return {
361
+ key: POLICY_KEY,
362
+ value: salesChannel,
363
+ };
364
+ };
365
+ const getRegionFacet = () => {
366
+ const { regionId, seller } = ctx.storage.channel;
367
+ const sellerRegionId = seller
368
+ ? Buffer.from(`SW#${seller}`).toString('base64')
369
+ : null;
370
+ const facet = sellerRegionId ?? regionId;
371
+ if (!facet) {
372
+ return null;
373
+ }
374
+ return {
375
+ key: REGION_KEY,
376
+ value: facet,
377
+ };
378
+ };
379
+ const addDefaultFacets = (facets) => {
380
+ const withDefaultFacets = facets.filter(({ key }) => !CHANNEL_KEYS.has(key));
381
+ const policyFacet = facets.find(({ key }) => key === POLICY_KEY) ?? getPolicyFacet();
382
+ const regionFacet = facets.find(({ key }) => key === REGION_KEY) ?? getRegionFacet();
383
+ if (policyFacet !== null) {
384
+ withDefaultFacets.push(policyFacet);
385
+ }
386
+ if (regionFacet !== null) {
387
+ withDefaultFacets.push(regionFacet);
388
+ }
389
+ return withDefaultFacets;
390
+ };
391
+ const search = ({ query = '', page, count, sort = '', selectedFacets = [], type, fuzzy = 'auto', }) => {
392
+ const params = new URLSearchParams({
393
+ page: (page + 1).toString(),
394
+ count: count.toString(),
395
+ query,
396
+ sort,
397
+ fuzzy,
398
+ locale: ctx.storage.locale,
399
+ });
400
+ if (hideUnavailableItems !== undefined) {
401
+ params.append('hideUnavailableItems', hideUnavailableItems.toString());
402
+ }
403
+ const pathname = addDefaultFacets(selectedFacets)
404
+ .map(({ key, value }) => `${key}/${value}`)
405
+ .join('/');
406
+ return fetchAPI(`${base}/_v/api/intelligent-search/${type}/${pathname}?${params.toString()}`);
407
+ };
408
+ const products = (args) => search({ ...args, type: 'product_search' });
409
+ const suggestedTerms = (args) => {
410
+ const params = new URLSearchParams({
411
+ query: args.query?.toString() ?? '',
412
+ locale: ctx.storage.locale,
413
+ });
414
+ return fetchAPI(`${base}/_v/api/intelligent-search/search_suggestions?${params.toString()}`);
415
+ };
416
+ const topSearches = () => {
417
+ const params = new URLSearchParams({
418
+ locale: ctx.storage.locale,
419
+ });
420
+ return fetchAPI(`${base}/_v/api/intelligent-search/top_searches?${params.toString()}`);
421
+ };
422
+ const facets = (args) => search({ ...args, type: 'facets' });
423
+ return {
424
+ facets,
425
+ products,
426
+ suggestedTerms,
427
+ topSearches,
428
+ };
429
+ };
430
+ //# sourceMappingURL=index.js.map
431
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/sp/index.js
432
+ /**
433
+ * Client for SP, Intelligent search's analytics event API
434
+ * More info at: https://www.notion.so/vtexhandbook/Event-API-Documentation-48eee26730cf4d7f80f8fd7262231f84
435
+ */
436
+
437
+ const THIRTY_MINUTES_S = 30 * 60;
438
+ const ONE_YEAR_S = 365 * 24 * 3600;
439
+ const randomUUID = () => (Math.random() * 1e6).toFixed(0);
440
+ const timelapsed = (past) => (Date.now() - past) / 1e3;
441
+ const createId = (expiresSecond) => {
442
+ let payload = randomUUID();
443
+ let createdAt = Date.now();
444
+ return () => {
445
+ if (timelapsed(createdAt) > expiresSecond) {
446
+ payload = randomUUID();
447
+ createdAt = Date.now();
448
+ }
449
+ return payload;
450
+ };
451
+ };
452
+ const user = {
453
+ anonymous: createId(ONE_YEAR_S),
454
+ session: createId(THIRTY_MINUTES_S),
455
+ };
456
+ const SP = ({ account }, _) => {
457
+ const base = `https://sp.vtex.com/event-api/v1/${account}/event`;
458
+ const sendEvent = (options) => {
459
+ return fetchAPI(base, {
460
+ method: 'POST',
461
+ body: JSON.stringify({
462
+ ...options,
463
+ agent: '@faststore/api',
464
+ anonymous: user.anonymous(), // 'zZlNhqz1vFJP6iPG5Oqtt'
465
+ session: user.session(), // 'Om1TNluGvgmSgU5OOTvkkd'
466
+ }),
467
+ headers: {
468
+ 'content-type': 'application/json',
469
+ },
470
+ });
471
+ };
472
+ return {
473
+ sendEvent,
474
+ };
475
+ };
476
+ //# sourceMappingURL=index.js.map
477
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/clients/index.js
478
+
479
+
480
+
481
+ const getClients = (options, ctx) => {
482
+ const search = IntelligentSearch(options, ctx);
483
+ const commerce = VtexCommerce(options, ctx);
484
+ const sp = SP(options, ctx);
485
+ return {
486
+ search,
487
+ commerce,
488
+ sp,
489
+ };
490
+ };
491
+ //# sourceMappingURL=index.js.map
492
+ // EXTERNAL MODULE: ../api/node_modules/dataloader/index.js
493
+ var dataloader = __webpack_require__(3404);
494
+ var dataloader_default = /*#__PURE__*/__webpack_require__.n(dataloader);
495
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/salesChannel.js
496
+
497
+ const getSalesChannelLoader = (_, clients) => {
498
+ const loader = async (channels) => Promise.all(channels.map((sc) => clients.commerce.catalog.salesChannel(sc)));
499
+ return new (dataloader_default())(loader);
500
+ };
501
+ //# sourceMappingURL=salesChannel.js.map
502
+ // EXTERNAL MODULE: external "p-limit"
503
+ var external_p_limit_ = __webpack_require__(5471);
504
+ var external_p_limit_default = /*#__PURE__*/__webpack_require__.n(external_p_limit_);
505
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/simulation.js
506
+
507
+
508
+ // Limits concurrent requests to the API per request cycle
509
+ const CONCURRENT_REQUESTS_MAX = 1;
510
+ const getSimulationLoader = (_, clients) => {
511
+ const limit = external_p_limit_default()(CONCURRENT_REQUESTS_MAX);
512
+ const loader = async (simulationArgs) => {
513
+ const allItems = simulationArgs.reduce((acc, { items }) => {
514
+ return [...acc, items];
515
+ }, []);
516
+ const items = [...allItems.flat()];
517
+ const simulation = await clients.commerce.checkout.simulation({
518
+ country: simulationArgs[0].country,
519
+ postalCode: simulationArgs[0].postalCode,
520
+ items,
521
+ });
522
+ // Sort and filter simulation since Checkout API may return
523
+ // items that we didn't ask for
524
+ const simulated = simulation.items.reduce((acc, item) => {
525
+ const index = item.requestIndex;
526
+ if (typeof index === 'number' && index < acc.length) {
527
+ acc[index] = item;
528
+ }
529
+ return acc;
530
+ }, Array(items.length).fill(null));
531
+ const itemsIndices = allItems.reduce((acc, curr) => [...acc, curr.length + acc[acc.length - 1]], [0]);
532
+ return allItems.map((__, index) => ({
533
+ ...simulation,
534
+ items: simulated
535
+ .slice(itemsIndices[index], itemsIndices[index + 1])
536
+ .filter((item) => Boolean(item)),
537
+ }));
538
+ };
539
+ const limited = async (allItems) => limit(loader, allItems);
540
+ return new (dataloader_default())(limited, {
541
+ maxBatchSize: 50,
542
+ });
543
+ };
544
+ //# sourceMappingURL=simulation.js.map
545
+ // EXTERNAL MODULE: external "sanitize-html"
546
+ var external_sanitize_html_ = __webpack_require__(6109);
547
+ var external_sanitize_html_default = /*#__PURE__*/__webpack_require__.n(external_sanitize_html_);
548
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/sanitizeHtml.js
549
+
550
+ /**
551
+ * For now, we're using sanitize-html's default set
552
+ * of allowed tags and attributes, which don't even include img elements
553
+ *
554
+ * It is known many client depends on pontentially vulnerable tags, such as script tags
555
+ * We chose to be restrictive at first, and document those restrictions later.
556
+ *
557
+ * When expanding the set of allowed tags and attributes, please consider performance, privacy and security.
558
+ *
559
+ * This possibily breaks compatibility with Portal and Store Framework,
560
+ * which both allows an enormous amount of tags and attributes
561
+ *
562
+ * This was a thoughtful decision that can be reviewed in the future given
563
+ * research was made to back up those changes.
564
+ */
565
+ const sanitizeHtml = (dirty, options) => external_sanitize_html_default()(dirty, options);
566
+ //# sourceMappingURL=sanitizeHtml.js.map
567
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/enhanceSku.js
568
+
569
+ function sanitizeProduct(product) {
570
+ return {
571
+ ...product,
572
+ description: product.description
573
+ ? sanitizeHtml(product.description)
574
+ : product.description,
575
+ };
576
+ }
577
+ const enhanceSku = (item, product) => ({
578
+ ...item,
579
+ isVariantOf: sanitizeProduct(product),
580
+ });
581
+ //# sourceMappingURL=enhanceSku.js.map
582
+ // EXTERNAL MODULE: ../api/dist/esm/src/platforms/errors.js
583
+ var errors = __webpack_require__(782);
584
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/sku.js
585
+
586
+
587
+
588
+ const getSkuLoader = (_, clients) => {
589
+ const loader = async (skuIds) => {
590
+ const { products } = await clients.search.products({
591
+ query: `sku:${skuIds.join(';')}`,
592
+ page: 0,
593
+ count: skuIds.length,
594
+ });
595
+ const skuBySkuId = products.reduce((acc, product) => {
596
+ for (const sku of product.items) {
597
+ acc[sku.itemId] = enhanceSku(sku, product);
598
+ }
599
+ return acc;
600
+ }, {});
601
+ const skus = skuIds.map((skuId) => skuBySkuId[skuId]);
602
+ const missingSkus = skuIds.filter((skuId) => !skuBySkuId[skuId]);
603
+ if (missingSkus.length > 0) {
604
+ throw new errors/* NotFoundError */.dR(`Search API did not found the following skus: ${missingSkus.join(',')}`);
605
+ }
606
+ return skus;
607
+ };
608
+ return new (dataloader_default())(loader, {
609
+ maxBatchSize: 99, // Max allowed batch size of Search API
610
+ });
611
+ };
612
+ //# sourceMappingURL=sku.js.map
613
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/collection.js
614
+
615
+
616
+
617
+ // Limits concurrent requests to 20 so that they don't timeout
618
+ const collection_CONCURRENT_REQUESTS_MAX = 20;
619
+ const collectionPageTypes = new Set([
620
+ 'brand',
621
+ 'category',
622
+ 'department',
623
+ 'subcategory',
624
+ 'collection',
625
+ 'cluster',
626
+ ]);
627
+ const isCollectionPageType = (x) => typeof x.pageType === 'string' &&
628
+ collectionPageTypes.has(x.pageType.toLowerCase());
629
+ const getCollectionLoader = (_, clients) => {
630
+ const limit = external_p_limit_default()(collection_CONCURRENT_REQUESTS_MAX);
631
+ const loader = async (slugs) => {
632
+ return Promise.all(slugs.map((slug) => limit(async () => {
633
+ const page = await clients.commerce.catalog.portal.pagetype(slug);
634
+ if (isCollectionPageType(page)) {
635
+ return page;
636
+ }
637
+ throw new errors/* NotFoundError */.dR(`Catalog returned ${page.pageType} for slug: ${slug}. This usually happens when there is more than one category with the same name in the same category tree level.`);
638
+ })));
639
+ };
640
+ return new (dataloader_default())(loader, {
641
+ // DataLoader is being used to cache requests, not to batch them
642
+ batch: false,
643
+ });
644
+ };
645
+ //# sourceMappingURL=collection.js.map
646
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/loaders/index.js
647
+
648
+
649
+
650
+
651
+ const getLoaders = (options, { clients }) => {
652
+ const skuLoader = getSkuLoader(options, clients);
653
+ const simulationLoader = getSimulationLoader(options, clients);
654
+ const collectionLoader = getCollectionLoader(options, clients);
655
+ const salesChannelLoader = getSalesChannelLoader(options, clients);
656
+ return {
657
+ skuLoader,
658
+ simulationLoader,
659
+ collectionLoader,
660
+ salesChannelLoader
661
+ };
662
+ };
663
+ //# sourceMappingURL=index.js.map
664
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/productStock.js
665
+ const inStock = (offer) => offer.AvailableQuantity > 0;
666
+ const price = (offer) => offer.spotPrice ?? 0;
667
+ const sellingPrice = (offer) => offer.Price ?? 0;
668
+ const availability = (available) => available ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock';
669
+ // Smallest Available Spot Price First
670
+ const bestOfferFirst = (a, b) => {
671
+ if (inStock(a) && !inStock(b)) {
672
+ return -1;
673
+ }
674
+ if (!inStock(a) && inStock(b)) {
675
+ return 1;
676
+ }
677
+ return price(a) - price(b);
678
+ };
679
+ const inStockOrderFormItem = (itemAvailability) => itemAvailability === 'available';
680
+ //# sourceMappingURL=productStock.js.map
681
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/aggregateOffer.js
682
+
683
+ const StoreAggregateOffer = {
684
+ highPrice: (offers) => {
685
+ const availableOffers = offers.filter(inStock);
686
+ const highOffer = availableOffers[availableOffers.length - 1];
687
+ return highOffer != null ? price(highOffer) : 0;
688
+ },
689
+ lowPrice: (offers) => {
690
+ const [lowOffer] = offers.filter(inStock);
691
+ return lowOffer ? price(lowOffer) : 0;
692
+ },
693
+ offerCount: (offers) => offers.length,
694
+ priceCurrency: async (_, __, ctx) => {
695
+ const { loaders: { salesChannelLoader }, storage: { channel } } = ctx;
696
+ const sc = await salesChannelLoader.load(channel.salesChannel);
697
+ return sc.CurrencyCode ?? '';
698
+ },
699
+ offers: (offers) => offers,
700
+ };
701
+ //# sourceMappingURL=aggregateOffer.js.map
702
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/aggregateRating.js
703
+ // TODO: Add a review system integration
704
+ const StoreAggregateRating = {
705
+ ratingValue: () => 5,
706
+ reviewCount: () => 0,
707
+ };
708
+ //# sourceMappingURL=aggregateRating.js.map
709
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/slugify.js
710
+ /**
711
+ * VTEX catalog slugify function
712
+ *
713
+ * Copied from:
714
+ * https://github.com/vtex/rewriter/blob/1ce2010783e0586cab42534ce2fb7a983d8a3a84/node/clients/catalog.ts#L72
715
+ *
716
+ * Sometimes, we need to slugify strings for creating urls. An example is the
717
+ * brand urls, where we create them from the brand's name.
718
+ * This slugify function should match exactly what VTEX catalog generates. Any mismatch
719
+ * will lead to broken links.
720
+ * Hopefully, we had this function implemented on VTEX IO and we've been using it for
721
+ * years now. However, looking at the code, I think we can save lots of computing. I'm
722
+ * in a hurry for doing these tests now, so I'll leave a small TODO.
723
+ *
724
+ * TODO: Research for better ways of computing this slugify function. Things I'd try are:
725
+ * - Join those 3 regexs for special characters into a single one.
726
+ * - Replace the regexp of `removeDiacritics` function with a Map. We can make the complexity
727
+ * of this function be O(n) with n=string.length
728
+ *
729
+ */
730
+ const from = 'ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a';
731
+ const to = 'AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa';
732
+ const removeDiacritics = (str) => {
733
+ let newStr = str.slice(0);
734
+ for (let i = 0; i < from.length; i++) {
735
+ newStr = newStr.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
736
+ }
737
+ return newStr;
738
+ };
739
+ const slugifySpecialCharacters = (str) => {
740
+ return str.replace(/[·/_,:]/, '-');
741
+ };
742
+ function slugify(str) {
743
+ const noCommas = str.replace(/,/g, '');
744
+ const replaced = noCommas.replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, '-');
745
+ const slugified = slugifySpecialCharacters(removeDiacritics(replaced));
746
+ return slugified.toLowerCase();
747
+ }
748
+ //# sourceMappingURL=slugify.js.map
749
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/collection.js
750
+
751
+
752
+ const isBrand = (x) => x.type === 'brand' ||
753
+ (isCollectionPageType(x) && x.pageType.toLowerCase() === 'brand');
754
+ const isCollection = (x) => isCollectionPageType(x) && x.pageType.toLowerCase() === 'collection';
755
+ const slugifyRoot = (root) => {
756
+ if (isBrand(root) || isCollection(root)) {
757
+ return slugify(root.name);
758
+ }
759
+ if (isCollectionPageType(root)) {
760
+ return new URL(`https://${root.url}`).pathname.slice(1).toLowerCase();
761
+ }
762
+ return new URL(root.url).pathname.slice(1).toLowerCase();
763
+ };
764
+ const StoreCollection = {
765
+ id: ({ id }) => id.toString(),
766
+ slug: (root) => slugifyRoot(root),
767
+ seo: (root) => isBrand(root) || isCollectionPageType(root)
768
+ ? {
769
+ title: root.title,
770
+ description: root.metaTagDescription,
771
+ }
772
+ : {
773
+ title: root.Title,
774
+ description: root.MetaTagDescription,
775
+ },
776
+ type: (root) => isBrand(root)
777
+ ? 'Brand'
778
+ : isCollectionPageType(root)
779
+ ? root.pageType
780
+ : root.level === 0
781
+ ? 'Department'
782
+ : 'Category',
783
+ meta: (root) => {
784
+ const slug = slugifyRoot(root);
785
+ return isBrand(root)
786
+ ? {
787
+ selectedFacets: [{ key: 'brand', value: slug }],
788
+ }
789
+ : isCollection(root)
790
+ ? {
791
+ selectedFacets: [{ key: 'productclusterids', value: root.id }],
792
+ }
793
+ : {
794
+ selectedFacets: slug.split('/').map((segment, index) => ({
795
+ key: `category-${index + 1}`,
796
+ value: segment,
797
+ })),
798
+ };
799
+ },
800
+ breadcrumbList: async (root, _, ctx) => {
801
+ const { loaders: { collectionLoader }, } = ctx;
802
+ const slug = slugifyRoot(root);
803
+ /**
804
+ * Split slug into segments so we fetch all data for
805
+ * the breadcrumb. For instance, if we get `/foo/bar`
806
+ * we need all metadata for both `/foo` and `/bar` and
807
+ * thus we need to fetch pageType for `/foo` and `/bar`
808
+ */
809
+ const segments = slug.split('/').filter((segment) => Boolean(segment));
810
+ const slugs = segments.map((__, index) => segments.slice(0, index + 1).join('/'));
811
+ const collections = await Promise.all(slugs.map(async (s) => {
812
+ const collection = await collectionLoader.load(s);
813
+ return { slug: s, ...collection };
814
+ }));
815
+ return {
816
+ itemListElement: collections.map((collection, index) => ({
817
+ item: isCollection(collection)
818
+ ? `/${collection.slug}`
819
+ : new URL(`https://${collection.url}`).pathname.toLowerCase(),
820
+ name: collection.name,
821
+ position: index + 1,
822
+ })),
823
+ numberOfItems: collections.length,
824
+ };
825
+ },
826
+ };
827
+ //# sourceMappingURL=collection.js.map
828
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/facets.js
829
+
830
+ const FACET_CROSS_SELLING_MAP = {
831
+ buy: "whoboughtalsobought",
832
+ view: "whosawalsosaw",
833
+ similars: "similars",
834
+ viewAndBought: "whosawalsobought",
835
+ accessories: "accessories",
836
+ suggestions: "suggestions",
837
+ };
838
+ /**
839
+ * Transform facets from the store to VTEX platform facets.
840
+ * For instance, the channel in Store becomes trade-policy and regionId in VTEX's realm
841
+ * */
842
+ const transformSelectedFacet = ({ key, value }) => {
843
+ switch (key) {
844
+ case 'price': {
845
+ return { key, value: value.replace('-to-', ':') };
846
+ }
847
+ case 'channel':
848
+ case 'locale':
849
+ case "buy":
850
+ case "view":
851
+ case "similars":
852
+ case "viewAndBought":
853
+ case "accessories":
854
+ case "suggestions": {
855
+ return []; // remove this facet from search
856
+ }
857
+ default:
858
+ return { key, value };
859
+ }
860
+ };
861
+ const parseRange = (range) => {
862
+ const splitted = range.split(':').map(Number);
863
+ if (splitted.length !== 2 ||
864
+ Number.isNaN(splitted[0]) ||
865
+ Number.isNaN(splitted[1])) {
866
+ return null;
867
+ }
868
+ return splitted;
869
+ };
870
+ const isCrossSelling = (x) => typeof FACET_CROSS_SELLING_MAP[x] === "string";
871
+ const findCrossSelling = (facets) => {
872
+ const filtered = facets?.filter((x) => isCrossSelling(x.key));
873
+ if (Array.isArray(filtered) && filtered.length > 1) {
874
+ throw new errors/* BadRequestError */.oY(`You passed ${filtered.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${filtered.map(x => x.key).join(',')}`);
875
+ }
876
+ return filtered?.[0] ?? null;
877
+ };
878
+ const findSlug = (facets) => facets?.find((x) => x.key === 'slug')?.value ?? null;
879
+ const findSkuId = (facets) => facets?.find((x) => x.key === 'id')?.value ?? null;
880
+ const findLocale = (facets) => facets?.find((x) => x.key === 'locale')?.value ?? null;
881
+ const findChannel = (facets) => facets?.find((facet) => facet.key === 'channel')?.value ?? null;
882
+ //# sourceMappingURL=facets.js.map
883
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/orderStatistics.js
884
+ /**
885
+ * More info at: https://en.wikipedia.org/wiki/Order_statistic
886
+ */
887
+ // O(n) search to find the max of an array
888
+ const min = (array, cmp) => {
889
+ let best = 0;
890
+ for (let curr = 1; curr < array.length; curr++) {
891
+ if (cmp(array[best], array[curr]) > 0) {
892
+ best = curr;
893
+ }
894
+ }
895
+ return array[best];
896
+ };
897
+ //# sourceMappingURL=orderStatistics.js.map
898
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/facet.js
899
+
900
+
901
+ const StoreFacet = {
902
+ __resolveType: ({ type }) => type === 'TEXT' ? 'StoreFacetBoolean' : 'StoreFacetRange',
903
+ };
904
+ const StoreFacetBoolean = {
905
+ key: ({ key }) => key,
906
+ label: ({ name }) => name,
907
+ values: ({ values }) => values.sort((a, b) => a.name.localeCompare(b.name)),
908
+ };
909
+ const StoreFacetRange = {
910
+ key: ({ key }) => key,
911
+ label: ({ name }) => name,
912
+ min: ({ values, key }, _, { storage: { searchArgs } }) => {
913
+ /**
914
+ * Fetch the selected range the user queried.
915
+ *
916
+ * This is necessary because, differently from boolean facets, Search API does
917
+ * not return the selected values, making us have to implement it in here
918
+ */
919
+ const selectedRange = parseRange(searchArgs?.selectedFacets?.find((facet) => facet.key === key)?.value ??
920
+ '');
921
+ const facet = min(values, (a, b) => a.range.from - b.range.from);
922
+ const globalMin = facet?.range.from ?? 0;
923
+ return {
924
+ selected: selectedRange?.[0] ?? globalMin,
925
+ absolute: globalMin,
926
+ };
927
+ },
928
+ max: ({ values, key }, _, { storage: { searchArgs } }) => {
929
+ /**
930
+ * Fetch the selected range the user queried.
931
+ *
932
+ * This is necessary because, differently from boolean facets, Search API does
933
+ * not return the selected values, making us have to implement it in here
934
+ */
935
+ const selectedRange = parseRange(searchArgs?.selectedFacets?.find((facet) => facet.key === key)?.value ??
936
+ '');
937
+ const facet = min(values, (a, b) => b.range.to - a.range.to);
938
+ const globalMax = facet?.range.to ?? 0;
939
+ return {
940
+ selected: selectedRange?.[1] ?? globalMax,
941
+ absolute: globalMax,
942
+ };
943
+ },
944
+ };
945
+ //# sourceMappingURL=facet.js.map
946
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/faceValue.js
947
+ const StoreFacetValueBoolean = {
948
+ value: ({ value }) => value,
949
+ label: ({ name }) => name || 'unknown',
950
+ selected: ({ selected }) => selected,
951
+ quantity: ({ quantity }) => quantity,
952
+ };
953
+ //# sourceMappingURL=faceValue.js.map
954
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/subscribeToNewsletter.js
955
+ const subscribeToNewsletter = async (_, { data }, { clients: { commerce } }) => {
956
+ const response = await commerce.subscribeToNewsletter(data);
957
+ return { id: response?.Id };
958
+ };
959
+ //# sourceMappingURL=subscribeToNewsletter.js.map
960
+ // EXTERNAL MODULE: external "fast-deep-equal"
961
+ var external_fast_deep_equal_ = __webpack_require__(2404);
962
+ var external_fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(external_fast_deep_equal_);
963
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/channel.js
964
+ class ChannelMarshal {
965
+ static parse(channelString) {
966
+ try {
967
+ const parsedChannel = JSON.parse(channelString);
968
+ return {
969
+ seller: parsedChannel.seller ?? '',
970
+ regionId: parsedChannel.regionId ?? '',
971
+ salesChannel: parsedChannel.salesChannel ?? '',
972
+ };
973
+ }
974
+ catch (error) {
975
+ console.error(error);
976
+ throw new Error('Malformed channel string');
977
+ }
978
+ }
979
+ static stringify(channel) {
980
+ return JSON.stringify(channel);
981
+ }
982
+ }
983
+ //# sourceMappingURL=channel.js.map
984
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/contex.js
985
+
986
+ const mutateChannelContext = (ctx, channelString) => {
987
+ ctx.storage.channel = ChannelMarshal.parse(channelString);
988
+ };
989
+ const mutateLocaleContext = (ctx, locale) => {
990
+ ctx.storage.locale = locale;
991
+ };
992
+ //# sourceMappingURL=contex.js.map
993
+ // EXTERNAL MODULE: external "crypto"
994
+ var external_crypto_ = __webpack_require__(6113);
995
+ var external_crypto_default = /*#__PURE__*/__webpack_require__.n(external_crypto_);
996
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/md5.js
997
+
998
+ const md5 = (payload) => external_crypto_default().createHash('md5').update(payload).digest('hex');
999
+ //# sourceMappingURL=md5.js.map
1000
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/propertyValue.js
1001
+
1002
+ const VALUE_REFERENCES = {
1003
+ attachment: 'ATTACHMENT',
1004
+ specification: 'SPECIFICATION',
1005
+ };
1006
+ function attachmentToPropertyValue(attachment) {
1007
+ return {
1008
+ name: attachment.name,
1009
+ value: attachment.content,
1010
+ valueReference: VALUE_REFERENCES.attachment,
1011
+ };
1012
+ }
1013
+ function getPropertyId(item) {
1014
+ return md5(`${item.name}:${JSON.stringify(item.value)}:${item.valueReference}`);
1015
+ }
1016
+ //# sourceMappingURL=propertyValue.js.map
1017
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/shouldUpdateShippingData.js
1018
+ const shouldUpdateShippingData = (orderForm, session) => {
1019
+ if (!hasSessionPostalCodeOrGeoCoordinates(session)) {
1020
+ return { updateShipping: false, addressChanged: false };
1021
+ }
1022
+ if (!hasItems(orderForm)) {
1023
+ return { updateShipping: false, addressChanged: false };
1024
+ }
1025
+ const [selectedAddress] = orderForm?.shippingData?.selectedAddresses ?? [];
1026
+ if (checkPostalCode(selectedAddress, session.postalCode) ||
1027
+ checkGeoCoordinates(selectedAddress, session.geoCoordinates) ||
1028
+ checkAddressType(selectedAddress, session.addressType)) {
1029
+ return { updateShipping: true, addressChanged: true };
1030
+ }
1031
+ // The logisticsInfo will always exist if there´s at least one item inside the cart
1032
+ const { logisticsInfo } = orderForm.shippingData;
1033
+ if (shouldUpdateDeliveryInfo(logisticsInfo, session)) {
1034
+ return { updateShipping: true, addressChanged: false };
1035
+ }
1036
+ return { updateShipping: false, addressChanged: false };
1037
+ };
1038
+ // Validate if theres any postal Code or GeoCoordinates set at the session
1039
+ const hasSessionPostalCodeOrGeoCoordinates = (session) => {
1040
+ return (!!session.postalCode ||
1041
+ (session.geoCoordinates?.latitude && session.geoCoordinates?.longitude));
1042
+ };
1043
+ // Validate if theres a difference between the session postal code and orderForm postal code
1044
+ const checkPostalCode = (address, postalCode) => {
1045
+ return typeof postalCode === 'string' && address?.postalCode !== postalCode;
1046
+ };
1047
+ // Validate if theres a difference between the session geoCoords and orderForm geoCoords
1048
+ const checkGeoCoordinates = (address, geoCoordinates) => {
1049
+ return (typeof geoCoordinates?.latitude === 'number' &&
1050
+ typeof geoCoordinates?.longitude === 'number' &&
1051
+ (address?.geoCoordinates[0] !== geoCoordinates?.longitude ||
1052
+ address?.geoCoordinates[1] !== geoCoordinates?.latitude));
1053
+ };
1054
+ const checkAddressType = (address, addressType) => {
1055
+ return typeof addressType === 'string' && address?.addressType !== addressType;
1056
+ };
1057
+ // Validate if theres any item inside the orderForm
1058
+ const hasItems = (orderForm) => {
1059
+ return orderForm.items.length !== 0;
1060
+ };
1061
+ const shouldUpdateDeliveryInfo = (logisticsInfo, session) => {
1062
+ const deliveryChannel = session?.deliveryMode?.deliveryChannel;
1063
+ const deliveryMethod = session?.deliveryMode?.deliveryMethod;
1064
+ const { startDate, endDate } = session?.deliveryMode?.deliveryWindow || {};
1065
+ return logisticsInfo.some(({ selectedDeliveryChannel, selectedSla, slas }) => {
1066
+ const checkDeliveryChannel = deliveryChannel && selectedDeliveryChannel !== deliveryChannel;
1067
+ const checkDeliveryMethod = deliveryMethod && selectedSla !== deliveryMethod;
1068
+ return slas?.some((sla) => {
1069
+ if ((checkDeliveryChannel && sla.deliveryChannel === deliveryChannel) ||
1070
+ (checkDeliveryMethod && sla.id === deliveryMethod)) {
1071
+ return true;
1072
+ }
1073
+ return (startDate &&
1074
+ endDate &&
1075
+ sla.deliveryChannel === deliveryChannel &&
1076
+ sla.id === deliveryMethod &&
1077
+ (!sla?.deliveryWindow ||
1078
+ sla?.deliveryWindow?.startDateUtc !== startDate ||
1079
+ sla?.deliveryWindow?.endDateUtc !== endDate) &&
1080
+ sla.availableDeliveryWindows?.some((window) => window?.startDateUtc === startDate &&
1081
+ window?.endDateUtc === endDate));
1082
+ });
1083
+ });
1084
+ };
1085
+ //# sourceMappingURL=shouldUpdateShippingData.js.map
1086
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/getAddressOrderForm.js
1087
+ const getAddressOrderForm = (orderForm, session, addressChanged) => {
1088
+ const postalCode = session.postalCode;
1089
+ const geoCoordinates = session.geoCoordinates;
1090
+ const availableAddresses = orderForm?.shippingData?.availableAddresses ?? [];
1091
+ const selectedAddresses = orderForm?.shippingData?.selectedAddresses ?? [];
1092
+ // Validate if no change for the address was made and the deliveryMode has changed we can return the address from the orderForm
1093
+ if (!addressChanged && selectedAddresses.length > 0) {
1094
+ return [selectedAddresses[0]];
1095
+ }
1096
+ // Validate if the address from the session already exists at the availableAddresses from the OrderForm to avoid duplication
1097
+ if (addressChanged && availableAddresses.length > 0) {
1098
+ for (const address of availableAddresses) {
1099
+ if (postalCode && geoCoordinates) {
1100
+ const addressMatcher = address.postalCode === postalCode ||
1101
+ (address.geoCoordinates[0] === geoCoordinates.longitude &&
1102
+ address.geoCoordinates[1] === geoCoordinates.latitude);
1103
+ if (addressMatcher) {
1104
+ return [address];
1105
+ }
1106
+ }
1107
+ if (postalCode && !geoCoordinates) {
1108
+ const addressMatcher = address.postalCode === postalCode;
1109
+ if (addressMatcher) {
1110
+ return [address];
1111
+ }
1112
+ }
1113
+ if (geoCoordinates && !postalCode) {
1114
+ const addressMatcher = address.geoCoordinates[0] === geoCoordinates.longitude &&
1115
+ address.geoCoordinates[1] === geoCoordinates.latitude;
1116
+ if (addressMatcher) {
1117
+ return [address];
1118
+ }
1119
+ }
1120
+ }
1121
+ }
1122
+ return null;
1123
+ };
1124
+ //# sourceMappingURL=getAddressOrderForm.js.map
1125
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/createNewAddress.js
1126
+ const createNewAddress = (session) => {
1127
+ const postalCode = session.postalCode;
1128
+ const geoCoordinates = session.geoCoordinates;
1129
+ // If the address from the session has changed and it do not exist we will create the new one
1130
+ const addressSession = {
1131
+ addressType: session.addressType || null,
1132
+ postalCode: postalCode || null,
1133
+ city: null,
1134
+ state: null,
1135
+ country: session.country || null,
1136
+ street: null,
1137
+ number: null,
1138
+ neighborhood: null,
1139
+ complement: null,
1140
+ reference: null,
1141
+ geoCoordinates: [],
1142
+ };
1143
+ if (geoCoordinates) {
1144
+ const latitude = typeof geoCoordinates === 'object' && 'latitude' in geoCoordinates
1145
+ ? geoCoordinates.latitude
1146
+ : null;
1147
+ const longitude = typeof geoCoordinates === 'object' && 'longitude' in geoCoordinates
1148
+ ? geoCoordinates.longitude
1149
+ : null;
1150
+ addressSession.geoCoordinates =
1151
+ latitude !== null && longitude !== null ? [longitude, latitude] : [];
1152
+ }
1153
+ return [addressSession];
1154
+ };
1155
+ //# sourceMappingURL=createNewAddress.js.map
1156
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/validateCart.js
1157
+
1158
+
8
1159
 
9
- var __webpack_unused_export__;
10
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=__webpack_require__(2547),i=e(__webpack_require__(7881)),t=e(__webpack_require__(3404)),a=e(__webpack_require__(5471)),r=e(__webpack_require__(6109)),o=e(__webpack_require__(2404)),l=e(__webpack_require__(6113)),d=__webpack_require__(7343),s=__webpack_require__(6548),u=__webpack_require__(1718),c=__webpack_require__(1283),m=__webpack_require__(4161),p=__webpack_require__(5196),k=__webpack_require__(2793),v=__webpack_require__(6969),g=__webpack_require__(8525),y=__webpack_require__(9362),f=__webpack_require__(4691),N=__webpack_require__(8973);const S=async(e,n)=>{const t=await i(e,{...n,headers:{...null==n?void 0:n.headers,"User-Agent":"@faststore/api@2.2.38"}});if(t.ok)return 204!==t.status?t.json():void 0;console.error(e,n,t);const a=await t.text();throw new Error(a)},h={method:"POST",headers:{"content-type":"application/json"}},b=new Set(["trade-policy","region-id"]),T=({account:e,environment:n,hideUnavailableItems:i},t)=>{const a=`https://${e}.${n}.com.br/api/io`,r=({query:e="",page:n,count:r,sort:o="",selectedFacets:l=[],type:d,fuzzy:s="auto"})=>{const u=new URLSearchParams({page:(n+1).toString(),count:r.toString(),query:e,sort:o,fuzzy:s,locale:t.storage.locale});void 0!==i&&u.append("hideUnavailableItems",i.toString());const c=(e=>{var n,i;const a=e.filter(({key:e})=>!b.has(e)),r=null!=(n=e.find(({key:e})=>"trade-policy"===e))?n:(()=>{const{salesChannel:e}=t.storage.channel;return e?{key:"trade-policy",value:e}:null})(),o=null!=(i=e.find(({key:e})=>"region-id"===e))?i:(()=>{const{regionId:e,seller:n}=t.storage.channel,i=n?Buffer.from("SW#"+n).toString("base64"):null,a=null!=i?i:e;return a?{key:"region-id",value:a}:null})();return null!==r&&a.push(r),null!==o&&a.push(o),a})(l).map(({key:e,value:n})=>`${e}/${n}`).join("/");return S(`${a}/_v/api/intelligent-search/${d}/${c}?${u.toString()}`)};return{facets:e=>r({...e,type:"facets"}),products:e=>r({...e,type:"product_search"}),suggestedTerms:e=>{var n,i;const r=new URLSearchParams({query:null!=(n=null==(i=e.query)?void 0:i.toString())?n:"",locale:t.storage.locale});return S(`${a}/_v/api/intelligent-search/search_suggestions?${r.toString()}`)},topSearches:()=>{const e=new URLSearchParams({locale:t.storage.locale});return S(`${a}/_v/api/intelligent-search/top_searches?${e.toString()}`)}}},V=()=>(1e6*Math.random()).toFixed(0),D=e=>{let n=V(),i=Date.now();return()=>{var t;return t=i,(Date.now()-t)/1e3>e&&(n=V(),i=Date.now()),n}},I={anonymous:D(31536e3),session:D(1800)};function w(e){return{...e,description:e.description?(n=e.description,r(n,void 0)):e.description};var n}const F=(e,n)=>({...e,isVariantOf:w(n)});class C extends Error{constructor(e,n){super(n),this.extensions=e,this.name="FastStoreError"}}class O extends C{constructor(e){super({status:400,type:"BadRequestError"},e)}}class P extends C{constructor(e){super({status:404,type:"NotFoundError"},e)}}const A=new Set(["brand","category","department","subcategory","collection","cluster"]),L=e=>"string"==typeof e.pageType&&A.has(e.pageType.toLowerCase()),E=e=>e.AvailableQuantity>0,R=e=>{var n;return null!=(n=e.spotPrice)?n:0},x=e=>e?"https://schema.org/InStock":"https://schema.org/OutOfStock",M=(e,n)=>E(e)&&!E(n)?-1:!E(e)&&E(n)?1:R(e)-R(n),U={highPrice:e=>{const n=e.filter(E),i=n[n.length-1];return null!=i?R(i):0},lowPrice:e=>{const[n]=e.filter(E);return n?R(n):0},offerCount:e=>e.length,priceCurrency:async(e,n,i)=>{var t;const{loaders:{salesChannelLoader:a},storage:{channel:r}}=i;return null!=(t=(await a.load(r.salesChannel)).CurrencyCode)?t:""},offers:e=>e},q="ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a";function j(e){return(e=>e.replace(/[·/_,:]/,"-"))((e=>{let n=e.slice(0);for(let e=0;e<q.length;e++)n=n.replace(new RegExp(q.charAt(e),"g"),"AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa".charAt(e));return n})(e.replace(/,/g,"").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g,"-"))).toLowerCase()}const _=e=>"brand"===e.type||L(e)&&"brand"===e.pageType.toLowerCase(),B=e=>L(e)&&"collection"===e.pageType.toLowerCase(),$=e=>_(e)||B(e)?j(e.name):L(e)?new URL("https://"+e.url).pathname.slice(1).toLowerCase():new URL(e.url).pathname.slice(1).toLowerCase(),G={id:({id:e})=>e.toString(),slug:e=>$(e),seo:e=>_(e)||L(e)?{title:e.title,description:e.metaTagDescription}:{title:e.Title,description:e.MetaTagDescription},type:e=>_(e)?"Brand":L(e)?e.pageType:0===e.level?"Department":"Category",meta:e=>{const n=$(e);return _(e)?{selectedFacets:[{key:"brand",value:n}]}:B(e)?{selectedFacets:[{key:"productclusterids",value:e.id}]}:{selectedFacets:n.split("/").map((e,n)=>({key:"category-"+(n+1),value:e}))}},breadcrumbList:async(e,n,i)=>{const{loaders:{collectionLoader:t}}=i,a=$(e).split("/").filter(e=>Boolean(e)),r=a.map((e,n)=>a.slice(0,n+1).join("/")),o=await Promise.all(r.map(async e=>({slug:e,...await t.load(e)})));return{itemListElement:o.map((e,n)=>({item:B(e)?"/"+e.slug:new URL("https://"+e.url).pathname.toLowerCase(),name:e.name,position:n+1})),numberOfItems:o.length}}},z={buy:"whoboughtalsobought",view:"whosawalsosaw",similars:"similars",viewAndBought:"whosawalsobought",accessories:"accessories",suggestions:"suggestions"},K=({key:e,value:n})=>{switch(e){case"price":return{key:e,value:n.replace("-to-",":")};case"channel":case"locale":case"buy":case"view":case"similars":case"viewAndBought":case"accessories":case"suggestions":return[];default:return{key:e,value:n}}},W=e=>{const n=e.split(":").map(Number);return 2!==n.length||Number.isNaN(n[0])||Number.isNaN(n[1])?null:n},Q=e=>{var n,i;return null!=(n=null==e||null==(i=e.find(e=>"locale"===e.key))?void 0:i.value)?n:null},X=e=>{var n,i;return null!=(n=null==e||null==(i=e.find(e=>"channel"===e.key))?void 0:i.value)?n:null},Y=(e,n)=>{let i=0;for(let t=1;t<e.length;t++)n(e[i],e[t])>0&&(i=t);return e[i]},J={key:({key:e})=>e,label:({name:e})=>e,min:({values:e,key:n},i,{storage:{searchArgs:t}})=>{var a,r,o,l,d;const s=W(null!=(a=null==t||null==(r=t.selectedFacets)||null==(o=r.find(e=>e.key===n))?void 0:o.value)?a:""),u=Y(e,(e,n)=>e.range.from-n.range.from),c=null!=(l=null==u?void 0:u.range.from)?l:0;return{selected:null!=(d=null==s?void 0:s[0])?d:c,absolute:c}},max:({values:e,key:n},i,{storage:{searchArgs:t}})=>{var a,r,o,l,d;const s=W(null!=(a=null==t||null==(r=t.selectedFacets)||null==(o=r.find(e=>e.key===n))?void 0:o.value)?a:""),u=Y(e,(e,n)=>n.range.to-e.range.to),c=null!=(l=null==u?void 0:u.range.to)?l:0;return{selected:null!=(d=null==s?void 0:s[1])?d:c,absolute:c}}};class H{static parse(e){try{var n,i,t;const a=JSON.parse(e);return{seller:null!=(n=a.seller)?n:"",regionId:null!=(i=a.regionId)?i:"",salesChannel:null!=(t=a.salesChannel)?t:""}}catch(e){throw console.error(e),new Error("Malformed channel string")}}static stringify(e){return JSON.stringify(e)}}const Z=(e,n)=>{e.storage.channel=H.parse(n)},ee=(e,n)=>{e.storage.locale=n},ne=e=>l.createHash("md5").update(e).digest("hex");function ie(e){return{name:e.name,value:e.content,valueReference:"ATTACHMENT"}}function te(e){return ne(`${e.name}:${JSON.stringify(e.value)}:${e.valueReference}`)}const ae=e=>"ATTACHMENT"===e.valueReference,re=e=>{var n;return[e.itemOffered.sku,e.seller.identifier,e.price<.01?"Gift":void 0,null==(n=e.itemOffered.additionalProperty)?void 0:n.filter(ae).map(te).join("-")].filter(Boolean).join("::")},oe=(e,n)=>({listPrice:e.listPrice/100,price:e.sellingPrice/100,quantity:e.quantity,seller:{identifier:e.seller},itemOffered:{sku:e.id,image:[],name:e.name,additionalProperty:e.attachments.map(ie)},index:n}),le=e=>{var n,i;return{quantity:e.quantity,seller:e.seller.identifier,id:e.itemOffered.sku,index:e.index,attachments:(null!=(n=null==(i=e.itemOffered.additionalProperty)?void 0:i.filter(ae))?n:[]).map(e=>({name:e.name,content:e.value}))}},de=e=>e.reduce((e,n)=>{var i;const t=re(n);return e.has(t)||e.set(t,[]),null==(i=e.get(t))||i.push(n),e},new Map),se=e=>{const n=e.items.reduce((e,n)=>{const i=re(oe(n));return e[i]||(e[i]=[]),e[i].push(n),e},{});return{...e,items:Object.values(n).map(e=>{const[n]=e,i=e.reduce((e,n)=>e+n.quantity,0);return{...n,quantity:i,sellingPrice:e.reduce((e,n)=>{var i,t,a,r;return e+(null!=(i=null==n||null==(t=n.priceDefinition)?void 0:t.total)?i:(null!=(a=null==n?void 0:n.quantity)?a:0)*(null!=(r=null==n?void 0:n.sellingPrice)?r:0))},0)/i}})}},ue=async(e,n)=>({order:{orderNumber:e.orderFormId,acceptedOffer:e.items.map(async e=>({...e,product:await n.load(e.id)}))},messages:e.messages.map(({text:e,status:n})=>({text:e,status:n.toUpperCase()}))}),ce=({items:e})=>ne(JSON.stringify(e)),me=async(e,n)=>{try{return await n.checkout.setCustomData({id:e.orderFormId,appId:"faststore",key:"cartEtag",value:ce(e)})}catch(e){throw console.error('Error while setting custom data to orderForm.\n Make sure to add the following custom app to the orderForm: \n{"fields":["cartEtag"],"id":"faststore","major":1}.\n More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api'),e}},pe={validateCart:async(e,{cart:{order:n},session:i},t)=>{const{orderNumber:a,acceptedOffer:r,shouldSplitItem:l}=n,{clients:{commerce:d},loaders:{skuLoader:s}}=t,u=null==i?void 0:i.channel,c=null==i?void 0:i.locale;u&&Z(t,u),c&&ee(t,c);const m=await(async(e,{clients:{commerce:n}})=>n.checkout.orderForm({id:e}))(a,t);if(0!==m.messages.length&&await(async(e,{clients:{commerce:n}})=>n.checkout.clearOrderFormMessages({id:e}))(a,t),(e=>{var n,i;const t=null==(n=e.customData)?void 0:n.customApps.find(e=>"faststore"===e.id),a=null==t||null==(i=t.fields)?void 0:i.cartEtag;return null==a||ce(e)!==a})(m)&&a){const e=await me(m,d).then(se);return ue(e,s)}const p=de(r),k=de(m.items.map(oe)),v=Array.from(k.entries()),g=Array.from(p.entries()),{itemsToAdd:y,itemsToUpdate:f}=g.reduce((e,[n,i])=>{const t=k.get(n);if(!t)return i.forEach(n=>e.itemsToAdd.push(n)),e;const[a,...r]=t,o=i.reduce((e,n)=>e+n.quantity,0);return e.itemsToUpdate.push({...a,quantity:o}),r.forEach(n=>e.itemsToUpdate.push({...n,quantity:0})),e},{itemsToAdd:[],itemsToUpdate:[]}),N=[...y,...f,...v.filter(([e])=>!p.has(e)).flatMap(([,e])=>e.map(e=>({...e,quantity:0})))].map(le);if(0===N.length)return null;const S=await d.checkout.updateOrderFormItems({id:m.orderFormId,orderItems:N,shouldSplitItem:l}).then(e=>(async(e,n,{clients:{commerce:i}})=>{if(!n)return e;const{updateShipping:t,addressChanged:a}=((e,n)=>{var i,t;if(!(e=>{var n,i;return!!e.postalCode||(null==(n=e.geoCoordinates)?void 0:n.latitude)&&(null==(i=e.geoCoordinates)?void 0:i.longitude)})(n))return{updateShipping:!1,addressChanged:!1};if(!(e=>0!==e.items.length)(e))return{updateShipping:!1,addressChanged:!1};const[a]=null!=(i=null==e||null==(t=e.shippingData)?void 0:t.selectedAddresses)?i:[];if(r=a,"string"==typeof(o=n.postalCode)&&(null==r?void 0:r.postalCode)!==o||((e,n)=>"number"==typeof(null==n?void 0:n.latitude)&&"number"==typeof(null==n?void 0:n.longitude)&&((null==e?void 0:e.geoCoordinates[0])!==(null==n?void 0:n.longitude)||(null==e?void 0:e.geoCoordinates[1])!==(null==n?void 0:n.latitude)))(a,n.geoCoordinates)||((e,n)=>"string"==typeof n&&(null==e?void 0:e.addressType)!==n)(a,n.addressType))return{updateShipping:!0,addressChanged:!0};var r,o;const{logisticsInfo:l}=e.shippingData;return((e,n)=>{var i,t,a;const r=null==n||null==(i=n.deliveryMode)?void 0:i.deliveryChannel,o=null==n||null==(t=n.deliveryMode)?void 0:t.deliveryMethod,{startDate:l,endDate:d}=(null==n||null==(a=n.deliveryMode)?void 0:a.deliveryWindow)||{};return e.some(({selectedDeliveryChannel:e,selectedSla:n,slas:i})=>{const t=r&&e!==r,a=o&&n!==o;return null==i?void 0:i.some(e=>{var n,i,s;return!!(t&&e.deliveryChannel===r||a&&e.id===o)||l&&d&&e.deliveryChannel===r&&e.id===o&&(!(null!=e&&e.deliveryWindow)||(null==e||null==(n=e.deliveryWindow)?void 0:n.startDateUtc)!==l||(null==e||null==(i=e.deliveryWindow)?void 0:i.endDateUtc)!==d)&&(null==(s=e.availableDeliveryWindows)?void 0:s.some(e=>(null==e?void 0:e.startDateUtc)===l&&(null==e?void 0:e.endDateUtc)===d))})})})(l,n)?{updateShipping:!0,addressChanged:!1}:{updateShipping:!1,addressChanged:!1}})(e,n);if(t){var r;const t=((e,n,i)=>{var t,a,r,o;const l=n.postalCode,d=n.geoCoordinates,s=null!=(t=null==e||null==(a=e.shippingData)?void 0:a.availableAddresses)?t:[],u=null!=(r=null==e||null==(o=e.shippingData)?void 0:o.selectedAddresses)?r:[];if(!i&&u.length>0)return[u[0]];if(i&&s.length>0)for(const e of s){if(l&&d&&(e.postalCode===l||e.geoCoordinates[0]===d.longitude&&e.geoCoordinates[1]===d.latitude))return[e];if(l&&!d&&e.postalCode===l)return[e];if(d&&!l&&e.geoCoordinates[0]===d.longitude&&e.geoCoordinates[1]===d.latitude)return[e]}return null})(e,n,a)||(e=>{const n=e.geoCoordinates,i={addressType:e.addressType||null,postalCode:e.postalCode||null,city:null,state:null,country:e.country||null,street:null,number:null,neighborhood:null,complement:null,reference:null,geoCoordinates:[]};if(n){const e="object"==typeof n&&"latitude"in n?n.latitude:null,t="object"==typeof n&&"longitude"in n?n.longitude:null;i.geoCoordinates=null!==e&&null!==t?[t,e]:[]}return[i]})(n);return!(null==(r=n.deliveryMode)||!r.deliveryWindow)&&await i.checkout.shippingData({id:e.orderFormId,index:e.items.length,deliveryMode:n.deliveryMode,selectedAddresses:t},!1),i.checkout.shippingData({id:e.orderFormId,index:e.items.length,deliveryMode:n.deliveryMode,selectedAddresses:t},!0)}return e})(e,i,t)).then(e=>me(e,d)).then(se),h=o(m.messages,S.messages);return((e,n)=>{const i=(e,n)=>({...e,itemOffered:{sku:e.itemOffered.sku},index:n}),t=n.items.map(oe).map(i),a=e.acceptedOffer.map(i),r=e.orderNumber===n.orderFormId,l=o(t,a);return r&&l})(n,S)&&h?null:ue(S,s)},validateSession:async(e,{session:n,search:i},{clients:t})=>{var a,r,l,d,s,u,c,m,p,k,v,g,y,f,N,S,h,b,T,V,D;const I=H.parse(null!=(a=n.channel)?a:""),w=String(null!=(r=n.postalCode)?r:"").replace(/\D/g,""),F=null!=(l=n.geoCoordinates)?l:null,C=null!=(d=n.country)?d:"",O=new URLSearchParams(i),P=null!=(s=O.get("sc"))?s:I.salesChannel;O.set("sc",P);const[A,L]=await Promise.all([w||F?t.commerce.checkout.region({postalCode:w,geoCoordinates:F,country:C,salesChannel:P}):Promise.resolve(null),t.commerce.session(O.toString()).catch(()=>null)]),E=null!=(u=null==L?void 0:L.namespaces.profile)?u:null,R=null!=(c=null==L?void 0:L.namespaces.store)?c:null,x=null==A?void 0:A[0],M=null==x?void 0:x.sellers.find(e=>I.seller===e.id),U={...n,currency:{code:null!=(m=null==R?void 0:R.currencyCode.value)?m:n.currency.code,symbol:null!=(p=null==R?void 0:R.currencySymbol.value)?p:n.currency.symbol},country:null!=(k=null==R?void 0:R.countryCode.value)?k:n.country,channel:H.stringify({salesChannel:null!=(v=null==R||null==(g=R.channel)?void 0:g.value)?v:I.salesChannel,regionId:null!=(y=null==x?void 0:x.id)?y:I.regionId,seller:null==M?void 0:M.id}),person:null!=E&&E.id?{id:null!=(f=null==(N=E.id)?void 0:N.value)?f:"",email:null!=(S=null==(h=E.email)?void 0:h.value)?S:"",givenName:null!=(b=null==(T=E.firstName)?void 0:T.value)?b:"",familyName:null!=(V=null==(D=E.lastName)?void 0:D.value)?V:""}:null};return o(n,U)?null:U},subscribeToNewsletter:async(e,{data:n},{clients:{commerce:i}})=>{const t=await i.subscribeToNewsletter(n);return{id:null==t?void 0:t.Id}}},ke=new d.GraphQLScalarType({name:"ObjectOrString",description:"A string or the string representation of an object (a stringified object).",parseValue:function(e){return"string"==typeof e?ve(e):null},serialize:function(e){return"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null},parseLiteral:e=>e.kind===s.Kind.STRING?ve(e.value):null});function ve(e){try{return JSON.parse(e)}catch(n){return e}}const ge=e=>"Price"in e&&"seller"in e&&"product"in e,ye=e=>"skuName"in e,fe={priceCurrency:async(e,n,i)=>{var t;const{loaders:{salesChannelLoader:a},storage:{channel:r}}=i;return null!=(t=(await a.load(r.salesChannel)).CurrencyCode)?t:""},priceValidUntil:e=>{var n,i;return ge(e)?null!=(n=e.PriceValidUntil)?n:"":ye(e)?null!=(i=e.priceValidUntil)?i:"":null},itemCondition:()=>"https://schema.org/NewCondition",availability:async e=>ge(e)?x(E(e)):ye(e)?x("available"===e.availability):null,seller:(e,n,i)=>{var t;return ge(e)?{identifier:(null==(t=i.storage.channel)?void 0:t.seller)||e.seller.sellerId||""}:ye(e)?{identifier:e.seller}:null},price:e=>ge(e)?R(e):ye(e)?e.sellingPrice/100:null,sellingPrice:e=>{return ge(e)?null!=(n=e.Price)?n:0:ye(e)?e.sellingPrice/100:null;var n},listPrice:e=>{var n;return ge(e)?null!=(n=e.ListPrice)?n:0:ye(e)?e.listPrice/100:null},itemOffered:e=>ge(e)?e.product:ye(e)?{...e.product,attachmentsValues:e.attachments}:null,quantity:e=>{var n;return ge(e)?null!=(n=e.AvailableQuantity)?n:0:ye(e)?e.quantity:null}},Ne=({linkText:e})=>`/${e}/p`,Se={imageText:"image",imageUrl:"https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg"},he=(e,n)=>`${e}-${n}`,be={productID:({itemId:e})=>e,name:({isVariantOf:e,name:n})=>null!=n?n:e.productName,slug:({isVariantOf:{linkText:e},itemId:n})=>he(e,n),description:({isVariantOf:{description:e}})=>e,seo:({isVariantOf:e})=>({title:e.productName,description:e.description,canonical:Ne(e)}),brand:({isVariantOf:{brand:e}})=>({name:e}),breadcrumbList:({isVariantOf:{categories:e,productName:n,linkText:i},itemId:t})=>{return{itemListElement:[...e.reverse().map((e,n)=>{const i=e.split("/");return{name:i[i.length-2],item:i.map(j).join("/"),position:n+1}}),{name:n,item:(a=i,r=t,`/${he(a,r)}/p`),position:e.length+1}],numberOfItems:e.length};var a,r},image:({images:e})=>{var n,i;return(null!=(i=e,n=Array.isArray(i)&&i.length>0?i:null)?n:[Se]).map(({imageUrl:e,imageText:n})=>({alternateName:null!=n?n:"",url:e.replace("vteximg.com.br","vtexassets.com")}))},sku:({itemId:e})=>e,gtin:({referenceId:e})=>{var n,i;return null!=(n=null==(i=e[0])?void 0:i.Value)?n:""},review:()=>[],aggregateRating:()=>({}),offers:e=>e.sellers.map(n=>(({offer:e,seller:n,product:i})=>({...e,product:i,seller:n}))({offer:n.commertialOffer,seller:n,product:e})).sort(M),isVariantOf:e=>e,additionalProperty:({variations:e=[],attachmentsValues:n=[]})=>[...e.flatMap(({name:e,values:n})=>n.map(n=>({name:e,value:n,valueReference:"SPECIFICATION"}))),...n.map(ie)],releaseDate:({isVariantOf:{releaseDate:e}})=>null!=e?e:""},Te=new Set(["allSpecifications"]),Ve={price_desc:"price:desc",price_asc:"price:asc",orders_desc:"orders:desc",name_desc:"name:desc",name_asc:"name:asc",release_desc:"release:desc",discount_desc:"discount:desc",score_desc:""},De=e=>{const n=e.flatMap(e=>e.sellers.map(n=>({offer:n.commertialOffer,sku:e}))),i=Y(n,({offer:e},{offer:n})=>M(e,n));return i?i.sku:e[0]},Ie={product:async(e,{locator:n},i)=>{const t=X(n),a=Q(n),r=null!=(l=null==(o=n)||null==(d=o.find(e=>"id"===e.key))?void 0:d.value)?l:null;var o,l,d;const s=(e=>{var n,i;return null!=(n=null==e||null==(i=e.find(e=>"slug"===e.key))?void 0:i.value)?n:null})(n);t&&Z(i,t),a&&ee(i,a);const{loaders:{skuLoader:u},clients:{commerce:c,search:m}}=i;try{var p;const e=null!=(p=null!=r?r:null==s?void 0:s.split("-").pop())?p:"";if(!(e=>""!==e&&!Number.isNaN(Number(e)))(e))throw new Error("Invalid SkuId");const n=await u.load(e);if(s&&n.isVariantOf.linkText&&!s.startsWith(n.isVariantOf.linkText))throw new Error(`Slug was set but the fetched sku does not satisfy the slug condition. slug: ${s}, linkText: ${n.isVariantOf.linkText}`);return n}catch(e){if(null==s)throw new O("Missing slug or id");const n=await c.catalog.portal.pagetype(s+"/p");if("Product"!==n.pageType||!n.id)throw new P("No product found for slug "+s);const{products:[i]}=await m.products({page:0,count:1,query:"product:"+n.id});if(!i)throw new P("No product found for id "+n.id);const t=De(i.items);return F(t,i)}},collection:(e,{slug:n},i)=>{const{loaders:{collectionLoader:t}}=i;return t.load(n)},search:async(e,{first:n,after:i,sort:t,term:a,selectedFacets:r},o)=>{var l,d;const s=X(r),u=Q(r),c=(e=>{var n;const i=null==e?void 0:e.filter(e=>(e=>"string"==typeof z[e])(e.key));if(Array.isArray(i)&&i.length>1)throw new O(`You passed ${i.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${i.map(e=>e.key).join(",")}`);return null!=(n=null==i?void 0:i[0])?n:null})(r);s&&Z(o,s),u&&ee(o,u);let m=a;c&&(m="product:"+(await o.clients.commerce.catalog.products.crossselling({type:z[c.key],productId:c.value})).map(e=>e.productId).slice(0,n).join(";"));const p=i?Number(i):0,k={page:Math.ceil(p/n),count:n,query:null!=(l=m)?l:void 0,sort:Ve[null!=t?t:"score_desc"],selectedFacets:null!=(d=null==r?void 0:r.flatMap(K))?d:[]};return{searchArgs:k,productSearchPromise:o.clients.search.products(k)}},allProducts:async(e,{first:n,after:i},t)=>{const{clients:{search:a}}=t,r=i?Number(i):0,o=await a.products({page:Math.ceil(r/n),count:n}),l=o.products.map(e=>e.items.map(n=>F(n,e))).flat().filter(e=>e.sellers.length>0);return{pageInfo:{hasNextPage:o.pagination.after.length>0,hasPreviousPage:o.pagination.before.length>0,startCursor:"0",endCursor:o.recordsFiltered.toString(),totalCount:o.recordsFiltered},edges:l.map((e,n)=>({node:e,cursor:(r+n).toString()}))}},allCollections:async(e,{first:n,after:i},t)=>{const{clients:{commerce:a}}=t,r=i?Number(i):0,[o,l]=await Promise.all([a.catalog.brand.list(),a.catalog.category.tree()]),d=[],s=(e,n)=>{d.push({...e,level:n});for(const i of e.children)s(i,n+1)};for(const e of l)s(e,0);const u=[...o.filter(e=>e.isActive).map(e=>({...e,type:"brand"})),...d].filter(e=>Boolean(G.slug(e,null,t,null)));return{pageInfo:{hasNextPage:u.length-r>n,hasPreviousPage:r>0,startCursor:"0",endCursor:(Math.min(n,u.length-r)-1).toString(),totalCount:u.length},edges:u.slice(r,r+n).map((e,n)=>({node:e,cursor:(r+n).toString()}))}},shipping:async(e,{country:n,items:i,postalCode:t},a)=>{const{loaders:{simulationLoader:r},clients:{commerce:o}}=a,[l,d]=await Promise.all([r.load({country:n,items:i,postalCode:t}),o.checkout.address({postalCode:t,country:n})]);return{...l,address:d}},redirect:async(e,{term:n,selectedFacets:i},t)=>{var a;if(!(n||i&&i.length))return null;const{redirect:r}=await t.clients.search.products({page:1,count:1,query:null!=n?n:void 0,selectedFacets:null!=(a=null==i?void 0:i.flatMap(K))?a:[]});return{url:r}},sellers:async(e,{postalCode:n,geoCoordinates:i,country:t,salesChannel:a},r)=>{const{clients:{commerce:o}}=r,l=await o.checkout.region({postalCode:n,geoCoordinates:i,country:t,salesChannel:a}),d=null==l?void 0:l[0],{id:s,sellers:u}=d;return{id:s,sellers:u}}},we=["bd","d","h","m"],Fe={bd:{0:"Today",1:"In 1 business day",other:"Up to # business days"},d:{0:"Today",1:"In 1 day",other:"Up to # days"},h:{0:"Now",1:"In 1 hour",other:"Up to # hours"},m:{0:"Now",1:"In 1 minute",other:"Up to # minutes"}};function Ce(e){const n={};return e.forEach(e=>{n[e.name]=e.values[0]}),n}function Oe(e,n){return Number.isNaN(Number(e)-Number(n))?e<n?-1:e>n?1:0:Number(e)-Number(n)}const Pe={StoreCollection:G,StoreAggregateOffer:U,StoreProduct:be,StoreSeo:{title:({title:e})=>null!=e?e:"",description:({description:e})=>null!=e?e:"",canonical:({canonical:e})=>null!=e?e:"",titleTemplate:()=>""},StoreFacet:{__resolveType:({type:e})=>"TEXT"===e?"StoreFacetBoolean":"StoreFacetRange"},StoreFacetBoolean:{key:({key:e})=>e,label:({name:e})=>e,values:({values:e})=>e.sort((e,n)=>e.name.localeCompare(n.name))},StoreFacetRange:J,StoreFacetValueBoolean:{value:({value:e})=>e,label:({name:e})=>e||"unknown",selected:({selected:e})=>e,quantity:({quantity:e})=>e},StoreOffer:fe,StoreAggregateRating:{ratingValue:()=>5,reviewCount:()=>0},StoreReview:{reviewRating:()=>({ratingValue:5,bestRating:5}),author:()=>({name:""})},StoreProductGroup:{hasVariant:e=>e.isVariantOf.items.map(n=>F(n,e.isVariantOf)),productGroupID:({isVariantOf:e})=>e.productId,name:e=>e.isVariantOf.productName,skuVariants:e=>e,additionalProperty:({isVariantOf:{specificationGroups:e}})=>e.filter(e=>!Te.has(e.name)).flatMap(({specifications:e})=>e.flatMap(({name:e,values:n})=>n.map(n=>({name:e,value:n,valueReference:"SPECIFICATION"}))))},StoreSearchResult:{suggestions:async(e,n,i)=>{const{clients:{search:t}}=i,{searchArgs:a}=e;if(!a.query)return{terms:(await t.topSearches()).searches.map(e=>({value:e.term,count:e.count})),products:[]};const{productSearchPromise:r}=e,[o,l]=await Promise.all([t.suggestedTerms(a),r]),d=l.products.map(e=>{const n=De(e.items);return n&&F(n,e)}).filter(e=>!!e),{searches:s}=o;return{terms:s.map(e=>({value:e.term,count:e.count})),products:d}},products:async({productSearchPromise:e})=>{const n=await e,i=n.products.map(e=>{const n=De(e.items);return n&&F(n,e)}).filter(e=>!!e);return{pageInfo:{hasNextPage:n.pagination.after.length>0,hasPreviousPage:n.pagination.before.length>0,startCursor:"0",endCursor:n.recordsFiltered.toString(),totalCount:n.recordsFiltered},edges:i.map((e,n)=>({node:e,cursor:n.toString()}))}},facets:async({searchArgs:e},n,i)=>{var t,a;const{clients:{search:r}}=i;i.storage.searchArgs=e;const{facets:o=[]}=await r.facets(e),l=!e.query,d=!(null==(t=e.selectedFacets)||!t.length)&&"category-1"===e.selectedFacets[0].key,s=!(null==(a=e.selectedFacets)||!a.length)&&"brand"===e.selectedFacets[0].key;return o.filter(e=>!l||!((e,n,i)=>n?"category-1"===e.key:!!i&&"brand"===e.key)(e,d,s))},metadata:async({searchArgs:e,productSearchPromise:n})=>{var i,t;if(!e.query)return null;const a=await n;return{isTermMisspelled:null!=(i=null==(t=a.correction)?void 0:t.misspelled)&&i,logicalOperator:a.operator}}},StorePropertyValue:{propertyID:e=>te(e),name:({name:e})=>e,value:({value:e})=>e,valueReference:({valueReference:e})=>e},SkuVariants:{activeVariations:e=>Ce(e.variations),allVariantsByName:e=>function(e){const n={};return null==e||e.forEach(e=>{var i;n[null!=(i=e.field.originalName)?i:e.field.name]=e.values.map(e=>{var n;return null!=(n=e.originalName)?n:e.name})}),n}(e.isVariantOf.skuSpecifications),slugsMap:(e,n)=>{var i,t;return function(e,n,i){const t={};return e.forEach(e=>{var a,r;const o=e.variations;if(0===o.length)return;const l=`${n}-${null!=(a=null==(r=o.find(e=>e.name===n))?void 0:r.values[0])?a:""}`,d=o.reduce((e,i)=>i.name===n?e:e+`-${i.name}-${i.values[0]}`,l);t[d]=`${i}-${e.itemId}`}),t}(e.isVariantOf.items,null!=(i=n.dominantVariantName)?i:null==(t=e.variations[0])?void 0:t.name,e.isVariantOf.linkText)},availableVariations:(e,n)=>{var i,t;const a=null!=(i=n.dominantVariantName)?i:null==(t=e.variations[0])?void 0:t.name,r=Ce(e.variations);return function(e,n,i){const t={},a=new Set;return e.forEach(e=>{if(0===e.variations.length)return;const r=null!=(l=(o=e.images).find(e=>"skuvariation"===e.imageLabel))?l:o[0];var o,l;const d=e.variations.find(e=>e.name===n);if((null==d?void 0:d.values[0])===i)e.variations.forEach(e=>{var n;const i=`${e.name}-${e.values[0]}`;if(a.has(i))return;a.add(i);const o={src:r.imageUrl,alt:null!=(n=r.imageLabel)?n:"",label:`${e.name}: ${e.values[0]}`,value:e.values[0]};t[e.name]?t[e.name].push(o):t[e.name]=[o]});else{var s;const e=`${n}-${null==d?void 0:d.values[0]}`;if(!d||a.has(e))return;a.add(e);const i={src:r.imageUrl,alt:null!=(s=r.imageLabel)?s:"",label:`${n}: ${d.values[0]}`,value:d.values[0]};t[d.name]?t[d.name].push(i):t[d.name]=[i]}}),function(e){const n=e;for(const n in e)e[n].sort((e,n)=>Oe(e.value,n.value));return n}(t)}(e.isVariantOf.items,a,r[a])}},ShippingSLA:{carrier:e=>{var n,i;return null!=(n=null!=(i=null==e?void 0:e.friendlyName)?i:null==e?void 0:e.name)?n:""},price:e=>null!=e&&e.price?e.price/100:null==e?void 0:e.price,localizedEstimates:e=>null!=e&&e.shippingEstimate?(e=>{var n;const[i,t]=[e.split(/\D+/)[0],e.split(/[0-9]+/)[1]],a=""!==i&&!Number.isNaN(Number(i)),r=we.includes(t);if(!a||!r)return"";const o=Number(i)<2?Number(i):"other";return null!=(n=Fe[t][o].replace("#",i))?n:""})(e.shippingEstimate):""},ObjectOrString:ke,Query:Ie,Mutation:pe};var Ae={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Address information.",block:!0},name:{kind:"Name",value:"Address"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address postal code",block:!0},name:{kind:"Name",value:"postalCode"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address city",block:!0},name:{kind:"Name",value:"city"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address state",block:!0},name:{kind:"Name",value:"state"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address country",block:!0},name:{kind:"Name",value:"country"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address street",block:!0},name:{kind:"Name",value:"street"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address number",block:!0},name:{kind:"Name",value:"number"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address neighborhood",block:!0},name:{kind:"Name",value:"neighborhood"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address complement",block:!0},name:{kind:"Name",value:"complement"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address reference",block:!0},name:{kind:"Name",value:"reference"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address geoCoordinates",block:!0},name:{kind:"Name",value:"geoCoordinates"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]}],loc:{start:0,end:554}};Ae.loc.source={body:'"""\nAddress information.\n"""\ntype Address {\n """\n Address postal code\n """\n postalCode: String\n """\n Address city\n """\n city: String\n """\n Address state\n """\n state: String\n """\n Address country\n """\n country: String\n """\n Address street\n """\n street: String\n """\n Address number\n """\n number: String\n """\n Address neighborhood\n """\n neighborhood: String\n """\n Address complement\n """\n complement: String\n """\n Address reference\n """\n reference: String\n """\n Address geoCoordinates\n """\n geoCoordinates: [Float]\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Le={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Aggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.",block:!0},name:{kind:"Name",value:"StoreAggregateOffer"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Highest price among all sellers.",block:!0},name:{kind:"Name",value:"highPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Lowest price among all sellers.",block:!0},name:{kind:"Name",value:"lowPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of sellers selling this SKU.",block:!0},name:{kind:"Name",value:"offerCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ISO code of the currency used for the offer prices.",block:!0},name:{kind:"Name",value:"priceCurrency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with information on each available offer.",block:!0},name:{kind:"Name",value:"offers"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOffer"}}}}},directives:[]}]}],loc:{start:0,end:516}};Le.loc.source={body:'"""\nAggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.\n"""\ntype StoreAggregateOffer {\n """\n Highest price among all sellers.\n """\n highPrice: Float!\n """\n Lowest price among all sellers.\n """\n lowPrice: Float!\n """\n Number of sellers selling this SKU.\n """\n offerCount: Int!\n """\n ISO code of the currency used for the offer prices.\n """\n priceCurrency: String!\n """\n Array with information on each available offer.\n """\n offers: [StoreOffer!]!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ee={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Average rating, based on multiple ratings or reviews.",block:!0},name:{kind:"Name",value:"StoreAggregateRating"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Value of the aggregate rating.",block:!0},name:{kind:"Name",value:"ratingValue"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Total number of ratings.",block:!0},name:{kind:"Name",value:"reviewCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:218}};Ee.loc.source={body:'"""\nAverage rating, based on multiple ratings or reviews.\n"""\ntype StoreAggregateRating {\n """\n Value of the aggregate rating.\n """\n ratingValue: Float!\n """\n Total number of ratings.\n """\n reviewCount: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Re={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"information about the author of a product review or rating.",block:!0},name:{kind:"Name",value:"StoreAuthor"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Author name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:132}};Re.loc.source={body:'"""\ninformation about the author of a product review or rating.\n"""\ntype StoreAuthor {\n """\n Author name.\n """\n name: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var xe={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Brand of a given product.",block:!0},name:{kind:"Name",value:"StoreBrand"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Brand name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:96}};xe.loc.source={body:'"""\nBrand of a given product.\n"""\ntype StoreBrand {\n """\n Brand name.\n """\n name: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Me={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Item of a list.",block:!0},name:{kind:"Name",value:"StoreListItem"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"List item value.",block:!0},name:{kind:"Name",value:"item"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Name of the list item.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Position of the item in the list.",block:!0},name:{kind:"Name",value:"position"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"List of items consisting of chain linked web pages, ending with the current page.",block:!0},name:{kind:"Name",value:"StoreBreadcrumbList"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with breadcrumb elements.",block:!0},name:{kind:"Name",value:"itemListElement"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreListItem"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of breadcrumbs in the list.",block:!0},name:{kind:"Name",value:"numberOfItems"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:486}};Me.loc.source={body:'"""\nItem of a list.\n"""\ntype StoreListItem {\n """\n List item value.\n """\n item: String!\n """\n Name of the list item.\n """\n name: String!\n """\n Position of the item in the list.\n """\n position: Int!\n}\n\n"""\nList of items consisting of chain linked web pages, ending with the current page.\n"""\ntype StoreBreadcrumbList {\n """\n Array with breadcrumb elements.\n """\n itemListElement: [StoreListItem!]!\n """\n Number of breadcrumbs in the list.\n """\n numberOfItems: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ue={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Shopping cart message.",block:!0},name:{kind:"Name",value:"StoreCartMessage"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Shopping cart message text.",block:!0},name:{kind:"Name",value:"text"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Shopping cart message status, which can be `INFO`, `WARNING` or `ERROR`.",block:!0},name:{kind:"Name",value:"status"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreStatus"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Shopping cart information.",block:!0},name:{kind:"Name",value:"StoreCart"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Order information, including `orderNumber` and `acceptedOffer`.",block:!0},name:{kind:"Name",value:"order"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOrder"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of shopping cart messages.",block:!0},name:{kind:"Name",value:"messages"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCartMessage"}}}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Shopping cart input.",block:!0},name:{kind:"Name",value:"IStoreCart"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Order information, including `orderNumber`, `acceptedOffer` and `shouldSplitItem`.",block:!0},name:{kind:"Name",value:"order"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOrder"}}},directives:[]}]}],loc:{start:0,end:628}};Ue.loc.source={body:'"""\nShopping cart message.\n"""\ntype StoreCartMessage {\n """\n Shopping cart message text.\n """\n text: String!\n """\n Shopping cart message status, which can be `INFO`, `WARNING` or `ERROR`.\n """\n status: StoreStatus!\n}\n\n"""\nShopping cart information.\n"""\ntype StoreCart {\n """\n Order information, including `orderNumber` and `acceptedOffer`.\n """\n order: StoreOrder!\n """\n List of shopping cart messages.\n """\n messages: [StoreCartMessage!]!\n}\n\n"""\nShopping cart input.\n"""\ninput IStoreCart {\n """\n Order information, including `orderNumber`, `acceptedOffer` and `shouldSplitItem`.\n """\n order: IStoreOrder!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var qe={kind:"Document",definitions:[{kind:"EnumTypeDefinition",description:{kind:"StringValue",value:"Product collection type. Possible values are `Department`, `Category`, `Brand`, `Cluster`, `SubCategory` or `Collection`.",block:!0},name:{kind:"Name",value:"StoreCollectionType"},directives:[],values:[{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"First level of product categorization.",block:!0},name:{kind:"Name",value:"Department"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Second level of product categorization.",block:!0},name:{kind:"Name",value:"Category"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Third level of product categorization.",block:!0},name:{kind:"Name",value:"SubCategory"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Product brand.",block:!0},name:{kind:"Name",value:"Brand"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Product cluster.",block:!0},name:{kind:"Name",value:"Cluster"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Product collection.",block:!0},name:{kind:"Name",value:"Collection"},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product collection facet, used for search.",block:!0},name:{kind:"Name",value:"StoreCollectionFacet"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet key.",block:!0},name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet value.",block:!0},name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Collection meta information. Used for search.",block:!0},name:{kind:"Name",value:"StoreCollectionMeta"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of selected collection facets.",block:!0},name:{kind:"Name",value:"selectedFacets"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionFacet"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product collection information.",block:!0},name:{kind:"Name",value:"StoreCollection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Meta tag data.",block:!0},name:{kind:"Name",value:"seo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSeo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of items consisting of chain linked web pages, ending with the current page.",block:!0},name:{kind:"Name",value:"breadcrumbList"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBreadcrumbList"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection meta information. Used for search.",block:!0},name:{kind:"Name",value:"meta"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionMeta"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection ID.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Corresponding collection URL slug, with which to retrieve this entity.",block:!0},name:{kind:"Name",value:"slug"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection type.",block:!0},name:{kind:"Name",value:"type"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionType"}}},directives:[]}]}],loc:{start:0,end:1361}};qe.loc.source={body:'"""\nProduct collection type. Possible values are `Department`, `Category`, `Brand`, `Cluster`, `SubCategory` or `Collection`.\n"""\nenum StoreCollectionType {\n """\n First level of product categorization.\n """\n Department\n """\n Second level of product categorization.\n """\n Category\n """\n Third level of product categorization.\n """\n SubCategory\n """\n Product brand.\n """\n Brand\n """\n Product cluster.\n """\n Cluster\n """\n Product collection.\n """\n Collection\n}\n\n"""\nProduct collection facet, used for search.\n"""\ntype StoreCollectionFacet {\n """\n Facet key.\n """\n key: String!\n """\n Facet value.\n """\n value: String!\n}\n\n"""\nCollection meta information. Used for search.\n"""\ntype StoreCollectionMeta {\n """\n List of selected collection facets.\n """\n selectedFacets: [StoreCollectionFacet!]!\n}\n\n"""\nProduct collection information.\n"""\ntype StoreCollection {\n """\n Meta tag data.\n """\n seo: StoreSeo!\n """\n List of items consisting of chain linked web pages, ending with the current page.\n """\n breadcrumbList: StoreBreadcrumbList!\n """\n Collection meta information. Used for search.\n """\n meta: StoreCollectionMeta!\n """\n Collection ID.\n """\n id: ID!\n """\n Corresponding collection URL slug, with which to retrieve this entity.\n """\n slug: String!\n """\n Collection type.\n """\n type: StoreCollectionType!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var je={kind:"Document",definitions:[{kind:"UnionTypeDefinition",name:{kind:"Name",value:"StoreFacet"},directives:[],types:[{kind:"NamedType",name:{kind:"Name",value:"StoreFacetRange"}},{kind:"NamedType",name:{kind:"Name",value:"StoreFacetBoolean"}}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search facet range information.",block:!0},name:{kind:"Name",value:"StoreFacetRange"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet key.",block:!0},name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet label.",block:!0},name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Minimum facet range value.",block:!0},name:{kind:"Name",value:"min"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetValueRange"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Maximum facet range value.",block:!0},name:{kind:"Name",value:"max"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetValueRange"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search facet boolean information.",block:!0},name:{kind:"Name",value:"StoreFacetBoolean"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet key.",block:!0},name:{kind:"Name",value:"key"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet label.",block:!0},name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with information on each facet value.",block:!0},name:{kind:"Name",value:"values"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacetValueBoolean"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search facet range value information. Used for minimum and maximum range values.",block:!0},name:{kind:"Name",value:"StoreFacetValueRange"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search facet range absolute value.",block:!0},name:{kind:"Name",value:"absolute"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search facet range selected value.",block:!0},name:{kind:"Name",value:"selected"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of a specific facet value.",block:!0},name:{kind:"Name",value:"StoreFacetValueBoolean"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet value.",block:!0},name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Facet value label.",block:!0},name:{kind:"Name",value:"label"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates whether facet is selected.",block:!0},name:{kind:"Name",value:"selected"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of items with this facet.",block:!0},name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:1160}};je.loc.source={body:'union StoreFacet = StoreFacetRange | StoreFacetBoolean\n\n"""\nSearch facet range information.\n"""\ntype StoreFacetRange {\n """\n Facet key.\n """\n key: String!\n """\n Facet label.\n """\n label: String!\n """\n Minimum facet range value.\n """\n min: StoreFacetValueRange!\n """\n Maximum facet range value.\n """\n max: StoreFacetValueRange!\n}\n\n"""\nSearch facet boolean information.\n"""\ntype StoreFacetBoolean {\n """\n Facet key.\n """\n key: String!\n """\n Facet label.\n """\n label: String!\n """\n Array with information on each facet value.\n """\n values: [StoreFacetValueBoolean!]!\n}\n\n"""\nSearch facet range value information. Used for minimum and maximum range values.\n"""\ntype StoreFacetValueRange {\n """\n Search facet range absolute value.\n """\n absolute: Float!\n """\n Search facet range selected value.\n """\n selected: Float!\n}\n\n"""\nInformation of a specific facet value.\n"""\ntype StoreFacetValueBoolean {\n """\n Facet value.\n """\n value: String!\n """\n Facet value label.\n """\n label: String!\n """\n Indicates whether facet is selected.\n """\n selected: Boolean!\n """\n Number of items with this facet.\n """\n quantity: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var _e={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Image.",block:!0},name:{kind:"Name",value:"StoreImage"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Image URL.",block:!0},name:{kind:"Name",value:"url"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Alias for the image.",block:!0},name:{kind:"Name",value:"alternateName"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Image input.",block:!0},name:{kind:"Name",value:"IStoreImage"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Image input URL.",block:!0},name:{kind:"Name",value:"url"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Alias for the input image.",block:!0},name:{kind:"Name",value:"alternateName"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:291}};_e.loc.source={body:'"""\nImage.\n"""\ntype StoreImage {\n """\n Image URL.\n """\n url: String!\n """\n Alias for the image.\n """\n alternateName: String!\n}\n\n"""\nImage input.\n"""\ninput IStoreImage {\n """\n Image input URL.\n """\n url: String!\n """\n Alias for the input image.\n """\n alternateName: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Be={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"Mutation"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns `null`.",block:!0},name:{kind:"Name",value:"validateCart"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"cart"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreCart"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"session"},type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSession"}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"StoreCart"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Updates a web session with the specified values.",block:!0},name:{kind:"Name",value:"validateSession"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"session"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSession"}}},directives:[]},{kind:"InputValueDefinition",name:{kind:"Name",value:"search"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"StoreSession"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Subscribes a new person to the newsletter list.",block:!0},name:{kind:"Name",value:"subscribeToNewsletter"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"data"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IPersonNewsletter"}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"PersonNewsletter"}},directives:[]}]}],loc:{start:0,end:570}};Be.loc.source={body:'type Mutation {\n """\n Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns `null`.\n """\n validateCart(cart: IStoreCart!, session: IStoreSession): StoreCart\n """\n Updates a web session with the specified values.\n """\n validateSession(session: IStoreSession!, search: String!): StoreSession\n """\n Subscribes a new person to the newsletter list.\n """\n subscribeToNewsletter(data: IPersonNewsletter!): PersonNewsletter\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var $e={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Newsletter information.",block:!0},name:{kind:"Name",value:"PersonNewsletter"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Person's ID in the newsletter list.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Person data input to the newsletter.",block:!0},name:{kind:"Name",value:"IPersonNewsletter"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Person's name.",block:!0},name:{kind:"Name",value:"name"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Person's email.",block:!0},name:{kind:"Name",value:"email"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:289}};$e.loc.source={body:'"""\nNewsletter information.\n"""\n\ntype PersonNewsletter {\n """\n Person\'s ID in the newsletter list.\n """\n id: String!\n}\n\n"""\nPerson data input to the newsletter.\n"""\ninput IPersonNewsletter {\n """\n Person\'s name.\n """\n name: String!\n """\n Person\'s email.\n """\n email: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ge={kind:"Document",definitions:[{kind:"ScalarTypeDefinition",name:{kind:"Name",value:"ObjectOrString"},directives:[]}],loc:{start:0,end:21}};Ge.loc.source={body:"scalar ObjectOrString",name:"GraphQL request",locationOffset:{line:1,column:1}};var ze={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Offer information.",block:!0},name:{kind:"Name",value:"StoreOffer"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:'This is displayed as the "from" price in the context of promotions\' price comparison. This may change before it reaches the shelf.',block:!0},name:{kind:"Name",value:"listPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Computed price before applying coupons, taxes or benefits. This may change before it reaches the shelf.",block:!0},name:{kind:"Name",value:"sellingPrice"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ISO code of the currency used for the offer prices.",block:!0},name:{kind:"Name",value:"priceCurrency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Also known as spot price.",block:!0},name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.",block:!0},name:{kind:"Name",value:"priceValidUntil"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Offer item condition.",block:!0},name:{kind:"Name",value:"itemCondition"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Offer item availability.",block:!0},name:{kind:"Name",value:"availability"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Seller responsible for the offer.",block:!0},name:{kind:"Name",value:"seller"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOrganization"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Information on the item being offered.",block:!0},name:{kind:"Name",value:"itemOffered"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of items offered.",block:!0},name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Offer input.",block:!0},name:{kind:"Name",value:"IStoreOffer"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Also known as spot price.",block:!0},name:{kind:"Name",value:"price"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:'This is displayed as the "from" price in the context of promotions\' price comparison. This may change before it reaches the shelf.',block:!0},name:{kind:"Name",value:"listPrice"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Seller responsible for the offer.",block:!0},name:{kind:"Name",value:"seller"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOrganization"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Information on the item being offered.",block:!0},name:{kind:"Name",value:"itemOffered"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreProduct"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Number of items offered.",block:!0},name:{kind:"Name",value:"quantity"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:1501}};ze.loc.source={body:'"""\nOffer information.\n"""\ntype StoreOffer {\n """\n This is displayed as the "from" price in the context of promotions\' price comparison. This may change before it reaches the shelf.\n """\n listPrice: Float!\n """\n Computed price before applying coupons, taxes or benefits. This may change before it reaches the shelf.\n """\n sellingPrice: Float!\n """\n ISO code of the currency used for the offer prices.\n """\n priceCurrency: String!\n """\n Also known as spot price.\n """\n price: Float!\n """\n Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.\n """\n priceValidUntil: String!\n """\n Offer item condition.\n """\n itemCondition: String!\n """\n Offer item availability.\n """\n availability: String!\n """\n Seller responsible for the offer.\n """\n seller: StoreOrganization!\n """\n Information on the item being offered.\n """\n itemOffered: StoreProduct!\n """\n Number of items offered.\n """\n quantity: Int!\n}\n\n"""\nOffer input.\n"""\ninput IStoreOffer {\n """\n Also known as spot price.\n """\n price: Float!\n """\n This is displayed as the "from" price in the context of promotions\' price comparison. This may change before it reaches the shelf.\n """\n listPrice: Float!\n """\n Seller responsible for the offer.\n """\n seller: IStoreOrganization!\n """\n Information on the item being offered.\n """\n itemOffered: IStoreProduct!\n """\n Number of items offered.\n """\n quantity: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ke={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of a specific order.",block:!0},name:{kind:"Name",value:"StoreOrder"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).",block:!0},name:{kind:"Name",value:"orderNumber"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with information on each accepted offer.",block:!0},name:{kind:"Name",value:"acceptedOffer"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreOffer"}}}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Order input.",block:!0},name:{kind:"Name",value:"IStoreOrder"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).",block:!0},name:{kind:"Name",value:"orderNumber"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Array with information on each accepted offer.",block:!0},name:{kind:"Name",value:"acceptedOffer"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreOffer"}}}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Indicates whether or not items with attachments should be split.",block:!0},name:{kind:"Name",value:"shouldSplitItem"},type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}]}],loc:{start:0,end:740}};Ke.loc.source={body:'"""\nInformation of a specific order.\n"""\ntype StoreOrder {\n """\n ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).\n """\n orderNumber: String!\n """\n Array with information on each accepted offer.\n """\n acceptedOffer: [StoreOffer!]!\n}\n\n"""\nOrder input.\n"""\ninput IStoreOrder {\n """\n ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).\n """\n orderNumber: String!\n """\n Array with information on each accepted offer.\n """\n acceptedOffer: [IStoreOffer!]!\n """\n Indicates whether or not items with attachments should be split.\n """\n shouldSplitItem: Boolean\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var We={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Organization.",block:!0},name:{kind:"Name",value:"StoreOrganization"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Organization ID.",block:!0},name:{kind:"Name",value:"identifier"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Organization input.",block:!0},name:{kind:"Name",value:"IStoreOrganization"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Organization ID.",block:!0},name:{kind:"Name",value:"identifier"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:213}};We.loc.source={body:'"""\nOrganization.\n"""\ntype StoreOrganization {\n """\n Organization ID.\n """\n identifier: String!\n}\n\n"""\nOrganization input.\n"""\ninput IStoreOrganization {\n """\n Organization ID.\n """\n identifier: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Qe={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Whenever you make a query that allows for pagination, such as `allProducts` or `allCollections`, you can check `StorePageInfo` to learn more about the complete set of items and use it to paginate your queries.",block:!0},name:{kind:"Name",value:"StorePageInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates whether there is at least one more page with items after the ones returned in the current query.",block:!0},name:{kind:"Name",value:"hasNextPage"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates whether there is at least one more page with items before the ones returned in the current query.",block:!0},name:{kind:"Name",value:"hasPreviousPage"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Cursor corresponding to the first possible item.",block:!0},name:{kind:"Name",value:"startCursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Cursor corresponding to the last possible item.",block:!0},name:{kind:"Name",value:"endCursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Total number of items (products or collections), not pages.",block:!0},name:{kind:"Name",value:"totalCount"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]}],loc:{start:0,end:798}};Qe.loc.source={body:'"""\nWhenever you make a query that allows for pagination, such as `allProducts` or `allCollections`, you can check `StorePageInfo` to learn more about the complete set of items and use it to paginate your queries.\n"""\ntype StorePageInfo {\n """\n Indicates whether there is at least one more page with items after the ones returned in the current query.\n """\n hasNextPage: Boolean!\n """\n Indicates whether there is at least one more page with items before the ones returned in the current query.\n """\n hasPreviousPage: Boolean!\n """\n Cursor corresponding to the first possible item.\n """\n startCursor: String!\n """\n Cursor corresponding to the last possible item.\n """\n endCursor: String!\n """\n Total number of items (products or collections), not pages.\n """\n totalCount: Int!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Xe={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Client profile data.",block:!0},name:{kind:"Name",value:"StorePerson"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Client ID.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Client email.",block:!0},name:{kind:"Name",value:"email"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Client first name.",block:!0},name:{kind:"Name",value:"givenName"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Client last name.",block:!0},name:{kind:"Name",value:"familyName"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Client profile data.",block:!0},name:{kind:"Name",value:"IStorePerson"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Client ID.",block:!0},name:{kind:"Name",value:"id"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Client email.",block:!0},name:{kind:"Name",value:"email"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Client first name.",block:!0},name:{kind:"Name",value:"givenName"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Client last name.",block:!0},name:{kind:"Name",value:"familyName"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:487}};Xe.loc.source={body:'"""\nClient profile data.\n"""\ntype StorePerson {\n """\n Client ID.\n """\n id: String!\n """\n Client email.\n """\n email: String!\n """\n Client first name.\n """\n givenName: String!\n """\n Client last name.\n """\n familyName: String!\n}\n\n"""\nClient profile data.\n"""\ninput IStorePerson {\n """\n Client ID.\n """\n id: String!\n """\n Client email.\n """\n email: String!\n """\n Client first name.\n """\n givenName: String!\n """\n Client last name.\n """\n familyName: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ye={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.",block:!0},name:{kind:"Name",value:"StoreProduct"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Meta tag data.",block:!0},name:{kind:"Name",value:"seo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSeo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of items consisting of chain linked web pages, ending with the current page.",block:!0},name:{kind:"Name",value:"breadcrumbList"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBreadcrumbList"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Corresponding collection URL slug, with which to retrieve this entity.",block:!0},name:{kind:"Name",value:"slug"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.",block:!0},name:{kind:"Name",value:"productID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product brand.",block:!0},name:{kind:"Name",value:"brand"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreBrand"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product description.",block:!0},name:{kind:"Name",value:"description"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of images.",block:!0},name:{kind:"Name",value:"image"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreImage"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Aggregate offer information.",block:!0},name:{kind:"Name",value:"offers"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAggregateOffer"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Stock Keeping Unit. Merchant-specific ID for the product.",block:!0},name:{kind:"Name",value:"sku"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Global Trade Item Number.",block:!0},name:{kind:"Name",value:"gtin"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with review information.",block:!0},name:{kind:"Name",value:"review"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreReview"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Aggregate ratings data.",block:!0},name:{kind:"Name",value:"aggregateRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAggregateRating"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates product group related to this product.",block:!0},name:{kind:"Name",value:"isVariantOf"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductGroup"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of additional properties.",block:!0},name:{kind:"Name",value:"additionalProperty"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePropertyValue"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The product's release date. Formatted using https://en.wikipedia.org/wiki/ISO_8601",block:!0},name:{kind:"Name",value:"releaseDate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Product input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.",block:!0},name:{kind:"Name",value:"IStoreProduct"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Stock Keeping Unit. Merchant-specific ID for the product.",block:!0},name:{kind:"Name",value:"sku"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Product name.",block:!0},name:{kind:"Name",value:"name"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Array of product images.",block:!0},name:{kind:"Name",value:"image"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreImage"}}}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Custom Product Additional Properties.",block:!0},name:{kind:"Name",value:"additionalProperty"},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStorePropertyValue"}}}},directives:[]}]}],loc:{start:0,end:2274}};Ye.loc.source={body:'"""\nProduct information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n"""\ntype StoreProduct {\n """\n Meta tag data.\n """\n seo: StoreSeo!\n """\n List of items consisting of chain linked web pages, ending with the current page.\n """\n breadcrumbList: StoreBreadcrumbList!\n """\n Corresponding collection URL slug, with which to retrieve this entity.\n """\n slug: String!\n """\n Product name.\n """\n name: String!\n """\n Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.\n """\n productID: String!\n """\n Product brand.\n """\n brand: StoreBrand!\n """\n Product description.\n """\n description: String!\n """\n Array of images.\n """\n image: [StoreImage!]!\n """\n Aggregate offer information.\n """\n offers: StoreAggregateOffer!\n """\n Stock Keeping Unit. Merchant-specific ID for the product.\n """\n sku: String!\n """\n Global Trade Item Number.\n """\n gtin: String!\n """\n Array with review information.\n """\n review: [StoreReview!]!\n """\n Aggregate ratings data.\n """\n aggregateRating: StoreAggregateRating!\n """\n Indicates product group related to this product.\n """\n isVariantOf: StoreProductGroup!\n """\n Array of additional properties.\n """\n additionalProperty: [StorePropertyValue!]!\n """\n The product\'s release date. Formatted using https://en.wikipedia.org/wiki/ISO_8601\n """\n releaseDate: String!\n}\n\n"""\nProduct input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n"""\ninput IStoreProduct {\n """\n Stock Keeping Unit. Merchant-specific ID for the product.\n """\n sku: String!\n """\n Product name.\n """\n name: String!\n """\n Array of product images.\n """\n image: [IStoreImage!]!\n """\n Custom Product Additional Properties.\n """\n additionalProperty: [IStorePropertyValue!]\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Je={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.",block:!0},name:{kind:"Name",value:"StoreProductGroup"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).",block:!0},name:{kind:"Name",value:"hasVariant"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product group ID.",block:!0},name:{kind:"Name",value:"productGroupID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product group name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of additional properties.",block:!0},name:{kind:"Name",value:"additionalProperty"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePropertyValue"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Object containing data structures to facilitate handling different SKU\nvariant properties. Specially useful for implementing SKU selection \ncomponents.",block:!0},name:{kind:"Name",value:"skuVariants"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"SkuVariants"}},directives:[]}]}],loc:{start:0,end:1113}};Je.loc.source={body:'"""\nProduct group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.\n"""\ntype StoreProductGroup {\n """\n Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).\n """\n hasVariant: [StoreProduct!]!\n """\n Product group ID.\n """\n productGroupID: String!\n """\n Product group name.\n """\n name: String!\n """\n Array of additional properties.\n """\n additionalProperty: [StorePropertyValue!]!\n """\n Object containing data structures to facilitate handling different SKU\n variant properties. Specially useful for implementing SKU selection \n components.\n """\n skuVariants: SkuVariants\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var He={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Properties that can be associated with products and products groups.",block:!0},name:{kind:"Name",value:"StorePropertyValue"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Property id. This propert changes according to the content of the object.",block:!0},name:{kind:"Name",value:"propertyID"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Property value. May hold a string or the string representation of an object.",block:!0},name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ObjectOrString"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Property name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Specifies the nature of the value",block:!0},name:{kind:"Name",value:"valueReference"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStorePropertyValue"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Property id. This propert changes according to the content of the object.",block:!0},name:{kind:"Name",value:"propertyID"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Property value. May hold a string or the string representation of an object.",block:!0},name:{kind:"Name",value:"value"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ObjectOrString"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Property name.",block:!0},name:{kind:"Name",value:"name"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Specifies the nature of the value",block:!0},name:{kind:"Name",value:"valueReference"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:825}};He.loc.source={body:'"""\nProperties that can be associated with products and products groups.\n"""\ntype StorePropertyValue {\n """\n Property id. This propert changes according to the content of the object.\n """\n propertyID: String!\n """\n Property value. May hold a string or the string representation of an object.\n """\n value: ObjectOrString!\n """\n Property name.\n """\n name: String!\n """\n Specifies the nature of the value\n """\n valueReference: String!\n}\n\ninput IStorePropertyValue {\n """\n Property id. This propert changes according to the content of the object.\n """\n propertyID: String\n """\n Property value. May hold a string or the string representation of an object.\n """\n value: ObjectOrString!\n """\n Property name.\n """\n name: String!\n """\n Specifies the nature of the value\n """\n valueReference: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var Ze={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Each product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination.",block:!0},name:{kind:"Name",value:"StoreProductEdge"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Each product node contains the information of a product returned by the query.",block:!0},name:{kind:"Name",value:"node"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product cursor. Used as pagination reference.",block:!0},name:{kind:"Name",value:"cursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Product connections, including pagination information and products returned by the query.",block:!0},name:{kind:"Name",value:"StoreProductConnection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Product pagination information.",block:!0},name:{kind:"Name",value:"pageInfo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePageInfo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with product connection edges, each containing a product and a corresponding cursor.",block:!0},name:{kind:"Name",value:"edges"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductEdge"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Each collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination.",block:!0},name:{kind:"Name",value:"StoreCollectionEdge"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Each collection node contains the information of a product collection returned by the query.",block:!0},name:{kind:"Name",value:"node"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollection"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection cursor. Used as pagination reference.",block:!0},name:{kind:"Name",value:"cursor"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Collection connections, including pagination information and collections returned by the query.",block:!0},name:{kind:"Name",value:"StoreCollectionConnection"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Collection pagination information.",block:!0},name:{kind:"Name",value:"pageInfo"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StorePageInfo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with collection connection page edges, each containing a collection and a corresponding cursor..",block:!0},name:{kind:"Name",value:"edges"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionEdge"}}}}},directives:[]}]},{kind:"EnumTypeDefinition",description:{kind:"StringValue",value:"Product search results sorting options.",block:!0},name:{kind:"Name",value:"StoreSort"},directives:[],values:[{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by price, from highest to lowest.",block:!0},name:{kind:"Name",value:"price_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by price, from lowest to highest.",block:!0},name:{kind:"Name",value:"price_asc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by orders, from highest to lowest.",block:!0},name:{kind:"Name",value:"orders_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by name, in reverse alphabetical order.",block:!0},name:{kind:"Name",value:"name_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by name, in alphabetical order.",block:!0},name:{kind:"Name",value:"name_asc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by release date, from highest to lowest.",block:!0},name:{kind:"Name",value:"release_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by discount value, from highest to lowest.",block:!0},name:{kind:"Name",value:"discount_desc"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Sort by product score, from highest to lowest.",block:!0},name:{kind:"Name",value:"score_desc"},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Selected search facet input.",block:!0},name:{kind:"Name",value:"IStoreSelectedFacet"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Selected search facet key.",block:!0},name:{kind:"Name",value:"key"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Selected search facet value.",block:!0},name:{kind:"Name",value:"value"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"EnumTypeDefinition",description:{kind:"StringValue",value:"Search facet type.",block:!0},name:{kind:"Name",value:"StoreFacetType"},directives:[],values:[{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Indicates boolean search facet.",block:!0},name:{kind:"Name",value:"BOOLEAN"},directives:[]},{kind:"EnumValueDefinition",description:{kind:"StringValue",value:"Indicates range type search facet.",block:!0},name:{kind:"Name",value:"RANGE"},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Suggestion term.",block:!0},name:{kind:"Name",value:"StoreSuggestionTerm"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"The term.",block:!0},name:{kind:"Name",value:"value"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Its occurrences count.",block:!0},name:{kind:"Name",value:"count"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Suggestions information.",block:!0},name:{kind:"Name",value:"StoreSuggestions"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with suggestion terms.",block:!0},name:{kind:"Name",value:"terms"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSuggestionTerm"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array with suggestion products' information.",block:!0},name:{kind:"Name",value:"products"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search result.",block:!0},name:{kind:"Name",value:"SearchMetadata"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Indicates if the search term was misspelled.",block:!0},name:{kind:"Name",value:"isTermMisspelled"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Logical operator used to run the search.",block:!0},name:{kind:"Name",value:"logicalOperator"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search result.",block:!0},name:{kind:"Name",value:"StoreSearchResult"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search result products.",block:!0},name:{kind:"Name",value:"products"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductConnection"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Array of search result facets.",block:!0},name:{kind:"Name",value:"facets"},arguments:[],type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreFacet"}}}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search result suggestions.",block:!0},name:{kind:"Name",value:"suggestions"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSuggestions"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Search result metadata. Additional data can be used to send analytics events.",block:!0},name:{kind:"Name",value:"metadata"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"SearchMetadata"}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IGeoCoordinates"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The latitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"latitude"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The longitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"longitude"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"Query"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns the details of a product based on the specified locator.",block:!0},name:{kind:"Name",value:"product"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"An array of selected search facets.",block:!0},name:{kind:"Name",value:"locator"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProduct"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns the details of a collection based on the collection slug.",block:!0},name:{kind:"Name",value:"collection"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Collection slug.",block:!0},name:{kind:"Name",value:"slug"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollection"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns the result of a product, facet, or suggestion search.",block:!0},name:{kind:"Name",value:"search"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search pagination argument, indicating how many results should be returned from the complete result list.",block:!0},name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search pagination argument, indicating the cursor corresponding with the item after which the results should be fetched.",block:!0},name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search results sorting mode.",block:!0},name:{kind:"Name",value:"sort"},type:{kind:"NamedType",name:{kind:"Name",value:"StoreSort"}},defaultValue:{kind:"EnumValue",value:"score_desc"},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search term.",block:!0},name:{kind:"Name",value:"term"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"StringValue",value:"",block:!1},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Array of selected search facets.",block:!0},name:{kind:"Name",value:"selectedFacets"},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreSearchResult"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns information about all products.",block:!0},name:{kind:"Name",value:"allProducts"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Product pagination argument, indicating how many items should be returned from the complete result list.",block:!0},name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Product pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.",block:!0},name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreProductConnection"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns information about all collections.",block:!0},name:{kind:"Name",value:"allCollections"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Collection pagination argument, indicating how many items should be returned from the complete result list.",block:!0},name:{kind:"Name",value:"first"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Collection pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.",block:!0},name:{kind:"Name",value:"after"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCollectionConnection"}}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns information about shipping simulation.",block:!0},name:{kind:"Name",value:"shipping"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"List of SKU products",block:!0},name:{kind:"Name",value:"items"},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IShippingItem"}}}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Postal code to freight calculator",block:!0},name:{kind:"Name",value:"postalCode"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Country of postal code",block:!0},name:{kind:"Name",value:"country"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"ShippingData"}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns if there's a redirect for a search.",block:!0},name:{kind:"Name",value:"redirect"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Search term.",block:!0},name:{kind:"Name",value:"term"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Array of selected search facets.",block:!0},name:{kind:"Name",value:"selectedFacets"},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreSelectedFacet"}}}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"StoreRedirect"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Returns a list of sellers available for a specific localization.",block:!0},name:{kind:"Name",value:"sellers"},arguments:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Postal code input to calculate sellers",block:!0},name:{kind:"Name",value:"postalCode"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Geocoordinates input to calculate sellers",block:!0},name:{kind:"Name",value:"geoCoordinates"},type:{kind:"NamedType",name:{kind:"Name",value:"IGeoCoordinates"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Country of localization",block:!0},name:{kind:"Name",value:"country"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Sales channel of the navigation",block:!0},name:{kind:"Name",value:"salesChannel"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"SellersData"}},directives:[{kind:"Directive",name:{kind:"Name",value:"cacheControl"},arguments:[{kind:"Argument",name:{kind:"Name",value:"scope"},value:{kind:"StringValue",value:"public",block:!1}},{kind:"Argument",name:{kind:"Name",value:"sMaxAge"},value:{kind:"IntValue",value:"120"}},{kind:"Argument",name:{kind:"Name",value:"staleWhileRevalidate"},value:{kind:"IntValue",value:"3600"}}]}]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Redirect informations, including url returned by the query.\nhttps://schema.org/Thing",block:!0},name:{kind:"Name",value:"StoreRedirect"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"URL to redirect",block:!0},name:{kind:"Name",value:"url"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Regionalization with sellers information.",block:!0},name:{kind:"Name",value:"SellersData"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Identification of region.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of sellers.",block:!0},name:{kind:"Name",value:"sellers"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"SellerInfo"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of sellers.",block:!0},name:{kind:"Name",value:"SellerInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Identification of the seller",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Name of the seller",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Logo of the seller",block:!0},name:{kind:"Name",value:"logo"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}]}],loc:{start:0,end:7490}};Ze.loc.source={body:'"""\nEach product edge contains a `node`, with product information, and a `cursor`, that can be used as a reference for pagination.\n"""\ntype StoreProductEdge {\n """\n Each product node contains the information of a product returned by the query.\n """\n node: StoreProduct!\n """\n Product cursor. Used as pagination reference.\n """\n cursor: String!\n}\n\n"""\nProduct connections, including pagination information and products returned by the query.\n"""\ntype StoreProductConnection {\n """\n Product pagination information.\n """\n pageInfo: StorePageInfo!\n """\n Array with product connection edges, each containing a product and a corresponding cursor.\n """\n edges: [StoreProductEdge!]!\n}\n\n"""\nEach collection edge contains a `node`, with product collection information, and a `cursor`, that can be used as a reference for pagination.\n"""\ntype StoreCollectionEdge {\n """\n Each collection node contains the information of a product collection returned by the query.\n """\n node: StoreCollection!\n """\n Collection cursor. Used as pagination reference.\n """\n cursor: String!\n}\n\n"""\nCollection connections, including pagination information and collections returned by the query.\n"""\ntype StoreCollectionConnection {\n """\n Collection pagination information.\n """\n pageInfo: StorePageInfo!\n """\n Array with collection connection page edges, each containing a collection and a corresponding cursor..\n """\n edges: [StoreCollectionEdge!]!\n}\n\n"""\nProduct search results sorting options.\n"""\nenum StoreSort {\n """\n Sort by price, from highest to lowest.\n """\n price_desc\n """\n Sort by price, from lowest to highest.\n """\n price_asc\n """\n Sort by orders, from highest to lowest.\n """\n orders_desc\n """\n Sort by name, in reverse alphabetical order.\n """\n name_desc\n """\n Sort by name, in alphabetical order.\n """\n name_asc\n """\n Sort by release date, from highest to lowest.\n """\n release_desc\n """\n Sort by discount value, from highest to lowest.\n """\n discount_desc\n """\n Sort by product score, from highest to lowest.\n """\n score_desc\n}\n\n"""\nSelected search facet input.\n"""\ninput IStoreSelectedFacet {\n """\n Selected search facet key.\n """\n key: String!\n """\n Selected search facet value.\n """\n value: String!\n}\n\n"""\nSearch facet type.\n"""\nenum StoreFacetType {\n """\n Indicates boolean search facet.\n """\n BOOLEAN\n """\n Indicates range type search facet.\n """\n RANGE\n}\n\n"""\nSuggestion term.\n"""\ntype StoreSuggestionTerm {\n """\n The term.\n """\n value: String!\n """\n Its occurrences count.\n """\n count: Int!\n}\n\n"""\nSuggestions information.\n"""\ntype StoreSuggestions {\n """\n Array with suggestion terms.\n """\n terms: [StoreSuggestionTerm!]!\n """\n Array with suggestion products\' information.\n """\n products: [StoreProduct!]!\n}\n\n"""\nSearch result.\n"""\ntype SearchMetadata {\n """\n Indicates if the search term was misspelled.\n """\n isTermMisspelled: Boolean!\n """\n Logical operator used to run the search.\n """\n logicalOperator: String!\n}\n\n"""\nSearch result.\n"""\ntype StoreSearchResult {\n """\n Search result products.\n """\n products: StoreProductConnection!\n """\n Array of search result facets.\n """\n facets: [StoreFacet!]!\n """\n Search result suggestions.\n """\n suggestions: StoreSuggestions!\n """\n Search result metadata. Additional data can be used to send analytics events.\n """\n metadata: SearchMetadata\n}\n\ninput IGeoCoordinates {\n """\n The latitude of the geographic coordinates.\n """\n latitude: Float!\n """\n The longitude of the geographic coordinates.\n """\n longitude: Float!\n}\n\ntype Query {\n """\n Returns the details of a product based on the specified locator.\n """\n product(\n """\n An array of selected search facets.\n """\n locator: [IStoreSelectedFacet!]!\n ): StoreProduct!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns the details of a collection based on the collection slug.\n """\n collection(\n """\n Collection slug.\n """\n slug: String!\n ): StoreCollection!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns the result of a product, facet, or suggestion search.\n """\n search(\n """\n Search pagination argument, indicating how many results should be returned from the complete result list.\n """\n first: Int!\n """\n Search pagination argument, indicating the cursor corresponding with the item after which the results should be fetched.\n """\n after: String\n """\n Search results sorting mode.\n """\n sort: StoreSort = score_desc\n """\n Search term.\n """\n term: String = ""\n """\n Array of selected search facets.\n """\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreSearchResult!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns information about all products.\n """\n allProducts(\n """\n Product pagination argument, indicating how many items should be returned from the complete result list.\n """\n first: Int!\n """\n Product pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.\n """\n after: String\n ): StoreProductConnection!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns information about all collections.\n """\n allCollections(\n """\n Collection pagination argument, indicating how many items should be returned from the complete result list.\n """\n first: Int!\n """\n Collection pagination argument, indicating the cursor corresponding with the item after which the items should be fetched.\n """\n after: String\n ): StoreCollectionConnection!\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns information about shipping simulation.\n """\n shipping(\n """\n List of SKU products\n """\n items: [IShippingItem!]!\n """\n Postal code to freight calculator\n """\n postalCode: String!\n """\n Country of postal code\n """\n country: String!\n ): ShippingData\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n\n """\n Returns if there\'s a redirect for a search.\n """\n redirect(\n """\n Search term.\n """\n term: String\n """\n Array of selected search facets.\n """\n selectedFacets: [IStoreSelectedFacet!]\n ): StoreRedirect\n\n\n """\n Returns a list of sellers available for a specific localization.\n """\n sellers(\n """\n Postal code input to calculate sellers\n """\n postalCode: String\n """\n Geocoordinates input to calculate sellers\n """\n geoCoordinates: IGeoCoordinates\n """\n Country of localization\n """\n country: String!\n """\n Sales channel of the navigation\n """\n salesChannel: String\n ): SellersData\n @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)\n}\n\n"""\nRedirect informations, including url returned by the query.\nhttps://schema.org/Thing\n"""\ntype StoreRedirect {\n """\n URL to redirect\n """\n url: String\n}\n\n"""\nRegionalization with sellers information.\n"""\ntype SellersData {\n """\n Identification of region.\n """\n id: String\n """\n List of sellers.\n """\n sellers: [SellerInfo]\n}\n\n"""\nInformation of sellers.\n"""\ntype SellerInfo {\n """\n Identification of the seller\n """\n id: String\n """\n Name of the seller\n """\n name: String\n """\n Logo of the seller\n """\n logo: String\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var en={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of a given review rating.",block:!0},name:{kind:"Name",value:"StoreReviewRating"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Rating value.",block:!0},name:{kind:"Name",value:"ratingValue"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Best rating value.",block:!0},name:{kind:"Name",value:"bestRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Information of a given review.",block:!0},name:{kind:"Name",value:"StoreReview"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Review rating information.",block:!0},name:{kind:"Name",value:"reviewRating"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreReviewRating"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Review author.",block:!0},name:{kind:"Name",value:"author"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreAuthor"}}},directives:[]}]}],loc:{start:0,end:366}};en.loc.source={body:'"""\nInformation of a given review rating.\n"""\ntype StoreReviewRating {\n """\n Rating value.\n """\n ratingValue: Float!\n """\n Best rating value.\n """\n bestRating: Float!\n}\n\n"""\nInformation of a given review.\n"""\ntype StoreReview {\n """\n Review rating information.\n """\n reviewRating: StoreReviewRating!\n """\n Review author.\n """\n author: StoreAuthor!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var nn={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Search Engine Optimization (SEO) tags data.",block:!0},name:{kind:"Name",value:"StoreSeo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Title tag.",block:!0},name:{kind:"Name",value:"title"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Title template tag.",block:!0},name:{kind:"Name",value:"titleTemplate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Description tag.",block:!0},name:{kind:"Name",value:"description"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Canonical tag.",block:!0},name:{kind:"Name",value:"canonical"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]}],loc:{start:0,end:275}};nn.loc.source={body:'"""\nSearch Engine Optimization (SEO) tags data.\n"""\ntype StoreSeo {\n """\n Title tag.\n """\n title: String!\n """\n Title template tag.\n """\n titleTemplate: String!\n """\n Description tag.\n """\n description: String!\n """\n Canonical tag.\n """\n canonical: String!\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var tn={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Currency information.",block:!0},name:{kind:"Name",value:"StoreCurrency"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Currency code (e.g: USD).",block:!0},name:{kind:"Name",value:"code"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Currency symbol (e.g: $).",block:!0},name:{kind:"Name",value:"symbol"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreCurrency"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Currency code (e.g: USD).",block:!0},name:{kind:"Name",value:"code"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Currency symbol (e.g: $).",block:!0},name:{kind:"Name",value:"symbol"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Geographic coordinates information.",block:!0},name:{kind:"Name",value:"StoreGeoCoordinates"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"The latitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"latitude"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The longitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"longitude"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreGeoCoordinates"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The latitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"latitude"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The longitude of the geographic coordinates.",block:!0},name:{kind:"Name",value:"longitude"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Delivery window information.",block:!0},name:{kind:"Name",value:"StoreDeliveryWindow"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery window start date information.",block:!0},name:{kind:"Name",value:"startDate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery window end date information.",block:!0},name:{kind:"Name",value:"endDate"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Delivery window information.",block:!0},name:{kind:"Name",value:"IStoreDeliveryWindow"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery window start date information.",block:!0},name:{kind:"Name",value:"startDate"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery window end date information.",block:!0},name:{kind:"Name",value:"endDate"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Delivery mode information.",block:!0},name:{kind:"Name",value:"StoreDeliveryMode"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery channel information of the session.",block:!0},name:{kind:"Name",value:"deliveryChannel"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery method information of the session.",block:!0},name:{kind:"Name",value:"deliveryMethod"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"The delivery window information of the session.",block:!0},name:{kind:"Name",value:"deliveryWindow"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"StoreDeliveryWindow"}},directives:[]}]},{kind:"InputObjectTypeDefinition",name:{kind:"Name",value:"IStoreDeliveryMode"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery channel information of the session.",block:!0},name:{kind:"Name",value:"deliveryChannel"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery method information of the session.",block:!0},name:{kind:"Name",value:"deliveryMethod"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"The delivery window information of the session.",block:!0},name:{kind:"Name",value:"deliveryWindow"},type:{kind:"NamedType",name:{kind:"Name",value:"IStoreDeliveryWindow"}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Session information.",block:!0},name:{kind:"Name",value:"StoreSession"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session locale.",block:!0},name:{kind:"Name",value:"locale"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session currency.",block:!0},name:{kind:"Name",value:"currency"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"StoreCurrency"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session country.",block:!0},name:{kind:"Name",value:"country"},arguments:[],type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session channel.",block:!0},name:{kind:"Name",value:"channel"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session delivery mode.",block:!0},name:{kind:"Name",value:"deliveryMode"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"StoreDeliveryMode"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session address type.",block:!0},name:{kind:"Name",value:"addressType"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session postal code.",block:!0},name:{kind:"Name",value:"postalCode"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session input geoCoordinates.",block:!0},name:{kind:"Name",value:"geoCoordinates"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"StoreGeoCoordinates"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Session input person.",block:!0},name:{kind:"Name",value:"person"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"StorePerson"}},directives:[]}]},{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Session input.",block:!0},name:{kind:"Name",value:"IStoreSession"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input locale.",block:!0},name:{kind:"Name",value:"locale"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input currency.",block:!0},name:{kind:"Name",value:"currency"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IStoreCurrency"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input country.",block:!0},name:{kind:"Name",value:"country"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input channel.",block:!0},name:{kind:"Name",value:"channel"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input delivery mode.",block:!0},name:{kind:"Name",value:"deliveryMode"},type:{kind:"NamedType",name:{kind:"Name",value:"IStoreDeliveryMode"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input address type.",block:!0},name:{kind:"Name",value:"addressType"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input postal code.",block:!0},name:{kind:"Name",value:"postalCode"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input geoCoordinates.",block:!0},name:{kind:"Name",value:"geoCoordinates"},type:{kind:"NamedType",name:{kind:"Name",value:"IStoreGeoCoordinates"}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Session input person.",block:!0},name:{kind:"Name",value:"person"},type:{kind:"NamedType",name:{kind:"Name",value:"IStorePerson"}},directives:[]}]}],loc:{start:0,end:3027}};tn.loc.source={body:'"""\nCurrency information.\n"""\ntype StoreCurrency {\n """\n Currency code (e.g: USD).\n """\n code: String!\n """\n Currency symbol (e.g: $).\n """\n symbol: String!\n}\n\ninput IStoreCurrency {\n """\n Currency code (e.g: USD).\n """\n code: String!\n """\n Currency symbol (e.g: $).\n """\n symbol: String!\n}\n\n"""\nGeographic coordinates information.\n"""\ntype StoreGeoCoordinates {\n """\n The latitude of the geographic coordinates.\n """\n latitude: Float!\n """\n The longitude of the geographic coordinates.\n """\n longitude: Float!\n}\n\ninput IStoreGeoCoordinates {\n """\n The latitude of the geographic coordinates.\n """\n latitude: Float!\n """\n The longitude of the geographic coordinates.\n """\n longitude: Float!\n}\n\n"""\nDelivery window information.\n"""\ntype StoreDeliveryWindow {\n """\n The delivery window start date information.\n """\n startDate: String!\n """\n The delivery window end date information.\n """\n endDate: String!\n}\n\n"""\nDelivery window information.\n"""\ninput IStoreDeliveryWindow {\n """\n The delivery window start date information.\n """\n startDate: String!\n """\n The delivery window end date information.\n """\n endDate: String!\n}\n\n"""\nDelivery mode information.\n"""\ntype StoreDeliveryMode {\n """\n The delivery channel information of the session.\n """\n deliveryChannel: String!\n """\n The delivery method information of the session.\n """\n deliveryMethod: String!\n """\n The delivery window information of the session.\n """\n deliveryWindow: StoreDeliveryWindow\n}\n\ninput IStoreDeliveryMode {\n """\n The delivery channel information of the session.\n """\n deliveryChannel: String!\n """\n The delivery method information of the session.\n """\n deliveryMethod: String!\n """\n The delivery window information of the session.\n """\n deliveryWindow: IStoreDeliveryWindow\n}\n\n"""\nSession information.\n"""\ntype StoreSession {\n """\n Session locale.\n """\n locale: String!\n """\n Session currency.\n """\n currency: StoreCurrency!\n """\n Session country.\n """\n country: String!\n """\n Session channel.\n """\n channel: String\n """\n Session delivery mode.\n """\n deliveryMode: StoreDeliveryMode\n """\n Session address type.\n """\n addressType: String\n """\n Session postal code.\n """\n postalCode: String\n """\n Session input geoCoordinates.\n """\n geoCoordinates: StoreGeoCoordinates\n """\n Session input person.\n """\n person: StorePerson\n}\n\n"""\nSession input.\n"""\ninput IStoreSession {\n """\n Session input locale.\n """\n locale: String!\n """\n Session input currency.\n """\n currency: IStoreCurrency!\n """\n Session input country.\n """\n country: String!\n """\n Session input channel.\n """\n channel: String\n """\n Session input delivery mode.\n """\n deliveryMode: IStoreDeliveryMode\n """\n Session input address type.\n """\n addressType: String\n """\n Session input postal code.\n """\n postalCode: String\n """\n Session input geoCoordinates.\n """\n geoCoordinates: IStoreGeoCoordinates\n """\n Session input person.\n """\n person: IStorePerson\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var an={kind:"Document",definitions:[{kind:"InputObjectTypeDefinition",description:{kind:"StringValue",value:"Shipping Simulation item input.",block:!0},name:{kind:"Name",value:"IShippingItem"},directives:[],fields:[{kind:"InputValueDefinition",description:{kind:"StringValue",value:"ShippingItem ID / Sku.",block:!0},name:{kind:"Name",value:"id"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Number of items.",block:!0},name:{kind:"Name",value:"quantity"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},directives:[]},{kind:"InputValueDefinition",description:{kind:"StringValue",value:"Seller responsible for the ShippingItem.",block:!0},name:{kind:"Name",value:"seller"},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Shipping Simulation information.",block:!0},name:{kind:"Name",value:"ShippingData"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of LogisticsItem.",block:!0},name:{kind:"Name",value:"items"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"LogisticsItem"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of LogisticsInfo.",block:!0},name:{kind:"Name",value:"logisticsInfo"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"LogisticsInfo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of MessageInfo.",block:!0},name:{kind:"Name",value:"messages"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"MessageInfo"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Address information.",block:!0},name:{kind:"Name",value:"address"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Address"}},directives:[]}]},{kind:"ObjectTypeDefinition",description:{kind:"StringValue",value:"Shipping Simulation Logistic Item.",block:!0},name:{kind:"Name",value:"LogisticsItem"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem ID / Sku.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",name:{kind:"Name",value:"requestIndex"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Number of items.",block:!0},name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Seller responsible for the ShippingItem.",block:!0},name:{kind:"Name",value:"seller"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of Sellers.",block:!0},name:{kind:"Name",value:"sellerChain"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem tax.",block:!0},name:{kind:"Name",value:"tax"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.",block:!0},name:{kind:"Name",value:"priceValidUntil"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem price.",block:!0},name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem listPrice.",block:!0},name:{kind:"Name",value:"listPrice"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem rewardValue.",block:!0},name:{kind:"Name",value:"rewardValue"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem sellingPrice.",block:!0},name:{kind:"Name",value:"sellingPrice"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem measurementUnit.",block:!0},name:{kind:"Name",value:"measurementUnit"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem unitMultiplier.",block:!0},name:{kind:"Name",value:"unitMultiplier"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsItem availability.",block:!0},name:{kind:"Name",value:"availability"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"LogisticsInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsInfo itemIndex.",block:!0},name:{kind:"Name",value:"itemIndex"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"LogisticsInfo selectedSla.",block:!0},name:{kind:"Name",value:"selectedSla"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of LogisticsInfo ShippingSLA.",block:!0},name:{kind:"Name",value:"slas"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"ShippingSLA"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"ShippingSLA"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA id.",block:!0},name:{kind:"Name",value:"id"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA name.",block:!0},name:{kind:"Name",value:"name"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA price.",block:!0},name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Float"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA shipping estimate.",block:!0},name:{kind:"Name",value:"shippingEstimate"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA localized shipping estimate.\nNote: this will always return a localized string for locale `en-US`.",block:!0},name:{kind:"Name",value:"localizedEstimates"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA available delivery windows.",block:!0},name:{kind:"Name",value:"availableDeliveryWindows"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"AvailableDeliveryWindows"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA shipping estimate date.",block:!0},name:{kind:"Name",value:"shippingEstimateDate"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"List of ShippingSLA delivery ids.",block:!0},name:{kind:"Name",value:"deliveryIds"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"DeliveryIds"}}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA delivery channel.",block:!0},name:{kind:"Name",value:"deliveryChannel"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA friendly name.",block:!0},name:{kind:"Name",value:"friendlyName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA carrier.",block:!0},name:{kind:"Name",value:"carrier"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA pickup point id.",block:!0},name:{kind:"Name",value:"pickupPointId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA pickup store info.",block:!0},name:{kind:"Name",value:"pickupStoreInfo"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"PickupStoreInfo"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"ShippingSLA pickup distance.",block:!0},name:{kind:"Name",value:"pickupDistance"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Float"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"AvailableDeliveryWindows"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window start date in UTC",block:!0},name:{kind:"Name",value:"startDateUtc"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window end date in UTC",block:!0},name:{kind:"Name",value:"endDateUtc"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window price",block:!0},name:{kind:"Name",value:"price"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window list price",block:!0},name:{kind:"Name",value:"listPrice"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available delivery window tax",block:!0},name:{kind:"Name",value:"tax"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"DeliveryIds"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds courier id",block:!0},name:{kind:"Name",value:"courierId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds warehouse id",block:!0},name:{kind:"Name",value:"warehouseId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds dock id",block:!0},name:{kind:"Name",value:"dockId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds courier name",block:!0},name:{kind:"Name",value:"courierName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"DeliveryIds quantity",block:!0},name:{kind:"Name",value:"quantity"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"PickupStoreInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupStoreInfo friendly name.",block:!0},name:{kind:"Name",value:"friendlyName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupStoreInfo address.",block:!0},name:{kind:"Name",value:"address"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"PickupAddress"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupStoreInfo additional information.",block:!0},name:{kind:"Name",value:"additionalInfo"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupStoreInfo dock id.",block:!0},name:{kind:"Name",value:"dockId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Information if the store has pickup enable.",block:!0},name:{kind:"Name",value:"isPickupStore"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"PickupAddress"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress address type.",block:!0},name:{kind:"Name",value:"addressType"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress receiver name.",block:!0},name:{kind:"Name",value:"receiverName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress address id.",block:!0},name:{kind:"Name",value:"addressId"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress postal code.",block:!0},name:{kind:"Name",value:"postalCode"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress city.",block:!0},name:{kind:"Name",value:"city"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress state.",block:!0},name:{kind:"Name",value:"state"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress country.",block:!0},name:{kind:"Name",value:"country"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress street.",block:!0},name:{kind:"Name",value:"street"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress number.",block:!0},name:{kind:"Name",value:"number"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress neighborhood.",block:!0},name:{kind:"Name",value:"neighborhood"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress complement.",block:!0},name:{kind:"Name",value:"complement"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress reference.",block:!0},name:{kind:"Name",value:"reference"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"PickupAddress geo coordinates.",block:!0},name:{kind:"Name",value:"geoCoordinates"},arguments:[],type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"MessageInfo"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageInfo code.",block:!0},name:{kind:"Name",value:"code"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageInfo text.",block:!0},name:{kind:"Name",value:"text"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageInfo status.",block:!0},name:{kind:"Name",value:"status"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageInfo fields.",block:!0},name:{kind:"Name",value:"fields"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"MessageFields"}},directives:[]}]},{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"MessageFields"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageFields item index.",block:!0},name:{kind:"Name",value:"itemIndex"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageFields ean.",block:!0},name:{kind:"Name",value:"ean"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"MessageFields sku name.",block:!0},name:{kind:"Name",value:"skuName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}]}],loc:{start:0,end:5041}};an.loc.source={body:'"""\nShipping Simulation item input.\n"""\ninput IShippingItem {\n """\n ShippingItem ID / Sku.\n """\n id: String!\n """\n Number of items.\n """\n quantity: Int!\n """\n Seller responsible for the ShippingItem.\n """\n seller: String!\n}\n\n"""\nShipping Simulation information.\n"""\ntype ShippingData {\n """\n List of LogisticsItem.\n """\n items: [LogisticsItem]\n """\n List of LogisticsInfo.\n """\n logisticsInfo: [LogisticsInfo]\n """\n List of MessageInfo.\n """\n messages: [MessageInfo]\n """\n Address information.\n """\n address: Address\n}\n\n"""\nShipping Simulation Logistic Item.\n"""\ntype LogisticsItem {\n """\n LogisticsItem ID / Sku.\n """\n id: String\n requestIndex: Int\n """\n Number of items.\n """\n quantity: Int\n """\n Seller responsible for the ShippingItem.\n """\n seller: String\n """\n List of Sellers.\n """\n sellerChain: [String]\n """\n LogisticsItem tax.\n """\n tax: Int\n """\n Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.\n """\n priceValidUntil: String\n """\n LogisticsItem price.\n """\n price: Int\n """\n LogisticsItem listPrice.\n """\n listPrice: Int\n """\n LogisticsItem rewardValue.\n """\n rewardValue: Int\n """\n LogisticsItem sellingPrice.\n """\n sellingPrice: Int\n """\n LogisticsItem measurementUnit.\n """\n measurementUnit: String\n """\n LogisticsItem unitMultiplier.\n """\n unitMultiplier: Int\n """\n LogisticsItem availability.\n """\n availability: String\n}\n\ntype LogisticsInfo {\n """\n LogisticsInfo itemIndex.\n """\n itemIndex: String\n """\n LogisticsInfo selectedSla.\n """\n selectedSla: String\n """\n List of LogisticsInfo ShippingSLA.\n """\n slas: [ShippingSLA]\n}\n\ntype ShippingSLA {\n """\n ShippingSLA id.\n """\n id: String\n """\n ShippingSLA name.\n """\n name: String\n """\n ShippingSLA price.\n """\n price: Float\n """\n ShippingSLA shipping estimate.\n """\n shippingEstimate: String\n """\n ShippingSLA localized shipping estimate.\n Note: this will always return a localized string for locale `en-US`.\n """\n localizedEstimates: String\n """\n ShippingSLA available delivery windows.\n """\n availableDeliveryWindows: [AvailableDeliveryWindows]\n """\n ShippingSLA shipping estimate date.\n """\n shippingEstimateDate: String\n """\n List of ShippingSLA delivery ids.\n """\n deliveryIds: [DeliveryIds]\n """\n ShippingSLA delivery channel.\n """\n deliveryChannel: String\n """\n ShippingSLA friendly name.\n """\n friendlyName: String\n """\n ShippingSLA carrier.\n """\n carrier: String\n """\n ShippingSLA pickup point id.\n """\n pickupPointId: String\n """\n ShippingSLA pickup store info.\n """\n pickupStoreInfo: PickupStoreInfo\n """\n ShippingSLA pickup distance.\n """\n pickupDistance: Float\n}\n\ntype AvailableDeliveryWindows {\n """\n Available delivery window start date in UTC\n """\n startDateUtc: String\n """\n Available delivery window end date in UTC\n """\n endDateUtc: String\n """\n Available delivery window price\n """\n price: Int\n """\n Available delivery window list price\n """\n listPrice: Int\n """\n Available delivery window tax\n """\n tax: Int\n}\n\ntype DeliveryIds {\n """\n DeliveryIds courier id\n """\n courierId: String\n """\n DeliveryIds warehouse id\n """\n warehouseId: String\n """\n DeliveryIds dock id\n """\n dockId: String\n """\n DeliveryIds courier name\n """\n courierName: String\n """\n DeliveryIds quantity\n """\n quantity: Int\n}\n\ntype PickupStoreInfo {\n """\n PickupStoreInfo friendly name.\n """\n friendlyName: String\n """\n PickupStoreInfo address.\n """\n address: PickupAddress\n """\n PickupStoreInfo additional information.\n """\n additionalInfo: String\n """\n PickupStoreInfo dock id.\n """\n dockId: String\n """\n Information if the store has pickup enable.\n """\n isPickupStore: Boolean\n}\n\ntype PickupAddress {\n """\n PickupAddress address type.\n """\n addressType: String\n """\n PickupAddress receiver name.\n """\n receiverName: String\n """\n PickupAddress address id.\n """\n addressId: String\n """\n PickupAddress postal code.\n """\n postalCode: String\n """\n PickupAddress city.\n """\n city: String\n """\n PickupAddress state.\n """\n state: String\n """\n PickupAddress country.\n """\n country: String\n """\n PickupAddress street.\n """\n street: String\n """\n PickupAddress number.\n """\n number: String\n """\n PickupAddress neighborhood.\n """\n neighborhood: String\n """\n PickupAddress complement.\n """\n complement: String\n """\n PickupAddress reference.\n """\n reference: String\n """\n PickupAddress geo coordinates.\n """\n geoCoordinates: [Float]\n}\n\ntype MessageInfo {\n """\n MessageInfo code.\n """\n code: String\n """\n MessageInfo text.\n """\n text: String\n """\n MessageInfo status.\n """\n status: String\n """\n MessageInfo fields.\n """\n fields: MessageFields\n}\n\ntype MessageFields {\n """\n MessageFields item index.\n """\n itemIndex: String\n """\n MessageFields ean.\n """\n ean: String\n """\n MessageFields sku name.\n """\n skuName: String\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var rn={kind:"Document",definitions:[{kind:"ObjectTypeDefinition",name:{kind:"Name",value:"SkuVariants"},interfaces:[],directives:[],fields:[{kind:"FieldDefinition",description:{kind:"StringValue",value:"SKU property values for the current SKU.",block:!0},name:{kind:"Name",value:"activeVariations"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"ActiveVariations"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"All available options for each SKU variant property, indexed by their name.",block:!0},name:{kind:"Name",value:"allVariantsByName"},arguments:[],type:{kind:"NamedType",name:{kind:"Name",value:"VariantsByName"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Maps property value combinations to their respective SKU's slug. Enables\nus to retrieve the slug for the SKU that matches the currently selected\nvariations in O(1) time.\nIf `dominantVariantName` is not present, the first variant will be \nconsidered the dominant one.",block:!0},name:{kind:"Name",value:"slugsMap"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"dominantVariantName"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"SlugsMap"}},directives:[]},{kind:"FieldDefinition",description:{kind:"StringValue",value:"Available options for each varying SKU property, taking into account the\n`dominantVariantName` property. Returns all available options for the\ndominant property, and only options that can be combined with its current\nvalue for other properties.\nIf `dominantVariantName` is not present, the first variant will be \nconsidered the dominant one.",block:!0},name:{kind:"Name",value:"availableVariations"},arguments:[{kind:"InputValueDefinition",name:{kind:"Name",value:"dominantVariantName"},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],type:{kind:"NamedType",name:{kind:"Name",value:"FormattedVariants"}},directives:[]}]},{kind:"ScalarTypeDefinition",description:{kind:"StringValue",value:"Example:\n\n```json\n{\n 'Color-Red-Size-40': 'classic-shoes-37'\n}\n```",block:!0},name:{kind:"Name",value:"SlugsMap"},directives:[]},{kind:"ScalarTypeDefinition",description:{kind:"StringValue",value:"Example:\n\n```json\n{\n Color: 'Red', Size: '42'\n}\n```",block:!0},name:{kind:"Name",value:"ActiveVariations"},directives:[]},{kind:"ScalarTypeDefinition",description:{kind:"StringValue",value:'Example:\n\n```json\n{\n Color: [ "Red", "Blue", "Green" ],\n Size: [ "40", "41" ]\n}\n```',block:!0},name:{kind:"Name",value:"VariantsByName"},directives:[]},{kind:"ScalarTypeDefinition",description:{kind:"StringValue",value:'Example:\n\n```json\n{\n Color: [\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n },\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n }\n ],\n Size: [\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n }\n ]\n}\n```',block:!0},name:{kind:"Name",value:"FormattedVariants"},directives:[]}],loc:{start:0,end:1776}};rn.loc.source={body:'type SkuVariants {\n """\n SKU property values for the current SKU.\n """\n activeVariations: ActiveVariations\n """\n All available options for each SKU variant property, indexed by their name.\n """\n allVariantsByName: VariantsByName\n """\n Maps property value combinations to their respective SKU\'s slug. Enables\n us to retrieve the slug for the SKU that matches the currently selected\n variations in O(1) time.\n If `dominantVariantName` is not present, the first variant will be \n considered the dominant one.\n """\n slugsMap(dominantVariantName: String): SlugsMap\n """\n Available options for each varying SKU property, taking into account the\n `dominantVariantName` property. Returns all available options for the\n dominant property, and only options that can be combined with its current\n value for other properties.\n If `dominantVariantName` is not present, the first variant will be \n considered the dominant one.\n """\n availableVariations(dominantVariantName: String): FormattedVariants\n}\n\n"""\nExample:\n\n```json\n{\n \'Color-Red-Size-40\': \'classic-shoes-37\'\n}\n```\n"""\nscalar SlugsMap\n"""\nExample:\n\n```json\n{\n Color: \'Red\', Size: \'42\'\n}\n```\n"""\nscalar ActiveVariations\n"""\nExample:\n\n```json\n{\n Color: [ "Red", "Blue", "Green" ],\n Size: [ "40", "41" ]\n}\n```\n"""\nscalar VariantsByName\n"""\nExample:\n\n```json\n{\n Color: [\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n },\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n }\n ],\n Size: [\n {\n src: "https://storecomponents.vtexassets.com/...",\n alt: "...",\n label: "...",\n value: "..."\n }\n ]\n}\n```\n"""\nscalar FormattedVariants\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var on={kind:"Document",definitions:[{kind:"EnumTypeDefinition",description:{kind:"StringValue",value:"Status used to indicate a message type. For instance, a shopping cart informative or error message.",block:!0},name:{kind:"Name",value:"StoreStatus"},directives:[],values:[{kind:"EnumValueDefinition",name:{kind:"Name",value:"INFO"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"WARNING"},directives:[]},{kind:"EnumValueDefinition",name:{kind:"Name",value:"ERROR"},directives:[]}]}],loc:{start:0,end:154}};on.loc.source={body:'"""\nStatus used to indicate a message type. For instance, a shopping cart informative or error message.\n"""\nenum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};const ln=[Ze,Be,Ae,xe,Me,qe,je,_e,Qe,Ye,nn,ze,Ee,en,Re,Je,We,Le,Ke,Ue,on,He,Xe,Ge,tn,$e,rn,an].map(d.print).join("\n"),dn=(e,n)=>"number"==typeof e&&"number"==typeof n?e>n?n:e:"number"==typeof e?e:n,sn={typeDefs:"directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION",transformer:e=>u.mapSchema(e,{[u.MapperKind.OBJECT_FIELD]:n=>{var i;const t=null==(i=u.getDirective(e,n,"cacheControl"))?void 0:i[0];if(t){const{sMaxAge:e,staleWhileRevalidate:i,scope:a}=t,r=n.resolve;n.resolve=(n,t,o,l)=>{var d,s,u,c,m;return o.cacheControl={sMaxAge:dn(null==(d=o.cacheControl)?void 0:d.sMaxAge,e),staleWhileRevalidate:dn(null==(s=o.cacheControl)?void 0:s.staleWhileRevalidate,i),scope:(c=null==(u=o.cacheControl)?void 0:u.scope,m=a,"string"==typeof c&&"string"==typeof m?"public"===c&&"public"===m?"public":"private":c||m)},null==r?void 0:r(n,t,o,l)}}return n}})};var un;!function(e){e.EXECUTION_ERROR="graphql.error",e.EXECUTION_RESULT="graphql.result",e.RESOLVER_EXECUTION_ERROR="graphql.resolver.error",e.RESOLVER_EXCEPTION="graphql.resolver.exception",e.RESOLVER_FIELD_NAME="graphql.resolver.fieldName",e.RESOLVER_TYPE_NAME="graphql.resolver.typeName",e.RESOLVER_RESULT_TYPE="graphql.resolver.resultType",e.RESOLVER_ARGS="graphql.resolver.args",e.EXECUTION_OPERATION_NAME="graphql.operation.name",e.EXECUTION_OPERATION_TYPE="graphql.operation.type",e.EXECUTION_OPERATION_DOCUMENT="graphql.document",e.EXECUTION_VARIABLES="graphql.variables"}(un||(un={}));const cn=Symbol("OPEN_TELEMETRY_GRAPHQL");function mn(e){const n=[];let i=0===n.length&&Number.isInteger(e.key)?e.prev:e;for(;i;)n.push(i.key),i=i.prev;return[...n].reverse().join(".")}const pn={vtex:{getResolvers:e=>Pe,getContextFactory:e=>n=>{var i;return n.storage={channel:H.parse(e.channel),flags:null!=(i=e.flags)?i:{},locale:e.locale},n.clients=((e,n)=>({search:T(e,n),commerce:(({account:e,environment:n,incrementAddress:i},t)=>{const a=`https://${e}.${n}.com.br`;return{catalog:{salesChannel:e=>S(`${a}/api/catalog_system/pub/saleschannel/${e}`),brand:{list:()=>S(a+"/api/catalog_system/pub/brand/list")},category:{tree:(e=3)=>S(`${a}/api/catalog_system/pub/category/tree/${e}`)},portal:{pagetype:e=>S(`${a}/api/catalog_system/pub/portal/pagetype/${e}`)},products:{crossselling:({type:e,productId:n,groupByProduct:i=!0})=>{const r=new URLSearchParams({sc:t.storage.channel.salesChannel,groupByProduct:i.toString()});return S(`${a}/api/catalog_system/pub/products/crossselling/${e}/${n}?${r}`)}}},checkout:{simulation:(e,{salesChannel:n}=t.storage.channel)=>{const i=new URLSearchParams({sc:n});return S(`${a}/api/checkout/pub/orderForms/simulation?${i.toString()}`,{...h,body:JSON.stringify(e)})},shippingData:({id:e,index:n,deliveryMode:r,selectedAddresses:o},l)=>{var d,s;const u=l?{startDateUtc:null==r||null==(d=r.deliveryWindow)?void 0:d.startDate,endDateUtc:null==r||null==(s=r.deliveryWindow)?void 0:s.endDate}:null,c={logisticsInfo:Array.from({length:n},(e,n)=>({itemIndex:n,selectedDeliveryChannel:(null==r?void 0:r.deliveryChannel)||null,selectedSla:(null==r?void 0:r.deliveryMethod)||null,deliveryWindow:u})),selectedAddresses:o,clearAddressIfPostalCodeNotFound:i};return S(`${a}/api/checkout/pub/orderForm/${e}/attachments/shippingData`,{...h,body:JSON.stringify(c),headers:{"content-type":"application/json",cookie:t.headers.cookie}})},orderForm:({id:e,refreshOutdatedData:n=!0,channel:i=t.storage.channel})=>{const{salesChannel:r}=i,o=new URLSearchParams({refreshOutdatedData:n.toString(),sc:r}),l=t.headers?{...h,headers:{"content-type":"application/json",cookie:t.headers.cookie}}:h;return S(`${a}/api/checkout/pub/orderForm/${e}?${o.toString()}`,l)},clearOrderFormMessages:({id:e})=>S(`${a}/api/checkout/pub/orderForm/${e}/messages/clear`,{...h,body:"{}"}),updateOrderFormItems:({id:e,orderItems:n,allowOutdatedData:i="paymentData",salesChannel:r=t.storage.channel.salesChannel,shouldSplitItem:o=!0})=>{const l=new URLSearchParams({allowOutdatedData:i,sc:r}),d=JSON.stringify({orderItems:n,noSplitItem:!o});return S(`${a}/api/checkout/pub/orderForm/${e}/items?${l}`,t.headers?{headers:{"content-type":"application/json",cookie:t.headers.cookie},body:d,method:"PATCH"}:{headers:{"content-type":"application/json"},body:d,method:"PATCH"})},setCustomData:({id:e,appId:n,key:i,value:t})=>S(`${a}/api/checkout/pub/orderForm/${e}/customData/${n}/${i}`,{...h,body:JSON.stringify({value:t}),method:"PUT"}),region:async({postalCode:e,geoCoordinates:n,country:i,salesChannel:t})=>{const r=new URLSearchParams({country:i,sc:null!=t?t:""});e?r.append("postalCode",e):r.append("geoCoordinates",`${null==n?void 0:n.longitude};${null==n?void 0:n.latitude}`);const o=`${a}/api/checkout/pub/regions/?${r.toString()}`;return S(o)},address:async({postalCode:e,country:n})=>S(`${a}/api/checkout/pub/postal-code/${n}/${e}`)},session:e=>{const n=new URLSearchParams(e);return n.set("items","profile.id,profile.email,profile.firstName,profile.lastName,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol"),S(`${a}/api/sessions?${n.toString()}`,{method:"POST",headers:{"content-type":"application/json",cookie:t.headers.cookie},body:"{}"})},subscribeToNewsletter:e=>S(a+"/api/dataentities/NL/documents/",{...h,body:JSON.stringify({...e,isNewsletterOptIn:!0}),method:"PATCH"})}})(e,n),sp:(({account:e},n)=>{const i=`https://sp.vtex.com/event-api/v1/${e}/event`;return{sendEvent:e=>S(i,{method:"POST",body:JSON.stringify({...e,agent:"@faststore/api",anonymous:I.anonymous(),session:I.session()}),headers:{"content-type":"application/json"}})}})(e)}))(e,n),n.loaders=((e,{clients:n})=>({skuLoader:((e,n)=>new t(async e=>{const{products:i}=await n.search.products({query:"sku:"+e.join(";"),page:0,count:e.length}),t=i.reduce((e,n)=>{for(const i of n.items)e[i.itemId]=F(i,n);return e},{}),a=e.map(e=>t[e]),r=e.filter(e=>!t[e]);if(r.length>0)throw new P("Search API did not found the following skus: "+r.join(","));return a},{maxBatchSize:99}))(0,n),simulationLoader:((e,n)=>{const i=a(1),r=async e=>{const i=e.reduce((e,{items:n})=>[...e,n],[]),t=[...i.flat()],a=await n.commerce.checkout.simulation({country:e[0].country,postalCode:e[0].postalCode,items:t}),r=a.items.reduce((e,n)=>{const i=n.requestIndex;return"number"==typeof i&&i<e.length&&(e[i]=n),e},Array(t.length).fill(null)),o=i.reduce((e,n)=>[...e,n.length+e[e.length-1]],[0]);return i.map((e,n)=>({...a,items:r.slice(o[n],o[n+1]).filter(e=>Boolean(e))}))};return new t(async e=>i(r,e),{maxBatchSize:50})})(0,n),collectionLoader:((e,n)=>{const i=a(20);return new t(async e=>Promise.all(e.map(e=>i(async()=>{const i=await n.commerce.catalog.portal.pagetype(e);if(L(i))return i;throw new P(`Catalog returned ${i.pageType} for slug: ${e}. This usually happens when there is more than one category with the same name in the same category tree level.`)}))),{batch:!1})})(0,n),salesChannelLoader:((e,n)=>new t(async e=>Promise.all(e.map(e=>n.commerce.catalog.salesChannel(e)))))(0,n)}))(0,n),n}}},kn=[sn],vn=()=>[ln,...kn.map(e=>e.typeDefs)],gn=e=>pn[e.platform].getResolvers(e);__webpack_unused_export__=O,__webpack_unused_export__=P,exports.getContextFactory=e=>pn[e.platform].getContextFactory(e),exports.getResolvers=gn,__webpack_unused_export__=async e=>{const i=n.makeExecutableSchema({resolvers:gn(e),typeDefs:vn()});return kn.reduce((e,n)=>n.transformer(e),i)},__webpack_unused_export__=function(e,n){var i;const t={url:"dev"===(null==n?void 0:n.mode)?"opentelemetry-collector-beta.vtex.systems":"opentelemetry-collector.vtex.systems"},a=new c.BasicTracerProvider({resource:new m.Resource({"service.name":"faststore-api","service.version":"2.2.38","service.name_and_version":"faststore-api@2.2.38",platform:e.platform,[e.platform+".account"]:e.account,[e.platform+".environment"]:e.environment,locale:e.locale})}),r=new k.LoggerProvider,o=new p.OTLPTraceExporter(t),l=new v.OTLPLogsExporter({url:"opentelemetry-collector.vtex.systems"}),s=new c.SimpleSpanProcessor(o),u=new k.SimpleLogRecordProcessor(l);if(a.addSpanProcessor(s),r.addLogRecordProcessor(u),"verbose"===(null==n?void 0:n.mode)||"dev"===(null==n?void 0:n.mode)){const e=new c.ConsoleSpanExporter,n=new c.SimpleSpanProcessor(e),i=new k.ConsoleLogRecordExporter,t=new k.SimpleLogRecordProcessor(i);a.addSpanProcessor(n),r.addLogRecordProcessor(t)}return{useFaststoreTelemetry:((e,n,i,t)=>function(){const i=e.getTracer("faststore-api"),a=n.getLogger("faststore-api"),r={};return{onPluginInit({addPlugin:e}){e(y.useOnResolve(({info:e,context:n})=>{if(n&&"object"==typeof n&&n[cn]){var t,a;i.getActiveSpanProcessor();const l=n[cn].spanContext().spanId,{fieldName:d,returnType:s,parentType:u,path:c}=e,m=c.prev&&mn(c.prev);let p=null;var o;m&&r[l][m]?p=r[l][m]:(p=f.trace.setSpan(f.context.active(),n[cn]),r[l]=null!=(o=r[l])?o:{});const k=Number.isInteger(null==(t=c.prev)?void 0:t.key)?`[${null==(a=c.prev)?void 0:a.key}]`:"",v=i.startSpan(`${u.toString()}.${d}${k}`,{attributes:{[un.RESOLVER_FIELD_NAME]:d,[un.RESOLVER_TYPE_NAME]:u.toString(),[un.RESOLVER_RESULT_TYPE]:s.toString(),"meta.span.path":mn(c)}},p),g=f.trace.setSpan(p,v);return r[l][mn(c)]=g,({result:e})=>{e instanceof Error&&(v.setAttributes({error:!0,"exception.category":un.RESOLVER_EXECUTION_ERROR,"exception.message":e.message,"exception.type":e.name}),v.recordException(e)),v.end()}}return()=>{}}))},onExecute({args:e,extendContext:n}){var r,o;const l=null==(r=e.document.definitions.filter(e=>e.kind===d.Kind.OPERATION_DEFINITION).map(e=>e.operation))?void 0:r[0];let s="GraphQL Operation";l&&e.operationName?s=`${l} ${e.operationName}`:l&&!e.operationName&&(s=l);const u=i.startSpan(s,{kind:f.SpanKind.SERVER,attributes:{[un.EXECUTION_OPERATION_NAME]:null!=(o=e.operationName)?o:void 0,[un.EXECUTION_OPERATION_TYPE]:null!=l?l:void 0,[un.EXECUTION_OPERATION_DOCUMENT]:d.print(e.document)}}),c=f.context.active(),m={onExecuteDone({result:n}){var i,r;if(g.isAsyncIterable(n))return u.end(),void console.warn('Plugin "newrelic" encountered a AsyncIterator which is not supported yet, so tracing data is not available for the operation.');const o={context:c,attributes:{"service.name":"faststore-api","service.version":"1.12.38","service.name_and_version":"faststore-api@1.12.38","vtex.search_index":"faststore_beta_api",[un.EXECUTION_OPERATION_NAME]:null!=(i=e.operationName)?i:void 0,[un.EXECUTION_OPERATION_DOCUMENT]:d.print(e.document),[un.EXECUTION_VARIABLES]:JSON.stringify(null!=(r=e.variableValues)?r:{})}};void 0===n.data||n.errors&&n.errors.length>0||(o.severityNumber=N.SeverityNumber.INFO,o.severityText="Info",o.attributes[un.EXECUTION_RESULT]=JSON.stringify(n)),n.errors&&n.errors.length>0&&(o.severityNumber=N.SeverityNumber.ERROR,o.severityText="Error",o.attributes[un.EXECUTION_ERROR]=JSON.stringify(n.errors),u.setAttributes({error:!0,"exception.category":un.EXECUTION_ERROR,"exception.message":JSON.stringify(n.errors)})),t&&a.emit(o),u.end()}};return n({[cn]:u}),m}}})(a,r,0,null!=(i=null==n?void 0:n.experimentalSendLogs)&&i)}},__webpack_unused_export__=vn,__webpack_unused_export__=e=>{var n;return"BadRequestError"===(null==e||null==(n=e.extensions)?void 0:n.type)},exports.isFastStoreError=e=>"FastStoreError"===(null==e?void 0:e.name),exports.isNotFoundError=e=>{var n;return"NotFoundError"===(null==e||null==(n=e.extensions)?void 0:n.type)},__webpack_unused_export__=({scope:e="private",sMaxAge:n=0,staleWhileRevalidate:i=0})=>`${e}, s-maxage=${n}, stale-while-revalidate=${i}`;
11
- //# sourceMappingURL=api.cjs.production.min.js.map
12
1160
 
13
1161
 
1162
+
1163
+
1164
+ const isAttachment = (value) => value.valueReference === VALUE_REFERENCES.attachment;
1165
+ const getId = (item) => [
1166
+ item.itemOffered.sku,
1167
+ item.seller.identifier,
1168
+ item.price < 0.01 ? 'Gift' : undefined,
1169
+ item.itemOffered.additionalProperty
1170
+ ?.filter(isAttachment)
1171
+ .map(getPropertyId)
1172
+ .join('-'),
1173
+ ]
1174
+ .filter(Boolean)
1175
+ .join('::');
1176
+ const orderFormItemToOffer = (item, index) => ({
1177
+ listPrice: item.listPrice / 100,
1178
+ price: item.sellingPrice / 100,
1179
+ quantity: item.quantity,
1180
+ seller: { identifier: item.seller },
1181
+ itemOffered: {
1182
+ sku: item.id,
1183
+ image: [],
1184
+ name: item.name,
1185
+ additionalProperty: item.attachments.map(attachmentToPropertyValue),
1186
+ },
1187
+ index,
1188
+ });
1189
+ const offerToOrderItemInput = (offer) => ({
1190
+ quantity: offer.quantity,
1191
+ seller: offer.seller.identifier,
1192
+ id: offer.itemOffered.sku,
1193
+ index: offer.index,
1194
+ attachments: (offer.itemOffered.additionalProperty?.filter(isAttachment) ?? []).map((attachment) => ({
1195
+ name: attachment.name,
1196
+ content: attachment.value,
1197
+ })),
1198
+ });
1199
+ const groupById = (offers) => offers.reduce((acc, item) => {
1200
+ const id = getId(item);
1201
+ if (!acc.has(id)) {
1202
+ acc.set(id, []);
1203
+ }
1204
+ acc.get(id)?.push(item);
1205
+ return acc;
1206
+ }, new Map());
1207
+ const equals = (storeOrder, orderForm) => {
1208
+ const pick = (item, index) => ({
1209
+ ...item,
1210
+ itemOffered: {
1211
+ sku: item.itemOffered.sku,
1212
+ },
1213
+ index,
1214
+ });
1215
+ const orderFormItems = orderForm.items.map(orderFormItemToOffer).map(pick);
1216
+ const storeOrderItems = storeOrder.acceptedOffer.map(pick);
1217
+ const isSameOrder = storeOrder.orderNumber === orderForm.orderFormId;
1218
+ const orderItemsAreSync = external_fast_deep_equal_default()(orderFormItems, storeOrderItems);
1219
+ return isSameOrder && orderItemsAreSync;
1220
+ };
1221
+ const joinItems = (form) => {
1222
+ const itemsById = form.items.reduce((acc, item) => {
1223
+ const id = getId(orderFormItemToOffer(item));
1224
+ if (!acc[id]) {
1225
+ acc[id] = [];
1226
+ }
1227
+ acc[id].push(item);
1228
+ return acc;
1229
+ }, {});
1230
+ return {
1231
+ ...form,
1232
+ items: Object.values(itemsById).map((items) => {
1233
+ const [item] = items;
1234
+ const quantity = items.reduce((acc, i) => acc + i.quantity, 0);
1235
+ const totalPrice = items.reduce((acc, i) => acc +
1236
+ (i?.priceDefinition?.total ??
1237
+ (i?.quantity ?? 0) * (i?.sellingPrice ?? 0)), 0);
1238
+ return {
1239
+ ...item,
1240
+ quantity,
1241
+ sellingPrice: totalPrice / quantity,
1242
+ };
1243
+ }),
1244
+ };
1245
+ };
1246
+ const orderFormToCart = async (form, skuLoader) => {
1247
+ return {
1248
+ order: {
1249
+ orderNumber: form.orderFormId,
1250
+ acceptedOffer: form.items.map(async (item) => ({
1251
+ ...item,
1252
+ product: await skuLoader.load(item.id),
1253
+ })),
1254
+ },
1255
+ messages: form.messages.map(({ text, status }) => ({
1256
+ text,
1257
+ status: status.toUpperCase(),
1258
+ })),
1259
+ };
1260
+ };
1261
+ const getOrderFormEtag = ({ items }) => md5(JSON.stringify(items));
1262
+ const setOrderFormEtag = async (form, commerce) => {
1263
+ try {
1264
+ const orderForm = await commerce.checkout.setCustomData({
1265
+ id: form.orderFormId,
1266
+ appId: 'faststore',
1267
+ key: 'cartEtag',
1268
+ value: getOrderFormEtag(form),
1269
+ });
1270
+ return orderForm;
1271
+ }
1272
+ catch (err) {
1273
+ console.error('Error while setting custom data to orderForm.\n Make sure to add the following custom app to the orderForm: \n{"fields":["cartEtag"],"id":"faststore","major":1}.\n More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api');
1274
+ throw err;
1275
+ }
1276
+ };
1277
+ /**
1278
+ * Checks if cartEtag stored on customData is up to date
1279
+ * @description If cartEtag is not up to date, this means that
1280
+ * another system changed the cart, like Checkout UI or Order Placed
1281
+ */
1282
+ const isOrderFormStale = (form) => {
1283
+ const faststoreData = form.customData?.customApps.find((app) => app.id === 'faststore');
1284
+ const oldEtag = faststoreData?.fields?.cartEtag;
1285
+ if (oldEtag == null) {
1286
+ return true;
1287
+ }
1288
+ const newEtag = getOrderFormEtag(form);
1289
+ return newEtag !== oldEtag;
1290
+ };
1291
+ // Returns the regionalized orderForm
1292
+ const getOrderForm = async (id, { clients: { commerce } }) => {
1293
+ return commerce.checkout.orderForm({
1294
+ id,
1295
+ });
1296
+ };
1297
+ const clearOrderFormMessages = async (id, { clients: { commerce } }) => {
1298
+ return commerce.checkout.clearOrderFormMessages({
1299
+ id,
1300
+ });
1301
+ };
1302
+ const updateOrderFormShippingData = async (orderForm, session, { clients: { commerce } }) => {
1303
+ // Stores that are not yet providing the session while validating the cart
1304
+ // should not be able to update the shipping data
1305
+ //
1306
+ // This was causing errors while validating regionalizated carts
1307
+ // because the following code was trying to change the shippingData to an undefined address/session
1308
+ if (!session) {
1309
+ return orderForm;
1310
+ }
1311
+ const { updateShipping, addressChanged } = shouldUpdateShippingData(orderForm, session);
1312
+ if (updateShipping) {
1313
+ // Check if the orderForm address matches the one from the session
1314
+ const oldAddress = getAddressOrderForm(orderForm, session, addressChanged);
1315
+ const address = oldAddress ? oldAddress : createNewAddress(session);
1316
+ const selectedAddresses = address;
1317
+ const hasDeliveryWindow = session.deliveryMode?.deliveryWindow
1318
+ ? true
1319
+ : false;
1320
+ if (hasDeliveryWindow) {
1321
+ // if you have a Delivery Window you have to first get the delivery window to set the desired after
1322
+ await commerce.checkout.shippingData({
1323
+ id: orderForm.orderFormId,
1324
+ index: orderForm.items.length,
1325
+ deliveryMode: session.deliveryMode,
1326
+ selectedAddresses: selectedAddresses,
1327
+ }, false);
1328
+ }
1329
+ return commerce.checkout.shippingData({
1330
+ id: orderForm.orderFormId,
1331
+ index: orderForm.items.length,
1332
+ deliveryMode: session.deliveryMode,
1333
+ selectedAddresses: selectedAddresses,
1334
+ }, true);
1335
+ }
1336
+ return orderForm;
1337
+ };
1338
+ /**
1339
+ * This resolver implements the optimistic cart behavior. The main idea in here
1340
+ * is that we receive a cart from the UI (as query params) and we validate it with
1341
+ * the commerce platform. If the cart is valid, we return null, if the cart is
1342
+ * invalid according to the commerce platform, we return the new cart the UI should use
1343
+ * instead.
1344
+ *
1345
+ * The algorithm is something like:
1346
+ * 1. Fetch orderForm from VTEX
1347
+ * 2. Compute delta changes between the orderForm and the UI's cart
1348
+ * 3. Update the orderForm in VTEX platform accordingly
1349
+ * 4. If any changes were made, send to the UI the new cart. Null otherwise
1350
+ */
1351
+ const validateCart = async (_, { cart: { order }, session }, ctx) => {
1352
+ const { orderNumber, acceptedOffer, shouldSplitItem } = order;
1353
+ const { clients: { commerce }, loaders: { skuLoader }, } = ctx;
1354
+ const channel = session?.channel;
1355
+ const locale = session?.locale;
1356
+ if (channel) {
1357
+ mutateChannelContext(ctx, channel);
1358
+ }
1359
+ if (locale) {
1360
+ mutateLocaleContext(ctx, locale);
1361
+ }
1362
+ // Step1: Get OrderForm from VTEX Commerce
1363
+ const orderForm = await getOrderForm(orderNumber, ctx);
1364
+ // Clear messages so it doesn't keep populating toasts on a loop
1365
+ // In the next validateCart mutation it will only have messages if a new message is created on orderForm
1366
+ if (orderForm.messages.length !== 0) {
1367
+ await clearOrderFormMessages(orderNumber, ctx);
1368
+ }
1369
+ // Step1.5: Check if another system changed the orderForm with this orderNumber
1370
+ // If so, this means the user interacted with this cart elsewhere and expects
1371
+ // to see this new cart state instead of what's stored on the user's browser.
1372
+ const isStale = isOrderFormStale(orderForm);
1373
+ if (isStale && orderNumber) {
1374
+ const newOrderForm = await setOrderFormEtag(orderForm, commerce).then(joinItems);
1375
+ return orderFormToCart(newOrderForm, skuLoader);
1376
+ }
1377
+ // Step2: Process items from both browser and checkout so they have the same shape
1378
+ const browserItemsById = groupById(acceptedOffer);
1379
+ const originItemsById = groupById(orderForm.items.map(orderFormItemToOffer));
1380
+ const originItems = Array.from(originItemsById.entries()); // items on the VTEX platform backend
1381
+ const browserItems = Array.from(browserItemsById.entries()); // items on the user's browser
1382
+ // Step3: Compute delta changes
1383
+ const { itemsToAdd, itemsToUpdate } = browserItems.reduce((acc, [id, items]) => {
1384
+ const maybeOriginItem = originItemsById.get(id);
1385
+ // Adding new items to cart
1386
+ if (!maybeOriginItem) {
1387
+ items.forEach((item) => acc.itemsToAdd.push(item));
1388
+ return acc;
1389
+ }
1390
+ // Update existing items
1391
+ const [head, ...tail] = maybeOriginItem;
1392
+ const totalQuantity = items.reduce((acc, curr) => acc + curr.quantity, 0);
1393
+ // set total quantity to first item
1394
+ acc.itemsToUpdate.push({
1395
+ ...head,
1396
+ quantity: totalQuantity,
1397
+ });
1398
+ // Remove all the rest
1399
+ tail.forEach((item) => acc.itemsToUpdate.push({ ...item, quantity: 0 }));
1400
+ return acc;
1401
+ }, {
1402
+ itemsToAdd: [],
1403
+ itemsToUpdate: [],
1404
+ });
1405
+ const itemsToDelete = originItems
1406
+ .filter(([id]) => !browserItemsById.has(id))
1407
+ .flatMap(([, items]) => items.map((item) => ({ ...item, quantity: 0 })));
1408
+ const changes = [...itemsToAdd, ...itemsToUpdate, ...itemsToDelete].map(offerToOrderItemInput);
1409
+ if (changes.length === 0) {
1410
+ return null;
1411
+ }
1412
+ // Step4: Apply delta changes to order form
1413
+ const updatedOrderForm = await commerce.checkout
1414
+ // update orderForm items
1415
+ .updateOrderFormItems({
1416
+ id: orderForm.orderFormId,
1417
+ orderItems: changes,
1418
+ shouldSplitItem,
1419
+ })
1420
+ // update orderForm shippingData
1421
+ .then((form) => updateOrderFormShippingData(form, session, ctx))
1422
+ // update orderForm etag so we know last time we touched this orderForm
1423
+ .then((form) => setOrderFormEtag(form, commerce))
1424
+ .then(joinItems);
1425
+ const equalMessages = external_fast_deep_equal_default()(orderForm.messages, updatedOrderForm.messages);
1426
+ // Step5: If no changes detected before/after updating orderForm, the order is validated
1427
+ if (equals(order, updatedOrderForm) && equalMessages) {
1428
+ return null;
1429
+ }
1430
+ // Step6: There were changes, convert orderForm to StoreCart
1431
+ return orderFormToCart(updatedOrderForm, skuLoader);
1432
+ };
1433
+ //# sourceMappingURL=validateCart.js.map
1434
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/validateSession.js
1435
+
1436
+
1437
+ const validateSession = async (_, { session: oldSession, search }, { clients }) => {
1438
+ const channel = ChannelMarshal.parse(oldSession.channel ?? '');
1439
+ const postalCode = String(oldSession.postalCode ?? '').replace(/\D/g, '');
1440
+ const geoCoordinates = oldSession.geoCoordinates ?? null;
1441
+ const country = oldSession.country ?? '';
1442
+ const params = new URLSearchParams(search);
1443
+ const salesChannel = params.get('sc') ?? channel.salesChannel;
1444
+ params.set('sc', salesChannel);
1445
+ const [regionData, sessionData] = await Promise.all([
1446
+ postalCode || geoCoordinates
1447
+ ? clients.commerce.checkout.region({
1448
+ postalCode,
1449
+ geoCoordinates,
1450
+ country,
1451
+ salesChannel,
1452
+ })
1453
+ : Promise.resolve(null),
1454
+ clients.commerce.session(params.toString()).catch(() => null),
1455
+ ]);
1456
+ const profile = sessionData?.namespaces.profile ?? null;
1457
+ const store = sessionData?.namespaces.store ?? null;
1458
+ const region = regionData?.[0];
1459
+ // Set seller only if it's inside a region
1460
+ const seller = region?.sellers.find((seller) => channel.seller === seller.id);
1461
+ const newSession = {
1462
+ ...oldSession,
1463
+ currency: {
1464
+ code: store?.currencyCode.value ?? oldSession.currency.code,
1465
+ symbol: store?.currencySymbol.value ?? oldSession.currency.symbol,
1466
+ },
1467
+ country: store?.countryCode.value ?? oldSession.country,
1468
+ channel: ChannelMarshal.stringify({
1469
+ salesChannel: store?.channel?.value ?? channel.salesChannel,
1470
+ regionId: region?.id ?? channel.regionId,
1471
+ seller: seller?.id,
1472
+ }),
1473
+ person: profile?.id
1474
+ ? {
1475
+ id: profile.id?.value ?? '',
1476
+ email: profile.email?.value ?? '',
1477
+ givenName: profile.firstName?.value ?? '',
1478
+ familyName: profile.lastName?.value ?? '',
1479
+ }
1480
+ : null,
1481
+ };
1482
+ if (external_fast_deep_equal_default()(oldSession, newSession)) {
1483
+ return null;
1484
+ }
1485
+ return newSession;
1486
+ };
1487
+ //# sourceMappingURL=validateSession.js.map
1488
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/mutation.js
1489
+
1490
+
1491
+
1492
+ const Mutation = {
1493
+ validateCart: validateCart,
1494
+ validateSession: validateSession,
1495
+ subscribeToNewsletter: subscribeToNewsletter,
1496
+ };
1497
+ //# sourceMappingURL=mutation.js.map
1498
+ // EXTERNAL MODULE: external "graphql"
1499
+ var external_graphql_ = __webpack_require__(7343);
1500
+ // EXTERNAL MODULE: external "graphql/language"
1501
+ var language_ = __webpack_require__(6548);
1502
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/objectOrString.js
1503
+
1504
+
1505
+ const ObjectOrString = new external_graphql_.GraphQLScalarType({
1506
+ name: 'ObjectOrString',
1507
+ description: 'A string or the string representation of an object (a stringified object).',
1508
+ parseValue: toObjectOrString,
1509
+ serialize: stringify,
1510
+ parseLiteral(ast) {
1511
+ if (ast.kind === language_.Kind.STRING) {
1512
+ return getValueAsObjectOrString(ast.value);
1513
+ }
1514
+ return null;
1515
+ },
1516
+ });
1517
+ function toObjectOrString(value) {
1518
+ if (typeof value === 'string') {
1519
+ return getValueAsObjectOrString(value);
1520
+ }
1521
+ return null;
1522
+ }
1523
+ function getValueAsObjectOrString(value) {
1524
+ try {
1525
+ return JSON.parse(value);
1526
+ }
1527
+ catch (e) {
1528
+ return value;
1529
+ }
1530
+ }
1531
+ function stringify(value) {
1532
+ if (typeof value === 'object') {
1533
+ return JSON.stringify(value);
1534
+ }
1535
+ if (typeof value === 'string') {
1536
+ return value;
1537
+ }
1538
+ return null;
1539
+ }
1540
+ //# sourceMappingURL=objectOrString.js.map
1541
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/offer.js
1542
+
1543
+ const isSearchItem = (item) => 'Price' in item && 'seller' in item && 'product' in item;
1544
+ const isOrderFormItem = (item) => 'skuName' in item;
1545
+ const StoreOffer = {
1546
+ priceCurrency: async (_, __, ctx) => {
1547
+ const { loaders: { salesChannelLoader }, storage: { channel } } = ctx;
1548
+ const sc = await salesChannelLoader.load(channel.salesChannel);
1549
+ return sc.CurrencyCode ?? '';
1550
+ },
1551
+ priceValidUntil: (root) => {
1552
+ if (isSearchItem(root)) {
1553
+ return root.PriceValidUntil ?? '';
1554
+ }
1555
+ if (isOrderFormItem(root)) {
1556
+ return root.priceValidUntil ?? '';
1557
+ }
1558
+ return null;
1559
+ },
1560
+ itemCondition: () => 'https://schema.org/NewCondition',
1561
+ availability: async (root) => {
1562
+ if (isSearchItem(root)) {
1563
+ return availability(inStock(root));
1564
+ }
1565
+ if (isOrderFormItem(root)) {
1566
+ return availability(inStockOrderFormItem(root.availability));
1567
+ }
1568
+ return null;
1569
+ },
1570
+ seller: (root, _, ctx) => {
1571
+ if (isSearchItem(root)) {
1572
+ return {
1573
+ identifier: ctx.storage.channel?.seller || root.seller.sellerId || '',
1574
+ };
1575
+ }
1576
+ if (isOrderFormItem(root)) {
1577
+ return {
1578
+ identifier: root.seller,
1579
+ };
1580
+ }
1581
+ return null;
1582
+ },
1583
+ price: (root) => {
1584
+ if (isSearchItem(root)) {
1585
+ return price(root);
1586
+ }
1587
+ if (isOrderFormItem(root)) {
1588
+ return root.sellingPrice / 1e2;
1589
+ }
1590
+ return null;
1591
+ },
1592
+ sellingPrice: (root) => {
1593
+ if (isSearchItem(root)) {
1594
+ return sellingPrice(root);
1595
+ }
1596
+ if (isOrderFormItem(root)) {
1597
+ return root.sellingPrice / 1e2;
1598
+ }
1599
+ return null;
1600
+ },
1601
+ listPrice: (root) => {
1602
+ if (isSearchItem(root)) {
1603
+ return root.ListPrice ?? 0;
1604
+ }
1605
+ if (isOrderFormItem(root)) {
1606
+ return root.listPrice / 1e2;
1607
+ }
1608
+ return null;
1609
+ },
1610
+ itemOffered: (root) => {
1611
+ if (isSearchItem(root)) {
1612
+ return root.product;
1613
+ }
1614
+ if (isOrderFormItem(root)) {
1615
+ return {
1616
+ ...root.product,
1617
+ attachmentsValues: root.attachments,
1618
+ };
1619
+ }
1620
+ return null;
1621
+ },
1622
+ quantity: (root) => {
1623
+ if (isSearchItem(root)) {
1624
+ return root.AvailableQuantity ?? 0;
1625
+ }
1626
+ if (isOrderFormItem(root)) {
1627
+ return root.quantity;
1628
+ }
1629
+ return null;
1630
+ },
1631
+ };
1632
+ //# sourceMappingURL=offer.js.map
1633
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/canonical.js
1634
+ const canonicalFromProduct = ({ linkText }) => `/${linkText}/p`;
1635
+ //# sourceMappingURL=canonical.js.map
1636
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/enhanceCommercialOffer.js
1637
+ const enhanceCommercialOffer = ({ offer, seller, product, }) => ({
1638
+ ...offer,
1639
+ product,
1640
+ seller,
1641
+ });
1642
+ //# sourceMappingURL=enhanceCommercialOffer.js.map
1643
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/product.js
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+ const DEFAULT_IMAGE = {
1650
+ imageText: 'image',
1651
+ imageUrl: 'https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg',
1652
+ };
1653
+ const getSlug = (link, id) => `${link}-${id}`;
1654
+ const getPath = (link, id) => `/${getSlug(link, id)}/p`;
1655
+ const nonEmptyArray = (array) => Array.isArray(array) && array.length > 0 ? array : null;
1656
+ const StoreProduct = {
1657
+ productID: ({ itemId }) => itemId,
1658
+ name: ({ isVariantOf, name }) => name ?? isVariantOf.productName,
1659
+ slug: ({ isVariantOf: { linkText }, itemId }) => getSlug(linkText, itemId),
1660
+ description: ({ isVariantOf: { description } }) => description,
1661
+ seo: ({ isVariantOf }) => ({
1662
+ title: isVariantOf.productName,
1663
+ description: isVariantOf.description,
1664
+ canonical: canonicalFromProduct(isVariantOf),
1665
+ }),
1666
+ brand: ({ isVariantOf: { brand } }) => ({ name: brand }),
1667
+ breadcrumbList: ({ isVariantOf: { categories, productName, linkText }, itemId, }) => {
1668
+ return {
1669
+ itemListElement: [
1670
+ ...categories.reverse().map((categoryPath, index) => {
1671
+ const splitted = categoryPath.split('/');
1672
+ const name = splitted[splitted.length - 2];
1673
+ const item = splitted.map(slugify).join('/');
1674
+ return {
1675
+ name,
1676
+ item,
1677
+ position: index + 1,
1678
+ };
1679
+ }),
1680
+ {
1681
+ name: productName,
1682
+ item: getPath(linkText, itemId),
1683
+ position: categories.length + 1,
1684
+ },
1685
+ ],
1686
+ numberOfItems: categories.length,
1687
+ };
1688
+ },
1689
+ image: ({ images }) => (nonEmptyArray(images) ?? [DEFAULT_IMAGE]).map(({ imageUrl, imageText }) => ({
1690
+ alternateName: imageText ?? '',
1691
+ url: imageUrl.replace('vteximg.com.br', 'vtexassets.com'),
1692
+ })),
1693
+ sku: ({ itemId }) => itemId,
1694
+ gtin: ({ referenceId }) => referenceId[0]?.Value ?? '',
1695
+ review: () => [],
1696
+ aggregateRating: () => ({}),
1697
+ offers: (root) => root.sellers
1698
+ .map((seller) => enhanceCommercialOffer({
1699
+ offer: seller.commertialOffer,
1700
+ seller,
1701
+ product: root,
1702
+ }))
1703
+ .sort(bestOfferFirst),
1704
+ isVariantOf: (root) => root,
1705
+ additionalProperty: ({
1706
+ // Search uses the name variations for specifications
1707
+ variations: specifications = [], attachmentsValues = [], }) => {
1708
+ const propertyValueSpecifications = specifications.flatMap(({ name, values }) => values.map((value) => ({
1709
+ name,
1710
+ value,
1711
+ valueReference: VALUE_REFERENCES.specification,
1712
+ })));
1713
+ const propertyValueAttachments = attachmentsValues.map(attachmentToPropertyValue);
1714
+ return [...propertyValueSpecifications, ...propertyValueAttachments];
1715
+ },
1716
+ releaseDate: ({ isVariantOf: { releaseDate } }) => releaseDate ?? ''
1717
+ };
1718
+ //# sourceMappingURL=product.js.map
1719
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/productGroup.js
1720
+
1721
+
1722
+ const BLOCKED_SPECIFICATIONS = new Set(['allSpecifications']);
1723
+ const StoreProductGroup = {
1724
+ hasVariant: (root) => root.isVariantOf.items.map((item) => enhanceSku(item, root.isVariantOf)),
1725
+ productGroupID: ({ isVariantOf }) => isVariantOf.productId,
1726
+ name: (root) => root.isVariantOf.productName,
1727
+ skuVariants: (root) => root,
1728
+ additionalProperty: ({ isVariantOf: { specificationGroups } }) => specificationGroups
1729
+ // Filter sku specifications so we don't mix them with product specs.
1730
+ .filter((specificationGroup) => !BLOCKED_SPECIFICATIONS.has(specificationGroup.name))
1731
+ // Transform specs back into product specs.
1732
+ .flatMap(({ specifications }) => specifications.flatMap(({ name, values }) => values.map((value) => ({
1733
+ name,
1734
+ value,
1735
+ valueReference: VALUE_REFERENCES.specification,
1736
+ })))),
1737
+ };
1738
+ //# sourceMappingURL=productGroup.js.map
1739
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/propertyValue.js
1740
+
1741
+ const StorePropertyValue = {
1742
+ propertyID: (root) => getPropertyId(root),
1743
+ name: ({ name }) => name,
1744
+ value: ({ value }) => value,
1745
+ valueReference: ({ valueReference }) => valueReference,
1746
+ };
1747
+ //# sourceMappingURL=propertyValue.js.map
1748
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/sort.js
1749
+ const SORT_MAP = {
1750
+ price_desc: 'price:desc',
1751
+ price_asc: 'price:asc',
1752
+ orders_desc: 'orders:desc',
1753
+ name_desc: 'name:desc',
1754
+ name_asc: 'name:asc',
1755
+ release_desc: 'release:desc',
1756
+ discount_desc: 'discount:desc',
1757
+ score_desc: '',
1758
+ };
1759
+ //# sourceMappingURL=sort.js.map
1760
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/sku.js
1761
+
1762
+
1763
+ /**
1764
+ * This function implements Portal heuristics for returning the best sku for a product.
1765
+ *
1766
+ * The best sku is the one with the best (cheapest available) offer
1767
+ * */
1768
+ const pickBestSku = (skus) => {
1769
+ const offersBySku = skus.flatMap((sku) => sku.sellers.map((seller) => ({
1770
+ offer: seller.commertialOffer,
1771
+ sku,
1772
+ })));
1773
+ const best = min(offersBySku, ({ offer: o1 }, { offer: o2 }) => bestOfferFirst(o1, o2));
1774
+ return best ? best.sku : skus[0];
1775
+ };
1776
+ const isValidSkuId = (skuId) => skuId !== '' && !Number.isNaN(Number(skuId));
1777
+ //# sourceMappingURL=sku.js.map
1778
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/query.js
1779
+
1780
+
1781
+
1782
+
1783
+
1784
+
1785
+
1786
+
1787
+ const Query = {
1788
+ product: async (_, { locator }, ctx) => {
1789
+ // Insert channel in context for later usage
1790
+ const channel = findChannel(locator);
1791
+ const locale = findLocale(locator);
1792
+ const id = findSkuId(locator);
1793
+ const slug = findSlug(locator);
1794
+ if (channel) {
1795
+ mutateChannelContext(ctx, channel);
1796
+ }
1797
+ if (locale) {
1798
+ mutateLocaleContext(ctx, locale);
1799
+ }
1800
+ const { loaders: { skuLoader }, clients: { commerce, search }, } = ctx;
1801
+ try {
1802
+ const skuId = id ?? slug?.split('-').pop() ?? '';
1803
+ if (!isValidSkuId(skuId)) {
1804
+ throw new Error('Invalid SkuId');
1805
+ }
1806
+ const sku = await skuLoader.load(skuId);
1807
+ /**
1808
+ * Here be dragons 🦄🦄🦄
1809
+ *
1810
+ * In some cases, the slug has a valid skuId for a different
1811
+ * product. This condition makes sure that the fetched sku
1812
+ * is the one we actually asked for
1813
+ * */
1814
+ if (slug &&
1815
+ sku.isVariantOf.linkText &&
1816
+ !slug.startsWith(sku.isVariantOf.linkText)) {
1817
+ throw new Error(`Slug was set but the fetched sku does not satisfy the slug condition. slug: ${slug}, linkText: ${sku.isVariantOf.linkText}`);
1818
+ }
1819
+ return sku;
1820
+ }
1821
+ catch (err) {
1822
+ if (slug == null) {
1823
+ throw new errors/* BadRequestError */.oY('Missing slug or id');
1824
+ }
1825
+ const route = await commerce.catalog.portal.pagetype(`${slug}/p`);
1826
+ if (route.pageType !== 'Product' || !route.id) {
1827
+ throw new errors/* NotFoundError */.dR(`No product found for slug ${slug}`);
1828
+ }
1829
+ const { products: [product], } = await search.products({
1830
+ page: 0,
1831
+ count: 1,
1832
+ query: `product:${route.id}`,
1833
+ });
1834
+ if (!product) {
1835
+ throw new errors/* NotFoundError */.dR(`No product found for id ${route.id}`);
1836
+ }
1837
+ const sku = pickBestSku(product.items);
1838
+ return enhanceSku(sku, product);
1839
+ }
1840
+ },
1841
+ collection: (_, { slug }, ctx) => {
1842
+ const { loaders: { collectionLoader }, } = ctx;
1843
+ return collectionLoader.load(slug);
1844
+ },
1845
+ search: async (_, { first, after: maybeAfter, sort, term, selectedFacets }, ctx) => {
1846
+ // Insert channel in context for later usage
1847
+ const channel = findChannel(selectedFacets);
1848
+ const locale = findLocale(selectedFacets);
1849
+ const crossSelling = findCrossSelling(selectedFacets);
1850
+ if (channel) {
1851
+ mutateChannelContext(ctx, channel);
1852
+ }
1853
+ if (locale) {
1854
+ mutateLocaleContext(ctx, locale);
1855
+ }
1856
+ let query = term;
1857
+ /**
1858
+ * In case we are using crossSelling, we need to modify the search
1859
+ * we will be performing on our search engine. The idea in here
1860
+ * is to use the cross selling API for fetching the productIds our
1861
+ * search will return for us.
1862
+ * Doing this two request workflow makes it possible to have cross
1863
+ * selling with Search features, like pagination, internationalization
1864
+ * etc
1865
+ */
1866
+ if (crossSelling) {
1867
+ const products = await ctx.clients.commerce.catalog.products.crossselling({
1868
+ type: FACET_CROSS_SELLING_MAP[crossSelling.key],
1869
+ productId: crossSelling.value,
1870
+ });
1871
+ query = `product:${products
1872
+ .map((x) => x.productId)
1873
+ .slice(0, first)
1874
+ .join(';')}`;
1875
+ }
1876
+ const after = maybeAfter ? Number(maybeAfter) : 0;
1877
+ const searchArgs = {
1878
+ page: Math.ceil(after / first),
1879
+ count: first,
1880
+ query: query ?? undefined,
1881
+ sort: SORT_MAP[sort ?? 'score_desc'],
1882
+ selectedFacets: selectedFacets?.flatMap(transformSelectedFacet) ?? [],
1883
+ };
1884
+ const productSearchPromise = ctx.clients.search.products(searchArgs);
1885
+ return { searchArgs, productSearchPromise };
1886
+ },
1887
+ allProducts: async (_, { first, after: maybeAfter }, ctx) => {
1888
+ const { clients: { search }, } = ctx;
1889
+ const after = maybeAfter ? Number(maybeAfter) : 0;
1890
+ const products = await search.products({
1891
+ page: Math.ceil(after / first),
1892
+ count: first,
1893
+ });
1894
+ const skus = products.products
1895
+ .map((product) => product.items.map((sku) => enhanceSku(sku, product)))
1896
+ .flat()
1897
+ .filter((sku) => sku.sellers.length > 0);
1898
+ return {
1899
+ pageInfo: {
1900
+ hasNextPage: products.pagination.after.length > 0,
1901
+ hasPreviousPage: products.pagination.before.length > 0,
1902
+ startCursor: '0',
1903
+ endCursor: products.recordsFiltered.toString(),
1904
+ totalCount: products.recordsFiltered,
1905
+ },
1906
+ // after + index is bigger than after+first itself because of the array flat() above
1907
+ edges: skus.map((sku, index) => ({
1908
+ node: sku,
1909
+ cursor: (after + index).toString(),
1910
+ })),
1911
+ };
1912
+ },
1913
+ allCollections: async (_, { first, after: maybeAfter }, ctx) => {
1914
+ const { clients: { commerce }, } = ctx;
1915
+ const after = maybeAfter ? Number(maybeAfter) : 0;
1916
+ const [brands, tree] = await Promise.all([
1917
+ commerce.catalog.brand.list(),
1918
+ commerce.catalog.category.tree(),
1919
+ ]);
1920
+ const categories = [];
1921
+ const dfs = (node, level) => {
1922
+ categories.push({ ...node, level });
1923
+ for (const child of node.children) {
1924
+ dfs(child, level + 1);
1925
+ }
1926
+ };
1927
+ for (const node of tree) {
1928
+ dfs(node, 0);
1929
+ }
1930
+ const collections = [
1931
+ ...brands
1932
+ .filter((brand) => brand.isActive)
1933
+ .map((x) => ({ ...x, type: 'brand' })),
1934
+ ...categories,
1935
+ ];
1936
+ const validCollections = collections
1937
+ // Nullable slugs may cause one route to override the other
1938
+ .filter((node) => Boolean(StoreCollection.slug(node, null, ctx, null)));
1939
+ return {
1940
+ pageInfo: {
1941
+ hasNextPage: validCollections.length - after > first,
1942
+ hasPreviousPage: after > 0,
1943
+ startCursor: '0',
1944
+ endCursor: (Math.min(first, validCollections.length - after) - 1).toString(),
1945
+ totalCount: validCollections.length,
1946
+ },
1947
+ edges: validCollections
1948
+ .slice(after, after + first)
1949
+ .map((node, index) => ({
1950
+ node,
1951
+ cursor: (after + index).toString(),
1952
+ })),
1953
+ };
1954
+ },
1955
+ shipping: async (_, { country, items, postalCode }, ctx) => {
1956
+ const { loaders: { simulationLoader }, clients: { commerce }, } = ctx;
1957
+ const [simulation, address] = await Promise.all([
1958
+ simulationLoader.load({ country, items, postalCode }),
1959
+ commerce.checkout.address({ postalCode, country }),
1960
+ ]);
1961
+ return {
1962
+ ...simulation,
1963
+ address,
1964
+ };
1965
+ },
1966
+ redirect: async (_, { term, selectedFacets }, ctx) => {
1967
+ // Currently the search redirection can be done through a search term or filter (facet) so we limit the redirect query to always have one of these values otherwise we do not execute it.
1968
+ // https://help.vtex.com/en/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/4Gd2wLQFbCwTsh8RUDwSoL?&utm_source=autocomplete
1969
+ if (!term && (!selectedFacets || !selectedFacets.length)) {
1970
+ return null;
1971
+ }
1972
+ const { redirect } = await ctx.clients.search.products({
1973
+ page: 1,
1974
+ count: 1,
1975
+ query: term ?? undefined,
1976
+ selectedFacets: selectedFacets?.flatMap(transformSelectedFacet) ?? [],
1977
+ });
1978
+ return {
1979
+ url: redirect,
1980
+ };
1981
+ },
1982
+ sellers: async (_, { postalCode, geoCoordinates, country, salesChannel }, ctx) => {
1983
+ const { clients: { commerce }, } = ctx;
1984
+ const regionData = await commerce.checkout.region({
1985
+ postalCode,
1986
+ geoCoordinates,
1987
+ country,
1988
+ salesChannel,
1989
+ });
1990
+ const region = regionData?.[0];
1991
+ const { id, sellers } = region;
1992
+ return {
1993
+ id,
1994
+ sellers,
1995
+ };
1996
+ },
1997
+ };
1998
+ //# sourceMappingURL=query.js.map
1999
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/review.js
2000
+ const StoreReview = {
2001
+ reviewRating: () => ({
2002
+ ratingValue: 5,
2003
+ bestRating: 5,
2004
+ }),
2005
+ author: () => ({
2006
+ name: '',
2007
+ }),
2008
+ };
2009
+ //# sourceMappingURL=review.js.map
2010
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/searchResult.js
2011
+
2012
+
2013
+ const isRootFacet = (facet, isDepartment, isBrand) => isDepartment
2014
+ ? facet.key === 'category-1'
2015
+ : isBrand
2016
+ ? facet.key === 'brand'
2017
+ : false;
2018
+ const StoreSearchResult = {
2019
+ suggestions: async (root, _, ctx) => {
2020
+ const { clients: { search }, } = ctx;
2021
+ const { searchArgs } = root;
2022
+ // If there's no search query, suggest the most popular searches.
2023
+ if (!searchArgs.query) {
2024
+ const topSearches = await search.topSearches();
2025
+ return {
2026
+ terms: topSearches.searches.map((item) => ({
2027
+ value: item.term,
2028
+ count: item.count,
2029
+ })),
2030
+ products: [],
2031
+ };
2032
+ }
2033
+ const { productSearchPromise } = root;
2034
+ const [terms, productSearchResult] = await Promise.all([
2035
+ search.suggestedTerms(searchArgs),
2036
+ productSearchPromise,
2037
+ ]);
2038
+ const skus = productSearchResult.products
2039
+ .map((product) => {
2040
+ // What determines the presentation of the SKU is the price order
2041
+ // https://help.vtex.com/pt/tutorial/ordenando-imagens-na-vitrine-e-na-pagina-de-produto--tutorials_278
2042
+ const maybeSku = pickBestSku(product.items);
2043
+ return maybeSku && enhanceSku(maybeSku, product);
2044
+ })
2045
+ .filter((sku) => !!sku);
2046
+ const { searches } = terms;
2047
+ return {
2048
+ terms: searches.map((item) => ({ value: item.term, count: item.count })),
2049
+ products: skus,
2050
+ };
2051
+ },
2052
+ products: async ({ productSearchPromise }) => {
2053
+ const productSearchResult = await productSearchPromise;
2054
+ const skus = productSearchResult.products
2055
+ .map((product) => {
2056
+ // What determines the presentation of the SKU is the price order
2057
+ // https://help.vtex.com/pt/tutorial/ordenando-imagens-na-vitrine-e-na-pagina-de-produto--tutorials_278
2058
+ const maybeSku = pickBestSku(product.items);
2059
+ return maybeSku && enhanceSku(maybeSku, product);
2060
+ })
2061
+ .filter((sku) => !!sku);
2062
+ return {
2063
+ pageInfo: {
2064
+ hasNextPage: productSearchResult.pagination.after.length > 0,
2065
+ hasPreviousPage: productSearchResult.pagination.before.length > 0,
2066
+ startCursor: '0',
2067
+ endCursor: productSearchResult.recordsFiltered.toString(),
2068
+ totalCount: productSearchResult.recordsFiltered,
2069
+ },
2070
+ edges: skus.map((sku, index) => ({
2071
+ node: sku,
2072
+ cursor: index.toString(),
2073
+ })),
2074
+ };
2075
+ },
2076
+ facets: async ({ searchArgs }, _, ctx) => {
2077
+ const { clients: { search: is }, } = ctx;
2078
+ ctx.storage.searchArgs = searchArgs;
2079
+ const { facets = [] } = await is.facets(searchArgs);
2080
+ const isCollectionPage = !searchArgs.query;
2081
+ const isDepartment = searchArgs.selectedFacets?.length
2082
+ ? searchArgs.selectedFacets[0].key === 'category-1'
2083
+ : false;
2084
+ const isBrand = searchArgs.selectedFacets?.length
2085
+ ? searchArgs.selectedFacets[0].key === 'brand'
2086
+ : false;
2087
+ const filteredFacets = facets
2088
+ // Remove root facet on category and brand pages
2089
+ // TODO: Hide category filters for category pages. E.g. /office/desks
2090
+ .filter((facet) => !isCollectionPage || !isRootFacet(facet, isDepartment, isBrand));
2091
+ return filteredFacets;
2092
+ },
2093
+ metadata: async ({ searchArgs, productSearchPromise }) => {
2094
+ if (!searchArgs.query) {
2095
+ return null;
2096
+ }
2097
+ const productSearchResult = await productSearchPromise;
2098
+ return {
2099
+ isTermMisspelled: productSearchResult.correction?.misspelled ?? false,
2100
+ logicalOperator: productSearchResult.operator,
2101
+ };
2102
+ },
2103
+ };
2104
+ //# sourceMappingURL=searchResult.js.map
2105
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/seo.js
2106
+ const StoreSeo = {
2107
+ title: ({ title }) => title ?? '',
2108
+ description: ({ description }) => description ?? '',
2109
+ canonical: ({ canonical }) => canonical ?? '',
2110
+ titleTemplate: () => '',
2111
+ };
2112
+ //# sourceMappingURL=seo.js.map
2113
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/shippingSLA.js
2114
+ const units = ['bd', 'd', 'h', 'm'];
2115
+ const isUnit = (x) => units.includes(x);
2116
+ const localizedEstimates = {
2117
+ bd: {
2118
+ 0: 'Today',
2119
+ 1: 'In 1 business day',
2120
+ other: `Up to # business days`,
2121
+ },
2122
+ d: {
2123
+ 0: 'Today',
2124
+ 1: 'In 1 day',
2125
+ other: 'Up to # days',
2126
+ },
2127
+ h: {
2128
+ 0: 'Now',
2129
+ 1: 'In 1 hour',
2130
+ other: 'Up to # hours',
2131
+ },
2132
+ m: {
2133
+ 0: 'Now',
2134
+ 1: 'In 1 minute',
2135
+ other: 'Up to # minutes',
2136
+ },
2137
+ };
2138
+ /**
2139
+ * Transforms estimate (e.g 3bd) into friendly format (e.g Up to 3 business days)
2140
+ * based on https://github.com/vtex-apps/shipping-estimate-translator/blob/13e17055d6353dd3f3f4c31bae77ab049002809b/messages/en.json
2141
+ */
2142
+ const getLocalizedEstimates = (estimate) => {
2143
+ const [amount, unit] = [estimate.split(/\D+/)[0], estimate.split(/[0-9]+/)[1]];
2144
+ const isAmountNumber = amount !== '' && !Number.isNaN(Number(amount));
2145
+ const isUnitValid = isUnit(unit);
2146
+ if (!isAmountNumber || !isUnitValid) {
2147
+ return '';
2148
+ }
2149
+ const amountKey = Number(amount) < 2 ? Number(amount) : 'other';
2150
+ return localizedEstimates[unit][amountKey].replace('#', amount) ?? '';
2151
+ };
2152
+ const ShippingSLA = {
2153
+ carrier: (root) => root?.friendlyName ?? root?.name ?? '',
2154
+ price: (root) => (root?.price ? root.price / 100 : root?.price),
2155
+ localizedEstimates: (root) => root?.shippingEstimate ? getLocalizedEstimates(root.shippingEstimate) : '',
2156
+ };
2157
+ //# sourceMappingURL=shippingSLA.js.map
2158
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/utils/skuVariants.js
2159
+ function findSkuVariantImage(availableImages) {
2160
+ return (availableImages.find((imageProperties) => imageProperties.imageLabel === 'skuvariation') ?? availableImages[0]);
2161
+ }
2162
+ function createSlugsMap(variants, dominantVariantName, baseSlug) {
2163
+ /**
2164
+ * Maps property value combinations to their respective SKU's slug. Enables
2165
+ * us to retrieve the slug for the SKU that matches the currently selected
2166
+ * variations in O(1) time.
2167
+ *
2168
+ * Example: `'Color-Red-Size-40': 'classic-shoes-37'`
2169
+ */
2170
+ const slugsMap = {};
2171
+ variants.forEach((variant) => {
2172
+ const skuSpecificationProperties = variant.variations;
2173
+ if (skuSpecificationProperties.length === 0) {
2174
+ return;
2175
+ }
2176
+ // Make sure that the 'name-value' pair for the dominant variation
2177
+ // is always the first one.
2178
+ const dominantNameValue = `${dominantVariantName}-${skuSpecificationProperties.find((variationDetails) => variationDetails.name === dominantVariantName)?.values[0] ?? ''}`;
2179
+ const skuVariantKey = skuSpecificationProperties.reduce((acc, property) => {
2180
+ const shouldIgnore = property.name === dominantVariantName;
2181
+ if (shouldIgnore) {
2182
+ return acc;
2183
+ }
2184
+ return acc + `-${property.name}-${property.values[0]}`;
2185
+ }, dominantNameValue);
2186
+ slugsMap[skuVariantKey] = `${baseSlug}-${variant.itemId}`;
2187
+ });
2188
+ return slugsMap;
2189
+ }
2190
+ function getActiveSkuVariations(variations) {
2191
+ const activeVariations = {};
2192
+ variations.forEach((variation) => {
2193
+ activeVariations[variation.name] = variation.values[0];
2194
+ });
2195
+ return activeVariations;
2196
+ }
2197
+ function getVariantsByName(skuSpecifications) {
2198
+ const variants = {};
2199
+ skuSpecifications?.forEach((specification) => {
2200
+ variants[specification.field.originalName ?? specification.field.name] =
2201
+ specification.values.map((value) => value.originalName ?? value.name);
2202
+ });
2203
+ return variants;
2204
+ }
2205
+ function compare(a, b) {
2206
+ // Values are always represented as Strings, so we need to handle numbers
2207
+ // in this special case.
2208
+ if (!Number.isNaN(Number(a) - Number(b))) {
2209
+ return Number(a) - Number(b);
2210
+ }
2211
+ if (a < b) {
2212
+ return -1;
2213
+ }
2214
+ if (a > b) {
2215
+ return 1;
2216
+ }
2217
+ return 0;
2218
+ }
2219
+ function sortVariants(variantsByName) {
2220
+ const sortedVariants = variantsByName;
2221
+ for (const variantProperty in variantsByName) {
2222
+ variantsByName[variantProperty].sort((a, b) => compare(a.value, b.value));
2223
+ }
2224
+ return sortedVariants;
2225
+ }
2226
+ function getFormattedVariations(variants, dominantVariantName, dominantVariantValue) {
2227
+ /**
2228
+ * SKU options already formatted and indexed by their property name.
2229
+ *
2230
+ * Ex: {
2231
+ * `Size`: [
2232
+ * { label: '42', value: '42' },
2233
+ * { label: '41', value: '41' },
2234
+ * { label: '39', value: '39' },
2235
+ * ]
2236
+ * }
2237
+ */
2238
+ const variantsByName = {};
2239
+ const previouslySeenPropertyValues = new Set();
2240
+ variants.forEach((variant) => {
2241
+ if (variant.variations.length === 0) {
2242
+ return;
2243
+ }
2244
+ const variantImageToUse = findSkuVariantImage(variant.images);
2245
+ const dominantVariantEntry = variant.variations.find((variation) => variation.name === dominantVariantName);
2246
+ const matchesDominantVariant = dominantVariantEntry?.values[0] === dominantVariantValue;
2247
+ if (!matchesDominantVariant) {
2248
+ const nameValueIdentifier = `${dominantVariantName}-${dominantVariantEntry?.values[0]}`;
2249
+ if (!dominantVariantEntry ||
2250
+ previouslySeenPropertyValues.has(nameValueIdentifier)) {
2251
+ return;
2252
+ }
2253
+ previouslySeenPropertyValues.add(nameValueIdentifier);
2254
+ const formattedVariant = {
2255
+ src: variantImageToUse.imageUrl,
2256
+ alt: variantImageToUse.imageLabel ?? '',
2257
+ label: `${dominantVariantName}: ${dominantVariantEntry.values[0]}`,
2258
+ value: dominantVariantEntry.values[0],
2259
+ };
2260
+ if (variantsByName[dominantVariantEntry.name]) {
2261
+ variantsByName[dominantVariantEntry.name].push(formattedVariant);
2262
+ }
2263
+ else {
2264
+ variantsByName[dominantVariantEntry.name] = [formattedVariant];
2265
+ }
2266
+ return;
2267
+ }
2268
+ variant.variations.forEach((variationProperty) => {
2269
+ const nameValueIdentifier = `${variationProperty.name}-${variationProperty.values[0]}`;
2270
+ if (previouslySeenPropertyValues.has(nameValueIdentifier)) {
2271
+ return;
2272
+ }
2273
+ previouslySeenPropertyValues.add(nameValueIdentifier);
2274
+ const formattedVariant = {
2275
+ src: variantImageToUse.imageUrl,
2276
+ alt: variantImageToUse.imageLabel ?? '',
2277
+ label: `${variationProperty.name}: ${variationProperty.values[0]}`,
2278
+ value: variationProperty.values[0],
2279
+ };
2280
+ if (variantsByName[variationProperty.name]) {
2281
+ variantsByName[variationProperty.name].push(formattedVariant);
2282
+ }
2283
+ else {
2284
+ variantsByName[variationProperty.name] = [formattedVariant];
2285
+ }
2286
+ });
2287
+ });
2288
+ return sortVariants(variantsByName);
2289
+ }
2290
+ //# sourceMappingURL=skuVariants.js.map
2291
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/resolvers/skuVariations.js
2292
+
2293
+ const SkuVariants = {
2294
+ activeVariations: (root) => getActiveSkuVariations(root.variations),
2295
+ allVariantsByName: (root) => getVariantsByName(root.isVariantOf.skuSpecifications),
2296
+ slugsMap: (root, args) => createSlugsMap(root.isVariantOf.items, args.dominantVariantName ?? root.variations[0]?.name, root.isVariantOf.linkText),
2297
+ availableVariations: (root, args) => {
2298
+ const dominantVariantName = args.dominantVariantName ?? root.variations[0]?.name;
2299
+ const activeVariations = getActiveSkuVariations(root.variations);
2300
+ const activeDominantVariationValue = activeVariations[dominantVariantName];
2301
+ const filteredFormattedVariations = getFormattedVariations(root.isVariantOf.items, dominantVariantName, activeDominantVariationValue);
2302
+ return filteredFormattedVariations;
2303
+ },
2304
+ };
2305
+ //# sourceMappingURL=skuVariations.js.map
2306
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/platforms/vtex/index.js
2307
+
2308
+
2309
+
2310
+
2311
+
2312
+
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+
2319
+
2320
+
2321
+
2322
+
2323
+
2324
+
2325
+
2326
+
2327
+ const Resolvers = {
2328
+ StoreCollection: StoreCollection,
2329
+ StoreAggregateOffer: StoreAggregateOffer,
2330
+ StoreProduct: StoreProduct,
2331
+ StoreSeo: StoreSeo,
2332
+ StoreFacet: StoreFacet,
2333
+ StoreFacetBoolean: StoreFacetBoolean,
2334
+ StoreFacetRange: StoreFacetRange,
2335
+ StoreFacetValueBoolean: StoreFacetValueBoolean,
2336
+ StoreOffer: StoreOffer,
2337
+ StoreAggregateRating: StoreAggregateRating,
2338
+ StoreReview: StoreReview,
2339
+ StoreProductGroup: StoreProductGroup,
2340
+ StoreSearchResult: StoreSearchResult,
2341
+ StorePropertyValue: StorePropertyValue,
2342
+ SkuVariants: SkuVariants,
2343
+ ShippingSLA: ShippingSLA,
2344
+ ObjectOrString: ObjectOrString,
2345
+ Query: Query,
2346
+ Mutation: Mutation,
2347
+ };
2348
+ const getContextFactory = (options) => (ctx) => {
2349
+ ctx.storage = {
2350
+ channel: ChannelMarshal.parse(options.channel),
2351
+ flags: options.flags ?? {},
2352
+ locale: options.locale,
2353
+ };
2354
+ ctx.clients = getClients(options, ctx);
2355
+ ctx.loaders = getLoaders(options, ctx);
2356
+ return ctx;
2357
+ };
2358
+ const getResolvers = (_) => Resolvers;
2359
+ //# sourceMappingURL=index.js.map
2360
+
14
2361
  /***/ }),
15
2362
 
16
- /***/ 4826:
17
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2363
+ /***/ 941:
2364
+ /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
2365
+
2366
+
2367
+ // UNUSED EXPORTS: getTelemetry
2368
+
2369
+ // EXTERNAL MODULE: external "@opentelemetry/sdk-trace-base"
2370
+ var sdk_trace_base_ = __webpack_require__(1283);
2371
+ // EXTERNAL MODULE: external "@opentelemetry/resources"
2372
+ var resources_ = __webpack_require__(4161);
2373
+ // EXTERNAL MODULE: external "@opentelemetry/exporter-trace-otlp-grpc"
2374
+ var exporter_trace_otlp_grpc_ = __webpack_require__(5196);
2375
+ // EXTERNAL MODULE: external "@opentelemetry/sdk-logs"
2376
+ var sdk_logs_ = __webpack_require__(2793);
2377
+ // EXTERNAL MODULE: external "@opentelemetry/exporter-logs-otlp-grpc"
2378
+ var exporter_logs_otlp_grpc_ = __webpack_require__(6969);
2379
+ // EXTERNAL MODULE: external "@opentelemetry/api"
2380
+ var api_ = __webpack_require__(4691);
2381
+ // EXTERNAL MODULE: external "@opentelemetry/api-logs"
2382
+ var api_logs_ = __webpack_require__(8973);
2383
+ // EXTERNAL MODULE: external "graphql"
2384
+ var external_graphql_ = __webpack_require__(7343);
2385
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/telemetry/useFaststoreTelemetry.js
2386
+
2387
+
2388
+
2389
+
2390
+
2391
+
2392
+ var AttributeName;
2393
+ (function (AttributeName) {
2394
+ AttributeName["EXECUTION_ERROR"] = "graphql.error";
2395
+ AttributeName["EXECUTION_RESULT"] = "graphql.result";
2396
+ AttributeName["RESOLVER_EXECUTION_ERROR"] = "graphql.resolver.error";
2397
+ AttributeName["RESOLVER_EXCEPTION"] = "graphql.resolver.exception";
2398
+ AttributeName["RESOLVER_FIELD_NAME"] = "graphql.resolver.fieldName";
2399
+ AttributeName["RESOLVER_TYPE_NAME"] = "graphql.resolver.typeName";
2400
+ AttributeName["RESOLVER_RESULT_TYPE"] = "graphql.resolver.resultType";
2401
+ AttributeName["RESOLVER_ARGS"] = "graphql.resolver.args";
2402
+ AttributeName["EXECUTION_OPERATION_NAME"] = "graphql.operation.name";
2403
+ AttributeName["EXECUTION_OPERATION_TYPE"] = "graphql.operation.type";
2404
+ AttributeName["EXECUTION_OPERATION_DOCUMENT"] = "graphql.document";
2405
+ AttributeName["EXECUTION_VARIABLES"] = "graphql.variables";
2406
+ })(AttributeName || (AttributeName = {}));
2407
+ const tracingSpanSymbol = Symbol('OPEN_TELEMETRY_GRAPHQL');
2408
+ function getResolverSpanKey(path) {
2409
+ const nodes = [];
2410
+ // If the first node (after reversed, it will be the last one) is an integer, that is, identifies a list,
2411
+ // we don't want to include it in the key. Note that this will only happen when analysing .prev paths in
2412
+ // a list of elements. We just want to remove the initial node that is a integer, not all of them.
2413
+ //
2414
+ // Nodes with keys 6bc73341b2a183fc::product::image::0::url would not be able to find
2415
+ // parents with key 6bc73341b2a183fc::product::image because of the "0" list index -
2416
+ // it would search for 6bc73341b2a183fc::product::image::0
2417
+ let currentPath = nodes.length === 0 && Number.isInteger(path.key) ? path.prev : path;
2418
+ while (currentPath) {
2419
+ nodes.push(currentPath.key);
2420
+ currentPath = currentPath.prev;
2421
+ }
2422
+ return [...nodes].reverse().join('.');
2423
+ }
2424
+ const useFaststoreTelemetry_getFaststoreTelemetryPlugin = (tracingProvider, loggerProvider, serviceName, experimentalSendLogs) => {
2425
+ return function useFaststoreTelemetry() {
2426
+ const tracer = tracingProvider.getTracer(serviceName);
2427
+ const logger = loggerProvider.getLogger(serviceName);
2428
+ const resolverContextsByRootSpans = {};
2429
+ return {
2430
+ onPluginInit({ addPlugin }) {
2431
+ addPlugin(
2432
+ // eslint-disable-next-line
2433
+ useOnResolve(({ info, context }) => {
2434
+ if (context &&
2435
+ typeof context === 'object' &&
2436
+ context[tracingSpanSymbol]) {
2437
+ tracer.getActiveSpanProcessor();
2438
+ const rootContextSpanId = context[tracingSpanSymbol].spanContext().spanId;
2439
+ const { fieldName, returnType, parentType, path } = info;
2440
+ const previousResolverSpanKey = path.prev && getResolverSpanKey(path.prev);
2441
+ let ctx = null;
2442
+ if (previousResolverSpanKey &&
2443
+ resolverContextsByRootSpans[rootContextSpanId][previousResolverSpanKey]) {
2444
+ ctx =
2445
+ resolverContextsByRootSpans[rootContextSpanId][previousResolverSpanKey];
2446
+ }
2447
+ else {
2448
+ ctx = openTelTrace.setSpan(openTelContext.active(), context[tracingSpanSymbol]);
2449
+ resolverContextsByRootSpans[rootContextSpanId] =
2450
+ resolverContextsByRootSpans[rootContextSpanId] ?? {};
2451
+ }
2452
+ const resolverIndexInList = Number.isInteger(path.prev?.key)
2453
+ ? `[${path.prev?.key}]`
2454
+ : '';
2455
+ const resolverSpan = tracer.startSpan(`${parentType.toString()}.${fieldName}${resolverIndexInList}`, {
2456
+ attributes: {
2457
+ [AttributeName.RESOLVER_FIELD_NAME]: fieldName,
2458
+ [AttributeName.RESOLVER_TYPE_NAME]: parentType.toString(),
2459
+ [AttributeName.RESOLVER_RESULT_TYPE]: returnType.toString(),
2460
+ 'meta.span.path': getResolverSpanKey(path),
2461
+ },
2462
+ }, ctx);
2463
+ const resolverCtx = openTelTrace.setSpan(ctx, resolverSpan);
2464
+ resolverContextsByRootSpans[rootContextSpanId][getResolverSpanKey(path)] = resolverCtx;
2465
+ return ({ result }) => {
2466
+ if (result instanceof Error) {
2467
+ resolverSpan.setAttributes({
2468
+ error: true,
2469
+ 'exception.category': AttributeName.RESOLVER_EXECUTION_ERROR,
2470
+ 'exception.message': result.message,
2471
+ 'exception.type': result.name,
2472
+ });
2473
+ resolverSpan.recordException(result);
2474
+ }
2475
+ resolverSpan.end();
2476
+ };
2477
+ }
2478
+ return () => { };
2479
+ }));
2480
+ },
2481
+ onExecute({ args, extendContext }) {
2482
+ const operationType = args.document.definitions
2483
+ .filter((def) => def.kind === Kind.OPERATION_DEFINITION)
2484
+ .map((def) => def.operation)?.[0];
2485
+ // Span name according to Semantic Conventions
2486
+ // https://github.com/open-telemetry/semantic-conventions
2487
+ let spanName = 'GraphQL Operation';
2488
+ if (operationType && args.operationName) {
2489
+ spanName = `${operationType} ${args.operationName}`;
2490
+ }
2491
+ else if (operationType && !args.operationName) {
2492
+ spanName = operationType;
2493
+ }
2494
+ const executionSpan = tracer.startSpan(spanName, {
2495
+ kind: SpanKind.SERVER,
2496
+ attributes: {
2497
+ [AttributeName.EXECUTION_OPERATION_NAME]: args.operationName ?? undefined,
2498
+ [AttributeName.EXECUTION_OPERATION_TYPE]: operationType ?? undefined,
2499
+ [AttributeName.EXECUTION_OPERATION_DOCUMENT]: print(args.document),
2500
+ },
2501
+ });
2502
+ const executeContext = openTelContext.active();
2503
+ const resultCbs = {
2504
+ onExecuteDone({ result }) {
2505
+ if (isAsyncIterable(result)) {
2506
+ executionSpan.end();
2507
+ // eslint-disable-next-line no-console
2508
+ console.warn(`Plugin "newrelic" encountered a AsyncIterator which is not supported yet, so tracing data is not available for the operation.`);
2509
+ return;
2510
+ }
2511
+ const logRecord = {
2512
+ context: executeContext,
2513
+ attributes: {
2514
+ 'service.name': 'faststore-api',
2515
+ 'service.version': '1.12.38',
2516
+ 'service.name_and_version': 'faststore-api@1.12.38',
2517
+ 'vtex.search_index': 'faststore_beta_api',
2518
+ [AttributeName.EXECUTION_OPERATION_NAME]: args.operationName ?? undefined,
2519
+ [AttributeName.EXECUTION_OPERATION_DOCUMENT]: print(args.document),
2520
+ [AttributeName.EXECUTION_VARIABLES]: JSON.stringify(args.variableValues ?? {}),
2521
+ },
2522
+ };
2523
+ if (typeof result.data !== 'undefined' &&
2524
+ !(result.errors && result.errors.length > 0)) {
2525
+ logRecord.severityNumber = SeverityNumber.INFO;
2526
+ logRecord.severityText = 'Info';
2527
+ logRecord.attributes[AttributeName.EXECUTION_RESULT] =
2528
+ JSON.stringify(result);
2529
+ }
2530
+ if (result.errors && result.errors.length > 0) {
2531
+ logRecord.severityNumber = SeverityNumber.ERROR;
2532
+ logRecord.severityText = 'Error';
2533
+ logRecord.attributes[AttributeName.EXECUTION_ERROR] =
2534
+ JSON.stringify(result.errors);
2535
+ executionSpan.setAttributes({
2536
+ error: true,
2537
+ 'exception.category': AttributeName.EXECUTION_ERROR,
2538
+ 'exception.message': JSON.stringify(result.errors),
2539
+ });
2540
+ }
2541
+ if (experimentalSendLogs) {
2542
+ logger.emit(logRecord);
2543
+ }
2544
+ executionSpan.end();
2545
+ },
2546
+ };
2547
+ extendContext({
2548
+ [tracingSpanSymbol]: executionSpan,
2549
+ });
2550
+ return resultCbs;
2551
+ },
2552
+ };
2553
+ };
2554
+ };
2555
+ //# sourceMappingURL=useFaststoreTelemetry.js.map
2556
+ // EXTERNAL MODULE: ../api/dist/esm/package.json
2557
+ var esm_package = __webpack_require__(2828);
2558
+ ;// CONCATENATED MODULE: ../api/dist/esm/src/telemetry/index.js
2559
+
18
2560
 
19
2561
 
20
2562
 
21
2563
 
22
- if (true) {
23
- module.exports = __webpack_require__(4850)
24
- } else {}
25
2564
 
26
2565
 
2566
+ const FASTSTORE_API_VERSION = esm_package/* version */.i8;
2567
+ // TODO: These urls are hardcoded for now, but they should be configurable via ENV variables
2568
+ // They are only acessible from within the VTEX network, so they are not a security risk
2569
+ const TRACE_COLLECTOR_URL = 'opentelemetry-collector.vtex.systems';
2570
+ const TRACE_COLLECTOR_URL_DEV = 'opentelemetry-collector-beta.vtex.systems';
2571
+ const LOG_COLLECTOR_URL = 'opentelemetry-collector.vtex.systems';
2572
+ function getTelemetry(APIOptions, telemetryOptions) {
2573
+ const honeycombCollectorOptions = {
2574
+ url: telemetryOptions?.mode === 'dev'
2575
+ ? TRACE_COLLECTOR_URL_DEV
2576
+ : TRACE_COLLECTOR_URL,
2577
+ };
2578
+ const openSearchCollectorOptions = {
2579
+ url: LOG_COLLECTOR_URL,
2580
+ };
2581
+ // Create a new tracer provider
2582
+ const tracerProvider = new BasicTracerProvider({
2583
+ resource: new Resource({
2584
+ 'service.name': 'faststore-api',
2585
+ 'service.version': FASTSTORE_API_VERSION,
2586
+ 'service.name_and_version': `faststore-api@${FASTSTORE_API_VERSION}`,
2587
+ platform: APIOptions.platform,
2588
+ [`${APIOptions.platform}.account`]: APIOptions.account,
2589
+ [`${APIOptions.platform}.environment`]: APIOptions.environment,
2590
+ // TODO: include the following properties in the logs
2591
+ // [`${APIOptions.platform}.options.hideUnavailableItems`]:
2592
+ // APIOptions.hideUnavailableItems,
2593
+ // [`${APIOptions.platform}.flags.enableOrderFormSync`]:
2594
+ // APIOptions.flags?.enableOrderFormSync,
2595
+ // channel: APIOptions.channel,
2596
+ locale: APIOptions.locale,
2597
+ }),
2598
+ });
2599
+ const loggerProvider = new LoggerProvider();
2600
+ // Create trace exporter
2601
+ const honeycombExporter = new OTLPTraceExporter(honeycombCollectorOptions);
2602
+ // Create log exporter
2603
+ const openSearchExporter = new OTLPLogsExporter(openSearchCollectorOptions);
2604
+ // Set up a span processor to export spans to Honeycomb
2605
+ const honeyCombSpanProcessor = new SimpleSpanProcessor(honeycombExporter);
2606
+ // Set up a log record processor to export spans to OpenSearch
2607
+ const openSearchLogProcessor = new SimpleLogRecordProcessor(openSearchExporter);
2608
+ // Register the span processor with the tracer provider
2609
+ tracerProvider.addSpanProcessor(honeyCombSpanProcessor);
2610
+ // Register the log record processor with the log provider
2611
+ loggerProvider.addLogRecordProcessor(openSearchLogProcessor);
2612
+ if (telemetryOptions?.mode === 'verbose' ||
2613
+ telemetryOptions?.mode === 'dev') {
2614
+ // Set up a console exporter for verbose mode
2615
+ const consoleExporter = new ConsoleSpanExporter();
2616
+ const verboseTraceProcessor = new SimpleSpanProcessor(consoleExporter);
2617
+ // Set up processors for verbose mode
2618
+ const consoleLogExporter = new ConsoleLogRecordExporter();
2619
+ const veboseLogRecordExporter = new SimpleLogRecordProcessor(consoleLogExporter);
2620
+ tracerProvider.addSpanProcessor(verboseTraceProcessor);
2621
+ loggerProvider.addLogRecordProcessor(veboseLogRecordExporter);
2622
+ }
2623
+ const useFaststoreTelemetry = getFaststoreTelemetryPlugin(
2624
+ // The @opentelemetry/sdk-trace-base was renamed from @opentelemetry/tracing but the
2625
+ // envelop plugin doesn't support this change yet. This causes the class type to be incompatible,
2626
+ // even if they are the same. https://github.com/n1ru4l/envelop/issues/1610
2627
+ tracerProvider, loggerProvider, 'faststore-api', telemetryOptions?.experimentalSendLogs ?? false);
2628
+ return { useFaststoreTelemetry };
2629
+ }
2630
+ //# sourceMappingURL=index.js.map
2631
+
2632
+ /***/ }),
2633
+
2634
+ /***/ 3999:
2635
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
2636
+
2637
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
2638
+ /* unused harmony export typeDefs */
2639
+ /* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7343);
2640
+ /* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphql__WEBPACK_IMPORTED_MODULE_0__);
2641
+ /* harmony import */ var _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5774);
2642
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_1__]);
2643
+ _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
2644
+
2645
+
2646
+ // Empty string ('') is interpreted as the current dir. Referencing it as './' won't work.
2647
+ const typeDefs = (0,_graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_1__.loadFilesSync)('', { extensions: ['.graphql'] })
2648
+ .map(graphql__WEBPACK_IMPORTED_MODULE_0__.print)
2649
+ .join('\n');
2650
+ //# sourceMappingURL=index.js.map
2651
+ __webpack_async_result__();
2652
+ } catch(e) { __webpack_async_result__(e); } });
2653
+
27
2654
  /***/ }),
28
2655
 
29
2656
  /***/ 9297:
@@ -62,7 +2689,7 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
62
2689
  /* harmony import */ var _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7886);
63
2690
  /* harmony import */ var _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4656);
64
2691
  /* harmony import */ var _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6093);
65
- /* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4826);
2692
+ /* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7397);
66
2693
  /* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7343);
67
2694
  /* harmony import */ var graphql__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(graphql__WEBPACK_IMPORTED_MODULE_6__);
68
2695
  /* harmony import */ var _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6550);
@@ -71,8 +2698,8 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
71
2698
  /* harmony import */ var _customizations_src_graphql_vtex_resolvers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8299);
72
2699
  /* harmony import */ var _customizations_src_graphql_thirdParty_resolvers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9297);
73
2700
  /* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1001);
74
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_envelop_core__WEBPACK_IMPORTED_MODULE_1__, _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__, _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__, _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__, _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__, _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_8__]);
75
- ([_envelop_core__WEBPACK_IMPORTED_MODULE_1__, _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__, _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__, _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__, _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__, _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
2701
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_envelop_core__WEBPACK_IMPORTED_MODULE_1__, _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__, _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__, _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__, _faststore_api__WEBPACK_IMPORTED_MODULE_5__, _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__, _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_8__]);
2702
+ ([_envelop_core__WEBPACK_IMPORTED_MODULE_1__, _envelop_graphql_jit__WEBPACK_IMPORTED_MODULE_2__, _envelop_parser_cache__WEBPACK_IMPORTED_MODULE_3__, _envelop_validation_cache__WEBPACK_IMPORTED_MODULE_4__, _faststore_api__WEBPACK_IMPORTED_MODULE_5__, _graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__, _graphql_tools_load_files__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
76
2703
  /* eslint-disable react-hooks/rules-of-hooks */
77
2704
 
78
2705
 
@@ -88,10 +2715,10 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_env
88
2715
 
89
2716
 
90
2717
  const persistedQueries = new Map(Object.entries(_generated_graphql_persisted_json__WEBPACK_IMPORTED_MODULE_9__));
91
- const apiContextFactory = (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__.getContextFactory)(_options__WEBPACK_IMPORTED_MODULE_10__/* .apiOptions */ .e);
2718
+ const apiContextFactory = (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__/* .getContextFactory */ .E9)(_options__WEBPACK_IMPORTED_MODULE_10__/* .apiOptions */ .e);
92
2719
 
93
2720
  const formatError = err => {
94
- if (err instanceof graphql__WEBPACK_IMPORTED_MODULE_6__.GraphQLError && (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__.isFastStoreError)(err.originalError)) {
2721
+ if (err instanceof graphql__WEBPACK_IMPORTED_MODULE_6__.GraphQLError && (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__/* .isFastStoreError */ .T9)(err.originalError)) {
95
2722
  return err;
96
2723
  }
97
2724
 
@@ -107,7 +2734,7 @@ function loadGeneratedSchema() {
107
2734
 
108
2735
  function getFinalAPISchema() {
109
2736
  const generatedSchema = loadGeneratedSchema();
110
- const nativeResolvers = (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__.getResolvers)(_options__WEBPACK_IMPORTED_MODULE_10__/* .apiOptions */ .e);
2737
+ const nativeResolvers = (0,_faststore_api__WEBPACK_IMPORTED_MODULE_5__/* .getResolvers */ .yd)(_options__WEBPACK_IMPORTED_MODULE_10__/* .apiOptions */ .e);
111
2738
  return (0,_graphql_tools_schema__WEBPACK_IMPORTED_MODULE_7__.makeExecutableSchema)({
112
2739
  typeDefs: generatedSchema,
113
2740
  resolvers: [nativeResolvers, _customizations_src_graphql_vtex_resolvers__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, _customizations_src_graphql_thirdParty_resolvers__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z]
@@ -189,6 +2816,13 @@ const apiOptions = {
189
2816
 
190
2817
  /***/ }),
191
2818
 
2819
+ /***/ 2828:
2820
+ /***/ ((module) => {
2821
+
2822
+ module.exports = JSON.parse('{"u2":"@faststore/api","i8":"2.2.43"}');
2823
+
2824
+ /***/ }),
2825
+
192
2826
  /***/ 6984:
193
2827
  /***/ ((module) => {
194
2828