@dropins/storefront-checkout 0.1.0-alpha6 → 0.1.0-alpha60

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 (302) hide show
  1. package/api/authenticateCustomer/authenticateCustomer.d.ts +18 -0
  2. package/api/authenticateCustomer/index.d.ts +18 -0
  3. package/api/errors/errors.d.ts +30 -0
  4. package/api/errors/index.d.ts +18 -0
  5. package/api/estimateShippingMethods/estimateShippingMethods.d.ts +13 -0
  6. package/api/estimateShippingMethods/fixtures.d.ts +8 -0
  7. package/api/estimateShippingMethods/graphql/estimateShippingMethods.graphql.d.ts +18 -0
  8. package/api/estimateShippingMethods/graphql/index.d.ts +18 -0
  9. package/api/estimateShippingMethods/index.d.ts +18 -0
  10. package/api/fetch-graphql/fetch-graphql.d.ts +25 -0
  11. package/api/fetch-graphql/index.d.ts +18 -0
  12. package/api/fragments.d.ts +21 -0
  13. package/api/getCart/fixtures.d.ts +12 -0
  14. package/api/getCart/getCart.d.ts +18 -0
  15. package/api/getCart/graphql/getCart.graphql.d.ts +19 -0
  16. package/api/getCart/graphql/index.d.ts +18 -0
  17. package/api/getCart/index.d.ts +18 -0
  18. package/api/getCustomer/fixtures.d.ts +5 -0
  19. package/api/getCustomer/getCustomer.d.ts +4 -0
  20. package/api/getCustomer/graphql/getCustomer.graphql.d.ts +18 -0
  21. package/api/getCustomer/graphql/index.d.ts +18 -0
  22. package/api/getCustomer/index.d.ts +18 -0
  23. package/api/getStoreConfig/getStoreConfig.d.ts +6 -0
  24. package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +18 -0
  25. package/api/getStoreConfig/index.d.ts +18 -0
  26. package/api/graphql/CartAddressFragment.graphql.d.ts +19 -0
  27. package/api/graphql/CheckoutDataFragment.graphql.d.ts +18 -0
  28. package/api/graphql/CustomerFragment.graphql.d.ts +18 -0
  29. package/api/graphql/OrderAddressFragment.graphql.d.ts +18 -0
  30. package/api/graphql/OrderFragment.graphql.d.ts +19 -0
  31. package/api/graphql/OrderItemFragment.graphql.d.ts +6 -0
  32. package/api/index.d.ts +35 -0
  33. package/api/initialize/index.d.ts +18 -0
  34. package/api/initialize/initialize.d.ts +15 -0
  35. package/api/initialize/listeners.d.ts +20 -0
  36. package/api/initializeCheckout/index.d.ts +18 -0
  37. package/api/initializeCheckout/initializeCheckout.d.ts +4 -0
  38. package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +18 -0
  39. package/api/isEmailAvailable/index.d.ts +18 -0
  40. package/api/isEmailAvailable/isEmailAvailable.d.ts +4 -0
  41. package/api/placeOrder/fixtures.d.ts +20 -0
  42. package/api/placeOrder/graphql/index.d.ts +18 -0
  43. package/api/placeOrder/graphql/placeOrder.graphql.d.ts +18 -0
  44. package/api/placeOrder/index.d.ts +18 -0
  45. package/api/placeOrder/placeOrder.d.ts +18 -0
  46. package/api/resetCheckout/index.d.ts +2 -0
  47. package/api/resetCheckout/resetCheckout.d.ts +18 -0
  48. package/api/setBillingAddress/graphql/setBillingAddress.graphql.d.ts +18 -0
  49. package/api/setBillingAddress/index.d.ts +18 -0
  50. package/api/setBillingAddress/setBillingAddress.d.ts +4 -0
  51. package/api/setGuestEmailOnCart/graphql/setGuestEmailOnCart.graphql.d.ts +18 -0
  52. package/api/setGuestEmailOnCart/index.d.ts +18 -0
  53. package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +18 -0
  54. package/api/setPaymentMethod/graphql/setPaymentMethod.graphql.d.ts +18 -0
  55. package/api/setPaymentMethod/index.d.ts +18 -0
  56. package/api/setPaymentMethod/setPaymentMethod.d.ts +4 -0
  57. package/api/setShippingAddress/graphql/setShippingAddress.graphql.d.ts +18 -0
  58. package/api/setShippingAddress/index.d.ts +18 -0
  59. package/api/setShippingAddress/setShippingAddress.d.ts +4 -0
  60. package/api/setShippingMethods/graphql/setShippingMethodsOnCart.graphql.d.ts +18 -0
  61. package/api/setShippingMethods/index.d.ts +18 -0
  62. package/api/setShippingMethods/setShippingMethods.d.ts +18 -0
  63. package/api/synchronizeCheckout/index.d.ts +18 -0
  64. package/api/synchronizeCheckout/synchronizeCheckout.d.ts +4 -0
  65. package/api/utils/dispatchApiCall.d.ts +38 -0
  66. package/api/utils/enqueueRequest.d.ts +18 -0
  67. package/api/utils/filterControlledErrors.d.ts +18 -0
  68. package/api.d.ts +1 -0
  69. package/api.js +39 -2
  70. package/chunks/OrderError.js +3 -0
  71. package/chunks/ServerErrorSignal.js +3 -0
  72. package/chunks/classes.js +3 -0
  73. package/chunks/fetch-graphql.js +12 -0
  74. package/chunks/isEmailAvailable.js +9 -0
  75. package/chunks/placeOrder2.js +17 -0
  76. package/chunks/setBillingAddress.js +13 -0
  77. package/chunks/setGuestEmailOnCart.js +13 -0
  78. package/chunks/setPaymentMethod.js +18 -0
  79. package/chunks/setShippingMethods.js +18 -0
  80. package/chunks/store-config.js +3 -0
  81. package/chunks/synchronizeCheckout.js +27 -0
  82. package/chunks/withConditionalRendering.js +3 -0
  83. package/components/BillToShippingAddress/BillToShippingAddress.d.ts +9 -0
  84. package/components/BillToShippingAddress/BillToShippingAddressSkeleton.d.ts +4 -0
  85. package/components/BillToShippingAddress/index.d.ts +20 -0
  86. package/components/EstimateShipping/EstimateShipping.d.ts +12 -0
  87. package/components/EstimateShipping/EstimateShippingSkeleton.d.ts +4 -0
  88. package/components/EstimateShipping/index.d.ts +20 -0
  89. package/components/LoginForm/Email.d.ts +13 -0
  90. package/components/LoginForm/LoginForm.d.ts +20 -0
  91. package/components/LoginForm/LoginFormSkeleton.d.ts +4 -0
  92. package/components/LoginForm/SignIn.d.ts +8 -0
  93. package/components/LoginForm/SignOut.d.ts +8 -0
  94. package/components/LoginForm/index.d.ts +22 -0
  95. package/components/OrderConfirmationHeader/OrderConfirmationHeader.d.ts +10 -0
  96. package/components/OrderConfirmationHeader/OrderConfirmationHeaderSkeleton.d.ts +4 -0
  97. package/components/OrderConfirmationHeader/index.d.ts +3 -0
  98. package/components/OutOfStock/OutOfStock.d.ts +11 -0
  99. package/components/OutOfStock/index.d.ts +19 -0
  100. package/components/PaymentMethods/PaymentMethods.d.ts +14 -0
  101. package/components/PaymentMethods/PaymentMethodsSkeleton.d.ts +4 -0
  102. package/components/PaymentMethods/index.d.ts +20 -0
  103. package/components/PlaceOrder/PlaceOrder.d.ts +9 -0
  104. package/components/PlaceOrder/PlaceOrderSkeleton.d.ts +4 -0
  105. package/components/PlaceOrder/index.d.ts +19 -0
  106. package/components/ServerError/ServerError.d.ts +10 -0
  107. package/components/ServerError/index.d.ts +19 -0
  108. package/components/ShippingMethods/ShippingMethods.d.ts +12 -0
  109. package/components/ShippingMethods/ShippingMethodsSkeleton.d.ts +4 -0
  110. package/components/ShippingMethods/index.d.ts +20 -0
  111. package/components/index.d.ts +26 -0
  112. package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +24 -0
  113. package/containers/BillToShippingAddress/index.d.ts +19 -0
  114. package/containers/BillToShippingAddress.d.ts +3 -0
  115. package/containers/BillToShippingAddress.js +3 -1
  116. package/containers/ErrorBanner/ErrorBanner.d.ts +5 -0
  117. package/containers/ErrorBanner/index.d.ts +19 -0
  118. package/containers/ErrorBanner.d.ts +3 -0
  119. package/containers/ErrorBanner.js +3 -0
  120. package/containers/EstimateShipping/EstimateShipping.d.ts +4 -0
  121. package/containers/EstimateShipping/index.d.ts +19 -0
  122. package/containers/EstimateShipping.d.ts +3 -0
  123. package/containers/EstimateShipping.js +3 -0
  124. package/containers/LoginForm/LoginForm.d.ts +11 -0
  125. package/containers/LoginForm/index.d.ts +19 -0
  126. package/containers/LoginForm.d.ts +3 -0
  127. package/containers/LoginForm.js +3 -1
  128. package/containers/MergedCartBanner/MergedCartBanner.d.ts +7 -0
  129. package/containers/MergedCartBanner/index.d.ts +19 -0
  130. package/containers/MergedCartBanner.d.ts +3 -0
  131. package/containers/MergedCartBanner.js +3 -0
  132. package/containers/OrderConfirmationHeader/OrderConfirmationHeader.d.ts +18 -0
  133. package/containers/OrderConfirmationHeader/index.d.ts +3 -0
  134. package/containers/OrderConfirmationHeader.d.ts +3 -0
  135. package/containers/OrderConfirmationHeader.js +3 -0
  136. package/containers/OutOfStock/OutOfStock.d.ts +13 -0
  137. package/containers/OutOfStock/index.d.ts +19 -0
  138. package/containers/OutOfStock.d.ts +3 -0
  139. package/containers/OutOfStock.js +3 -0
  140. package/containers/PaymentMethods/PaymentMethods.d.ts +27 -0
  141. package/containers/PaymentMethods/defaultHandlers.d.ts +4 -0
  142. package/containers/PaymentMethods/index.d.ts +19 -0
  143. package/containers/PaymentMethods.d.ts +3 -0
  144. package/containers/PaymentMethods.js +3 -1
  145. package/containers/PlaceOrder/PlaceOrder.d.ts +15 -0
  146. package/containers/PlaceOrder/index.d.ts +19 -0
  147. package/containers/PlaceOrder.d.ts +3 -0
  148. package/containers/PlaceOrder.js +3 -2
  149. package/containers/ServerError/ServerError.d.ts +8 -0
  150. package/containers/ServerError/index.d.ts +19 -0
  151. package/containers/ServerError.d.ts +3 -0
  152. package/containers/ServerError.js +3 -0
  153. package/containers/ShippingMethods/ShippingMethods.d.ts +18 -0
  154. package/containers/ShippingMethods/hooks/useShippingEstimateEventEmitter.d.ts +19 -0
  155. package/containers/ShippingMethods/index.d.ts +19 -0
  156. package/containers/ShippingMethods.d.ts +3 -0
  157. package/containers/ShippingMethods.js +3 -1
  158. package/containers/index.d.ts +28 -0
  159. package/data/models/acdl.d.ts +115 -0
  160. package/data/models/address.d.ts +17 -0
  161. package/data/models/api.d.ts +29 -0
  162. package/data/models/cart.d.ts +19 -0
  163. package/data/models/country.d.ts +21 -0
  164. package/data/models/custom-attribute.d.ts +21 -0
  165. package/data/models/customer.d.ts +22 -0
  166. package/data/models/email-availability.d.ts +18 -0
  167. package/data/models/index.d.ts +32 -0
  168. package/data/models/order.d.ts +150 -0
  169. package/data/models/payment-method.d.ts +21 -0
  170. package/data/models/price.d.ts +21 -0
  171. package/data/models/region.d.ts +22 -0
  172. package/data/models/shipping-estimate.d.ts +17 -0
  173. package/data/models/shipping-method.d.ts +19 -0
  174. package/data/models/store-config.d.ts +30 -0
  175. package/data/transforms/index.d.ts +27 -0
  176. package/data/transforms/transform-acdl.d.ts +5 -0
  177. package/data/transforms/transform-address.d.ts +91 -0
  178. package/data/transforms/transform-cart.d.ts +7 -0
  179. package/data/transforms/transform-customer-address-input.d.ts +5 -0
  180. package/data/transforms/transform-customer.d.ts +7 -0
  181. package/data/transforms/transform-email-availability.d.ts +6 -0
  182. package/data/transforms/transform-order.d.ts +20 -0
  183. package/data/transforms/transform-payment-methods.d.ts +9 -0
  184. package/data/transforms/transform-shipping-estimate.d.ts +5 -0
  185. package/data/transforms/transform-shipping-methods.d.ts +14 -0
  186. package/data/transforms/transform-store-config.d.ts +6 -0
  187. package/fragments.d.ts +1 -0
  188. package/fragments.js +372 -0
  189. package/hocs/index.d.ts +18 -0
  190. package/hocs/withConditionalRendering.d.ts +13 -0
  191. package/hooks/index.d.ts +20 -0
  192. package/hooks/useBreakpoint/index.d.ts +18 -0
  193. package/hooks/useBreakpoint/useBreakpoint.d.ts +18 -0
  194. package/hooks/useLockScroll/index.d.ts +18 -0
  195. package/hooks/useLockScroll/useLockScroll.d.ts +21 -0
  196. package/hooks/useStableList/index.d.ts +2 -0
  197. package/hooks/useStableList/useStableList.d.ts +2 -0
  198. package/i18n/en_US.json.d.ts +88 -0
  199. package/lib/acdl.d.ts +18 -0
  200. package/lib/fetch-error.d.ts +23 -0
  201. package/lib/index.d.ts +22 -0
  202. package/lib/network-error.d.ts +22 -0
  203. package/lib/state.d.ts +24 -0
  204. package/lib/validation.d.ts +5 -0
  205. package/msw/browser.d.ts +18 -0
  206. package/msw/fixtures/fragments/available-shipping-methods.d.ts +23 -0
  207. package/msw/fixtures/fragments/billing-address.d.ts +52 -0
  208. package/msw/fixtures/fragments/cart.d.ts +141 -0
  209. package/msw/fixtures/fragments/index.d.ts +21 -0
  210. package/msw/fixtures/fragments/shipping-address.d.ts +58 -0
  211. package/msw/fixtures/index.d.ts +20 -0
  212. package/msw/fixtures/mutations/estimate-shipping-methods.d.ts +4 -0
  213. package/msw/fixtures/mutations/index.d.ts +24 -0
  214. package/msw/fixtures/mutations/place-order.d.ts +4 -0
  215. package/msw/fixtures/mutations/set-billing-address.d.ts +5 -0
  216. package/msw/fixtures/mutations/set-guest-email.d.ts +4 -0
  217. package/msw/fixtures/mutations/set-payment-method.d.ts +4 -0
  218. package/msw/fixtures/mutations/set-shipping-address.d.ts +4 -0
  219. package/msw/fixtures/mutations/set-shipping-methods.d.ts +4 -0
  220. package/msw/fixtures/queries/get-cart.d.ts +4 -0
  221. package/msw/fixtures/queries/get-customer-cart-stock-status.d.ts +4 -0
  222. package/msw/fixtures/queries/get-customer.d.ts +5 -0
  223. package/msw/fixtures/queries/get-stock-status.d.ts +4 -0
  224. package/msw/fixtures/queries/get-store-config.d.ts +4 -0
  225. package/msw/fixtures/queries/index.d.ts +23 -0
  226. package/msw/fixtures/queries/is-email-available.d.ts +4 -0
  227. package/msw/handlers.d.ts +4 -0
  228. package/msw/server.d.ts +18 -0
  229. package/package.json +1 -1
  230. package/render/Provider.d.ts +8 -0
  231. package/render/index.d.ts +18 -0
  232. package/render/render.d.ts +6 -0
  233. package/render.d.ts +1 -0
  234. package/render.js +9 -1
  235. package/signals/CartSignal.d.ts +7 -0
  236. package/signals/CustomerSignal.d.ts +7 -0
  237. package/signals/EstimateShippingMethodsSignal.d.ts +7 -0
  238. package/signals/IsBillToShippingSignal.d.ts +18 -0
  239. package/signals/SelectedPaymentMethodSignal.d.ts +18 -0
  240. package/signals/SelectedShippingMethodSignal.d.ts +4 -0
  241. package/signals/ServerErrorSignal.d.ts +18 -0
  242. package/signals/StoreConfigSignal.d.ts +7 -0
  243. package/signals/index.d.ts +25 -0
  244. package/tests/constants.d.ts +19 -0
  245. package/tests/integration/utils/index.d.ts +19 -0
  246. package/tests/integration/utils/setup.d.ts +8 -0
  247. package/tests/integration/utils/user-actions.d.ts +18 -0
  248. package/tests/mocks/svg.d.ts +20 -0
  249. package/tests/utils/expectError.d.ts +25 -0
  250. package/tests/utils/index.d.ts +19 -0
  251. package/tests/utils/mockEvents.d.ts +21 -0
  252. package/utils/convertCase/convertCase.d.ts +4 -0
  253. package/utils/convertCase/index.d.ts +18 -0
  254. package/utils/getDisplayName/getDisplayName.d.ts +4 -0
  255. package/utils/getDisplayName/index.d.ts +18 -0
  256. package/utils/index.d.ts +21 -0
  257. package/utils/isEmpty/index.d.ts +18 -0
  258. package/utils/isEmpty/isEmpty.d.ts +18 -0
  259. package/utils/isNullish/index.d.ts +18 -0
  260. package/utils/isNullish/isNullish.d.ts +18 -0
  261. package/utils/isUnexpectedError/index.d.ts +18 -0
  262. package/utils/isUnexpectedError/isUnexpectedError.d.ts +18 -0
  263. package/utils/shippingMethods/index.d.ts +18 -0
  264. package/utils/shippingMethods/isEqual.d.ts +4 -0
  265. package/193.js +0 -1
  266. package/212.js +0 -2
  267. package/212.js.LICENSE.txt +0 -1
  268. package/261.js +0 -2
  269. package/261.js.LICENSE.txt +0 -1
  270. package/357.js +0 -1
  271. package/405.js +0 -1
  272. package/41.js +0 -2
  273. package/41.js.LICENSE.txt +0 -1
  274. package/494.js +0 -2
  275. package/494.js.LICENSE.txt +0 -1
  276. package/516.js +0 -1
  277. package/549.js +0 -2
  278. package/549.js.LICENSE.txt +0 -1
  279. package/565.js +0 -2
  280. package/565.js.LICENSE.txt +0 -1
  281. package/599.js +0 -1
  282. package/621.js +0 -1
  283. package/632.js +0 -1
  284. package/636.js +0 -2
  285. package/636.js.LICENSE.txt +0 -1
  286. package/687.js +0 -2
  287. package/687.js.LICENSE.txt +0 -1
  288. package/693.js +0 -1
  289. package/731.js +0 -1
  290. package/757.js +0 -1
  291. package/805.js +0 -2
  292. package/805.js.LICENSE.txt +0 -1
  293. package/88.js +0 -2
  294. package/88.js.LICENSE.txt +0 -1
  295. package/api.js.LICENSE.txt +0 -1
  296. package/containers/BillingForm.js +0 -1
  297. package/containers/Checkout.js +0 -2
  298. package/containers/Checkout.js.LICENSE.txt +0 -1
  299. package/containers/OrderSummary.js +0 -1
  300. package/containers/PlaceOrder.js.LICENSE.txt +0 -1
  301. package/containers/ShippingForm.js +0 -1
  302. package/runtime.js +0 -1
@@ -1 +1,3 @@
1
- import*as e from"@dropins/elsie/event-bus.js";import*as n from"@dropins/elsie/fetch-graphql.js";import*as t from"@dropins/elsie/preact-compat.js";import*as r from"@dropins/elsie/preact-hooks.js";import*as o from"@dropins/elsie/preact-jsx-runtime.js";import*as a from"@dropins/elsie/preact.js";export const id=278;export const ids=[278];export const modules={3483:(e,n,t)=>{t.d(n,{X:()=>g});var r=t(1892),o=t.n(r),a=t(5760),s=t.n(a),i=t(8311),l=t.n(i),c=t(8192),u=t.n(c),d=t(8060),m=t.n(d),p=t(4865),f=t.n(p),h=t(8695),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=m(),o()(h.Z,v),h.Z&&h.Z.locals&&h.Z.locals;var y=t(7188),g=function(e){var n=e.className,t=e.children,r=e.level,o=void 0===r?2:r,a=o>=1&&o<=6?"h".concat(o):"h2";return(0,y.jsx)(a,{className:n,children:t})}},9799:(e,n,t)=>{t.d(n,{O:()=>p,d:()=>m});var r=t(5587),o=(t(1442),t(7188));function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s=["isFull","lines","size","variant"],i=["className","children"];function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){u(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function u(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==a(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===a(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function d(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var m=function(e){var n=e.isFull,t=void 0!==n&&n,a=e.lines,i=void 0===a?1:a,l=e.size,u=void 0===l?"small":l,m=e.variant,p=void 0===m?"row":m,f=d(e,s),h=[["checkout-skeleton-row__".concat(p),p],["checkout-skeleton-row__".concat(p,"-").concat(u),p&&u]];return!1==i>1?(0,o.jsx)("div",c(c({},f),{},{class:(0,r.S)(["checkout-skeleton-row",["checkout-skeleton-row--full",t]].concat(h))})):(0,o.jsx)("div",c(c({},f),{},{class:(0,r.S)(["checkout-skeleton-row--multiline",["checkout-skeleton-row--full",t]]),children:Array.from({length:i}).map((function(e,n){return(0,o.jsx)("div",{class:(0,r.S)(["checkout-skeleton-row",["checkout-skeleton-row--full",t]].concat(h))},n)}))}))},p=function(e){var n=e.className,t=e.children,a=d(e,i);return(0,o.jsx)("div",c(c({},a),{},{className:(0,r.S)(["checkout-skeleton",n]),children:t}))}},1822:(e,n,t)=>{t.d(n,{A:()=>r.A,Z:()=>r.A});var r=t(6494)},3177:(e,n,t)=>{t.d(n,{t:()=>s});var r=t(6765),o=t(5437);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function s(){var e,n,t=(e=(0,o.useState)(),n=2,function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,a,s,i=[],l=!0,c=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=a.call(t)).done)&&(i.push(r.value),i.length!==n);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return a(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=t[0],i=t[1];return(0,o.useEffect)((function(){var e=r.events.on("checkout/data",(function(e){e&&i(e)}),{eager:!0});return function(){null==e||e.off()}}),[]),s}},8695:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(4933),o=t.n(r),a=t(3476),s=t.n(a)()(o());s.push([e.id,"/* https://cssguidelin.es/#bem-like-naming */\n\n/* .elsie-heading { } */\n\n/* Extra small devices (phones, 600px and down) */\n/* @media only screen and (max-width: 600px) { } */\n\n/* Small devices (portrait tablets and large phones, 600px and up) */\n/* @media only screen and (min-width: 600px) { } */\n\n/* Medium devices (landscape tablets, 768px and up) */\n/* @media only screen and (min-width: 768px) { } */\n\n/* Large devices (laptops/desktops, 992px and up) */\n/* @media only screen and (min-width: 992px) { } */\n\n/* Extra large devices (large laptops and desktops, 1200px and up) */\n/* @media only screen and (min-width: 1200px) { } */\n",""]);const i=s},4278:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(4933),o=t.n(r),a=t(3476),s=t.n(a)()(o());s.push([e.id,".checkout-skeleton {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--spacing-medium);\n}\n\n.checkout-skeleton-row {\n background: var(--color-neutral-300)\n linear-gradient(\n to right,\n var(--color-neutral-300) 0%,\n var(--color-neutral-100) 20%,\n var(--color-neutral-300) 40%,\n var(--color-neutral-300) 100%\n )\n no-repeat;\n animation: shimmer infinite 1.2s linear;\n border-radius: var(--shape-border-radius-2);\n}\n\n.checkout-skeleton-row__empty {\n background: none;\n}\n\n.checkout-skeleton-row--multiline {\n display: grid;\n grid-auto-rows: max-content;\n gap: var(--spacing-small);\n}\n\n.checkout-skeleton-row--full {\n grid-column: 1 / -1;\n}\n\n/* Heading variants */\n.checkout-skeleton-row__heading-small {\n height: 24px;\n}\n\n.checkout-skeleton-row__heading-medium {\n height: 32px;\n}\n\n.checkout-skeleton-row__heading-large {\n height: 40px;\n}\n\n/* Row variants */\n.checkout-skeleton-row__row-small {\n height: 40px;\n}\n\n.checkout-skeleton-row__row-medium {\n height: 48px;\n}\n\n.checkout-skeleton-row__row-large {\n height: 56px;\n}\n\n.checkout-skeleton-row__row-xlarge {\n height: 72px;\n}\n\n@keyframes shimmer {\n 0% {\n background-position: -600px 0;\n }\n 100% {\n background-position: 600px 0;\n }\n}\n\n/* Extra small devices (phones, 600px and down) */\n@media only screen and (max-width: 600px) {\n .checkout-skeleton {\n grid-template-columns: 1fr;\n }\n}\n",""]);const i=s},1442:(e,n,t)=>{var r=t(1892),o=t.n(r),a=t(5760),s=t.n(a),i=t(8311),l=t.n(i),c=t(8192),u=t.n(c),d=t(8060),m=t.n(d),p=t(4865),f=t.n(p),h=t(4278),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=m(),o()(h.Z,v),h.Z&&h.Z.locals&&h.Z.locals},6765:(n,t,r)=>{var o,a;n.exports=(o={events:()=>e.events},a={},r.d(a,o),a)},9699:(e,t,r)=>{var o,a;e.exports=(o={FetchGraphQL:()=>n.FetchGraphQL},a={},r.d(a,o),a)},4853:(e,n,r)=>{var o,a;e.exports=(o={forwardRef:()=>t.forwardRef,useCallback:()=>t.useCallback,useEffect:()=>t.useEffect,useImperativeHandle:()=>t.useImperativeHandle,useMemo:()=>t.useMemo,useRef:()=>t.useRef,useState:()=>t.useState},a={},r.d(a,o),a)},5437:(e,n,t)=>{var o,a;e.exports=(o={useCallback:()=>r.useCallback,useContext:()=>r.useContext,useDebugValue:()=>r.useDebugValue,useEffect:()=>r.useEffect,useId:()=>r.useId,useImperativeHandle:()=>r.useImperativeHandle,useLayoutEffect:()=>r.useLayoutEffect,useMemo:()=>r.useMemo,useReducer:()=>r.useReducer,useRef:()=>r.useRef,useState:()=>r.useState},a={},t.d(a,o),a)},4142:(e,n,t)=>{var r,a;e.exports=(r={Fragment:()=>o.Fragment,jsx:()=>o.jsx,jsxs:()=>o.jsxs},a={},t.d(a,r),a)},3474:(e,n,t)=>{var r,o;e.exports=(r={Component:()=>a.Component,Fragment:()=>a.Fragment,cloneElement:()=>a.cloneElement,createContext:()=>a.createContext,createElement:()=>a.createElement,createRef:()=>a.createRef,h:()=>a.h,hydrate:()=>a.hydrate,isValidElement:()=>a.isValidElement,options:()=>a.options,render:()=>a.render,toChildArray:()=>a.toChildArray},o={},t.d(o,r),o)}};import s from"../runtime.js";import*as i from"../757.js";s.C(i);import*as l from"../516.js";s.C(l);import*as c from"../599.js";s.C(c);import*as u from"../261.js";s.C(u);import*as d from"../494.js";s.C(d);import*as m from"./PaymentMethods.js";s.C(m);var p=(1822,s(s.s=1822)),f=p.A,h=p.Z;export{f as PaymentMethods,h as default};
1
+ /*! Copyright 2024 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as n,jsxs as v,Fragment as D}from"@dropins/tools/preact-jsx-runtime.js";import{s as $}from"../chunks/fetch-graphql.js";import{c as H,b as y}from"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import"@dropins/tools/event-bus.js";import{classes as S,Slot as T}from"@dropins/tools/lib.js";import{s as B}from"../chunks/setPaymentMethod.js";/* empty css */import{IllustratedMessage as U,Icon as Z,ProgressSpinner as F,ToggleButton as q,Skeleton as G,SkeletonRow as g}from"@dropins/tools/components.js";import*as k from"@dropins/tools/preact-compat.js";import{useState as w,useCallback as N,useEffect as b}from"@dropins/tools/preact-compat.js";import{useText as J}from"@dropins/tools/i18n.js";import{w as K}from"../chunks/withConditionalRendering.js";import{useRef as Q}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const X=e=>k.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},k.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),k.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Y=({code:e,loading:r,selected:o,onChange:d,title:h})=>n(q,{className:"checkout-payment-methods__method",label:h,name:"payment-method",value:e,selected:o,onChange:d,busy:r}),ee=({className:e,paymentMethodContent:r,loading:o=!1,initializing:d=!1,onChange:h=()=>{},options:c,selection:M})=>{const a=J({Title:"Checkout.PaymentMethods.title",EmptyState:"Checkout.PaymentMethods.emptyState"});return d?n(te,{}):v("div",{className:S(["checkout-payment-methods",e]),children:[n("h2",{className:"checkout-payment-methods__title",children:a.Title}),!o&&c.length===0&&n(U,{icon:n(Z,{source:X}),message:n("p",{children:a.EmptyState})}),v("div",{className:S(["checkout-payment-methods__wrapper"]),children:[o&&n(F,{className:"checkout-payment-methods__spinner"}),n("div",{className:S(["checkout-payment-methods__methods",["checkout-payment-methods--loading",o],["checkout-payment-methods--full-width",c.length%2!==0]]),children:c==null?void 0:c.map(i=>n(Y,{code:i.code,onChange:h,selected:i.code===M,title:i.title},i.code))}),r&&n("div",{className:"checkout-payment-methods__content",children:r})]})]})},te=()=>v(G,{"data-testid":"payment-methods-skeleton",children:[n(g,{variant:"heading",size:"medium"}),n(g,{variant:"empty",size:"medium"}),n(g,{size:"xlarge",fullWidth:!0}),n(g,{size:"xlarge",fullWidth:!0})]}),V={free:e=>{const r=document.createElement("div");r.innerText="",e.replaceHTML(r)},checkmo:e=>{const r=document.createElement("div");r.innerText="",e.replaceHTML(r)}},ne=(e,r)=>{const o=Q(e);return r(o.current,e)||(o.current=e),o.current},W=({slots:e,setOnChange:r={}})=>{var _,L;const[o]=w(r),[d,h]=w(V),[c,M]=w(!0),a=H.value.data,i=!!H.value.data,O=H.value.pending,j=(a==null?void 0:a.isVirtual)??!1,z=(_=a==null?void 0:a.shippingAddresses)==null?void 0:_[0],A=(a==null?void 0:a.availablePaymentMethods)||[],m=(L=a==null?void 0:a.selectedPaymentMethod)==null?void 0:L.code,E=j?!0:!!z,l=ne(A,(t,s)=>t.length!==s.length?!1:t.every((p,C)=>p.code===s[C].code)),u=N(t=>{y.value=t,!(!t||!E)&&t!==m&&o[t]!==!1&&B({code:t}).catch(console.error)},[E,m,o]);b(()=>{if(!i)return;if(!!!(l!=null&&l.length)){u(void 0);return}const s=l[0].code;if(!m){u(s);return}const p=l.some(C=>C.code===m);u(p?m:s)},[l,i,m,u]);const I=t=>{u(t)},x=N((t,s)=>{if(!t){console.warn("Payment method handler is ignored because it has no code");return}if(!s){console.warn("Payment method handler is ignored because it is empty");return}h(p=>({...p,[t]:s}))},[]);b(()=>{e!=null&&e.Handlers&&Object.entries(e.Handlers).forEach(([t,s])=>{x(t,s)})},[x,e==null?void 0:e.Handlers]);const f=e!=null&&e.Main?n(T,{name:"PaymentMethods",slot:e==null?void 0:e.Main,context:{replaceHTML(t){this.replaceWith(t),M(!1)}}}):null,P=y.value?d[y.value]:null,R=P?n(T,{name:"PaymentMethodContent",slot:P,context:{cartId:$.cartId||"",replaceHTML(t){this.replaceWith(t)}}},P):void 0;return b(()=>{!c&&d!=V&&console.warn("Payment method handlers you have added are ignored because the default content has been replaced")},[c,d]),v(D,{children:[f&&n(f.type,{ref:f.ref,...f.props}),c&&n(ee,{initializing:i===!1,loading:i&&O,onChange:I,options:l,paymentMethodContent:R,selection:y.value})]})};W.displayName="PaymentMethodsContainer";const Me=K(W);export{Me as PaymentMethods,Me as default};
@@ -0,0 +1,15 @@
1
+ import { HTMLAttributes } from 'preact/compat';
2
+
3
+ export interface PlaceOrderProps extends HTMLAttributes<HTMLDivElement> {
4
+ disabled?: boolean;
5
+ handleValidation?: () => boolean;
6
+ onPlaceOrder?: (ctx: PlaceOrderContext) => Promise<void>;
7
+ }
8
+ export interface PlaceOrderContext {
9
+ code: string;
10
+ }
11
+ export declare const PlaceOrder: {
12
+ ({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & PlaceOrderProps): import("preact/compat").JSX.Element;
13
+ displayName: string;
14
+ };
15
+ //# sourceMappingURL=PlaceOrder.d.ts.map
@@ -0,0 +1,19 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export * from './PlaceOrder';
18
+ export { PlaceOrder as default } from './PlaceOrder';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './PlaceOrder/index'
2
+ import _default from './PlaceOrder/index'
3
+ export default _default
@@ -1,2 +1,3 @@
1
- /*! For license information please see PlaceOrder.js.LICENSE.txt */
2
- import*as e from"@dropins/elsie/preact-compat.js";import*as n from"@dropins/elsie/preact-hooks.js";import*as t from"@dropins/elsie/preact-jsx-runtime.js";import*as r from"@dropins/elsie/preact.js";export const id=708;export const ids=[708];export const modules={9853:(e,n,t)=>{t.d(n,{z:()=>E});var r=t(5587),o=t(1892),i=t.n(o),a=t(5760),c=t.n(a),s=t(8311),l=t.n(s),u=t(8192),d=t.n(u),p=t(8060),f=t.n(p),h=t(4865),v=t.n(h),m=t(4367),y={};y.styleTagTransform=v(),y.setAttributes=d(),y.insert=l().bind(null,"head"),y.domAPI=c(),y.insertStyleElement=f(),i()(m.Z,y),m.Z&&m.Z.locals&&m.Z.locals;var b=t(7188);function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}var x=["value","variant","size","icon","className","children","disabled","active","activeChildren","activeIcon"];function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function j(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){O(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function O(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==g(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===g(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var E=function(e){var n=e.value,t=e.variant,o=void 0===t?"primary":t,i=e.size,a=void 0===i?"medium":i,c=e.icon,s=e.className,l=e.children,u=e.disabled,d=void 0!==u&&u,p=e.active,f=void 0!==p&&p,h=e.activeChildren,v=e.activeIcon,m=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,x),y="elsie-button";(c&&!l||c&&f&&!h||!c&&f&&v)&&(y="elsie-iconButton"),f&&h&&(y="elsie-button"),s=(0,r.S)([y,"".concat(y,"--").concat(a),"".concat(y,"--").concat(o),["".concat(y,"--").concat(o,"--disabled"),d],l&&c&&"".concat(y,"--with-icon"),!l&&h&&c&&"".concat(y,"--with-icon"),f&&v&&"".concat(y,"--with-icon"),s]);var g=(0,r.S)(["elsie-button-icon","elsie-button-icon--".concat(o),["elsie-button-icon--".concat(o,"--disabled"),d],null==c?void 0:c.props.className]);return(0,b.jsxs)("button",j(j({role:"button"},m),{},{value:n,className:s,disabled:d,active:f,children:[c&&!f&&(0,b.jsx)(c.type,j(j({},c.props),{},{className:g})),v&&f&&(0,b.jsx)(v.type,j(j({},v.props),{},{className:g})),l&&!f&&("string"==typeof l?(0,b.jsx)("span",{children:l}):l),f&&h&&("string"==typeof h?(0,b.jsx)("span",{children:h}):h)]}))}},7238:(e,n,t)=>{t.d(n,{U:()=>r});var r="billing_address"},6200:(e,n,t)=>{t.d(n,{N:()=>r});var r="login-form"},9776:(e,n,t)=>{t.d(n,{L:()=>N});var r=t(5587),o=t(1892),i=t.n(o),a=t(5760),c=t.n(a),s=t(8311),l=t.n(s),u=t(8192),d=t.n(u),p=t(8060),f=t.n(p),h=t(4865),v=t.n(h),m=t(4330),y={};y.styleTagTransform=v(),y.setAttributes=d(),y.insert=l().bind(null,"head"),y.domAPI=c(),y.insertStyleElement=f(),i()(m.Z,y),m.Z&&m.Z.locals&&m.Z.locals;var b=t(9853),g=t(9724),x=t(7188),w=["className","children"];var j=function(e){var n=e.className,t=(e.children,function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,w).onClick);return(0,x.jsx)("div",{className:(0,r.S)(["checkout-place-order",n]),children:(0,x.jsx)(b.z,{className:(0,r.S)(["checkout-place-order__button",n]),size:"medium",variant:"primary",type:"submit",onClick:t,children:(0,x.jsx)(g.xv,{id:"Checkout.PlaceOrder.button"})},"placeOrder")})},O=t(6200),E=t(7613),k=t(7238);function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function L(){L=function(){return e};var e={},n=Object.prototype,t=n.hasOwnProperty,r=Object.defineProperty||function(e,n,t){e[n]=t.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{s({},"")}catch(e){s=function(e,n,t){return e[n]=t}}function l(e,n,t,o){var i=n&&n.prototype instanceof p?n:p,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:w(e,t,c)}),a}function u(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d={};function p(){}function f(){}function h(){}var v={};s(v,i,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(P([])));y&&y!==n&&t.call(y,i)&&(v=y);var b=h.prototype=p.prototype=Object.create(v);function g(e){["next","throw","return"].forEach((function(n){s(e,n,(function(e){return this._invoke(n,e)}))}))}function x(e,n){function o(r,i,a,c){var s=u(e[r],e,i);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"==S(d)&&t.call(d,"__await")?n.resolve(d.__await).then((function(e){o("next",e,a,c)}),(function(e){o("throw",e,a,c)})):n.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,c)}))}c(s.arg)}var i;r(this,"_invoke",{value:function(e,t){function r(){return new n((function(n,r){o(e,t,n,r)}))}return i=i?i.then(r,r):r()}})}function w(e,n,t){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(t.method=o,t.arg=i;;){var a=t.delegate;if(a){var c=j(a,t);if(c){if(c===d)continue;return c}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===r)throw r="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);r="executing";var s=u(e,n,t);if("normal"===s.type){if(r=t.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:t.done}}"throw"===s.type&&(r="completed",t.method="throw",t.arg=s.arg)}}}function j(e,n){var t=n.method,r=e.iterator[t];if(void 0===r)return n.delegate=null,"throw"===t&&e.iterator.return&&(n.method="return",n.arg=void 0,j(e,n),"throw"===n.method)||"return"!==t&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+t+"' method")),d;var o=u(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function O(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function E(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function P(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function n(){for(;++r<e.length;)if(t.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=void 0,n.done=!0,n};return o.next=o}}return{next:_}}function _(){return{value:void 0,done:!0}}return f.prototype=h,r(b,"constructor",{value:h,configurable:!0}),r(h,"constructor",{value:f,configurable:!0}),f.displayName=s(h,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===f||"GeneratorFunction"===(n.displayName||n.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},g(x.prototype),s(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(n,t,r,o,i){void 0===i&&(i=Promise);var a=new x(l(n,t,r,o),i);return e.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(b),s(b,c,"Generator"),s(b,i,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var n=Object(e),t=[];for(var r in n)t.push(r);return t.reverse(),function e(){for(;t.length;){var r=t.pop();if(r in n)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=P,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&t.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(t,r){return a.type="throw",a.arg=e,n.next=t,r&&(n.method="next",n.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=t.call(i,"catchLoc"),s=t.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&t.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=n,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),d},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),E(t),d}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;E(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,t){return this.delegate={iterator:P(e),resultName:n,nextLoc:t},"next"===this.method&&(this.arg=void 0),d}},e}function P(e,n,t,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void t(e)}c.done?n(s):Promise.resolve(s).then(r,o)}var _=[O.N,E.d,k.U],C=function(){var e,n=(Array.from(document.forms)||[]).filter((function(e){return _.includes(e.name)})).filter((function(e){return null!==e.offsetParent})).filter((function(e){return!1===e.checkValidity()})),t=0===n.length;t||(e=n[0].querySelector(":invalid"))&&(e.scrollIntoView({behavior:"smooth"}),e.focus());return t},N=function(e){var n=e.onClick,t=e.handleServerError,r=function(){var e,r=(e=L().mark((function e(){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C()){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,n();case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),t(e.t0);case 10:case"end":return e.stop()}}),e,null,[[2,7]])})),function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function a(e){P(i,r,o,a,c,"next",e)}function c(e){P(i,r,o,a,c,"throw",e)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();return(0,x.jsx)(j,{onClick:r})}},6314:(e,n,t)=>{t.d(n,{L:()=>r.L,Z:()=>r.L});var r=t(9776)},7613:(e,n,t)=>{t.d(n,{d:()=>r});var r="shipping_address"},4367:(e,n,t)=>{t.d(n,{Z:()=>c});var r=t(4933),o=t.n(r),i=t(3476),a=t.n(i)()(o());a.push([e.id,"/* Common button styles */\n.elsie-button,\n.elsie-iconButton {\n border: 0 none;\n cursor: pointer;\n white-space: normal;\n}\n\n.elsie-button {\n border-radius: var(--shape-border-radius-3);\n font-size: var(--type-button-1-font);\n font-weight: var(--type-button-1-font);\n padding: var(--spacing-xsmall) var(--spacing-medium);\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: left;\n word-wrap: break-word;\n}\n\n.elsie-iconButton {\n border-radius: 50%; /* Make the button a perfect circle */\n height: var(--spacing-xbig);\n width: var(--spacing-xbig);\n padding: var(--spacing-xsmall);\n}\n\n.elsie-button:disabled,\n.elsie-iconButton:disabled {\n pointer-events: none;\n user-select: none;\n}\n\n.elsie-button:not(:disabled),\n.elsie-iconButton:not(:disabled) {\n cursor: pointer;\n}\n\n.elsie-button:hover > svg,\n.elsie-iconButton:hover > svg {\n fill: var(--color-neutral-300);\n}\n\n.elsie-button:focus,\n.elsie-iconButton:focus {\n outline: var(--spacing-xxsmall) solid var(--color-neutral-400);\n}\n\n/* Primary */\n.elsie-button--primary,\n.elsie-iconButton--primary {\n border: none;\n background: var(--color-brand-500) 0 0% no-repeat padding-box;\n color: var(--color-neutral-50);\n text-align: left;\n margin-right: 0;\n}\n\n.elsie-iconButton--primary {\n border-radius: var(--spacing-xbig);\n min-height: var(--spacing-xbig);\n min-width: var(--spacing-xbig);\n padding: var(--spacing-xsmall);\n}\n\n.elsie-button--primary--disabled,\n.elsie-iconButton--primary--disabled {\n background: var(--color-neutral-300) 0 0% no-repeat padding-box;\n color: var(--color-neutral-500);\n fill: var(--color-neutral-300);\n pointer-events: none;\n user-select: none;\n}\n\n.elsie-button--primary:hover,\n.elsie-iconButton--primary:hover {\n background: var(--color-brand-600) 0 0% no-repeat padding-box;\n}\n\n/* Secondary */\n.elsie-button--secondary,\n.elsie-iconButton--secondary {\n border: var(--shape-border-width-2) solid var(--color-brand-500);\n background: none 0 0% no-repeat padding-box;\n color: var(--color-brand-500);\n padding-top: calc(var(--spacing-xsmall) - var(--shape-border-width-2));\n padding-left: calc(var(--spacing-medium) - var(--shape-border-width-2));\n}\n\n.elsie-iconButton--secondary {\n border-radius: var(--spacing-xbig);\n min-height: var(--spacing-xbig);\n min-width: var(--spacing-xbig);\n padding: var(--spacing-xsmall);\n padding-top: calc(var(--spacing-xsmall) - var(--shape-border-width-2));\n padding-left: calc(var(--spacing-xsmall) - var(--shape-border-width-2));\n}\n\n.elsie-button--secondary--disabled,\n.elsie-iconButton--secondary--disabled {\n border: var(--shape-border-width-2) solid var(--color-neutral-300);\n background: none 0 0% no-repeat padding-box;\n color: var(--color-neutral-500);\n fill: var(--color-neutral-300);\n pointer-events: none;\n user-select: none;\n}\n\n.elsie-button--secondary:hover,\n.elsie-iconButton--secondary:hover {\n border: var(--shape-border-width-2) solid var(--color-brand-600);\n color: var(--color-brand-600);\n}\n\n/* Tertiary */\n.elsie-button--tertiary,\n.elsie-iconButton--tertiary {\n border: none;\n background: none 0 0% no-repeat padding-box;\n color: var(--color-brand-500);\n}\n\n.elsie-iconButton--tertiary {\n border: none;\n min-height: var(--spacing-xbig);\n min-width: var(--spacing-xbig);\n padding: var(--spacing-xsmall);\n}\n\n.elsie-button--tertiary--disabled,\n.elsie-iconButton--tertiary--disabled {\n border: none;\n color: var(--color-neutral-500);\n pointer-events: none;\n user-select: none;\n}\n\n.elsie-button--tertiary:hover,\n.elsie-iconButton--tertiary:hover {\n color: var(--color-brand-600);\n}\n\n/* Button Sizes */\n.elsie-button--large {\n font: var(--type-button-1-font);\n letter-spacing: var(--type-button-1-letter-spacing);\n}\n\n.elsie-button--medium {\n font: var(--type-button-2-font);\n letter-spacing: var(--type-button-2-letter-spacing);\n}\n\n.elsie-button-icon {\n height: 24px;\n}\n\n/* No Icon */\n.elsie-button--with-icon {\n column-gap: var(--spacing-xsmall);\n row-gap: var(--spacing-xsmall);\n}\n",""]);const c=a},4330:(e,n,t)=>{t.d(n,{Z:()=>c});var r=t(4933),o=t.n(r),i=t(3476),a=t.n(i)()(o());a.push([e.id,"/* https://cssguidelin.es/#bem-like-naming */\n\n.checkout-place-order {\n display: grid;\n}\n\n.checkout-place-order__button {\n align-self: flex-end;\n justify-self: flex-end;\n}\n\n@media only screen and (min-width:320px) and (max-width: 768px) {\n .checkout-place-order__button {\n align-self: center;\n justify-self: stretch;\n }\n}\n\n/* Medium (portrait tablets and large phones, 768px and up) */\n/* @media only screen and (min-width: 768px) { } */\n\n/* Large (landscape tablets, 1024px and up) */\n/* @media only screen and (min-width: 1024px) { } */\n\n/* XLarge (laptops/desktops, 1366px and up) */\n/* @media only screen and (min-width: 1366px) { } */\n\n/* XXlarge (large laptops and desktops, 1920px and up) */\n/* @media only screen and (min-width: 1920px) { } */\n",""]);const c=a},4853:(n,t,r)=>{var o,i;n.exports=(o={forwardRef:()=>e.forwardRef,useCallback:()=>e.useCallback,useEffect:()=>e.useEffect,useImperativeHandle:()=>e.useImperativeHandle,useMemo:()=>e.useMemo,useRef:()=>e.useRef,useState:()=>e.useState},i={},r.d(i,o),i)},5437:(e,t,r)=>{var o,i;e.exports=(o={useCallback:()=>n.useCallback,useContext:()=>n.useContext,useDebugValue:()=>n.useDebugValue,useEffect:()=>n.useEffect,useId:()=>n.useId,useImperativeHandle:()=>n.useImperativeHandle,useLayoutEffect:()=>n.useLayoutEffect,useMemo:()=>n.useMemo,useReducer:()=>n.useReducer,useRef:()=>n.useRef,useState:()=>n.useState},i={},r.d(i,o),i)},4142:(e,n,r)=>{var o,i;e.exports=(o={Fragment:()=>t.Fragment,jsx:()=>t.jsx,jsxs:()=>t.jsxs},i={},r.d(i,o),i)},3474:(e,n,t)=>{var o,i;e.exports=(o={Component:()=>r.Component,Fragment:()=>r.Fragment,cloneElement:()=>r.cloneElement,createContext:()=>r.createContext,createElement:()=>r.createElement,createRef:()=>r.createRef,h:()=>r.h,hydrate:()=>r.hydrate,isValidElement:()=>r.isValidElement,options:()=>r.options,render:()=>r.render,toChildArray:()=>r.toChildArray},i={},t.d(i,o),i)}};import o from"../runtime.js";import*as i from"../757.js";o.C(i);import*as a from"./PlaceOrder.js";o.C(a);var c=(6314,o(o.s=6314)),s=c.L,l=c.Z;export{s as PlaceOrder,l as default};
1
+ /*! Copyright 2024 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import{U as x}from"../chunks/fetch-graphql.js";import{c as E,b as g}from"../chunks/store-config.js";import{s as v}from"../chunks/ServerErrorSignal.js";import{events as y}from"@dropins/tools/event-bus.js";import{classes as S}from"@dropins/tools/lib.js";import{p as b}from"../chunks/placeOrder2.js";/* empty css */import{Button as P}from"@dropins/tools/components.js";import{Text as U,useText as w}from"@dropins/tools/i18n.js";import{w as N}from"../chunks/withConditionalRendering.js";import{useState as T,useCallback as m,useEffect as z}from"@dropins/tools/preact-compat.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const D=r=>r instanceof TypeError||r instanceof x,H=({className:r,disabled:t=!1,onClick:o})=>a("div",{className:S(["checkout-place-order",r]),children:a(P,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:t,onClick:o,size:"medium",type:"submit",variant:"primary",children:a(U,{id:"Checkout.PlaceOrder.button"})},"placeOrder")}),l=({disabled:r=!1,handleValidation:t,onPlaceOrder:o,...p})=>{const[u,d]=T(!1),{data:f,pending:O}=E.value,h=!!f,c=w({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),n=m(e=>{v.value=D(e)?c.CheckoutUnexpectedError:e.message},[c]),k=m(async()=>{try{if(!(t?t():!0))return;o?await o({code:g.value||""}):await b()}catch(e){n(e)}},[t,o,n]);return z(()=>{const e=y.on("cart/initialized",s=>{const C=(s==null?void 0:s.items)||[];d(C.some(i=>i.outOfStock||i.insufficientQuantity))},{eager:!0});return()=>{e==null||e.off()}},[]),a(H,{...p,onClick:k,disabled:r||!h||O||u})};l.displayName="PlaceOrderContainer";const X=N(l);export{X as PlaceOrder,X as default};
@@ -0,0 +1,8 @@
1
+ import { Container } from '@dropins/tools/types/elsie/src/lib';
2
+
3
+ export interface ServerErrorProps {
4
+ onRetry?: () => void;
5
+ onServerError?: (error: string) => void;
6
+ }
7
+ export declare const ServerError: Container<ServerErrorProps>;
8
+ //# sourceMappingURL=ServerError.d.ts.map
@@ -0,0 +1,19 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export * from './ServerError';
18
+ export { ServerError as default } from './ServerError';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './ServerError/index'
2
+ import _default from './ServerError/index'
3
+ export default _default
@@ -0,0 +1,3 @@
1
+ /*! Copyright 2024 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as t,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as m,Icon as l,Button as n}from"@dropins/tools/components.js";/* empty css */import{classes as a}from"@dropins/tools/lib.js";/* empty css *//* empty css */import{S as p}from"../chunks/OrderError.js";import{useText as d}from"@dropins/tools/i18n.js";/* empty css */import{s as i}from"../chunks/ServerErrorSignal.js";import{useEffect as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/signals.js";const v=({className:o,contactSupport:e,errorMessage:r,onClick:c})=>{const s=d({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return t(m,{"aria-invalid":"true","aria-describedby":"checkout-server-error__message","aria-live":"polite",className:a(["checkout-server-error",o]),"data-testid":"checkout-server-error",heading:r??s.Title,message:u("p",{id:a(["checkout-server-error__message"]),children:[s.Message,t("br",{}),t("span",{children:e??s.ContactSupport})]}),icon:t(l,{className:a(["checkout-server-error__icon"]),source:p}),action:t(n,{className:a(["checkout-server-error__button"]),onClick:c,children:s.Button})})},I=({onRetry:o,onServerError:e})=>{const r=i.value,c=async()=>{o==null||o(),i.value=void 0};return h(()=>{r&&(e==null||e(r))},[r,e]),r?t(v,{errorMessage:r,onClick:c}):null};export{I as ServerError,I as default};
@@ -0,0 +1,18 @@
1
+ import { ShippingMethod } from '../../data/models';
2
+ import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
3
+ import { HTMLAttributes } from 'preact/compat';
4
+
5
+ export interface ShippingMethodsProps extends HTMLAttributes<HTMLDivElement> {
6
+ onCheckoutDataUpdate?: () => Promise<void>;
7
+ onShippingMethodSelect?: (method: ShippingMethod) => void;
8
+ preSelectedMethod?: {
9
+ carrierCode: string;
10
+ methodCode: string;
11
+ };
12
+ shippingMethodsSlot?: SlotProps;
13
+ }
14
+ export declare const ShippingMethods: {
15
+ ({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & ShippingMethodsProps): import("preact/compat").JSX.Element;
16
+ displayName: string;
17
+ };
18
+ //# sourceMappingURL=ShippingMethods.d.ts.map
@@ -0,0 +1,19 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ declare function useShippingEstimateEventEmitter(): void;
18
+ export default useShippingEstimateEventEmitter;
19
+ //# sourceMappingURL=useShippingEstimateEventEmitter.d.ts.map
@@ -0,0 +1,19 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export * from './ShippingMethods';
18
+ export { ShippingMethods as default } from './ShippingMethods';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './ShippingMethods/index'
2
+ import _default from './ShippingMethods/index'
3
+ export default _default
@@ -1 +1,3 @@
1
- import*as e from"@dropins/elsie/event-bus.js";import*as n from"@dropins/elsie/fetch-graphql.js";import*as t from"@dropins/elsie/preact-compat.js";import*as r from"@dropins/elsie/preact-hooks.js";import*as o from"@dropins/elsie/preact-jsx-runtime.js";import*as a from"@dropins/elsie/preact.js";export const id=57;export const ids=[57];export const modules={424:(e,n,t)=>{t.d(n,{u:()=>P});var r=t(5587),o=t(1892),a=t.n(o),s=t(5760),i=t.n(s),l=t(8311),c=t.n(l),u=t(8192),d=t.n(u),p=t(8060),m=t.n(p),f=t(4865),h=t.n(f),v=t(123),y={};y.styleTagTransform=h(),y.setAttributes=d(),y.insert=c().bind(null,"head"),y.domAPI=i(),y.insertStyleElement=m(),a()(v.Z,y),v.Z&&v.Z.locals&&v.Z.locals;var g=t(1072),b=t(3483),k=t(7188);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}var x=["className","icon","heading","headingLevel","message"];function j(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?j(Object(t),!0).forEach((function(n){S(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):j(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function S(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==w(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===w(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var P=function(e){var n=e.className,t=e.icon,o=e.heading,a=e.headingLevel,s=void 0===a?2:a,i=e.message,l=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,x);return(0,k.jsxs)("div",O(O({},l),{},{className:(0,r.S)(["elsie-empty-state",n]),children:[t&&(0,k.jsx)(g.J,{size:"64",className:"elsie-empty-state__icon",source:t}),o&&(0,k.jsx)(b.X,{level:s,className:"elsie-empty-state__heading",children:o}),i&&(0,k.jsx)("p",{className:"elsie-empty-state__message",children:i})]}))}},3483:(e,n,t)=>{t.d(n,{X:()=>g});var r=t(1892),o=t.n(r),a=t(5760),s=t.n(a),i=t(8311),l=t.n(i),c=t(8192),u=t.n(c),d=t(8060),p=t.n(d),m=t(4865),f=t.n(m),h=t(8695),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=p(),o()(h.Z,v),h.Z&&h.Z.locals&&h.Z.locals;var y=t(7188),g=function(e){var n=e.className,t=e.children,r=e.level,o=void 0===r?2:r,a=o>=1&&o<=6?"h".concat(o):"h2";return(0,y.jsx)(a,{className:n,children:t})}},7354:(e,n,t)=>{t.d(n,{a:()=>b});var r=t(5587),o=t(1892),a=t.n(o),s=t(5760),i=t.n(s),l=t(8311),c=t.n(l),u=t(8192),d=t.n(u),p=t(8060),m=t.n(p),f=t(4865),h=t.n(f),v=t(9794),y={};y.styleTagTransform=h(),y.setAttributes=d(),y.insert=c().bind(null,"head"),y.domAPI=i(),y.insertStyleElement=m(),a()(v.Z,y),v.Z&&v.Z.locals&&v.Z.locals;var g=t(7188),b=function(e){var n=e.size,t=void 0===n?"24":n,o=e.stroke,a=void 0===o?"4":o,s=e.className;return(0,g.jsx)("div",{className:(0,r.S)(["elsie-loader","elsie-loader--shape-size-".concat(t),"elsie-loader--shape-stroke-".concat(a),s])})}},9799:(e,n,t)=>{t.d(n,{O:()=>m,d:()=>p});var r=t(5587),o=(t(1442),t(7188));function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s=["isFull","lines","size","variant"],i=["className","children"];function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){u(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function u(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==a(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===a(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function d(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var p=function(e){var n=e.isFull,t=void 0!==n&&n,a=e.lines,i=void 0===a?1:a,l=e.size,u=void 0===l?"small":l,p=e.variant,m=void 0===p?"row":p,f=d(e,s),h=[["checkout-skeleton-row__".concat(m),m],["checkout-skeleton-row__".concat(m,"-").concat(u),m&&u]];return!1==i>1?(0,o.jsx)("div",c(c({},f),{},{class:(0,r.S)(["checkout-skeleton-row",["checkout-skeleton-row--full",t]].concat(h))})):(0,o.jsx)("div",c(c({},f),{},{class:(0,r.S)(["checkout-skeleton-row--multiline",["checkout-skeleton-row--full",t]]),children:Array.from({length:i}).map((function(e,n){return(0,o.jsx)("div",{class:(0,r.S)(["checkout-skeleton-row",["checkout-skeleton-row--full",t]].concat(h))},n)}))}))},m=function(e){var n=e.className,t=e.children,a=d(e,i);return(0,o.jsx)("div",c(c({},a),{},{className:(0,r.S)(["checkout-skeleton",n]),children:t}))}},8539:(e,n,t)=>{t.d(n,{SG:()=>r.SG,ZP:()=>r.SG,fz:()=>r.fz,lJ:()=>r.lJ});var r=t(7805)},3177:(e,n,t)=>{t.d(n,{t:()=>s});var r=t(6765),o=t(5437);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function s(){var e,n,t=(e=(0,o.useState)(),n=2,function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,a,s,i=[],l=!0,c=!1;try{if(a=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=a.call(t)).done)&&(i.push(r.value),i.length!==n);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return a(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=t[0],i=t[1];return(0,o.useEffect)((function(){var e=r.events.on("checkout/data",(function(e){e&&i(e)}),{eager:!0});return function(){null==e||e.off()}}),[]),s}},123:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(4933),o=t.n(r),a=t(3476),s=t.n(a)()(o());s.push([e.id,".elsie-empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n row-gap: var(--spacing-small);\n}\n\n.elsie-empty-state__icon {\n color: var(--color-neutral-400);\n}\n\n.elsie-empty-state__heading {\n color: var(--color-neutral-800);\n font: var(--type-headline-2-strong-font);\n letter-spacing: var(--type-headline-2-strong-letter-spacing);\n margin: 0;\n}\n\n.elsie-empty-state__message {\n color: var(--color-neutral-800);\n font: var(--type-body-2-default-font);\n letter-spacing: var(--type-body-2-default-letter-spacing);\n text-align: center;\n margin: 0;\n max-width: 400px; /* ~80 characters line length*/\n}\n",""]);const i=s},8695:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(4933),o=t.n(r),a=t(3476),s=t.n(a)()(o());s.push([e.id,"/* https://cssguidelin.es/#bem-like-naming */\n\n/* .elsie-heading { } */\n\n/* Extra small devices (phones, 600px and down) */\n/* @media only screen and (max-width: 600px) { } */\n\n/* Small devices (portrait tablets and large phones, 600px and up) */\n/* @media only screen and (min-width: 600px) { } */\n\n/* Medium devices (landscape tablets, 768px and up) */\n/* @media only screen and (min-width: 768px) { } */\n\n/* Large devices (laptops/desktops, 992px and up) */\n/* @media only screen and (min-width: 992px) { } */\n\n/* Extra large devices (large laptops and desktops, 1200px and up) */\n/* @media only screen and (min-width: 1200px) { } */\n",""]);const i=s},9794:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(4933),o=t.n(r),a=t(3476),s=t.n(a)()(o());s.push([e.id,"/* https://cssguidelin.es/#bem-like-naming */\n\n.elsie-loader {\n --size: 24px;\n --stroke-width: var(--shape-icon-stroke-4);\n width: var(--size);\n height: var(--size);\n border-style: solid;\n border-width: var(--stroke-width);\n border-color: var(--color-neutral-400);\n border-top-color: var(--color-brand-500);\n border-radius: 50%;\n animation: indeterminate 1s infinite ease-in-out;\n}\n\n.elsie-loader--shape-size-16 {\n --size: 16px;\n}\n\n.elsie-loader--shape-size-24 {\n --size: 24px;\n}\n\n.elsie-loader--shape-size-32 {\n --size: 32px;\n}\n\n.elsie-loader--shape-size-64 {\n --size: 64px;\n}\n\n.elsie-loader--shape-stroke-1 {\n --stroke-width: var(--shape-icon-stroke-1);\n}\n\n.elsie-loader--shape-stroke-2 {\n --stroke-width: var(--shape-icon-stroke-2);\n}\n\n.elsie-loader--shape-stroke-3 {\n --stroke-width: var(--shape-icon-stroke-3);\n}\n\n.elsie-loader--shape-stroke-4 {\n --stroke-width: var(--shape-icon-stroke-4);\n}\n\n@keyframes indeterminate {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n",""]);const i=s},4278:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(4933),o=t.n(r),a=t(3476),s=t.n(a)()(o());s.push([e.id,".checkout-skeleton {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--spacing-medium);\n}\n\n.checkout-skeleton-row {\n background: var(--color-neutral-300)\n linear-gradient(\n to right,\n var(--color-neutral-300) 0%,\n var(--color-neutral-100) 20%,\n var(--color-neutral-300) 40%,\n var(--color-neutral-300) 100%\n )\n no-repeat;\n animation: shimmer infinite 1.2s linear;\n border-radius: var(--shape-border-radius-2);\n}\n\n.checkout-skeleton-row__empty {\n background: none;\n}\n\n.checkout-skeleton-row--multiline {\n display: grid;\n grid-auto-rows: max-content;\n gap: var(--spacing-small);\n}\n\n.checkout-skeleton-row--full {\n grid-column: 1 / -1;\n}\n\n/* Heading variants */\n.checkout-skeleton-row__heading-small {\n height: 24px;\n}\n\n.checkout-skeleton-row__heading-medium {\n height: 32px;\n}\n\n.checkout-skeleton-row__heading-large {\n height: 40px;\n}\n\n/* Row variants */\n.checkout-skeleton-row__row-small {\n height: 40px;\n}\n\n.checkout-skeleton-row__row-medium {\n height: 48px;\n}\n\n.checkout-skeleton-row__row-large {\n height: 56px;\n}\n\n.checkout-skeleton-row__row-xlarge {\n height: 72px;\n}\n\n@keyframes shimmer {\n 0% {\n background-position: -600px 0;\n }\n 100% {\n background-position: 600px 0;\n }\n}\n\n/* Extra small devices (phones, 600px and down) */\n@media only screen and (max-width: 600px) {\n .checkout-skeleton {\n grid-template-columns: 1fr;\n }\n}\n",""]);const i=s},1442:(e,n,t)=>{var r=t(1892),o=t.n(r),a=t(5760),s=t.n(a),i=t(8311),l=t.n(i),c=t(8192),u=t.n(c),d=t(8060),p=t.n(d),m=t(4865),f=t.n(m),h=t(4278),v={};v.styleTagTransform=f(),v.setAttributes=u(),v.insert=l().bind(null,"head"),v.domAPI=s(),v.insertStyleElement=p(),o()(h.Z,v),h.Z&&h.Z.locals&&h.Z.locals},6765:(n,t,r)=>{var o,a;n.exports=(o={events:()=>e.events},a={},r.d(a,o),a)},9699:(e,t,r)=>{var o,a;e.exports=(o={FetchGraphQL:()=>n.FetchGraphQL},a={},r.d(a,o),a)},4853:(e,n,r)=>{var o,a;e.exports=(o={forwardRef:()=>t.forwardRef,useCallback:()=>t.useCallback,useEffect:()=>t.useEffect,useImperativeHandle:()=>t.useImperativeHandle,useMemo:()=>t.useMemo,useRef:()=>t.useRef,useState:()=>t.useState},a={},r.d(a,o),a)},5437:(e,n,t)=>{var o,a;e.exports=(o={useCallback:()=>r.useCallback,useContext:()=>r.useContext,useDebugValue:()=>r.useDebugValue,useEffect:()=>r.useEffect,useId:()=>r.useId,useImperativeHandle:()=>r.useImperativeHandle,useLayoutEffect:()=>r.useLayoutEffect,useMemo:()=>r.useMemo,useReducer:()=>r.useReducer,useRef:()=>r.useRef,useState:()=>r.useState},a={},t.d(a,o),a)},4142:(e,n,t)=>{var r,a;e.exports=(r={Fragment:()=>o.Fragment,jsx:()=>o.jsx,jsxs:()=>o.jsxs},a={},t.d(a,r),a)},3474:(e,n,t)=>{var r,o;e.exports=(r={Component:()=>a.Component,Fragment:()=>a.Fragment,cloneElement:()=>a.cloneElement,createContext:()=>a.createContext,createElement:()=>a.createElement,createRef:()=>a.createRef,h:()=>a.h,hydrate:()=>a.hydrate,isValidElement:()=>a.isValidElement,options:()=>a.options,render:()=>a.render,toChildArray:()=>a.toChildArray},o={},t.d(o,r),o)}};import s from"../runtime.js";import*as i from"../757.js";s.C(i);import*as l from"../516.js";s.C(l);import*as c from"../405.js";s.C(c);import*as u from"../261.js";s.C(u);import*as d from"../549.js";s.C(d);import*as p from"../805.js";s.C(p);import*as m from"./ShippingMethods.js";s.C(m);var f=(8539,s(s.s=8539)),h=f.SG,v=f.fz,y=f.ZP,g=f.lJ;export{h as ShippingMethods,v as buildShippingMethod,y as default,g as getShippingMethodValue};
1
+ /*! Copyright 2024 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as o,jsxs as E,Fragment as I}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/fetch-graphql.js";import{s as k,e as M,c as x,a as B}from"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import{events as N}from"@dropins/tools/event-bus.js";import{classes as j,Slot as V}from"@dropins/tools/lib.js";import{s as O}from"../chunks/setShippingMethods.js";/* empty css */import{IllustratedMessage as P,Icon as Z,ProgressSpinner as $,RadioButton as q,Price as F,Skeleton as G,SkeletonRow as S}from"@dropins/tools/components.js";import*as d from"@dropins/tools/preact-compat.js";import{useRef as J,useEffect as R,useCallback as K,useMemo as Q}from"@dropins/tools/preact-compat.js";import{useText as X}from"@dropins/tools/i18n.js";import{useState as T,useEffect as _}from"@dropins/tools/preact-hooks.js";import{w as Y}from"../chunks/withConditionalRendering.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const D=e=>({countryCode:e.country_id,postCode:e.postcode||"",...e.region_id?{regionId:Number(e.region_id)}:{...e.region?{region:e.region}:{}}}),U=e=>({carrierCode:e.carrier.code||"",methodCode:e.code||"",amount:e.amount,amountExclTax:e.amountExclTax,amountInclTax:e.amountInclTax}),ee=e=>d.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.47266 4.90002H15.1851V10.9645H21.2495L23 12.715V17.6124H20.073",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76151 16.7898C9.76151 18.0525 8.72845 19.076 7.46582 19.076C6.20318 19.076 5.17969 18.0429 5.17969 16.7803C5.17969 15.5176 6.20318 14.4941 7.46582 14.4941C8.72845 14.4941 9.75195 15.5176 9.76151 16.7803C9.76151 16.7803 9.76151 16.7803 9.76151 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8726 16.7898C19.8726 18.062 18.8491 19.0855 17.5769 19.0855C16.3047 19.0855 15.2812 18.062 15.2812 16.7898C15.2812 15.5176 16.3047 14.4941 17.5769 14.4941C18.8491 14.4941 19.8726 15.5176 19.8726 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),te=({className:e,isLoading:t=!1,onSelectionChange:c=()=>{},options:i,selection:r,...a})=>{const s=X({Title:"Checkout.ShippingMethods.title",EmptyState:"Checkout.ShippingMethods.emptyState"});return i===void 0?o(ne,{}):E("div",{...a,className:j(["checkout-shipping-methods",e]),children:[o("h3",{className:"checkout-shipping-methods__title",children:s.Title}),!t&&i.length===0&&o(P,{icon:o(Z,{source:ee}),message:o("p",{children:s.EmptyState})}),E("div",{className:j(["checkout-shipping-methods__content"]),children:[t&&o($,{className:"checkout-shipping-methods__spinner"}),o("div",{className:j(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:i.map(n=>o(q,{"data-testid":"shipping-method-radiobutton","aria-busy":t,id:n.value,name:"shipping-method",className:"checkout-shipping-methods__method",label:E(I,{children:[o(F,{amount:n.amount.value,currency:n.amount.currency})," ",o("span",{children:n.carrier.title})]}),description:n.title,value:n.value,checked:(r==null?void 0:r.value)===n.value,onChange:()=>c(n)},n.value))})]})]})},ne=()=>E(G,{"data-testid":"shipping-methods-skeleton",children:[o(S,{variant:"heading",size:"small"}),o(S,{variant:"empty",size:"small"}),o(S,{size:"medium",fullWidth:!0}),o(S,{size:"medium",fullWidth:!0})]});function oe(){var L;const[e,t]=T(),[c,i]=T();_(()=>{N.on("checkout/estimate-shipping-address",({address:f,isValid:p})=>{t({address:f,isValid:p})})},[]),_(()=>{i(k.value)},[k.value]),_(()=>{M.value.pending?i(void 0):i(k.value)},[M.value.pending]);const{country_id:r,region_id:a,region:s,postcode:n}=(e==null?void 0:e.address)||{},l=!!e,h=x.value.data,u=!!((L=h==null?void 0:h.shippingAddresses)!=null&&L[0]),v=e==null?void 0:e.isValid;_(()=>{u||v||!c||!l||N.emit("shipping/estimate",{address:D({country_id:r,region_id:a,region:s,postcode:n}),shippingMethod:U(c)})},[c,r,a,s,n,l,u,v])}const W=(e,t)=>e.code===t.code&&e.carrier.code===t.carrier.code,ie=e=>{var i,r,a,s;const t=(s=(a=(r=(i=x.value.data)==null?void 0:i.shippingAddresses)==null?void 0:r[0])==null?void 0:a.selectedShippingMethod)==null?void 0:s.carrier.code,c=J();R(()=>{t!==c.current&&(c.current=t,t&&(e==null||e()))},[t,e])};function re({preSelectedMethod:e,onShippingMethodSelect:t}){const i=!B.value.data,r=x.value.data,a=x.value.pending,s=M.value.data,n=M.value.pending,l=k.value,h=r==null?void 0:r.shippingAddresses,u=h==null?void 0:h[0],v=!!u,L=u==null?void 0:u.availableShippingMethods,f=u==null?void 0:u.selectedShippingMethod,p=L||s,b=K(g=>{if(!v)return;const C={method_code:g.code,carrier_code:g.carrier.code};O([C]).catch(w=>{console.error("Setting shipping methods on cart failed:",w)})},[v]),A=g=>{k.value=g,t==null||t(g)},m=Q(()=>{if(!(p!=null&&p.length))return;const g=p[0],C=l||f;return C?p.some(y=>W(y,C))?C:g:p.find(H=>H.carrier.code===(e==null?void 0:e.carrierCode)&&H.code===(e==null?void 0:e.methodCode))||g},[l,f,p,e]);return R(()=>{m&&((!l||!W(m,l))&&(k.value=m,t==null||t(m)),(!f||!W(m,f))&&b(m))},[m,l,f,b,t]),{isLoading:a||i||n,options:p,selection:m,onSelectionChange:A}}const z=({preSelectedMethod:e,onCheckoutDataUpdate:t,shippingMethodsSlot:c,onShippingMethodSelect:i,initialData:r,...a})=>{const{isLoading:s,options:n,selection:l,onSelectionChange:h}=re({preSelectedMethod:e,onCheckoutDataUpdate:t,onShippingMethodSelect:i});return oe(),ie(t),E(I,{children:[o(te,{...a,isLoading:s,onSelectionChange:h,options:n,selection:l}),!s&&c&&o(V,{name:"ShippingMethods",slot:c})]})};z.displayName="ShippingMethodsContainer";const _e=Y(z);export{_e as ShippingMethods,_e as default};
@@ -0,0 +1,28 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export * from './BillToShippingAddress';
18
+ export * from './ErrorBanner';
19
+ export * from './EstimateShipping';
20
+ export * from './LoginForm';
21
+ export * from './MergedCartBanner';
22
+ export * from './OutOfStock';
23
+ export * from './PaymentMethods';
24
+ export * from './PlaceOrder';
25
+ export * from './ServerError';
26
+ export * from './ShippingMethods';
27
+ export * from './OrderConfirmationHeader';
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,115 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ /**
18
+ * This module contains the schema type definitions to build the ShoppingCart
19
+ * and Order contexts, which are required to trigger the "place-order" event.
20
+ *
21
+ * The following schema types have been extracted from the Adobe Commerce
22
+ * Events SDK package.
23
+ *
24
+ * ShoppingCart schema type @see https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/types/schemas/shoppingCart.ts
25
+ * Order schema type @see https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/types/schemas/order.ts
26
+ */
27
+ type ShoppingCartItem = {
28
+ canApplyMsrp: boolean;
29
+ formattedPrice: string;
30
+ id: string;
31
+ prices: {
32
+ price: Price;
33
+ };
34
+ product: Product;
35
+ configurableOptions?: Array<ConfigurableOption>;
36
+ quantity: number;
37
+ };
38
+ type Price = {
39
+ value: number;
40
+ currency?: string;
41
+ regularPrice?: number;
42
+ };
43
+ type Product = {
44
+ productId: number;
45
+ name: string;
46
+ sku: string;
47
+ topLevelSku?: string | null;
48
+ specialToDate?: string | null;
49
+ specialFromDate?: string | null;
50
+ newToDate?: string | null;
51
+ newFromDate?: string | null;
52
+ createdAt?: string | null;
53
+ updatedAt?: string | null;
54
+ manufacturer?: string | null;
55
+ countryOfManufacture?: string | null;
56
+ categories?: string[] | null;
57
+ productType?: string | null;
58
+ pricing?: {
59
+ regularPrice: number;
60
+ minimalPrice?: number;
61
+ maximalPrice?: number;
62
+ specialPrice?: number;
63
+ tierPricing?: {
64
+ customerGroupId?: number | null;
65
+ qty: number;
66
+ value: number;
67
+ }[];
68
+ currencyCode: string | null;
69
+ };
70
+ canonicalUrl?: string | null;
71
+ mainImageUrl?: string | null;
72
+ };
73
+ type ConfigurableOption = {
74
+ id?: number;
75
+ optionLabel: string;
76
+ valueId?: number;
77
+ valueLabel: string;
78
+ };
79
+ type Payment = {
80
+ paymentMethodCode: string;
81
+ paymentMethodName: string;
82
+ total: number;
83
+ };
84
+ type Shipping = {
85
+ shippingMethod?: string;
86
+ shippingAmount?: number;
87
+ };
88
+ export type ShoppingCartContext = {
89
+ id: string | null;
90
+ items?: Array<ShoppingCartItem>;
91
+ prices?: {
92
+ subtotalExcludingTax?: Price;
93
+ subtotalIncludingTax?: Price;
94
+ };
95
+ totalQuantity: number;
96
+ possibleOnepageCheckout?: boolean;
97
+ giftMessageSelected?: boolean;
98
+ giftWrappingSelected?: boolean;
99
+ source?: string;
100
+ };
101
+ export type OrderContext = {
102
+ appliedCouponCode: string;
103
+ email: string;
104
+ grandTotal: number;
105
+ orderId: string;
106
+ orderType?: 'checkout' | 'instant_purchase';
107
+ otherTax: number;
108
+ payments?: Payment[];
109
+ salesTax: number;
110
+ shipping?: Shipping;
111
+ subtotalExcludingTax: number;
112
+ subtotalIncludingTax: number;
113
+ };
114
+ export {};
115
+ //# sourceMappingURL=acdl.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { Region, Country, CustomAttribute } from '.';
2
+
3
+ export interface Address {
4
+ id?: number;
5
+ city: string;
6
+ company?: string;
7
+ country: Country;
8
+ customAttributes: CustomAttribute[];
9
+ firstName: string;
10
+ lastName: string;
11
+ postCode?: string;
12
+ region?: Region;
13
+ street: string[];
14
+ telephone?: string;
15
+ vatId?: string;
16
+ }
17
+ //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { CustomAttribute } from './custom-attribute';
2
+
3
+ export interface CartAddress {
4
+ city: string;
5
+ company?: string;
6
+ countryCode: string;
7
+ customAttributes: CustomAttribute[];
8
+ firstName: string;
9
+ lastName: string;
10
+ postcode?: string;
11
+ region?: string;
12
+ regionId?: number;
13
+ saveInAddressBook?: boolean;
14
+ street: string[];
15
+ telephone?: string;
16
+ vatId?: string;
17
+ }
18
+ export interface ShippingAddressInput {
19
+ address?: CartAddress;
20
+ customerAddressId?: number;
21
+ pickupLocationCode?: string;
22
+ }
23
+ export interface BillingAddressInput {
24
+ address?: CartAddress;
25
+ customerAddressId?: number;
26
+ sameAsShipping?: boolean;
27
+ useForShipping?: boolean;
28
+ }
29
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { Address, PaymentMethod, ShippingMethod } from '.';
2
+
3
+ export interface ShippingAddress extends Address {
4
+ availableShippingMethods?: ShippingMethod[];
5
+ selectedShippingMethod?: ShippingMethod;
6
+ sameAsBilling?: boolean;
7
+ }
8
+ export interface Cart {
9
+ availablePaymentMethods?: PaymentMethod[];
10
+ billingAddress?: Address;
11
+ email?: string;
12
+ id: string;
13
+ isEmpty: boolean;
14
+ isGuest: boolean;
15
+ isVirtual: boolean;
16
+ selectedPaymentMethod?: PaymentMethod;
17
+ shippingAddresses?: ShippingAddress[];
18
+ }
19
+ //# sourceMappingURL=cart.d.ts.map
@@ -0,0 +1,21 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export type Country = {
18
+ value: string;
19
+ label: string;
20
+ };
21
+ //# sourceMappingURL=country.d.ts.map
@@ -0,0 +1,21 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export type CustomAttribute = {
18
+ code: string;
19
+ value: string;
20
+ };
21
+ //# sourceMappingURL=custom-attribute.d.ts.map
@@ -0,0 +1,22 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export interface Customer {
18
+ firstName: string;
19
+ lastName: string;
20
+ email: string;
21
+ }
22
+ //# sourceMappingURL=customer.d.ts.map
@@ -0,0 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export type EmailAvailability = boolean;
18
+ //# sourceMappingURL=email-availability.d.ts.map