@ikas/bp-storefront 1.4.0-beta.22 → 1.4.0-beta.221

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 (131) hide show
  1. package/dist/analytics/analytics-functions/addToCart.js +1 -1
  2. package/dist/analytics/analytics-functions/addToWishlist.js +1 -1
  3. package/dist/analytics/analytics-functions/completeRegistration.js +1 -1
  4. package/dist/analytics/analytics-functions/contactForm.js +1 -1
  5. package/dist/analytics/analytics-functions/createEmailSubscription.js +1 -1
  6. package/dist/analytics/analytics-functions/customerLogin.js +1 -1
  7. package/dist/analytics/analytics-functions/customerLogout.js +1 -1
  8. package/dist/analytics/analytics-functions/customerVisit.js +1 -1
  9. package/dist/analytics/analytics-functions/pageView.js +1 -1
  10. package/dist/analytics/analytics-functions/productView.js +1 -1
  11. package/dist/analytics/analytics-functions/removeFromCart.js +1 -1
  12. package/dist/analytics/analytics-functions/search.js +1 -1
  13. package/dist/analytics/analytics-functions/viewBrand.js +1 -1
  14. package/dist/analytics/analytics-functions/viewCart.js +1 -1
  15. package/dist/analytics/analytics-functions/viewCategory.js +1 -1
  16. package/dist/analytics/analytics-functions/viewListing.js +1 -1
  17. package/dist/analytics/analytics-functions/viewSearchResults.js +1 -1
  18. package/dist/analytics/analytics-functions/viewStorefrontPopup.js +1 -1
  19. package/dist/analytics/events.d.ts +8 -0
  20. package/dist/analytics/events.js +1 -1
  21. package/dist/analytics/ikas/analytics.js +1 -1
  22. package/dist/analytics/openai/addToCart.d.ts +2 -0
  23. package/dist/analytics/openai/addToCart.js +1 -0
  24. package/dist/analytics/openai/completeRegistration.d.ts +1 -0
  25. package/dist/analytics/openai/completeRegistration.js +1 -0
  26. package/dist/analytics/openai/contactForm.d.ts +1 -0
  27. package/dist/analytics/openai/contactForm.js +1 -0
  28. package/dist/analytics/openai/initAdvancedMatching.d.ts +12 -0
  29. package/dist/analytics/openai/initAdvancedMatching.js +1 -0
  30. package/dist/analytics/openai/pageView.d.ts +1 -0
  31. package/dist/analytics/openai/pageView.js +1 -0
  32. package/dist/analytics/openai/productView.d.ts +2 -0
  33. package/dist/analytics/openai/productView.js +1 -0
  34. package/dist/analytics/openai/utils.d.ts +26 -0
  35. package/dist/analytics/openai/utils.js +1 -0
  36. package/dist/analytics/utils.d.ts +1 -0
  37. package/dist/analytics/utils.js +1 -1
  38. package/dist/functions/api/cart/index.d.ts +2 -0
  39. package/dist/functions/api/cart/index.js +1 -1
  40. package/dist/functions/api/customer/index.d.ts +10 -2
  41. package/dist/functions/api/customer/index.js +1 -1
  42. package/dist/functions/api/loyalty/index.d.ts +2 -1
  43. package/dist/functions/api/loyalty/index.js +1 -1
  44. package/dist/functions/api/product/index.js +1 -1
  45. package/dist/functions/models/attribute-detail/index.d.ts +3 -0
  46. package/dist/functions/models/attribute-list/index.d.ts +3 -0
  47. package/dist/functions/models/image/index.d.ts +71 -21
  48. package/dist/functions/models/image/index.js +1 -1
  49. package/dist/functions/models/index.d.ts +1 -0
  50. package/dist/functions/models/order/index.d.ts +139 -4
  51. package/dist/functions/models/order/index.js +1 -1
  52. package/dist/functions/models/product/attribute-value/index.d.ts +5 -0
  53. package/dist/functions/models/product/variant/index.d.ts +96 -6
  54. package/dist/functions/models/product/variant/index.js +1 -1
  55. package/dist/functions/models/product-list/index.js +1 -1
  56. package/dist/functions/models/validator/address/index.d.ts +70 -2
  57. package/dist/functions/models/validator/deactivate-customer/index.d.ts +54 -0
  58. package/dist/functions/models/validator/deactivate-customer/index.js +1 -0
  59. package/dist/functions/stores/base/index.d.ts +67 -0
  60. package/dist/functions/stores/base/index.js +1 -1
  61. package/dist/functions/stores/cart/index.d.ts +46 -2
  62. package/dist/functions/stores/cart/index.js +1 -1
  63. package/dist/functions/stores/customer/index.d.ts +322 -29
  64. package/dist/functions/stores/customer/index.js +1 -1
  65. package/dist/i18n/ikas-texts.d.ts +423 -0
  66. package/dist/i18n/index.d.ts +19 -0
  67. package/dist/index.d.ts +5 -1
  68. package/dist/index.js +1 -1
  69. package/dist/packages/storefront-api/src/__api/mutations/removeGiftCardFromCart.js +1 -0
  70. package/dist/packages/storefront-api/src/__api/mutations/unlinkExternalAccount.js +1 -0
  71. package/dist/packages/storefront-api/src/__api/queries/getExternalAccountLink.js +1 -0
  72. package/dist/packages/storefront-api/src/__api/queries/getLoyaltyProgram.js +1 -0
  73. package/dist/packages/storefront-api/src/__api/queries/getMilesSmilesDetails.js +1 -0
  74. package/dist/packages/storefront-api/src/__api/queries/getRefundableLines.js +1 -0
  75. package/dist/packages/storefront-api-client/src/utils/api.js +1 -1
  76. package/dist/packages/storefront-config/src/index.js +1 -1
  77. package/dist/packages/storefront-config/src/theme-globals.js +1 -0
  78. package/dist/router/index.d.ts +28 -0
  79. package/dist/router/index.js +1 -1
  80. package/dist/storefront-api/src/__api/mutations/removeGiftCardFromCart.d.ts +7 -0
  81. package/dist/storefront-api/src/__api/mutations/unlinkExternalAccount.d.ts +6 -0
  82. package/dist/storefront-api/src/__api/queries/getExternalAccountLink.d.ts +6 -0
  83. package/dist/storefront-api/src/__api/queries/getLoyaltyProgram.d.ts +3 -0
  84. package/dist/storefront-api/src/__api/queries/getMilesSmilesDetails.d.ts +3 -0
  85. package/dist/storefront-api/src/__api/queries/getRefundableLines.d.ts +6 -0
  86. package/dist/storefront-api/src/__api/types/index.d.ts +101 -6
  87. package/dist/storefront-api-client/src/utils/api.d.ts +7 -0
  88. package/dist/storefront-config/src/index.d.ts +32 -0
  89. package/dist/storefront-config/src/theme-globals.d.ts +349 -0
  90. package/dist/storefront-models/src/index.d.ts +8 -0
  91. package/dist/storefront-models/src/models/blueprint/prop-value/attribute-list.d.ts +2 -0
  92. package/dist/storefront-models/src/models/blueprint/prop-value/attribute.d.ts +2 -0
  93. package/dist/storefront-models/src/models/blueprint/prop-value/color.d.ts +2 -0
  94. package/dist/storefront-models/src/models/blueprint/prop-value/index.d.ts +1 -0
  95. package/dist/storefront-models/src/models/blueprint/prop-value/variable-binding.d.ts +16 -0
  96. package/dist/storefront-models/src/models/image/index.d.ts +7 -0
  97. package/dist/storefront-models/src/models/loyalty-program/customer-info/index.d.ts +2 -0
  98. package/dist/storefront-models/src/models/loyalty-program/earning-method/index.d.ts +1 -0
  99. package/dist/storefront-models/src/models/loyalty-program/index.d.ts +1 -0
  100. package/dist/storefront-models/src/models/loyalty-program/point-history/index.d.ts +1 -0
  101. package/dist/storefront-models/src/models/order/gift-card-line/index.d.ts +15 -0
  102. package/dist/storefront-models/src/models/order/index.d.ts +10 -0
  103. package/dist/storefront-models/src/models/order/line-item/index.d.ts +6 -1
  104. package/dist/storefront-models/src/models/order/package/index.d.ts +1 -1
  105. package/dist/storefront-models/src/models/order/refund/reason/index.d.ts +6 -0
  106. package/dist/storefront-models/src/models/order/refund/reason/translation/index.d.ts +4 -0
  107. package/dist/storefront-models/src/models/order/refund/refundable-line/index.d.ts +8 -0
  108. package/dist/storefront-models/src/models/order/refund/refundable-lines/index.d.ts +8 -0
  109. package/dist/storefront-models/src/models/order/refund/settings/translation/index.d.ts +4 -0
  110. package/dist/storefront-models/src/models/payment-gateway/index.d.ts +3 -1
  111. package/dist/storefront-models/src/models/product/attribute/index.d.ts +6 -1
  112. package/dist/storefront-models/src/models/product/campaign/data/index.d.ts +2 -0
  113. package/dist/storefront-models/src/models/product/campaign/filter/index.d.ts +1 -1
  114. package/dist/storefront-models/src/models/product/campaign/product-tiered-discount/index.d.ts +13 -0
  115. package/dist/storefront-models/src/models/product/image/index.d.ts +5 -0
  116. package/dist/storefront-models/src/models/product/variant/index.d.ts +17 -0
  117. package/dist/storefront-models/src/models/storefront/index.d.ts +1 -0
  118. package/dist/storefront-models/src/models/validator/deactivate-customer/index.d.ts +4 -0
  119. package/dist/stores/customer/index.d.ts +2 -1
  120. package/dist/stores/customer/index.js +1 -1
  121. package/dist/theme/settings/index.d.ts +51 -0
  122. package/dist/theme/settings/index.js +1 -0
  123. package/dist/utils/component-renderer.js +1 -1
  124. package/dist/utils/currency.d.ts +36 -3
  125. package/dist/utils/helper.d.ts +1 -0
  126. package/dist/utils/helper.js +1 -1
  127. package/dist/utils/pay-with-ikas.d.ts +552 -0
  128. package/dist/utils/pay-with-ikas.js +1 -0
  129. package/dist/utils/svg.d.ts +15 -0
  130. package/dist/utils/svg.js +1 -0
  131. package/package.json +2 -2
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import{APIResponse as s}from"../../../packages/storefront-api-client/src/utils/api.js";import'./../../../ext/isomorphic-fetch/fetch-npm-node.js';import{IkasStorefrontConfig as n}from"../../../packages/storefront-config/src/index.js";import{initIkasCustomerAttribute as i}from"../../models/customer/attribute/init.js";import{initIkasCustomerReview as o}from"../../models/customer/review/init.js";import{initIkasOrder as a}from"../../models/order/index.js";function u(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerLogin.js")];case 1:return[4,(0,e.sent().customerLogin)(n,["customer.addresses.region.createdAt","customer.addresses.region.deleted","customer.addresses.region.updatedAt"])];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.customer)||null,[2,new s(t.data?r(r({},t.data),{customer:i}):null,t.graphQLErrors)]}})})}function c(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/customerSocialLogin.js")];case 1:return[4,(0,e.sent().customerSocialLogin)(n,["customer.addresses.region.createdAt","customer.addresses.region.deleted","customer.addresses.region.updatedAt"])];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.customer)||null,[2,new s(t.data?r(r({},t.data),{customer:i}):null,t.graphQLErrors)]}})})}function d(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/registerCustomer.js")];case 1:return[4,(0,e.sent().registerCustomer)(n,["customer.addresses.region.createdAt","customer.addresses.region.deleted","customer.addresses.region.updatedAt"])];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.customer)||null,[2,new s(t.data?r(r({},t.data),{customer:i}):null,t.graphQLErrors)]}})})}function p(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerRefreshToken.js")];case 1:return[4,(0,t.sent().customerRefreshToken)(r)];case 2:return[2,t.sent()]}})})}function l(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerForgotPassword.js")];case 1:return[4,(0,t.sent().customerForgotPassword)(r)];case 2:return[2,t.sent()]}})})}function f(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerRecoverPassword.js")];case 1:return[4,(0,t.sent().customerRecoverPassword)(r)];case 2:return[2,t.sent()]}})})}function m(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/checkCustomerEmail.js")];case 1:return[4,(0,t.sent().checkCustomerEmail)(r)];case 2:return[2,t.sent()]}})})}function h(){return t(this,void 0,void 0,function(){var t,r;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getMyCustomer.js")];case 1:return[4,(0,e.sent().getMyCustomer)(["note","tagIds","customerGroupIds","passwordUpdateDate","orderCount","registrationSource","customerSequence","addresses.region.createdAt","addresses.region.deleted","addresses.region.updatedAt"])];case 2:return t=e.sent(),r=t.data||null,[2,new s(r,t.graphQLErrors)]}})})}function g(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveMyCustomer.js")];case 1:return[4,(0,e.sent().saveMyCustomer)(r,["note","tagIds","customerGroupIds","passwordUpdateDate","orderCount","registrationSource","customerSequence","addresses.region.createdAt","addresses.region.deleted","addresses.region.updatedAt"])];case 2:return t=e.sent(),n=t.data||null,[2,new s(n,t.graphQLErrors)]}})})}function v(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveCustomerFormData.js")];case 1:return[4,(0,t.sent().saveCustomerFormData)(r)];case 2:return[2,t.sent()]}})})}function w(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getCustomerOrders.js")];case 1:return[4,(0,e.sent().getCustomerOrders)(r,["billingAddress.region.createdAt","billingAddress.region.deleted","billingAddress.region.updatedAt","shippingAddress.region.createdAt","shippingAddress.region.deleted","shippingAddress.region.updatedAt"])];case 2:return t=e.sent(),n=t.data.map(a),[2,new s(n,t.graphQLErrors)]}})})}function _(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getOrderByEmail.js")];case 1:return[4,(0,e.sent().getOrderByEmail)(r,["billingAddress.region.createdAt","billingAddress.region.deleted","billingAddress.region.updatedAt","shippingAddress.region.createdAt","shippingAddress.region.deleted","shippingAddress.region.updatedAt"])];case 2:return t=e.sent(),n=t.data?a(t.data):void 0,[2,new s(n,t.graphQLErrors)]}})})}function b(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listOrderTransactions.js")];case 1:return[4,(0,e.sent().listOrderTransactions)(r)];case 2:return t=e.sent(),n=t.data,[2,new s(n,t.graphQLErrors)]}})})}function A(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/createOrderRefundRequest.js")];case 1:return[4,(0,e.sent().createOrderRefundRequest)(r,["billingAddress.region.createdAt","billingAddress.region.deleted","billingAddress.region.updatedAt","shippingAddress.region.createdAt","shippingAddress.region.deleted","shippingAddress.region.updatedAt"])];case 2:return t=e.sent(),n=a(t.data),[2,new s(n,t.graphQLErrors)]}})})}function j(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/subscribeToMarketingNotifications.js")];case 1:return[4,(0,t.sent().subscribeToMarketingNotifications)(r)];case 2:return[2,t.sent()]}})})}function k(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getLastViewedProducts.js")];case 1:return[4,(0,e.sent().getLastViewedProducts)(r)];case 2:return t=e.sent(),[2,new s(null===(n=t.data)||void 0===n?void 0:n.products,t.graphQLErrors)]}})})}function C(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveLastViewedProducts.js")];case 1:return[4,(0,t.sent().saveLastViewedProducts)(r)];case 2:return[2,t.sent()]}})})}function L(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listOrderRefundSettings.js")];case 1:return[4,(0,e.sent().listOrderRefundSettings)(n)];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.map(function(t){return r({},t)}))||null,[2,new s(i,t.graphQLErrors)]}})})}function E(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/sendContactFormToMerchant.js")];case 1:return[4,(0,t.sent().sendContactFormToMerchant)(r)];case 2:return[2,t.sent()]}})})}function P(){return t(this,void 0,void 0,function(){var t,r;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listFavoriteProducts.js")];case 1:return[4,(0,e.sent().listFavoriteProducts)()];case 2:return t=e.sent(),r=t.data||null,[2,new s(r,t.graphQLErrors)]}})})}function q(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveFavoriteProduct.js")];case 1:return[4,(0,t.sent().saveFavoriteProduct)(r)];case 2:return[2,t.sent()]}})})}function Q(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/isFavoriteProduct.js")];case 1:return[4,(0,t.sent().isFavoriteProduct)({productId:r.productId})];case 2:return[2,t.sent()]}})})}function R(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/createCustomerReview.js")];case 1:return[4,(0,e.sent().createCustomerReview)(r)];case 2:return t=e.sent(),(n=t.data)&&o(n),[2,new s(n,t.graphQLErrors)]}})})}function F(n){return t(this,void 0,void 0,function(){var t,i,a;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCustomerReviews.js")];case 1:return[4,(0,e.sent().listCustomerReviews)(n)];case 2:return t=e.sent(),(i=(null===(a=t.data)||void 0===a?void 0:a.data)||[]).forEach(o),[2,new s(t.data?r(r({},t.data),{data:i}):null,t.graphQLErrors)]}})})}function D(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCustomerReviewSummary.js")];case 1:return[4,(0,e.sent().listCustomerReviewSummary)(n)];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.data)||[],[2,new s(r(r({},t.data),{data:i}),t.graphQLErrors)]}})})}function O(){return t(this,void 0,void 0,function(){var t,r;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCustomerAttribute.js")];case 1:return[4,(0,e.sent().listCustomerAttribute)()];case 2:return t=e.sent(),(r=t.data||[]).sort(function(t,e){return t.order&&e.order?t.order-e.order:-1}).forEach(function(t){return i(t,n.getCurrentLocale())}),[2,new s(r,t.graphQLErrors)]}})})}function S(n){return t(this,void 0,void 0,function(){var t,i;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCustomerSettings.js")];case 1:return[4,(0,e.sent().listCustomerSettings)(n)];case 2:return t=e.sent(),i=t.data||[],[2,new s(r(r({},t.data),{data:i}),t.graphQLErrors)]}})})}function M(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/activateCustomer.js")];case 1:return[4,(0,t.sent().activateCustomer)(r)];case 2:return[2,t.sent()]}})})}function T(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/resendCustomerActivationMail.js")];case 1:return[4,(0,t.sent().resendCustomerActivationMail)(r)];case 2:return[2,t.sent()]}})})}function I(){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/resendCustomerPhoneVerificationCode.js")];case 1:return[4,(0,t.sent().resendCustomerPhoneVerificationCode)()];case 2:return[2,t.sent()]}})})}function y(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/validateCustomerPhoneVerificationCode.js")];case 1:return[4,(0,t.sent().validateCustomerPhoneVerificationCode)(r)];case 2:return[2,t.sent()]}})})}function V(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/validateOTPCode.js")];case 1:return[4,(0,e.sent().validateOTPCode)(n)];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.customer)||null,[2,new s(t.data?r(r({},t.data),{customer:i}):null,t.graphQLErrors)]}})})}function x(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerDeactivate.js")];case 1:return[4,(0,t.sent().customerDeactivate)(r)];case 2:return[2,t.sent()]}})})}function U(){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/exportCustomerPersonalData.js")];case 1:return[4,(0,t.sent().exportCustomerPersonalData)()];case 2:return[2,t.sent()]}})})}function B(r,s){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getDigitalProductFileDownloadUrl.js")];case 1:return[4,(0,t.sent().getDigitalProductFileDownloadUrl)({orderId:r,orderLineItemId:s})];case 2:return[2,t.sent()]}})})}export{M as apiActivateCustomer,m as apiCheckEmail,R as apiCreateCustomerReview,A as apiCreateOrderRefundRequest,x as apiDeactivateCustomer,U as apiExportCustomerPersonalData,l as apiForgotPassword,h as apiGetCustomer,B as apiGetDigitalProductFileDownloadUrl,k as apiGetLastViewedProducts,_ as apiGetOrderByEmail,w as apiGetOrders,Q as apiIsFavoriteProduct,O as apiListCustomerAttribute,D as apiListCustomerReviewSummary,F as apiListCustomerReviews,S as apiListCustomerSettings,P as apiListFavoriteProducts,L as apiListOrderRefundSettings,b as apiListOrderTransactions,u as apiLogin,f as apiRecoverPassword,p as apiRefreshToken,d as apiRegister,T as apiResendCustomerActivationMail,I as apiResendCustomerPhoneVerificationCode,g as apiSaveCustomer,v as apiSaveCustomerFormData,q as apiSaveFavoriteProduct,C as apiSaveLastViewedProducts,E as apiSendContactFormToMerchant,c as apiSocialLogin,j as apiSubscribeToMarketingNotifications,y as apiValidateCustomerPhoneVerificationCode,V as apiValidateOTPCode};
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import{APIResponse as s}from"../../../packages/storefront-api-client/src/utils/api.js";import'./../../../ext/isomorphic-fetch/fetch-npm-node.js';import{IkasStorefrontConfig as n}from"../../../packages/storefront-config/src/index.js";import{initIkasCustomerAttribute as i}from"../../models/customer/attribute/init.js";import{initIkasCustomerReview as o}from"../../models/customer/review/init.js";import{initIkasOrder as a}from"../../models/order/index.js";function u(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerLogin.js")];case 1:return[4,(0,e.sent().customerLogin)(n,["customer.addresses.region.createdAt","customer.addresses.region.deleted","customer.addresses.region.updatedAt"])];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.customer)||null,[2,new s(t.data?r(r({},t.data),{customer:i}):null,t.graphQLErrors)]}})})}function c(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/customerSocialLogin.js")];case 1:return[4,(0,e.sent().customerSocialLogin)(n,["customer.addresses.region.createdAt","customer.addresses.region.deleted","customer.addresses.region.updatedAt"])];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.customer)||null,[2,new s(t.data?r(r({},t.data),{customer:i}):null,t.graphQLErrors)]}})})}function d(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/registerCustomer.js")];case 1:return[4,(0,e.sent().registerCustomer)(n,["customer.addresses.region.createdAt","customer.addresses.region.deleted","customer.addresses.region.updatedAt"])];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.customer)||null,[2,new s(t.data?r(r({},t.data),{customer:i}):null,t.graphQLErrors)]}})})}function p(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerRefreshToken.js")];case 1:return[4,(0,t.sent().customerRefreshToken)(r)];case 2:return[2,t.sent()]}})})}function l(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerForgotPassword.js")];case 1:return[4,(0,t.sent().customerForgotPassword)(r)];case 2:return[2,t.sent()]}})})}function f(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerRecoverPassword.js")];case 1:return[4,(0,t.sent().customerRecoverPassword)(r)];case 2:return[2,t.sent()]}})})}function m(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/checkCustomerEmail.js")];case 1:return[4,(0,t.sent().checkCustomerEmail)(r)];case 2:return[2,t.sent()]}})})}function h(){return t(this,void 0,void 0,function(){var t,r;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getMyCustomer.js")];case 1:return[4,(0,e.sent().getMyCustomer)(["note","tagIds","customerGroupIds","passwordUpdateDate","orderCount","registrationSource","customerSequence","addresses.region.createdAt","addresses.region.deleted","addresses.region.updatedAt"])];case 2:return t=e.sent(),r=t.data||null,[2,new s(r,t.graphQLErrors)]}})})}function g(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveMyCustomer.js")];case 1:return[4,(0,e.sent().saveMyCustomer)(r,["note","tagIds","customerGroupIds","passwordUpdateDate","orderCount","registrationSource","customerSequence","addresses.region.createdAt","addresses.region.deleted","addresses.region.updatedAt"])];case 2:return t=e.sent(),n=t.data||null,[2,new s(n,t.graphQLErrors)]}})})}function v(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveCustomerFormData.js")];case 1:return[4,(0,t.sent().saveCustomerFormData)(r)];case 2:return[2,t.sent()]}})})}function _(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getCustomerOrders.js")];case 1:return[4,(0,e.sent().getCustomerOrders)(r,["billingAddress.region.createdAt","billingAddress.region.deleted","billingAddress.region.updatedAt","shippingAddress.region.createdAt","shippingAddress.region.deleted","shippingAddress.region.updatedAt"])];case 2:return t=e.sent(),n=t.data.map(a),[2,new s(n,t.graphQLErrors)]}})})}function w(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getOrderByEmail.js")];case 1:return[4,(0,e.sent().getOrderByEmail)(r,["billingAddress.region.createdAt","billingAddress.region.deleted","billingAddress.region.updatedAt","shippingAddress.region.createdAt","shippingAddress.region.deleted","shippingAddress.region.updatedAt"])];case 2:return t=e.sent(),n=t.data?a(t.data):void 0,[2,new s(n,t.graphQLErrors)]}})})}function b(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listOrderTransactions.js")];case 1:return[4,(0,e.sent().listOrderTransactions)(r)];case 2:return t=e.sent(),n=t.data,[2,new s(n,t.graphQLErrors)]}})})}function k(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getRefundableLines.js")];case 1:return[4,(0,e.sent().getRefundableLines)(r)];case 2:return t=e.sent(),n=t.data,[2,new s(n,t.graphQLErrors)]}})})}function A(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/createOrderRefundRequest.js")];case 1:return[4,(0,e.sent().createOrderRefundRequest)(r,["billingAddress.region.createdAt","billingAddress.region.deleted","billingAddress.region.updatedAt","shippingAddress.region.createdAt","shippingAddress.region.deleted","shippingAddress.region.updatedAt"])];case 2:return t=e.sent(),n=t.data?a(t.data):null,[2,new s(n,t.graphQLErrors)]}})})}function j(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/subscribeToMarketingNotifications.js")];case 1:return[4,(0,t.sent().subscribeToMarketingNotifications)(r)];case 2:return[2,t.sent()]}})})}function C(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getLastViewedProducts.js")];case 1:return[4,(0,e.sent().getLastViewedProducts)(r)];case 2:return t=e.sent(),[2,new s(null===(n=t.data)||void 0===n?void 0:n.products,t.graphQLErrors)]}})})}function L(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveLastViewedProducts.js")];case 1:return[4,(0,t.sent().saveLastViewedProducts)(r)];case 2:return[2,t.sent()]}})})}function E(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listOrderRefundSettings.js")];case 1:return[4,(0,e.sent().listOrderRefundSettings)(n)];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.map(function(t){return r({},t)}))||null,[2,new s(i,t.graphQLErrors)]}})})}function P(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/sendContactFormToMerchant.js")];case 1:return[4,(0,t.sent().sendContactFormToMerchant)(r)];case 2:return[2,t.sent()]}})})}function q(){return t(this,void 0,void 0,function(){var t,r;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listFavoriteProducts.js")];case 1:return[4,(0,e.sent().listFavoriteProducts)()];case 2:return t=e.sent(),r=t.data||null,[2,new s(r,t.graphQLErrors)]}})})}function Q(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveFavoriteProduct.js")];case 1:return[4,(0,t.sent().saveFavoriteProduct)(r)];case 2:return[2,t.sent()]}})})}function R(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/isFavoriteProduct.js")];case 1:return[4,(0,t.sent().isFavoriteProduct)({productId:r.productId})];case 2:return[2,t.sent()]}})})}function D(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/createCustomerReview.js")];case 1:return[4,(0,e.sent().createCustomerReview)(r)];case 2:return t=e.sent(),(n=t.data)&&o(n),[2,new s(n,t.graphQLErrors)]}})})}function F(n){return t(this,void 0,void 0,function(){var t,i,a;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCustomerReviews.js")];case 1:return[4,(0,e.sent().listCustomerReviews)(n)];case 2:return t=e.sent(),(i=(null===(a=t.data)||void 0===a?void 0:a.data)||[]).forEach(o),[2,new s(t.data?r(r({},t.data),{data:i}):null,t.graphQLErrors)]}})})}function S(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCustomerReviewSummary.js")];case 1:return[4,(0,e.sent().listCustomerReviewSummary)(n)];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.data)||[],[2,new s(r(r({},t.data),{data:i}),t.graphQLErrors)]}})})}function M(){return t(this,void 0,void 0,function(){var t,r;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCustomerAttribute.js")];case 1:return[4,(0,e.sent().listCustomerAttribute)()];case 2:return t=e.sent(),(r=t.data||[]).sort(function(t,e){return t.order&&e.order?t.order-e.order:-1}).forEach(function(t){return i(t,n.getCurrentLocale())}),[2,new s(r,t.graphQLErrors)]}})})}function O(n){return t(this,void 0,void 0,function(){var t,i;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCustomerSettings.js")];case 1:return[4,(0,e.sent().listCustomerSettings)(n)];case 2:return t=e.sent(),i=t.data||[],[2,new s(r(r({},t.data),{data:i}),t.graphQLErrors)]}})})}function T(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/activateCustomer.js")];case 1:return[4,(0,t.sent().activateCustomer)(r)];case 2:return[2,t.sent()]}})})}function x(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/resendCustomerActivationMail.js")];case 1:return[4,(0,t.sent().resendCustomerActivationMail)(r)];case 2:return[2,t.sent()]}})})}function I(){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/resendCustomerPhoneVerificationCode.js")];case 1:return[4,(0,t.sent().resendCustomerPhoneVerificationCode)()];case 2:return[2,t.sent()]}})})}function y(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/validateCustomerPhoneVerificationCode.js")];case 1:return[4,(0,t.sent().validateCustomerPhoneVerificationCode)(r)];case 2:return[2,t.sent()]}})})}function V(n){return t(this,void 0,void 0,function(){var t,i,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/validateOTPCode.js")];case 1:return[4,(0,e.sent().validateOTPCode)(n)];case 2:return t=e.sent(),i=(null===(o=t.data)||void 0===o?void 0:o.customer)||null,[2,new s(t.data?r(r({},t.data),{customer:i}):null,t.graphQLErrors)]}})})}function U(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/customerDeactivate.js")];case 1:return[4,(0,t.sent().customerDeactivate)(r)];case 2:return[2,t.sent()]}})})}function B(){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/exportCustomerPersonalData.js")];case 1:return[4,(0,t.sent().exportCustomerPersonalData)()];case 2:return[2,t.sent()]}})})}function G(r,s){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getDigitalProductFileDownloadUrl.js")];case 1:return[4,(0,t.sent().getDigitalProductFileDownloadUrl)({orderId:r,orderLineItemId:s})];case 2:return[2,t.sent()]}})})}function N(r){return t(this,void 0,void 0,function(){var t,n;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getExternalAccountLink.js")];case 1:return[4,(0,e.sent().getExternalAccountLink)(r)];case 2:return t=e.sent(),[2,new s(null!==(n=t.data)&&void 0!==n?n:null,t.graphQLErrors)]}})})}function z(r){return t(this,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/unlinkExternalAccount.js")];case 1:return[4,(0,e.sent().unlinkExternalAccount)(r)];case 2:return t=e.sent(),[2,new s(!!t.data,t.graphQLErrors)]}})})}function H(){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getMilesSmilesDetails.js")];case 1:return[4,(0,t.sent().getMilesSmilesDetails)()];case 2:return[2,t.sent()]}})})}export{T as apiActivateCustomer,m as apiCheckEmail,D as apiCreateCustomerReview,A as apiCreateOrderRefundRequest,U as apiDeactivateCustomer,B as apiExportCustomerPersonalData,l as apiForgotPassword,h as apiGetCustomer,G as apiGetDigitalProductFileDownloadUrl,N as apiGetExternalAccountLink,C as apiGetLastViewedProducts,H as apiGetMilesSmilesDetails,w as apiGetOrderByEmail,_ as apiGetOrders,k as apiGetRefundableLines,R as apiIsFavoriteProduct,M as apiListCustomerAttribute,S as apiListCustomerReviewSummary,F as apiListCustomerReviews,O as apiListCustomerSettings,q as apiListFavoriteProducts,E as apiListOrderRefundSettings,b as apiListOrderTransactions,u as apiLogin,f as apiRecoverPassword,p as apiRefreshToken,d as apiRegister,x as apiResendCustomerActivationMail,I as apiResendCustomerPhoneVerificationCode,g as apiSaveCustomer,v as apiSaveCustomerFormData,Q as apiSaveFavoriteProduct,L as apiSaveLastViewedProducts,P as apiSendContactFormToMerchant,c as apiSocialLogin,j as apiSubscribeToMarketingNotifications,z as apiUnlinkExternalAccount,y as apiValidateCustomerPhoneVerificationCode,V as apiValidateOTPCode};
@@ -2,8 +2,9 @@ import { APIResponse, CartV2, ListLoyaltyProgramPointHistoryQueryParams, UseLoya
2
2
  import { RemoveLoyaltyPointsFromCartQueryParams } from "../../../storefront-api/src/__api/mutations/removeLoyaltyPointsFromCart";
3
3
  import { GetLoyaltyCustomerInfoQueryParams } from "../../../storefront-api/src/__api/queries/getLoyaltyCustomerInfo";
4
4
  import { ListSpendingMethodsByCartIdQueryParams } from "../../../storefront-api/src/__api/queries/listSpendingMethodsByCartId";
5
- import { IkasLoyaltyCustomerInfo, IkasLoyaltyProgramEarningMethod, IkasLoyaltyProgramPointHistory, IkasLoyaltyProgramSpendingMethod, IkasLoyaltyProgramTier, IkasStorefrontWidgetSettings } from "../../../storefront-models/src";
5
+ import { IkasLoyaltyCustomerInfo, IkasLoyaltyProgram, IkasLoyaltyProgramEarningMethod, IkasLoyaltyProgramPointHistory, IkasLoyaltyProgramSpendingMethod, IkasLoyaltyProgramTier, IkasStorefrontWidgetSettings } from "../../../storefront-models/src";
6
6
  export declare function apiGetStorefrontWidgetSettings(): Promise<APIResponse<IkasStorefrontWidgetSettings>>;
7
+ export declare function apiGetLoyaltyProgram(): Promise<APIResponse<IkasLoyaltyProgram>>;
7
8
  export declare function apiListEarningMethods(): Promise<APIResponse<IkasLoyaltyProgramEarningMethod[]>>;
8
9
  export declare function apiListLoyaltyProgramTiers(): Promise<APIResponse<IkasLoyaltyProgramTier[]>>;
9
10
  export declare function apiListSpendingMethodsByCartId(params: ListSpendingMethodsByCartIdQueryParams): Promise<APIResponse<IkasLoyaltyProgramSpendingMethod[]>>;
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import"../../../packages/storefront-api/src/index.js";import{APIResponse as e}from"../../../packages/storefront-api-client/src/utils/api.js";import'./../../../ext/isomorphic-fetch/fetch-npm-node.js';function s(){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getStorefrontWidgetSettings.js")];case 1:return[4,(0,r.sent().getStorefrontWidgetSettings)()];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function n(){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listEarningMethods.js")];case 1:return[4,(0,r.sent().listEarningMethods)()];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function i(){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listLoyaltyProgramTiers.js")];case 1:return[4,(0,r.sent().listLoyaltyProgramTiers)()];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function o(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listSpendingMethodsByCartId.js")];case 1:return[4,(0,r.sent().listSpendingMethodsByCartId)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function a(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getLoyaltyCustomerInfo.js")];case 1:return[4,(0,r.sent().getLoyaltyCustomerInfo)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function c(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listLoyaltyProgramPointHistory.js")];case 1:return[4,(0,r.sent().listLoyaltyProgramPointHistory)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function u(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/useLoyaltyPoints.js")];case 1:return[4,(0,r.sent().useLoyaltyPoints)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function p(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/removeLoyaltyPointsFromCart.js")];case 1:return[4,(0,r.sent().removeLoyaltyPointsFromCart)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}export{a as apiGetLoyaltyCustomerInfo,s as apiGetStorefrontWidgetSettings,n as apiListEarningMethods,c as apiListLoyaltyProgramPointHistory,i as apiListLoyaltyProgramTiers,o as apiListSpendingMethodsByCartId,p as apiRemoveLoyaltyPointsFromCart,u as apiUseLoyaltyPoints};
1
+ import{__awaiter as t,__generator as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import"../../../packages/storefront-api/src/index.js";import{APIResponse as e}from"../../../packages/storefront-api-client/src/utils/api.js";import'./../../../ext/isomorphic-fetch/fetch-npm-node.js';function s(){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getStorefrontWidgetSettings.js")];case 1:return[4,(0,r.sent().getStorefrontWidgetSettings)()];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function n(){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getLoyaltyProgram.js")];case 1:return[4,(0,r.sent().getLoyaltyProgram)()];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function i(){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listEarningMethods.js")];case 1:return[4,(0,r.sent().listEarningMethods)()];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function o(){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listLoyaltyProgramTiers.js")];case 1:return[4,(0,r.sent().listLoyaltyProgramTiers)()];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function a(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listSpendingMethodsByCartId.js")];case 1:return[4,(0,r.sent().listSpendingMethodsByCartId)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function c(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getLoyaltyCustomerInfo.js")];case 1:return[4,(0,r.sent().getLoyaltyCustomerInfo)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function u(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listLoyaltyProgramPointHistory.js")];case 1:return[4,(0,r.sent().listLoyaltyProgramPointHistory)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function p(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/useLoyaltyPoints.js")];case 1:return[4,(0,r.sent().useLoyaltyPoints)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}function f(s){return t(this,void 0,void 0,function(){var t;return r(this,function(r){switch(r.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/removeLoyaltyPointsFromCart.js")];case 1:return[4,(0,r.sent().removeLoyaltyPointsFromCart)(s)];case 2:return t=r.sent(),[2,new e(t.data,t.graphQLErrors)]}})})}export{c as apiGetLoyaltyCustomerInfo,n as apiGetLoyaltyProgram,s as apiGetStorefrontWidgetSettings,i as apiListEarningMethods,u as apiListLoyaltyProgramPointHistory,o as apiListLoyaltyProgramTiers,a as apiListSpendingMethodsByCartId,f as apiRemoveLoyaltyPointsFromCart,p as apiUseLoyaltyPoints};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import{APIResponse as n}from"../../../packages/storefront-api-client/src/utils/api.js";import'./../../../ext/isomorphic-fetch/fetch-npm-node.js';import{IkasStorefrontConfig as i}from"../../../packages/storefront-config/src/index.js";import{initIkasProductAttribute as a}from"../../models/product/attribute/init.js";import{initIkasCampaignOffer as o}from"../../models/product/campaign-offer/init.js";import{initIkasProduct as u}from"../../models/product/init.js";import{initIkasProductOptionSet as d}from"../../models/product/option-set/init.js";function s(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listProductBackInStockRemind.js")];case 1:return[4,(0,t.sent().listProductBackInStockRemind)(r)];case 2:return[2,t.sent()]}})})}function c(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveProductBackInStockRemind.js")];case 1:return[4,(0,t.sent().saveProductBackInStockRemind)(r)];case 2:return[2,t.sent()]}})})}function l(r){return t(this,void 0,void 0,function(){var t,a;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCampaignOffer.js")];case 1:return[4,(0,e.sent().listCampaignOffer)(r)];case 2:return t=e.sent(),null===(a=t.data)||void 0===a||a.forEach(function(t){o(t,i.getCurrentLocale())}),[2,new n(t.data||null,t.graphQLErrors)]}})})}function p(a,o){return t(this,void 0,void 0,function(){var t,d,s,c,l,p;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/searchProducts.js")];case 1:return t=e.sent().searchProducts,d=null===(l=i.getCurrentRouting())||void 0===l?void 0:l.dynamicCurrencySettings,[4,t({input:r(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:d?{roundingFormat:d.roundingFormat,targetCurrencyCode:d.targetCurrencyCode}:void 0},a.input),{showStockOption:a.input.showStockOption||i.stockPreference||"SHOW_ALL"})},o)];case 2:return s=e.sent(),null==(c=null===(p=s.data)||void 0===p?void 0:p.results.map(I))||c.forEach(function(t){return u(t,i.getCurrentLocale())}),[2,new n(s.data?r(r({},s.data),{data:c}):null,s.graphQLErrors)]}})})}function v(r){return t(this,void 0,void 0,function(){var t,i,a,o,u,d,s;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getProductFilterData.js")];case 1:return[4,(0,e.sent().getProductFilterData)(r)];case 2:return t=e.sent(),i=null===(u=t.data)||void 0===u?void 0:u.filters,a=(null===(d=t.data)||void 0===d?void 0:d.categories)||null,o=(null===(s=t.data)||void 0===s?void 0:s.disabledSortTypes)||null,[2,new n(t.data?{filters:i,categories:a,disabledSortTypes:o}:null,t.graphQLErrors)]}})})}function m(a){return t(this,void 0,void 0,function(){var t,o,d,s,c,l;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getRelatedProducts.js")];case 1:return t=e.sent().getRelatedProducts,o=null===(c=i.getCurrentRouting())||void 0===c?void 0:c.dynamicCurrencySettings,[4,t(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:o?{roundingFormat:o.roundingFormat,targetCurrencyCode:o.targetCurrencyCode}:void 0},a))];case 2:return d=e.sent(),(s=(null===(l=null==d?void 0:d.data)||void 0===l?void 0:l.map(function(t){return I(t)}))||[]).forEach(function(t){return u(t,i.getCurrentLocale())}),[2,new n(d.data?{data:s,count:d.data.length,facets:null,limit:20,page:1,totalCount:d.data.length}:null,d.graphQLErrors)]}})})}function g(a){return t(this,void 0,void 0,function(){var t,o,d,s,c,l;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getSuggestedProducts.js")];case 1:return t=e.sent().getSuggestedProducts,o=null===(c=i.getCurrentRouting())||void 0===c?void 0:c.dynamicCurrencySettings,[4,t(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:o?{roundingFormat:o.roundingFormat,targetCurrencyCode:o.targetCurrencyCode}:void 0},a))];case 2:return d=e.sent(),(s=(null===(l=null==d?void 0:d.data)||void 0===l?void 0:l.map(function(t){return I(t)}))||[]).forEach(function(t){return u(t,i.getCurrentLocale())}),[2,new n(d.data?{data:s,count:d.data.length,facets:null,limit:20,page:1,totalCount:d.data.length}:null,d.graphQLErrors)]}})})}function f(r){return t(this,void 0,void 0,function(){var t,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listProductAttribute.js")];case 1:return[4,(0,e.sent().listProductAttribute)(r)];case 2:return t=e.sent(),null==(o=t.data)||o.forEach(function(t){return a(t,i.getCurrentLocale())}),[2,new n(o,t.graphQLErrors)]}})})}function h(r){return t(this,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getProductCampaigns.js")];case 1:return[4,(0,e.sent().getProductCampaigns)(r)];case 2:return t=e.sent(),[2,new n(t.data,t.graphQLErrors)]}})})}function b(r){return t(this,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getVariantStockLocations.js")];case 1:return[4,(0,e.sent().getVariantStockLocations)(r)];case 2:return t=e.sent(),[2,new n(t.data,t.graphQLErrors)]}})})}function y(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/getOrderLineFile.js")];case 1:return[4,(0,t.sent().getOrderLineFile)(r)];case 2:return[2,t.sent()]}})})}function C(r,a){return t(this,void 0,void 0,function(){var t,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listProductOptionSet.js")];case 1:return[4,(0,e.sent().listProductOptionSet)(r)];case 2:return t=e.sent(),null==(o=t.data)||o.forEach(function(t){return d(t,i.getCurrentLocale(),a)}),[2,new n(o,t.graphQLErrors)]}})})}function I(t){var e,n,a,o,u,d="local"===import.meta.env.VITE_ENV;return{id:t.id,type:t.type,groupVariantsByVariantTypeId:t.groupVariantsByVariantTypeId,deleted:t.deleted,selectedVariantValues:[],offers:[],bundleProductCache:{},productOptionSet:null,showVariantsInGroup:!1,attributes:(null===(e=t.attributes)||void 0===e?void 0:e.map(function(t){var e,n,i,a,o,u;return r(r({},t),{value:t.value,productAttributeId:(null===(e=t.productAttribute)||void 0===e?void 0:e.id)||null,productAttributeOptionId:(null===(n=t.productAttributeOption)||void 0===n?void 0:n.id)||null,productAttribute:{id:(null===(i=t.productAttribute)||void 0===i?void 0:i.id)||"",name:(null===(a=t.productAttribute)||void 0===a?void 0:a.name)||"",description:null,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(u=t.productAttribute)||void 0===u?void 0:u.tableTemplate)?t.productAttribute.tableTemplate:null,options:null},productAttributeOption:t.productAttributeOption})}))||[],brand:t.brand?r(r({},t.brand),{id:t.brand.id,name:t.brand.name,createdAt:0,updatedAt:0,description:null,imageId:t.brand.imageId,orderType:"BEST_SELLER",metaData:{id:"",createdAt:0,updatedAt:0,slug:t.brand.slug||""}}):null,campaigns:null===(n=t.campaigns)||void 0===n?void 0:n.map(function(t){return{campaign:t,variantIds:[]}}),campaignOffers:t.campaignOffers,categories:(null===(a=t.categories)||void 0===a?void 0:a.map(function(t){var e;return r(r({},t),{categoryPath:t.path.map(function(t){return t.name}),description:null,imageId:null,parentId:null,metaData:t.slug?{id:"",createdAt:0,updatedAt:0,name:t.name||"",slug:t.slug,translations:null===(e=t.translations)||void 0===e?void 0:e.map(function(t){return{pageTitle:t.name,slug:t.slug,locale:t.locale,description:null}})}:null,categoryPathItems:t.path.map(function(t){return{metaData:{id:"",createdAt:0,updatedAt:0,name:t.name||"",slug:t.slug||""},description:null,name:t.name,translations:t.translations,imageId:null,id:t.id,createdAt:0,updatedAt:0}}),createdAt:0,updatedAt:0,orderType:"BEST_SELLER",conditions:null,conditionValues:null})}))||[],tags:t.tags||[],description:t.description||"",averageRating:t.averageRating,reviewCount:t.reviewCount,stars:t.stars,baseUnit:t.baseUnit,metaData:r(r({},t.metaData),{id:"",createdAt:0,updatedAt:0,slug:(null===(o=t.metaData)||void 0===o?void 0:o.slug)||""}),name:t.name,productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map(function(t){return{order:t.order,variantType:{id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map(function(e){return{id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id}}).filter(function(e){return t.variantValueIds.includes(e.id)})},variantValueIds:t.variantValueIds}}),variants:t.variants.map(function(e){var n,a,o,u;return r(r({},e),{id:e.id,productId:t.id,images:(null===(n=e.images)||void 0===n?void 0:n.map(function(t){return{imageId:t.id,isMain:t.isMain||!1,isVideo:t.isVideo,order:t.order,fileName:t.fileName}}))||null,sellIfOutOfStock:e.sellIfOutOfStock||!1,isBackInStockReminderSaved:!1,unit:e.unit,attributes:(null===(a=e.attributes)||void 0===a?void 0:a.map(function(t){var e,n,i,a,o,u;return r(r({},t),{value:t.value,productAttributeId:(null===(e=t.productAttribute)||void 0===e?void 0:e.id)||null,productAttributeOptionId:(null===(n=t.productAttributeOption)||void 0===n?void 0:n.id)||null,productAttribute:{id:(null===(i=t.productAttribute)||void 0===i?void 0:i.id)||"",name:(null===(a=t.productAttribute)||void 0===a?void 0:a.name)||"",description:"",type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(u=t.productAttribute)||void 0===u?void 0:u.tableTemplate)?t.productAttribute.tableTemplate:null,options:null},productAttributeOption:t.productAttributeOption})}))||[],sku:e.sku,barcodeList:e.barcodeList||null,prices:e.prices||[],price:{buyPrice:null,campaignPrice:null,currency:"",currencyCode:"",currencySymbol:"",discountPrice:null,priceListId:null,sellPrice:0,unitPrice:null},stock:(null===(o=e.stocks)||void 0===o?void 0:o.filter(function(t){var e;return d||i.isEditor||(null===(e=i.stockLocationIds)||void 0===e?void 0:e.includes(t.stockLocationId))}).reduce(function(t,e){return e.stockCount+t},0))||0,variantValues:(null===(u=e.variantValues)||void 0===u?void 0:u.map(function(e){var r=t.productVariantTypes.find(function(t){return t.variantType.id===e.variantTypeId}),n=null==r?void 0:r.variantType.values.find(function(t){return t.id===e.variantValueId});return{id:e.variantValueId,name:(null==n?void 0:n.name)||"",colorCode:(null==n?void 0:n.colorCode)||"",thumbnailImageId:(null==n?void 0:n.thumbnailImageId)||"",variantTypeId:(null==r?void 0:r.variantType.id)||""}}))||[],isActive:e.isActive||!1,bundleSettings:e.bundleSettings||null})}),dynamicPriceListIds:null,productGroup:t.productGroup,salesChannels:null===(u=t.salesChannels)||void 0===u?void 0:u.filter(function(t){return t.id===i.salesChannelId})}}export{y as apiGetOrderLineFile,h as apiGetProductCampaigns,v as apiGetProductFilterData,m as apiGetRelatedProducts,g as apiGetSuggestedProducts,b as apiGetVariantStockLocations,l as apiListCampaignOffer,f as apiListProductAttribute,s as apiListProductBackInStockRemind,C as apiListProductOptionSet,c as apiSaveProductBackInStockRemind,p as apiSearchProducts};
1
+ import{__awaiter as t,__generator as e,__assign as r}from'./../../../ext/tslib/tslib.es6.mjs.js';import{APIResponse as n}from"../../../packages/storefront-api-client/src/utils/api.js";import'./../../../ext/isomorphic-fetch/fetch-npm-node.js';import{IkasStorefrontConfig as i}from"../../../packages/storefront-config/src/index.js";import{initIkasProductAttribute as a}from"../../models/product/attribute/init.js";import{initIkasCampaignOffer as o}from"../../models/product/campaign-offer/init.js";import{initIkasProduct as u}from"../../models/product/init.js";import{initIkasProductOptionSet as d}from"../../models/product/option-set/init.js";function s(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listProductBackInStockRemind.js")];case 1:return[4,(0,t.sent().listProductBackInStockRemind)(r)];case 2:return[2,t.sent()]}})})}function c(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/saveProductBackInStockRemind.js")];case 1:return[4,(0,t.sent().saveProductBackInStockRemind)(r)];case 2:return[2,t.sent()]}})})}function l(r){return t(this,void 0,void 0,function(){var t,a;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listCampaignOffer.js")];case 1:return[4,(0,e.sent().listCampaignOffer)(r)];case 2:return t=e.sent(),null===(a=t.data)||void 0===a||a.forEach(function(t){o(t,i.getCurrentLocale())}),[2,new n(t.data||null,t.graphQLErrors)]}})})}function p(a,o){return t(this,void 0,void 0,function(){var t,d,s,c,l,p;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/searchProducts.js")];case 1:return t=e.sent().searchProducts,d=null===(l=i.getCurrentRouting())||void 0===l?void 0:l.dynamicCurrencySettings,[4,t({input:r(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:d?{roundingFormat:d.roundingFormat,targetCurrencyCode:d.targetCurrencyCode}:void 0},a.input),{showStockOption:a.input.showStockOption||i.stockPreference||"SHOW_ALL"})},o)];case 2:return s=e.sent(),null==(c=null===(p=s.data)||void 0===p?void 0:p.results.map(I))||c.forEach(function(t){return u(t,i.getCurrentLocale())}),[2,new n(s.data?r(r({},s.data),{data:c}):null,s.graphQLErrors)]}})})}function v(r){return t(this,void 0,void 0,function(){var t,i,a,o,u,d,s;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getProductFilterData.js")];case 1:return[4,(0,e.sent().getProductFilterData)(r)];case 2:return t=e.sent(),i=null===(u=t.data)||void 0===u?void 0:u.filters,a=(null===(d=t.data)||void 0===d?void 0:d.categories)||null,o=(null===(s=t.data)||void 0===s?void 0:s.disabledSortTypes)||null,[2,new n(t.data?{filters:i,categories:a,disabledSortTypes:o}:null,t.graphQLErrors)]}})})}function m(a){return t(this,void 0,void 0,function(){var t,o,d,s,c,l;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getRelatedProducts.js")];case 1:return t=e.sent().getRelatedProducts,o=null===(c=i.getCurrentRouting())||void 0===c?void 0:c.dynamicCurrencySettings,[4,t(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:o?{roundingFormat:o.roundingFormat,targetCurrencyCode:o.targetCurrencyCode}:void 0},a))];case 2:return d=e.sent(),(s=(null===(l=null==d?void 0:d.data)||void 0===l?void 0:l.map(function(t){return I(t)}))||[]).forEach(function(t){return u(t,i.getCurrentLocale())}),[2,new n(d.data?{data:s,count:d.data.length,facets:null,limit:20,page:1,totalCount:d.data.length}:null,d.graphQLErrors)]}})})}function g(a){return t(this,void 0,void 0,function(){var t,o,d,s,c,l;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getSuggestedProducts.js")];case 1:return t=e.sent().getSuggestedProducts,o=null===(c=i.getCurrentRouting())||void 0===c?void 0:c.dynamicCurrencySettings,[4,t(r({locale:i.getCurrentLocale(),dynamicCurrencySettings:o?{roundingFormat:o.roundingFormat,targetCurrencyCode:o.targetCurrencyCode}:void 0},a))];case 2:return d=e.sent(),(s=(null===(l=null==d?void 0:d.data)||void 0===l?void 0:l.map(function(t){return I(t)}))||[]).forEach(function(t){return u(t,i.getCurrentLocale())}),[2,new n(d.data?{data:s,count:d.data.length,facets:null,limit:20,page:1,totalCount:d.data.length}:null,d.graphQLErrors)]}})})}function f(r){return t(this,void 0,void 0,function(){var t,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listProductAttribute.js")];case 1:return[4,(0,e.sent().listProductAttribute)(r)];case 2:return t=e.sent(),null==(o=t.data)||o.forEach(function(t){return a(t,i.getCurrentLocale())}),[2,new n(o,t.graphQLErrors)]}})})}function h(r){return t(this,void 0,void 0,function(){var t;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getProductCampaigns.js")];case 1:return[4,(0,e.sent().getProductCampaigns)(r)];case 2:return t=e.sent(),[2,new n(t.data,t.graphQLErrors)]}})})}function b(r){return t(this,void 0,void 0,function(){var t,i;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/getVariantStockLocations.js")];case 1:return[4,(0,e.sent().getVariantStockLocations)(r)];case 2:return t=e.sent(),[2,new n(null===(i=t.data)||void 0===i?void 0:i.stockLocations,t.graphQLErrors)]}})})}function y(r){return t(this,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/mutations/getOrderLineFile.js")];case 1:return[4,(0,t.sent().getOrderLineFile)(r)];case 2:return[2,t.sent()]}})})}function C(r,a){return t(this,void 0,void 0,function(){var t,o;return e(this,function(e){switch(e.label){case 0:return[4,import("../../../packages/storefront-api/src/__api/queries/listProductOptionSet.js")];case 1:return[4,(0,e.sent().listProductOptionSet)(r)];case 2:return t=e.sent(),null==(o=t.data)||o.forEach(function(t){return d(t,i.getCurrentLocale(),a)}),[2,new n(o,t.graphQLErrors)]}})})}function I(t){var e,n,a,o,u,d="local"===import.meta.env.VITE_ENV;return{id:t.id,type:t.type,groupVariantsByVariantTypeId:t.groupVariantsByVariantTypeId,deleted:t.deleted,selectedVariantValues:[],offers:[],bundleProductCache:{},productOptionSet:null,showVariantsInGroup:!1,attributes:(null===(e=t.attributes)||void 0===e?void 0:e.map(function(t){var e,n,i,a,o,u;return r(r({},t),{value:t.value,productAttributeId:(null===(e=t.productAttribute)||void 0===e?void 0:e.id)||null,productAttributeOptionId:(null===(n=t.productAttributeOption)||void 0===n?void 0:n.id)||null,productAttribute:{id:(null===(i=t.productAttribute)||void 0===i?void 0:i.id)||"",name:(null===(a=t.productAttribute)||void 0===a?void 0:a.name)||"",description:null,type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(u=t.productAttribute)||void 0===u?void 0:u.tableTemplate)?t.productAttribute.tableTemplate:null,options:null},productAttributeOption:t.productAttributeOption})}))||[],brand:t.brand?r(r({},t.brand),{id:t.brand.id,name:t.brand.name,createdAt:0,updatedAt:0,description:null,imageId:t.brand.imageId,orderType:"BEST_SELLER",metaData:{id:"",createdAt:0,updatedAt:0,slug:t.brand.slug||""}}):null,campaigns:null===(n=t.campaigns)||void 0===n?void 0:n.map(function(t){return{campaign:t,variantIds:[]}}),campaignOffers:t.campaignOffers,categories:(null===(a=t.categories)||void 0===a?void 0:a.map(function(t){var e;return r(r({},t),{categoryPath:t.path.map(function(t){return t.name}),description:null,imageId:null,parentId:null,metaData:t.slug?{id:"",createdAt:0,updatedAt:0,name:t.name||"",slug:t.slug,translations:null===(e=t.translations)||void 0===e?void 0:e.map(function(t){return{pageTitle:t.name,slug:t.slug,locale:t.locale,description:null}})}:null,categoryPathItems:t.path.map(function(t){return{metaData:{id:"",createdAt:0,updatedAt:0,name:t.name||"",slug:t.slug||""},description:null,name:t.name,translations:t.translations,imageId:null,id:t.id,createdAt:0,updatedAt:0}}),createdAt:0,updatedAt:0,orderType:"BEST_SELLER",conditions:null,conditionValues:null})}))||[],tags:t.tags||[],description:t.description||"",averageRating:t.averageRating,reviewCount:t.reviewCount,stars:t.stars,baseUnit:t.baseUnit,metaData:r(r({},t.metaData),{id:"",createdAt:0,updatedAt:0,slug:(null===(o=t.metaData)||void 0===o?void 0:o.slug)||""}),name:t.name,productOptionSetId:t.productOptionSetId,variantTypes:t.productVariantTypes.map(function(t){return{order:t.order,variantType:{id:t.variantType.id,name:t.variantType.name,selectionType:t.variantType.selectionType,values:t.variantType.values.map(function(e){return{id:e.id,colorCode:e.colorCode,name:e.name,thumbnailImageId:e.thumbnailImageId,variantTypeId:t.variantType.id}}).filter(function(e){return t.variantValueIds.includes(e.id)})},variantValueIds:t.variantValueIds}}),variants:t.variants.map(function(e){var n,a,o,u;return r(r({},e),{id:e.id,productId:t.id,images:(null===(n=e.images)||void 0===n?void 0:n.map(function(t){return{imageId:t.id,isMain:t.isMain||!1,isVideo:t.isVideo,order:t.order,fileName:t.fileName}}))||null,sellIfOutOfStock:e.sellIfOutOfStock||!1,isBackInStockReminderSaved:!1,unit:e.unit,attributes:(null===(a=e.attributes)||void 0===a?void 0:a.map(function(t){var e,n,i,a,o,u;return r(r({},t),{value:t.value,productAttributeId:(null===(e=t.productAttribute)||void 0===e?void 0:e.id)||null,productAttributeOptionId:(null===(n=t.productAttributeOption)||void 0===n?void 0:n.id)||null,productAttribute:{id:(null===(i=t.productAttribute)||void 0===i?void 0:i.id)||"",name:(null===(a=t.productAttribute)||void 0===a?void 0:a.name)||"",description:"",type:null===(o=t.productAttribute)||void 0===o?void 0:o.type,tableTemplate:(null===(u=t.productAttribute)||void 0===u?void 0:u.tableTemplate)?t.productAttribute.tableTemplate:null,options:null},productAttributeOption:t.productAttributeOption})}))||[],sku:e.sku,barcodeList:e.barcodeList||null,prices:e.prices||[],price:{buyPrice:null,campaignPrice:null,currency:"",currencyCode:"",currencySymbol:"",discountPrice:null,priceListId:null,sellPrice:0,unitPrice:null},stock:(null===(o=e.stocks)||void 0===o?void 0:o.filter(function(t){var e;return d||i.isEditor||(null===(e=i.stockLocationIds)||void 0===e?void 0:e.includes(t.stockLocationId))}).reduce(function(t,e){return e.stockCount+t},0))||0,variantValues:(null===(u=e.variantValues)||void 0===u?void 0:u.map(function(e){var r=t.productVariantTypes.find(function(t){return t.variantType.id===e.variantTypeId}),n=null==r?void 0:r.variantType.values.find(function(t){return t.id===e.variantValueId});return{id:e.variantValueId,name:(null==n?void 0:n.name)||"",colorCode:(null==n?void 0:n.colorCode)||"",thumbnailImageId:(null==n?void 0:n.thumbnailImageId)||"",variantTypeId:(null==r?void 0:r.variantType.id)||""}}))||[],isActive:e.isActive||!1,bundleSettings:e.bundleSettings||null})}),dynamicPriceListIds:null,productGroup:t.productGroup,salesChannels:null===(u=t.salesChannels)||void 0===u?void 0:u.filter(function(t){return t.id===i.salesChannelId})}}export{y as apiGetOrderLineFile,h as apiGetProductCampaigns,v as apiGetProductFilterData,m as apiGetRelatedProducts,g as apiGetSuggestedProducts,b as apiGetVariantStockLocations,l as apiListCampaignOffer,f as apiListProductAttribute,s as apiListProductBackInStockRemind,C as apiListProductOptionSet,c as apiSaveProductBackInStockRemind,p as apiSearchProducts};
@@ -1,6 +1,9 @@
1
1
  import { IkasProductAttributeDetail } from "../../../storefront-models/src";
2
2
  /**
3
3
  * Retrieves the attribute values for a product attribute detail, merging variant and product-level attributes.
4
+ * This is how a PRODUCT_ATTRIBUTE code-component prop is consumed: that prop hands you the
5
+ * IkasProductAttributeDetail wrapper ({ product, attributePropValue }), never the attribute value itself, so
6
+ * reading `prop.value` silently yields nothing — call this function instead.
4
7
  *
5
8
  * @ai-category AttributeDetail
6
9
  * @ai-related getSelectedProductVariant, hasProductVariant
@@ -1,6 +1,9 @@
1
1
  import { IkasProductAttributeList, IkasProductAttributeMap } from "../../../storefront-models/src";
2
2
  /**
3
3
  * Retrieves grouped attribute values for a product attribute list, combining variant and product-level attributes.
4
+ * This is how a PRODUCT_ATTRIBUTE_LIST code-component prop is consumed: that prop hands you a single
5
+ * IkasProductAttributeList wrapper ({ product, attributeListPropValue }) — never an array — so mapping over the
6
+ * prop is a runtime error; call this function and iterate the returned { attribute, values } maps instead.
4
7
  *
5
8
  * @ai-category AttributeList
6
9
  * @ai-related getSelectedProductVariant, hasProductVariant
@@ -1,62 +1,102 @@
1
1
  import { IkasImage } from "../../../storefront-models/src";
2
2
  /**
3
- * Returns the default source URL for an image at 1080px resolution.
3
+ * Returns the default source URL for an image OR video at 1080px resolution.
4
+ *
5
+ * Product media items (IkasProductImage) can be videos. ALWAYS check `item.isVideo`
6
+ * and render a `<video src={getDefaultSrc(item)}>` instead of an `<img>` when it is true.
7
+ * Never assume every media item is an image.
4
8
  *
5
9
  * @ai-category Image
6
10
  * @ai-related getThumbnailSrc, getSrc, createMediaSrcset
7
11
  *
8
12
  * @param image - The image object to generate the default source URL for.
9
- * @returns The CDN URL string for the image at 1080px size.
13
+ * @returns The CDN URL string for the image or video at 1080px size.
10
14
  *
11
15
  * @example
12
16
  * ```typescript
13
- * import { getDefaultSrc } from "@ikas/bp-storefront";
14
- *
15
- * const src = getDefaultSrc(image);
16
- * console.log(src); // "https://cdn.example.com/images/.../1080/image.webp"
17
+ * import { getDefaultSrc, createMediaSrcset } from "@ikas/bp-storefront";
18
+ *
19
+ * // Product images can be videos — ALWAYS branch on isVideo when mapping media:
20
+ * {product.images.map((item, i) =>
21
+ * item.isVideo ? (
22
+ * <video key={i} src={getDefaultSrc(item)} muted playsInline preload="metadata">
23
+ * <track kind="captions" />
24
+ * </video>
25
+ * ) : (
26
+ * <img key={i} src={getDefaultSrc(item)} srcSet={createMediaSrcset(item)} alt={`Product ${i + 1}`} />
27
+ * )
28
+ * )}
17
29
  * ```
18
30
  */
19
31
  export declare function getDefaultSrc(image: IkasImage): string;
20
32
  /**
21
- * Returns the thumbnail source URL for an image at 180px resolution.
33
+ * Returns the thumbnail source URL for an IMAGE at 180px resolution.
34
+ *
35
+ * VIDEOS HAVE NO 180px THUMBNAIL and no poster URL. When `image.isVideo === true` the size is
36
+ * IGNORED and this returns the same full-size .mp4 as `getDefaultSrc(image)` — so using it in a
37
+ * thumbnail-sized box (swatch, cart line, order line) downloads the whole video instead of a
38
+ * 180px webp. Nothing looks broken, which makes it a silent performance regression.
39
+ *
40
+ * Branch on `item.isVideo` first and only pass images here. For the video branch in a small,
41
+ * static context render `<video src={getDefaultSrc(item)} preload="metadata" muted playsInline>`
42
+ * with no `autoPlay`: the browser fetches only the first frame and holds it as a stand-in poster.
22
43
  *
23
44
  * @ai-category Image
24
45
  * @ai-related getDefaultSrc, getSrc, createMediaSrcset
25
46
  *
26
- * @param image - The image object to generate the thumbnail source URL for.
27
- * @returns The CDN URL string for the image at 180px size.
47
+ * @param image - The image object to generate the thumbnail source URL for. Videos ignore the size.
48
+ * @returns The CDN URL string: a 180px image, or — for `isVideo` items — the original .mp4.
28
49
  *
29
50
  * @example
30
51
  * ```typescript
31
- * import { getThumbnailSrc } from "@ikas/bp-storefront";
32
- *
33
- * const thumbnailSrc = getThumbnailSrc(image);
34
- * console.log(thumbnailSrc); // "https://cdn.example.com/images/.../180/image.webp"
52
+ * import { getThumbnailSrc, getDefaultSrc } from "@ikas/bp-storefront";
53
+ *
54
+ * // Thumbnail rail — branch on isVideo per item (no autoPlay: first frame acts as the poster):
55
+ * {product.images.map((item, i) =>
56
+ * item.isVideo ? (
57
+ * <video key={i} src={getDefaultSrc(item)} muted playsInline preload="metadata">
58
+ * <track kind="captions" />
59
+ * </video>
60
+ * ) : (
61
+ * <img key={i} src={getThumbnailSrc(item)} sizes="112px" alt={`Thumb ${i + 1}`} />
62
+ * )
63
+ * )}
35
64
  * ```
36
65
  */
37
66
  export declare function getThumbnailSrc(image: IkasImage): string;
38
67
  /**
39
68
  * Generates the full CDN source URL for an image or video at the specified size, handling both legacy path-based and merchant-scoped ID formats.
40
69
  *
70
+ * NOTE: For videos (`image.isVideo === true`) the `size` argument is IGNORED — the original .mp4 is always returned.
71
+ * So `getSrc(item, 240)` and `getDefaultSrc(item)` produce the identical URL for a video. PREFER `getDefaultSrc(item)`
72
+ * for video `src` (no size param) — do NOT pass an arbitrary size like `getSrc(item, 240)`, it is misleading.
73
+ *
41
74
  * @ai-category Image
42
75
  * @ai-related getDefaultSrc, getThumbnailSrc, createMediaSrcset
43
76
  *
44
77
  * @param image - The image object containing the id, fileName, and isVideo flag.
45
- * @param size - The desired image width in pixels for the generated URL.
78
+ * @param size - The desired image width in pixels. Ignored for videos.
46
79
  * @returns The full CDN URL string for the image or video.
47
80
  *
48
81
  * @example
49
82
  * ```typescript
50
- * import { getSrc } from "@ikas/bp-storefront";
83
+ * import { getSrc, getDefaultSrc } from "@ikas/bp-storefront";
51
84
  *
52
85
  * const src = getSrc(image, 640);
53
86
  * console.log(src); // "https://cdn.example.com/images/.../640/image.webp"
87
+ *
88
+ * // For a video, use getDefaultSrc (size is ignored anyway):
89
+ * <video src={getDefaultSrc(item)} muted playsInline preload="metadata" />
54
90
  * ```
55
91
  */
56
92
  export declare function getSrc(image: IkasImage, size: number): string;
57
93
  /**
58
94
  * Generates a complete responsive `srcset` string for an image across all standard sizes (180–3840px).
59
95
  *
96
+ * srcset applies to `<img>` only — video media (`item.isVideo === true`) has no srcset
97
+ * and must be rendered with `<video src={getDefaultSrc(item)}>`. When mapping product
98
+ * images, branch on `item.isVideo` first, then only use createMediaSrcset on the image branch.
99
+ *
60
100
  * @ai-category Image
61
101
  * @ai-related getDefaultSrc, getThumbnailSrc, getSrc
62
102
  *
@@ -67,12 +107,22 @@ export declare function getSrc(image: IkasImage, size: number): string;
67
107
  * ```typescript
68
108
  * import { createMediaSrcset, getDefaultSrc } from "@ikas/bp-storefront";
69
109
  *
70
- * <img
71
- * src={getDefaultSrc(image)}
72
- * srcSet={createMediaSrcset(image)}
73
- * sizes="(max-width: 768px) 100vw, 50vw"
74
- * alt="Product"
75
- * />
110
+ * // Product images can be videos — ALWAYS branch on isVideo when mapping media:
111
+ * {product.images.map((item, i) =>
112
+ * item.isVideo ? (
113
+ * <video key={i} src={getDefaultSrc(item)} muted playsInline preload="metadata">
114
+ * <track kind="captions" />
115
+ * </video>
116
+ * ) : (
117
+ * <img
118
+ * key={i}
119
+ * src={getDefaultSrc(item)}
120
+ * srcSet={createMediaSrcset(item)}
121
+ * sizes="(max-width: 768px) 100vw, 50vw"
122
+ * alt={`Product ${i + 1}`}
123
+ * />
124
+ * )
125
+ * )}
76
126
  * ```
77
127
  */
78
128
  export declare function createMediaSrcset(image?: IkasImage | null): string;
@@ -1 +1 @@
1
- import{IkasStorefrontConfig as c}from"../../../packages/storefront-config/src/index.js";function n(c){return a(c,1080)}function o(c){return a(c,180)}function a(n,o){var a,i=c.cdnUrl,t=c.videoCdnUrl;if(n.id.includes("/"))return n.isVideo?"".concat(t,"videos/").concat(n.id,"/original.mp4"):n.fileName?"".concat(i,"images/").concat(n.id,"/").concat(o,"/").concat(n.fileName,".webp"):"".concat(i,"images/").concat(n.id,"/image_").concat(o,".webp");var e=null===(a=c.merchantSettings)||void 0===a?void 0:a.merchantId;return n.isVideo?"".concat(t,"videos/").concat(e,"/").concat(n.id,"/original.mp4"):n.fileName?"".concat(i,"images/").concat(e,"/").concat(n.id,"/").concat(o,"/").concat(n.fileName,".webp"):"".concat(i,"images/").concat(e,"/").concat(n.id,"/image_").concat(o,".webp")}var i=[180,360,420,540,640,720,800,900,1080,1296,1350,1512,1728,1950,2560,3840];function t(c){return c?i.map(function(n){return"".concat(a(c,n)," ").concat(n,"w")}).join(", "):""}export{t as createMediaSrcset,n as getDefaultSrc,a as getSrc,o as getThumbnailSrc};
1
+ import{IkasStorefrontConfig as c}from"../../../packages/storefront-config/src/index.js";function n(c){return o(c,1080)}function i(c){return o(c,180)}function o(n,i){var o;if(!(null==n?void 0:n.id))return"";var a=c.cdnUrl,t=c.videoCdnUrl;if(n.id.includes("/"))return n.isVideo?"".concat(t,"videos/").concat(n.id,"/original.mp4"):n.fileName?"".concat(a,"images/").concat(n.id,"/").concat(i,"/").concat(n.fileName,".webp"):"".concat(a,"images/").concat(n.id,"/image_").concat(i,".webp");var e=null===(o=c.merchantSettings)||void 0===o?void 0:o.merchantId;return n.isVideo?"".concat(t,"videos/").concat(e,"/").concat(n.id,"/original.mp4"):n.fileName?"".concat(a,"images/").concat(e,"/").concat(n.id,"/").concat(i,"/").concat(n.fileName,".webp"):"".concat(a,"images/").concat(e,"/").concat(n.id,"/image_").concat(i,".webp")}var a=[180,360,420,540,640,720,800,900,1080,1296,1350,1512,1728,1950,2560,3840];function t(c){return(null==c?void 0:c.id)?a.map(function(n){return"".concat(o(c,n)," ").concat(n,"w")}).join(", "):""}export{t as createMediaSrcset,n as getDefaultSrc,o as getSrc,i as getThumbnailSrc};
@@ -75,6 +75,7 @@ export * from "./validator/back-in-stock-notification";
75
75
  export * from "./validator/contact-form";
76
76
  export * from "./validator/coupon-code-form";
77
77
  export * from "./validator/customer-review";
78
+ export * from "./validator/deactivate-customer";
78
79
  export * from "./validator/forgot-password";
79
80
  export * from "./validator/login";
80
81
  export * from "./validator/newsletter-subscription";
@@ -1,4 +1,4 @@
1
- import { IkasDisplayedPackage, IkasOrder } from "../../../storefront-models/src";
1
+ import { IkasDisplayedPackage, IkasOrder, IkasOrderRefundReason, IkasRefundableLines } from "../../../storefront-models/src";
2
2
  /**
3
3
  * Initializes an IkasOrder by filtering deleted line items and enriching adjustments and gift package lines with currency information.
4
4
  *
@@ -15,6 +15,27 @@ import { IkasDisplayedPackage, IkasOrder } from "../../../storefront-models/src"
15
15
  * ```
16
16
  */
17
17
  export declare function initIkasOrder(data: IkasOrder): IkasOrder;
18
+ /**
19
+ * Returns the total amount covered by the gift cards (and store credits) applied to the order or cart.
20
+ *
21
+ * This is a derived value, the API does not return it: it sums `amount` over `order.giftCardLines`.
22
+ * Subtract it from `order.totalFinalPrice` to get the amount still due.
23
+ *
24
+ * @ai-category Order, Cart
25
+ * @ai-related removeGiftCardLine, saveCouponCode
26
+ *
27
+ * @param order - The IkasOrder or IkasCart holding the gift card lines
28
+ * @returns The summed gift card amount, or 0 when no gift card is applied
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * import { getIkasOrderGiftCardTotalPrice } from "@ikas/bp-storefront";
33
+ *
34
+ * const giftCardTotal = getIkasOrderGiftCardTotalPrice(cart);
35
+ * const remainingPrice = cart.totalFinalPrice - giftCardTotal;
36
+ * ```
37
+ */
38
+ export declare function getIkasOrderGiftCardTotalPrice(order: IkasOrder): number;
18
39
  /**
19
40
  * Returns the number of distinct line items in the order.
20
41
  *
@@ -65,13 +86,13 @@ export declare function getIkasOrderTotalItemCount(order: IkasOrder): number;
65
86
  */
66
87
  export declare function getIkasOrderDisplayedPackages(order: IkasOrder): IkasDisplayedPackage[];
67
88
  /**
68
- * Returns order line items that are eligible for refund based on item status and the merchant's refund day limit settings.
89
+ * Returns order line items that are eligible for refund, based on the refundable lines returned by the API for the order.
69
90
  *
70
91
  * @ai-category Order, Payment
71
- * @ai-related isIkasOrderRefundable, getIkasOrderRefundedItems
92
+ * @ai-related isIkasOrderRefundable, getIkasOrderRefundedItems, getIkasOrderRefundReasons
72
93
  *
73
94
  * @param order - The IkasOrder to retrieve refundable items from
74
- * @returns An array of order line items eligible for refund, or an empty array if refunds are disabled
95
+ * @returns An array of order line items eligible for refund, or an empty array if refundable lines are not loaded
75
96
  *
76
97
  * @example
77
98
  * ```typescript
@@ -80,6 +101,120 @@ export declare function getIkasOrderDisplayedPackages(order: IkasOrder): IkasDis
80
101
  * ```
81
102
  */
82
103
  export declare function getIkasOrderRefundableItems(order: IkasOrder): import("../../../storefront-models/src").IkasOrderLineItem[];
104
+ /**
105
+ * Applies the refundable lines response to the order and its line items (flow, autoApprove, isCancellable, isRefundable).
106
+ *
107
+ * @ai-category Order, Payment
108
+ * @ai-related getIkasOrderRefundableItems, getIkasOrderRefundReasons
109
+ *
110
+ * @param order - The IkasOrder to apply the refundable lines to
111
+ * @param data - The refundable lines response for the order
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * import { applyIkasOrderRefundableLines } from "@ikas/bp-storefront";
116
+ * applyIkasOrderRefundableLines(order, refundableLines);
117
+ * ```
118
+ */
119
+ export declare function applyIkasOrderRefundableLines(order: IkasOrder, data: IkasRefundableLines): void;
120
+ /**
121
+ * Returns the selected refund reason id for the order's refund request.
122
+ *
123
+ * @ai-category Order, Payment
124
+ * @ai-related setIkasOrderRefundReasonId, getIkasOrderRefundReasons
125
+ *
126
+ * @param order - The IkasOrder to read the selected refund reason id from
127
+ * @returns The selected refund reason id, or null if none is selected
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * import { getIkasOrderRefundReasonId } from "@ikas/bp-storefront";
132
+ * const refundReasonId = getIkasOrderRefundReasonId(order);
133
+ * ```
134
+ */
135
+ export declare function getIkasOrderRefundReasonId(order: IkasOrder): string | null;
136
+ /**
137
+ * Sets the selected refund reason id that will be sent with the order's refund request.
138
+ *
139
+ * @ai-category Order, Payment
140
+ * @ai-related getIkasOrderRefundReasonId, getIkasOrderRefundReasons, refundOrder
141
+ *
142
+ * @param order - The IkasOrder to set the refund reason id on
143
+ * @param value - The id of one of the reasons returned by getIkasOrderRefundReasons, or null to clear it
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * import { setIkasOrderRefundReasonId, getIkasOrderRefundReasons } from "@ikas/bp-storefront";
148
+ * const [firstReason] = getIkasOrderRefundReasons(order);
149
+ * setIkasOrderRefundReasonId(order, firstReason?.id || null);
150
+ * ```
151
+ */
152
+ export declare function setIkasOrderRefundReasonId(order: IkasOrder, value: string | null): void;
153
+ /**
154
+ * Returns the free-text refund reason written by the customer for the order's refund request.
155
+ *
156
+ * @ai-category Order, Payment
157
+ * @ai-related setIkasOrderRefundReason, getIkasOrderRefundReasonId
158
+ *
159
+ * @param order - The IkasOrder to read the refund reason note from
160
+ * @returns The refund reason note, or null if none is set
161
+ *
162
+ * @example
163
+ * ```typescript
164
+ * import { getIkasOrderRefundReason } from "@ikas/bp-storefront";
165
+ * const reason = getIkasOrderRefundReason(order);
166
+ * ```
167
+ */
168
+ export declare function getIkasOrderRefundReason(order: IkasOrder): string | null;
169
+ /**
170
+ * Sets the free-text refund reason that will be sent with the order's refund request.
171
+ *
172
+ * @ai-category Order, Payment
173
+ * @ai-related getIkasOrderRefundReason, setIkasOrderRefundReasonId, refundOrder
174
+ *
175
+ * @param order - The IkasOrder to set the refund reason note on
176
+ * @param value - The refund reason note, or null to clear it
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * import { setIkasOrderRefundReason } from "@ikas/bp-storefront";
181
+ * setIkasOrderRefundReason(order, "The product arrived damaged");
182
+ * ```
183
+ */
184
+ export declare function setIkasOrderRefundReason(order: IkasOrder, value: string | null): void;
185
+ /**
186
+ * Returns the refund reasons the customer can choose from, with titles translated to the current locale.
187
+ *
188
+ * @ai-category Order, Payment
189
+ * @ai-related setIkasOrderRefundReasonId, getIkasOrderRefundableItems
190
+ *
191
+ * @param order - The IkasOrder to get refund reasons for
192
+ * @returns An array of refund reasons with localized titles, or an empty array if refundable lines are not loaded
193
+ *
194
+ * @example
195
+ * ```typescript
196
+ * import { getIkasOrderRefundReasons } from "@ikas/bp-storefront";
197
+ * const reasons = getIkasOrderRefundReasons(order);
198
+ * reasons.forEach(reason => console.log(reason.id, reason.title));
199
+ * ```
200
+ */
201
+ export declare function getIkasOrderRefundReasons(order: IkasOrder): IkasOrderRefundReason[];
202
+ /**
203
+ * Returns the merchant's return method description for the current locale.
204
+ *
205
+ * @ai-category Order, Payment
206
+ * @ai-related getIkasOrderRefundReasons, getIkasOrderRefundableItems
207
+ *
208
+ * @param order - The IkasOrder to get the return method description for
209
+ * @returns The return method description for the current locale, or null if none exists
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * import { getIkasOrderReturnMethodDescription } from "@ikas/bp-storefront";
214
+ * const description = getIkasOrderReturnMethodDescription(order);
215
+ * ```
216
+ */
217
+ export declare function getIkasOrderReturnMethodDescription(order: IkasOrder): string | null;
83
218
  /**
84
219
  * Checks whether the order has any line items that are eligible for refund and still have refundable quantity remaining.
85
220
  *
@@ -1 +1 @@
1
- import{__assign as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import{I18n as r}from"../../../i18n/index.js";import{withRoutePrefix as t}from"../../../router/index.js";import{customerStore as n}from"../../../stores/customer/index.js";import{formatCurrency as a}from"../../../utils/currency.js";import{validateEmail as u,formatDate as o}from"../../../utils/helper.js";import{getOrderAdjustmentDisplayName as i}from"./adjustment/index.js";import{getOrderLineItemRefundQuantity as s}from"./line-item/index.js";function c(r){var t,n,a;return e(e({},r),{orderLineItems:(null===(t=r.orderLineItems)||void 0===t?void 0:t.filter(function(e){return!e.deleted}))||[],orderAdjustments:(null===(n=r.orderAdjustments)||void 0===n?void 0:n.map(function(t){return e(e({},t),{currencyCode:r.currencyCode,currencySymbol:r.currencySymbol||""})}))||null,giftPackageLines:(null===(a=r.giftPackageLines)||void 0===a?void 0:a.map(function(t){return e(e({},t),{currencyCode:r.currencyCode,currencySymbol:r.currencySymbol||""})}))||null})}function d(e){var r;return(null===(r=e.orderLineItems)||void 0===r?void 0:r.length)||0}function l(e){var r;return(null===(r=e.orderLineItems)||void 0===r?void 0:r.reduce(function(e,r){return e+r.quantity},0))||0}function _(r){var t,n=m(r),a=null===(t=r.orderPackages)||void 0===t?void 0:t.filter(function(e){return!e.deleted}),u=r.orderLineItems.filter(function(e){return!e.deleted&&"CANCELLED"===e.status}),o=[];return n.length&&o.push({id:r.id+"-u",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItems:n,orderLineItemIds:n.map(function(e){return e.id}),statusTranslation:T({orderPackageStatus:"UNFULFILLED"}),orderPackageFulfillStatus:"UNFULFILLED",orderPackageNumber:r.orderNumber?r.orderNumber+"-u":"u",stockLocationId:n[0].stockLocationId||"",trackingInfo:null}),a&&o.push.apply(o,a.map(function(t){return e(e({},t),{statusTranslation:T({orderPackageStatus:t.orderPackageFulfillStatus}),orderLineItems:r.orderLineItems.filter(function(e){return t.orderLineItemIds.includes(e.id)})})})),u.length&&o.push({id:r.id+"-c",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItems:u,orderLineItemIds:u.map(function(e){return e.id}),statusTranslation:T({orderPackageStatus:"CANCELLED"}),orderPackageFulfillStatus:"CANCELLED",orderPackageNumber:r.orderNumber?r.orderNumber+"-c":"c",stockLocationId:u[0].stockLocationId||"",trackingInfo:null}),o}function f(e){if(n._refundSettings&&!n._refundSettings.isActiveRefundSection)return[];var r=function(e){var r=e.orderedAt,t=Date.now();return Math.abs(t-r)/864e5}(e);return e.orderLineItems.filter(function(e){var t;return["FULFILLED","UNFULFILLED","DELIVERED"].includes(e.status)&&(!(null===(t=n._refundSettings)||void 0===t?void 0:t.orderRefundDayLimit)||n._refundSettings.orderRefundDayLimit>=r)})}function E(e){return!!f(e).some(function(e){return!!s(e)})}function m(e){return e.orderLineItems.filter(function(e){return"UNFULFILLED"===e.status})}function L(e){return e.orderLineItems.filter(function(e){return"REFUNDED"===e.status||"REFUND_REQUESTED"===e.status||"REFUND_REQUEST_ACCEPTED"===e.status||"REFUND_REJECTED"===e.status})}function p(e){var r;return(null===(r=e.taxLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.price},0))||0}function I(e){return a(p(e),e.currencyCode,e.currencySymbol||"")}function v(e){var r;return(null===(r=e.shippingLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.finalPrice},0))||0}function D(e){return a(v(e),e.currencyCode,e.currencySymbol||"")}function g(e){return a(e.totalFinalPrice,e.currencyCode,e.currencySymbol||"")}function R(e){return a(e.totalPrice,e.currencyCode,e.currencySymbol||"")}function k(e){var r;return!!(null===(r=e.customer)||void 0===r?void 0:r.id)&&!e.customer.isGuestCheckout}function N(e){var r;return!!(null===(r=e.customer)||void 0===r?void 0:r.email)&&u(e.customer.email)}function A(e){var r,t;return"".concat((null===(r=e.customer)||void 0===r?void 0:r.firstName)||""," ").concat((null===(t=e.customer)||void 0===t?void 0:t.lastName)||"")}function y(e){var r=new Date;return r.setTime(e.updatedAt),o(r)}function F(e){if(!e.orderedAt)return null;var r=new Date;return r.setTime(e.orderedAt),o(r)}function T(e){if(!e.orderPackageStatus)return"";switch(e.orderPackageStatus){case"CANCELLED":return r.translate("order_package_status.cancelled");case"CANCEL_REJECTED":return r.translate("order_package_status.cancel_rejected");case"CANCEL_REQUESTED":return r.translate("order_package_status.cancel_requested");case"DELIVERED":return r.translate("order_package_status.delivered");case"FULFILLED":return r.translate("order_package_status.fulfilled");case"PARTIALLY_CANCELLED":return r.translate("order_package_status.partially_cancelled");case"PARTIALLY_DELIVERED":return r.translate("order_package_status.partially_delivered");case"PARTIALLY_FULFILLED":return r.translate("order_package_status.partially_fulfilled");case"PARTIALLY_READY_FOR_SHIPMENT":return r.translate("order_package_status.partially_ready_for_shipment");case"PARTIALLY_REFUNDED":return r.translate("order_package_status.partially_refunded");case"READY_FOR_PICK_UP":return r.translate("order_package_status.ready_for_pick_up");case"READY_FOR_SHIPMENT":return r.translate("order_package_status.ready_for_shipment");case"REFUNDED":return r.translate("order_package_status.refunded");case"REFUND_REJECTED":return r.translate("order_package_status.refund_rejected");case"REFUND_REQUESTED":return r.translate("order_package_status.refund_requested");case"REFUND_REQUEST_ACCEPTED":return r.translate("order_package_status.refund_request_accepted");case"RETURN_PARCEL_WAITING":return r.translate("order_package_status.return_parcel_waiting");case"RETURN_IN_TRANSIT":return r.translate("order_package_status.return_in_transit");case"RETURN_DELIVERED":return r.translate("order_package_status.return_delivered");case"RETURN_REJECTED":return r.translate("order_package_status.return_rejected");case"UNABLE_TO_DELIVER":return r.translate("order_package_status.unable_to_deliver");case"UNFULFILLED":return r.translate("order_package_status.unfulfilled");default:return""}}function U(e){var r;return null===(r=e.orderAdjustments)||void 0===r?void 0:r.find(function(e){return!!e.couponId})}function C(e){var r;return null===(r=e.orderAdjustments)||void 0===r?void 0:r.filter(function(e){return!e.couponId})}function S(e){return e.orderLineItems.filter(function(e){return!!e.variant.fileId&&"REFUNDED"!==e.status}).map(function(e){return e.variant.fileId})}function P(r){var t;return null===(t=r.orderAdjustments)||void 0===t?void 0:t.filter(function(e){return"FREE_SHIPPING"!==e.campaignType}).map(function(r){return"INTEREST"===r.name?e(e({},r),{name:i(r)}):r})}function j(e){return t("/account/orders/".concat(e.id))}function b(e){return e.orderLineItems.map(function(e){return e.variant.name}).join(", ")}export{U as getIkasOrderCouponAdjustment,A as getIkasOrderCustomerFullName,P as getIkasOrderDisplayedAdjustments,_ as getIkasOrderDisplayedPackages,d as getIkasOrderDistinctItemCount,y as getIkasOrderFormattedDate,F as getIkasOrderFormattedOrderedAt,D as getIkasOrderFormattedShippingTotal,g as getIkasOrderFormattedTotalFinalPrice,R as getIkasOrderFormattedTotalPrice,I as getIkasOrderFormattedTotalTax,j as getIkasOrderHref,C as getIkasOrderNonCouponAdjustments,T as getIkasOrderPackageStatusTranslation,S as getIkasOrderProductFiles,f as getIkasOrderRefundableItems,L as getIkasOrderRefundedItems,v as getIkasOrderShippingTotal,l as getIkasOrderTotalItemCount,p as getIkasOrderTotalTax,m as getIkasOrderUnfullfilledItems,b as getIkasOrderVariantNames,k as hasIkasOrderCustomer,N as hasValidIkasOrderCustomerEmail,c as initIkasOrder,E as isIkasOrderRefundable};
1
+ import{__assign as e}from'./../../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as r}from"../../../packages/storefront-config/src/index.js";import{I18n as t}from"../../../i18n/index.js";import{withRoutePrefix as n}from"../../../router/index.js";import{formatCurrency as u}from"../../../utils/currency.js";import{validateEmail as a,formatDate as o}from"../../../utils/helper.js";import{getOrderAdjustmentDisplayName as i}from"./adjustment/index.js";import{getOrderLineItemRefundQuantity as s}from"./line-item/index.js";function d(r){var t,n,u;return e(e({},r),{orderLineItems:(null===(t=r.orderLineItems)||void 0===t?void 0:t.filter(function(e){return!e.deleted}))||[],orderAdjustments:(null===(n=r.orderAdjustments)||void 0===n?void 0:n.map(function(t){return e(e({},t),{currencyCode:r.currencyCode,currencySymbol:r.currencySymbol||""})}))||null,giftPackageLines:(null===(u=r.giftPackageLines)||void 0===u?void 0:u.map(function(t){return e(e({},t),{currencyCode:r.currencyCode,currencySymbol:r.currencySymbol||""})}))||null})}function c(e){var r;return(null===(r=e.giftCardLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.amount},0))||0}function l(e){var r;return(null===(r=e.orderLineItems)||void 0===r?void 0:r.length)||0}function f(e){var r;return(null===(r=e.orderLineItems)||void 0===r?void 0:r.reduce(function(e,r){return e+r.quantity},0))||0}function _(r){var t,n=k(r),u=null===(t=r.orderPackages)||void 0===t?void 0:t.filter(function(e){return!e.deleted}),a=r.orderLineItems.filter(function(e){return!e.deleted&&"CANCELLED"===e.status}),o=[];return n.length&&o.push({id:r.id+"-u",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItems:n,orderLineItemIds:n.map(function(e){return e.id}),statusTranslation:w({orderPackageStatus:"UNFULFILLED"}),orderPackageFulfillStatus:"UNFULFILLED",orderPackageNumber:r.orderNumber?r.orderNumber+"-u":"u",stockLocationId:n[0].stockLocationId||"",trackingInfo:null}),u&&o.push.apply(o,u.map(function(t){return e(e({},t),{statusTranslation:w({orderPackageStatus:t.orderPackageFulfillStatus}),orderLineItems:r.orderLineItems.filter(function(e){return t.orderLineItemIds.includes(e.id)})})})),a.length&&o.push({id:r.id+"-c",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItems:a,orderLineItemIds:a.map(function(e){return e.id}),statusTranslation:w({orderPackageStatus:"CANCELLED"}),orderPackageFulfillStatus:"CANCELLED",orderPackageNumber:r.orderNumber?r.orderNumber+"-c":"c",stockLocationId:a[0].stockLocationId||"",trackingInfo:null}),o}function m(e){if(!e._refundableLines)return[];var r=new Set(e._refundableLines.filter(function(e){return e.isRefundable}).map(function(e){return e.orderLineItemId}));return e.orderLineItems.filter(function(e){return r.has(e.id)})}function E(e,r){e._refundableLines=r.orderLineItems||[],e._refundReasons=r.refundReasons||[],e._refundTranslations=r.translations||[];var t=new Map(e._refundableLines.map(function(e){return[e.orderLineItemId,e]}));e.orderLineItems.forEach(function(e){var r,n,u,a,o=t.get(e.id);e.flow=null!==(r=null==o?void 0:o.flow)&&void 0!==r?r:null,e.autoApprove=null!==(n=null==o?void 0:o.autoApprove)&&void 0!==n&&n,e.isCancellable=null!==(u=null==o?void 0:o.isCancellable)&&void 0!==u&&u,e.isRefundable=null!==(a=null==o?void 0:o.isRefundable)&&void 0!==a&&a})}function L(e){return e._refundReasonId||null}function v(e,r){e._refundReasonId=r||null}function p(e){return e._refundReason||null}function I(e,r){e._refundReason=r||null}function R(e){var t=r.getCurrentLocale();return(e._refundReasons||[]).map(function(e){var r,n;return{id:e.id,title:(null===(n=null===(r=e.translations)||void 0===r?void 0:r.find(function(e){return e.locale===t}))||void 0===n?void 0:n.title)||e.title,translations:e.translations}})}function g(e){var t,n,u=r.getCurrentLocale();return(null===(n=null===(t=e._refundTranslations)||void 0===t?void 0:t.find(function(e){return e.locale===u}))||void 0===n?void 0:n.returnMethodDescription)||null}function D(e){return!!m(e).some(function(e){return!!s(e)})}function k(e){return e.orderLineItems.filter(function(e){return"UNFULFILLED"===e.status})}function N(e){return e.orderLineItems.filter(function(e){return"REFUNDED"===e.status||"REFUND_REQUESTED"===e.status||"REFUND_REQUEST_ACCEPTED"===e.status||"REFUND_REJECTED"===e.status})}function A(e){var r;return(null===(r=e.taxLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.price},0))||0}function C(e){return u(A(e),e.currencyCode,e.currencySymbol||"")}function y(e){var r;return(null===(r=e.shippingLines)||void 0===r?void 0:r.reduce(function(e,r){return e+r.finalPrice},0))||0}function T(e){return u(y(e),e.currencyCode,e.currencySymbol||"")}function U(e){return u(e.totalFinalPrice,e.currencyCode,e.currencySymbol||"")}function F(e){return u(e.totalPrice,e.currencyCode,e.currencySymbol||"")}function P(e){var r;return!!(null===(r=e.customer)||void 0===r?void 0:r.id)&&!e.customer.isGuestCheckout}function S(e){var r;return!!(null===(r=e.customer)||void 0===r?void 0:r.email)&&a(e.customer.email)}function b(e){var r,t;return"".concat((null===(r=e.customer)||void 0===r?void 0:r.firstName)||""," ").concat((null===(t=e.customer)||void 0===t?void 0:t.lastName)||"")}function j(e){var r=new Date;return r.setTime(e.updatedAt),o(r)}function h(e){if(!e.orderedAt)return null;var r=new Date;return r.setTime(e.orderedAt),o(r)}function w(e){if(!e.orderPackageStatus)return"";switch(e.orderPackageStatus){case"CANCELLED":return t.translate("order_package_status.cancelled");case"CANCEL_REJECTED":return t.translate("order_package_status.cancel_rejected");case"CANCEL_REQUESTED":return t.translate("order_package_status.cancel_requested");case"DELIVERED":return t.translate("order_package_status.delivered");case"FULFILLED":return t.translate("order_package_status.fulfilled");case"PARTIALLY_CANCELLED":return t.translate("order_package_status.partially_cancelled");case"PARTIALLY_DELIVERED":return t.translate("order_package_status.partially_delivered");case"PARTIALLY_FULFILLED":return t.translate("order_package_status.partially_fulfilled");case"PARTIALLY_READY_FOR_SHIPMENT":return t.translate("order_package_status.partially_ready_for_shipment");case"PARTIALLY_REFUNDED":return t.translate("order_package_status.partially_refunded");case"READY_FOR_PICK_UP":return t.translate("order_package_status.ready_for_pick_up");case"READY_FOR_SHIPMENT":return t.translate("order_package_status.ready_for_shipment");case"REFUNDED":return t.translate("order_package_status.refunded");case"REFUND_REJECTED":return t.translate("order_package_status.refund_rejected");case"REFUND_REQUESTED":return t.translate("order_package_status.refund_requested");case"REFUND_REQUEST_ACCEPTED":return t.translate("order_package_status.refund_request_accepted");case"RETURN_PARCEL_WAITING":return t.translate("order_package_status.return_parcel_waiting");case"RETURN_IN_TRANSIT":return t.translate("order_package_status.return_in_transit");case"RETURN_DELIVERED":return t.translate("order_package_status.return_delivered");case"RETURN_REJECTED":return t.translate("order_package_status.return_rejected");case"UNABLE_TO_DELIVER":return t.translate("order_package_status.unable_to_deliver");case"UNFULFILLED":return t.translate("order_package_status.unfulfilled");default:return""}}function Y(e){var r;return null===(r=e.orderAdjustments)||void 0===r?void 0:r.find(function(e){return!!e.couponId})}function x(e){var r;return null===(r=e.orderAdjustments)||void 0===r?void 0:r.filter(function(e){return!e.couponId})}function M(e){return e.orderLineItems.filter(function(e){return!!e.variant.fileId&&"REFUNDED"!==e.status}).map(function(e){return e.variant.fileId})}function Q(r){var t;return null===(t=r.orderAdjustments)||void 0===t?void 0:t.filter(function(e){return"FREE_SHIPPING"!==e.campaignType}).map(function(r){return"INTEREST"===r.name?e(e({},r),{name:i(r)}):r})}function q(e){return n("/account/orders/".concat(e.id))}function J(e){return e.orderLineItems.map(function(e){return e.variant.name}).join(", ")}export{E as applyIkasOrderRefundableLines,Y as getIkasOrderCouponAdjustment,b as getIkasOrderCustomerFullName,Q as getIkasOrderDisplayedAdjustments,_ as getIkasOrderDisplayedPackages,l as getIkasOrderDistinctItemCount,j as getIkasOrderFormattedDate,h as getIkasOrderFormattedOrderedAt,T as getIkasOrderFormattedShippingTotal,U as getIkasOrderFormattedTotalFinalPrice,F as getIkasOrderFormattedTotalPrice,C as getIkasOrderFormattedTotalTax,c as getIkasOrderGiftCardTotalPrice,q as getIkasOrderHref,x as getIkasOrderNonCouponAdjustments,w as getIkasOrderPackageStatusTranslation,M as getIkasOrderProductFiles,p as getIkasOrderRefundReason,L as getIkasOrderRefundReasonId,R as getIkasOrderRefundReasons,m as getIkasOrderRefundableItems,N as getIkasOrderRefundedItems,g as getIkasOrderReturnMethodDescription,y as getIkasOrderShippingTotal,f as getIkasOrderTotalItemCount,A as getIkasOrderTotalTax,k as getIkasOrderUnfullfilledItems,J as getIkasOrderVariantNames,P as hasIkasOrderCustomer,S as hasValidIkasOrderCustomerEmail,d as initIkasOrder,D as isIkasOrderRefundable,I as setIkasOrderRefundReason,v as setIkasOrderRefundReasonId};
@@ -18,6 +18,11 @@ import { IkasAttributeTableCellValue, IkasProductAttributeValue } from "../../..
18
18
  export declare function getIkasProductAttributeTableValue(value: IkasProductAttributeValue): IkasAttributeTableCellValue[] | undefined;
19
19
  /**
20
20
  * Extracts and returns the product IDs from a PRODUCT-type attribute value's JSON string.
21
+ * NOTE: the export name really is misspelled — "Attrribute" with a double r. It is kept as-is because
22
+ * renaming a published export would break every theme that imports it, so import it VERBATIM; the
23
+ * correctly spelled `getIkasProductAttributeProductIds` does not exist and will not compile. This is
24
+ * not a documentation typo to report or "fix". In the blueprint editor the display alias is
25
+ * `getProductIds`, which hides the misspelling; only direct TypeScript imports see it.
21
26
  *
22
27
  * @ai-category ProductAttribute, Product
23
28
  * @ai-related getIkasProductAttributeTableValue, getIkasProductAttributeProducts