@plasmicpkgs/commerce-shopify 0.0.214 → 0.0.215

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 (84) hide show
  1. package/dist/cart/use-add-item.d.ts +4 -4
  2. package/dist/cart/use-cart.d.ts +2 -3
  3. package/dist/cart/use-remove-item.d.ts +12 -8
  4. package/dist/cart/use-update-item.d.ts +12 -8
  5. package/dist/commerce-shopify.cjs.development.js +2863 -716
  6. package/dist/commerce-shopify.cjs.development.js.map +1 -1
  7. package/dist/commerce-shopify.cjs.production.min.js +1 -1
  8. package/dist/commerce-shopify.cjs.production.min.js.map +1 -1
  9. package/dist/commerce-shopify.esm.js +2864 -717
  10. package/dist/commerce-shopify.esm.js.map +1 -1
  11. package/dist/const.d.ts +1 -1
  12. package/dist/fetcher.d.ts +1 -1
  13. package/dist/graphql-config.d.ts +6 -0
  14. package/dist/product/use-product.d.ts +2 -5
  15. package/dist/product/use-search.d.ts +1 -9
  16. package/dist/provider.d.ts +19 -13
  17. package/dist/shopify-types.d.ts +5 -0
  18. package/dist/site/use-brands.d.ts +2 -3
  19. package/dist/site/use-categories.d.ts +2 -3
  20. package/dist/utils/cart-create.d.ts +3 -0
  21. package/dist/utils/fragments/cart.d.ts +1 -0
  22. package/dist/utils/fragments/collection.d.ts +1 -0
  23. package/dist/utils/fragments/image.d.ts +1 -0
  24. package/dist/utils/fragments/product-variant.d.ts +1 -0
  25. package/dist/utils/fragments/product.d.ts +1 -0
  26. package/dist/utils/fragments/seo.d.ts +1 -0
  27. package/dist/utils/get-cart-id.d.ts +1 -0
  28. package/dist/utils/graphql/gen/gql.d.ts +76 -0
  29. package/dist/utils/graphql/gen/graphql.d.ts +11114 -0
  30. package/dist/utils/graphql/gen/index.d.ts +1 -0
  31. package/dist/utils/mutations/cart.d.ts +15 -0
  32. package/dist/utils/mutations/customer-activate-by-url.d.ts +4 -2
  33. package/dist/utils/normalize.d.ts +6 -7
  34. package/dist/utils/queries/get-all-collections-query.d.ts +3 -2
  35. package/dist/utils/queries/get-all-product-vendors-query.d.ts +4 -2
  36. package/dist/utils/queries/get-all-products-query.d.ts +6 -3
  37. package/dist/utils/queries/get-cart-query.d.ts +3 -0
  38. package/dist/utils/queries/get-collection-products-query.d.ts +6 -2
  39. package/dist/utils/queries/get-collection-query.d.ts +5 -3
  40. package/dist/utils/queries/get-product-query.d.ts +6 -3
  41. package/dist/utils/throw-user-errors.d.ts +1 -2
  42. package/package.json +7 -4
  43. package/dist/cart/index.d.ts +0 -4
  44. package/dist/product/use-price.d.ts +0 -2
  45. package/dist/types/cart.d.ts +0 -25
  46. package/dist/types/checkout.d.ts +0 -1
  47. package/dist/types/common.d.ts +0 -1
  48. package/dist/types/customer.d.ts +0 -3
  49. package/dist/types/index.d.ts +0 -12
  50. package/dist/types/login.d.ts +0 -6
  51. package/dist/types/logout.d.ts +0 -1
  52. package/dist/types/page.d.ts +0 -8
  53. package/dist/types/product.d.ts +0 -1
  54. package/dist/types/signup.d.ts +0 -1
  55. package/dist/types/site.d.ts +0 -7
  56. package/dist/types/wishlist.d.ts +0 -1
  57. package/dist/utils/checkout-create.d.ts +0 -4
  58. package/dist/utils/checkout-to-cart.d.ts +0 -9
  59. package/dist/utils/customer-token.d.ts +0 -3
  60. package/dist/utils/get-brands.d.ts +0 -11
  61. package/dist/utils/get-categories.d.ts +0 -3
  62. package/dist/utils/get-checkout-id.d.ts +0 -2
  63. package/dist/utils/handle-account-activation.d.ts +0 -3
  64. package/dist/utils/handle-fetch-response.d.ts +0 -5
  65. package/dist/utils/handle-login.d.ts +0 -4
  66. package/dist/utils/index.d.ts +0 -9
  67. package/dist/utils/mutations/associate-customer-with-checkout.d.ts +0 -2
  68. package/dist/utils/mutations/checkout-create.d.ts +0 -2
  69. package/dist/utils/mutations/checkout-line-item-add.d.ts +0 -2
  70. package/dist/utils/mutations/checkout-line-item-remove.d.ts +0 -2
  71. package/dist/utils/mutations/checkout-line-item-update.d.ts +0 -2
  72. package/dist/utils/mutations/customer-access-token-create.d.ts +0 -2
  73. package/dist/utils/mutations/customer-access-token-delete.d.ts +0 -2
  74. package/dist/utils/mutations/customer-activate.d.ts +0 -2
  75. package/dist/utils/mutations/customer-create.d.ts +0 -2
  76. package/dist/utils/mutations/index.d.ts +0 -9
  77. package/dist/utils/queries/get-all-pages-query.d.ts +0 -2
  78. package/dist/utils/queries/get-all-products-paths-query.d.ts +0 -2
  79. package/dist/utils/queries/get-checkout-query.d.ts +0 -3
  80. package/dist/utils/queries/get-customer-id-query.d.ts +0 -2
  81. package/dist/utils/queries/get-customer-query.d.ts +0 -2
  82. package/dist/utils/queries/get-page-query.d.ts +0 -2
  83. package/dist/utils/queries/get-site-info-query.d.ts +0 -2
  84. package/dist/utils/queries/index.d.ts +0 -11
@@ -1,5 +1,5 @@
1
1
  import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
2
- import { FetcherError, ValidationError, CommerceError, useCart, useCommerce as useCommerce$1, getCommerceProvider as getCommerceProvider$1, CartActionsProvider, globalActionsRegistrations } from '@plasmicpkgs/commerce';
2
+ import { useCart, CommerceError, ValidationError, FetcherError, useCommerce as useCommerce$1, getCommerceProvider as getCommerceProvider$1, CartActionsProvider, globalActionsRegistrations } from '@plasmicpkgs/commerce';
3
3
  import React, { useMemo, useCallback } from 'react';
4
4
  import Cookies from 'js-cookie';
5
5
  import debounce from 'debounce';
@@ -349,6 +349,79 @@ function _extends() {
349
349
  };
350
350
  return _extends.apply(this, arguments);
351
351
  }
352
+ function _inheritsLoose(subClass, superClass) {
353
+ subClass.prototype = Object.create(superClass.prototype);
354
+ subClass.prototype.constructor = subClass;
355
+ _setPrototypeOf(subClass, superClass);
356
+ }
357
+ function _getPrototypeOf(o) {
358
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
359
+ return o.__proto__ || Object.getPrototypeOf(o);
360
+ };
361
+ return _getPrototypeOf(o);
362
+ }
363
+ function _setPrototypeOf(o, p) {
364
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
365
+ o.__proto__ = p;
366
+ return o;
367
+ };
368
+ return _setPrototypeOf(o, p);
369
+ }
370
+ function _isNativeReflectConstruct() {
371
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
372
+ if (Reflect.construct.sham) return false;
373
+ if (typeof Proxy === "function") return true;
374
+ try {
375
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
376
+ return true;
377
+ } catch (e) {
378
+ return false;
379
+ }
380
+ }
381
+ function _construct(Parent, args, Class) {
382
+ if (_isNativeReflectConstruct()) {
383
+ _construct = Reflect.construct.bind();
384
+ } else {
385
+ _construct = function _construct(Parent, args, Class) {
386
+ var a = [null];
387
+ a.push.apply(a, args);
388
+ var Constructor = Function.bind.apply(Parent, a);
389
+ var instance = new Constructor();
390
+ if (Class) _setPrototypeOf(instance, Class.prototype);
391
+ return instance;
392
+ };
393
+ }
394
+ return _construct.apply(null, arguments);
395
+ }
396
+ function _isNativeFunction(fn) {
397
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
398
+ }
399
+ function _wrapNativeSuper(Class) {
400
+ var _cache = typeof Map === "function" ? new Map() : undefined;
401
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
402
+ if (Class === null || !_isNativeFunction(Class)) return Class;
403
+ if (typeof Class !== "function") {
404
+ throw new TypeError("Super expression must either be null or a function");
405
+ }
406
+ if (typeof _cache !== "undefined") {
407
+ if (_cache.has(Class)) return _cache.get(Class);
408
+ _cache.set(Class, Wrapper);
409
+ }
410
+ function Wrapper() {
411
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
412
+ }
413
+ Wrapper.prototype = Object.create(Class.prototype, {
414
+ constructor: {
415
+ value: Wrapper,
416
+ enumerable: false,
417
+ writable: true,
418
+ configurable: true
419
+ }
420
+ });
421
+ return _setPrototypeOf(Wrapper, Class);
422
+ };
423
+ return _wrapNativeSuper(Class);
424
+ }
352
425
  function _objectWithoutPropertiesLoose(source, excluded) {
353
426
  if (source == null) return {};
354
427
  var target = {};
@@ -362,211 +435,2248 @@ function _objectWithoutPropertiesLoose(source, excluded) {
362
435
  return target;
363
436
  }
364
437
 
365
- /*
366
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
367
- Changes: Removed store domain and api token
368
- */
369
- var SHOPIFY_CHECKOUT_ID_COOKIE = 'shopify_checkoutId';
370
- var SHOPIFY_CHECKOUT_URL_COOKIE = 'shopify_checkoutUrl';
371
- var SHOPIFY_COOKIE_EXPIRE = 30;
372
-
373
- function getError(errors, status) {
374
- var _errors;
375
- errors = (_errors = errors) != null ? _errors : [{
376
- message: 'Failed to fetch Shopify API'
377
- }];
378
- return new FetcherError({
379
- errors: errors,
380
- status: status
381
- });
382
- }
383
- function getAsyncError(_x) {
384
- return _getAsyncError.apply(this, arguments);
385
- }
386
- function _getAsyncError() {
387
- _getAsyncError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(res) {
388
- var data;
389
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
390
- while (1) switch (_context2.prev = _context2.next) {
391
- case 0:
392
- _context2.next = 2;
393
- return res.json();
394
- case 2:
395
- data = _context2.sent;
396
- return _context2.abrupt("return", getError(data.errors, res.status));
397
- case 4:
398
- case "end":
399
- return _context2.stop();
400
- }
401
- }, _callee2);
402
- }));
403
- return _getAsyncError.apply(this, arguments);
404
- }
405
- var handleFetchResponse = /*#__PURE__*/function () {
406
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
407
- var _yield$res$json, data, errors;
408
- return _regeneratorRuntime().wrap(function _callee$(_context) {
409
- while (1) switch (_context.prev = _context.next) {
410
- case 0:
411
- if (!res.ok) {
412
- _context.next = 9;
413
- break;
414
- }
415
- _context.next = 3;
416
- return res.json();
417
- case 3:
418
- _yield$res$json = _context.sent;
419
- data = _yield$res$json.data;
420
- errors = _yield$res$json.errors;
421
- if (!(errors && errors.length)) {
422
- _context.next = 8;
423
- break;
424
- }
425
- throw getError(errors, res.status);
426
- case 8:
427
- return _context.abrupt("return", data);
428
- case 9:
429
- _context.next = 11;
430
- return getAsyncError(res);
431
- case 11:
432
- throw _context.sent;
433
- case 12:
434
- case "end":
435
- return _context.stop();
438
+ var _schema;
439
+ var defaultStoreDomain = "next-js-store.myshopify.com";
440
+ var defaultAccessToken = "ef7d41c7bf7e1c214074d0d3047bcd7b";
441
+ var shopifyApiVersion = "2025-01";
442
+ var config = {
443
+ schema: (_schema = {}, _schema["https://" + defaultStoreDomain + "/api/" + shopifyApiVersion + "/graphql.json"] = {
444
+ headers: {
445
+ "X-Shopify-Storefront-Access-Token": defaultAccessToken
446
+ }
447
+ }, _schema),
448
+ generates: {
449
+ "./src/utils/graphql/gen/": {
450
+ preset: "client",
451
+ presetConfig: {
452
+ fragmentMasking: false
453
+ },
454
+ config: {
455
+ documentMode: "string"
436
456
  }
437
- }, _callee);
438
- }));
439
- return function handleFetchResponse(_x2) {
440
- return _ref.apply(this, arguments);
441
- };
442
- }();
443
-
444
- /*
445
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
446
- Changes: None
447
- */
448
- var getSortVariables = function getSortVariables(sort, isCategory) {
449
- if (isCategory === void 0) {
450
- isCategory = false;
451
- }
452
- var output = {};
453
- switch (sort) {
454
- case 'price-asc':
455
- output = {
456
- sortKey: 'PRICE',
457
- reverse: false
458
- };
459
- break;
460
- case 'price-desc':
461
- output = {
462
- sortKey: 'PRICE',
463
- reverse: true
464
- };
465
- break;
466
- case 'trending-desc':
467
- output = {
468
- sortKey: 'BEST_SELLING',
469
- reverse: false
470
- };
471
- break;
472
- case 'latest-desc':
473
- output = {
474
- sortKey: isCategory ? 'CREATED' : 'CREATED_AT',
475
- reverse: true
476
- };
477
- break;
478
- }
479
- return output;
457
+ }
458
+ },
459
+ documents: ["./src/utils/fragments/*.{ts,tsx}", "./src/utils/mutations/*.{ts,tsx}", "./src/utils/queries/*.{ts,tsx}"]
480
460
  };
481
461
 
482
- var getSearchVariables = function getSearchVariables(_ref) {
483
- var brandId = _ref.brandId,
484
- search = _ref.search,
485
- categoryId = _ref.categoryId,
486
- sort = _ref.sort,
487
- locale = _ref.locale,
488
- count = _ref.count;
489
- var query = "";
490
- var searchQuery = search + "*";
491
- if (search) {
492
- query += "product_type:" + searchQuery + " OR title:" + searchQuery + " OR tag:" + searchQuery;
493
- }
494
- if (brandId) {
495
- query += (search ? "AND " : "") + "vendor:" + brandId;
462
+ var SHOPIFY_CART_ID_COOKIE = "shopify_cartId";
463
+ var SHOPIFY_CHECKOUT_URL_COOKIE = "shopify_checkoutUrl";
464
+ var SHOPIFY_COOKIE_EXPIRE = 30;
465
+
466
+ /** The set of valid sort keys for the Article query. */
467
+ var ArticleSortKeys;
468
+ (function (ArticleSortKeys) {
469
+ /** Sort by the `author` value. */
470
+ ArticleSortKeys["Author"] = "AUTHOR";
471
+ /** Sort by the `blog_title` value. */
472
+ ArticleSortKeys["BlogTitle"] = "BLOG_TITLE";
473
+ /** Sort by the `id` value. */
474
+ ArticleSortKeys["Id"] = "ID";
475
+ /** Sort by the `published_at` value. */
476
+ ArticleSortKeys["PublishedAt"] = "PUBLISHED_AT";
477
+ /**
478
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
479
+ * Don't use this sort key when no search query is specified.
480
+ *
481
+ */
482
+ ArticleSortKeys["Relevance"] = "RELEVANCE";
483
+ /** Sort by the `title` value. */
484
+ ArticleSortKeys["Title"] = "TITLE";
485
+ /** Sort by the `updated_at` value. */
486
+ ArticleSortKeys["UpdatedAt"] = "UPDATED_AT";
487
+ })(ArticleSortKeys || (ArticleSortKeys = {}));
488
+ /** The set of valid sort keys for the Blog query. */
489
+ var BlogSortKeys;
490
+ (function (BlogSortKeys) {
491
+ /** Sort by the `handle` value. */
492
+ BlogSortKeys["Handle"] = "HANDLE";
493
+ /** Sort by the `id` value. */
494
+ BlogSortKeys["Id"] = "ID";
495
+ /**
496
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
497
+ * Don't use this sort key when no search query is specified.
498
+ *
499
+ */
500
+ BlogSortKeys["Relevance"] = "RELEVANCE";
501
+ /** Sort by the `title` value. */
502
+ BlogSortKeys["Title"] = "TITLE";
503
+ })(BlogSortKeys || (BlogSortKeys = {}));
504
+ /** Card brand, such as Visa or Mastercard, which can be used for payments. */
505
+ var CardBrand;
506
+ (function (CardBrand) {
507
+ /** American Express. */
508
+ CardBrand["AmericanExpress"] = "AMERICAN_EXPRESS";
509
+ /** Diners Club. */
510
+ CardBrand["DinersClub"] = "DINERS_CLUB";
511
+ /** Discover. */
512
+ CardBrand["Discover"] = "DISCOVER";
513
+ /** JCB. */
514
+ CardBrand["Jcb"] = "JCB";
515
+ /** Mastercard. */
516
+ CardBrand["Mastercard"] = "MASTERCARD";
517
+ /** Visa. */
518
+ CardBrand["Visa"] = "VISA";
519
+ })(CardBrand || (CardBrand = {}));
520
+ /**
521
+ * Represents how credit card details are provided for a direct payment.
522
+ *
523
+ */
524
+ var CartCardSource;
525
+ (function (CartCardSource) {
526
+ /**
527
+ * The credit card was provided by a third party and vaulted on their system.
528
+ * Using this value requires a separate permission from Shopify.
529
+ *
530
+ */
531
+ CartCardSource["SavedCreditCard"] = "SAVED_CREDIT_CARD";
532
+ })(CartCardSource || (CartCardSource = {}));
533
+ /**
534
+ * Defines what type of merchandise is in the delivery group.
535
+ *
536
+ */
537
+ var CartDeliveryGroupType;
538
+ (function (CartDeliveryGroupType) {
539
+ /**
540
+ * The delivery group only contains merchandise that is either a one time purchase or a first delivery of
541
+ * subscription merchandise.
542
+ *
543
+ */
544
+ CartDeliveryGroupType["OneTimePurchase"] = "ONE_TIME_PURCHASE";
545
+ /** The delivery group only contains subscription merchandise. */
546
+ CartDeliveryGroupType["Subscription"] = "SUBSCRIPTION";
547
+ })(CartDeliveryGroupType || (CartDeliveryGroupType = {}));
548
+ /** Possible error codes that can be returned by `CartUserError`. */
549
+ var CartErrorCode;
550
+ (function (CartErrorCode) {
551
+ /** The specified address field contains emojis. */
552
+ CartErrorCode["AddressFieldContainsEmojis"] = "ADDRESS_FIELD_CONTAINS_EMOJIS";
553
+ /** The specified address field contains HTML tags. */
554
+ CartErrorCode["AddressFieldContainsHtmlTags"] = "ADDRESS_FIELD_CONTAINS_HTML_TAGS";
555
+ /** The specified address field contains a URL. */
556
+ CartErrorCode["AddressFieldContainsUrl"] = "ADDRESS_FIELD_CONTAINS_URL";
557
+ /** The specified address field does not match the expected pattern. */
558
+ CartErrorCode["AddressFieldDoesNotMatchExpectedPattern"] = "ADDRESS_FIELD_DOES_NOT_MATCH_EXPECTED_PATTERN";
559
+ /** The specified address field is required. */
560
+ CartErrorCode["AddressFieldIsRequired"] = "ADDRESS_FIELD_IS_REQUIRED";
561
+ /** The specified address field is too long. */
562
+ CartErrorCode["AddressFieldIsTooLong"] = "ADDRESS_FIELD_IS_TOO_LONG";
563
+ /** The input value is invalid. */
564
+ CartErrorCode["Invalid"] = "INVALID";
565
+ /** Company location not found or not allowed. */
566
+ CartErrorCode["InvalidCompanyLocation"] = "INVALID_COMPANY_LOCATION";
567
+ /** The delivery address was not found. */
568
+ CartErrorCode["InvalidDeliveryAddressId"] = "INVALID_DELIVERY_ADDRESS_ID";
569
+ /** Delivery group was not found in cart. */
570
+ CartErrorCode["InvalidDeliveryGroup"] = "INVALID_DELIVERY_GROUP";
571
+ /** Delivery option was not valid. */
572
+ CartErrorCode["InvalidDeliveryOption"] = "INVALID_DELIVERY_OPTION";
573
+ /** The quantity must be a multiple of the specified increment. */
574
+ CartErrorCode["InvalidIncrement"] = "INVALID_INCREMENT";
575
+ /** Merchandise line was not found in cart. */
576
+ CartErrorCode["InvalidMerchandiseLine"] = "INVALID_MERCHANDISE_LINE";
577
+ /** The metafields were not valid. */
578
+ CartErrorCode["InvalidMetafields"] = "INVALID_METAFIELDS";
579
+ /** The payment wasn't valid. */
580
+ CartErrorCode["InvalidPayment"] = "INVALID_PAYMENT";
581
+ /** Cannot update payment on an empty cart */
582
+ CartErrorCode["InvalidPaymentEmptyCart"] = "INVALID_PAYMENT_EMPTY_CART";
583
+ /** The given zip code is invalid for the provided country. */
584
+ CartErrorCode["InvalidZipCodeForCountry"] = "INVALID_ZIP_CODE_FOR_COUNTRY";
585
+ /** The given zip code is invalid for the provided province. */
586
+ CartErrorCode["InvalidZipCodeForProvince"] = "INVALID_ZIP_CODE_FOR_PROVINCE";
587
+ /** The input value should be less than the maximum value allowed. */
588
+ CartErrorCode["LessThan"] = "LESS_THAN";
589
+ /** The quantity must be below the specified maximum for the item. */
590
+ CartErrorCode["MaximumExceeded"] = "MAXIMUM_EXCEEDED";
591
+ /** The quantity must be above the specified minimum for the item. */
592
+ CartErrorCode["MinimumNotMet"] = "MINIMUM_NOT_MET";
593
+ /** The customer access token is required when setting a company location. */
594
+ CartErrorCode["MissingCustomerAccessToken"] = "MISSING_CUSTOMER_ACCESS_TOKEN";
595
+ /** Missing discount code. */
596
+ CartErrorCode["MissingDiscountCode"] = "MISSING_DISCOUNT_CODE";
597
+ /** Missing note. */
598
+ CartErrorCode["MissingNote"] = "MISSING_NOTE";
599
+ /** The note length must be below the specified maximum. */
600
+ CartErrorCode["NoteTooLong"] = "NOTE_TOO_LONG";
601
+ /** Only one delivery address can be selected. */
602
+ CartErrorCode["OnlyOneDeliveryAddressCanBeSelected"] = "ONLY_ONE_DELIVERY_ADDRESS_CAN_BE_SELECTED";
603
+ /** The payment method is not supported. */
604
+ CartErrorCode["PaymentMethodNotSupported"] = "PAYMENT_METHOD_NOT_SUPPORTED";
605
+ /** The given province cannot be found. */
606
+ CartErrorCode["ProvinceNotFound"] = "PROVINCE_NOT_FOUND";
607
+ /** Too many delivery addresses on Cart. */
608
+ CartErrorCode["TooManyDeliveryAddresses"] = "TOO_MANY_DELIVERY_ADDRESSES";
609
+ /** A general error occurred during address validation. */
610
+ CartErrorCode["UnspecifiedAddressError"] = "UNSPECIFIED_ADDRESS_ERROR";
611
+ /** Validation failed. */
612
+ CartErrorCode["ValidationCustom"] = "VALIDATION_CUSTOM";
613
+ /** The given zip code is unsupported. */
614
+ CartErrorCode["ZipCodeNotSupported"] = "ZIP_CODE_NOT_SUPPORTED";
615
+ })(CartErrorCode || (CartErrorCode = {}));
616
+ /** The code for the cart warning. */
617
+ var CartWarningCode;
618
+ (function (CartWarningCode) {
619
+ /** A delivery address with the same details already exists on this cart. */
620
+ CartWarningCode["DuplicateDeliveryAddress"] = "DUPLICATE_DELIVERY_ADDRESS";
621
+ /** The merchandise does not have enough stock. */
622
+ CartWarningCode["MerchandiseNotEnoughStock"] = "MERCHANDISE_NOT_ENOUGH_STOCK";
623
+ /** The merchandise is out of stock. */
624
+ CartWarningCode["MerchandiseOutOfStock"] = "MERCHANDISE_OUT_OF_STOCK";
625
+ /** Gift cards are not available as a payment method. */
626
+ CartWarningCode["PaymentsGiftCardsUnavailable"] = "PAYMENTS_GIFT_CARDS_UNAVAILABLE";
627
+ })(CartWarningCode || (CartWarningCode = {}));
628
+ /** The set of valid sort keys for the Collection query. */
629
+ var CollectionSortKeys;
630
+ (function (CollectionSortKeys) {
631
+ /** Sort by the `id` value. */
632
+ CollectionSortKeys["Id"] = "ID";
633
+ /**
634
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
635
+ * Don't use this sort key when no search query is specified.
636
+ *
637
+ */
638
+ CollectionSortKeys["Relevance"] = "RELEVANCE";
639
+ /** Sort by the `title` value. */
640
+ CollectionSortKeys["Title"] = "TITLE";
641
+ /** Sort by the `updated_at` value. */
642
+ CollectionSortKeys["UpdatedAt"] = "UPDATED_AT";
643
+ })(CollectionSortKeys || (CollectionSortKeys = {}));
644
+ /** The code of the error that occurred during a cart completion attempt. */
645
+ var CompletionErrorCode;
646
+ (function (CompletionErrorCode) {
647
+ CompletionErrorCode["Error"] = "ERROR";
648
+ CompletionErrorCode["InventoryReservationError"] = "INVENTORY_RESERVATION_ERROR";
649
+ CompletionErrorCode["PaymentAmountTooSmall"] = "PAYMENT_AMOUNT_TOO_SMALL";
650
+ CompletionErrorCode["PaymentCallIssuer"] = "PAYMENT_CALL_ISSUER";
651
+ CompletionErrorCode["PaymentCardDeclined"] = "PAYMENT_CARD_DECLINED";
652
+ CompletionErrorCode["PaymentError"] = "PAYMENT_ERROR";
653
+ CompletionErrorCode["PaymentGatewayNotEnabledError"] = "PAYMENT_GATEWAY_NOT_ENABLED_ERROR";
654
+ CompletionErrorCode["PaymentInsufficientFunds"] = "PAYMENT_INSUFFICIENT_FUNDS";
655
+ CompletionErrorCode["PaymentInvalidBillingAddress"] = "PAYMENT_INVALID_BILLING_ADDRESS";
656
+ CompletionErrorCode["PaymentInvalidCreditCard"] = "PAYMENT_INVALID_CREDIT_CARD";
657
+ CompletionErrorCode["PaymentInvalidCurrency"] = "PAYMENT_INVALID_CURRENCY";
658
+ CompletionErrorCode["PaymentInvalidPaymentMethod"] = "PAYMENT_INVALID_PAYMENT_METHOD";
659
+ CompletionErrorCode["PaymentTransientError"] = "PAYMENT_TRANSIENT_ERROR";
660
+ })(CompletionErrorCode || (CompletionErrorCode = {}));
661
+ /** The precision of the value returned by a count field. */
662
+ var CountPrecision;
663
+ (function (CountPrecision) {
664
+ /** The count is at least the value. A limit was reached. */
665
+ CountPrecision["AtLeast"] = "AT_LEAST";
666
+ /** The count is exactly the value. */
667
+ CountPrecision["Exact"] = "EXACT";
668
+ })(CountPrecision || (CountPrecision = {}));
669
+ /**
670
+ * The code designating a country/region, which generally follows ISO 3166-1 alpha-2 guidelines.
671
+ * If a territory doesn't have a country code value in the `CountryCode` enum, then it might be considered a subdivision
672
+ * of another country. For example, the territories associated with Spain are represented by the country code `ES`,
673
+ * and the territories associated with the United States of America are represented by the country code `US`.
674
+ *
675
+ */
676
+ var CountryCode;
677
+ (function (CountryCode) {
678
+ /** Ascension Island. */
679
+ CountryCode["Ac"] = "AC";
680
+ /** Andorra. */
681
+ CountryCode["Ad"] = "AD";
682
+ /** United Arab Emirates. */
683
+ CountryCode["Ae"] = "AE";
684
+ /** Afghanistan. */
685
+ CountryCode["Af"] = "AF";
686
+ /** Antigua & Barbuda. */
687
+ CountryCode["Ag"] = "AG";
688
+ /** Anguilla. */
689
+ CountryCode["Ai"] = "AI";
690
+ /** Albania. */
691
+ CountryCode["Al"] = "AL";
692
+ /** Armenia. */
693
+ CountryCode["Am"] = "AM";
694
+ /** Netherlands Antilles. */
695
+ CountryCode["An"] = "AN";
696
+ /** Angola. */
697
+ CountryCode["Ao"] = "AO";
698
+ /** Argentina. */
699
+ CountryCode["Ar"] = "AR";
700
+ /** Austria. */
701
+ CountryCode["At"] = "AT";
702
+ /** Australia. */
703
+ CountryCode["Au"] = "AU";
704
+ /** Aruba. */
705
+ CountryCode["Aw"] = "AW";
706
+ /** Åland Islands. */
707
+ CountryCode["Ax"] = "AX";
708
+ /** Azerbaijan. */
709
+ CountryCode["Az"] = "AZ";
710
+ /** Bosnia & Herzegovina. */
711
+ CountryCode["Ba"] = "BA";
712
+ /** Barbados. */
713
+ CountryCode["Bb"] = "BB";
714
+ /** Bangladesh. */
715
+ CountryCode["Bd"] = "BD";
716
+ /** Belgium. */
717
+ CountryCode["Be"] = "BE";
718
+ /** Burkina Faso. */
719
+ CountryCode["Bf"] = "BF";
720
+ /** Bulgaria. */
721
+ CountryCode["Bg"] = "BG";
722
+ /** Bahrain. */
723
+ CountryCode["Bh"] = "BH";
724
+ /** Burundi. */
725
+ CountryCode["Bi"] = "BI";
726
+ /** Benin. */
727
+ CountryCode["Bj"] = "BJ";
728
+ /** St. Barthélemy. */
729
+ CountryCode["Bl"] = "BL";
730
+ /** Bermuda. */
731
+ CountryCode["Bm"] = "BM";
732
+ /** Brunei. */
733
+ CountryCode["Bn"] = "BN";
734
+ /** Bolivia. */
735
+ CountryCode["Bo"] = "BO";
736
+ /** Caribbean Netherlands. */
737
+ CountryCode["Bq"] = "BQ";
738
+ /** Brazil. */
739
+ CountryCode["Br"] = "BR";
740
+ /** Bahamas. */
741
+ CountryCode["Bs"] = "BS";
742
+ /** Bhutan. */
743
+ CountryCode["Bt"] = "BT";
744
+ /** Bouvet Island. */
745
+ CountryCode["Bv"] = "BV";
746
+ /** Botswana. */
747
+ CountryCode["Bw"] = "BW";
748
+ /** Belarus. */
749
+ CountryCode["By"] = "BY";
750
+ /** Belize. */
751
+ CountryCode["Bz"] = "BZ";
752
+ /** Canada. */
753
+ CountryCode["Ca"] = "CA";
754
+ /** Cocos (Keeling) Islands. */
755
+ CountryCode["Cc"] = "CC";
756
+ /** Congo - Kinshasa. */
757
+ CountryCode["Cd"] = "CD";
758
+ /** Central African Republic. */
759
+ CountryCode["Cf"] = "CF";
760
+ /** Congo - Brazzaville. */
761
+ CountryCode["Cg"] = "CG";
762
+ /** Switzerland. */
763
+ CountryCode["Ch"] = "CH";
764
+ /** Côte d’Ivoire. */
765
+ CountryCode["Ci"] = "CI";
766
+ /** Cook Islands. */
767
+ CountryCode["Ck"] = "CK";
768
+ /** Chile. */
769
+ CountryCode["Cl"] = "CL";
770
+ /** Cameroon. */
771
+ CountryCode["Cm"] = "CM";
772
+ /** China. */
773
+ CountryCode["Cn"] = "CN";
774
+ /** Colombia. */
775
+ CountryCode["Co"] = "CO";
776
+ /** Costa Rica. */
777
+ CountryCode["Cr"] = "CR";
778
+ /** Cuba. */
779
+ CountryCode["Cu"] = "CU";
780
+ /** Cape Verde. */
781
+ CountryCode["Cv"] = "CV";
782
+ /** Curaçao. */
783
+ CountryCode["Cw"] = "CW";
784
+ /** Christmas Island. */
785
+ CountryCode["Cx"] = "CX";
786
+ /** Cyprus. */
787
+ CountryCode["Cy"] = "CY";
788
+ /** Czechia. */
789
+ CountryCode["Cz"] = "CZ";
790
+ /** Germany. */
791
+ CountryCode["De"] = "DE";
792
+ /** Djibouti. */
793
+ CountryCode["Dj"] = "DJ";
794
+ /** Denmark. */
795
+ CountryCode["Dk"] = "DK";
796
+ /** Dominica. */
797
+ CountryCode["Dm"] = "DM";
798
+ /** Dominican Republic. */
799
+ CountryCode["Do"] = "DO";
800
+ /** Algeria. */
801
+ CountryCode["Dz"] = "DZ";
802
+ /** Ecuador. */
803
+ CountryCode["Ec"] = "EC";
804
+ /** Estonia. */
805
+ CountryCode["Ee"] = "EE";
806
+ /** Egypt. */
807
+ CountryCode["Eg"] = "EG";
808
+ /** Western Sahara. */
809
+ CountryCode["Eh"] = "EH";
810
+ /** Eritrea. */
811
+ CountryCode["Er"] = "ER";
812
+ /** Spain. */
813
+ CountryCode["Es"] = "ES";
814
+ /** Ethiopia. */
815
+ CountryCode["Et"] = "ET";
816
+ /** Finland. */
817
+ CountryCode["Fi"] = "FI";
818
+ /** Fiji. */
819
+ CountryCode["Fj"] = "FJ";
820
+ /** Falkland Islands. */
821
+ CountryCode["Fk"] = "FK";
822
+ /** Faroe Islands. */
823
+ CountryCode["Fo"] = "FO";
824
+ /** France. */
825
+ CountryCode["Fr"] = "FR";
826
+ /** Gabon. */
827
+ CountryCode["Ga"] = "GA";
828
+ /** United Kingdom. */
829
+ CountryCode["Gb"] = "GB";
830
+ /** Grenada. */
831
+ CountryCode["Gd"] = "GD";
832
+ /** Georgia. */
833
+ CountryCode["Ge"] = "GE";
834
+ /** French Guiana. */
835
+ CountryCode["Gf"] = "GF";
836
+ /** Guernsey. */
837
+ CountryCode["Gg"] = "GG";
838
+ /** Ghana. */
839
+ CountryCode["Gh"] = "GH";
840
+ /** Gibraltar. */
841
+ CountryCode["Gi"] = "GI";
842
+ /** Greenland. */
843
+ CountryCode["Gl"] = "GL";
844
+ /** Gambia. */
845
+ CountryCode["Gm"] = "GM";
846
+ /** Guinea. */
847
+ CountryCode["Gn"] = "GN";
848
+ /** Guadeloupe. */
849
+ CountryCode["Gp"] = "GP";
850
+ /** Equatorial Guinea. */
851
+ CountryCode["Gq"] = "GQ";
852
+ /** Greece. */
853
+ CountryCode["Gr"] = "GR";
854
+ /** South Georgia & South Sandwich Islands. */
855
+ CountryCode["Gs"] = "GS";
856
+ /** Guatemala. */
857
+ CountryCode["Gt"] = "GT";
858
+ /** Guinea-Bissau. */
859
+ CountryCode["Gw"] = "GW";
860
+ /** Guyana. */
861
+ CountryCode["Gy"] = "GY";
862
+ /** Hong Kong SAR. */
863
+ CountryCode["Hk"] = "HK";
864
+ /** Heard & McDonald Islands. */
865
+ CountryCode["Hm"] = "HM";
866
+ /** Honduras. */
867
+ CountryCode["Hn"] = "HN";
868
+ /** Croatia. */
869
+ CountryCode["Hr"] = "HR";
870
+ /** Haiti. */
871
+ CountryCode["Ht"] = "HT";
872
+ /** Hungary. */
873
+ CountryCode["Hu"] = "HU";
874
+ /** Indonesia. */
875
+ CountryCode["Id"] = "ID";
876
+ /** Ireland. */
877
+ CountryCode["Ie"] = "IE";
878
+ /** Israel. */
879
+ CountryCode["Il"] = "IL";
880
+ /** Isle of Man. */
881
+ CountryCode["Im"] = "IM";
882
+ /** India. */
883
+ CountryCode["In"] = "IN";
884
+ /** British Indian Ocean Territory. */
885
+ CountryCode["Io"] = "IO";
886
+ /** Iraq. */
887
+ CountryCode["Iq"] = "IQ";
888
+ /** Iran. */
889
+ CountryCode["Ir"] = "IR";
890
+ /** Iceland. */
891
+ CountryCode["Is"] = "IS";
892
+ /** Italy. */
893
+ CountryCode["It"] = "IT";
894
+ /** Jersey. */
895
+ CountryCode["Je"] = "JE";
896
+ /** Jamaica. */
897
+ CountryCode["Jm"] = "JM";
898
+ /** Jordan. */
899
+ CountryCode["Jo"] = "JO";
900
+ /** Japan. */
901
+ CountryCode["Jp"] = "JP";
902
+ /** Kenya. */
903
+ CountryCode["Ke"] = "KE";
904
+ /** Kyrgyzstan. */
905
+ CountryCode["Kg"] = "KG";
906
+ /** Cambodia. */
907
+ CountryCode["Kh"] = "KH";
908
+ /** Kiribati. */
909
+ CountryCode["Ki"] = "KI";
910
+ /** Comoros. */
911
+ CountryCode["Km"] = "KM";
912
+ /** St. Kitts & Nevis. */
913
+ CountryCode["Kn"] = "KN";
914
+ /** North Korea. */
915
+ CountryCode["Kp"] = "KP";
916
+ /** South Korea. */
917
+ CountryCode["Kr"] = "KR";
918
+ /** Kuwait. */
919
+ CountryCode["Kw"] = "KW";
920
+ /** Cayman Islands. */
921
+ CountryCode["Ky"] = "KY";
922
+ /** Kazakhstan. */
923
+ CountryCode["Kz"] = "KZ";
924
+ /** Laos. */
925
+ CountryCode["La"] = "LA";
926
+ /** Lebanon. */
927
+ CountryCode["Lb"] = "LB";
928
+ /** St. Lucia. */
929
+ CountryCode["Lc"] = "LC";
930
+ /** Liechtenstein. */
931
+ CountryCode["Li"] = "LI";
932
+ /** Sri Lanka. */
933
+ CountryCode["Lk"] = "LK";
934
+ /** Liberia. */
935
+ CountryCode["Lr"] = "LR";
936
+ /** Lesotho. */
937
+ CountryCode["Ls"] = "LS";
938
+ /** Lithuania. */
939
+ CountryCode["Lt"] = "LT";
940
+ /** Luxembourg. */
941
+ CountryCode["Lu"] = "LU";
942
+ /** Latvia. */
943
+ CountryCode["Lv"] = "LV";
944
+ /** Libya. */
945
+ CountryCode["Ly"] = "LY";
946
+ /** Morocco. */
947
+ CountryCode["Ma"] = "MA";
948
+ /** Monaco. */
949
+ CountryCode["Mc"] = "MC";
950
+ /** Moldova. */
951
+ CountryCode["Md"] = "MD";
952
+ /** Montenegro. */
953
+ CountryCode["Me"] = "ME";
954
+ /** St. Martin. */
955
+ CountryCode["Mf"] = "MF";
956
+ /** Madagascar. */
957
+ CountryCode["Mg"] = "MG";
958
+ /** North Macedonia. */
959
+ CountryCode["Mk"] = "MK";
960
+ /** Mali. */
961
+ CountryCode["Ml"] = "ML";
962
+ /** Myanmar (Burma). */
963
+ CountryCode["Mm"] = "MM";
964
+ /** Mongolia. */
965
+ CountryCode["Mn"] = "MN";
966
+ /** Macao SAR. */
967
+ CountryCode["Mo"] = "MO";
968
+ /** Martinique. */
969
+ CountryCode["Mq"] = "MQ";
970
+ /** Mauritania. */
971
+ CountryCode["Mr"] = "MR";
972
+ /** Montserrat. */
973
+ CountryCode["Ms"] = "MS";
974
+ /** Malta. */
975
+ CountryCode["Mt"] = "MT";
976
+ /** Mauritius. */
977
+ CountryCode["Mu"] = "MU";
978
+ /** Maldives. */
979
+ CountryCode["Mv"] = "MV";
980
+ /** Malawi. */
981
+ CountryCode["Mw"] = "MW";
982
+ /** Mexico. */
983
+ CountryCode["Mx"] = "MX";
984
+ /** Malaysia. */
985
+ CountryCode["My"] = "MY";
986
+ /** Mozambique. */
987
+ CountryCode["Mz"] = "MZ";
988
+ /** Namibia. */
989
+ CountryCode["Na"] = "NA";
990
+ /** New Caledonia. */
991
+ CountryCode["Nc"] = "NC";
992
+ /** Niger. */
993
+ CountryCode["Ne"] = "NE";
994
+ /** Norfolk Island. */
995
+ CountryCode["Nf"] = "NF";
996
+ /** Nigeria. */
997
+ CountryCode["Ng"] = "NG";
998
+ /** Nicaragua. */
999
+ CountryCode["Ni"] = "NI";
1000
+ /** Netherlands. */
1001
+ CountryCode["Nl"] = "NL";
1002
+ /** Norway. */
1003
+ CountryCode["No"] = "NO";
1004
+ /** Nepal. */
1005
+ CountryCode["Np"] = "NP";
1006
+ /** Nauru. */
1007
+ CountryCode["Nr"] = "NR";
1008
+ /** Niue. */
1009
+ CountryCode["Nu"] = "NU";
1010
+ /** New Zealand. */
1011
+ CountryCode["Nz"] = "NZ";
1012
+ /** Oman. */
1013
+ CountryCode["Om"] = "OM";
1014
+ /** Panama. */
1015
+ CountryCode["Pa"] = "PA";
1016
+ /** Peru. */
1017
+ CountryCode["Pe"] = "PE";
1018
+ /** French Polynesia. */
1019
+ CountryCode["Pf"] = "PF";
1020
+ /** Papua New Guinea. */
1021
+ CountryCode["Pg"] = "PG";
1022
+ /** Philippines. */
1023
+ CountryCode["Ph"] = "PH";
1024
+ /** Pakistan. */
1025
+ CountryCode["Pk"] = "PK";
1026
+ /** Poland. */
1027
+ CountryCode["Pl"] = "PL";
1028
+ /** St. Pierre & Miquelon. */
1029
+ CountryCode["Pm"] = "PM";
1030
+ /** Pitcairn Islands. */
1031
+ CountryCode["Pn"] = "PN";
1032
+ /** Palestinian Territories. */
1033
+ CountryCode["Ps"] = "PS";
1034
+ /** Portugal. */
1035
+ CountryCode["Pt"] = "PT";
1036
+ /** Paraguay. */
1037
+ CountryCode["Py"] = "PY";
1038
+ /** Qatar. */
1039
+ CountryCode["Qa"] = "QA";
1040
+ /** Réunion. */
1041
+ CountryCode["Re"] = "RE";
1042
+ /** Romania. */
1043
+ CountryCode["Ro"] = "RO";
1044
+ /** Serbia. */
1045
+ CountryCode["Rs"] = "RS";
1046
+ /** Russia. */
1047
+ CountryCode["Ru"] = "RU";
1048
+ /** Rwanda. */
1049
+ CountryCode["Rw"] = "RW";
1050
+ /** Saudi Arabia. */
1051
+ CountryCode["Sa"] = "SA";
1052
+ /** Solomon Islands. */
1053
+ CountryCode["Sb"] = "SB";
1054
+ /** Seychelles. */
1055
+ CountryCode["Sc"] = "SC";
1056
+ /** Sudan. */
1057
+ CountryCode["Sd"] = "SD";
1058
+ /** Sweden. */
1059
+ CountryCode["Se"] = "SE";
1060
+ /** Singapore. */
1061
+ CountryCode["Sg"] = "SG";
1062
+ /** St. Helena. */
1063
+ CountryCode["Sh"] = "SH";
1064
+ /** Slovenia. */
1065
+ CountryCode["Si"] = "SI";
1066
+ /** Svalbard & Jan Mayen. */
1067
+ CountryCode["Sj"] = "SJ";
1068
+ /** Slovakia. */
1069
+ CountryCode["Sk"] = "SK";
1070
+ /** Sierra Leone. */
1071
+ CountryCode["Sl"] = "SL";
1072
+ /** San Marino. */
1073
+ CountryCode["Sm"] = "SM";
1074
+ /** Senegal. */
1075
+ CountryCode["Sn"] = "SN";
1076
+ /** Somalia. */
1077
+ CountryCode["So"] = "SO";
1078
+ /** Suriname. */
1079
+ CountryCode["Sr"] = "SR";
1080
+ /** South Sudan. */
1081
+ CountryCode["Ss"] = "SS";
1082
+ /** São Tomé & Príncipe. */
1083
+ CountryCode["St"] = "ST";
1084
+ /** El Salvador. */
1085
+ CountryCode["Sv"] = "SV";
1086
+ /** Sint Maarten. */
1087
+ CountryCode["Sx"] = "SX";
1088
+ /** Syria. */
1089
+ CountryCode["Sy"] = "SY";
1090
+ /** Eswatini. */
1091
+ CountryCode["Sz"] = "SZ";
1092
+ /** Tristan da Cunha. */
1093
+ CountryCode["Ta"] = "TA";
1094
+ /** Turks & Caicos Islands. */
1095
+ CountryCode["Tc"] = "TC";
1096
+ /** Chad. */
1097
+ CountryCode["Td"] = "TD";
1098
+ /** French Southern Territories. */
1099
+ CountryCode["Tf"] = "TF";
1100
+ /** Togo. */
1101
+ CountryCode["Tg"] = "TG";
1102
+ /** Thailand. */
1103
+ CountryCode["Th"] = "TH";
1104
+ /** Tajikistan. */
1105
+ CountryCode["Tj"] = "TJ";
1106
+ /** Tokelau. */
1107
+ CountryCode["Tk"] = "TK";
1108
+ /** Timor-Leste. */
1109
+ CountryCode["Tl"] = "TL";
1110
+ /** Turkmenistan. */
1111
+ CountryCode["Tm"] = "TM";
1112
+ /** Tunisia. */
1113
+ CountryCode["Tn"] = "TN";
1114
+ /** Tonga. */
1115
+ CountryCode["To"] = "TO";
1116
+ /** Türkiye. */
1117
+ CountryCode["Tr"] = "TR";
1118
+ /** Trinidad & Tobago. */
1119
+ CountryCode["Tt"] = "TT";
1120
+ /** Tuvalu. */
1121
+ CountryCode["Tv"] = "TV";
1122
+ /** Taiwan. */
1123
+ CountryCode["Tw"] = "TW";
1124
+ /** Tanzania. */
1125
+ CountryCode["Tz"] = "TZ";
1126
+ /** Ukraine. */
1127
+ CountryCode["Ua"] = "UA";
1128
+ /** Uganda. */
1129
+ CountryCode["Ug"] = "UG";
1130
+ /** U.S. Outlying Islands. */
1131
+ CountryCode["Um"] = "UM";
1132
+ /** United States. */
1133
+ CountryCode["Us"] = "US";
1134
+ /** Uruguay. */
1135
+ CountryCode["Uy"] = "UY";
1136
+ /** Uzbekistan. */
1137
+ CountryCode["Uz"] = "UZ";
1138
+ /** Vatican City. */
1139
+ CountryCode["Va"] = "VA";
1140
+ /** St. Vincent & Grenadines. */
1141
+ CountryCode["Vc"] = "VC";
1142
+ /** Venezuela. */
1143
+ CountryCode["Ve"] = "VE";
1144
+ /** British Virgin Islands. */
1145
+ CountryCode["Vg"] = "VG";
1146
+ /** Vietnam. */
1147
+ CountryCode["Vn"] = "VN";
1148
+ /** Vanuatu. */
1149
+ CountryCode["Vu"] = "VU";
1150
+ /** Wallis & Futuna. */
1151
+ CountryCode["Wf"] = "WF";
1152
+ /** Samoa. */
1153
+ CountryCode["Ws"] = "WS";
1154
+ /** Kosovo. */
1155
+ CountryCode["Xk"] = "XK";
1156
+ /** Yemen. */
1157
+ CountryCode["Ye"] = "YE";
1158
+ /** Mayotte. */
1159
+ CountryCode["Yt"] = "YT";
1160
+ /** South Africa. */
1161
+ CountryCode["Za"] = "ZA";
1162
+ /** Zambia. */
1163
+ CountryCode["Zm"] = "ZM";
1164
+ /** Zimbabwe. */
1165
+ CountryCode["Zw"] = "ZW";
1166
+ /** Unknown Region. */
1167
+ CountryCode["Zz"] = "ZZ";
1168
+ })(CountryCode || (CountryCode = {}));
1169
+ /** The part of the image that should remain after cropping. */
1170
+ var CropRegion;
1171
+ (function (CropRegion) {
1172
+ /** Keep the bottom of the image. */
1173
+ CropRegion["Bottom"] = "BOTTOM";
1174
+ /** Keep the center of the image. */
1175
+ CropRegion["Center"] = "CENTER";
1176
+ /** Keep the left of the image. */
1177
+ CropRegion["Left"] = "LEFT";
1178
+ /** Keep the right of the image. */
1179
+ CropRegion["Right"] = "RIGHT";
1180
+ /** Keep the top of the image. */
1181
+ CropRegion["Top"] = "TOP";
1182
+ })(CropRegion || (CropRegion = {}));
1183
+ /**
1184
+ * The three-letter currency codes that represent the world currencies used in
1185
+ * stores. These include standard ISO 4217 codes, legacy codes,
1186
+ * and non-standard codes.
1187
+ *
1188
+ */
1189
+ var CurrencyCode;
1190
+ (function (CurrencyCode) {
1191
+ /** United Arab Emirates Dirham (AED). */
1192
+ CurrencyCode["Aed"] = "AED";
1193
+ /** Afghan Afghani (AFN). */
1194
+ CurrencyCode["Afn"] = "AFN";
1195
+ /** Albanian Lek (ALL). */
1196
+ CurrencyCode["All"] = "ALL";
1197
+ /** Armenian Dram (AMD). */
1198
+ CurrencyCode["Amd"] = "AMD";
1199
+ /** Netherlands Antillean Guilder. */
1200
+ CurrencyCode["Ang"] = "ANG";
1201
+ /** Angolan Kwanza (AOA). */
1202
+ CurrencyCode["Aoa"] = "AOA";
1203
+ /** Argentine Pesos (ARS). */
1204
+ CurrencyCode["Ars"] = "ARS";
1205
+ /** Australian Dollars (AUD). */
1206
+ CurrencyCode["Aud"] = "AUD";
1207
+ /** Aruban Florin (AWG). */
1208
+ CurrencyCode["Awg"] = "AWG";
1209
+ /** Azerbaijani Manat (AZN). */
1210
+ CurrencyCode["Azn"] = "AZN";
1211
+ /** Bosnia and Herzegovina Convertible Mark (BAM). */
1212
+ CurrencyCode["Bam"] = "BAM";
1213
+ /** Barbadian Dollar (BBD). */
1214
+ CurrencyCode["Bbd"] = "BBD";
1215
+ /** Bangladesh Taka (BDT). */
1216
+ CurrencyCode["Bdt"] = "BDT";
1217
+ /** Bulgarian Lev (BGN). */
1218
+ CurrencyCode["Bgn"] = "BGN";
1219
+ /** Bahraini Dinar (BHD). */
1220
+ CurrencyCode["Bhd"] = "BHD";
1221
+ /** Burundian Franc (BIF). */
1222
+ CurrencyCode["Bif"] = "BIF";
1223
+ /** Bermudian Dollar (BMD). */
1224
+ CurrencyCode["Bmd"] = "BMD";
1225
+ /** Brunei Dollar (BND). */
1226
+ CurrencyCode["Bnd"] = "BND";
1227
+ /** Bolivian Boliviano (BOB). */
1228
+ CurrencyCode["Bob"] = "BOB";
1229
+ /** Brazilian Real (BRL). */
1230
+ CurrencyCode["Brl"] = "BRL";
1231
+ /** Bahamian Dollar (BSD). */
1232
+ CurrencyCode["Bsd"] = "BSD";
1233
+ /** Bhutanese Ngultrum (BTN). */
1234
+ CurrencyCode["Btn"] = "BTN";
1235
+ /** Botswana Pula (BWP). */
1236
+ CurrencyCode["Bwp"] = "BWP";
1237
+ /** Belarusian Ruble (BYN). */
1238
+ CurrencyCode["Byn"] = "BYN";
1239
+ /**
1240
+ * Belarusian Ruble (BYR).
1241
+ * @deprecated `BYR` is deprecated. Use `BYN` available from version `2021-01` onwards instead.
1242
+ */
1243
+ CurrencyCode["Byr"] = "BYR";
1244
+ /** Belize Dollar (BZD). */
1245
+ CurrencyCode["Bzd"] = "BZD";
1246
+ /** Canadian Dollars (CAD). */
1247
+ CurrencyCode["Cad"] = "CAD";
1248
+ /** Congolese franc (CDF). */
1249
+ CurrencyCode["Cdf"] = "CDF";
1250
+ /** Swiss Francs (CHF). */
1251
+ CurrencyCode["Chf"] = "CHF";
1252
+ /** Chilean Peso (CLP). */
1253
+ CurrencyCode["Clp"] = "CLP";
1254
+ /** Chinese Yuan Renminbi (CNY). */
1255
+ CurrencyCode["Cny"] = "CNY";
1256
+ /** Colombian Peso (COP). */
1257
+ CurrencyCode["Cop"] = "COP";
1258
+ /** Costa Rican Colones (CRC). */
1259
+ CurrencyCode["Crc"] = "CRC";
1260
+ /** Cape Verdean escudo (CVE). */
1261
+ CurrencyCode["Cve"] = "CVE";
1262
+ /** Czech Koruny (CZK). */
1263
+ CurrencyCode["Czk"] = "CZK";
1264
+ /** Djiboutian Franc (DJF). */
1265
+ CurrencyCode["Djf"] = "DJF";
1266
+ /** Danish Kroner (DKK). */
1267
+ CurrencyCode["Dkk"] = "DKK";
1268
+ /** Dominican Peso (DOP). */
1269
+ CurrencyCode["Dop"] = "DOP";
1270
+ /** Algerian Dinar (DZD). */
1271
+ CurrencyCode["Dzd"] = "DZD";
1272
+ /** Egyptian Pound (EGP). */
1273
+ CurrencyCode["Egp"] = "EGP";
1274
+ /** Eritrean Nakfa (ERN). */
1275
+ CurrencyCode["Ern"] = "ERN";
1276
+ /** Ethiopian Birr (ETB). */
1277
+ CurrencyCode["Etb"] = "ETB";
1278
+ /** Euro (EUR). */
1279
+ CurrencyCode["Eur"] = "EUR";
1280
+ /** Fijian Dollars (FJD). */
1281
+ CurrencyCode["Fjd"] = "FJD";
1282
+ /** Falkland Islands Pounds (FKP). */
1283
+ CurrencyCode["Fkp"] = "FKP";
1284
+ /** United Kingdom Pounds (GBP). */
1285
+ CurrencyCode["Gbp"] = "GBP";
1286
+ /** Georgian Lari (GEL). */
1287
+ CurrencyCode["Gel"] = "GEL";
1288
+ /** Ghanaian Cedi (GHS). */
1289
+ CurrencyCode["Ghs"] = "GHS";
1290
+ /** Gibraltar Pounds (GIP). */
1291
+ CurrencyCode["Gip"] = "GIP";
1292
+ /** Gambian Dalasi (GMD). */
1293
+ CurrencyCode["Gmd"] = "GMD";
1294
+ /** Guinean Franc (GNF). */
1295
+ CurrencyCode["Gnf"] = "GNF";
1296
+ /** Guatemalan Quetzal (GTQ). */
1297
+ CurrencyCode["Gtq"] = "GTQ";
1298
+ /** Guyanese Dollar (GYD). */
1299
+ CurrencyCode["Gyd"] = "GYD";
1300
+ /** Hong Kong Dollars (HKD). */
1301
+ CurrencyCode["Hkd"] = "HKD";
1302
+ /** Honduran Lempira (HNL). */
1303
+ CurrencyCode["Hnl"] = "HNL";
1304
+ /** Croatian Kuna (HRK). */
1305
+ CurrencyCode["Hrk"] = "HRK";
1306
+ /** Haitian Gourde (HTG). */
1307
+ CurrencyCode["Htg"] = "HTG";
1308
+ /** Hungarian Forint (HUF). */
1309
+ CurrencyCode["Huf"] = "HUF";
1310
+ /** Indonesian Rupiah (IDR). */
1311
+ CurrencyCode["Idr"] = "IDR";
1312
+ /** Israeli New Shekel (NIS). */
1313
+ CurrencyCode["Ils"] = "ILS";
1314
+ /** Indian Rupees (INR). */
1315
+ CurrencyCode["Inr"] = "INR";
1316
+ /** Iraqi Dinar (IQD). */
1317
+ CurrencyCode["Iqd"] = "IQD";
1318
+ /** Iranian Rial (IRR). */
1319
+ CurrencyCode["Irr"] = "IRR";
1320
+ /** Icelandic Kronur (ISK). */
1321
+ CurrencyCode["Isk"] = "ISK";
1322
+ /** Jersey Pound. */
1323
+ CurrencyCode["Jep"] = "JEP";
1324
+ /** Jamaican Dollars (JMD). */
1325
+ CurrencyCode["Jmd"] = "JMD";
1326
+ /** Jordanian Dinar (JOD). */
1327
+ CurrencyCode["Jod"] = "JOD";
1328
+ /** Japanese Yen (JPY). */
1329
+ CurrencyCode["Jpy"] = "JPY";
1330
+ /** Kenyan Shilling (KES). */
1331
+ CurrencyCode["Kes"] = "KES";
1332
+ /** Kyrgyzstani Som (KGS). */
1333
+ CurrencyCode["Kgs"] = "KGS";
1334
+ /** Cambodian Riel. */
1335
+ CurrencyCode["Khr"] = "KHR";
1336
+ /** Kiribati Dollar (KID). */
1337
+ CurrencyCode["Kid"] = "KID";
1338
+ /** Comorian Franc (KMF). */
1339
+ CurrencyCode["Kmf"] = "KMF";
1340
+ /** South Korean Won (KRW). */
1341
+ CurrencyCode["Krw"] = "KRW";
1342
+ /** Kuwaiti Dinar (KWD). */
1343
+ CurrencyCode["Kwd"] = "KWD";
1344
+ /** Cayman Dollars (KYD). */
1345
+ CurrencyCode["Kyd"] = "KYD";
1346
+ /** Kazakhstani Tenge (KZT). */
1347
+ CurrencyCode["Kzt"] = "KZT";
1348
+ /** Laotian Kip (LAK). */
1349
+ CurrencyCode["Lak"] = "LAK";
1350
+ /** Lebanese Pounds (LBP). */
1351
+ CurrencyCode["Lbp"] = "LBP";
1352
+ /** Sri Lankan Rupees (LKR). */
1353
+ CurrencyCode["Lkr"] = "LKR";
1354
+ /** Liberian Dollar (LRD). */
1355
+ CurrencyCode["Lrd"] = "LRD";
1356
+ /** Lesotho Loti (LSL). */
1357
+ CurrencyCode["Lsl"] = "LSL";
1358
+ /** Lithuanian Litai (LTL). */
1359
+ CurrencyCode["Ltl"] = "LTL";
1360
+ /** Latvian Lati (LVL). */
1361
+ CurrencyCode["Lvl"] = "LVL";
1362
+ /** Libyan Dinar (LYD). */
1363
+ CurrencyCode["Lyd"] = "LYD";
1364
+ /** Moroccan Dirham. */
1365
+ CurrencyCode["Mad"] = "MAD";
1366
+ /** Moldovan Leu (MDL). */
1367
+ CurrencyCode["Mdl"] = "MDL";
1368
+ /** Malagasy Ariary (MGA). */
1369
+ CurrencyCode["Mga"] = "MGA";
1370
+ /** Macedonia Denar (MKD). */
1371
+ CurrencyCode["Mkd"] = "MKD";
1372
+ /** Burmese Kyat (MMK). */
1373
+ CurrencyCode["Mmk"] = "MMK";
1374
+ /** Mongolian Tugrik. */
1375
+ CurrencyCode["Mnt"] = "MNT";
1376
+ /** Macanese Pataca (MOP). */
1377
+ CurrencyCode["Mop"] = "MOP";
1378
+ /** Mauritanian Ouguiya (MRU). */
1379
+ CurrencyCode["Mru"] = "MRU";
1380
+ /** Mauritian Rupee (MUR). */
1381
+ CurrencyCode["Mur"] = "MUR";
1382
+ /** Maldivian Rufiyaa (MVR). */
1383
+ CurrencyCode["Mvr"] = "MVR";
1384
+ /** Malawian Kwacha (MWK). */
1385
+ CurrencyCode["Mwk"] = "MWK";
1386
+ /** Mexican Pesos (MXN). */
1387
+ CurrencyCode["Mxn"] = "MXN";
1388
+ /** Malaysian Ringgits (MYR). */
1389
+ CurrencyCode["Myr"] = "MYR";
1390
+ /** Mozambican Metical. */
1391
+ CurrencyCode["Mzn"] = "MZN";
1392
+ /** Namibian Dollar. */
1393
+ CurrencyCode["Nad"] = "NAD";
1394
+ /** Nigerian Naira (NGN). */
1395
+ CurrencyCode["Ngn"] = "NGN";
1396
+ /** Nicaraguan Córdoba (NIO). */
1397
+ CurrencyCode["Nio"] = "NIO";
1398
+ /** Norwegian Kroner (NOK). */
1399
+ CurrencyCode["Nok"] = "NOK";
1400
+ /** Nepalese Rupee (NPR). */
1401
+ CurrencyCode["Npr"] = "NPR";
1402
+ /** New Zealand Dollars (NZD). */
1403
+ CurrencyCode["Nzd"] = "NZD";
1404
+ /** Omani Rial (OMR). */
1405
+ CurrencyCode["Omr"] = "OMR";
1406
+ /** Panamian Balboa (PAB). */
1407
+ CurrencyCode["Pab"] = "PAB";
1408
+ /** Peruvian Nuevo Sol (PEN). */
1409
+ CurrencyCode["Pen"] = "PEN";
1410
+ /** Papua New Guinean Kina (PGK). */
1411
+ CurrencyCode["Pgk"] = "PGK";
1412
+ /** Philippine Peso (PHP). */
1413
+ CurrencyCode["Php"] = "PHP";
1414
+ /** Pakistani Rupee (PKR). */
1415
+ CurrencyCode["Pkr"] = "PKR";
1416
+ /** Polish Zlotych (PLN). */
1417
+ CurrencyCode["Pln"] = "PLN";
1418
+ /** Paraguayan Guarani (PYG). */
1419
+ CurrencyCode["Pyg"] = "PYG";
1420
+ /** Qatari Rial (QAR). */
1421
+ CurrencyCode["Qar"] = "QAR";
1422
+ /** Romanian Lei (RON). */
1423
+ CurrencyCode["Ron"] = "RON";
1424
+ /** Serbian dinar (RSD). */
1425
+ CurrencyCode["Rsd"] = "RSD";
1426
+ /** Russian Rubles (RUB). */
1427
+ CurrencyCode["Rub"] = "RUB";
1428
+ /** Rwandan Franc (RWF). */
1429
+ CurrencyCode["Rwf"] = "RWF";
1430
+ /** Saudi Riyal (SAR). */
1431
+ CurrencyCode["Sar"] = "SAR";
1432
+ /** Solomon Islands Dollar (SBD). */
1433
+ CurrencyCode["Sbd"] = "SBD";
1434
+ /** Seychellois Rupee (SCR). */
1435
+ CurrencyCode["Scr"] = "SCR";
1436
+ /** Sudanese Pound (SDG). */
1437
+ CurrencyCode["Sdg"] = "SDG";
1438
+ /** Swedish Kronor (SEK). */
1439
+ CurrencyCode["Sek"] = "SEK";
1440
+ /** Singapore Dollars (SGD). */
1441
+ CurrencyCode["Sgd"] = "SGD";
1442
+ /** Saint Helena Pounds (SHP). */
1443
+ CurrencyCode["Shp"] = "SHP";
1444
+ /** Sierra Leonean Leone (SLL). */
1445
+ CurrencyCode["Sll"] = "SLL";
1446
+ /** Somali Shilling (SOS). */
1447
+ CurrencyCode["Sos"] = "SOS";
1448
+ /** Surinamese Dollar (SRD). */
1449
+ CurrencyCode["Srd"] = "SRD";
1450
+ /** South Sudanese Pound (SSP). */
1451
+ CurrencyCode["Ssp"] = "SSP";
1452
+ /**
1453
+ * Sao Tome And Principe Dobra (STD).
1454
+ * @deprecated `STD` is deprecated. Use `STN` available from version `2022-07` onwards instead.
1455
+ */
1456
+ CurrencyCode["Std"] = "STD";
1457
+ /** Sao Tome And Principe Dobra (STN). */
1458
+ CurrencyCode["Stn"] = "STN";
1459
+ /** Syrian Pound (SYP). */
1460
+ CurrencyCode["Syp"] = "SYP";
1461
+ /** Swazi Lilangeni (SZL). */
1462
+ CurrencyCode["Szl"] = "SZL";
1463
+ /** Thai baht (THB). */
1464
+ CurrencyCode["Thb"] = "THB";
1465
+ /** Tajikistani Somoni (TJS). */
1466
+ CurrencyCode["Tjs"] = "TJS";
1467
+ /** Turkmenistani Manat (TMT). */
1468
+ CurrencyCode["Tmt"] = "TMT";
1469
+ /** Tunisian Dinar (TND). */
1470
+ CurrencyCode["Tnd"] = "TND";
1471
+ /** Tongan Pa'anga (TOP). */
1472
+ CurrencyCode["Top"] = "TOP";
1473
+ /** Turkish Lira (TRY). */
1474
+ CurrencyCode["Try"] = "TRY";
1475
+ /** Trinidad and Tobago Dollars (TTD). */
1476
+ CurrencyCode["Ttd"] = "TTD";
1477
+ /** Taiwan Dollars (TWD). */
1478
+ CurrencyCode["Twd"] = "TWD";
1479
+ /** Tanzanian Shilling (TZS). */
1480
+ CurrencyCode["Tzs"] = "TZS";
1481
+ /** Ukrainian Hryvnia (UAH). */
1482
+ CurrencyCode["Uah"] = "UAH";
1483
+ /** Ugandan Shilling (UGX). */
1484
+ CurrencyCode["Ugx"] = "UGX";
1485
+ /** United States Dollars (USD). */
1486
+ CurrencyCode["Usd"] = "USD";
1487
+ /** Uruguayan Pesos (UYU). */
1488
+ CurrencyCode["Uyu"] = "UYU";
1489
+ /** Uzbekistan som (UZS). */
1490
+ CurrencyCode["Uzs"] = "UZS";
1491
+ /** Venezuelan Bolivares (VED). */
1492
+ CurrencyCode["Ved"] = "VED";
1493
+ /**
1494
+ * Venezuelan Bolivares (VEF).
1495
+ * @deprecated `VEF` is deprecated. Use `VES` available from version `2020-10` onwards instead.
1496
+ */
1497
+ CurrencyCode["Vef"] = "VEF";
1498
+ /** Venezuelan Bolivares Soberanos (VES). */
1499
+ CurrencyCode["Ves"] = "VES";
1500
+ /** Vietnamese đồng (VND). */
1501
+ CurrencyCode["Vnd"] = "VND";
1502
+ /** Vanuatu Vatu (VUV). */
1503
+ CurrencyCode["Vuv"] = "VUV";
1504
+ /** Samoan Tala (WST). */
1505
+ CurrencyCode["Wst"] = "WST";
1506
+ /** Central African CFA Franc (XAF). */
1507
+ CurrencyCode["Xaf"] = "XAF";
1508
+ /** East Caribbean Dollar (XCD). */
1509
+ CurrencyCode["Xcd"] = "XCD";
1510
+ /** West African CFA franc (XOF). */
1511
+ CurrencyCode["Xof"] = "XOF";
1512
+ /** CFP Franc (XPF). */
1513
+ CurrencyCode["Xpf"] = "XPF";
1514
+ /** Unrecognized currency. */
1515
+ CurrencyCode["Xxx"] = "XXX";
1516
+ /** Yemeni Rial (YER). */
1517
+ CurrencyCode["Yer"] = "YER";
1518
+ /** South African Rand (ZAR). */
1519
+ CurrencyCode["Zar"] = "ZAR";
1520
+ /** Zambian Kwacha (ZMW). */
1521
+ CurrencyCode["Zmw"] = "ZMW";
1522
+ })(CurrencyCode || (CurrencyCode = {}));
1523
+ /** Possible error codes that can be returned by `CustomerUserError`. */
1524
+ var CustomerErrorCode;
1525
+ (function (CustomerErrorCode) {
1526
+ /** Customer already enabled. */
1527
+ CustomerErrorCode["AlreadyEnabled"] = "ALREADY_ENABLED";
1528
+ /** Input email contains an invalid domain name. */
1529
+ CustomerErrorCode["BadDomain"] = "BAD_DOMAIN";
1530
+ /** The input value is blank. */
1531
+ CustomerErrorCode["Blank"] = "BLANK";
1532
+ /** Input contains HTML tags. */
1533
+ CustomerErrorCode["ContainsHtmlTags"] = "CONTAINS_HTML_TAGS";
1534
+ /** Input contains URL. */
1535
+ CustomerErrorCode["ContainsUrl"] = "CONTAINS_URL";
1536
+ /** Customer is disabled. */
1537
+ CustomerErrorCode["CustomerDisabled"] = "CUSTOMER_DISABLED";
1538
+ /** The input value is invalid. */
1539
+ CustomerErrorCode["Invalid"] = "INVALID";
1540
+ /** Multipass token is not valid. */
1541
+ CustomerErrorCode["InvalidMultipassRequest"] = "INVALID_MULTIPASS_REQUEST";
1542
+ /** Address does not exist. */
1543
+ CustomerErrorCode["NotFound"] = "NOT_FOUND";
1544
+ /** Input password starts or ends with whitespace. */
1545
+ CustomerErrorCode["PasswordStartsOrEndsWithWhitespace"] = "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE";
1546
+ /** The input value is already taken. */
1547
+ CustomerErrorCode["Taken"] = "TAKEN";
1548
+ /** Invalid activation token. */
1549
+ CustomerErrorCode["TokenInvalid"] = "TOKEN_INVALID";
1550
+ /** The input value is too long. */
1551
+ CustomerErrorCode["TooLong"] = "TOO_LONG";
1552
+ /** The input value is too short. */
1553
+ CustomerErrorCode["TooShort"] = "TOO_SHORT";
1554
+ /** Unidentified customer. */
1555
+ CustomerErrorCode["UnidentifiedCustomer"] = "UNIDENTIFIED_CUSTOMER";
1556
+ })(CustomerErrorCode || (CustomerErrorCode = {}));
1557
+ /**
1558
+ * Defines the types of available validation strategies for delivery addresses.
1559
+ *
1560
+ */
1561
+ var DeliveryAddressValidationStrategy;
1562
+ (function (DeliveryAddressValidationStrategy) {
1563
+ /** Only the country code is validated. */
1564
+ DeliveryAddressValidationStrategy["CountryCodeOnly"] = "COUNTRY_CODE_ONLY";
1565
+ /**
1566
+ * Strict validation is performed, i.e. all fields in the address are validated
1567
+ * according to Shopify's checkout rules. If the address fails validation, the cart will not be updated.
1568
+ *
1569
+ */
1570
+ DeliveryAddressValidationStrategy["Strict"] = "STRICT";
1571
+ })(DeliveryAddressValidationStrategy || (DeliveryAddressValidationStrategy = {}));
1572
+ /** List of different delivery method types. */
1573
+ var DeliveryMethodType;
1574
+ (function (DeliveryMethodType) {
1575
+ /** Local Delivery. */
1576
+ DeliveryMethodType["Local"] = "LOCAL";
1577
+ /** None. */
1578
+ DeliveryMethodType["None"] = "NONE";
1579
+ /** Shipping to a Pickup Point. */
1580
+ DeliveryMethodType["PickupPoint"] = "PICKUP_POINT";
1581
+ /** Local Pickup. */
1582
+ DeliveryMethodType["PickUp"] = "PICK_UP";
1583
+ /** Retail. */
1584
+ DeliveryMethodType["Retail"] = "RETAIL";
1585
+ /** Shipping. */
1586
+ DeliveryMethodType["Shipping"] = "SHIPPING";
1587
+ })(DeliveryMethodType || (DeliveryMethodType = {}));
1588
+ /** Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. */
1589
+ var DigitalWallet;
1590
+ (function (DigitalWallet) {
1591
+ /** Android Pay. */
1592
+ DigitalWallet["AndroidPay"] = "ANDROID_PAY";
1593
+ /** Apple Pay. */
1594
+ DigitalWallet["ApplePay"] = "APPLE_PAY";
1595
+ /** Google Pay. */
1596
+ DigitalWallet["GooglePay"] = "GOOGLE_PAY";
1597
+ /** Shopify Pay. */
1598
+ DigitalWallet["ShopifyPay"] = "SHOPIFY_PAY";
1599
+ })(DigitalWallet || (DigitalWallet = {}));
1600
+ /** The method by which the discount's value is allocated onto its entitled lines. */
1601
+ var DiscountApplicationAllocationMethod;
1602
+ (function (DiscountApplicationAllocationMethod) {
1603
+ /** The value is spread across all entitled lines. */
1604
+ DiscountApplicationAllocationMethod["Across"] = "ACROSS";
1605
+ /** The value is applied onto every entitled line. */
1606
+ DiscountApplicationAllocationMethod["Each"] = "EACH";
1607
+ /**
1608
+ * The value is specifically applied onto a particular line.
1609
+ * @deprecated Use ACROSS instead.
1610
+ */
1611
+ DiscountApplicationAllocationMethod["One"] = "ONE";
1612
+ })(DiscountApplicationAllocationMethod || (DiscountApplicationAllocationMethod = {}));
1613
+ /**
1614
+ * The lines on the order to which the discount is applied, of the type defined by
1615
+ * the discount application's `targetType`. For example, the value `ENTITLED`, combined with a `targetType` of
1616
+ * `LINE_ITEM`, applies the discount on all line items that are entitled to the discount.
1617
+ * The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all shipping lines.
1618
+ *
1619
+ */
1620
+ var DiscountApplicationTargetSelection;
1621
+ (function (DiscountApplicationTargetSelection) {
1622
+ /** The discount is allocated onto all the lines. */
1623
+ DiscountApplicationTargetSelection["All"] = "ALL";
1624
+ /** The discount is allocated onto only the lines that it's entitled for. */
1625
+ DiscountApplicationTargetSelection["Entitled"] = "ENTITLED";
1626
+ /** The discount is allocated onto explicitly chosen lines. */
1627
+ DiscountApplicationTargetSelection["Explicit"] = "EXPLICIT";
1628
+ })(DiscountApplicationTargetSelection || (DiscountApplicationTargetSelection = {}));
1629
+ /**
1630
+ * The type of line (i.e. line item or shipping line) on an order that the discount is applicable towards.
1631
+ *
1632
+ */
1633
+ var DiscountApplicationTargetType;
1634
+ (function (DiscountApplicationTargetType) {
1635
+ /** The discount applies onto line items. */
1636
+ DiscountApplicationTargetType["LineItem"] = "LINE_ITEM";
1637
+ /** The discount applies onto shipping lines. */
1638
+ DiscountApplicationTargetType["ShippingLine"] = "SHIPPING_LINE";
1639
+ })(DiscountApplicationTargetType || (DiscountApplicationTargetType = {}));
1640
+ /**
1641
+ * Defines how to present the filter values, specifies the presentation of the filter.
1642
+ *
1643
+ */
1644
+ var FilterPresentation;
1645
+ (function (FilterPresentation) {
1646
+ /** Image presentation, filter values display an image. */
1647
+ FilterPresentation["Image"] = "IMAGE";
1648
+ /** Swatch presentation, filter values display color or image patterns. */
1649
+ FilterPresentation["Swatch"] = "SWATCH";
1650
+ /** Text presentation, no additional visual display for filter values. */
1651
+ FilterPresentation["Text"] = "TEXT";
1652
+ })(FilterPresentation || (FilterPresentation = {}));
1653
+ /**
1654
+ * The type of data that the filter group represents.
1655
+ *
1656
+ * For more information, refer to [Filter products in a collection with the Storefront API]
1657
+ * (https://shopify.dev/custom-storefronts/products-collections/filter-products).
1658
+ *
1659
+ */
1660
+ var FilterType;
1661
+ (function (FilterType) {
1662
+ /** A boolean value. */
1663
+ FilterType["Boolean"] = "BOOLEAN";
1664
+ /** A list of selectable values. */
1665
+ FilterType["List"] = "LIST";
1666
+ /** A range of prices. */
1667
+ FilterType["PriceRange"] = "PRICE_RANGE";
1668
+ })(FilterType || (FilterType = {}));
1669
+ /** List of supported image content types. */
1670
+ var ImageContentType;
1671
+ (function (ImageContentType) {
1672
+ /** A JPG image. */
1673
+ ImageContentType["Jpg"] = "JPG";
1674
+ /** A PNG image. */
1675
+ ImageContentType["Png"] = "PNG";
1676
+ /** A WEBP image. */
1677
+ ImageContentType["Webp"] = "WEBP";
1678
+ })(ImageContentType || (ImageContentType = {}));
1679
+ /** Language codes supported by Shopify. */
1680
+ var LanguageCode;
1681
+ (function (LanguageCode) {
1682
+ /** Afrikaans. */
1683
+ LanguageCode["Af"] = "AF";
1684
+ /** Akan. */
1685
+ LanguageCode["Ak"] = "AK";
1686
+ /** Amharic. */
1687
+ LanguageCode["Am"] = "AM";
1688
+ /** Arabic. */
1689
+ LanguageCode["Ar"] = "AR";
1690
+ /** Assamese. */
1691
+ LanguageCode["As"] = "AS";
1692
+ /** Azerbaijani. */
1693
+ LanguageCode["Az"] = "AZ";
1694
+ /** Belarusian. */
1695
+ LanguageCode["Be"] = "BE";
1696
+ /** Bulgarian. */
1697
+ LanguageCode["Bg"] = "BG";
1698
+ /** Bambara. */
1699
+ LanguageCode["Bm"] = "BM";
1700
+ /** Bangla. */
1701
+ LanguageCode["Bn"] = "BN";
1702
+ /** Tibetan. */
1703
+ LanguageCode["Bo"] = "BO";
1704
+ /** Breton. */
1705
+ LanguageCode["Br"] = "BR";
1706
+ /** Bosnian. */
1707
+ LanguageCode["Bs"] = "BS";
1708
+ /** Catalan. */
1709
+ LanguageCode["Ca"] = "CA";
1710
+ /** Chechen. */
1711
+ LanguageCode["Ce"] = "CE";
1712
+ /** Central Kurdish. */
1713
+ LanguageCode["Ckb"] = "CKB";
1714
+ /** Czech. */
1715
+ LanguageCode["Cs"] = "CS";
1716
+ /** Church Slavic. */
1717
+ LanguageCode["Cu"] = "CU";
1718
+ /** Welsh. */
1719
+ LanguageCode["Cy"] = "CY";
1720
+ /** Danish. */
1721
+ LanguageCode["Da"] = "DA";
1722
+ /** German. */
1723
+ LanguageCode["De"] = "DE";
1724
+ /** Dzongkha. */
1725
+ LanguageCode["Dz"] = "DZ";
1726
+ /** Ewe. */
1727
+ LanguageCode["Ee"] = "EE";
1728
+ /** Greek. */
1729
+ LanguageCode["El"] = "EL";
1730
+ /** English. */
1731
+ LanguageCode["En"] = "EN";
1732
+ /** Esperanto. */
1733
+ LanguageCode["Eo"] = "EO";
1734
+ /** Spanish. */
1735
+ LanguageCode["Es"] = "ES";
1736
+ /** Estonian. */
1737
+ LanguageCode["Et"] = "ET";
1738
+ /** Basque. */
1739
+ LanguageCode["Eu"] = "EU";
1740
+ /** Persian. */
1741
+ LanguageCode["Fa"] = "FA";
1742
+ /** Fulah. */
1743
+ LanguageCode["Ff"] = "FF";
1744
+ /** Finnish. */
1745
+ LanguageCode["Fi"] = "FI";
1746
+ /** Filipino. */
1747
+ LanguageCode["Fil"] = "FIL";
1748
+ /** Faroese. */
1749
+ LanguageCode["Fo"] = "FO";
1750
+ /** French. */
1751
+ LanguageCode["Fr"] = "FR";
1752
+ /** Western Frisian. */
1753
+ LanguageCode["Fy"] = "FY";
1754
+ /** Irish. */
1755
+ LanguageCode["Ga"] = "GA";
1756
+ /** Scottish Gaelic. */
1757
+ LanguageCode["Gd"] = "GD";
1758
+ /** Galician. */
1759
+ LanguageCode["Gl"] = "GL";
1760
+ /** Gujarati. */
1761
+ LanguageCode["Gu"] = "GU";
1762
+ /** Manx. */
1763
+ LanguageCode["Gv"] = "GV";
1764
+ /** Hausa. */
1765
+ LanguageCode["Ha"] = "HA";
1766
+ /** Hebrew. */
1767
+ LanguageCode["He"] = "HE";
1768
+ /** Hindi. */
1769
+ LanguageCode["Hi"] = "HI";
1770
+ /** Croatian. */
1771
+ LanguageCode["Hr"] = "HR";
1772
+ /** Hungarian. */
1773
+ LanguageCode["Hu"] = "HU";
1774
+ /** Armenian. */
1775
+ LanguageCode["Hy"] = "HY";
1776
+ /** Interlingua. */
1777
+ LanguageCode["Ia"] = "IA";
1778
+ /** Indonesian. */
1779
+ LanguageCode["Id"] = "ID";
1780
+ /** Igbo. */
1781
+ LanguageCode["Ig"] = "IG";
1782
+ /** Sichuan Yi. */
1783
+ LanguageCode["Ii"] = "II";
1784
+ /** Icelandic. */
1785
+ LanguageCode["Is"] = "IS";
1786
+ /** Italian. */
1787
+ LanguageCode["It"] = "IT";
1788
+ /** Japanese. */
1789
+ LanguageCode["Ja"] = "JA";
1790
+ /** Javanese. */
1791
+ LanguageCode["Jv"] = "JV";
1792
+ /** Georgian. */
1793
+ LanguageCode["Ka"] = "KA";
1794
+ /** Kikuyu. */
1795
+ LanguageCode["Ki"] = "KI";
1796
+ /** Kazakh. */
1797
+ LanguageCode["Kk"] = "KK";
1798
+ /** Kalaallisut. */
1799
+ LanguageCode["Kl"] = "KL";
1800
+ /** Khmer. */
1801
+ LanguageCode["Km"] = "KM";
1802
+ /** Kannada. */
1803
+ LanguageCode["Kn"] = "KN";
1804
+ /** Korean. */
1805
+ LanguageCode["Ko"] = "KO";
1806
+ /** Kashmiri. */
1807
+ LanguageCode["Ks"] = "KS";
1808
+ /** Kurdish. */
1809
+ LanguageCode["Ku"] = "KU";
1810
+ /** Cornish. */
1811
+ LanguageCode["Kw"] = "KW";
1812
+ /** Kyrgyz. */
1813
+ LanguageCode["Ky"] = "KY";
1814
+ /** Latin. */
1815
+ LanguageCode["La"] = "LA";
1816
+ /** Luxembourgish. */
1817
+ LanguageCode["Lb"] = "LB";
1818
+ /** Ganda. */
1819
+ LanguageCode["Lg"] = "LG";
1820
+ /** Lingala. */
1821
+ LanguageCode["Ln"] = "LN";
1822
+ /** Lao. */
1823
+ LanguageCode["Lo"] = "LO";
1824
+ /** Lithuanian. */
1825
+ LanguageCode["Lt"] = "LT";
1826
+ /** Luba-Katanga. */
1827
+ LanguageCode["Lu"] = "LU";
1828
+ /** Latvian. */
1829
+ LanguageCode["Lv"] = "LV";
1830
+ /** Malagasy. */
1831
+ LanguageCode["Mg"] = "MG";
1832
+ /** Māori. */
1833
+ LanguageCode["Mi"] = "MI";
1834
+ /** Macedonian. */
1835
+ LanguageCode["Mk"] = "MK";
1836
+ /** Malayalam. */
1837
+ LanguageCode["Ml"] = "ML";
1838
+ /** Mongolian. */
1839
+ LanguageCode["Mn"] = "MN";
1840
+ /** Moldavian. */
1841
+ LanguageCode["Mo"] = "MO";
1842
+ /** Marathi. */
1843
+ LanguageCode["Mr"] = "MR";
1844
+ /** Malay. */
1845
+ LanguageCode["Ms"] = "MS";
1846
+ /** Maltese. */
1847
+ LanguageCode["Mt"] = "MT";
1848
+ /** Burmese. */
1849
+ LanguageCode["My"] = "MY";
1850
+ /** Norwegian (Bokmål). */
1851
+ LanguageCode["Nb"] = "NB";
1852
+ /** North Ndebele. */
1853
+ LanguageCode["Nd"] = "ND";
1854
+ /** Nepali. */
1855
+ LanguageCode["Ne"] = "NE";
1856
+ /** Dutch. */
1857
+ LanguageCode["Nl"] = "NL";
1858
+ /** Norwegian Nynorsk. */
1859
+ LanguageCode["Nn"] = "NN";
1860
+ /** Norwegian. */
1861
+ LanguageCode["No"] = "NO";
1862
+ /** Oromo. */
1863
+ LanguageCode["Om"] = "OM";
1864
+ /** Odia. */
1865
+ LanguageCode["Or"] = "OR";
1866
+ /** Ossetic. */
1867
+ LanguageCode["Os"] = "OS";
1868
+ /** Punjabi. */
1869
+ LanguageCode["Pa"] = "PA";
1870
+ /** Polish. */
1871
+ LanguageCode["Pl"] = "PL";
1872
+ /** Pashto. */
1873
+ LanguageCode["Ps"] = "PS";
1874
+ /** Portuguese. */
1875
+ LanguageCode["Pt"] = "PT";
1876
+ /** Portuguese (Brazil). */
1877
+ LanguageCode["PtBr"] = "PT_BR";
1878
+ /** Portuguese (Portugal). */
1879
+ LanguageCode["PtPt"] = "PT_PT";
1880
+ /** Quechua. */
1881
+ LanguageCode["Qu"] = "QU";
1882
+ /** Romansh. */
1883
+ LanguageCode["Rm"] = "RM";
1884
+ /** Rundi. */
1885
+ LanguageCode["Rn"] = "RN";
1886
+ /** Romanian. */
1887
+ LanguageCode["Ro"] = "RO";
1888
+ /** Russian. */
1889
+ LanguageCode["Ru"] = "RU";
1890
+ /** Kinyarwanda. */
1891
+ LanguageCode["Rw"] = "RW";
1892
+ /** Sanskrit. */
1893
+ LanguageCode["Sa"] = "SA";
1894
+ /** Sardinian. */
1895
+ LanguageCode["Sc"] = "SC";
1896
+ /** Sindhi. */
1897
+ LanguageCode["Sd"] = "SD";
1898
+ /** Northern Sami. */
1899
+ LanguageCode["Se"] = "SE";
1900
+ /** Sango. */
1901
+ LanguageCode["Sg"] = "SG";
1902
+ /** Serbo-Croatian. */
1903
+ LanguageCode["Sh"] = "SH";
1904
+ /** Sinhala. */
1905
+ LanguageCode["Si"] = "SI";
1906
+ /** Slovak. */
1907
+ LanguageCode["Sk"] = "SK";
1908
+ /** Slovenian. */
1909
+ LanguageCode["Sl"] = "SL";
1910
+ /** Shona. */
1911
+ LanguageCode["Sn"] = "SN";
1912
+ /** Somali. */
1913
+ LanguageCode["So"] = "SO";
1914
+ /** Albanian. */
1915
+ LanguageCode["Sq"] = "SQ";
1916
+ /** Serbian. */
1917
+ LanguageCode["Sr"] = "SR";
1918
+ /** Sundanese. */
1919
+ LanguageCode["Su"] = "SU";
1920
+ /** Swedish. */
1921
+ LanguageCode["Sv"] = "SV";
1922
+ /** Swahili. */
1923
+ LanguageCode["Sw"] = "SW";
1924
+ /** Tamil. */
1925
+ LanguageCode["Ta"] = "TA";
1926
+ /** Telugu. */
1927
+ LanguageCode["Te"] = "TE";
1928
+ /** Tajik. */
1929
+ LanguageCode["Tg"] = "TG";
1930
+ /** Thai. */
1931
+ LanguageCode["Th"] = "TH";
1932
+ /** Tigrinya. */
1933
+ LanguageCode["Ti"] = "TI";
1934
+ /** Turkmen. */
1935
+ LanguageCode["Tk"] = "TK";
1936
+ /** Tongan. */
1937
+ LanguageCode["To"] = "TO";
1938
+ /** Turkish. */
1939
+ LanguageCode["Tr"] = "TR";
1940
+ /** Tatar. */
1941
+ LanguageCode["Tt"] = "TT";
1942
+ /** Uyghur. */
1943
+ LanguageCode["Ug"] = "UG";
1944
+ /** Ukrainian. */
1945
+ LanguageCode["Uk"] = "UK";
1946
+ /** Urdu. */
1947
+ LanguageCode["Ur"] = "UR";
1948
+ /** Uzbek. */
1949
+ LanguageCode["Uz"] = "UZ";
1950
+ /** Vietnamese. */
1951
+ LanguageCode["Vi"] = "VI";
1952
+ /** Volapük. */
1953
+ LanguageCode["Vo"] = "VO";
1954
+ /** Wolof. */
1955
+ LanguageCode["Wo"] = "WO";
1956
+ /** Xhosa. */
1957
+ LanguageCode["Xh"] = "XH";
1958
+ /** Yiddish. */
1959
+ LanguageCode["Yi"] = "YI";
1960
+ /** Yoruba. */
1961
+ LanguageCode["Yo"] = "YO";
1962
+ /** Chinese. */
1963
+ LanguageCode["Zh"] = "ZH";
1964
+ /** Chinese (Simplified). */
1965
+ LanguageCode["ZhCn"] = "ZH_CN";
1966
+ /** Chinese (Traditional). */
1967
+ LanguageCode["ZhTw"] = "ZH_TW";
1968
+ /** Zulu. */
1969
+ LanguageCode["Zu"] = "ZU";
1970
+ })(LanguageCode || (LanguageCode = {}));
1971
+ /** The set of valid sort keys for the Location query. */
1972
+ var LocationSortKeys;
1973
+ (function (LocationSortKeys) {
1974
+ /** Sort by the `city` value. */
1975
+ LocationSortKeys["City"] = "CITY";
1976
+ /** Sort by the `distance` value. */
1977
+ LocationSortKeys["Distance"] = "DISTANCE";
1978
+ /** Sort by the `id` value. */
1979
+ LocationSortKeys["Id"] = "ID";
1980
+ /** Sort by the `name` value. */
1981
+ LocationSortKeys["Name"] = "NAME";
1982
+ })(LocationSortKeys || (LocationSortKeys = {}));
1983
+ /** The possible content types for a media object. */
1984
+ var MediaContentType;
1985
+ (function (MediaContentType) {
1986
+ /** An externally hosted video. */
1987
+ MediaContentType["ExternalVideo"] = "EXTERNAL_VIDEO";
1988
+ /** A Shopify hosted image. */
1989
+ MediaContentType["Image"] = "IMAGE";
1990
+ /** A 3d model. */
1991
+ MediaContentType["Model_3D"] = "MODEL_3D";
1992
+ /** A Shopify hosted video. */
1993
+ MediaContentType["Video"] = "VIDEO";
1994
+ })(MediaContentType || (MediaContentType = {}));
1995
+ /** Host for a Media Resource. */
1996
+ var MediaHost;
1997
+ (function (MediaHost) {
1998
+ /** Host for Vimeo embedded videos. */
1999
+ MediaHost["Vimeo"] = "VIMEO";
2000
+ /** Host for YouTube embedded videos. */
2001
+ MediaHost["Youtube"] = "YOUTUBE";
2002
+ })(MediaHost || (MediaHost = {}));
2003
+ /** The possible formats for a media presentation. */
2004
+ var MediaPresentationFormat;
2005
+ (function (MediaPresentationFormat) {
2006
+ /** A media image presentation. */
2007
+ MediaPresentationFormat["Image"] = "IMAGE";
2008
+ /** A model viewer presentation. */
2009
+ MediaPresentationFormat["ModelViewer"] = "MODEL_VIEWER";
2010
+ })(MediaPresentationFormat || (MediaPresentationFormat = {}));
2011
+ /** A menu item type. */
2012
+ var MenuItemType;
2013
+ (function (MenuItemType) {
2014
+ /** An article link. */
2015
+ MenuItemType["Article"] = "ARTICLE";
2016
+ /** A blog link. */
2017
+ MenuItemType["Blog"] = "BLOG";
2018
+ /** A catalog link. */
2019
+ MenuItemType["Catalog"] = "CATALOG";
2020
+ /** A collection link. */
2021
+ MenuItemType["Collection"] = "COLLECTION";
2022
+ /** A collection link. */
2023
+ MenuItemType["Collections"] = "COLLECTIONS";
2024
+ /** A customer account page link. */
2025
+ MenuItemType["CustomerAccountPage"] = "CUSTOMER_ACCOUNT_PAGE";
2026
+ /** A frontpage link. */
2027
+ MenuItemType["Frontpage"] = "FRONTPAGE";
2028
+ /** An http link. */
2029
+ MenuItemType["Http"] = "HTTP";
2030
+ /** A metaobject page link. */
2031
+ MenuItemType["Metaobject"] = "METAOBJECT";
2032
+ /** A page link. */
2033
+ MenuItemType["Page"] = "PAGE";
2034
+ /** A product link. */
2035
+ MenuItemType["Product"] = "PRODUCT";
2036
+ /** A search link. */
2037
+ MenuItemType["Search"] = "SEARCH";
2038
+ /** A shop policy link. */
2039
+ MenuItemType["ShopPolicy"] = "SHOP_POLICY";
2040
+ })(MenuItemType || (MenuItemType = {}));
2041
+ /** Possible error codes that can be returned by `MetafieldDeleteUserError`. */
2042
+ var MetafieldDeleteErrorCode;
2043
+ (function (MetafieldDeleteErrorCode) {
2044
+ /** The owner ID is invalid. */
2045
+ MetafieldDeleteErrorCode["InvalidOwner"] = "INVALID_OWNER";
2046
+ /** Metafield not found. */
2047
+ MetafieldDeleteErrorCode["MetafieldDoesNotExist"] = "METAFIELD_DOES_NOT_EXIST";
2048
+ })(MetafieldDeleteErrorCode || (MetafieldDeleteErrorCode = {}));
2049
+ /** Possible error codes that can be returned by `MetafieldsSetUserError`. */
2050
+ var MetafieldsSetUserErrorCode;
2051
+ (function (MetafieldsSetUserErrorCode) {
2052
+ /** The input value is blank. */
2053
+ MetafieldsSetUserErrorCode["Blank"] = "BLANK";
2054
+ /** The input value isn't included in the list. */
2055
+ MetafieldsSetUserErrorCode["Inclusion"] = "INCLUSION";
2056
+ /** The owner ID is invalid. */
2057
+ MetafieldsSetUserErrorCode["InvalidOwner"] = "INVALID_OWNER";
2058
+ /** The type is invalid. */
2059
+ MetafieldsSetUserErrorCode["InvalidType"] = "INVALID_TYPE";
2060
+ /** The value is invalid for metafield type or for definition options. */
2061
+ MetafieldsSetUserErrorCode["InvalidValue"] = "INVALID_VALUE";
2062
+ /** The input value should be less than or equal to the maximum value allowed. */
2063
+ MetafieldsSetUserErrorCode["LessThanOrEqualTo"] = "LESS_THAN_OR_EQUAL_TO";
2064
+ /** The input value needs to be blank. */
2065
+ MetafieldsSetUserErrorCode["Present"] = "PRESENT";
2066
+ /** The input value is too long. */
2067
+ MetafieldsSetUserErrorCode["TooLong"] = "TOO_LONG";
2068
+ /** The input value is too short. */
2069
+ MetafieldsSetUserErrorCode["TooShort"] = "TOO_SHORT";
2070
+ })(MetafieldsSetUserErrorCode || (MetafieldsSetUserErrorCode = {}));
2071
+ /** Represents the reason for the order's cancellation. */
2072
+ var OrderCancelReason;
2073
+ (function (OrderCancelReason) {
2074
+ /** The customer wanted to cancel the order. */
2075
+ OrderCancelReason["Customer"] = "CUSTOMER";
2076
+ /** Payment was declined. */
2077
+ OrderCancelReason["Declined"] = "DECLINED";
2078
+ /** The order was fraudulent. */
2079
+ OrderCancelReason["Fraud"] = "FRAUD";
2080
+ /** There was insufficient inventory. */
2081
+ OrderCancelReason["Inventory"] = "INVENTORY";
2082
+ /** The order was canceled for an unlisted reason. */
2083
+ OrderCancelReason["Other"] = "OTHER";
2084
+ /** Staff made an error. */
2085
+ OrderCancelReason["Staff"] = "STAFF";
2086
+ })(OrderCancelReason || (OrderCancelReason = {}));
2087
+ /** Represents the order's current financial status. */
2088
+ var OrderFinancialStatus;
2089
+ (function (OrderFinancialStatus) {
2090
+ /** Displayed as **Authorized**. */
2091
+ OrderFinancialStatus["Authorized"] = "AUTHORIZED";
2092
+ /** Displayed as **Paid**. */
2093
+ OrderFinancialStatus["Paid"] = "PAID";
2094
+ /** Displayed as **Partially paid**. */
2095
+ OrderFinancialStatus["PartiallyPaid"] = "PARTIALLY_PAID";
2096
+ /** Displayed as **Partially refunded**. */
2097
+ OrderFinancialStatus["PartiallyRefunded"] = "PARTIALLY_REFUNDED";
2098
+ /** Displayed as **Pending**. */
2099
+ OrderFinancialStatus["Pending"] = "PENDING";
2100
+ /** Displayed as **Refunded**. */
2101
+ OrderFinancialStatus["Refunded"] = "REFUNDED";
2102
+ /** Displayed as **Voided**. */
2103
+ OrderFinancialStatus["Voided"] = "VOIDED";
2104
+ })(OrderFinancialStatus || (OrderFinancialStatus = {}));
2105
+ /** Represents the order's aggregated fulfillment status for display purposes. */
2106
+ var OrderFulfillmentStatus;
2107
+ (function (OrderFulfillmentStatus) {
2108
+ /** Displayed as **Fulfilled**. All of the items in the order have been fulfilled. */
2109
+ OrderFulfillmentStatus["Fulfilled"] = "FULFILLED";
2110
+ /** Displayed as **In progress**. Some of the items in the order have been fulfilled, or a request for fulfillment has been sent to the fulfillment service. */
2111
+ OrderFulfillmentStatus["InProgress"] = "IN_PROGRESS";
2112
+ /** Displayed as **On hold**. All of the unfulfilled items in this order are on hold. */
2113
+ OrderFulfillmentStatus["OnHold"] = "ON_HOLD";
2114
+ /** Displayed as **Open**. None of the items in the order have been fulfilled. Replaced by "UNFULFILLED" status. */
2115
+ OrderFulfillmentStatus["Open"] = "OPEN";
2116
+ /** Displayed as **Partially fulfilled**. Some of the items in the order have been fulfilled. */
2117
+ OrderFulfillmentStatus["PartiallyFulfilled"] = "PARTIALLY_FULFILLED";
2118
+ /** Displayed as **Pending fulfillment**. A request for fulfillment of some items awaits a response from the fulfillment service. Replaced by "IN_PROGRESS" status. */
2119
+ OrderFulfillmentStatus["PendingFulfillment"] = "PENDING_FULFILLMENT";
2120
+ /** Displayed as **Restocked**. All of the items in the order have been restocked. Replaced by "UNFULFILLED" status. */
2121
+ OrderFulfillmentStatus["Restocked"] = "RESTOCKED";
2122
+ /** Displayed as **Scheduled**. All of the unfulfilled items in this order are scheduled for fulfillment at later time. */
2123
+ OrderFulfillmentStatus["Scheduled"] = "SCHEDULED";
2124
+ /** Displayed as **Unfulfilled**. None of the items in the order have been fulfilled. */
2125
+ OrderFulfillmentStatus["Unfulfilled"] = "UNFULFILLED";
2126
+ })(OrderFulfillmentStatus || (OrderFulfillmentStatus = {}));
2127
+ /** The set of valid sort keys for the Order query. */
2128
+ var OrderSortKeys;
2129
+ (function (OrderSortKeys) {
2130
+ /** Sort by the `id` value. */
2131
+ OrderSortKeys["Id"] = "ID";
2132
+ /** Sort by the `processed_at` value. */
2133
+ OrderSortKeys["ProcessedAt"] = "PROCESSED_AT";
2134
+ /**
2135
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
2136
+ * Don't use this sort key when no search query is specified.
2137
+ *
2138
+ */
2139
+ OrderSortKeys["Relevance"] = "RELEVANCE";
2140
+ /** Sort by the `total_price` value. */
2141
+ OrderSortKeys["TotalPrice"] = "TOTAL_PRICE";
2142
+ })(OrderSortKeys || (OrderSortKeys = {}));
2143
+ /** The set of valid sort keys for the Page query. */
2144
+ var PageSortKeys;
2145
+ (function (PageSortKeys) {
2146
+ /** Sort by the `id` value. */
2147
+ PageSortKeys["Id"] = "ID";
2148
+ /**
2149
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
2150
+ * Don't use this sort key when no search query is specified.
2151
+ *
2152
+ */
2153
+ PageSortKeys["Relevance"] = "RELEVANCE";
2154
+ /** Sort by the `title` value. */
2155
+ PageSortKeys["Title"] = "TITLE";
2156
+ /** Sort by the `updated_at` value. */
2157
+ PageSortKeys["UpdatedAt"] = "UPDATED_AT";
2158
+ })(PageSortKeys || (PageSortKeys = {}));
2159
+ /** Decides the distribution of results. */
2160
+ var PredictiveSearchLimitScope;
2161
+ (function (PredictiveSearchLimitScope) {
2162
+ /** Return results up to limit across all types. */
2163
+ PredictiveSearchLimitScope["All"] = "ALL";
2164
+ /** Return results up to limit per type. */
2165
+ PredictiveSearchLimitScope["Each"] = "EACH";
2166
+ })(PredictiveSearchLimitScope || (PredictiveSearchLimitScope = {}));
2167
+ /** The types of search items to perform predictive search on. */
2168
+ var PredictiveSearchType;
2169
+ (function (PredictiveSearchType) {
2170
+ /** Returns matching articles. */
2171
+ PredictiveSearchType["Article"] = "ARTICLE";
2172
+ /** Returns matching collections. */
2173
+ PredictiveSearchType["Collection"] = "COLLECTION";
2174
+ /** Returns matching pages. */
2175
+ PredictiveSearchType["Page"] = "PAGE";
2176
+ /** Returns matching products. */
2177
+ PredictiveSearchType["Product"] = "PRODUCT";
2178
+ /** Returns matching query strings. */
2179
+ PredictiveSearchType["Query"] = "QUERY";
2180
+ })(PredictiveSearchType || (PredictiveSearchType = {}));
2181
+ /** The preferred delivery methods such as shipping, local pickup or through pickup points. */
2182
+ var PreferenceDeliveryMethodType;
2183
+ (function (PreferenceDeliveryMethodType) {
2184
+ /** A delivery method used to let buyers collect purchases at designated locations like parcel lockers. */
2185
+ PreferenceDeliveryMethodType["PickupPoint"] = "PICKUP_POINT";
2186
+ /** A delivery method used to let buyers receive items directly from a specific location within an area. */
2187
+ PreferenceDeliveryMethodType["PickUp"] = "PICK_UP";
2188
+ /** A delivery method used to send items directly to a buyer’s specified address. */
2189
+ PreferenceDeliveryMethodType["Shipping"] = "SHIPPING";
2190
+ })(PreferenceDeliveryMethodType || (PreferenceDeliveryMethodType = {}));
2191
+ /** The set of valid sort keys for the ProductCollection query. */
2192
+ var ProductCollectionSortKeys;
2193
+ (function (ProductCollectionSortKeys) {
2194
+ /** Sort by the `best-selling` value. */
2195
+ ProductCollectionSortKeys["BestSelling"] = "BEST_SELLING";
2196
+ /** Sort by the `collection-default` value. */
2197
+ ProductCollectionSortKeys["CollectionDefault"] = "COLLECTION_DEFAULT";
2198
+ /** Sort by the `created` value. */
2199
+ ProductCollectionSortKeys["Created"] = "CREATED";
2200
+ /** Sort by the `id` value. */
2201
+ ProductCollectionSortKeys["Id"] = "ID";
2202
+ /** Sort by the `manual` value. */
2203
+ ProductCollectionSortKeys["Manual"] = "MANUAL";
2204
+ /** Sort by the `price` value. */
2205
+ ProductCollectionSortKeys["Price"] = "PRICE";
2206
+ /**
2207
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
2208
+ * Don't use this sort key when no search query is specified.
2209
+ *
2210
+ */
2211
+ ProductCollectionSortKeys["Relevance"] = "RELEVANCE";
2212
+ /** Sort by the `title` value. */
2213
+ ProductCollectionSortKeys["Title"] = "TITLE";
2214
+ })(ProductCollectionSortKeys || (ProductCollectionSortKeys = {}));
2215
+ /** The set of valid sort keys for the ProductImage query. */
2216
+ var ProductImageSortKeys;
2217
+ (function (ProductImageSortKeys) {
2218
+ /** Sort by the `created_at` value. */
2219
+ ProductImageSortKeys["CreatedAt"] = "CREATED_AT";
2220
+ /** Sort by the `id` value. */
2221
+ ProductImageSortKeys["Id"] = "ID";
2222
+ /** Sort by the `position` value. */
2223
+ ProductImageSortKeys["Position"] = "POSITION";
2224
+ /**
2225
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
2226
+ * Don't use this sort key when no search query is specified.
2227
+ *
2228
+ */
2229
+ ProductImageSortKeys["Relevance"] = "RELEVANCE";
2230
+ })(ProductImageSortKeys || (ProductImageSortKeys = {}));
2231
+ /** The set of valid sort keys for the ProductMedia query. */
2232
+ var ProductMediaSortKeys;
2233
+ (function (ProductMediaSortKeys) {
2234
+ /** Sort by the `id` value. */
2235
+ ProductMediaSortKeys["Id"] = "ID";
2236
+ /** Sort by the `position` value. */
2237
+ ProductMediaSortKeys["Position"] = "POSITION";
2238
+ /**
2239
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
2240
+ * Don't use this sort key when no search query is specified.
2241
+ *
2242
+ */
2243
+ ProductMediaSortKeys["Relevance"] = "RELEVANCE";
2244
+ })(ProductMediaSortKeys || (ProductMediaSortKeys = {}));
2245
+ /**
2246
+ * The recommendation intent that is used to generate product recommendations.
2247
+ * You can use intent to generate product recommendations according to different strategies.
2248
+ *
2249
+ */
2250
+ var ProductRecommendationIntent;
2251
+ (function (ProductRecommendationIntent) {
2252
+ /** Offer customers products that are complementary to a product for which recommendations are to be fetched. An example is add-on products that display in a Pair it with section. */
2253
+ ProductRecommendationIntent["Complementary"] = "COMPLEMENTARY";
2254
+ /** Offer customers a mix of products that are similar or complementary to a product for which recommendations are to be fetched. An example is substitutable products that display in a You may also like section. */
2255
+ ProductRecommendationIntent["Related"] = "RELATED";
2256
+ })(ProductRecommendationIntent || (ProductRecommendationIntent = {}));
2257
+ /** The set of valid sort keys for the Product query. */
2258
+ var ProductSortKeys;
2259
+ (function (ProductSortKeys) {
2260
+ /** Sort by the `best_selling` value. */
2261
+ ProductSortKeys["BestSelling"] = "BEST_SELLING";
2262
+ /** Sort by the `created_at` value. */
2263
+ ProductSortKeys["CreatedAt"] = "CREATED_AT";
2264
+ /** Sort by the `id` value. */
2265
+ ProductSortKeys["Id"] = "ID";
2266
+ /** Sort by the `price` value. */
2267
+ ProductSortKeys["Price"] = "PRICE";
2268
+ /** Sort by the `product_type` value. */
2269
+ ProductSortKeys["ProductType"] = "PRODUCT_TYPE";
2270
+ /**
2271
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
2272
+ * Don't use this sort key when no search query is specified.
2273
+ *
2274
+ */
2275
+ ProductSortKeys["Relevance"] = "RELEVANCE";
2276
+ /** Sort by the `title` value. */
2277
+ ProductSortKeys["Title"] = "TITLE";
2278
+ /** Sort by the `updated_at` value. */
2279
+ ProductSortKeys["UpdatedAt"] = "UPDATED_AT";
2280
+ /** Sort by the `vendor` value. */
2281
+ ProductSortKeys["Vendor"] = "VENDOR";
2282
+ })(ProductSortKeys || (ProductSortKeys = {}));
2283
+ /** The set of valid sort keys for the ProductVariant query. */
2284
+ var ProductVariantSortKeys;
2285
+ (function (ProductVariantSortKeys) {
2286
+ /** Sort by the `id` value. */
2287
+ ProductVariantSortKeys["Id"] = "ID";
2288
+ /** Sort by the `position` value. */
2289
+ ProductVariantSortKeys["Position"] = "POSITION";
2290
+ /**
2291
+ * Sort by relevance to the search terms when the `query` parameter is specified on the connection.
2292
+ * Don't use this sort key when no search query is specified.
2293
+ *
2294
+ */
2295
+ ProductVariantSortKeys["Relevance"] = "RELEVANCE";
2296
+ /** Sort by the `sku` value. */
2297
+ ProductVariantSortKeys["Sku"] = "SKU";
2298
+ /** Sort by the `title` value. */
2299
+ ProductVariantSortKeys["Title"] = "TITLE";
2300
+ })(ProductVariantSortKeys || (ProductVariantSortKeys = {}));
2301
+ /** Specifies whether to perform a partial word match on the last search term. */
2302
+ var SearchPrefixQueryType;
2303
+ (function (SearchPrefixQueryType) {
2304
+ /** Perform a partial word match on the last search term. */
2305
+ SearchPrefixQueryType["Last"] = "LAST";
2306
+ /** Don't perform a partial word match on the last search term. */
2307
+ SearchPrefixQueryType["None"] = "NONE";
2308
+ })(SearchPrefixQueryType || (SearchPrefixQueryType = {}));
2309
+ /** The set of valid sort keys for the search query. */
2310
+ var SearchSortKeys;
2311
+ (function (SearchSortKeys) {
2312
+ /** Sort by the `price` value. */
2313
+ SearchSortKeys["Price"] = "PRICE";
2314
+ /** Sort by relevance to the search terms. */
2315
+ SearchSortKeys["Relevance"] = "RELEVANCE";
2316
+ })(SearchSortKeys || (SearchSortKeys = {}));
2317
+ /** The types of search items to perform search within. */
2318
+ var SearchType;
2319
+ (function (SearchType) {
2320
+ /** Returns matching articles. */
2321
+ SearchType["Article"] = "ARTICLE";
2322
+ /** Returns matching pages. */
2323
+ SearchType["Page"] = "PAGE";
2324
+ /** Returns matching products. */
2325
+ SearchType["Product"] = "PRODUCT";
2326
+ })(SearchType || (SearchType = {}));
2327
+ /** Specifies whether to display results for unavailable products. */
2328
+ var SearchUnavailableProductsType;
2329
+ (function (SearchUnavailableProductsType) {
2330
+ /** Exclude unavailable products. */
2331
+ SearchUnavailableProductsType["Hide"] = "HIDE";
2332
+ /** Show unavailable products after all other matching results. This is the default. */
2333
+ SearchUnavailableProductsType["Last"] = "LAST";
2334
+ /** Show unavailable products in the order that they're found. */
2335
+ SearchUnavailableProductsType["Show"] = "SHOW";
2336
+ })(SearchUnavailableProductsType || (SearchUnavailableProductsType = {}));
2337
+ /** Specifies the list of resource fields to search. */
2338
+ var SearchableField;
2339
+ (function (SearchableField) {
2340
+ /** Author of the page or article. */
2341
+ SearchableField["Author"] = "AUTHOR";
2342
+ /** Body of the page or article or product description or collection description. */
2343
+ SearchableField["Body"] = "BODY";
2344
+ /** Product type. */
2345
+ SearchableField["ProductType"] = "PRODUCT_TYPE";
2346
+ /** Tag associated with the product or article. */
2347
+ SearchableField["Tag"] = "TAG";
2348
+ /** Title of the page or article or product title or collection title. */
2349
+ SearchableField["Title"] = "TITLE";
2350
+ /** Variant barcode. */
2351
+ SearchableField["VariantsBarcode"] = "VARIANTS_BARCODE";
2352
+ /** Variant SKU. */
2353
+ SearchableField["VariantsSku"] = "VARIANTS_SKU";
2354
+ /** Variant title. */
2355
+ SearchableField["VariantsTitle"] = "VARIANTS_TITLE";
2356
+ /** Product vendor. */
2357
+ SearchableField["Vendor"] = "VENDOR";
2358
+ })(SearchableField || (SearchableField = {}));
2359
+ /** The checkout charge when the full amount isn't charged at checkout. */
2360
+ var SellingPlanCheckoutChargeType;
2361
+ (function (SellingPlanCheckoutChargeType) {
2362
+ /** The checkout charge is a percentage of the product or variant price. */
2363
+ SellingPlanCheckoutChargeType["Percentage"] = "PERCENTAGE";
2364
+ /** The checkout charge is a fixed price amount. */
2365
+ SellingPlanCheckoutChargeType["Price"] = "PRICE";
2366
+ })(SellingPlanCheckoutChargeType || (SellingPlanCheckoutChargeType = {}));
2367
+ /** Represents a valid selling plan interval. */
2368
+ var SellingPlanInterval;
2369
+ (function (SellingPlanInterval) {
2370
+ /** Day interval. */
2371
+ SellingPlanInterval["Day"] = "DAY";
2372
+ /** Month interval. */
2373
+ SellingPlanInterval["Month"] = "MONTH";
2374
+ /** Week interval. */
2375
+ SellingPlanInterval["Week"] = "WEEK";
2376
+ /** Year interval. */
2377
+ SellingPlanInterval["Year"] = "YEAR";
2378
+ })(SellingPlanInterval || (SellingPlanInterval = {}));
2379
+ /** The payment frequency for a Shop Pay Installments Financing Plan. */
2380
+ var ShopPayInstallmentsFinancingPlanFrequency;
2381
+ (function (ShopPayInstallmentsFinancingPlanFrequency) {
2382
+ /** Monthly payment frequency. */
2383
+ ShopPayInstallmentsFinancingPlanFrequency["Monthly"] = "MONTHLY";
2384
+ /** Weekly payment frequency. */
2385
+ ShopPayInstallmentsFinancingPlanFrequency["Weekly"] = "WEEKLY";
2386
+ })(ShopPayInstallmentsFinancingPlanFrequency || (ShopPayInstallmentsFinancingPlanFrequency = {}));
2387
+ /** The loan type for a Shop Pay Installments Financing Plan Term. */
2388
+ var ShopPayInstallmentsLoan;
2389
+ (function (ShopPayInstallmentsLoan) {
2390
+ /** An interest-bearing loan type. */
2391
+ ShopPayInstallmentsLoan["Interest"] = "INTEREST";
2392
+ /** A split-pay loan type. */
2393
+ ShopPayInstallmentsLoan["SplitPay"] = "SPLIT_PAY";
2394
+ /** A zero-percent loan type. */
2395
+ ShopPayInstallmentsLoan["ZeroPercent"] = "ZERO_PERCENT";
2396
+ })(ShopPayInstallmentsLoan || (ShopPayInstallmentsLoan = {}));
2397
+ /** Represents the delivery method type for a Shop Pay payment request. */
2398
+ var ShopPayPaymentRequestDeliveryMethodType;
2399
+ (function (ShopPayPaymentRequestDeliveryMethodType) {
2400
+ /** The delivery method type is pickup. */
2401
+ ShopPayPaymentRequestDeliveryMethodType["Pickup"] = "PICKUP";
2402
+ /** The delivery method type is shipping. */
2403
+ ShopPayPaymentRequestDeliveryMethodType["Shipping"] = "SHIPPING";
2404
+ })(ShopPayPaymentRequestDeliveryMethodType || (ShopPayPaymentRequestDeliveryMethodType = {}));
2405
+ /** The types of resources potentially present in a sitemap. */
2406
+ var SitemapType;
2407
+ (function (SitemapType) {
2408
+ /** Articles present in the sitemap. */
2409
+ SitemapType["Article"] = "ARTICLE";
2410
+ /** Blogs present in the sitemap. */
2411
+ SitemapType["Blog"] = "BLOG";
2412
+ /** Collections present in the sitemap. */
2413
+ SitemapType["Collection"] = "COLLECTION";
2414
+ /**
2415
+ * Metaobjects present in the sitemap. Only metaobject types with the
2416
+ * [`renderable` capability](https://shopify.dev/docs/apps/build/custom-data/metaobjects/use-metaobject-capabilities#render-metaobjects-as-web-pages)
2417
+ * are included in sitemap.
2418
+ *
2419
+ */
2420
+ SitemapType["Metaobject"] = "METAOBJECT";
2421
+ /** Pages present in the sitemap. */
2422
+ SitemapType["Page"] = "PAGE";
2423
+ /** Products present in the sitemap. */
2424
+ SitemapType["Product"] = "PRODUCT";
2425
+ })(SitemapType || (SitemapType = {}));
2426
+ /** The code of the error that occurred during cart submit for completion. */
2427
+ var SubmissionErrorCode;
2428
+ (function (SubmissionErrorCode) {
2429
+ SubmissionErrorCode["BuyerIdentityEmailIsInvalid"] = "BUYER_IDENTITY_EMAIL_IS_INVALID";
2430
+ SubmissionErrorCode["BuyerIdentityEmailRequired"] = "BUYER_IDENTITY_EMAIL_REQUIRED";
2431
+ SubmissionErrorCode["BuyerIdentityPhoneIsInvalid"] = "BUYER_IDENTITY_PHONE_IS_INVALID";
2432
+ SubmissionErrorCode["DeliveryAddress1Invalid"] = "DELIVERY_ADDRESS1_INVALID";
2433
+ SubmissionErrorCode["DeliveryAddress1Required"] = "DELIVERY_ADDRESS1_REQUIRED";
2434
+ SubmissionErrorCode["DeliveryAddress1TooLong"] = "DELIVERY_ADDRESS1_TOO_LONG";
2435
+ SubmissionErrorCode["DeliveryAddress2Invalid"] = "DELIVERY_ADDRESS2_INVALID";
2436
+ SubmissionErrorCode["DeliveryAddress2Required"] = "DELIVERY_ADDRESS2_REQUIRED";
2437
+ SubmissionErrorCode["DeliveryAddress2TooLong"] = "DELIVERY_ADDRESS2_TOO_LONG";
2438
+ SubmissionErrorCode["DeliveryAddressRequired"] = "DELIVERY_ADDRESS_REQUIRED";
2439
+ SubmissionErrorCode["DeliveryCityInvalid"] = "DELIVERY_CITY_INVALID";
2440
+ SubmissionErrorCode["DeliveryCityRequired"] = "DELIVERY_CITY_REQUIRED";
2441
+ SubmissionErrorCode["DeliveryCityTooLong"] = "DELIVERY_CITY_TOO_LONG";
2442
+ SubmissionErrorCode["DeliveryCompanyInvalid"] = "DELIVERY_COMPANY_INVALID";
2443
+ SubmissionErrorCode["DeliveryCompanyRequired"] = "DELIVERY_COMPANY_REQUIRED";
2444
+ SubmissionErrorCode["DeliveryCompanyTooLong"] = "DELIVERY_COMPANY_TOO_LONG";
2445
+ SubmissionErrorCode["DeliveryCountryRequired"] = "DELIVERY_COUNTRY_REQUIRED";
2446
+ SubmissionErrorCode["DeliveryFirstNameInvalid"] = "DELIVERY_FIRST_NAME_INVALID";
2447
+ SubmissionErrorCode["DeliveryFirstNameRequired"] = "DELIVERY_FIRST_NAME_REQUIRED";
2448
+ SubmissionErrorCode["DeliveryFirstNameTooLong"] = "DELIVERY_FIRST_NAME_TOO_LONG";
2449
+ SubmissionErrorCode["DeliveryInvalidPostalCodeForCountry"] = "DELIVERY_INVALID_POSTAL_CODE_FOR_COUNTRY";
2450
+ SubmissionErrorCode["DeliveryInvalidPostalCodeForZone"] = "DELIVERY_INVALID_POSTAL_CODE_FOR_ZONE";
2451
+ SubmissionErrorCode["DeliveryLastNameInvalid"] = "DELIVERY_LAST_NAME_INVALID";
2452
+ SubmissionErrorCode["DeliveryLastNameRequired"] = "DELIVERY_LAST_NAME_REQUIRED";
2453
+ SubmissionErrorCode["DeliveryLastNameTooLong"] = "DELIVERY_LAST_NAME_TOO_LONG";
2454
+ SubmissionErrorCode["DeliveryNoDeliveryAvailable"] = "DELIVERY_NO_DELIVERY_AVAILABLE";
2455
+ SubmissionErrorCode["DeliveryNoDeliveryAvailableForMerchandiseLine"] = "DELIVERY_NO_DELIVERY_AVAILABLE_FOR_MERCHANDISE_LINE";
2456
+ SubmissionErrorCode["DeliveryOptionsPhoneNumberInvalid"] = "DELIVERY_OPTIONS_PHONE_NUMBER_INVALID";
2457
+ SubmissionErrorCode["DeliveryOptionsPhoneNumberRequired"] = "DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED";
2458
+ SubmissionErrorCode["DeliveryPhoneNumberInvalid"] = "DELIVERY_PHONE_NUMBER_INVALID";
2459
+ SubmissionErrorCode["DeliveryPhoneNumberRequired"] = "DELIVERY_PHONE_NUMBER_REQUIRED";
2460
+ SubmissionErrorCode["DeliveryPostalCodeInvalid"] = "DELIVERY_POSTAL_CODE_INVALID";
2461
+ SubmissionErrorCode["DeliveryPostalCodeRequired"] = "DELIVERY_POSTAL_CODE_REQUIRED";
2462
+ SubmissionErrorCode["DeliveryZoneNotFound"] = "DELIVERY_ZONE_NOT_FOUND";
2463
+ SubmissionErrorCode["DeliveryZoneRequiredForCountry"] = "DELIVERY_ZONE_REQUIRED_FOR_COUNTRY";
2464
+ SubmissionErrorCode["Error"] = "ERROR";
2465
+ SubmissionErrorCode["MerchandiseLineLimitReached"] = "MERCHANDISE_LINE_LIMIT_REACHED";
2466
+ SubmissionErrorCode["MerchandiseNotApplicable"] = "MERCHANDISE_NOT_APPLICABLE";
2467
+ SubmissionErrorCode["MerchandiseNotEnoughStockAvailable"] = "MERCHANDISE_NOT_ENOUGH_STOCK_AVAILABLE";
2468
+ SubmissionErrorCode["MerchandiseOutOfStock"] = "MERCHANDISE_OUT_OF_STOCK";
2469
+ SubmissionErrorCode["MerchandiseProductNotPublished"] = "MERCHANDISE_PRODUCT_NOT_PUBLISHED";
2470
+ SubmissionErrorCode["NoDeliveryGroupSelected"] = "NO_DELIVERY_GROUP_SELECTED";
2471
+ SubmissionErrorCode["PaymentsAddress1Invalid"] = "PAYMENTS_ADDRESS1_INVALID";
2472
+ SubmissionErrorCode["PaymentsAddress1Required"] = "PAYMENTS_ADDRESS1_REQUIRED";
2473
+ SubmissionErrorCode["PaymentsAddress1TooLong"] = "PAYMENTS_ADDRESS1_TOO_LONG";
2474
+ SubmissionErrorCode["PaymentsAddress2Invalid"] = "PAYMENTS_ADDRESS2_INVALID";
2475
+ SubmissionErrorCode["PaymentsAddress2Required"] = "PAYMENTS_ADDRESS2_REQUIRED";
2476
+ SubmissionErrorCode["PaymentsAddress2TooLong"] = "PAYMENTS_ADDRESS2_TOO_LONG";
2477
+ SubmissionErrorCode["PaymentsBillingAddressZoneNotFound"] = "PAYMENTS_BILLING_ADDRESS_ZONE_NOT_FOUND";
2478
+ SubmissionErrorCode["PaymentsBillingAddressZoneRequiredForCountry"] = "PAYMENTS_BILLING_ADDRESS_ZONE_REQUIRED_FOR_COUNTRY";
2479
+ SubmissionErrorCode["PaymentsCityInvalid"] = "PAYMENTS_CITY_INVALID";
2480
+ SubmissionErrorCode["PaymentsCityRequired"] = "PAYMENTS_CITY_REQUIRED";
2481
+ SubmissionErrorCode["PaymentsCityTooLong"] = "PAYMENTS_CITY_TOO_LONG";
2482
+ SubmissionErrorCode["PaymentsCompanyInvalid"] = "PAYMENTS_COMPANY_INVALID";
2483
+ SubmissionErrorCode["PaymentsCompanyRequired"] = "PAYMENTS_COMPANY_REQUIRED";
2484
+ SubmissionErrorCode["PaymentsCompanyTooLong"] = "PAYMENTS_COMPANY_TOO_LONG";
2485
+ SubmissionErrorCode["PaymentsCountryRequired"] = "PAYMENTS_COUNTRY_REQUIRED";
2486
+ SubmissionErrorCode["PaymentsCreditCardBaseExpired"] = "PAYMENTS_CREDIT_CARD_BASE_EXPIRED";
2487
+ SubmissionErrorCode["PaymentsCreditCardBaseGatewayNotSupported"] = "PAYMENTS_CREDIT_CARD_BASE_GATEWAY_NOT_SUPPORTED";
2488
+ SubmissionErrorCode["PaymentsCreditCardBaseInvalidStartDateOrIssueNumberForDebit"] = "PAYMENTS_CREDIT_CARD_BASE_INVALID_START_DATE_OR_ISSUE_NUMBER_FOR_DEBIT";
2489
+ SubmissionErrorCode["PaymentsCreditCardBrandNotSupported"] = "PAYMENTS_CREDIT_CARD_BRAND_NOT_SUPPORTED";
2490
+ SubmissionErrorCode["PaymentsCreditCardFirstNameBlank"] = "PAYMENTS_CREDIT_CARD_FIRST_NAME_BLANK";
2491
+ SubmissionErrorCode["PaymentsCreditCardGeneric"] = "PAYMENTS_CREDIT_CARD_GENERIC";
2492
+ SubmissionErrorCode["PaymentsCreditCardLastNameBlank"] = "PAYMENTS_CREDIT_CARD_LAST_NAME_BLANK";
2493
+ SubmissionErrorCode["PaymentsCreditCardMonthInclusion"] = "PAYMENTS_CREDIT_CARD_MONTH_INCLUSION";
2494
+ SubmissionErrorCode["PaymentsCreditCardNameInvalid"] = "PAYMENTS_CREDIT_CARD_NAME_INVALID";
2495
+ SubmissionErrorCode["PaymentsCreditCardNumberInvalid"] = "PAYMENTS_CREDIT_CARD_NUMBER_INVALID";
2496
+ SubmissionErrorCode["PaymentsCreditCardNumberInvalidFormat"] = "PAYMENTS_CREDIT_CARD_NUMBER_INVALID_FORMAT";
2497
+ SubmissionErrorCode["PaymentsCreditCardSessionId"] = "PAYMENTS_CREDIT_CARD_SESSION_ID";
2498
+ SubmissionErrorCode["PaymentsCreditCardVerificationValueBlank"] = "PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_BLANK";
2499
+ SubmissionErrorCode["PaymentsCreditCardVerificationValueInvalidForCardType"] = "PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_INVALID_FOR_CARD_TYPE";
2500
+ SubmissionErrorCode["PaymentsCreditCardYearExpired"] = "PAYMENTS_CREDIT_CARD_YEAR_EXPIRED";
2501
+ SubmissionErrorCode["PaymentsCreditCardYearInvalidExpiryYear"] = "PAYMENTS_CREDIT_CARD_YEAR_INVALID_EXPIRY_YEAR";
2502
+ SubmissionErrorCode["PaymentsFirstNameInvalid"] = "PAYMENTS_FIRST_NAME_INVALID";
2503
+ SubmissionErrorCode["PaymentsFirstNameRequired"] = "PAYMENTS_FIRST_NAME_REQUIRED";
2504
+ SubmissionErrorCode["PaymentsFirstNameTooLong"] = "PAYMENTS_FIRST_NAME_TOO_LONG";
2505
+ SubmissionErrorCode["PaymentsInvalidPostalCodeForCountry"] = "PAYMENTS_INVALID_POSTAL_CODE_FOR_COUNTRY";
2506
+ SubmissionErrorCode["PaymentsInvalidPostalCodeForZone"] = "PAYMENTS_INVALID_POSTAL_CODE_FOR_ZONE";
2507
+ SubmissionErrorCode["PaymentsLastNameInvalid"] = "PAYMENTS_LAST_NAME_INVALID";
2508
+ SubmissionErrorCode["PaymentsLastNameRequired"] = "PAYMENTS_LAST_NAME_REQUIRED";
2509
+ SubmissionErrorCode["PaymentsLastNameTooLong"] = "PAYMENTS_LAST_NAME_TOO_LONG";
2510
+ SubmissionErrorCode["PaymentsMethodRequired"] = "PAYMENTS_METHOD_REQUIRED";
2511
+ SubmissionErrorCode["PaymentsMethodUnavailable"] = "PAYMENTS_METHOD_UNAVAILABLE";
2512
+ SubmissionErrorCode["PaymentsPhoneNumberInvalid"] = "PAYMENTS_PHONE_NUMBER_INVALID";
2513
+ SubmissionErrorCode["PaymentsPhoneNumberRequired"] = "PAYMENTS_PHONE_NUMBER_REQUIRED";
2514
+ SubmissionErrorCode["PaymentsPostalCodeInvalid"] = "PAYMENTS_POSTAL_CODE_INVALID";
2515
+ SubmissionErrorCode["PaymentsPostalCodeRequired"] = "PAYMENTS_POSTAL_CODE_REQUIRED";
2516
+ SubmissionErrorCode["PaymentsShopifyPaymentsRequired"] = "PAYMENTS_SHOPIFY_PAYMENTS_REQUIRED";
2517
+ SubmissionErrorCode["PaymentsUnacceptablePaymentAmount"] = "PAYMENTS_UNACCEPTABLE_PAYMENT_AMOUNT";
2518
+ SubmissionErrorCode["PaymentsWalletContentMissing"] = "PAYMENTS_WALLET_CONTENT_MISSING";
2519
+ SubmissionErrorCode["TaxesDeliveryGroupIdNotFound"] = "TAXES_DELIVERY_GROUP_ID_NOT_FOUND";
2520
+ SubmissionErrorCode["TaxesLineIdNotFound"] = "TAXES_LINE_ID_NOT_FOUND";
2521
+ SubmissionErrorCode["TaxesMustBeDefined"] = "TAXES_MUST_BE_DEFINED";
2522
+ })(SubmissionErrorCode || (SubmissionErrorCode = {}));
2523
+ /** The accepted types of unit of measurement. */
2524
+ var UnitPriceMeasurementMeasuredType;
2525
+ (function (UnitPriceMeasurementMeasuredType) {
2526
+ /** Unit of measurements representing areas. */
2527
+ UnitPriceMeasurementMeasuredType["Area"] = "AREA";
2528
+ /** Unit of measurements representing lengths. */
2529
+ UnitPriceMeasurementMeasuredType["Length"] = "LENGTH";
2530
+ /** Unit of measurements representing volumes. */
2531
+ UnitPriceMeasurementMeasuredType["Volume"] = "VOLUME";
2532
+ /** Unit of measurements representing weights. */
2533
+ UnitPriceMeasurementMeasuredType["Weight"] = "WEIGHT";
2534
+ })(UnitPriceMeasurementMeasuredType || (UnitPriceMeasurementMeasuredType = {}));
2535
+ /** The valid units of measurement for a unit price measurement. */
2536
+ var UnitPriceMeasurementMeasuredUnit;
2537
+ (function (UnitPriceMeasurementMeasuredUnit) {
2538
+ /** 100 centiliters equals 1 liter. */
2539
+ UnitPriceMeasurementMeasuredUnit["Cl"] = "CL";
2540
+ /** 100 centimeters equals 1 meter. */
2541
+ UnitPriceMeasurementMeasuredUnit["Cm"] = "CM";
2542
+ /** Metric system unit of weight. */
2543
+ UnitPriceMeasurementMeasuredUnit["G"] = "G";
2544
+ /** 1 kilogram equals 1000 grams. */
2545
+ UnitPriceMeasurementMeasuredUnit["Kg"] = "KG";
2546
+ /** Metric system unit of volume. */
2547
+ UnitPriceMeasurementMeasuredUnit["L"] = "L";
2548
+ /** Metric system unit of length. */
2549
+ UnitPriceMeasurementMeasuredUnit["M"] = "M";
2550
+ /** Metric system unit of area. */
2551
+ UnitPriceMeasurementMeasuredUnit["M2"] = "M2";
2552
+ /** 1 cubic meter equals 1000 liters. */
2553
+ UnitPriceMeasurementMeasuredUnit["M3"] = "M3";
2554
+ /** 1000 milligrams equals 1 gram. */
2555
+ UnitPriceMeasurementMeasuredUnit["Mg"] = "MG";
2556
+ /** 1000 milliliters equals 1 liter. */
2557
+ UnitPriceMeasurementMeasuredUnit["Ml"] = "ML";
2558
+ /** 1000 millimeters equals 1 meter. */
2559
+ UnitPriceMeasurementMeasuredUnit["Mm"] = "MM";
2560
+ })(UnitPriceMeasurementMeasuredUnit || (UnitPriceMeasurementMeasuredUnit = {}));
2561
+ /** Systems of weights and measures. */
2562
+ var UnitSystem;
2563
+ (function (UnitSystem) {
2564
+ /** Imperial system of weights and measures. */
2565
+ UnitSystem["ImperialSystem"] = "IMPERIAL_SYSTEM";
2566
+ /** Metric system of weights and measures. */
2567
+ UnitSystem["MetricSystem"] = "METRIC_SYSTEM";
2568
+ })(UnitSystem || (UnitSystem = {}));
2569
+ /** Possible error codes that can be returned by `ShopPayPaymentRequestSessionUserErrors`. */
2570
+ var UserErrorsShopPayPaymentRequestSessionUserErrorsCode;
2571
+ (function (UserErrorsShopPayPaymentRequestSessionUserErrorsCode) {
2572
+ /** Idempotency key has already been used. */
2573
+ UserErrorsShopPayPaymentRequestSessionUserErrorsCode["IdempotencyKeyAlreadyUsed"] = "IDEMPOTENCY_KEY_ALREADY_USED";
2574
+ /** Payment request input is invalid. */
2575
+ UserErrorsShopPayPaymentRequestSessionUserErrorsCode["PaymentRequestInvalidInput"] = "PAYMENT_REQUEST_INVALID_INPUT";
2576
+ /** Payment request not found. */
2577
+ UserErrorsShopPayPaymentRequestSessionUserErrorsCode["PaymentRequestNotFound"] = "PAYMENT_REQUEST_NOT_FOUND";
2578
+ })(UserErrorsShopPayPaymentRequestSessionUserErrorsCode || (UserErrorsShopPayPaymentRequestSessionUserErrorsCode = {}));
2579
+ /** Units of measurement for weight. */
2580
+ var WeightUnit;
2581
+ (function (WeightUnit) {
2582
+ /** Metric system unit of mass. */
2583
+ WeightUnit["Grams"] = "GRAMS";
2584
+ /** 1 kilogram equals 1000 grams. */
2585
+ WeightUnit["Kilograms"] = "KILOGRAMS";
2586
+ /** Imperial system unit of mass. */
2587
+ WeightUnit["Ounces"] = "OUNCES";
2588
+ /** 1 pound equals 16 ounces. */
2589
+ WeightUnit["Pounds"] = "POUNDS";
2590
+ })(WeightUnit || (WeightUnit = {}));
2591
+ var TypedDocumentString = /*#__PURE__*/function (_String) {
2592
+ _inheritsLoose(TypedDocumentString, _String);
2593
+ function TypedDocumentString(value, __meta__) {
2594
+ var _this;
2595
+ _this = _String.call(this, value) || this;
2596
+ _this.value = value;
2597
+ _this.__meta__ = __meta__;
2598
+ return _this;
496
2599
  }
497
- return _extends({
498
- categoryId: categoryId,
499
- query: query
500
- }, getSortVariables(sort, !!categoryId), locale && {
501
- locale: locale
502
- }, {
503
- first: count
504
- });
505
- };
2600
+ var _proto = TypedDocumentString.prototype;
2601
+ _proto.toString = function toString() {
2602
+ return this.value;
2603
+ };
2604
+ return TypedDocumentString;
2605
+ }(/*#__PURE__*/_wrapNativeSuper(String));
2606
+ var ImageFragmentDoc = /*#__PURE__*/new TypedDocumentString("\n fragment image on Image {\n url\n altText\n width\n height\n}\n ", {
2607
+ fragmentName: "image"
2608
+ });
2609
+ var ProductVariantFragmentDoc = /*#__PURE__*/new TypedDocumentString("\n fragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\n fragment image on Image {\n url\n altText\n width\n height\n}", {
2610
+ fragmentName: "productVariant"
2611
+ });
2612
+ var SeoFragmentDoc = /*#__PURE__*/new TypedDocumentString("\n fragment seo on SEO {\n description\n title\n}\n ", {
2613
+ fragmentName: "seo"
2614
+ });
2615
+ var ProductFragmentDoc = /*#__PURE__*/new TypedDocumentString("\n fragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\n fragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment seo on SEO {\n description\n title\n}", {
2616
+ fragmentName: "product"
2617
+ });
2618
+ var CartFragmentDoc = /*#__PURE__*/new TypedDocumentString("\n fragment cart on Cart {\n id\n createdAt\n checkoutUrl\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n ...productVariant\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n}\n fragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}", {
2619
+ fragmentName: "cart"
2620
+ });
2621
+ var CollectionFragmentDoc = /*#__PURE__*/new TypedDocumentString("\n fragment collection on Collection {\n id\n title\n handle\n image {\n ...image\n }\n}\n fragment image on Image {\n url\n altText\n width\n height\n}", {
2622
+ fragmentName: "collection"
2623
+ });
2624
+ var AddToCartDocument = /*#__PURE__*/new TypedDocumentString("\n mutation addToCart($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n }\n}\n fragment cart on Cart {\n id\n createdAt\n checkoutUrl\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n ...productVariant\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n}\nfragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
2625
+ var CreateCartDocument = /*#__PURE__*/new TypedDocumentString("\n mutation createCart($lines: [CartLineInput!]) {\n cartCreate(input: {lines: $lines}) {\n cart {\n ...cart\n }\n }\n}\n fragment cart on Cart {\n id\n createdAt\n checkoutUrl\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n ...productVariant\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n}\nfragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
2626
+ var EditCartItemsDocument = /*#__PURE__*/new TypedDocumentString("\n mutation editCartItems($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n }\n}\n fragment cart on Cart {\n id\n createdAt\n checkoutUrl\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n ...productVariant\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n}\nfragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
2627
+ var RemoveFromCartDocument = /*#__PURE__*/new TypedDocumentString("\n mutation removeFromCart($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart {\n ...cart\n }\n }\n}\n fragment cart on Cart {\n id\n createdAt\n checkoutUrl\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n ...productVariant\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n}\nfragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
2628
+ var CustomerActivateByUrlDocument = /*#__PURE__*/new TypedDocumentString("\n mutation customerActivateByUrl($activationUrl: URL!, $password: String!) {\n customerActivateByUrl(activationUrl: $activationUrl, password: $password) {\n customer {\n id\n }\n customerAccessToken {\n accessToken\n expiresAt\n }\n customerUserErrors {\n code\n field\n message\n }\n }\n}\n ");
2629
+ var GetSiteCollectionsDocument = /*#__PURE__*/new TypedDocumentString("\n query getSiteCollections($first: Int!) {\n collections(first: $first) {\n edges {\n node {\n ...collection\n products(first: $first) {\n edges {\n node {\n id\n }\n }\n }\n }\n }\n }\n}\n fragment collection on Collection {\n id\n title\n handle\n image {\n ...image\n }\n}\nfragment image on Image {\n url\n altText\n width\n height\n}");
2630
+ var GetAllProductVendorsDocument = /*#__PURE__*/new TypedDocumentString("\n query getAllProductVendors($first: Int = 250, $cursor: String) {\n products(first: $first, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n vendor\n }\n cursor\n }\n }\n}\n ");
2631
+ var GetAllProductsDocument = /*#__PURE__*/new TypedDocumentString("\n query getAllProducts($first: Int = 250, $query: String = \"\", $sortKey: ProductSortKeys = RELEVANCE, $reverse: Boolean = false) {\n products(first: $first, sortKey: $sortKey, reverse: $reverse, query: $query) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n ...product\n }\n }\n }\n}\n fragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
2632
+ var GetCartDocument = /*#__PURE__*/new TypedDocumentString("\n query getCart($cartId: ID!) {\n cart(id: $cartId) {\n ...cart\n }\n}\n fragment cart on Cart {\n id\n createdAt\n checkoutUrl\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n ...productVariant\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n}\nfragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
2633
+ var GetProductsFromCollectionDocument = /*#__PURE__*/new TypedDocumentString("\n query getProductsFromCollection($categoryId: ID!, $first: Int = 250, $sortKey: ProductCollectionSortKeys = RELEVANCE, $reverse: Boolean = false) {\n node(id: $categoryId) {\n id\n ... on Collection {\n ...collection\n products(first: $first, sortKey: $sortKey, reverse: $reverse) {\n edges {\n node {\n ...product\n }\n }\n }\n }\n }\n}\n fragment collection on Collection {\n id\n title\n handle\n image {\n ...image\n }\n}\nfragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
2634
+ var GetSiteCollectionDocument = /*#__PURE__*/new TypedDocumentString("\n query getSiteCollection($id: ID, $handle: String, $first: Int = 1) {\n collection(id: $id, handle: $handle) {\n ...collection\n products(first: $first) {\n edges {\n node {\n id\n }\n }\n }\n }\n}\n fragment collection on Collection {\n id\n title\n handle\n image {\n ...image\n }\n}\nfragment image on Image {\n url\n altText\n width\n height\n}");
2635
+ var GetProductBySlugDocument = /*#__PURE__*/new TypedDocumentString("\n query getProductBySlug($slug: String!) {\n productByHandle(handle: $slug) {\n ...product\n }\n}\n fragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
2636
+ var GetProductByIdDocument = /*#__PURE__*/new TypedDocumentString("\n query getProductById($id: ID!) {\n product(id: $id) {\n ...product\n }\n}\n fragment image on Image {\n url\n altText\n width\n height\n}\nfragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n}\nfragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n}\nfragment seo on SEO {\n description\n title\n}");
506
2637
 
507
- /*
508
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
509
- Changes: None
510
- */
511
- var getCheckoutId = function getCheckoutId(id) {
512
- return id != null ? id : Cookies.get(SHOPIFY_CHECKOUT_ID_COOKIE);
2638
+ /* eslint-disable */
2639
+ /**
2640
+ * Map of all GraphQL operations in the project.
2641
+ *
2642
+ * This map has several performance disadvantages:
2643
+ * 1. It is not tree-shakeable, so it will include all operations in the project.
2644
+ * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.
2645
+ * 3. It does not support dead code elimination, so it will add unused operations.
2646
+ *
2647
+ * Therefore it is highly recommended to use the babel or swc plugin for production.
2648
+ * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
2649
+ */
2650
+ var documents = {
2651
+ "\n fragment cart on Cart {\n id\n createdAt\n checkoutUrl\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n ...productVariant\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n": CartFragmentDoc,
2652
+ "\n fragment collection on Collection {\n id\n title\n handle\n image {\n ...image\n }\n }\n": CollectionFragmentDoc,
2653
+ "\n fragment image on Image {\n url\n altText\n width\n height\n }\n": ImageFragmentDoc,
2654
+ "\n fragment productVariant on ProductVariant {\n id\n sku\n title\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n }\n": ProductVariantFragmentDoc,
2655
+ "\n fragment product on Product {\n id\n handle\n availableForSale\n title\n productType\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n edges {\n node {\n ...productVariant\n }\n }\n }\n featuredImage {\n ...image\n }\n images(first: 20) {\n edges {\n node {\n ...image\n }\n }\n }\n seo {\n ...seo\n }\n tags\n updatedAt\n vendor\n }\n": ProductFragmentDoc,
2656
+ "\n fragment seo on SEO {\n description\n title\n }\n": SeoFragmentDoc,
2657
+ "\n mutation addToCart($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n }\n }\n": AddToCartDocument,
2658
+ "\n mutation createCart($lines: [CartLineInput!]) {\n cartCreate(input: { lines: $lines }) {\n cart {\n ...cart\n }\n }\n }\n": CreateCartDocument,
2659
+ "\n mutation editCartItems($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n }\n }\n": EditCartItemsDocument,
2660
+ "\n mutation removeFromCart($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart {\n ...cart\n }\n }\n }\n": RemoveFromCartDocument,
2661
+ "\n mutation customerActivateByUrl($activationUrl: URL!, $password: String!) {\n customerActivateByUrl(activationUrl: $activationUrl, password: $password) {\n customer {\n id\n }\n customerAccessToken {\n accessToken\n expiresAt\n }\n customerUserErrors {\n code\n field\n message\n }\n }\n }\n": CustomerActivateByUrlDocument,
2662
+ "\n query getSiteCollections($first: Int!) {\n collections(first: $first) {\n edges {\n node {\n ...collection\n products(first: $first) {\n edges {\n node {\n id\n }\n }\n }\n }\n }\n }\n }\n": GetSiteCollectionsDocument,
2663
+ "\n query getAllProductVendors($first: Int = 250, $cursor: String) {\n products(first: $first, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n vendor\n }\n cursor\n }\n }\n }\n": GetAllProductVendorsDocument,
2664
+ '\n query getAllProducts(\n $first: Int = 250\n $query: String = ""\n $sortKey: ProductSortKeys = RELEVANCE\n $reverse: Boolean = false\n ) {\n products(\n first: $first\n sortKey: $sortKey\n reverse: $reverse\n query: $query\n ) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n ...product\n }\n }\n }\n }\n': GetAllProductsDocument,
2665
+ "\n query getCart($cartId: ID!) {\n cart(id: $cartId) {\n ...cart\n }\n }\n": GetCartDocument,
2666
+ "\n query getProductsFromCollection(\n $categoryId: ID!\n $first: Int = 250\n $sortKey: ProductCollectionSortKeys = RELEVANCE\n $reverse: Boolean = false\n ) {\n node(id: $categoryId) {\n id\n ... on Collection {\n ...collection\n products(first: $first, sortKey: $sortKey, reverse: $reverse) {\n edges {\n node {\n ...product\n }\n }\n }\n }\n }\n }\n": GetProductsFromCollectionDocument,
2667
+ "\n query getSiteCollection($id: ID, $handle: String, $first: Int = 1) {\n collection(id: $id, handle: $handle) {\n ...collection\n products(first: $first) {\n edges {\n node {\n id\n }\n }\n }\n }\n }\n": GetSiteCollectionDocument,
2668
+ "\n query getProductBySlug($slug: String!) {\n productByHandle(handle: $slug) {\n ...product\n }\n }\n": GetProductBySlugDocument,
2669
+ "\n query getProductById($id: ID!) {\n product(id: $id) {\n ...product\n }\n }\n": GetProductByIdDocument
513
2670
  };
2671
+ function graphql(source) {
2672
+ var _documents$source;
2673
+ return (_documents$source = documents[source]) != null ? _documents$source : {};
2674
+ }
514
2675
 
515
- /*
516
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
517
- Changes: None
518
- */
519
- var checkoutDetailsFragment = /* GraphQL */"\n fragment checkoutDetails on Checkout {\n id\n webUrl\n subtotalPriceV2 {\n amount\n currencyCode\n }\n totalTaxV2 {\n amount\n currencyCode\n }\n totalPriceV2 {\n amount\n currencyCode\n }\n completedAt\n createdAt\n taxesIncluded\n lineItems(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n variant {\n id\n sku\n title\n selectedOptions {\n name\n value\n }\n image {\n originalSrc\n altText\n width\n height\n }\n priceV2 {\n amount\n currencyCode\n }\n compareAtPriceV2 {\n amount\n currencyCode\n }\n product {\n id\n handle\n }\n }\n quantity\n }\n }\n }\n }\n";
520
- var getCheckoutQuery = /* GraphQL */"\n query getCheckout($checkoutId: ID!) {\n node(id: $checkoutId) {\n ...checkoutDetails\n }\n }\n " + checkoutDetailsFragment + "\n";
521
-
522
- /*
523
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
524
- Changes: None
525
- */
526
- var checkoutCreateMutation = /* GraphQL */"\n mutation checkoutCreate($input: CheckoutCreateInput = {}) {\n checkoutCreate(input: $input) {\n checkoutUserErrors {\n code\n field\n message\n }\n checkout {\n ...checkoutDetails\n }\n }\n }\n\n " + checkoutDetailsFragment + "\n";
527
-
528
- var checkoutCreate = /*#__PURE__*/function () {
529
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fetch, lineItems) {
530
- var _yield$fetch, checkoutCreate, checkout, checkoutId, options;
531
- return _regeneratorRuntime().wrap(function _callee$(_context) {
532
- while (1) switch (_context.prev = _context.next) {
533
- case 0:
534
- _context.next = 2;
535
- return fetch({
536
- query: checkoutCreateMutation,
537
- variables: {
538
- input: {
539
- lineItems: lineItems
540
- }
541
- }
542
- });
543
- case 2:
544
- _yield$fetch = _context.sent;
545
- checkoutCreate = _yield$fetch.checkoutCreate;
546
- checkout = checkoutCreate == null ? void 0 : checkoutCreate.checkout;
547
- if (checkout) {
548
- checkoutId = checkout == null ? void 0 : checkout.id;
549
- options = {
550
- expires: SHOPIFY_COOKIE_EXPIRE,
551
- sameSite: "none",
552
- secure: true
553
- };
554
- Cookies.set(SHOPIFY_CHECKOUT_ID_COOKIE, checkoutId, options);
555
- if (checkout != null && checkout.webUrl) {
556
- Cookies.set(SHOPIFY_CHECKOUT_URL_COOKIE, checkout.webUrl, options);
557
- }
558
- }
559
- return _context.abrupt("return", checkoutCreate);
560
- case 7:
561
- case "end":
562
- return _context.stop();
563
- }
564
- }, _callee);
565
- }));
566
- return function checkoutCreate(_x, _x2) {
567
- return _ref.apply(this, arguments);
568
- };
569
- }();
2676
+ var addToCartMutation = /*#__PURE__*/graphql("\n mutation addToCart($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n }\n }\n");
2677
+ var createCartMutation = /*#__PURE__*/graphql("\n mutation createCart($lines: [CartLineInput!]) {\n cartCreate(input: { lines: $lines }) {\n cart {\n ...cart\n }\n }\n }\n");
2678
+ var editCartItemsMutation = /*#__PURE__*/graphql("\n mutation editCartItems($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n }\n }\n");
2679
+ var removeFromCartMutation = /*#__PURE__*/graphql("\n mutation removeFromCart($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart {\n ...cart\n }\n }\n }\n");
570
2680
 
571
2681
  /*
572
2682
  Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
@@ -727,8 +2837,7 @@ var colorMap = {
727
2837
  yellowgreen: '#9ACD32'
728
2838
  };
729
2839
 
730
- var _excluded = ["originalSrc"],
731
- _excluded2 = ["id", "title", "vendor", "images", "variants", "description", "descriptionHtml", "handle", "priceRange", "options", "metafields"];
2840
+ var _excluded = ["id", "title", "vendor", "images", "variants", "description", "handle", "priceRange", "options"];
732
2841
  var money = function money(_ref) {
733
2842
  var amount = _ref.amount,
734
2843
  currencyCode = _ref.currencyCode;
@@ -764,155 +2873,123 @@ var normalizeProductOption = function normalizeProductOption(_ref2) {
764
2873
  })
765
2874
  };
766
2875
  };
767
- var normalizeImage = function normalizeImage(_ref3) {
768
- var url = _ref3.originalSrc,
2876
+ function normalizeProduct(_ref3) {
2877
+ var id = _ref3.id,
2878
+ name = _ref3.title,
2879
+ images = _ref3.images,
2880
+ variants = _ref3.variants,
2881
+ description = _ref3.description,
2882
+ handle = _ref3.handle,
2883
+ priceRange = _ref3.priceRange,
2884
+ options = _ref3.options,
769
2885
  rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
770
- return _extends({
771
- url: url
772
- }, rest);
773
- };
774
- var normalizeProductImages = function normalizeProductImages(_ref4) {
775
- var edges = _ref4.edges;
776
- return edges == null ? void 0 : edges.map(function (_ref5) {
777
- var node = _ref5.node;
778
- return normalizeImage(node);
779
- });
780
- };
781
- var normalizeProductVariants = function normalizeProductVariants(_ref6) {
782
- var edges = _ref6.edges;
783
- return edges == null ? void 0 : edges.map(function (_ref7) {
784
- var _ref7$node = _ref7.node,
785
- id = _ref7$node.id,
786
- selectedOptions = _ref7$node.selectedOptions,
787
- sku = _ref7$node.sku,
788
- title = _ref7$node.title,
789
- priceV2 = _ref7$node.priceV2,
790
- compareAtPriceV2 = _ref7$node.compareAtPriceV2,
791
- requiresShipping = _ref7$node.requiresShipping,
792
- availableForSale = _ref7$node.availableForSale;
793
- return {
794
- id: id,
795
- name: selectedOptions.some(function (o) {
796
- return !isDefaultOption(o);
797
- }) ? title : "Default variant",
798
- sku: sku != null ? sku : id,
799
- price: +priceV2.amount,
800
- listPrice: +(compareAtPriceV2 == null ? void 0 : compareAtPriceV2.amount),
801
- requiresShipping: requiresShipping,
802
- availableForSale: availableForSale,
803
- options: selectedOptions.map(function (_ref8) {
804
- var name = _ref8.name,
805
- value = _ref8.value;
806
- var options = normalizeProductOption({
807
- id: id,
808
- name: name,
809
- values: [value]
810
- });
811
- return options;
812
- })
813
- };
814
- });
815
- };
816
- function normalizeProduct(_ref9) {
817
- var id = _ref9.id,
818
- name = _ref9.title,
819
- vendor = _ref9.vendor,
820
- images = _ref9.images,
821
- variants = _ref9.variants,
822
- description = _ref9.description,
823
- descriptionHtml = _ref9.descriptionHtml,
824
- handle = _ref9.handle,
825
- priceRange = _ref9.priceRange,
826
- options = _ref9.options,
827
- rest = _objectWithoutPropertiesLoose(_ref9, _excluded2);
828
2886
  return _extends({
829
2887
  id: id,
830
2888
  name: name,
831
- vendor: vendor,
2889
+ description: description || "",
832
2890
  path: "/" + handle,
833
2891
  slug: handle == null ? void 0 : handle.replace(/^\/+|\/+$/g, ""),
834
2892
  price: money(priceRange == null ? void 0 : priceRange.minVariantPrice),
835
- images: normalizeProductImages(images),
836
- variants: variants ? normalizeProductVariants(variants) : [],
2893
+ images: images.edges.map(function (edge) {
2894
+ return normalizeImage(edge.node);
2895
+ }),
2896
+ variants: variants.edges.map(function (_ref4) {
2897
+ var _ref4$node = _ref4.node,
2898
+ id = _ref4$node.id,
2899
+ selectedOptions = _ref4$node.selectedOptions,
2900
+ sku = _ref4$node.sku,
2901
+ title = _ref4$node.title,
2902
+ price = _ref4$node.price,
2903
+ compareAtPrice = _ref4$node.compareAtPrice,
2904
+ requiresShipping = _ref4$node.requiresShipping,
2905
+ availableForSale = _ref4$node.availableForSale;
2906
+ return {
2907
+ id: id,
2908
+ name: selectedOptions.some(function (o) {
2909
+ return !isDefaultOption(o);
2910
+ }) ? title : "Default variant",
2911
+ sku: sku != null ? sku : id,
2912
+ price: +price.amount,
2913
+ listPrice: +(compareAtPrice == null ? void 0 : compareAtPrice.amount),
2914
+ requiresShipping: requiresShipping,
2915
+ availableForSale: availableForSale,
2916
+ options: selectedOptions.map(function (_ref5) {
2917
+ var name = _ref5.name,
2918
+ value = _ref5.value;
2919
+ var options = normalizeProductOption({
2920
+ id: id,
2921
+ name: name,
2922
+ optionValues: [{
2923
+ id: id,
2924
+ name: name
2925
+ }],
2926
+ values: [value]
2927
+ });
2928
+ return options;
2929
+ })
2930
+ };
2931
+ }),
837
2932
  options: options ? options.filter(function (o) {
838
2933
  return !isDefaultOption(o);
839
2934
  }) // By default Shopify adds a 'Title' name when there's only one option. We don't need it. https://community.shopify.com/c/Shopify-APIs-SDKs/Adding-new-product-variant-is-automatically-adding-quot-Default/td-p/358095
840
2935
  .map(function (o) {
841
2936
  return normalizeProductOption(o);
842
2937
  }) : []
843
- }, description && {
844
- description: description
845
- }, descriptionHtml && {
846
- descriptionHtml: descriptionHtml
847
2938
  }, rest);
848
2939
  }
849
- function normalizeCart(checkout) {
850
- var _checkout$totalPriceV, _checkout$lineItems, _checkout$subtotalPri, _checkout$subtotalPri2, _checkout$totalPriceV2;
2940
+ function normalizeCart(cart) {
2941
+ var _cart$cost$totalAmoun;
2942
+ if (!cart) {
2943
+ return undefined;
2944
+ }
851
2945
  return {
852
- id: checkout.id,
853
- url: checkout.webUrl,
2946
+ id: cart.id,
2947
+ url: cart.checkoutUrl,
854
2948
  customerId: "",
855
2949
  email: "",
856
- createdAt: checkout.createdAt,
2950
+ createdAt: cart.createdAt,
857
2951
  currency: {
858
- code: (_checkout$totalPriceV = checkout.totalPriceV2) == null ? void 0 : _checkout$totalPriceV.currencyCode
2952
+ code: (_cart$cost$totalAmoun = cart.cost.totalAmount) == null ? void 0 : _cart$cost$totalAmoun.currencyCode
859
2953
  },
860
- taxesIncluded: checkout.taxesIncluded,
861
- lineItems: (_checkout$lineItems = checkout.lineItems) == null ? void 0 : _checkout$lineItems.edges.map(normalizeLineItem),
862
- lineItemsSubtotalPrice: +((_checkout$subtotalPri = checkout.subtotalPriceV2) == null ? void 0 : _checkout$subtotalPri.amount),
863
- subtotalPrice: +((_checkout$subtotalPri2 = checkout.subtotalPriceV2) == null ? void 0 : _checkout$subtotalPri2.amount),
864
- totalPrice: +((_checkout$totalPriceV2 = checkout.totalPriceV2) == null ? void 0 : _checkout$totalPriceV2.amount),
2954
+ taxesIncluded: false,
2955
+ lineItems: cart.lines.edges.map(function (_ref6) {
2956
+ var _merchandise$id, _merchandise$compareA;
2957
+ var _ref6$node = _ref6.node,
2958
+ id = _ref6$node.id,
2959
+ quantity = _ref6$node.quantity,
2960
+ merchandise = _ref6$node.merchandise;
2961
+ return {
2962
+ id: id,
2963
+ variantId: merchandise.id,
2964
+ productId: merchandise.product.id,
2965
+ name: merchandise.product.title,
2966
+ quantity: quantity,
2967
+ variant: {
2968
+ id: merchandise.id,
2969
+ sku: (_merchandise$id = merchandise.id) != null ? _merchandise$id : "",
2970
+ name: merchandise.title,
2971
+ image: normalizeImage(merchandise.image),
2972
+ requiresShipping: merchandise.requiresShipping,
2973
+ price: merchandise.price.amount,
2974
+ listPrice: (_merchandise$compareA = merchandise.compareAtPrice) == null ? void 0 : _merchandise$compareA.amount
2975
+ },
2976
+ path: merchandise.product.handle,
2977
+ discounts: [],
2978
+ options: merchandise.title === "Default Title" ? [] : merchandise.selectedOptions
2979
+ };
2980
+ }),
2981
+ lineItemsSubtotalPrice: +cart.cost.subtotalAmount.amount,
2982
+ subtotalPrice: +cart.cost.subtotalAmount.amount,
2983
+ totalPrice: +cart.cost.totalAmount.amount,
865
2984
  discounts: []
866
2985
  };
867
2986
  }
868
- function normalizeLineItem(_ref10) {
869
- var _variant$sku, _variant$image, _variant$requiresShip, _variant$priceV, _variant$compareAtPri, _variant$product;
870
- var _ref10$node = _ref10.node,
871
- id = _ref10$node.id,
872
- title = _ref10$node.title,
873
- variant = _ref10$node.variant,
874
- quantity = _ref10$node.quantity;
875
- return {
876
- id: id,
877
- variantId: String(variant == null ? void 0 : variant.id),
878
- productId: String(variant == null ? void 0 : variant.product.id),
879
- name: "" + title,
880
- quantity: quantity,
881
- variant: {
882
- id: String(variant == null ? void 0 : variant.id),
883
- sku: (_variant$sku = variant == null ? void 0 : variant.sku) != null ? _variant$sku : "",
884
- name: variant == null ? void 0 : variant.title,
885
- image: {
886
- url: (variant == null || (_variant$image = variant.image) == null ? void 0 : _variant$image.originalSrc) || "/product-img-placeholder.svg"
887
- },
888
- requiresShipping: (_variant$requiresShip = variant == null ? void 0 : variant.requiresShipping) != null ? _variant$requiresShip : false,
889
- price: variant == null || (_variant$priceV = variant.priceV2) == null ? void 0 : _variant$priceV.amount,
890
- listPrice: variant == null || (_variant$compareAtPri = variant.compareAtPriceV2) == null ? void 0 : _variant$compareAtPri.amount
891
- },
892
- path: String(variant == null || (_variant$product = variant.product) == null ? void 0 : _variant$product.handle),
893
- discounts: [],
894
- options: (variant == null ? void 0 : variant.title) == "Default Title" ? [] : variant == null ? void 0 : variant.selectedOptions
895
- };
896
- }
897
- /*
898
- export const normalizePage = (
899
- { title: name, handle, ...page }: ShopifyPage,
900
- locale: string = 'en-US'
901
- ): Page => ({
902
- ...page,
903
- url: `/${locale}/${handle}`,
904
- name,
905
- })
906
-
907
- export const normalizePages = (edges: PageEdge[], locale?: string): Page[] =>
908
- edges?.map((edge) => normalizePage(edge.node, locale))
909
- */
910
- var normalizeCategory = function normalizeCategory(_ref11) {
911
- var name = _ref11.title,
912
- handle = _ref11.handle,
913
- id = _ref11.id,
914
- products = _ref11.products,
915
- image = _ref11.image;
2987
+ function normalizeCategory(_ref7) {
2988
+ var name = _ref7.title,
2989
+ handle = _ref7.handle,
2990
+ id = _ref7.id,
2991
+ products = _ref7.products,
2992
+ image = _ref7.image;
916
2993
  return {
917
2994
  id: id,
918
2995
  name: name,
@@ -921,263 +2998,84 @@ var normalizeCategory = function normalizeCategory(_ref11) {
921
2998
  isEmpty: products.edges.length === 0,
922
2999
  images: image ? [normalizeImage(image)] : undefined
923
3000
  };
924
- };
925
-
926
- /*
927
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
928
- Changes: None
929
- */
930
- var getCustomMessage = function getCustomMessage(code, message) {
931
- switch (code) {
932
- case 'UNIDENTIFIED_CUSTOMER':
933
- message = 'Cannot find an account that matches the provided credentials';
934
- break;
935
- }
936
- return message;
937
- };
938
- var throwUserErrors = function throwUserErrors(errors) {
939
- if (errors && errors.length) {
940
- throw new ValidationError({
941
- errors: errors.map(function (_ref) {
942
- var code = _ref.code,
943
- message = _ref.message;
944
- return {
945
- code: code != null ? code : 'validation_error',
946
- message: getCustomMessage(code, message)
947
- };
948
- })
949
- });
950
- }
951
- };
952
-
953
- var checkoutToCart = function checkoutToCart(checkoutPayload) {
954
- throwUserErrors(checkoutPayload == null ? void 0 : checkoutPayload.checkoutUserErrors);
955
- if (!(checkoutPayload != null && checkoutPayload.checkout)) {
956
- throw new CommerceError({
957
- message: 'Missing checkout object from response'
958
- });
3001
+ }
3002
+ function normalizeImage(image) {
3003
+ if (!image) {
3004
+ return {
3005
+ url: "/product-img-placeholder.svg"
3006
+ };
959
3007
  }
960
- return normalizeCart(checkoutPayload == null ? void 0 : checkoutPayload.checkout);
961
- };
3008
+ var url = image.url,
3009
+ altText = image.altText,
3010
+ height = image.height,
3011
+ width = image.width;
3012
+ return {
3013
+ url: url,
3014
+ alt: altText || undefined,
3015
+ height: height || undefined,
3016
+ width: width || undefined
3017
+ };
3018
+ }
962
3019
 
963
- var simpleProductConnection = "\nfragment simpleProductConnection on ProductConnection {\n edges {\n node {\n id\n }\n }\n}\n";
964
- /*
965
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
966
- Changes:
967
- - Fetch image.
968
- */
969
- var collectionFieldsFragment = "\n fragment collectionFieldsFragment on Collection {\n id\n title\n handle\n image {\n originalSrc\n altText\n width\n height\n }\n products(first: $first) {\n ...simpleProductConnection\n }\n }\n " + simpleProductConnection + "\n";
970
- var getCollectionQueryById = /* GraphQL */"\n query getSiteCollection($id: ID, $handle: String, $first: Int = 1) {\n collection(id: $id, handle: $handle) {\n ...collectionFieldsFragment\n }\n }\n " + collectionFieldsFragment + "\n";
3020
+ var cartCreate = /*#__PURE__*/function () {
3021
+ var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(fetch, lines) {
3022
+ var _yield$fetch, cartCreate, cart, options;
3023
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3024
+ while (1) switch (_context.prev = _context.next) {
3025
+ case 0:
3026
+ _context.next = 2;
3027
+ return fetch({
3028
+ query: createCartMutation.toString(),
3029
+ variables: {
3030
+ lines: lines
3031
+ }
3032
+ });
3033
+ case 2:
3034
+ _yield$fetch = _context.sent;
3035
+ cartCreate = _yield$fetch.cartCreate;
3036
+ cart = cartCreate == null ? void 0 : cartCreate.cart;
3037
+ if (!cart) {
3038
+ _context.next = 12;
3039
+ break;
3040
+ }
3041
+ options = {
3042
+ expires: SHOPIFY_COOKIE_EXPIRE,
3043
+ sameSite: "none",
3044
+ secure: true
3045
+ };
3046
+ Cookies.set(SHOPIFY_CART_ID_COOKIE, cart.id, options);
3047
+ Cookies.set(SHOPIFY_CHECKOUT_URL_COOKIE, cart.checkoutUrl, options);
3048
+ return _context.abrupt("return", normalizeCart(cart));
3049
+ case 12:
3050
+ return _context.abrupt("return", undefined);
3051
+ case 13:
3052
+ case "end":
3053
+ return _context.stop();
3054
+ }
3055
+ }, _callee);
3056
+ }));
3057
+ return function cartCreate(_x, _x2) {
3058
+ return _ref.apply(this, arguments);
3059
+ };
3060
+ }();
971
3061
 
972
3062
  /*
973
3063
  Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
974
3064
  Changes: None
975
3065
  */
976
- var getSiteCollectionsQuery = /* GraphQL */"\n query getSiteCollections($first: Int!) {\n collections(first: $first) {\n edges {\n node {\n ...collectionFieldsFragment\n }\n }\n }\n }\n\n " + collectionFieldsFragment + "\n";
977
-
978
- /*
979
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
980
- Changes: Added query by product id
981
- */
982
- var productFieldsFragment = "\n fragment productFields on Product {\n id\n handle\n availableForSale\n title\n productType\n vendor\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n variants(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n sku\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n priceV2 {\n amount\n currencyCode\n }\n compareAtPriceV2 {\n amount\n currencyCode\n }\n }\n }\n }\n images(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n originalSrc\n altText\n width\n height\n }\n }\n }\n }\n";
983
- var getProductQueryBySlug = /* GraphQL */"\n query getProductBySlug($slug: String!) {\n productByHandle(handle: $slug) {\n ...productFields\n }\n }\n\n " + productFieldsFragment + "\n";
984
- var getProductQueryById = /* GraphQL */"\n query getProductById($id: ID!) {\n product(id: $id) {\n ...productFields\n }\n }\n\n " + productFieldsFragment + "\n";
985
-
986
- /*
987
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
988
- Changes:
989
- - Added variants info to the query
990
- */
991
- var productConnectionFragment = /* GraphQL */"\n fragment productConnection on ProductConnection {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n handle\n title\n vendor\n handle\n description\n descriptionHtml\n priceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n options {\n id\n name\n values\n }\n variants(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n sku\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n priceV2 {\n amount\n currencyCode\n }\n compareAtPriceV2 {\n amount\n currencyCode\n }\n }\n }\n }\n images(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n originalSrc\n altText\n width\n height\n }\n }\n }\n }\n }\n }\n";
992
- var getAllProductsQuery = /* GraphQL */"\n query getAllProducts(\n $first: Int = 250\n $query: String = \"\"\n $sortKey: ProductSortKeys = RELEVANCE\n $reverse: Boolean = false\n ) {\n products(\n first: $first\n sortKey: $sortKey\n reverse: $reverse\n query: $query\n ) {\n ...productConnection\n }\n }\n\n " + productConnectionFragment + "\n";
3066
+ var getCartId = function getCartId(id) {
3067
+ return id != null ? id : Cookies.get(SHOPIFY_CART_ID_COOKIE);
3068
+ };
993
3069
 
994
- /*
995
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
996
- Changes: None
997
- */
998
- var getAllProductVendors = /* GraphQL */"\n query getAllProductVendors($first: Int = 250, $cursor: String) {\n products(first: $first, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n vendor\n }\n cursor\n }\n }\n }\n";
999
-
1000
- /*
1001
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
1002
- Changes: None
1003
- */
1004
- var getCollectionProductsQuery = /* GraphQL */"\n query getProductsFromCollection(\n $categoryId: ID!\n $first: Int = 250\n $sortKey: ProductCollectionSortKeys = RELEVANCE\n $reverse: Boolean = false\n ) {\n node(id: $categoryId) {\n id\n ... on Collection {\n products(first: $first, sortKey: $sortKey, reverse: $reverse) {\n ...productConnection\n }\n }\n }\n }\n " + productConnectionFragment + "\n";
1005
-
1006
- /*
1007
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
1008
- Changes: None
1009
- */
1010
- var checkoutLineItemAddMutation = /* GraphQL */"\n mutation checkoutLineItemAdd(\n $checkoutId: ID!\n $lineItems: [CheckoutLineItemInput!]!\n ) {\n checkoutLineItemsAdd(checkoutId: $checkoutId, lineItems: $lineItems) {\n checkoutUserErrors {\n code\n field\n message\n }\n checkout {\n ...checkoutDetails\n }\n }\n }\n\n " + checkoutDetailsFragment + "\n";
1011
-
1012
- /*
1013
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
1014
- Changes: None
1015
- */
1016
- var checkoutLineItemUpdateMutation = /* GraphQL */"\n mutation checkoutLineItemUpdate(\n $checkoutId: ID!\n $lineItems: [CheckoutLineItemUpdateInput!]!\n ) {\n checkoutLineItemsUpdate(checkoutId: $checkoutId, lineItems: $lineItems) {\n checkoutUserErrors {\n code\n field\n message\n }\n checkout {\n ...checkoutDetails\n }\n }\n }\n\n " + checkoutDetailsFragment + "\n";
1017
-
1018
- /*
1019
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
1020
- Changes: None
1021
- */
1022
- var checkoutLineItemRemoveMutation = /* GraphQL */"\n mutation checkoutLineItemRemove($checkoutId: ID!, $lineItemIds: [ID!]!) {\n checkoutLineItemsRemove(\n checkoutId: $checkoutId\n lineItemIds: $lineItemIds\n ) {\n checkoutUserErrors {\n code\n field\n message\n }\n checkout {\n ...checkoutDetails\n }\n }\n }\n " + checkoutDetailsFragment + "\n";
3070
+ var getCartQuery = /*#__PURE__*/graphql("\n query getCart($cartId: ID!) {\n cart(id: $cartId) {\n ...cart\n }\n }\n");
1023
3071
 
1024
3072
  var handler = {
1025
3073
  fetchOptions: {
1026
- query: getAllProductsQuery
1027
- },
1028
- fetcher: function fetcher(_ref) {
1029
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1030
- var _products, _products2;
1031
- var input, options, fetch, categoryId, brandId, method, variables, products, _data$node, _data$node2, data, _data$products, _data;
1032
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1033
- while (1) switch (_context.prev = _context.next) {
1034
- case 0:
1035
- input = _ref.input, options = _ref.options, fetch = _ref.fetch;
1036
- categoryId = input.categoryId, brandId = input.brandId;
1037
- method = options == null ? void 0 : options.method;
1038
- variables = getSearchVariables(input);
1039
- if (!categoryId) {
1040
- _context.next = 11;
1041
- break;
1042
- }
1043
- _context.next = 7;
1044
- return fetch({
1045
- query: getCollectionProductsQuery,
1046
- method: method,
1047
- variables: _extends({}, variables, {
1048
- first: undefined
1049
- })
1050
- });
1051
- case 7:
1052
- data = _context.sent;
1053
- // filter on client when brandId & categoryId are set since is not available on collection product query
1054
- products = brandId ? (_data$node = data.node) == null || (_data$node = _data$node.products) == null || (_data$node = _data$node.edges) == null ? void 0 : _data$node.filter(function (_ref2) {
1055
- var vendor = _ref2.node.vendor;
1056
- return vendor.replace(/\s+/g, "-").toLowerCase() === ("" + brandId).toLowerCase();
1057
- }).slice(0, input.count) : (_data$node2 = data.node) == null || (_data$node2 = _data$node2.products) == null ? void 0 : _data$node2.edges.slice(0, input.count);
1058
- _context.next = 15;
1059
- break;
1060
- case 11:
1061
- _context.next = 13;
1062
- return fetch({
1063
- query: options.query,
1064
- method: method,
1065
- variables: variables
1066
- });
1067
- case 13:
1068
- _data = _context.sent;
1069
- products = (_data$products = _data.products) == null ? void 0 : _data$products.edges;
1070
- case 15:
1071
- return _context.abrupt("return", {
1072
- products: (_products = products) == null ? void 0 : _products.map(function (_ref3) {
1073
- var node = _ref3.node;
1074
- return normalizeProduct(node);
1075
- }),
1076
- found: !!((_products2 = products) != null && _products2.length)
1077
- });
1078
- case 16:
1079
- case "end":
1080
- return _context.stop();
1081
- }
1082
- }, _callee);
1083
- }))();
1084
- },
1085
- useHook: function useHook(_ref4) {
1086
- var useData = _ref4.useData;
1087
- return function (input) {
1088
- if (input === void 0) {
1089
- input = {};
1090
- }
1091
- return useData({
1092
- input: [["search", input.search], ["categoryId", input.categoryId], ["brandId", input.brandId], ["sort", input.sort], ["locale", input.locale], ["count", input.count]],
1093
- swrOptions: _extends({
1094
- revalidateOnFocus: false
1095
- }, input.swrOptions)
1096
- });
1097
- };
1098
- }
1099
- };
1100
-
1101
- var handler$1 = {
1102
- fetchOptions: {
1103
- query: getProductQueryBySlug
1104
- },
1105
- fetcher: function fetcher(_ref) {
1106
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1107
- var input, options, fetch, id, product, data, _data;
1108
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1109
- while (1) switch (_context.prev = _context.next) {
1110
- case 0:
1111
- input = _ref.input, options = _ref.options, fetch = _ref.fetch;
1112
- id = input.id;
1113
- if (id) {
1114
- _context.next = 4;
1115
- break;
1116
- }
1117
- return _context.abrupt("return", null);
1118
- case 4:
1119
- product = null;
1120
- if (!id.startsWith("gid://shopify")) {
1121
- _context.next = 12;
1122
- break;
1123
- }
1124
- _context.next = 8;
1125
- return fetch({
1126
- query: getProductQueryById,
1127
- variables: {
1128
- id: id
1129
- }
1130
- });
1131
- case 8:
1132
- data = _context.sent;
1133
- product = data.product;
1134
- _context.next = 16;
1135
- break;
1136
- case 12:
1137
- _context.next = 14;
1138
- return fetch({
1139
- query: options.query,
1140
- variables: {
1141
- slug: id
1142
- }
1143
- });
1144
- case 14:
1145
- _data = _context.sent;
1146
- if (_data.productByHandle) {
1147
- product = _data.productByHandle;
1148
- }
1149
- case 16:
1150
- return _context.abrupt("return", product ? normalizeProduct(product) : null);
1151
- case 17:
1152
- case "end":
1153
- return _context.stop();
1154
- }
1155
- }, _callee);
1156
- }))();
1157
- },
1158
- useHook: function useHook(_ref2) {
1159
- var useData = _ref2.useData;
1160
- return function (input) {
1161
- if (input === void 0) {
1162
- input = {};
1163
- }
1164
- return useData({
1165
- input: [['id', input.id]],
1166
- swrOptions: _extends({
1167
- revalidateOnFocus: false
1168
- }, input.swrOptions)
1169
- });
1170
- };
1171
- }
1172
- };
1173
-
1174
- var handler$2 = {
1175
- fetchOptions: {
1176
- query: getCheckoutQuery
3074
+ query: /*#__PURE__*/getCartQuery.toString()
1177
3075
  },
1178
3076
  fetcher: function fetcher(_ref) {
1179
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1180
- var cartId, options, fetch, _yield$fetch, checkout;
3077
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3078
+ var cartId, options, fetch, _yield$fetch, cart;
1181
3079
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1182
3080
  while (1) switch (_context.prev = _context.next) {
1183
3081
  case 0:
@@ -1189,23 +3087,21 @@ var handler$2 = {
1189
3087
  _context.next = 4;
1190
3088
  return fetch(_extends({}, options, {
1191
3089
  variables: {
1192
- checkoutId: cartId
3090
+ cartId: cartId
1193
3091
  }
1194
3092
  }));
1195
3093
  case 4:
1196
3094
  _yield$fetch = _context.sent;
1197
- checkout = _yield$fetch.node;
1198
- if (!(checkout != null && checkout.completedAt)) {
3095
+ cart = _yield$fetch.cart;
3096
+ if (cart) {
1199
3097
  _context.next = 12;
1200
3098
  break;
1201
3099
  }
1202
- Cookies.remove(SHOPIFY_CHECKOUT_ID_COOKIE);
3100
+ Cookies.remove(SHOPIFY_CART_ID_COOKIE);
1203
3101
  Cookies.remove(SHOPIFY_CHECKOUT_URL_COOKIE);
1204
3102
  return _context.abrupt("return", null);
1205
3103
  case 12:
1206
- return _context.abrupt("return", checkoutToCart({
1207
- checkout: checkout
1208
- }));
3104
+ return _context.abrupt("return", normalizeCart(cart));
1209
3105
  case 13:
1210
3106
  return _context.abrupt("return", null);
1211
3107
  case 14:
@@ -1238,14 +3134,14 @@ var handler$2 = {
1238
3134
  }
1239
3135
  };
1240
3136
 
1241
- var handler$3 = {
3137
+ var handler$1 = {
1242
3138
  fetchOptions: {
1243
- query: checkoutLineItemAddMutation
3139
+ query: /*#__PURE__*/addToCartMutation.toString()
1244
3140
  },
1245
3141
  fetcher: function fetcher(_ref) {
1246
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3142
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1247
3143
  var _item$quantity;
1248
- var item, options, fetch, lineItems, checkoutId, _yield$fetch, checkoutLineItemsAdd;
3144
+ var item, options, fetch, lines, cartId, _yield$fetch, cartLinesAdd;
1249
3145
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1250
3146
  while (1) switch (_context.prev = _context.next) {
1251
3147
  case 0:
@@ -1255,37 +3151,35 @@ var handler$3 = {
1255
3151
  break;
1256
3152
  }
1257
3153
  throw new CommerceError({
1258
- message: 'The item quantity has to be a valid integer greater than 0'
3154
+ message: "The item quantity has to be a valid integer greater than 0"
1259
3155
  });
1260
3156
  case 3:
1261
- lineItems = [{
1262
- variantId: item.variantId,
3157
+ lines = [{
3158
+ merchandiseId: item.variantId,
1263
3159
  quantity: (_item$quantity = item.quantity) != null ? _item$quantity : 1
1264
3160
  }];
1265
- checkoutId = getCheckoutId();
1266
- if (checkoutId) {
1267
- _context.next = 13;
3161
+ cartId = getCartId();
3162
+ if (cartId) {
3163
+ _context.next = 11;
1268
3164
  break;
1269
3165
  }
1270
- _context.t0 = checkoutToCart;
1271
- _context.next = 9;
1272
- return checkoutCreate(fetch, lineItems);
1273
- case 9:
1274
- _context.t1 = _context.sent;
1275
- return _context.abrupt("return", (0, _context.t0)(_context.t1));
1276
- case 13:
1277
- _context.next = 15;
3166
+ _context.next = 8;
3167
+ return cartCreate(fetch, lines);
3168
+ case 8:
3169
+ return _context.abrupt("return", _context.sent);
3170
+ case 11:
3171
+ _context.next = 13;
1278
3172
  return fetch(_extends({}, options, {
1279
3173
  variables: {
1280
- checkoutId: checkoutId,
1281
- lineItems: lineItems
3174
+ cartId: cartId,
3175
+ lines: lines
1282
3176
  }
1283
3177
  }));
1284
- case 15:
3178
+ case 13:
1285
3179
  _yield$fetch = _context.sent;
1286
- checkoutLineItemsAdd = _yield$fetch.checkoutLineItemsAdd;
1287
- return _context.abrupt("return", checkoutToCart(checkoutLineItemsAdd));
1288
- case 18:
3180
+ cartLinesAdd = _yield$fetch.cartLinesAdd;
3181
+ return _context.abrupt("return", normalizeCart(cartLinesAdd == null ? void 0 : cartLinesAdd.cart));
3182
+ case 16:
1289
3183
  case "end":
1290
3184
  return _context.stop();
1291
3185
  }
@@ -1297,8 +3191,8 @@ var handler$3 = {
1297
3191
  return function () {
1298
3192
  var _useCart = useCart(),
1299
3193
  mutate = _useCart.mutate;
1300
- return useCallback( /*#__PURE__*/function () {
1301
- var _addItem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
3194
+ return useCallback(/*#__PURE__*/function () {
3195
+ var _addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
1302
3196
  var data;
1303
3197
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1304
3198
  while (1) switch (_context2.prev = _context2.next) {
@@ -1328,13 +3222,13 @@ var handler$3 = {
1328
3222
  }
1329
3223
  };
1330
3224
 
1331
- var handler$4 = {
3225
+ var handler$2 = {
1332
3226
  fetchOptions: {
1333
- query: checkoutLineItemRemoveMutation
3227
+ query: /*#__PURE__*/removeFromCartMutation.toString()
1334
3228
  },
1335
3229
  fetcher: function fetcher(_ref) {
1336
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1337
- var itemId, options, fetch, data;
3230
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3231
+ var itemId, options, fetch, _yield$fetch, cartLinesRemove;
1338
3232
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1339
3233
  while (1) switch (_context.prev = _context.next) {
1340
3234
  case 0:
@@ -1342,14 +3236,15 @@ var handler$4 = {
1342
3236
  _context.next = 3;
1343
3237
  return fetch(_extends({}, options, {
1344
3238
  variables: {
1345
- checkoutId: getCheckoutId(),
1346
- lineItemIds: [itemId]
3239
+ cartId: getCartId(),
3240
+ lineIds: [itemId]
1347
3241
  }
1348
3242
  }));
1349
3243
  case 3:
1350
- data = _context.sent;
1351
- return _context.abrupt("return", checkoutToCart(data.checkoutLineItemsRemove));
1352
- case 5:
3244
+ _yield$fetch = _context.sent;
3245
+ cartLinesRemove = _yield$fetch.cartLinesRemove;
3246
+ return _context.abrupt("return", normalizeCart(cartLinesRemove == null ? void 0 : cartLinesRemove.cart));
3247
+ case 6:
1353
3248
  case "end":
1354
3249
  return _context.stop();
1355
3250
  }
@@ -1367,7 +3262,7 @@ var handler$4 = {
1367
3262
  var _useCart = useCart(),
1368
3263
  mutate = _useCart.mutate;
1369
3264
  var removeItem = /*#__PURE__*/function () {
1370
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
3265
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
1371
3266
  var _input$id;
1372
3267
  var itemId, data;
1373
3268
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1379,7 +3274,7 @@ var handler$4 = {
1379
3274
  break;
1380
3275
  }
1381
3276
  throw new ValidationError({
1382
- message: 'Invalid input used for this operation'
3277
+ message: "Invalid input used for this operation"
1383
3278
  });
1384
3279
  case 3:
1385
3280
  _context2.next = 5;
@@ -1409,13 +3304,13 @@ var handler$4 = {
1409
3304
  }
1410
3305
  };
1411
3306
 
1412
- var handler$5 = {
3307
+ var handler$3 = {
1413
3308
  fetchOptions: {
1414
- query: checkoutLineItemUpdateMutation
3309
+ query: /*#__PURE__*/editCartItemsMutation.toString()
1415
3310
  },
1416
3311
  fetcher: function fetcher(_ref) {
1417
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1418
- var _ref$input, itemId, item, options, fetch, _yield$fetch, checkoutLineItemsUpdate;
3312
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3313
+ var _ref$input, itemId, item, options, fetch, _yield$fetch, cartLinesUpdate;
1419
3314
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1420
3315
  while (1) switch (_context.prev = _context.next) {
1421
3316
  case 0:
@@ -1428,8 +3323,8 @@ var handler$5 = {
1428
3323
  _context.next = 4;
1429
3324
  break;
1430
3325
  }
1431
- return _context.abrupt("return", handler$4.fetcher({
1432
- options: handler$4.fetchOptions,
3326
+ return _context.abrupt("return", handler$2.fetcher({
3327
+ options: handler$2.fetchOptions,
1433
3328
  input: {
1434
3329
  itemId: itemId
1435
3330
  },
@@ -1450,8 +3345,8 @@ var handler$5 = {
1450
3345
  _context.next = 10;
1451
3346
  return fetch(_extends({}, options, {
1452
3347
  variables: {
1453
- checkoutId: getCheckoutId(),
1454
- lineItems: [{
3348
+ cartId: getCartId(),
3349
+ lines: [{
1455
3350
  id: itemId,
1456
3351
  quantity: item.quantity
1457
3352
  }]
@@ -1459,8 +3354,8 @@ var handler$5 = {
1459
3354
  }));
1460
3355
  case 10:
1461
3356
  _yield$fetch = _context.sent;
1462
- checkoutLineItemsUpdate = _yield$fetch.checkoutLineItemsUpdate;
1463
- return _context.abrupt("return", checkoutToCart(checkoutLineItemsUpdate));
3357
+ cartLinesUpdate = _yield$fetch.cartLinesUpdate;
3358
+ return _context.abrupt("return", normalizeCart(cartLinesUpdate == null ? void 0 : cartLinesUpdate.cart));
1464
3359
  case 13:
1465
3360
  case "end":
1466
3361
  return _context.stop();
@@ -1479,8 +3374,8 @@ var handler$5 = {
1479
3374
  item = _ctx.item;
1480
3375
  var _useCart = useCart(),
1481
3376
  mutate = _useCart.mutate;
1482
- return useCallback(debounce( /*#__PURE__*/function () {
1483
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
3377
+ return useCallback(debounce(/*#__PURE__*/function () {
3378
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
1484
3379
  var _input$id;
1485
3380
  var itemId, data;
1486
3381
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -1524,85 +3419,306 @@ var handler$5 = {
1524
3419
  }
1525
3420
  };
1526
3421
 
1527
- var handler$6 = {
3422
+ var _excluded$1 = ["locale"];
3423
+ var getFetcher = function getFetcher(storeDomain, accessToken) {
3424
+ return /*#__PURE__*/function () {
3425
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
3426
+ var _ref$url, url, _ref$method, method, variables, query, _ref3, locale, vars, res, _yield$res$json, data, errors, _yield$res$json2, _errors;
3427
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3428
+ while (1) switch (_context.prev = _context.next) {
3429
+ case 0:
3430
+ _ref$url = _ref.url, url = _ref$url === void 0 ? "https://" + storeDomain + "/api/" + shopifyApiVersion + "/graphql.json" : _ref$url, _ref$method = _ref.method, method = _ref$method === void 0 ? "POST" : _ref$method, variables = _ref.variables, query = _ref.query;
3431
+ _ref3 = variables != null ? variables : {}, locale = _ref3.locale, vars = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
3432
+ _context.next = 4;
3433
+ return fetch(url, {
3434
+ method: method,
3435
+ body: JSON.stringify({
3436
+ query: query,
3437
+ variables: vars
3438
+ }),
3439
+ headers: _extends({
3440
+ "X-Shopify-Storefront-Access-Token": accessToken,
3441
+ "Content-Type": "application/json"
3442
+ }, locale && {
3443
+ "Accept-Language": locale
3444
+ })
3445
+ });
3446
+ case 4:
3447
+ res = _context.sent;
3448
+ if (!res.ok) {
3449
+ _context.next = 16;
3450
+ break;
3451
+ }
3452
+ _context.next = 8;
3453
+ return res.json();
3454
+ case 8:
3455
+ _yield$res$json = _context.sent;
3456
+ data = _yield$res$json.data;
3457
+ errors = _yield$res$json.errors;
3458
+ if (!(errors && errors.length)) {
3459
+ _context.next = 13;
3460
+ break;
3461
+ }
3462
+ throw getError(errors, res.status);
3463
+ case 13:
3464
+ return _context.abrupt("return", data);
3465
+ case 16:
3466
+ _context.next = 18;
3467
+ return res.json();
3468
+ case 18:
3469
+ _yield$res$json2 = _context.sent;
3470
+ _errors = _yield$res$json2.errors;
3471
+ throw getError(_errors, res.status);
3472
+ case 21:
3473
+ case "end":
3474
+ return _context.stop();
3475
+ }
3476
+ }, _callee);
3477
+ }));
3478
+ return function (_x) {
3479
+ return _ref2.apply(this, arguments);
3480
+ };
3481
+ }();
3482
+ };
3483
+ function getError(errors, status) {
3484
+ var _errors2;
3485
+ errors = (_errors2 = errors) != null ? _errors2 : [{
3486
+ message: "Failed to fetch Shopify API"
3487
+ }];
3488
+ return new FetcherError({
3489
+ errors: errors,
3490
+ status: status
3491
+ });
3492
+ }
3493
+
3494
+ var getProductQueryBySlug = /*#__PURE__*/graphql("\n query getProductBySlug($slug: String!) {\n productByHandle(handle: $slug) {\n ...product\n }\n }\n");
3495
+ var getProductQueryById = /*#__PURE__*/graphql("\n query getProductById($id: ID!) {\n product(id: $id) {\n ...product\n }\n }\n");
3496
+
3497
+ var handler$4 = {
1528
3498
  fetchOptions: {
1529
- query: getSiteCollectionsQuery
3499
+ query: /*#__PURE__*/getProductQueryBySlug.toString()
1530
3500
  },
1531
3501
  fetcher: function fetcher(_ref) {
1532
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1533
- var input, options, fetch, categoryId, _data$collections$edg, _data$collections, data, _data;
3502
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3503
+ var input, options, fetch, id, product, data, _data;
1534
3504
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1535
3505
  while (1) switch (_context.prev = _context.next) {
1536
3506
  case 0:
1537
3507
  input = _ref.input, options = _ref.options, fetch = _ref.fetch;
1538
- categoryId = input.categoryId;
1539
- if (categoryId) {
1540
- _context.next = 9;
3508
+ id = input.id;
3509
+ if (id) {
3510
+ _context.next = 4;
1541
3511
  break;
1542
3512
  }
1543
- _context.next = 5;
3513
+ return _context.abrupt("return", null);
3514
+ case 4:
3515
+ product = null;
3516
+ if (!id.startsWith("gid://shopify")) {
3517
+ _context.next = 12;
3518
+ break;
3519
+ }
3520
+ _context.next = 8;
1544
3521
  return fetch({
1545
- query: options.query,
3522
+ query: getProductQueryById.toString(),
1546
3523
  variables: {
1547
- first: 250
3524
+ id: id
1548
3525
  }
1549
3526
  });
1550
- case 5:
3527
+ case 8:
1551
3528
  data = _context.sent;
1552
- return _context.abrupt("return", (_data$collections$edg = data == null || (_data$collections = data.collections) == null || (_data$collections = _data$collections.edges) == null ? void 0 : _data$collections.map(function (_ref2) {
1553
- var node = _ref2.node;
1554
- return normalizeCategory(node);
1555
- })) != null ? _data$collections$edg : []);
1556
- case 9:
1557
- _context.next = 11;
3529
+ product = data.product;
3530
+ _context.next = 16;
3531
+ break;
3532
+ case 12:
3533
+ _context.next = 14;
1558
3534
  return fetch({
1559
- query: getCollectionQueryById,
1560
- variables: _extends({}, categoryId.startsWith("gid://") ? {
1561
- id: categoryId
1562
- } : {
1563
- handle: categoryId
3535
+ query: options.query,
3536
+ variables: {
3537
+ slug: id
3538
+ }
3539
+ });
3540
+ case 14:
3541
+ _data = _context.sent;
3542
+ if (_data.productByHandle) {
3543
+ product = _data.productByHandle;
3544
+ }
3545
+ case 16:
3546
+ return _context.abrupt("return", product ? normalizeProduct(product) : null);
3547
+ case 17:
3548
+ case "end":
3549
+ return _context.stop();
3550
+ }
3551
+ }, _callee);
3552
+ }))();
3553
+ },
3554
+ useHook: function useHook(_ref2) {
3555
+ var useData = _ref2.useData;
3556
+ return function (input) {
3557
+ if (input === void 0) {
3558
+ input = {};
3559
+ }
3560
+ return useData({
3561
+ input: [["id", input.id]],
3562
+ swrOptions: _extends({
3563
+ revalidateOnFocus: false
3564
+ }, input.swrOptions)
3565
+ });
3566
+ };
3567
+ }
3568
+ };
3569
+
3570
+ /*
3571
+ Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
3572
+ Changes: None
3573
+ */
3574
+ var getSortVariables = function getSortVariables(sort, isCategory) {
3575
+ if (isCategory === void 0) {
3576
+ isCategory = false;
3577
+ }
3578
+ var output = {};
3579
+ switch (sort) {
3580
+ case 'price-asc':
3581
+ output = {
3582
+ sortKey: 'PRICE',
3583
+ reverse: false
3584
+ };
3585
+ break;
3586
+ case 'price-desc':
3587
+ output = {
3588
+ sortKey: 'PRICE',
3589
+ reverse: true
3590
+ };
3591
+ break;
3592
+ case 'trending-desc':
3593
+ output = {
3594
+ sortKey: 'BEST_SELLING',
3595
+ reverse: false
3596
+ };
3597
+ break;
3598
+ case 'latest-desc':
3599
+ output = {
3600
+ sortKey: isCategory ? 'CREATED' : 'CREATED_AT',
3601
+ reverse: true
3602
+ };
3603
+ break;
3604
+ }
3605
+ return output;
3606
+ };
3607
+
3608
+ var getSearchVariables = function getSearchVariables(_ref) {
3609
+ var brandId = _ref.brandId,
3610
+ search = _ref.search,
3611
+ categoryId = _ref.categoryId,
3612
+ sort = _ref.sort,
3613
+ locale = _ref.locale,
3614
+ count = _ref.count;
3615
+ var query = "";
3616
+ var searchQuery = search + "*";
3617
+ if (search) {
3618
+ query += "product_type:" + searchQuery + " OR title:" + searchQuery + " OR tag:" + searchQuery;
3619
+ }
3620
+ if (brandId) {
3621
+ query += (search ? "AND " : "") + "vendor:" + brandId;
3622
+ }
3623
+ return _extends({
3624
+ categoryId: categoryId,
3625
+ query: query
3626
+ }, getSortVariables(sort, !!categoryId), locale && {
3627
+ locale: locale
3628
+ }, {
3629
+ first: count
3630
+ });
3631
+ };
3632
+
3633
+ var getAllProductsQuery = /*#__PURE__*/graphql("\n query getAllProducts(\n $first: Int = 250\n $query: String = \"\"\n $sortKey: ProductSortKeys = RELEVANCE\n $reverse: Boolean = false\n ) {\n products(\n first: $first\n sortKey: $sortKey\n reverse: $reverse\n query: $query\n ) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n ...product\n }\n }\n }\n }\n");
3634
+
3635
+ var getCollectionProductsQuery = /*#__PURE__*/graphql("\n query getProductsFromCollection(\n $categoryId: ID!\n $first: Int = 250\n $sortKey: ProductCollectionSortKeys = RELEVANCE\n $reverse: Boolean = false\n ) {\n node(id: $categoryId) {\n id\n ... on Collection {\n ...collection\n products(first: $first, sortKey: $sortKey, reverse: $reverse) {\n edges {\n node {\n ...product\n }\n }\n }\n }\n }\n }\n");
3636
+
3637
+ var handler$5 = {
3638
+ fetchOptions: {
3639
+ query: /*#__PURE__*/getAllProductsQuery.toString()
3640
+ },
3641
+ fetcher: function fetcher(_ref) {
3642
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3643
+ var _products, _products2;
3644
+ var input, options, fetch, categoryId, brandId, method, variables, products, _data$node, _data$node2, data, _data$products, _data;
3645
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3646
+ while (1) switch (_context.prev = _context.next) {
3647
+ case 0:
3648
+ input = _ref.input, options = _ref.options, fetch = _ref.fetch;
3649
+ categoryId = input.categoryId, brandId = input.brandId;
3650
+ method = options == null ? void 0 : options.method;
3651
+ variables = getSearchVariables(input);
3652
+ if (!categoryId) {
3653
+ _context.next = 11;
3654
+ break;
3655
+ }
3656
+ _context.next = 7;
3657
+ return fetch({
3658
+ query: getCollectionProductsQuery.toString(),
3659
+ method: method,
3660
+ variables: _extends({}, variables, {
3661
+ first: undefined
1564
3662
  })
1565
3663
  });
3664
+ case 7:
3665
+ data = _context.sent;
3666
+ // filter on client when brandId & categoryId are set since is not available on collection product query
3667
+ products = brandId ? (_data$node = data.node) == null || (_data$node = _data$node.products) == null || (_data$node = _data$node.edges) == null ? void 0 : _data$node.filter(function (_ref2) {
3668
+ var vendor = _ref2.node.vendor;
3669
+ return vendor.replace(/\s+/g, "-").toLowerCase() === ("" + brandId).toLowerCase();
3670
+ }).slice(0, input.count) : (_data$node2 = data.node) == null || (_data$node2 = _data$node2.products) == null ? void 0 : _data$node2.edges.slice(0, input.count);
3671
+ _context.next = 15;
3672
+ break;
1566
3673
  case 11:
1567
- _data = _context.sent;
1568
- return _context.abrupt("return", !!(_data != null && _data.collection) ? [normalizeCategory(_data == null ? void 0 : _data.collection)] : []);
3674
+ _context.next = 13;
3675
+ return fetch({
3676
+ query: options.query,
3677
+ method: method,
3678
+ variables: variables
3679
+ });
1569
3680
  case 13:
3681
+ _data = _context.sent;
3682
+ products = (_data$products = _data.products) == null ? void 0 : _data$products.edges;
3683
+ case 15:
3684
+ return _context.abrupt("return", {
3685
+ products: (_products = products) == null ? void 0 : _products.map(function (_ref3) {
3686
+ var node = _ref3.node;
3687
+ return normalizeProduct(node);
3688
+ }),
3689
+ found: !!((_products2 = products) != null && _products2.length)
3690
+ });
3691
+ case 16:
1570
3692
  case "end":
1571
3693
  return _context.stop();
1572
3694
  }
1573
3695
  }, _callee);
1574
3696
  }))();
1575
3697
  },
1576
- useHook: function useHook(_ref3) {
1577
- var useData = _ref3.useData;
3698
+ useHook: function useHook(_ref4) {
3699
+ var useData = _ref4.useData;
1578
3700
  return function (input) {
1579
- var response = useData({
1580
- input: [["categoryId", input == null ? void 0 : input.categoryId]],
3701
+ if (input === void 0) {
3702
+ input = {};
3703
+ }
3704
+ return useData({
3705
+ input: [["search", input.search], ["categoryId", input.categoryId], ["brandId", input.brandId], ["sort", input.sort], ["locale", input.locale], ["count", input.count]],
1581
3706
  swrOptions: _extends({
1582
3707
  revalidateOnFocus: false
1583
- }, input == null ? void 0 : input.swrOptions)
3708
+ }, input.swrOptions)
1584
3709
  });
1585
- return useMemo(function () {
1586
- return Object.create(response, {
1587
- isEmpty: {
1588
- get: function get() {
1589
- var _response$data$length, _response$data;
1590
- return ((_response$data$length = (_response$data = response.data) == null ? void 0 : _response$data.length) != null ? _response$data$length : 0) <= 0;
1591
- },
1592
- enumerable: true
1593
- }
1594
- });
1595
- }, [response]);
1596
3710
  };
1597
3711
  }
1598
3712
  };
1599
3713
 
1600
- var handler$7 = {
3714
+ var getAllProductVendors = /*#__PURE__*/graphql("\n query getAllProductVendors($first: Int = 250, $cursor: String) {\n products(first: $first, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n vendor\n }\n cursor\n }\n }\n }\n");
3715
+
3716
+ var handler$6 = {
1601
3717
  fetchOptions: {
1602
- query: getAllProductVendors
3718
+ query: /*#__PURE__*/getAllProductVendors.toString()
1603
3719
  },
1604
3720
  fetcher: function fetcher(_ref) {
1605
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3721
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1606
3722
  var fetch, data, vendorsStrings;
1607
3723
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1608
3724
  while (1) switch (_context.prev = _context.next) {
@@ -1610,7 +3726,7 @@ var handler$7 = {
1610
3726
  fetch = _ref.fetch;
1611
3727
  _context.next = 3;
1612
3728
  return fetch({
1613
- query: getAllProductVendors,
3729
+ query: getAllProductVendors.toString(),
1614
3730
  variables: {
1615
3731
  first: 250
1616
3732
  }
@@ -1622,7 +3738,7 @@ var handler$7 = {
1622
3738
  return vendor;
1623
3739
  });
1624
3740
  return _context.abrupt("return", Array.from(new Set(vendorsStrings).values()).map(function (v) {
1625
- var id = v.replace(/\s+/g, '-').toLowerCase();
3741
+ var id = v.replace(/\s+/g, "-").toLowerCase();
1626
3742
  return {
1627
3743
  entityId: id,
1628
3744
  name: v,
@@ -1659,70 +3775,101 @@ var handler$7 = {
1659
3775
  }
1660
3776
  };
1661
3777
 
1662
- var _excluded$1 = ["locale"];
1663
- var getFetcher = function getFetcher(storeDomain, accessToken) {
1664
- return /*#__PURE__*/function () {
1665
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
1666
- var _ref$url, url, _ref$method, method, variables, query, _ref3, locale, vars;
3778
+ var getSiteCollectionsQuery = /*#__PURE__*/graphql("\n query getSiteCollections($first: Int!) {\n collections(first: $first) {\n edges {\n node {\n ...collection\n products(first: $first) {\n edges {\n node {\n id\n }\n }\n }\n }\n }\n }\n }\n");
3779
+
3780
+ var getCollectionQueryById = /*#__PURE__*/graphql("\n query getSiteCollection($id: ID, $handle: String, $first: Int = 1) {\n collection(id: $id, handle: $handle) {\n ...collection\n products(first: $first) {\n edges {\n node {\n id\n }\n }\n }\n }\n }\n");
3781
+
3782
+ var handler$7 = {
3783
+ fetchOptions: {
3784
+ query: /*#__PURE__*/getSiteCollectionsQuery.toString()
3785
+ },
3786
+ fetcher: function fetcher(_ref) {
3787
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3788
+ var input, options, fetch, categoryId, _data$collections$edg, _data$collections, data, _data;
1667
3789
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1668
3790
  while (1) switch (_context.prev = _context.next) {
1669
3791
  case 0:
1670
- _ref$url = _ref.url, url = _ref$url === void 0 ? "https://" + storeDomain + "/api/2022-04/graphql.json" : _ref$url, _ref$method = _ref.method, method = _ref$method === void 0 ? 'POST' : _ref$method, variables = _ref.variables, query = _ref.query;
1671
- _ref3 = variables != null ? variables : {}, locale = _ref3.locale, vars = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
1672
- _context.t0 = handleFetchResponse;
3792
+ input = _ref.input, options = _ref.options, fetch = _ref.fetch;
3793
+ categoryId = input.categoryId;
3794
+ if (categoryId) {
3795
+ _context.next = 9;
3796
+ break;
3797
+ }
1673
3798
  _context.next = 5;
1674
- return fetch(url, {
1675
- method: method,
1676
- body: JSON.stringify({
1677
- query: query,
1678
- variables: vars
1679
- }),
1680
- headers: _extends({
1681
- 'X-Shopify-Storefront-Access-Token': accessToken,
1682
- 'Content-Type': 'application/json'
1683
- }, locale && {
1684
- 'Accept-Language': locale
1685
- })
3799
+ return fetch({
3800
+ query: options.query,
3801
+ variables: {
3802
+ first: 250
3803
+ }
1686
3804
  });
1687
3805
  case 5:
1688
- _context.t1 = _context.sent;
1689
- return _context.abrupt("return", (0, _context.t0)(_context.t1));
1690
- case 7:
3806
+ data = _context.sent;
3807
+ return _context.abrupt("return", (_data$collections$edg = data == null || (_data$collections = data.collections) == null || (_data$collections = _data$collections.edges) == null ? void 0 : _data$collections.map(function (_ref2) {
3808
+ var node = _ref2.node;
3809
+ return normalizeCategory(node);
3810
+ })) != null ? _data$collections$edg : []);
3811
+ case 9:
3812
+ _context.next = 11;
3813
+ return fetch({
3814
+ query: getCollectionQueryById.toString(),
3815
+ variables: _extends({}, categoryId.startsWith("gid://") ? {
3816
+ id: categoryId
3817
+ } : {
3818
+ handle: categoryId
3819
+ })
3820
+ });
3821
+ case 11:
3822
+ _data = _context.sent;
3823
+ return _context.abrupt("return", !!(_data != null && _data.collection) ? [normalizeCategory(_data == null ? void 0 : _data.collection)] : []);
3824
+ case 13:
1691
3825
  case "end":
1692
3826
  return _context.stop();
1693
3827
  }
1694
3828
  }, _callee);
1695
- }));
1696
- return function (_x) {
1697
- return _ref2.apply(this, arguments);
3829
+ }))();
3830
+ },
3831
+ useHook: function useHook(_ref3) {
3832
+ var useData = _ref3.useData;
3833
+ return function (input) {
3834
+ var response = useData({
3835
+ input: [["categoryId", input == null ? void 0 : input.categoryId]],
3836
+ swrOptions: _extends({
3837
+ revalidateOnFocus: false
3838
+ }, input == null ? void 0 : input.swrOptions)
3839
+ });
3840
+ return useMemo(function () {
3841
+ return Object.create(response, {
3842
+ isEmpty: {
3843
+ get: function get() {
3844
+ var _response$data$length, _response$data;
3845
+ return ((_response$data$length = (_response$data = response.data) == null ? void 0 : _response$data.length) != null ? _response$data$length : 0) <= 0;
3846
+ },
3847
+ enumerable: true
3848
+ }
3849
+ });
3850
+ }, [response]);
1698
3851
  };
1699
- }();
3852
+ }
1700
3853
  };
1701
3854
 
1702
- /*
1703
- Forked from https://github.com/vercel/commerce/tree/main/packages/shopify/src
1704
- Changes:
1705
- - Removed authentication, customer and wishlist hooks.
1706
- - Added storeDomain and accessToken parameters.
1707
- */
1708
3855
  var getShopifyProvider = function getShopifyProvider(storeDomain, accessToken) {
1709
3856
  return {
1710
- locale: 'en-us',
1711
- cartCookie: SHOPIFY_CHECKOUT_ID_COOKIE,
3857
+ locale: "en-us",
3858
+ cartCookie: SHOPIFY_CART_ID_COOKIE,
1712
3859
  cart: {
1713
- useCart: handler$2,
1714
- useAddItem: handler$3,
1715
- useUpdateItem: handler$5,
1716
- useRemoveItem: handler$4
3860
+ useCart: handler,
3861
+ useAddItem: handler$1,
3862
+ useUpdateItem: handler$3,
3863
+ useRemoveItem: handler$2
1717
3864
  },
1718
3865
  fetcher: getFetcher(storeDomain, accessToken),
1719
3866
  products: {
1720
- useSearch: handler,
1721
- useProduct: handler$1
3867
+ useSearch: handler$5,
3868
+ useProduct: handler$4
1722
3869
  },
1723
3870
  site: {
1724
- useCategories: handler$6,
1725
- useBrands: handler$7
3871
+ useCategories: handler$7,
3872
+ useBrands: handler$6
1726
3873
  }
1727
3874
  };
1728
3875
  };
@@ -1746,11 +3893,11 @@ var commerceProviderMeta = /*#__PURE__*/_extends({
1746
3893
  props: {
1747
3894
  storeDomain: {
1748
3895
  type: "string",
1749
- defaultValue: "next-js-store.myshopify.com"
3896
+ defaultValue: defaultStoreDomain
1750
3897
  },
1751
3898
  accessToken: {
1752
3899
  type: "string",
1753
- defaultValue: "ef7d41c7bf7e1c214074d0d3047bcd7b"
3900
+ defaultValue: defaultAccessToken
1754
3901
  }
1755
3902
  }
1756
3903
  }, {