@plasmicpkgs/commerce-shopify 0.0.214 → 0.0.216

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