@rebuy/rebuy-hydrogen 3.0.0-beta.16 → 3.0.0-beta.17
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.
- package/README.md +21 -17
- package/dist/components/ProductCard/ProductCard.d.ts +1 -1
- package/dist/components/ProductCard/ProductCard.d.ts.map +1 -1
- package/dist/components/ProductCard/types.d.ts +1 -0
- package/dist/components/ProductCard/types.d.ts.map +1 -1
- package/dist/components/ProductCarousel/ProductCarousel.d.ts +2 -16
- package/dist/components/ProductCarousel/ProductCarousel.d.ts.map +1 -1
- package/dist/components/ProductCarousel/types.d.ts +18 -0
- package/dist/components/ProductCarousel/types.d.ts.map +1 -0
- package/dist/components/RebuyLink/RebuyLink.d.ts +3 -0
- package/dist/components/RebuyLink/RebuyLink.d.ts.map +1 -0
- package/dist/components/RebuyLink/index.d.ts +2 -0
- package/dist/components/RebuyLink/index.d.ts.map +1 -0
- package/dist/components/RebuyLink/types.d.ts +10 -0
- package/dist/components/RebuyLink/types.d.ts.map +1 -0
- package/dist/index.css +53 -39
- package/dist/index.css.map +3 -3
- package/dist/index.js +629 -488
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +531 -390
- package/dist/index.mjs.map +4 -4
- package/dist/smart-cart/components/CartItem/CartItem.d.ts.map +1 -1
- package/dist/smart-cart/components/LoginButton/LoginButton.d.ts.map +1 -1
- package/dist/smart-cart/components/SmartCartContainer/SmartCartContainer.d.ts.map +1 -1
- package/dist/types/shopify.d.ts +1 -2
- package/dist/types/shopify.d.ts.map +1 -1
- package/dist/utils/convertToRebuyProduct.d.ts.map +1 -1
- package/dist/widgetContainer/RebuyWidgetContainer.d.ts.map +1 -1
- package/dist/widgets/RebuyDynamicBundleProducts/BundleImages.d.ts.map +1 -1
- package/dist/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.d.ts.map +1 -1
- package/dist/widgets/RebuyProductAddOns/RebuyProductAddOnCard.d.ts.map +1 -1
- package/dist/widgets/RebuyProductAddOns/RebuyProductAddOns.d.ts.map +1 -1
- package/dist/widgets/RebuyWidget/RebuyWidget.d.ts.map +1 -1
- package/dist/widgets/RebuyWidget/WidgetContent.d.ts +1 -1
- package/dist/widgets/RebuyWidget/WidgetContent.d.ts.map +1 -1
- package/dist/widgets/RebuyWidget/types.d.ts +2 -0
- package/dist/widgets/RebuyWidget/types.d.ts.map +1 -1
- package/package.json +9 -4
package/dist/index.mjs
CHANGED
@@ -1221,7 +1221,7 @@ var useTieredProgressBarStore = create((set, get) => ({
|
|
1221
1221
|
if (idsToFetch.length > 0) {
|
1222
1222
|
const productGids = idsToFetch.map((id) => `gid://shopify/Product/${id}`);
|
1223
1223
|
const graphqlQuery = `query getProductsByIds($ids: [ID!]!) { nodes(ids: $ids) { ... on Product { id title handle tags images(first: 1) { edges { node { url altText } } } variants(first: 30) { edges { node { id title sku availableForSale price { amount currencyCode } compareAtPrice { amount currencyCode } selectedOptions { name value } image { url altText } } } } } } }`;
|
1224
|
-
const response = await fetch(`https://${_shopifyDomain}/api/
|
1224
|
+
const response = await fetch(`https://${_shopifyDomain}/api/2025-01/graphql.json`, {
|
1225
1225
|
body: JSON.stringify({ query: graphqlQuery, variables: { ids: productGids } }),
|
1226
1226
|
headers: {
|
1227
1227
|
"Content-Type": "application/json",
|
@@ -3524,7 +3524,7 @@ var RebuyHydrogenReactContextProvider = ({
|
|
3524
3524
|
publicStoreDomain,
|
3525
3525
|
publicStorefrontId,
|
3526
3526
|
publicStorefrontToken,
|
3527
|
-
storefrontApiVersion = "
|
3527
|
+
storefrontApiVersion = "2025-01"
|
3528
3528
|
}) => {
|
3529
3529
|
const adaptedCallbacks = useMemo4(
|
3530
3530
|
() => ({
|
@@ -3817,6 +3817,13 @@ import clsx from "clsx";
|
|
3817
3817
|
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo7, useState as useState5 } from "react";
|
3818
3818
|
import { useFetcher } from "react-router";
|
3819
3819
|
|
3820
|
+
// src/components/RebuyLink/RebuyLink.tsx
|
3821
|
+
import { Link } from "react-router";
|
3822
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
3823
|
+
var RebuyLink = ({ ariaLabel, children, className, handle, onClick, role = "link" }) => {
|
3824
|
+
return /* @__PURE__ */ jsx9(Link, { "aria-label": ariaLabel, className, onClick, rel: "nofollow", role, to: handle, children });
|
3825
|
+
};
|
3826
|
+
|
3820
3827
|
// src/smart-cart/hooks/useCartItemFeatures.ts
|
3821
3828
|
import { useCallback as useCallback3, useMemo as useMemo6, useState as useState4 } from "react";
|
3822
3829
|
|
@@ -4235,8 +4242,8 @@ var result2 = { "rebuy-cart-item": "CartItem_rebuy-cart-item", "rebuy-cart-item_
|
|
4235
4242
|
var CartItem_default = result2;
|
4236
4243
|
|
4237
4244
|
// src/smart-cart/components/CartItem/CartItem.tsx
|
4238
|
-
import { Fragment as Fragment3, jsx as
|
4239
|
-
var Spinner = ({ className }) => /* @__PURE__ */
|
4245
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
4246
|
+
var Spinner = ({ className }) => /* @__PURE__ */ jsx10("span", { className: clsx(CartItem_default["rebuy-cart-item__spinner"], className) });
|
4240
4247
|
var CartItem = ({ line }) => {
|
4241
4248
|
const { config, isCartBusy, isHydrogenReact, removeItem, updateItem } = useSmartCart();
|
4242
4249
|
const itemFetcher = useFetcher();
|
@@ -4246,6 +4253,7 @@ var CartItem = ({ line }) => {
|
|
4246
4253
|
const [isAdjustingBMSM, setIsAdjustingBMSM] = useState5(false);
|
4247
4254
|
const [isSwitchingSubscription, setIsSwitchingSubscription] = useState5(false);
|
4248
4255
|
const [switchingDirection, setSwitchingDirection] = useState5(null);
|
4256
|
+
const { toggleCart } = useSmartCart();
|
4249
4257
|
const {
|
4250
4258
|
actions: itemActionsLogic,
|
4251
4259
|
bmsm,
|
@@ -4473,21 +4481,34 @@ var CartItem = ({ line }) => {
|
|
4473
4481
|
"data-line-id": line.id,
|
4474
4482
|
"data-variant-id": line.merchandise.id,
|
4475
4483
|
children: [
|
4476
|
-
/* @__PURE__ */
|
4484
|
+
/* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__media"], children: /* @__PURE__ */ jsx10(
|
4485
|
+
RebuyLink,
|
4486
|
+
{
|
4487
|
+
ariaLabel: meta.linkLabel,
|
4488
|
+
handle: meta.itemUrl,
|
4489
|
+
onClick: () => {
|
4490
|
+
toggleCart();
|
4491
|
+
},
|
4492
|
+
children: /* @__PURE__ */ jsx10("img", { alt: meta.imageAltText, height: 120, loading: "lazy", src: meta.imageUrl, width: 120 })
|
4493
|
+
}
|
4494
|
+
) }),
|
4477
4495
|
/* @__PURE__ */ jsxs5("div", { className: CartItem_default["rebuy-cart-item__info"], children: [
|
4478
|
-
/* @__PURE__ */
|
4479
|
-
|
4496
|
+
/* @__PURE__ */ jsx10(
|
4497
|
+
RebuyLink,
|
4480
4498
|
{
|
4481
|
-
|
4499
|
+
ariaLabel: meta.linkLabel,
|
4482
4500
|
className: CartItem_default["rebuy-cart-item__product-title"],
|
4483
|
-
|
4501
|
+
handle: meta.itemUrl,
|
4502
|
+
onClick: () => {
|
4503
|
+
toggleCart();
|
4504
|
+
},
|
4484
4505
|
role: "heading",
|
4485
4506
|
children: meta.productTitle
|
4486
4507
|
}
|
4487
4508
|
),
|
4488
|
-
meta.variantTitle && /* @__PURE__ */
|
4509
|
+
meta.variantTitle && /* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__variant-title"], children: meta.variantTitle }),
|
4489
4510
|
properties.hasVisibleProperties && /* @__PURE__ */ jsxs5("div", { className: CartItem_default["rebuy-cart-item__properties-list"], children: [
|
4490
|
-
properties.deliveryFrequency && /* @__PURE__ */
|
4511
|
+
properties.deliveryFrequency && /* @__PURE__ */ jsx10(
|
4491
4512
|
"div",
|
4492
4513
|
{
|
4493
4514
|
className: clsx(
|
@@ -4497,7 +4518,7 @@ var CartItem = ({ line }) => {
|
|
4497
4518
|
children: properties.deliveryFrequency
|
4498
4519
|
}
|
4499
4520
|
),
|
4500
|
-
properties.visibleProperties.map((prop, index) => /* @__PURE__ */
|
4521
|
+
properties.visibleProperties.map((prop, index) => /* @__PURE__ */ jsx10(
|
4501
4522
|
"div",
|
4502
4523
|
{
|
4503
4524
|
className: clsx(
|
@@ -4506,15 +4527,15 @@ var CartItem = ({ line }) => {
|
|
4506
4527
|
getItemPropertyValueClass(prop)
|
4507
4528
|
),
|
4508
4529
|
children: prop.key !== "_Discount" ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
4509
|
-
/* @__PURE__ */
|
4510
|
-
/* @__PURE__ */
|
4511
|
-
/* @__PURE__ */
|
4512
|
-
] }) : /* @__PURE__ */
|
4530
|
+
/* @__PURE__ */ jsx10("span", { className: CartItem_default["rebuy-cart-item__property-key"], children: prop.key }),
|
4531
|
+
/* @__PURE__ */ jsx10("span", { className: CartItem_default["rebuy-cart-item__property-separator"], children: ": " }),
|
4532
|
+
/* @__PURE__ */ jsx10("span", { className: CartItem_default["rebuy-cart-item__property-value"], children: prop.value })
|
4533
|
+
] }) : /* @__PURE__ */ jsx10("span", { className: CartItem_default["rebuy-cart-item__property-value"], children: prop.value })
|
4513
4534
|
},
|
4514
4535
|
`${line.id}-prop-${index}`
|
4515
4536
|
))
|
4516
4537
|
] }),
|
4517
|
-
/* @__PURE__ */
|
4538
|
+
/* @__PURE__ */ jsx10(
|
4518
4539
|
"button",
|
4519
4540
|
{
|
4520
4541
|
"aria-label": `Remove ${meta.productTitle}`,
|
@@ -4522,11 +4543,11 @@ var CartItem = ({ line }) => {
|
|
4522
4543
|
disabled: isLoadingCombined,
|
4523
4544
|
onClick: handleRemoveItem,
|
4524
4545
|
type: "button",
|
4525
|
-
children: isRemoving ? /* @__PURE__ */
|
4546
|
+
children: isRemoving ? /* @__PURE__ */ jsx10(Spinner, {}) : "\u2715"
|
4526
4547
|
}
|
4527
4548
|
),
|
4528
|
-
!shouldHideQuantitySelector && /* @__PURE__ */
|
4529
|
-
/* @__PURE__ */
|
4549
|
+
!shouldHideQuantitySelector && /* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__quantity-selector-area"], children: /* @__PURE__ */ jsxs5("div", { className: CartItem_default["rebuy-cart-item__quantity-selector"], children: [
|
4550
|
+
/* @__PURE__ */ jsx10(
|
4530
4551
|
"button",
|
4531
4552
|
{
|
4532
4553
|
"aria-label": `Decrease quantity of ${meta.productTitle}`,
|
@@ -4534,7 +4555,7 @@ var CartItem = ({ line }) => {
|
|
4534
4555
|
disabled: isLoadingCombined,
|
4535
4556
|
onClick: handleDecreaseQuantity,
|
4536
4557
|
type: "button",
|
4537
|
-
children: isDecreasing ? /* @__PURE__ */
|
4558
|
+
children: isDecreasing ? /* @__PURE__ */ jsx10(Spinner, {}) : "-"
|
4538
4559
|
}
|
4539
4560
|
),
|
4540
4561
|
/* @__PURE__ */ jsxs5("span", { "aria-live": "polite", className: CartItem_default["rebuy-cart-item__quantity-selector-label"], children: [
|
@@ -4544,7 +4565,7 @@ var CartItem = ({ line }) => {
|
|
4544
4565
|
] }),
|
4545
4566
|
line.quantity
|
4546
4567
|
] }),
|
4547
|
-
/* @__PURE__ */
|
4568
|
+
/* @__PURE__ */ jsx10(
|
4548
4569
|
"button",
|
4549
4570
|
{
|
4550
4571
|
"aria-label": `Increase quantity of ${meta.productTitle}`,
|
@@ -4552,11 +4573,11 @@ var CartItem = ({ line }) => {
|
|
4552
4573
|
disabled: isLoadingCombined,
|
4553
4574
|
onClick: handleIncreaseQuantity,
|
4554
4575
|
type: "button",
|
4555
|
-
children: isIncreasing ? /* @__PURE__ */
|
4576
|
+
children: isIncreasing ? /* @__PURE__ */ jsx10(Spinner, {}) : "+"
|
4556
4577
|
}
|
4557
4578
|
)
|
4558
4579
|
] }) }),
|
4559
|
-
/* @__PURE__ */
|
4580
|
+
/* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__price-details"], children: pricing.hasDiscount && pricing.compareAtDisplayPrice ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
4560
4581
|
/* @__PURE__ */ jsxs5(
|
4561
4582
|
"span",
|
4562
4583
|
{
|
@@ -4566,7 +4587,7 @@ var CartItem = ({ line }) => {
|
|
4566
4587
|
CartItem_default["rebuy-cart-item__money--sale"]
|
4567
4588
|
),
|
4568
4589
|
children: [
|
4569
|
-
/* @__PURE__ */
|
4590
|
+
/* @__PURE__ */ jsx10(ScreenReaderText, { children: "Sale price" }),
|
4570
4591
|
pricing.displayPrice
|
4571
4592
|
]
|
4572
4593
|
}
|
@@ -4580,13 +4601,13 @@ var CartItem = ({ line }) => {
|
|
4580
4601
|
CartItem_default["rebuy-cart-item__money--compare-at"]
|
4581
4602
|
),
|
4582
4603
|
children: [
|
4583
|
-
/* @__PURE__ */
|
4604
|
+
/* @__PURE__ */ jsx10(ScreenReaderText, { children: "Original price" }),
|
4584
4605
|
pricing.compareAtDisplayPrice
|
4585
4606
|
]
|
4586
4607
|
}
|
4587
4608
|
)
|
4588
4609
|
] }) : /* @__PURE__ */ jsxs5("span", { "aria-label": "Price", className: CartItem_default["rebuy-cart-item__money"], children: [
|
4589
|
-
/* @__PURE__ */
|
4610
|
+
/* @__PURE__ */ jsx10(ScreenReaderText, { children: "Price" }),
|
4590
4611
|
pricing.displayPrice
|
4591
4612
|
] }) }),
|
4592
4613
|
bundle.isBundleParent && bundle.showToggle && /* @__PURE__ */ jsxs5("div", { className: CartItem_default["rebuy-cart-item__bundle-section"], children: [
|
@@ -4606,11 +4627,11 @@ var CartItem = ({ line }) => {
|
|
4606
4627
|
bundle.itemCount,
|
4607
4628
|
" item",
|
4608
4629
|
bundle.itemCount !== 1 ? "s" : "",
|
4609
|
-
/* @__PURE__ */
|
4630
|
+
/* @__PURE__ */ jsx10("span", { "aria-hidden": "true", className: CartItem_default["rebuy-cart-item__bundle-chev-icon"], children: isBundleExpanded ? "\u25B2" : "\u25BC" })
|
4610
4631
|
]
|
4611
4632
|
}
|
4612
4633
|
),
|
4613
|
-
bundle.itemCount > 0 && isBundleExpanded && /* @__PURE__ */
|
4634
|
+
bundle.itemCount > 0 && isBundleExpanded && /* @__PURE__ */ jsx10(
|
4614
4635
|
"ul",
|
4615
4636
|
{
|
4616
4637
|
className: CartItem_default["rebuy-cart-item__bundle-children-list"],
|
@@ -4629,7 +4650,7 @@ var CartItem = ({ line }) => {
|
|
4629
4650
|
{
|
4630
4651
|
className: CartItem_default["rebuy-cart-item__bundle-child-item"],
|
4631
4652
|
children: [
|
4632
|
-
/* @__PURE__ */
|
4653
|
+
/* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__bundle-child-media-wrapper"], children: /* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__bundle-child-image-wrapper"], children: /* @__PURE__ */ jsx10(
|
4633
4654
|
"img",
|
4634
4655
|
{
|
4635
4656
|
alt: childTitle,
|
@@ -4638,7 +4659,7 @@ var CartItem = ({ line }) => {
|
|
4638
4659
|
src: sizeImage(childImage, "40x40")
|
4639
4660
|
}
|
4640
4661
|
) }) }),
|
4641
|
-
/* @__PURE__ */
|
4662
|
+
/* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__bundle-child-details"], children: /* @__PURE__ */ jsx10("h5", { className: CartItem_default["rebuy-cart-item__bundle-child-title"], children: childTitle }) })
|
4642
4663
|
]
|
4643
4664
|
},
|
4644
4665
|
`${line.id}-bundle-child-${index}`
|
@@ -4649,18 +4670,18 @@ var CartItem = ({ line }) => {
|
|
4649
4670
|
] })
|
4650
4671
|
] }),
|
4651
4672
|
" ",
|
4652
|
-
bmsm.isEnabledAndApplicable && /* @__PURE__ */
|
4673
|
+
bmsm.isEnabledAndApplicable && /* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__bmsm-section"], children: bmsm.isButtonMode ? /* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__bmsm-button-wrapper"], children: bmsm.nextApplicableTiers.map((tier) => /* @__PURE__ */ jsx10(
|
4653
4674
|
"button",
|
4654
4675
|
{
|
4655
4676
|
"aria-label": `${bmsm.getButtonText(tier)} for ${meta.productTitle}`,
|
4656
4677
|
className: CartItem_default["rebuy-cart-item__bmsm-button"],
|
4657
4678
|
disabled: isLoadingCombined,
|
4658
4679
|
onClick: () => handleAdjustBMSMQuantity(tier.quantity ?? 0),
|
4659
|
-
children: /* @__PURE__ */
|
4680
|
+
children: /* @__PURE__ */ jsx10("span", { children: bmsm.getButtonText(tier) })
|
4660
4681
|
},
|
4661
4682
|
`bmsm-${line.id}-${tier.quantity}`
|
4662
|
-
)) }) : /* @__PURE__ */
|
4663
|
-
sts.isEnabledAndApplicable && /* @__PURE__ */
|
4683
|
+
)) }) : /* @__PURE__ */ jsx10("span", { className: CartItem_default["rebuy-cart-item__bmsm-dynamic-message"], children: bmsm.dynamicText }) }),
|
4684
|
+
sts.isEnabledAndApplicable && /* @__PURE__ */ jsx10("div", { className: CartItem_default["rebuy-cart-item__sts-section"], children: !sts.isCurrentlySubscription && sts.availableFrequencies.length > 0 ? /* @__PURE__ */ jsx10(
|
4664
4685
|
"button",
|
4665
4686
|
{
|
4666
4687
|
"aria-label": `Switch ${meta.productTitle} to a Subscription`,
|
@@ -4668,9 +4689,9 @@ var CartItem = ({ line }) => {
|
|
4668
4689
|
disabled: isLoadingCombined,
|
4669
4690
|
onClick: handleUpgradeToSubscriptionClick,
|
4670
4691
|
type: "button",
|
4671
|
-
children: isSwitchingSubscription && switchingDirection === "upgrading" ? /* @__PURE__ */
|
4692
|
+
children: isSwitchingSubscription && switchingDirection === "upgrading" ? /* @__PURE__ */ jsx10(Spinner, {}) : /* @__PURE__ */ jsx10("span", { children: sts.getUpgradeButtonLabel() })
|
4672
4693
|
}
|
4673
|
-
) : sts.isCurrentlySubscription || sts.canDowngrade ? /* @__PURE__ */
|
4694
|
+
) : sts.isCurrentlySubscription || sts.canDowngrade ? /* @__PURE__ */ jsx10(Fragment3, { children: isSwitchingSubscription ? /* @__PURE__ */ jsx10("span", { className: CartItem_default["rebuy-cart-item__sts-loading-replacement"], children: sts.getLoadingLabel(switchingDirection) }) : /* @__PURE__ */ jsxs5(
|
4674
4695
|
"select",
|
4675
4696
|
{
|
4676
4697
|
"aria-label": `Subscription delivery frequency for ${meta.productTitle}`,
|
@@ -4679,8 +4700,8 @@ var CartItem = ({ line }) => {
|
|
4679
4700
|
onChange: handleSwitchSubscriptionChange,
|
4680
4701
|
value: selectValue,
|
4681
4702
|
children: [
|
4682
|
-
sts.canDowngrade && /* @__PURE__ */
|
4683
|
-
sts.availableFrequencies.length > 0 && /* @__PURE__ */
|
4703
|
+
sts.canDowngrade && /* @__PURE__ */ jsx10("optgroup", { label: sts.getOneTimeGroupLabel(), children: /* @__PURE__ */ jsx10("option", { value: "onetime", children: sts.getOneTimeLabel() }) }),
|
4704
|
+
sts.availableFrequencies.length > 0 && /* @__PURE__ */ jsx10("optgroup", { label: sts.getGroupLabel(), children: sts.availableFrequencies.map((freq) => /* @__PURE__ */ jsx10("option", { value: freq.id, children: sts.getOptionLabel(freq.id) }, freq.id)) })
|
4684
4705
|
]
|
4685
4706
|
}
|
4686
4707
|
) }) : null })
|
@@ -4694,11 +4715,11 @@ var result3 = { "rebuy-empty-cart-message": "EmptyCart_rebuy-empty-cart-message"
|
|
4694
4715
|
var EmptyCart_default = result3;
|
4695
4716
|
|
4696
4717
|
// src/smart-cart/components/EmptyCart/EmptyCart.tsx
|
4697
|
-
import { jsx as
|
4718
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
4698
4719
|
var EmptyCart = () => {
|
4699
4720
|
const { config } = useSmartCart();
|
4700
4721
|
const emptyCartMarkup = config?.empty_cart_markup || "<p>Your cart is empty.</p>";
|
4701
|
-
return /* @__PURE__ */
|
4722
|
+
return /* @__PURE__ */ jsx11("div", { className: EmptyCart_default["rebuy-empty-cart-message"], dangerouslySetInnerHTML: { __html: emptyCartMarkup } });
|
4702
4723
|
};
|
4703
4724
|
|
4704
4725
|
// src/smart-cart/components/CartItemList/CartItemList.module.css
|
@@ -4706,7 +4727,7 @@ var result4 = { "rebuy-cart-item-list__container": "CartItemList_rebuy-cart-item
|
|
4706
4727
|
var CartItemList_default = result4;
|
4707
4728
|
|
4708
4729
|
// src/smart-cart/components/CartItemList/CartItemList.tsx
|
4709
|
-
import { jsx as
|
4730
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
4710
4731
|
var CartItemList = ({ componentConfig }) => {
|
4711
4732
|
const { cartData, isLoading: isCartLoading, isProgressBarLineItemMode } = useSmartCart();
|
4712
4733
|
const lines = cartData?.lines?.nodes ?? [];
|
@@ -4717,13 +4738,13 @@ var CartItemList = ({ componentConfig }) => {
|
|
4717
4738
|
return true;
|
4718
4739
|
});
|
4719
4740
|
const hasVisibleItems = visibleLines.length > 0;
|
4720
|
-
return /* @__PURE__ */
|
4741
|
+
return /* @__PURE__ */ jsx12(
|
4721
4742
|
"div",
|
4722
4743
|
{
|
4723
4744
|
className: CartItemList_default["rebuy-cart-item-list__container"],
|
4724
4745
|
"data-rebuy-component": "cart-items",
|
4725
4746
|
"data-rebuy-component-id": componentConfig.component_id,
|
4726
|
-
children: hasVisibleItems ? /* @__PURE__ */
|
4747
|
+
children: hasVisibleItems ? /* @__PURE__ */ jsx12("ul", { className: CartItemList_default["rebuy-cart-item-list"], "data-smartcart-items": "", role: "group", tabIndex: 0, children: visibleLines.map((line) => /* @__PURE__ */ jsx12(CartItem, { line }, line.id)) }) : !isCartLoading && /* @__PURE__ */ jsx12(EmptyCart, {})
|
4727
4748
|
}
|
4728
4749
|
);
|
4729
4750
|
};
|
@@ -4738,7 +4759,7 @@ var result5 = { "rebuy-cart-note-input": "CartNoteInput_rebuy-cart-note-input",
|
|
4738
4759
|
var CartNoteInput_default = result5;
|
4739
4760
|
|
4740
4761
|
// src/smart-cart/components/CartNoteInput/CartNoteInput.tsx
|
4741
|
-
import { jsx as
|
4762
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
4742
4763
|
var CartNoteInput = React2.memo(({ componentConfig }) => {
|
4743
4764
|
const {
|
4744
4765
|
cartData,
|
@@ -4907,7 +4928,7 @@ var CartNoteInput = React2.memo(({ componentConfig }) => {
|
|
4907
4928
|
"data-rebuy-component-id": componentConfig.component_id ?? "notes",
|
4908
4929
|
children: [
|
4909
4930
|
/* @__PURE__ */ jsxs6("label", { className: CartNoteInput_default["rebuy-cart-note-input__toggle-control"], children: [
|
4910
|
-
/* @__PURE__ */
|
4931
|
+
/* @__PURE__ */ jsx13(
|
4911
4932
|
"input",
|
4912
4933
|
{
|
4913
4934
|
checked: isTextareaVisible,
|
@@ -4917,7 +4938,7 @@ var CartNoteInput = React2.memo(({ componentConfig }) => {
|
|
4917
4938
|
type: "checkbox"
|
4918
4939
|
}
|
4919
4940
|
),
|
4920
|
-
/* @__PURE__ */
|
4941
|
+
/* @__PURE__ */ jsx13(
|
4921
4942
|
"span",
|
4922
4943
|
{
|
4923
4944
|
className: CartNoteInput_default["rebuy-cart-note-input__toggle-label"],
|
@@ -4927,7 +4948,7 @@ var CartNoteInput = React2.memo(({ componentConfig }) => {
|
|
4927
4948
|
] }),
|
4928
4949
|
isTextareaVisible && /* @__PURE__ */ jsxs6("div", { className: CartNoteInput_default["rebuy-cart-note-input__content-area"], children: [
|
4929
4950
|
/* @__PURE__ */ jsxs6("div", { className: CartNoteInput_default["rebuy-cart-note-input__textarea-wrapper"], children: [
|
4930
|
-
/* @__PURE__ */
|
4951
|
+
/* @__PURE__ */ jsx13(
|
4931
4952
|
"textarea",
|
4932
4953
|
{
|
4933
4954
|
"aria-describedby": describedByIds || void 0,
|
@@ -4945,7 +4966,7 @@ var CartNoteInput = React2.memo(({ componentConfig }) => {
|
|
4945
4966
|
value: currentNoteValue
|
4946
4967
|
}
|
4947
4968
|
),
|
4948
|
-
/* @__PURE__ */
|
4969
|
+
/* @__PURE__ */ jsx13(
|
4949
4970
|
"button",
|
4950
4971
|
{
|
4951
4972
|
"aria-label": saveMessage?.text || (isNoteChanged ? "Save note changes" : "Note is up to date"),
|
@@ -4965,7 +4986,7 @@ var CartNoteInput = React2.memo(({ componentConfig }) => {
|
|
4965
4986
|
!isNoteChanged && !saveMessage && CartNoteInput_default["rebuy-cart-note-input__meta-info--hidden"]
|
4966
4987
|
),
|
4967
4988
|
children: [
|
4968
|
-
limitChars && currentNoteValue.length > 0 && remainingChars !== null && /* @__PURE__ */
|
4989
|
+
limitChars && currentNoteValue.length > 0 && remainingChars !== null && /* @__PURE__ */ jsx13(
|
4969
4990
|
"small",
|
4970
4991
|
{
|
4971
4992
|
"aria-live": "polite",
|
@@ -4974,7 +4995,7 @@ var CartNoteInput = React2.memo(({ componentConfig }) => {
|
|
4974
4995
|
children: `You have ${remainingChars} characters remaining.`
|
4975
4996
|
}
|
4976
4997
|
),
|
4977
|
-
/* @__PURE__ */
|
4998
|
+
/* @__PURE__ */ jsx13("small", { className: CartNoteInput_default["rebuy-cart-note-input__help-text"], id: helpTextId, children: "Press Enter to save, Shift+Enter for new line." })
|
4978
4999
|
]
|
4979
5000
|
}
|
4980
5001
|
)
|
@@ -4994,7 +5015,7 @@ var result6 = { "rebuy-cart-subtotal": "CartSubtotal_rebuy-cart-subtotal", "rebu
|
|
4994
5015
|
var CartSubtotal_default = result6;
|
4995
5016
|
|
4996
5017
|
// src/smart-cart/components/CartSubtotal/CartSubtotal.tsx
|
4997
|
-
import { Fragment as Fragment4, jsx as
|
5018
|
+
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
4998
5019
|
var getDiscountAllocationTitle = (alloc) => {
|
4999
5020
|
switch (alloc.__typename) {
|
5000
5021
|
case "CartCodeDiscountAllocation":
|
@@ -5110,19 +5131,19 @@ var CartSubtotalComponent = ({ componentConfig }) => {
|
|
5110
5131
|
"data-rebuy-component-id": componentConfig.component_id,
|
5111
5132
|
children: [
|
5112
5133
|
/* @__PURE__ */ jsxs7("div", { className: CartSubtotal_default["rebuy-cart-subtotal__row"], children: [
|
5113
|
-
/* @__PURE__ */
|
5134
|
+
/* @__PURE__ */ jsx14("div", { className: CartSubtotal_default["rebuy-cart-subtotal__label"], children: /* @__PURE__ */ jsx14("span", { children: subtotalLabel }) }),
|
5114
5135
|
/* @__PURE__ */ jsxs7("div", { className: CartSubtotal_default["rebuy-cart-subtotal__amount-wrapper"], children: [
|
5115
|
-
/* @__PURE__ */
|
5136
|
+
/* @__PURE__ */ jsx14(ScreenReaderText, { children: "Cart subtotal" }),
|
5116
5137
|
compareAtPrice ? /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
5117
5138
|
/* @__PURE__ */ jsxs7("span", { className: CartSubtotal_default["rebuy-cart-subtotal__price--final"], children: [
|
5118
|
-
/* @__PURE__ */
|
5119
|
-
/* @__PURE__ */
|
5139
|
+
/* @__PURE__ */ jsx14(ScreenReaderText, { children: "Final price" }),
|
5140
|
+
/* @__PURE__ */ jsx14("span", { children: primaryPrice })
|
5120
5141
|
] }),
|
5121
5142
|
/* @__PURE__ */ jsxs7("span", { className: CartSubtotal_default["rebuy-cart-subtotal__price--compare-at"], children: [
|
5122
|
-
/* @__PURE__ */
|
5123
|
-
/* @__PURE__ */
|
5143
|
+
/* @__PURE__ */ jsx14(ScreenReaderText, { children: "Original price" }),
|
5144
|
+
/* @__PURE__ */ jsx14("span", { children: compareAtPrice })
|
5124
5145
|
] })
|
5125
|
-
] }) : /* @__PURE__ */
|
5146
|
+
] }) : /* @__PURE__ */ jsx14("span", { children: primaryPrice })
|
5126
5147
|
] })
|
5127
5148
|
] }),
|
5128
5149
|
shouldShowDiscountSummary && /* @__PURE__ */ jsxs7(
|
@@ -5140,15 +5161,15 @@ var CartSubtotalComponent = ({ componentConfig }) => {
|
|
5140
5161
|
className: CartSubtotal_default["rebuy-cart-subtotal__discount-summary-header"],
|
5141
5162
|
onClick: toggleDiscountSummary,
|
5142
5163
|
children: [
|
5143
|
-
/* @__PURE__ */
|
5164
|
+
/* @__PURE__ */ jsx14("span", { children: discountSummaryCountLabel }),
|
5144
5165
|
/* @__PURE__ */ jsxs7("span", { "aria-hidden": "true", className: CartSubtotal_default["rebuy-cart-subtotal__discount-summary-icon"], children: [
|
5145
|
-
/* @__PURE__ */
|
5166
|
+
/* @__PURE__ */ jsx14("i", { children: "\u25BC" }),
|
5146
5167
|
" "
|
5147
5168
|
] })
|
5148
5169
|
]
|
5149
5170
|
}
|
5150
5171
|
),
|
5151
|
-
/* @__PURE__ */
|
5172
|
+
/* @__PURE__ */ jsx14(
|
5152
5173
|
"div",
|
5153
5174
|
{
|
5154
5175
|
"aria-hidden": !isDiscountSummaryExpanded,
|
@@ -5156,8 +5177,8 @@ var CartSubtotalComponent = ({ componentConfig }) => {
|
|
5156
5177
|
id: summaryId,
|
5157
5178
|
role: "region",
|
5158
5179
|
children: groupedCartLevelDiscounts.map((discount, index) => /* @__PURE__ */ jsxs7("div", { className: CartSubtotal_default["rebuy-cart-subtotal__discount-summary-item"], children: [
|
5159
|
-
/* @__PURE__ */
|
5160
|
-
/* @__PURE__ */
|
5180
|
+
/* @__PURE__ */ jsx14("span", { children: discount.title }),
|
5181
|
+
/* @__PURE__ */ jsx14("span", { children: discount.amount })
|
5161
5182
|
] }, index))
|
5162
5183
|
}
|
5163
5184
|
)
|
@@ -5180,7 +5201,7 @@ var result7 = { "rebuy-cart-title-bar": "CartTitleBar_rebuy-cart-title-bar" };
|
|
5180
5201
|
var CartTitleBar_default = result7;
|
5181
5202
|
|
5182
5203
|
// src/smart-cart/components/CartTitleBar/CartTitleBar.tsx
|
5183
|
-
import { jsx as
|
5204
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
5184
5205
|
var CartTitleBar = React4.memo(() => {
|
5185
5206
|
const { getComponentConfigByType } = useSmartCart();
|
5186
5207
|
const componentConfig = getComponentConfigByType("title_bar");
|
@@ -5194,16 +5215,16 @@ var CartTitleBar = React4.memo(() => {
|
|
5194
5215
|
const DynamicHeadingTag = headingTag;
|
5195
5216
|
if (title === "" && !screenReaderOnly) return null;
|
5196
5217
|
if (screenReaderOnly) {
|
5197
|
-
return /* @__PURE__ */
|
5218
|
+
return /* @__PURE__ */ jsx15(
|
5198
5219
|
DynamicHeadingTag,
|
5199
5220
|
{
|
5200
5221
|
"data-rebuy-component-id": componentConfig?.component_id ?? "title_bar",
|
5201
5222
|
id: "rebuy-cart-title",
|
5202
|
-
children: /* @__PURE__ */
|
5223
|
+
children: /* @__PURE__ */ jsx15(ScreenReaderText, { children: sanitizedTitle })
|
5203
5224
|
}
|
5204
5225
|
);
|
5205
5226
|
}
|
5206
|
-
return /* @__PURE__ */
|
5227
|
+
return /* @__PURE__ */ jsx15(
|
5207
5228
|
DynamicHeadingTag,
|
5208
5229
|
{
|
5209
5230
|
className: CartTitleBar_default["rebuy-cart-title-bar"],
|
@@ -5225,7 +5246,7 @@ var result8 = { "rebuy-checkout-area": "CheckoutArea_rebuy-checkout-area", "rebu
|
|
5225
5246
|
var CheckoutArea_default = result8;
|
5226
5247
|
|
5227
5248
|
// src/smart-cart/components/CheckoutArea/CheckoutArea.tsx
|
5228
|
-
import { jsx as
|
5249
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
5229
5250
|
var CheckoutArea = React5.memo(({ componentConfig }) => {
|
5230
5251
|
const {
|
5231
5252
|
cartData,
|
@@ -5441,7 +5462,7 @@ var CheckoutArea = React5.memo(({ componentConfig }) => {
|
|
5441
5462
|
"data-rebuy-component-id": componentConfig.component_id,
|
5442
5463
|
children: [
|
5443
5464
|
hasTermsEnabled && /* @__PURE__ */ jsxs8("div", { className: CheckoutArea_default["rebuy-checkout-area__terms"], children: [
|
5444
|
-
/* @__PURE__ */
|
5465
|
+
/* @__PURE__ */ jsx16(
|
5445
5466
|
"input",
|
5446
5467
|
{
|
5447
5468
|
checked: termsAccepted,
|
@@ -5453,7 +5474,7 @@ var CheckoutArea = React5.memo(({ componentConfig }) => {
|
|
5453
5474
|
type: "checkbox"
|
5454
5475
|
}
|
5455
5476
|
),
|
5456
|
-
/* @__PURE__ */
|
5477
|
+
/* @__PURE__ */ jsx16(
|
5457
5478
|
"label",
|
5458
5479
|
{
|
5459
5480
|
className: CheckoutArea_default["rebuy-checkout-area__terms-label"],
|
@@ -5462,34 +5483,34 @@ var CheckoutArea = React5.memo(({ componentConfig }) => {
|
|
5462
5483
|
}
|
5463
5484
|
)
|
5464
5485
|
] }),
|
5465
|
-
hasCheckoutButton && /* @__PURE__ */
|
5486
|
+
hasCheckoutButton && /* @__PURE__ */ jsx16(
|
5466
5487
|
"button",
|
5467
5488
|
{
|
5468
5489
|
className: CheckoutArea_default["rebuy-checkout-area__checkout-button"],
|
5469
5490
|
disabled: isCheckoutDisabled,
|
5470
5491
|
onClick: handleCheckoutClick,
|
5471
5492
|
type: "button",
|
5472
|
-
children: /* @__PURE__ */
|
5493
|
+
children: /* @__PURE__ */ jsx16("span", { dangerouslySetInnerHTML: { __html: checkoutLabel } })
|
5473
5494
|
}
|
5474
5495
|
),
|
5475
|
-
hasViewCartButton && /* @__PURE__ */
|
5496
|
+
hasViewCartButton && /* @__PURE__ */ jsx16(
|
5476
5497
|
"button",
|
5477
5498
|
{
|
5478
5499
|
className: CheckoutArea_default["rebuy-checkout-area__view-cart-button"],
|
5479
5500
|
disabled: isAnyCriticalActionProcessing && processingSource !== "terms",
|
5480
5501
|
onClick: handleViewCartClick,
|
5481
5502
|
type: "button",
|
5482
|
-
children: /* @__PURE__ */
|
5503
|
+
children: /* @__PURE__ */ jsx16("span", { dangerouslySetInnerHTML: { __html: viewCartLabel } })
|
5483
5504
|
}
|
5484
5505
|
),
|
5485
|
-
hasContinueShoppingButton && /* @__PURE__ */
|
5506
|
+
hasContinueShoppingButton && /* @__PURE__ */ jsx16(
|
5486
5507
|
"button",
|
5487
5508
|
{
|
5488
5509
|
className: CheckoutArea_default["rebuy-checkout-area__continue-shopping-button"],
|
5489
5510
|
disabled: isAnyCriticalActionProcessing && processingSource !== "terms",
|
5490
5511
|
onClick: handleContinueShoppingClick,
|
5491
5512
|
type: "button",
|
5492
|
-
children: /* @__PURE__ */
|
5513
|
+
children: /* @__PURE__ */ jsx16(
|
5493
5514
|
"span",
|
5494
5515
|
{
|
5495
5516
|
dangerouslySetInnerHTML: {
|
@@ -5499,7 +5520,7 @@ var CheckoutArea = React5.memo(({ componentConfig }) => {
|
|
5499
5520
|
)
|
5500
5521
|
}
|
5501
5522
|
),
|
5502
|
-
hasShopPayButton && /* @__PURE__ */
|
5523
|
+
hasShopPayButton && /* @__PURE__ */ jsx16(
|
5503
5524
|
"button",
|
5504
5525
|
{
|
5505
5526
|
"aria-label": "Checkout with Shop Pay",
|
@@ -5509,7 +5530,7 @@ var CheckoutArea = React5.memo(({ componentConfig }) => {
|
|
5509
5530
|
onClick: handleShopPayClick
|
5510
5531
|
}
|
5511
5532
|
),
|
5512
|
-
hasInstallments && installmentsMessage && hasItems && /* @__PURE__ */
|
5533
|
+
hasInstallments && installmentsMessage && hasItems && /* @__PURE__ */ jsx16(
|
5513
5534
|
"div",
|
5514
5535
|
{
|
5515
5536
|
className: CheckoutArea_default["rebuy-checkout-area__installments-message"],
|
@@ -5518,7 +5539,7 @@ var CheckoutArea = React5.memo(({ componentConfig }) => {
|
|
5518
5539
|
}
|
5519
5540
|
}
|
5520
5541
|
),
|
5521
|
-
hasPrePurchase && hasItems && /* @__PURE__ */
|
5542
|
+
hasPrePurchase && hasItems && /* @__PURE__ */ jsx16("div", { "data-rebuy-id": settings.pre_purchase.widget_id })
|
5522
5543
|
]
|
5523
5544
|
}
|
5524
5545
|
);
|
@@ -5532,9 +5553,9 @@ import { flattenConnection as flattenConnection3 } from "@shopify/hydrogen";
|
|
5532
5553
|
import { useContext as useContext3, useEffect as useEffect13, useMemo as useMemo13, useRef as useRef7, useState as useState15 } from "react";
|
5533
5554
|
|
5534
5555
|
// src/assets/Close.tsx
|
5535
|
-
import { jsx as
|
5556
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
5536
5557
|
var Close = () => {
|
5537
|
-
return /* @__PURE__ */
|
5558
|
+
return /* @__PURE__ */ jsx17("svg", { height: "1em", viewBox: "0 0 352 512", width: "1em", children: /* @__PURE__ */ jsx17("path", { d: "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.19 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.19 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" }) });
|
5538
5559
|
};
|
5539
5560
|
|
5540
5561
|
// src/hooks/useBreakpoint.ts
|
@@ -6043,7 +6064,6 @@ var defaultProductCardSettings = {
|
|
6043
6064
|
// src/components/ProductCard/ProductCard.tsx
|
6044
6065
|
import { Image } from "@shopify/hydrogen";
|
6045
6066
|
import { useCallback as useCallback9, useMemo as useMemo12, useState as useState12 } from "react";
|
6046
|
-
import { Link } from "react-router";
|
6047
6067
|
|
6048
6068
|
// src/components/AddToCartBtn/HydrogenAddToCartBtn.tsx
|
6049
6069
|
import { CartForm, Money } from "@shopify/hydrogen";
|
@@ -6053,7 +6073,7 @@ var result9 = { "rebuy-cart-button": "AddToCartBtn_rebuy-cart-button", "rebuy-ca
|
|
6053
6073
|
var AddToCartBtn_default = result9;
|
6054
6074
|
|
6055
6075
|
// src/components/AddToCartBtn/HydrogenAddToCartBtn.tsx
|
6056
|
-
import { Fragment as Fragment5, jsx as
|
6076
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
6057
6077
|
var HydrogenAddToCartBtn = ({
|
6058
6078
|
addToCartBtnText,
|
6059
6079
|
addToCartCallback,
|
@@ -6075,7 +6095,7 @@ var HydrogenAddToCartBtn = ({
|
|
6075
6095
|
addToCartCallback();
|
6076
6096
|
}
|
6077
6097
|
};
|
6078
|
-
return /* @__PURE__ */
|
6098
|
+
return /* @__PURE__ */ jsx18("div", { className: AddToCartBtn_default["rebuy-cart-button__container"], children: /* @__PURE__ */ jsx18(
|
6079
6099
|
CartForm,
|
6080
6100
|
{
|
6081
6101
|
action: CartForm.ACTIONS.LinesAdd,
|
@@ -6083,7 +6103,7 @@ var HydrogenAddToCartBtn = ({
|
|
6083
6103
|
lines: linesToAdd
|
6084
6104
|
},
|
6085
6105
|
route: "/cart",
|
6086
|
-
children: (fetcher) => /* @__PURE__ */
|
6106
|
+
children: (fetcher) => /* @__PURE__ */ jsx18(Fragment5, { children: /* @__PURE__ */ jsxs9(
|
6087
6107
|
"button",
|
6088
6108
|
{
|
6089
6109
|
className: AddToCartBtn_default["rebuy-cart-button"],
|
@@ -6093,8 +6113,8 @@ var HydrogenAddToCartBtn = ({
|
|
6093
6113
|
children: [
|
6094
6114
|
addToCartBtnText,
|
6095
6115
|
moneyData && /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
6096
|
-
/* @__PURE__ */
|
6097
|
-
/* @__PURE__ */
|
6116
|
+
/* @__PURE__ */ jsx18("span", { children: " | " }),
|
6117
|
+
/* @__PURE__ */ jsx18(Money, { data: moneyData, withoutTrailingZeros: true })
|
6098
6118
|
] })
|
6099
6119
|
]
|
6100
6120
|
}
|
@@ -6105,7 +6125,7 @@ var HydrogenAddToCartBtn = ({
|
|
6105
6125
|
|
6106
6126
|
// src/components/AddToCartBtn/HydrogenReactAddToCartBtn.tsx
|
6107
6127
|
import { Money as Money2, useCart as useCart2 } from "@shopify/hydrogen-react";
|
6108
|
-
import { Fragment as Fragment6, jsx as
|
6128
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
6109
6129
|
var HydrogenReactAddToCartBtn = ({
|
6110
6130
|
addToCartBtnText,
|
6111
6131
|
addToCartCallback,
|
@@ -6131,14 +6151,14 @@ var HydrogenReactAddToCartBtn = ({
|
|
6131
6151
|
return /* @__PURE__ */ jsxs10("button", { className: AddToCartBtn_default["rebuy-cart-button"], disabled, onClick: handleAddToCart, type: "button", children: [
|
6132
6152
|
addToCartBtnText,
|
6133
6153
|
moneyData && /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
6134
|
-
/* @__PURE__ */
|
6135
|
-
/* @__PURE__ */
|
6154
|
+
/* @__PURE__ */ jsx19("span", { children: " | " }),
|
6155
|
+
/* @__PURE__ */ jsx19(Money2, { data: moneyData, withoutTrailingZeros: true })
|
6136
6156
|
] })
|
6137
6157
|
] });
|
6138
6158
|
};
|
6139
6159
|
|
6140
6160
|
// src/components/AddToCartBtn/AddToCartBtn.tsx
|
6141
|
-
import { jsx as
|
6161
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
6142
6162
|
var AddToCartBtn = ({
|
6143
6163
|
addToCartBtnText,
|
6144
6164
|
addToCartCallback,
|
@@ -6160,7 +6180,7 @@ var AddToCartBtn = ({
|
|
6160
6180
|
selectedVariant: variant
|
6161
6181
|
}));
|
6162
6182
|
if (isHydrogenReact) {
|
6163
|
-
return /* @__PURE__ */
|
6183
|
+
return /* @__PURE__ */ jsx20(
|
6164
6184
|
HydrogenReactAddToCartBtn,
|
6165
6185
|
{
|
6166
6186
|
addToCartBtnText,
|
@@ -6173,7 +6193,7 @@ var AddToCartBtn = ({
|
|
6173
6193
|
}
|
6174
6194
|
);
|
6175
6195
|
}
|
6176
|
-
return /* @__PURE__ */
|
6196
|
+
return /* @__PURE__ */ jsx20(
|
6177
6197
|
HydrogenAddToCartBtn,
|
6178
6198
|
{
|
6179
6199
|
addToCartBtnText,
|
@@ -6196,14 +6216,14 @@ var result10 = { "rebuy-product-price": "ProductPrice_rebuy-product-price", "reb
|
|
6196
6216
|
var ProductPrice_default = result10;
|
6197
6217
|
|
6198
6218
|
// src/components/ProductPrice/ProductPrice.tsx
|
6199
|
-
import { jsx as
|
6219
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
6200
6220
|
var RebuyProductPrice = ({ selectedVariant, settingsDiscount }) => {
|
6201
6221
|
if (!selectedVariant) return null;
|
6202
6222
|
const { compareAtPriceV2: compareAtPrice, priceV2: price } = selectedVariant;
|
6203
6223
|
const isDiscounted = (price2, compareAtPrice2) => Number(compareAtPrice2?.amount) > Number(price2?.amount);
|
6204
6224
|
const currentPriceIsOnSale = compareAtPrice && isDiscounted(price, compareAtPrice);
|
6205
6225
|
const CompareAtPrice = ({ data: compareAtPriceData }) => {
|
6206
|
-
return compareAtPriceData && /* @__PURE__ */
|
6226
|
+
return compareAtPriceData && /* @__PURE__ */ jsx21(
|
6207
6227
|
Money3,
|
6208
6228
|
{
|
6209
6229
|
as: "span",
|
@@ -6214,7 +6234,7 @@ var RebuyProductPrice = ({ selectedVariant, settingsDiscount }) => {
|
|
6214
6234
|
);
|
6215
6235
|
};
|
6216
6236
|
return price && /* @__PURE__ */ jsxs11("div", { className: ProductPrice_default["rebuy-product-price"], children: [
|
6217
|
-
/* @__PURE__ */
|
6237
|
+
/* @__PURE__ */ jsx21(
|
6218
6238
|
Money3,
|
6219
6239
|
{
|
6220
6240
|
as: "span",
|
@@ -6226,7 +6246,7 @@ var RebuyProductPrice = ({ selectedVariant, settingsDiscount }) => {
|
|
6226
6246
|
withoutTrailingZeros: true
|
6227
6247
|
}
|
6228
6248
|
),
|
6229
|
-
currentPriceIsOnSale && /* @__PURE__ */
|
6249
|
+
currentPriceIsOnSale && /* @__PURE__ */ jsx21(CompareAtPrice, { data: compareAtPrice })
|
6230
6250
|
] });
|
6231
6251
|
};
|
6232
6252
|
|
@@ -6238,7 +6258,7 @@ var result11 = { "rebuy-quantity__container": "QuantityInput_rebuy-quantity__con
|
|
6238
6258
|
var QuantityInput_default = result11;
|
6239
6259
|
|
6240
6260
|
// src/components/QuantityInput/QuantityInput.tsx
|
6241
|
-
import { jsx as
|
6261
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
6242
6262
|
var QuantityInput = ({
|
6243
6263
|
defaultQuantity = 1,
|
6244
6264
|
handleSelectedQuantity,
|
@@ -6254,7 +6274,7 @@ var QuantityInput = ({
|
|
6254
6274
|
}
|
6255
6275
|
};
|
6256
6276
|
const quantityOptions = Array.from({ length: maxValue - minValue + 1 }, (_, i) => minValue + i);
|
6257
|
-
return /* @__PURE__ */
|
6277
|
+
return /* @__PURE__ */ jsx22("div", { className: QuantityInput_default["rebuy-quantity__container"], children: /* @__PURE__ */ jsx22(
|
6258
6278
|
"select",
|
6259
6279
|
{
|
6260
6280
|
"aria-label": "Product quantity",
|
@@ -6262,46 +6282,18 @@ var QuantityInput = ({
|
|
6262
6282
|
name: "quantity",
|
6263
6283
|
onChange: handleChange,
|
6264
6284
|
value: quantity,
|
6265
|
-
children: quantityOptions.map((value) => /* @__PURE__ */
|
6285
|
+
children: quantityOptions.map((value) => /* @__PURE__ */ jsx22("option", { value, children: value }, `quantity-${value}`))
|
6266
6286
|
}
|
6267
6287
|
) });
|
6268
6288
|
};
|
6269
6289
|
|
6270
|
-
// src/components/Title/Title.tsx
|
6271
|
-
import clsx5 from "clsx";
|
6272
|
-
|
6273
|
-
// src/components/Title/Title.module.css
|
6274
|
-
var result12 = { "rebuy-title": "Title_rebuy-title" };
|
6275
|
-
var Title_default = result12;
|
6276
|
-
|
6277
|
-
// src/components/Title/Title.tsx
|
6278
|
-
import { jsx as jsx22 } from "react/jsx-runtime";
|
6279
|
-
var Title = ({ className, level, style, text }) => {
|
6280
|
-
const combinedClassName = clsx5(Title_default["rebuy-title"], className);
|
6281
|
-
switch (level) {
|
6282
|
-
case "h1":
|
6283
|
-
return /* @__PURE__ */ jsx22("h1", { className: combinedClassName, style, children: text });
|
6284
|
-
default:
|
6285
|
-
case "h2":
|
6286
|
-
return /* @__PURE__ */ jsx22("h2", { className: combinedClassName, style, children: text });
|
6287
|
-
case "h3":
|
6288
|
-
return /* @__PURE__ */ jsx22("h3", { className: combinedClassName, style, children: text });
|
6289
|
-
case "h4":
|
6290
|
-
return /* @__PURE__ */ jsx22("h4", { className: combinedClassName, style, children: text });
|
6291
|
-
case "h5":
|
6292
|
-
return /* @__PURE__ */ jsx22("h5", { className: combinedClassName, style, children: text });
|
6293
|
-
case "h6":
|
6294
|
-
return /* @__PURE__ */ jsx22("h6", { className: combinedClassName, style, children: text });
|
6295
|
-
}
|
6296
|
-
};
|
6297
|
-
|
6298
6290
|
// src/components/VariantSelect/VariantSelect.tsx
|
6299
|
-
import
|
6291
|
+
import clsx5 from "clsx";
|
6300
6292
|
import { useEffect as useEffect10, useState as useState11 } from "react";
|
6301
6293
|
|
6302
6294
|
// src/components/VariantSelect/VariantSelect.module.css
|
6303
|
-
var
|
6304
|
-
var VariantSelect_default =
|
6295
|
+
var result12 = { "rebuy-variant__container": "VariantSelect_rebuy-variant__container", "rebuy-variant__select": "VariantSelect_rebuy-variant__select", "rebuy-variant__select-option": "VariantSelect_rebuy-variant__select-option", "rebuy-variant__buttons": "VariantSelect_rebuy-variant__buttons", "rebuy-variant__button": "VariantSelect_rebuy-variant__button", "rebuy-variant__button--selected": "VariantSelect_rebuy-variant__button--selected" };
|
6296
|
+
var VariantSelect_default = result12;
|
6305
6297
|
|
6306
6298
|
// src/components/VariantSelect/VariantSelect.tsx
|
6307
6299
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
@@ -6340,7 +6332,7 @@ var VariantSelect = ({ handleSelectedVariant, product, selectedId, style = "sele
|
|
6340
6332
|
"button",
|
6341
6333
|
{
|
6342
6334
|
"aria-pressed": id === selectedVariantId,
|
6343
|
-
className:
|
6335
|
+
className: clsx5(
|
6344
6336
|
VariantSelect_default["rebuy-variant__button"],
|
6345
6337
|
id === selectedVariantId && VariantSelect_default["rebuy-variant__button--selected"]
|
6346
6338
|
),
|
@@ -6352,15 +6344,44 @@ var VariantSelect = ({ handleSelectedVariant, product, selectedId, style = "sele
|
|
6352
6344
|
)) }) });
|
6353
6345
|
};
|
6354
6346
|
|
6347
|
+
// src/components/Title/Title.tsx
|
6348
|
+
import clsx6 from "clsx";
|
6349
|
+
|
6350
|
+
// src/components/Title/Title.module.css
|
6351
|
+
var result13 = { "rebuy-title": "Title_rebuy-title" };
|
6352
|
+
var Title_default = result13;
|
6353
|
+
|
6354
|
+
// src/components/Title/Title.tsx
|
6355
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
6356
|
+
var Title = ({ className, level, style, text }) => {
|
6357
|
+
const combinedClassName = clsx6(Title_default["rebuy-title"], className);
|
6358
|
+
switch (level) {
|
6359
|
+
case "h1":
|
6360
|
+
return /* @__PURE__ */ jsx24("h1", { className: combinedClassName, style, children: text });
|
6361
|
+
default:
|
6362
|
+
case "h2":
|
6363
|
+
return /* @__PURE__ */ jsx24("h2", { className: combinedClassName, style, children: text });
|
6364
|
+
case "h3":
|
6365
|
+
return /* @__PURE__ */ jsx24("h3", { className: combinedClassName, style, children: text });
|
6366
|
+
case "h4":
|
6367
|
+
return /* @__PURE__ */ jsx24("h4", { className: combinedClassName, style, children: text });
|
6368
|
+
case "h5":
|
6369
|
+
return /* @__PURE__ */ jsx24("h5", { className: combinedClassName, style, children: text });
|
6370
|
+
case "h6":
|
6371
|
+
return /* @__PURE__ */ jsx24("h6", { className: combinedClassName, style, children: text });
|
6372
|
+
}
|
6373
|
+
};
|
6374
|
+
|
6355
6375
|
// src/components/ProductCard/ProductCard.module.css
|
6356
6376
|
var result14 = { "rebuy-product-card__container": "ProductCard_rebuy-product-card__container", "rebuy-product-card": "ProductCard_rebuy-product-card", "rebuy-product-card__content": "ProductCard_rebuy-product-card__content", "rebuy-product-card__header": "ProductCard_rebuy-product-card__header", "rebuy-product-card__info": "ProductCard_rebuy-product-card__info", "rebuy-product-card__actions": "ProductCard_rebuy-product-card__actions", "rebuy-product-card__media-link": "ProductCard_rebuy-product-card__media-link", "rebuy-product-card__image": "ProductCard_rebuy-product-card__image", "rebuy-product-card__title": "ProductCard_rebuy-product-card__title", "rebuy-product-card__title-link": "ProductCard_rebuy-product-card__title-link", "rebuy-product-card__actions-variant-select": "ProductCard_rebuy-product-card__actions-variant-select", "rebuy-product-card__variant-select": "ProductCard_rebuy-product-card__variant-select", "rebuy-product-card__actions-quantity": "ProductCard_rebuy-product-card__actions-quantity", "rebuy-product-card__actions-button": "ProductCard_rebuy-product-card__actions-button", "rebuy-product-card__vendor": "ProductCard_rebuy-product-card__vendor", "rebuy-product-card__variant-title": "ProductCard_rebuy-product-card__variant-title", "rebuy-product-card__review": "ProductCard_rebuy-product-card__review", "rebuy-product-card__star-rating": "ProductCard_rebuy-product-card__star-rating", "rebuy-product-card__star-rating-value": "ProductCard_rebuy-product-card__star-rating-value", "rebuy-product-card__star-rating-background": "ProductCard_rebuy-product-card__star-rating-background", "rebuy-product-card__star-rating-foreground": "ProductCard_rebuy-product-card__star-rating-foreground", "rebuy-product-card__review-count": "ProductCard_rebuy-product-card__review-count", "rebuy-product-card__review-count-parenthesis": "ProductCard_rebuy-product-card__review-count-parenthesis", "rebuy-product-card__review-count-number": "ProductCard_rebuy-product-card__review-count-number", "rebuy-product-card__review-count-label": "ProductCard_rebuy-product-card__review-count-label", "rebuy-product-card__description": "ProductCard_rebuy-product-card__description" };
|
6357
6377
|
var ProductCard_default = result14;
|
6358
6378
|
|
6359
6379
|
// src/components/ProductCard/ProductCard.tsx
|
6360
|
-
import { jsx as
|
6380
|
+
import { jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
|
6361
6381
|
var ProductCard = ({
|
6362
6382
|
addToCartBtnText,
|
6363
6383
|
addToCartCallback,
|
6384
|
+
isCrossSell,
|
6364
6385
|
isHydrogenReact,
|
6365
6386
|
isInPopup,
|
6366
6387
|
onPopupDismiss,
|
@@ -6372,6 +6393,7 @@ var ProductCard = ({
|
|
6372
6393
|
const [selectedVariant, setSelectedVariant] = useState12(product.variants.nodes[0]);
|
6373
6394
|
const [selectedQuantity, setSelectedQuantity] = useState12(settings?.quantityInput?.default_quantity || 1);
|
6374
6395
|
const [interactionStatus, setInteractionStatus] = useState12("ready");
|
6396
|
+
const { toggleCart } = useSmartCart();
|
6375
6397
|
const displayImage = selectedVariant.image || product.featuredImage;
|
6376
6398
|
const handleSelectedVariant = useCallback9((product2, variant_id) => {
|
6377
6399
|
const updatedVariant = product2.variants.nodes.find((variant) => variant.id === variant_id);
|
@@ -6383,6 +6405,9 @@ var ProductCard = ({
|
|
6383
6405
|
setSelectedQuantity(quantity);
|
6384
6406
|
}, []);
|
6385
6407
|
const handleLinkClick = useCallback9(() => {
|
6408
|
+
if (isCrossSell) {
|
6409
|
+
toggleCart();
|
6410
|
+
}
|
6386
6411
|
if (isInPopup && onPopupDismiss) {
|
6387
6412
|
onPopupDismiss();
|
6388
6413
|
}
|
@@ -6441,38 +6466,90 @@ var ProductCard = ({
|
|
6441
6466
|
const showQuantityInput = settings?.quantityInput?.enabled && settings?.quantityInput?.max_value !== null && settings?.quantityInput?.min_value !== null;
|
6442
6467
|
return /* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card__container"], children: [
|
6443
6468
|
/* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card"], "data-layout": cardLayout, children: [
|
6444
|
-
/* @__PURE__ */
|
6445
|
-
|
6446
|
-
|
6447
|
-
|
6448
|
-
|
6449
|
-
|
6450
|
-
|
6451
|
-
|
6452
|
-
|
6453
|
-
|
6469
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
6470
|
+
/* @__PURE__ */ jsx25(
|
6471
|
+
RebuyLink,
|
6472
|
+
{
|
6473
|
+
ariaLabel: `View ${product.title}`,
|
6474
|
+
className: ProductCard_default["rebuy-product-card__media-link"],
|
6475
|
+
handle: `/products/${product.handle}`,
|
6476
|
+
onClick: handleLinkClick,
|
6477
|
+
children: /* @__PURE__ */ jsx25(
|
6478
|
+
Image,
|
6479
|
+
{
|
6480
|
+
alt: displayImage?.altText ?? `Picture of ${product.title}`,
|
6481
|
+
className: ProductCard_default["rebuy-product-card__image"],
|
6482
|
+
data: displayImage,
|
6483
|
+
sizes: "(max-width: 320px) 280px, (max-width: 768px) 720px, 1440px"
|
6484
|
+
}
|
6485
|
+
)
|
6486
|
+
}
|
6487
|
+
),
|
6488
|
+
settings?.layoutStyle === "grid" && /* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card__content"], children: [
|
6489
|
+
/* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card__header"], children: [
|
6490
|
+
product.vendor && /* @__PURE__ */ jsx25("p", { className: ProductCard_default["rebuy-product-card__vendor"], children: product.vendor }),
|
6491
|
+
/* @__PURE__ */ jsx25(
|
6492
|
+
RebuyLink,
|
6493
|
+
{
|
6494
|
+
ariaLabel: `View ${product.title}`,
|
6495
|
+
className: ProductCard_default["rebuy-product-card__title-link"],
|
6496
|
+
handle: `/products/${product.handle}`,
|
6497
|
+
onClick: handleLinkClick,
|
6498
|
+
children: /* @__PURE__ */ jsx25(
|
6499
|
+
Title,
|
6500
|
+
{
|
6501
|
+
className: ProductCard_default["rebuy-product-card__title"],
|
6502
|
+
level: productCardTitleLevel,
|
6503
|
+
text: product.title
|
6504
|
+
}
|
6505
|
+
)
|
6506
|
+
}
|
6507
|
+
),
|
6508
|
+
showVariantTitle && /* @__PURE__ */ jsx25("div", { className: ProductCard_default["rebuy-product-card__variant-title"], children: selectedVariant.title })
|
6509
|
+
] }),
|
6510
|
+
/* @__PURE__ */ jsx25(
|
6511
|
+
RebuyProductPrice,
|
6454
6512
|
{
|
6455
|
-
|
6456
|
-
|
6457
|
-
data: displayImage,
|
6458
|
-
sizes: "(max-width: 320px) 280px, (max-width: 768px) 720px, 1440px"
|
6513
|
+
selectedVariant,
|
6514
|
+
settingsDiscount: settings?.settingsDiscount
|
6459
6515
|
}
|
6460
|
-
)
|
6461
|
-
|
6462
|
-
|
6516
|
+
),
|
6517
|
+
showReviews && /* @__PURE__ */ jsxs12("div", { "aria-label": "product star rating", className: ProductCard_default["rebuy-product-card__review"], children: [
|
6518
|
+
/* @__PURE__ */ jsxs12("span", { className: ProductCard_default["rebuy-product-card__star-rating"], children: [
|
6519
|
+
productReviewsRating && /* @__PURE__ */ jsxs12("span", { className: ProductCard_default["rebuy-product-card__star-rating-value"], children: [
|
6520
|
+
productReviewsRating,
|
6521
|
+
" stars out of 5 stars"
|
6522
|
+
] }),
|
6523
|
+
/* @__PURE__ */ jsx25("span", { className: ProductCard_default["rebuy-product-card__star-rating-background"] }),
|
6524
|
+
/* @__PURE__ */ jsx25(
|
6525
|
+
"span",
|
6526
|
+
{
|
6527
|
+
className: ProductCard_default["rebuy-product-card__star-rating-foreground"],
|
6528
|
+
style: productReviewsRating ? { width: productReviewsRating / 5 * 100 + "%" } : {}
|
6529
|
+
}
|
6530
|
+
)
|
6531
|
+
] }),
|
6532
|
+
product.reviews?.review_count && /* @__PURE__ */ jsxs12("span", { className: ProductCard_default["rebuy-product-card__review-count"], children: [
|
6533
|
+
"(",
|
6534
|
+
product.reviews.review_count,
|
6535
|
+
")"
|
6536
|
+
] })
|
6537
|
+
] }),
|
6538
|
+
showProductDescription && /* @__PURE__ */ jsx25("div", { className: ProductCard_default["rebuy-product-card__description"], children: /* @__PURE__ */ jsx25("p", { children: product.description }) })
|
6539
|
+
] })
|
6540
|
+
] }),
|
6463
6541
|
/* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card__info"], children: [
|
6464
|
-
/* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card__content"], children: [
|
6542
|
+
settings?.layoutStyle !== "grid" && /* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card__content"], children: [
|
6465
6543
|
/* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card__header"], children: [
|
6466
|
-
product.vendor && /* @__PURE__ */
|
6467
|
-
/* @__PURE__ */
|
6468
|
-
|
6544
|
+
product.vendor && /* @__PURE__ */ jsx25("p", { className: ProductCard_default["rebuy-product-card__vendor"], children: product.vendor }),
|
6545
|
+
/* @__PURE__ */ jsx25(
|
6546
|
+
RebuyLink,
|
6469
6547
|
{
|
6470
|
-
|
6548
|
+
ariaLabel: `View ${product.title}`,
|
6471
6549
|
className: ProductCard_default["rebuy-product-card__title-link"],
|
6550
|
+
handle: `/products/${product.handle}`,
|
6472
6551
|
onClick: handleLinkClick,
|
6473
|
-
|
6474
|
-
to: `/products/${product.handle}`,
|
6475
|
-
children: /* @__PURE__ */ jsx24(
|
6552
|
+
children: /* @__PURE__ */ jsx25(
|
6476
6553
|
Title,
|
6477
6554
|
{
|
6478
6555
|
className: ProductCard_default["rebuy-product-card__title"],
|
@@ -6482,9 +6559,9 @@ var ProductCard = ({
|
|
6482
6559
|
)
|
6483
6560
|
}
|
6484
6561
|
),
|
6485
|
-
showVariantTitle && /* @__PURE__ */
|
6562
|
+
showVariantTitle && /* @__PURE__ */ jsx25("div", { className: ProductCard_default["rebuy-product-card__variant-title"], children: selectedVariant.title })
|
6486
6563
|
] }),
|
6487
|
-
/* @__PURE__ */
|
6564
|
+
/* @__PURE__ */ jsx25(
|
6488
6565
|
RebuyProductPrice,
|
6489
6566
|
{
|
6490
6567
|
selectedVariant,
|
@@ -6497,8 +6574,8 @@ var ProductCard = ({
|
|
6497
6574
|
productReviewsRating,
|
6498
6575
|
" stars out of 5 stars"
|
6499
6576
|
] }),
|
6500
|
-
/* @__PURE__ */
|
6501
|
-
/* @__PURE__ */
|
6577
|
+
/* @__PURE__ */ jsx25("span", { className: ProductCard_default["rebuy-product-card__star-rating-background"] }),
|
6578
|
+
/* @__PURE__ */ jsx25(
|
6502
6579
|
"span",
|
6503
6580
|
{
|
6504
6581
|
className: ProductCard_default["rebuy-product-card__star-rating-foreground"],
|
@@ -6512,15 +6589,15 @@ var ProductCard = ({
|
|
6512
6589
|
")"
|
6513
6590
|
] })
|
6514
6591
|
] }),
|
6515
|
-
showProductDescription && /* @__PURE__ */
|
6592
|
+
showProductDescription && /* @__PURE__ */ jsx25("div", { className: ProductCard_default["rebuy-product-card__description"], children: /* @__PURE__ */ jsx25("p", { children: product.description }) })
|
6516
6593
|
] }),
|
6517
6594
|
/* @__PURE__ */ jsxs12("div", { className: ProductCard_default["rebuy-product-card__actions"], children: [
|
6518
|
-
showVariantSelect && cardLayout !== "line" && /* @__PURE__ */
|
6595
|
+
showVariantSelect && cardLayout !== "line" && /* @__PURE__ */ jsx25(
|
6519
6596
|
"div",
|
6520
6597
|
{
|
6521
6598
|
className: ProductCard_default["rebuy-product-card__actions-variant-select"],
|
6522
6599
|
"data-layout": cardLayout,
|
6523
|
-
children: /* @__PURE__ */
|
6600
|
+
children: /* @__PURE__ */ jsx25(
|
6524
6601
|
VariantSelect,
|
6525
6602
|
{
|
6526
6603
|
handleSelectedVariant,
|
@@ -6531,7 +6608,7 @@ var ProductCard = ({
|
|
6531
6608
|
)
|
6532
6609
|
}
|
6533
6610
|
),
|
6534
|
-
showQuantityInput && /* @__PURE__ */
|
6611
|
+
showQuantityInput && /* @__PURE__ */ jsx25("div", { className: ProductCard_default["rebuy-product-card__actions-quantity"], children: /* @__PURE__ */ jsx25(
|
6535
6612
|
QuantityInput,
|
6536
6613
|
{
|
6537
6614
|
defaultQuantity: settings?.quantityInput?.default_quantity,
|
@@ -6540,7 +6617,7 @@ var ProductCard = ({
|
|
6540
6617
|
minValue: settings?.quantityInput?.min_value
|
6541
6618
|
}
|
6542
6619
|
) }),
|
6543
|
-
/* @__PURE__ */
|
6620
|
+
/* @__PURE__ */ jsx25("div", { className: ProductCard_default["rebuy-product-card__actions-button"], children: /* @__PURE__ */ jsx25(
|
6544
6621
|
AddToCartBtn,
|
6545
6622
|
{
|
6546
6623
|
addToCartBtnText: atcButtonLabel,
|
@@ -6555,7 +6632,7 @@ var ProductCard = ({
|
|
6555
6632
|
] })
|
6556
6633
|
] })
|
6557
6634
|
] }),
|
6558
|
-
showVariantSelect && cardLayout === "line" && /* @__PURE__ */
|
6635
|
+
showVariantSelect && cardLayout === "line" && /* @__PURE__ */ jsx25("div", { className: ProductCard_default["rebuy-product-card__variant-select"], "data-layout": cardLayout, children: /* @__PURE__ */ jsx25(
|
6559
6636
|
VariantSelect,
|
6560
6637
|
{
|
6561
6638
|
handleSelectedVariant,
|
@@ -6575,12 +6652,15 @@ var result15 = { "rebuy-carousel": "ProductCarousel_rebuy-carousel", "rebuy-caro
|
|
6575
6652
|
var ProductCarousel_default = result15;
|
6576
6653
|
|
6577
6654
|
// src/components/ProductCarousel/ProductCarousel.tsx
|
6578
|
-
import { jsx as
|
6655
|
+
import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
6579
6656
|
var ProductCarousel = ({
|
6580
6657
|
addToCartBtnText,
|
6581
6658
|
addToCartCallback,
|
6582
6659
|
columns,
|
6660
|
+
isCrossSell,
|
6583
6661
|
isHydrogenReact,
|
6662
|
+
isInPopup,
|
6663
|
+
onPopupDismiss,
|
6584
6664
|
productCardTitleLevel,
|
6585
6665
|
products,
|
6586
6666
|
settings,
|
@@ -6622,17 +6702,20 @@ var ProductCarousel = ({
|
|
6622
6702
|
slides.push(repeatedProducts.slice(i, i + columns));
|
6623
6703
|
}
|
6624
6704
|
return /* @__PURE__ */ jsxs13("div", { className: ProductCarousel_default["rebuy-carousel"], children: [
|
6625
|
-
/* @__PURE__ */
|
6705
|
+
/* @__PURE__ */ jsx26(
|
6626
6706
|
"div",
|
6627
6707
|
{
|
6628
6708
|
className: ProductCarousel_default["rebuy-carousel__container"],
|
6629
6709
|
style: { transform: `translateX(-${currentSlide * 100}%)` },
|
6630
|
-
children: slides.map((slideProducts, index) => /* @__PURE__ */
|
6710
|
+
children: slides.map((slideProducts, index) => /* @__PURE__ */ jsx26("div", { className: ProductCarousel_default["rebuy-carousel__slide"], children: /* @__PURE__ */ jsx26("div", { className: ProductCarousel_default["rebuy-carousel__grid"], "data-columns": columns, children: slideProducts.map((product, productIndex) => /* @__PURE__ */ jsx26(
|
6631
6711
|
ProductCard,
|
6632
6712
|
{
|
6633
6713
|
addToCartBtnText,
|
6634
6714
|
addToCartCallback,
|
6715
|
+
isCrossSell,
|
6635
6716
|
isHydrogenReact,
|
6717
|
+
isInPopup,
|
6718
|
+
onPopupDismiss,
|
6636
6719
|
product,
|
6637
6720
|
productCardTitleLevel,
|
6638
6721
|
settings,
|
@@ -6643,10 +6726,10 @@ var ProductCarousel = ({
|
|
6643
6726
|
}
|
6644
6727
|
),
|
6645
6728
|
totalSlides > 1 && /* @__PURE__ */ jsxs13("div", { className: ProductCarousel_default["rebuy-carousel__controls"], children: [
|
6646
|
-
/* @__PURE__ */
|
6647
|
-
/* @__PURE__ */
|
6729
|
+
/* @__PURE__ */ jsx26("button", { className: ProductCarousel_default["rebuy-carousel__prev"], onClick: prevSlide, type: "button", children: "\u2190" }),
|
6730
|
+
/* @__PURE__ */ jsx26("button", { className: ProductCarousel_default["rebuy-carousel__next"], onClick: nextSlide, type: "button", children: "\u2192" })
|
6648
6731
|
] }),
|
6649
|
-
showPagination && totalSlides > 1 && /* @__PURE__ */
|
6732
|
+
showPagination && totalSlides > 1 && /* @__PURE__ */ jsx26("div", { className: ProductCarousel_default["rebuy-carousel__pagination"], children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ jsx26(
|
6650
6733
|
"button",
|
6651
6734
|
{
|
6652
6735
|
className: ProductCarousel_default["rebuy-carousel__dot"],
|
@@ -6668,7 +6751,7 @@ var result16 = { "rebuy-timer__container": "Timer_rebuy-timer__container", "rebu
|
|
6668
6751
|
var Timer_default = result16;
|
6669
6752
|
|
6670
6753
|
// src/components/Timer/Timer.tsx
|
6671
|
-
import { jsx as
|
6754
|
+
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
6672
6755
|
var Timer = ({ action, durationMinutes, durationSeconds, isPopup = false, onDismiss, title }) => {
|
6673
6756
|
const initialTotalSeconds = (durationMinutes || 0) * 60 + (durationSeconds || 0);
|
6674
6757
|
const [totalSeconds, setTotalSeconds] = useState14(initialTotalSeconds);
|
@@ -6711,16 +6794,16 @@ var Timer = ({ action, durationMinutes, durationSeconds, isPopup = false, onDism
|
|
6711
6794
|
return () => clearInterval(interval);
|
6712
6795
|
}, [timerActive, handleTimerEnd]);
|
6713
6796
|
const isUrgent = totalSeconds < 10;
|
6714
|
-
return /* @__PURE__ */
|
6715
|
-
/* @__PURE__ */
|
6797
|
+
return /* @__PURE__ */ jsx27("div", { className: Timer_default["rebuy-timer__container"], children: /* @__PURE__ */ jsxs14("p", { className: Timer_default["rebuy-timer__text"], children: [
|
6798
|
+
/* @__PURE__ */ jsx27("span", { className: Timer_default["rebuy-timer__title"], children: title }),
|
6716
6799
|
/* @__PURE__ */ jsxs14(
|
6717
6800
|
"span",
|
6718
6801
|
{
|
6719
6802
|
className: clsx7(Timer_default["rebuy-timer__display"], isUrgent && Timer_default["rebuy-timer__display--urgent"]),
|
6720
6803
|
children: [
|
6721
|
-
/* @__PURE__ */
|
6722
|
-
/* @__PURE__ */
|
6723
|
-
/* @__PURE__ */
|
6804
|
+
/* @__PURE__ */ jsx27("span", { className: Timer_default["rebuy-timer__minutes"], children: formattedMinutes }),
|
6805
|
+
/* @__PURE__ */ jsx27("span", { className: Timer_default["rebuy-timer__separator"], children: ":" }),
|
6806
|
+
/* @__PURE__ */ jsx27("span", { className: Timer_default["rebuy-timer__seconds"], children: formattedSeconds })
|
6724
6807
|
]
|
6725
6808
|
}
|
6726
6809
|
)
|
@@ -6770,12 +6853,13 @@ var result17 = { "rebuy-widget__container": "RebuyWidget_rebuy-widget__container
|
|
6770
6853
|
var RebuyWidget_default = result17;
|
6771
6854
|
|
6772
6855
|
// src/widgets/RebuyWidget/WidgetContent.tsx
|
6773
|
-
import { jsx as
|
6856
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
6774
6857
|
var WidgetContent = ({
|
6775
6858
|
addToCartCallback,
|
6776
6859
|
customTitle,
|
6777
6860
|
customTitleLevel,
|
6778
6861
|
customTitleStyle,
|
6862
|
+
isCrossSell,
|
6779
6863
|
isHydrogenReact,
|
6780
6864
|
isInPopup,
|
6781
6865
|
onDismiss,
|
@@ -6826,13 +6910,16 @@ var WidgetContent = ({
|
|
6826
6910
|
return null;
|
6827
6911
|
}
|
6828
6912
|
if (isCarousel) {
|
6829
|
-
return /* @__PURE__ */
|
6913
|
+
return /* @__PURE__ */ jsx28(
|
6830
6914
|
ProductCarousel,
|
6831
6915
|
{
|
6832
6916
|
addToCartBtnText: settings?.language.add_to_cart,
|
6833
6917
|
addToCartCallback,
|
6834
6918
|
columns,
|
6919
|
+
isCrossSell,
|
6835
6920
|
isHydrogenReact,
|
6921
|
+
isInPopup,
|
6922
|
+
onPopupDismiss: onDismiss,
|
6836
6923
|
productCardTitleLevel,
|
6837
6924
|
products,
|
6838
6925
|
settings: productCardSettings,
|
@@ -6841,11 +6928,12 @@ var WidgetContent = ({
|
|
6841
6928
|
}
|
6842
6929
|
);
|
6843
6930
|
}
|
6844
|
-
return /* @__PURE__ */
|
6931
|
+
return /* @__PURE__ */ jsx28("div", { className: RebuyWidget_default["rebuy-widget__product-grid"], "data-columns": columns, role: "list", tabIndex: 0, children: products.map((product) => /* @__PURE__ */ jsx28("div", { children: /* @__PURE__ */ jsx28(
|
6845
6932
|
ProductCard,
|
6846
6933
|
{
|
6847
6934
|
addToCartBtnText: settings?.language.add_to_cart,
|
6848
6935
|
addToCartCallback,
|
6936
|
+
isCrossSell,
|
6849
6937
|
isHydrogenReact,
|
6850
6938
|
isInPopup,
|
6851
6939
|
onPopupDismiss: onDismiss,
|
@@ -6857,7 +6945,7 @@ var WidgetContent = ({
|
|
6857
6945
|
) }, product.id)) });
|
6858
6946
|
};
|
6859
6947
|
return /* @__PURE__ */ jsxs15("div", { className: RebuyWidget_default["rebuy-widget__inner-content"], children: [
|
6860
|
-
hasTimer && /* @__PURE__ */
|
6948
|
+
hasTimer && /* @__PURE__ */ jsx28(
|
6861
6949
|
Timer,
|
6862
6950
|
{
|
6863
6951
|
action: settings?.timer.action,
|
@@ -6868,7 +6956,7 @@ var WidgetContent = ({
|
|
6868
6956
|
title: settings?.language.timer_title
|
6869
6957
|
}
|
6870
6958
|
),
|
6871
|
-
hasSuperTitle && /* @__PURE__ */
|
6959
|
+
hasSuperTitle && /* @__PURE__ */ jsx28(
|
6872
6960
|
Title,
|
6873
6961
|
{
|
6874
6962
|
level: getTitleLevel(customTitleLevel),
|
@@ -6876,7 +6964,7 @@ var WidgetContent = ({
|
|
6876
6964
|
text: settings.language.super_title
|
6877
6965
|
}
|
6878
6966
|
),
|
6879
|
-
hasPrimaryTitle && /* @__PURE__ */
|
6967
|
+
hasPrimaryTitle && /* @__PURE__ */ jsx28(
|
6880
6968
|
Title,
|
6881
6969
|
{
|
6882
6970
|
level: getTitleLevel(customTitleLevel, hasSuperTitle ? true : false),
|
@@ -6884,19 +6972,20 @@ var WidgetContent = ({
|
|
6884
6972
|
text: primaryTitle
|
6885
6973
|
}
|
6886
6974
|
),
|
6887
|
-
hasDescription && /* @__PURE__ */
|
6975
|
+
hasDescription && /* @__PURE__ */ jsx28("p", { className: RebuyWidget_default["rebuy-widget__description"], children: settings.language.description }),
|
6888
6976
|
renderProducts()
|
6889
6977
|
] });
|
6890
6978
|
};
|
6891
6979
|
|
6892
6980
|
// src/widgets/RebuyWidget/RebuyWidget.tsx
|
6893
|
-
import { Fragment as Fragment7, jsx as
|
6981
|
+
import { Fragment as Fragment7, jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
6894
6982
|
var RebuyWidget = (props) => {
|
6895
6983
|
const {
|
6896
6984
|
addToCartCallback,
|
6897
6985
|
customTitle,
|
6898
6986
|
customTitleLevel = "h2",
|
6899
6987
|
customTitleStyle,
|
6988
|
+
isCrossSell,
|
6900
6989
|
isHydrogenReact,
|
6901
6990
|
popupTriggerId,
|
6902
6991
|
product,
|
@@ -7119,17 +7208,17 @@ var RebuyWidget = (props) => {
|
|
7119
7208
|
if (settings && !loadingSettings && shouldHideWidget) {
|
7120
7209
|
return null;
|
7121
7210
|
}
|
7122
|
-
return /* @__PURE__ */
|
7123
|
-
/* @__PURE__ */
|
7211
|
+
return /* @__PURE__ */ jsx29(Fragment7, { children: (settings || products?.length > 0) && !loadingSettings && /* @__PURE__ */ jsx29("div", { className: RebuyWidget_default["rebuy-widget__container"], id: `rebuy-widget-${widgetId}`, children: settings?.display_type === "popup" && (settings.popup_trigger !== "add_to_cart" || settings.popup_trigger === "add_to_cart" && popupTriggerId) ? /* @__PURE__ */ jsx29("div", { children: showPopup && /* @__PURE__ */ jsx29("div", { className: RebuyWidget_default["rebuy-widget__popup-overlay"], children: /* @__PURE__ */ jsx29("div", { className: RebuyWidget_default["rebuy-widget__popup-content"], ref: popupRef, children: /* @__PURE__ */ jsxs16("div", { className: RebuyWidget_default["rebuy-widget__content"], children: [
|
7212
|
+
/* @__PURE__ */ jsx29(
|
7124
7213
|
"button",
|
7125
7214
|
{
|
7126
7215
|
"aria-label": "close modal",
|
7127
7216
|
className: RebuyWidget_default["rebuy-widget__modal-close"],
|
7128
7217
|
onClick: closePopup,
|
7129
|
-
children: /* @__PURE__ */
|
7218
|
+
children: /* @__PURE__ */ jsx29(Close, {})
|
7130
7219
|
}
|
7131
7220
|
),
|
7132
|
-
/* @__PURE__ */
|
7221
|
+
/* @__PURE__ */ jsx29(
|
7133
7222
|
WidgetContent,
|
7134
7223
|
{
|
7135
7224
|
addToCartCallback: () => {
|
@@ -7148,13 +7237,14 @@ var RebuyWidget = (props) => {
|
|
7148
7237
|
settings
|
7149
7238
|
}
|
7150
7239
|
)
|
7151
|
-
] }) }) }) }) : /* @__PURE__ */
|
7240
|
+
] }) }) }) }) : /* @__PURE__ */ jsx29("div", { className: RebuyWidget_default["rebuy-widget__content"], children: /* @__PURE__ */ jsx29(
|
7152
7241
|
WidgetContent,
|
7153
7242
|
{
|
7154
7243
|
addToCartCallback,
|
7155
7244
|
customTitle,
|
7156
7245
|
customTitleLevel,
|
7157
7246
|
customTitleStyle,
|
7247
|
+
isCrossSell,
|
7158
7248
|
isHydrogenReact,
|
7159
7249
|
isInPopup: settings?.display_type === "popup",
|
7160
7250
|
products,
|
@@ -7164,14 +7254,14 @@ var RebuyWidget = (props) => {
|
|
7164
7254
|
};
|
7165
7255
|
|
7166
7256
|
// src/smart-cart/components/CrossSell/CrossSell.tsx
|
7167
|
-
import { jsx as
|
7257
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
7168
7258
|
var CrossSell = ({ componentConfig }) => {
|
7169
7259
|
const widgetId = componentConfig.settings.widget_id;
|
7170
7260
|
if (!widgetId) {
|
7171
7261
|
console.warn("[CrossSell] Widget ID is missing from component configuration");
|
7172
7262
|
return null;
|
7173
7263
|
}
|
7174
|
-
return /* @__PURE__ */
|
7264
|
+
return /* @__PURE__ */ jsx30("div", { "data-rebuy-component": "cross-sell-widget", "data-rebuy-component-id": widgetId, children: /* @__PURE__ */ jsx30(RebuyWidget, { isCrossSell: true, widgetId }) });
|
7175
7265
|
};
|
7176
7266
|
|
7177
7267
|
// src/smart-cart/components/CustomCode/CustomCodeBlock.tsx
|
@@ -7248,7 +7338,7 @@ var executeScriptsInContainer = (container, debugKey, debugContext) => {
|
|
7248
7338
|
};
|
7249
7339
|
|
7250
7340
|
// src/smart-cart/components/CustomCode/CustomCodeBlock.tsx
|
7251
|
-
import { jsx as
|
7341
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
7252
7342
|
var CustomCodeBlock = React6.memo(({ componentConfig }) => {
|
7253
7343
|
const containerRef = useRef8(null);
|
7254
7344
|
const executedCodeRef = useRef8(null);
|
@@ -7275,7 +7365,7 @@ var CustomCodeBlock = React6.memo(({ componentConfig }) => {
|
|
7275
7365
|
if (!htmlCode) {
|
7276
7366
|
return null;
|
7277
7367
|
}
|
7278
|
-
return /* @__PURE__ */
|
7368
|
+
return /* @__PURE__ */ jsx31(
|
7279
7369
|
"div",
|
7280
7370
|
{
|
7281
7371
|
dangerouslySetInnerHTML: { __html: htmlCode },
|
@@ -7377,7 +7467,7 @@ var result18 = { "rebuy-discount-code-input": "DiscountCodeInput_rebuy-discount-
|
|
7377
7467
|
var DiscountCodeInput_default = result18;
|
7378
7468
|
|
7379
7469
|
// src/smart-cart/components/DiscountCodeInput/DiscountCodeInput.tsx
|
7380
|
-
import { jsx as
|
7470
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
7381
7471
|
var DiscountCodeInputComponent = ({ componentConfig }) => {
|
7382
7472
|
const {
|
7383
7473
|
applyDiscountCodes: hrApplyDiscountCodes,
|
@@ -7561,7 +7651,7 @@ var DiscountCodeInputComponent = ({ componentConfig }) => {
|
|
7561
7651
|
[DiscountCodeInput_default["rebuy-discount-code-input__input-wrapper--show-label"]]: !!inputValue || isInputFocused
|
7562
7652
|
}),
|
7563
7653
|
children: [
|
7564
|
-
/* @__PURE__ */
|
7654
|
+
/* @__PURE__ */ jsx32(
|
7565
7655
|
"input",
|
7566
7656
|
{
|
7567
7657
|
"aria-label": lang.inputLabel,
|
@@ -7582,7 +7672,7 @@ var DiscountCodeInputComponent = ({ componentConfig }) => {
|
|
7582
7672
|
value: inputValue
|
7583
7673
|
}
|
7584
7674
|
),
|
7585
|
-
/* @__PURE__ */
|
7675
|
+
/* @__PURE__ */ jsx32(
|
7586
7676
|
"label",
|
7587
7677
|
{
|
7588
7678
|
className: DiscountCodeInput_default["rebuy-discount-code-input__input-label"],
|
@@ -7593,7 +7683,7 @@ var DiscountCodeInputComponent = ({ componentConfig }) => {
|
|
7593
7683
|
]
|
7594
7684
|
}
|
7595
7685
|
),
|
7596
|
-
/* @__PURE__ */
|
7686
|
+
/* @__PURE__ */ jsx32(
|
7597
7687
|
"button",
|
7598
7688
|
{
|
7599
7689
|
className: DiscountCodeInput_default["rebuy-discount-code-input__apply-button"],
|
@@ -7603,11 +7693,11 @@ var DiscountCodeInputComponent = ({ componentConfig }) => {
|
|
7603
7693
|
}
|
7604
7694
|
)
|
7605
7695
|
] }),
|
7606
|
-
discountManagerError && /* @__PURE__ */
|
7607
|
-
shouldShowTags && /* @__PURE__ */
|
7608
|
-
/* @__PURE__ */
|
7609
|
-
/* @__PURE__ */
|
7610
|
-
/* @__PURE__ */
|
7696
|
+
discountManagerError && /* @__PURE__ */ jsx32("div", { className: DiscountCodeInput_default["rebuy-discount-code-input__error-message"], children: discountManagerError }),
|
7697
|
+
shouldShowTags && /* @__PURE__ */ jsx32("div", { className: DiscountCodeInput_default["rebuy-discount-code-input__tags-list"], children: appliedCodes.map((code) => /* @__PURE__ */ jsxs17("div", { className: DiscountCodeInput_default["rebuy-discount-code-input__tag"], children: [
|
7698
|
+
/* @__PURE__ */ jsx32("span", { className: DiscountCodeInput_default["rebuy-discount-code-input__tag-icon"], children: /* @__PURE__ */ jsx32("svg", { fill: "currentColor", height: "14", viewBox: "0 0 24 24", width: "14", children: /* @__PURE__ */ jsx32("path", { d: "M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z" }) }) }),
|
7699
|
+
/* @__PURE__ */ jsx32("span", { className: DiscountCodeInput_default["rebuy-discount-code-input__tag-text"], children: code }),
|
7700
|
+
/* @__PURE__ */ jsx32(
|
7611
7701
|
"button",
|
7612
7702
|
{
|
7613
7703
|
"aria-label": `Remove discount code ${code}`,
|
@@ -7634,7 +7724,7 @@ var result19 = { "rebuy-login-button": "LoginButton_rebuy-login-button" };
|
|
7634
7724
|
var LoginButton_default = result19;
|
7635
7725
|
|
7636
7726
|
// src/smart-cart/components/LoginButton/LoginButton.tsx
|
7637
|
-
import { jsx as
|
7727
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
7638
7728
|
var LoginButton = React8.memo(() => {
|
7639
7729
|
const { cartData, getComponentConfigByType } = useSmartCart();
|
7640
7730
|
const componentConfig = getComponentConfigByType("login");
|
@@ -7648,13 +7738,14 @@ var LoginButton = React8.memo(() => {
|
|
7648
7738
|
}
|
7649
7739
|
const loginLabel = componentConfig?.settings?.language?.title ?? "Login";
|
7650
7740
|
const loginUrl = componentConfig?.settings?.url ?? "/account/login";
|
7651
|
-
return /* @__PURE__ */
|
7652
|
-
|
7741
|
+
return /* @__PURE__ */ jsx33(
|
7742
|
+
RebuyLink,
|
7653
7743
|
{
|
7744
|
+
ariaLabel: loginLabel,
|
7654
7745
|
className: LoginButton_default["rebuy-login-button"],
|
7655
7746
|
"data-rebuy-component": "login",
|
7656
7747
|
"data-rebuy-component-id": componentConfig.component_id ?? "login",
|
7657
|
-
|
7748
|
+
handle: loginUrl,
|
7658
7749
|
children: loginLabel
|
7659
7750
|
}
|
7660
7751
|
);
|
@@ -7871,7 +7962,7 @@ var useSmartCartApps = () => {
|
|
7871
7962
|
};
|
7872
7963
|
|
7873
7964
|
// src/smart-cart/components/SmartCartApp/SmartCartApp.tsx
|
7874
|
-
import { jsx as
|
7965
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
7875
7966
|
var SmartCartApp = React9.memo(({ componentConfig }) => {
|
7876
7967
|
const containerRef = useRef10(null);
|
7877
7968
|
const executedScriptRef = useRef10(null);
|
@@ -7911,7 +8002,7 @@ var SmartCartApp = React9.memo(({ componentConfig }) => {
|
|
7911
8002
|
}
|
7912
8003
|
if (appsHookError) {
|
7913
8004
|
console.error(`[SmartCartApp - ${componentId}] Hook error prevented app rendering: ${appsHookError}`);
|
7914
|
-
return /* @__PURE__ */
|
8005
|
+
return /* @__PURE__ */ jsx34("div", { "data-rebuy-component-id": componentId, children: "Error loading app data." });
|
7915
8006
|
}
|
7916
8007
|
if (appId === null) {
|
7917
8008
|
console.warn(`[SmartCartApp - ${componentId}] Missing App ID (settings.app_id) in configuration.`);
|
@@ -7924,7 +8015,7 @@ var SmartCartApp = React9.memo(({ componentConfig }) => {
|
|
7924
8015
|
);
|
7925
8016
|
return null;
|
7926
8017
|
}
|
7927
|
-
return /* @__PURE__ */
|
8018
|
+
return /* @__PURE__ */ jsx34(
|
7928
8019
|
"div",
|
7929
8020
|
{
|
7930
8021
|
dangerouslySetInnerHTML: { __html: scriptContent },
|
@@ -7951,7 +8042,7 @@ var result20 = { "rebuy-tiered-progress-bar": "TieredProgressBar_rebuy-tiered-pr
|
|
7951
8042
|
var TieredProgressBar_default = result20;
|
7952
8043
|
|
7953
8044
|
// src/smart-cart/components/TieredProgressBar/TPBGiftItem.tsx
|
7954
|
-
import { Fragment as Fragment8, jsx as
|
8045
|
+
import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
7955
8046
|
var TieredProgressBarGiftItem = ({
|
7956
8047
|
isGloballySyncing,
|
7957
8048
|
onAddOrReAdd,
|
@@ -7984,7 +8075,7 @@ var TieredProgressBarGiftItem = ({
|
|
7984
8075
|
[TieredProgressBar_default["rebuy-tiered-progress-bar__gift-item--syncing"]]: isGloballySyncing
|
7985
8076
|
}),
|
7986
8077
|
children: [
|
7987
|
-
/* @__PURE__ */
|
8078
|
+
/* @__PURE__ */ jsx35("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-item-image-wrapper"], children: imageSrc ? /* @__PURE__ */ jsx35(
|
7988
8079
|
"img",
|
7989
8080
|
{
|
7990
8081
|
alt: imageAlt,
|
@@ -7992,7 +8083,7 @@ var TieredProgressBarGiftItem = ({
|
|
7992
8083
|
loading: "lazy",
|
7993
8084
|
src: imageSrc
|
7994
8085
|
}
|
7995
|
-
) : /* @__PURE__ */
|
8086
|
+
) : /* @__PURE__ */ jsx35(
|
7996
8087
|
"div",
|
7997
8088
|
{
|
7998
8089
|
"aria-label": "Gift product image placeholder",
|
@@ -8000,16 +8091,16 @@ var TieredProgressBarGiftItem = ({
|
|
8000
8091
|
}
|
8001
8092
|
) }),
|
8002
8093
|
/* @__PURE__ */ jsxs19("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-item-details"], children: [
|
8003
|
-
/* @__PURE__ */
|
8004
|
-
displayStatus === "added" /* ADDED */ && displayVariantTitle && /* @__PURE__ */
|
8094
|
+
/* @__PURE__ */ jsx35("h4", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-item-title"], id: `tpb-gift-${tierId}-title`, children: title }),
|
8095
|
+
displayStatus === "added" /* ADDED */ && displayVariantTitle && /* @__PURE__ */ jsx35("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-item-variant-title"], children: displayVariantTitle }),
|
8005
8096
|
/* @__PURE__ */ jsxs19("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-item-actions-wrapper"], children: [
|
8006
|
-
isGloballySyncing && /* @__PURE__ */
|
8097
|
+
isGloballySyncing && /* @__PURE__ */ jsx35("button", { className: clsx9(TieredProgressBar_default["rebuy-tiered-progress-bar__gift-item-button"]), disabled: true, children: "Updating..." }),
|
8007
8098
|
itemLevelError && !isGloballySyncing && /* @__PURE__ */ jsxs19("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__error-message"], children: [
|
8008
8099
|
"Error: ",
|
8009
8100
|
itemLevelError
|
8010
8101
|
] }),
|
8011
8102
|
!isGloballySyncing && !itemLevelError && /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
8012
|
-
displayStatus === "added" /* ADDED */ && /* @__PURE__ */
|
8103
|
+
displayStatus === "added" /* ADDED */ && /* @__PURE__ */ jsx35(
|
8013
8104
|
"button",
|
8014
8105
|
{
|
8015
8106
|
"aria-label": `Remove ${title} gift`,
|
@@ -8031,7 +8122,7 @@ var TieredProgressBarGiftItem = ({
|
|
8031
8122
|
onChange: handleVariantChange,
|
8032
8123
|
value: "",
|
8033
8124
|
children: [
|
8034
|
-
/* @__PURE__ */
|
8125
|
+
/* @__PURE__ */ jsx35("option", { disabled: true, value: "", children: "Select Option" }),
|
8035
8126
|
availableChoices.map((variant) => {
|
8036
8127
|
const variantLabel = getFreeVariantTitle(variant) || variant.title;
|
8037
8128
|
return /* @__PURE__ */ jsxs19("option", { value: variant.id, children: [
|
@@ -8044,7 +8135,7 @@ var TieredProgressBarGiftItem = ({
|
|
8044
8135
|
]
|
8045
8136
|
}
|
8046
8137
|
),
|
8047
|
-
canReAdd && displayStatus === "declined" /* DECLINED */ && /* @__PURE__ */
|
8138
|
+
canReAdd && displayStatus === "declined" /* DECLINED */ && /* @__PURE__ */ jsx35(
|
8048
8139
|
"button",
|
8049
8140
|
{
|
8050
8141
|
"aria-label": `Re-add ${title} gift`,
|
@@ -8057,7 +8148,7 @@ var TieredProgressBarGiftItem = ({
|
|
8057
8148
|
children: "Re-Add Gift"
|
8058
8149
|
}
|
8059
8150
|
),
|
8060
|
-
displayStatus === "unavailable" /* UNAVAILABLE */ && !canReAdd && /* @__PURE__ */
|
8151
|
+
displayStatus === "unavailable" /* UNAVAILABLE */ && !canReAdd && /* @__PURE__ */ jsx35("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-item-status-text"], children: "Unavailable" })
|
8061
8152
|
] })
|
8062
8153
|
] })
|
8063
8154
|
] })
|
@@ -8143,7 +8234,7 @@ var codeBlock = {
|
|
8143
8234
|
};
|
8144
8235
|
|
8145
8236
|
// src/smart-cart/components/TieredProgressBar/TieredProgressBar.tsx
|
8146
|
-
import { jsx as
|
8237
|
+
import { jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
8147
8238
|
var TieredProgressBar = React10.memo(() => {
|
8148
8239
|
const { hydrogenReactCartActions, isCartBusy, isHydrogenReact } = useSmartCart();
|
8149
8240
|
const tpbUserActionFetcher = useFetcher5();
|
@@ -8324,7 +8415,7 @@ var TieredProgressBar = React10.memo(() => {
|
|
8324
8415
|
const giftAreaTitleId = `tpb-giftarea-title-${activeBarConfig.id}`;
|
8325
8416
|
return /* @__PURE__ */ jsxs20("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar"], "data-rebuy-component": "tiered-progress-bar", children: [
|
8326
8417
|
/* @__PURE__ */ jsxs20("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__main-progress-area"], id: progressBarId, children: [
|
8327
|
-
/* @__PURE__ */
|
8418
|
+
/* @__PURE__ */ jsx36("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__tier-markers-list"], children: activeBarConfig.tiers.map((tier) => {
|
8328
8419
|
const isReached = checkTierReachedCallback(tier);
|
8329
8420
|
const tierLabel = getTierLabel(tier, fetchedProductMap);
|
8330
8421
|
const iconRenderData = getTierIconComponent(tier, isReached, fetchedProductMap);
|
@@ -8339,7 +8430,7 @@ var TieredProgressBar = React10.memo(() => {
|
|
8339
8430
|
if (React10.isValidElement(iconRenderData)) iconElement = iconRenderData;
|
8340
8431
|
else if (iconRenderData.type === "image") {
|
8341
8432
|
const imageObject = iconRenderData;
|
8342
|
-
iconElement = /* @__PURE__ */
|
8433
|
+
iconElement = /* @__PURE__ */ jsx36(
|
8343
8434
|
"img",
|
8344
8435
|
{
|
8345
8436
|
alt: imageObject.alt,
|
@@ -8356,7 +8447,7 @@ var TieredProgressBar = React10.memo(() => {
|
|
8356
8447
|
}),
|
8357
8448
|
title: `${tierLabel} (${isReached ? "Reached" : "Pending"} at ${formatMoney(getTierMinimum(tier))})`,
|
8358
8449
|
children: [
|
8359
|
-
/* @__PURE__ */
|
8450
|
+
/* @__PURE__ */ jsx36(
|
8360
8451
|
"div",
|
8361
8452
|
{
|
8362
8453
|
className: TieredProgressBar_default["rebuy-tiered-progress-bar__tier-icon-wrapper"],
|
@@ -8364,13 +8455,13 @@ var TieredProgressBar = React10.memo(() => {
|
|
8364
8455
|
children: iconElement
|
8365
8456
|
}
|
8366
8457
|
),
|
8367
|
-
/* @__PURE__ */
|
8458
|
+
/* @__PURE__ */ jsx36("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__tier-label"], children: tierLabel })
|
8368
8459
|
]
|
8369
8460
|
},
|
8370
8461
|
tier.id
|
8371
8462
|
);
|
8372
8463
|
}) }),
|
8373
|
-
/* @__PURE__ */
|
8464
|
+
/* @__PURE__ */ jsx36("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__track"], children: /* @__PURE__ */ jsx36(
|
8374
8465
|
"div",
|
8375
8466
|
{
|
8376
8467
|
"aria-label": "Reward progress",
|
@@ -8400,9 +8491,9 @@ var TieredProgressBar = React10.memo(() => {
|
|
8400
8491
|
] })
|
8401
8492
|
] }),
|
8402
8493
|
renderGiftArea && /* @__PURE__ */ jsxs20("div", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-area"], children: [
|
8403
|
-
renderGiftAreaTitle && /* @__PURE__ */
|
8494
|
+
renderGiftAreaTitle && /* @__PURE__ */ jsx36("h3", { className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-area-title"], id: giftAreaTitleId, children: giftAreaTitle }),
|
8404
8495
|
shouldDisableGiftActions && // If actions are disabled (likely loading something)
|
8405
|
-
productsToRenderInGiftArea.length === 0 && !productFetchError && !cartSyncError && !userActionError && /* @__PURE__ */
|
8496
|
+
productsToRenderInGiftArea.length === 0 && !productFetchError && !cartSyncError && !userActionError && /* @__PURE__ */ jsx36(
|
8406
8497
|
"div",
|
8407
8498
|
{
|
8408
8499
|
style: {
|
@@ -8412,12 +8503,12 @@ var TieredProgressBar = React10.memo(() => {
|
|
8412
8503
|
children: "Loading gifts..."
|
8413
8504
|
}
|
8414
8505
|
),
|
8415
|
-
productsToRenderInGiftArea.length > 0 && /* @__PURE__ */
|
8506
|
+
productsToRenderInGiftArea.length > 0 && /* @__PURE__ */ jsx36(
|
8416
8507
|
"div",
|
8417
8508
|
{
|
8418
8509
|
"aria-labelledby": renderGiftAreaTitle ? giftAreaTitleId : void 0,
|
8419
8510
|
className: TieredProgressBar_default["rebuy-tiered-progress-bar__gift-items-list"],
|
8420
|
-
children: productsToRenderInGiftArea.map((productState) => /* @__PURE__ */
|
8511
|
+
children: productsToRenderInGiftArea.map((productState) => /* @__PURE__ */ jsx36(
|
8421
8512
|
TieredProgressBarGiftItem,
|
8422
8513
|
{
|
8423
8514
|
isGloballySyncing: shouldDisableGiftActions,
|
@@ -8431,7 +8522,7 @@ var TieredProgressBar = React10.memo(() => {
|
|
8431
8522
|
}
|
8432
8523
|
)
|
8433
8524
|
] }),
|
8434
|
-
rebuyDebugLog.isKeyActive("smart-cart-tpb" /* SC_TPB */) && /* @__PURE__ */
|
8525
|
+
rebuyDebugLog.isKeyActive("smart-cart-tpb" /* SC_TPB */) && /* @__PURE__ */ jsx36(
|
8435
8526
|
"button",
|
8436
8527
|
{
|
8437
8528
|
onClick: () => setShowDebugPanel(!showDebugPanel),
|
@@ -8454,7 +8545,7 @@ var TieredProgressBar = React10.memo(() => {
|
|
8454
8545
|
width: "100%"
|
8455
8546
|
},
|
8456
8547
|
children: [
|
8457
|
-
/* @__PURE__ */
|
8548
|
+
/* @__PURE__ */ jsx36("div", { style: infoText, children: /* @__PURE__ */ jsx36("strong", { children: "Progress Bar Debug Info" }) }),
|
8458
8549
|
/* @__PURE__ */ jsxs20("div", { style: codeBlock, children: [
|
8459
8550
|
/* @__PURE__ */ jsxs20("div", { children: [
|
8460
8551
|
"Subtotal: ",
|
@@ -8484,8 +8575,8 @@ var TieredProgressBar = React10.memo(() => {
|
|
8484
8575
|
] })
|
8485
8576
|
] }),
|
8486
8577
|
giftsForDisplay.length > 0 && /* @__PURE__ */ jsxs20("div", { style: { marginTop: "8px" }, children: [
|
8487
|
-
/* @__PURE__ */
|
8488
|
-
/* @__PURE__ */
|
8578
|
+
/* @__PURE__ */ jsx36("div", { style: infoText, children: "Gift Status:" }),
|
8579
|
+
/* @__PURE__ */ jsx36("div", { style: codeBlock, children: giftsForDisplay.map((gift, idx) => /* @__PURE__ */ jsxs20("div", { style: { marginBottom: "4px" }, children: [
|
8489
8580
|
"Tier ",
|
8490
8581
|
gift.tierId,
|
8491
8582
|
": ",
|
@@ -8501,7 +8592,7 @@ var TieredProgressBar = React10.memo(() => {
|
|
8501
8592
|
TieredProgressBar.displayName = "TieredProgressBar";
|
8502
8593
|
|
8503
8594
|
// src/smart-cart/components/componentRegistry.tsx
|
8504
|
-
import { jsx as
|
8595
|
+
import { jsx as jsx37, jsxs as jsxs21 } from "react/jsx-runtime";
|
8505
8596
|
var componentRegistry = {
|
8506
8597
|
// Use 'any' for props initially, refine later
|
8507
8598
|
announcement_bar: AnnouncementBar,
|
@@ -8520,7 +8611,7 @@ var componentRegistry = {
|
|
8520
8611
|
};
|
8521
8612
|
|
8522
8613
|
// src/smart-cart/components/_Layouts/AnchorSlot.tsx
|
8523
|
-
import { Fragment as Fragment9, jsx as
|
8614
|
+
import { Fragment as Fragment9, jsx as jsx38 } from "react/jsx-runtime";
|
8524
8615
|
var AnchorSlot = ({ anchor, components, excludeTypes, includeTypes }) => {
|
8525
8616
|
const componentsForSlot = useMemo19(() => {
|
8526
8617
|
return components.filter((comp) => {
|
@@ -8538,13 +8629,13 @@ var AnchorSlot = ({ anchor, components, excludeTypes, includeTypes }) => {
|
|
8538
8629
|
});
|
8539
8630
|
return null;
|
8540
8631
|
}
|
8541
|
-
return /* @__PURE__ */
|
8632
|
+
return /* @__PURE__ */ jsx38(Fragment9, { children: componentsForSlot.map((componentConfig) => {
|
8542
8633
|
const Component = componentRegistry[componentConfig.type];
|
8543
8634
|
if (!Component) {
|
8544
8635
|
console.warn(`[SmartCartReact] No component registered for type: "${componentConfig.type}"`);
|
8545
8636
|
return null;
|
8546
8637
|
}
|
8547
|
-
return /* @__PURE__ */
|
8638
|
+
return /* @__PURE__ */ jsx38(Component, { componentConfig }, componentConfig.component_id);
|
8548
8639
|
}) });
|
8549
8640
|
};
|
8550
8641
|
|
@@ -8576,15 +8667,15 @@ var result21 = { "rebuy-smart-cart-layout__anchor-goal-box": "LayoutStyles_rebuy
|
|
8576
8667
|
var LayoutStyles_default = result21;
|
8577
8668
|
|
8578
8669
|
// src/smart-cart/components/_Layouts/DoubleColumnLayout.tsx
|
8579
|
-
import { jsx as
|
8670
|
+
import { jsx as jsx39, jsxs as jsxs22 } from "react/jsx-runtime";
|
8580
8671
|
var DoubleColumnLayout = ({ components, itemCount, layout }) => {
|
8581
8672
|
const scrollAreaRef = useRef11(null);
|
8582
8673
|
const isScrolled = useIsScrolled(scrollAreaRef);
|
8583
8674
|
const layoutClass = layout === "double-right" ? LayoutStyles_default["rebuy-smart-cart-layout__flyout-inner--double-right"] : LayoutStyles_default["rebuy-smart-cart-layout__flyout-inner--double"];
|
8584
8675
|
return /* @__PURE__ */ jsxs22("div", { className: clsx11(LayoutStyles_default["rebuy-smart-cart-layout__flyout-inner"], layoutClass), children: [
|
8585
8676
|
/* @__PURE__ */ jsxs22("div", { className: LayoutStyles_default["rebuy-smart-cart-layout__column--primary"], children: [
|
8586
|
-
/* @__PURE__ */
|
8587
|
-
/* @__PURE__ */
|
8677
|
+
/* @__PURE__ */ jsx39("div", { className: LayoutStyles_default["rebuy-smart-cart-layout__anchor-goal-box"], "data-rebuy-cart-anchor": "goalBox", children: /* @__PURE__ */ jsx39(AnchorSlot, { anchor: "goalBox", components }) }),
|
8678
|
+
/* @__PURE__ */ jsx39(
|
8588
8679
|
"div",
|
8589
8680
|
{
|
8590
8681
|
className: clsx11(
|
@@ -8593,26 +8684,26 @@ var DoubleColumnLayout = ({ components, itemCount, layout }) => {
|
|
8593
8684
|
),
|
8594
8685
|
"data-rebuy-cart-scroll-area": true,
|
8595
8686
|
ref: scrollAreaRef,
|
8596
|
-
children: /* @__PURE__ */
|
8687
|
+
children: /* @__PURE__ */ jsx39("div", { className: LayoutStyles_default["rebuy-smart-cart-layout__anchor-body"], "data-rebuy-cart-anchor": "body", children: /* @__PURE__ */ jsx39(AnchorSlot, { anchor: "body", components }) })
|
8597
8688
|
}
|
8598
8689
|
),
|
8599
|
-
/* @__PURE__ */
|
8690
|
+
/* @__PURE__ */ jsx39(
|
8600
8691
|
"div",
|
8601
8692
|
{
|
8602
8693
|
className: clsx11(LayoutStyles_default["rebuy-smart-cart-layout__anchor-footer"], {
|
8603
8694
|
[LayoutStyles_default["rebuy-smart-cart-layout__anchor-footer--hidden"]]: itemCount === 0
|
8604
8695
|
}),
|
8605
8696
|
"data-rebuy-cart-anchor": "footer",
|
8606
|
-
children: /* @__PURE__ */
|
8697
|
+
children: /* @__PURE__ */ jsx39(AnchorSlot, { anchor: "footer", components })
|
8607
8698
|
}
|
8608
8699
|
)
|
8609
8700
|
] }),
|
8610
|
-
/* @__PURE__ */
|
8701
|
+
/* @__PURE__ */ jsx39("div", { className: LayoutStyles_default["rebuy-smart-cart-layout__column--secondary"], children: /* @__PURE__ */ jsx39(
|
8611
8702
|
"div",
|
8612
8703
|
{
|
8613
8704
|
className: LayoutStyles_default["rebuy-smart-cart-layout__anchor-cross-sells"],
|
8614
8705
|
"data-rebuy-cart-anchor": "crossSells",
|
8615
|
-
children: /* @__PURE__ */
|
8706
|
+
children: /* @__PURE__ */ jsx39(AnchorSlot, { anchor: "crossSells", components })
|
8616
8707
|
}
|
8617
8708
|
) })
|
8618
8709
|
] });
|
@@ -8621,13 +8712,13 @@ var DoubleColumnLayout = ({ components, itemCount, layout }) => {
|
|
8621
8712
|
// src/smart-cart/components/_Layouts/SingleColumnLayout.tsx
|
8622
8713
|
import clsx12 from "clsx";
|
8623
8714
|
import { useRef as useRef12 } from "react";
|
8624
|
-
import { Fragment as Fragment10, jsx as
|
8715
|
+
import { Fragment as Fragment10, jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
8625
8716
|
var SingleColumnLayout = ({ components, itemCount }) => {
|
8626
8717
|
const scrollAreaRef = useRef12(null);
|
8627
8718
|
const isScrolled = useIsScrolled(scrollAreaRef);
|
8628
8719
|
return /* @__PURE__ */ jsxs23(Fragment10, { children: [
|
8629
|
-
/* @__PURE__ */
|
8630
|
-
/* @__PURE__ */
|
8720
|
+
/* @__PURE__ */ jsx40("div", { className: LayoutStyles_default["rebuy-smart-cart-layout__anchor-goal-box"], "data-rebuy-cart-anchor": "goalBox", children: /* @__PURE__ */ jsx40(AnchorSlot, { anchor: "goalBox", components }) }),
|
8721
|
+
/* @__PURE__ */ jsx40(
|
8631
8722
|
"div",
|
8632
8723
|
{
|
8633
8724
|
className: clsx12(
|
@@ -8636,17 +8727,17 @@ var SingleColumnLayout = ({ components, itemCount }) => {
|
|
8636
8727
|
),
|
8637
8728
|
"data-rebuy-cart-scroll-area": true,
|
8638
8729
|
ref: scrollAreaRef,
|
8639
|
-
children: /* @__PURE__ */
|
8730
|
+
children: /* @__PURE__ */ jsx40("div", { className: LayoutStyles_default["rebuy-smart-cart-layout__anchor-body"], "data-rebuy-cart-anchor": "body", children: /* @__PURE__ */ jsx40(AnchorSlot, { anchor: "body", components }) })
|
8640
8731
|
}
|
8641
8732
|
),
|
8642
|
-
/* @__PURE__ */
|
8733
|
+
/* @__PURE__ */ jsx40(
|
8643
8734
|
"div",
|
8644
8735
|
{
|
8645
8736
|
className: clsx12(LayoutStyles_default["rebuy-smart-cart-layout__anchor-footer"], {
|
8646
8737
|
[LayoutStyles_default["rebuy-smart-cart-layout__anchor-footer--hidden"]]: itemCount === 0
|
8647
8738
|
}),
|
8648
8739
|
"data-rebuy-cart-anchor": "footer",
|
8649
|
-
children: /* @__PURE__ */
|
8740
|
+
children: /* @__PURE__ */ jsx40(AnchorSlot, { anchor: "footer", components })
|
8650
8741
|
}
|
8651
8742
|
)
|
8652
8743
|
] });
|
@@ -8657,7 +8748,7 @@ var result22 = { "rebuy-smart-cart": "SmartCartContainer_rebuy-smart-cart", "reb
|
|
8657
8748
|
var SmartCartContainer_default = result22;
|
8658
8749
|
|
8659
8750
|
// src/smart-cart/components/SmartCartContainer/SmartCartContainer.tsx
|
8660
|
-
import { jsx as
|
8751
|
+
import { jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
|
8661
8752
|
var SmartCartContainer = ({ containerId }) => {
|
8662
8753
|
const { config, getItemCount, hideCart, isVisible } = useSmartCart();
|
8663
8754
|
const containerRef = useRef13(null);
|
@@ -8678,6 +8769,16 @@ var SmartCartContainer = ({ containerId }) => {
|
|
8678
8769
|
}
|
8679
8770
|
}
|
8680
8771
|
}, [isVisible]);
|
8772
|
+
useEffect21(() => {
|
8773
|
+
if (isVisible) {
|
8774
|
+
document.body.classList.add("rebuy-smart-cart-open");
|
8775
|
+
} else {
|
8776
|
+
document.body.classList.remove("rebuy-smart-cart-open");
|
8777
|
+
}
|
8778
|
+
return () => {
|
8779
|
+
document.body.classList.remove("rebuy-smart-cart-open");
|
8780
|
+
};
|
8781
|
+
}, [isVisible]);
|
8681
8782
|
const backgroundClassName = clsx13(SmartCartContainer_default["rebuy-smart-cart__overlay-background"], {
|
8682
8783
|
[SmartCartContainer_default["rebuy-smart-cart__overlay-background--visible"]]: isVisible
|
8683
8784
|
});
|
@@ -8690,20 +8791,20 @@ var SmartCartContainer = ({ containerId }) => {
|
|
8690
8791
|
}
|
8691
8792
|
);
|
8692
8793
|
const renderLayoutContent = () => {
|
8693
|
-
if (!config) return /* @__PURE__ */
|
8794
|
+
if (!config) return /* @__PURE__ */ jsx41("div", { style: { padding: "20px", textAlign: "center" }, children: "Loading configuration..." });
|
8694
8795
|
switch (config.layout) {
|
8695
8796
|
case "double":
|
8696
8797
|
case "double-right":
|
8697
|
-
return /* @__PURE__ */
|
8798
|
+
return /* @__PURE__ */ jsx41(DoubleColumnLayout, { components, itemCount: getItemCount(), layout: config.layout });
|
8698
8799
|
default:
|
8699
|
-
return /* @__PURE__ */
|
8800
|
+
return /* @__PURE__ */ jsx41(SingleColumnLayout, { components, itemCount: getItemCount() });
|
8700
8801
|
}
|
8701
8802
|
};
|
8702
8803
|
const defaultTitleId = "rebuy-smart-cart-default-title";
|
8703
8804
|
const titleBarComponent = components.find((c) => c.type === "title_bar");
|
8704
8805
|
const ariaLabelledBy = titleBarComponent ? `rebuy-title-${titleBarComponent.component_id}` : defaultTitleId;
|
8705
8806
|
return /* @__PURE__ */ jsxs24(React11.Fragment, { children: [
|
8706
|
-
/* @__PURE__ */
|
8807
|
+
/* @__PURE__ */ jsx41("div", { className: backgroundClassName, onClick: handleClose }),
|
8707
8808
|
/* @__PURE__ */ jsxs24(
|
8708
8809
|
"div",
|
8709
8810
|
{
|
@@ -8719,10 +8820,10 @@ var SmartCartContainer = ({ containerId }) => {
|
|
8719
8820
|
/* @__PURE__ */ jsxs24("header", { className: SmartCartContainer_default["rebuy-smart-cart__header"], "data-rebuy-cart-anchor": "header", children: [
|
8720
8821
|
/* @__PURE__ */ jsxs24("div", { className: SmartCartContainer_default["rebuy-smart-cart__header-top-bar"], "data-rebuy-cart-header-top-bar": "", children: [
|
8721
8822
|
/* @__PURE__ */ jsxs24("div", { className: SmartCartContainer_default["rebuy-smart-cart__header-content"], "data-rebuy-cart-header-top-inner": "", children: [
|
8722
|
-
/* @__PURE__ */
|
8823
|
+
/* @__PURE__ */ jsx41(AnchorSlot, { anchor: "header", components, includeTypes: ["title_bar", "login"] }),
|
8723
8824
|
!components.some(
|
8724
8825
|
(c) => c.type === "title_bar" && !c.settings?.screen_reader_only
|
8725
|
-
) && /* @__PURE__ */
|
8826
|
+
) && /* @__PURE__ */ jsx41("h2", { id: defaultTitleId, children: /* @__PURE__ */ jsx41(ScreenReaderText, { children: "Your Cart" }) })
|
8726
8827
|
] }),
|
8727
8828
|
/* @__PURE__ */ jsxs24(
|
8728
8829
|
"button",
|
@@ -8734,15 +8835,15 @@ var SmartCartContainer = ({ containerId }) => {
|
|
8734
8835
|
type: "button",
|
8735
8836
|
children: [
|
8736
8837
|
"\u2715",
|
8737
|
-
/* @__PURE__ */
|
8838
|
+
/* @__PURE__ */ jsx41(ScreenReaderText, { children: "Close Cart" })
|
8738
8839
|
]
|
8739
8840
|
}
|
8740
8841
|
)
|
8741
8842
|
] }),
|
8742
|
-
/* @__PURE__ */
|
8843
|
+
/* @__PURE__ */ jsx41(AnchorSlot, { anchor: "header", components, excludeTypes: ["title_bar", "login"] })
|
8743
8844
|
] }),
|
8744
8845
|
renderLayoutContent(),
|
8745
|
-
/* @__PURE__ */
|
8846
|
+
/* @__PURE__ */ jsx41("div", { "aria-live": "polite", className: "rebuy-sr-only", id: "rebuy-cart-live-region" })
|
8746
8847
|
]
|
8747
8848
|
}
|
8748
8849
|
)
|
@@ -8750,9 +8851,9 @@ var SmartCartContainer = ({ containerId }) => {
|
|
8750
8851
|
};
|
8751
8852
|
|
8752
8853
|
// src/smart-cart/RebuySmartCart.tsx
|
8753
|
-
import { jsx as
|
8854
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
8754
8855
|
var RebuySmartCart = () => {
|
8755
|
-
return /* @__PURE__ */
|
8856
|
+
return /* @__PURE__ */ jsx42(SmartCartContainer, {});
|
8756
8857
|
};
|
8757
8858
|
|
8758
8859
|
// src/widgetContainer/RebuyWidgetContainer.tsx
|
@@ -8854,6 +8955,7 @@ var RebuyWidgetContainerBase = ({ children, ...props }) => {
|
|
8854
8955
|
...props,
|
8855
8956
|
apiKey,
|
8856
8957
|
cacheKey: rebuyConfig?.shop?.cache_key,
|
8958
|
+
isHydrogenReact: rebuyContext?.contextParameters?.isHydrogenReact,
|
8857
8959
|
key: product?.id,
|
8858
8960
|
metadata,
|
8859
8961
|
products
|
@@ -8870,7 +8972,7 @@ var result23 = { "container": "RebuyCompleteTheLook_container", "productGrid": "
|
|
8870
8972
|
var RebuyCompleteTheLook_default = result23;
|
8871
8973
|
|
8872
8974
|
// src/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.tsx
|
8873
|
-
import { jsx as
|
8975
|
+
import { jsx as jsx43, jsxs as jsxs25 } from "react/jsx-runtime";
|
8874
8976
|
var RebuyCompleteTheLook = (props) => {
|
8875
8977
|
const {
|
8876
8978
|
addToCartBtnText = "Add to cart",
|
@@ -8885,8 +8987,8 @@ var RebuyCompleteTheLook = (props) => {
|
|
8885
8987
|
return null;
|
8886
8988
|
}
|
8887
8989
|
return /* @__PURE__ */ jsxs25("section", { className: RebuyCompleteTheLook_default.container, children: [
|
8888
|
-
/* @__PURE__ */
|
8889
|
-
/* @__PURE__ */
|
8990
|
+
/* @__PURE__ */ jsx43(Title, { level: getTitleLevel(customTitleLevel), style: customTitleStyle, text: customTitle }),
|
8991
|
+
/* @__PURE__ */ jsx43("ul", { className: RebuyCompleteTheLook_default.productGrid, children: products.map((product) => /* @__PURE__ */ jsx43("li", { className: RebuyCompleteTheLook_default.productItem, children: /* @__PURE__ */ jsx43(
|
8890
8992
|
ProductCard,
|
8891
8993
|
{
|
8892
8994
|
addToCartBtnText,
|
@@ -8904,11 +9006,34 @@ import { useCallback as useCallback15, useEffect as useEffect23, useState as use
|
|
8904
9006
|
|
8905
9007
|
// src/utils/convertToRebuyProduct.tsx
|
8906
9008
|
var convertToRebuyProduct = (isHydrogenReact, product) => {
|
8907
|
-
const mainProductVariants = isHydrogenReact ? product?.variants?.nodes?.map((variant) => {
|
8908
|
-
|
8909
|
-
|
8910
|
-
|
8911
|
-
|
9009
|
+
const mainProductVariants = isHydrogenReact ? product?.variants?.nodes?.map((variant) => ({
|
9010
|
+
availableForSale: variant.availableForSale,
|
9011
|
+
compareAtPriceV2: {
|
9012
|
+
amount: variant.compareAtPrice?.amount || "",
|
9013
|
+
currencyCode: variant.compareAtPrice?.currencyCode || "USD"
|
9014
|
+
},
|
9015
|
+
id: variant.id,
|
9016
|
+
image: variant.image ? {
|
9017
|
+
altText: variant.image.altText || null,
|
9018
|
+
height: variant.image.height || 100,
|
9019
|
+
id: variant.image.id || "",
|
9020
|
+
url: variant.image.url || "",
|
9021
|
+
width: variant.image.width || 100
|
9022
|
+
} : void 0,
|
9023
|
+
priceV2: {
|
9024
|
+
amount: variant.price.amount,
|
9025
|
+
currencyCode: variant.price.currencyCode
|
9026
|
+
},
|
9027
|
+
product: {
|
9028
|
+
handle: product.handle,
|
9029
|
+
id: product.id,
|
9030
|
+
title: product.title,
|
9031
|
+
vendor: product.vendor
|
9032
|
+
},
|
9033
|
+
selectedOptions: variant.selectedOptions,
|
9034
|
+
sku: variant.sku || "",
|
9035
|
+
title: variant.title
|
9036
|
+
})) || [] : product?.adjacentVariants.map((variant) => {
|
8912
9037
|
return {
|
8913
9038
|
availableForSale: variant.availableForSale,
|
8914
9039
|
compareAtPriceV2: {
|
@@ -8972,26 +9097,28 @@ var convertToRebuyProduct = (isHydrogenReact, product) => {
|
|
8972
9097
|
selected: true,
|
8973
9098
|
selectedOptions: product?.selectedVariant?.selectedOptions?.reduce((acc, option) => {
|
8974
9099
|
return { ...acc, [option.name]: option.value };
|
9100
|
+
}, {}) || product?.variants?.nodes[0]?.selectedOptions?.reduce((acc, option) => {
|
9101
|
+
return { ...acc, [option.name]: option.value };
|
8975
9102
|
}, {}) || {},
|
8976
9103
|
selectedSellingPlan: {},
|
8977
9104
|
selectedSellingPlanAllocation: {},
|
8978
9105
|
selectedVariant: {
|
8979
|
-
availableForSale: product?.selectedVariant?.availableForSale || false,
|
9106
|
+
availableForSale: product?.selectedVariant?.availableForSale || product?.variants?.nodes[0]?.availableForSale || false,
|
8980
9107
|
compareAtPriceV2: {
|
8981
|
-
amount: product?.selectedVariant?.compareAtPrice?.amount || "",
|
8982
|
-
currencyCode: product?.selectedVariant?.compareAtPrice?.currencyCode || "USD"
|
9108
|
+
amount: product?.selectedVariant?.compareAtPrice?.amount || product?.variants?.nodes[0]?.compareAtPrice?.amount || "",
|
9109
|
+
currencyCode: product?.selectedVariant?.compareAtPrice?.currencyCode || product?.variants?.nodes[0]?.compareAtPrice?.currencyCode || "USD"
|
8983
9110
|
},
|
8984
9111
|
id: product?.selectedVariant?.id || "",
|
8985
9112
|
image: {
|
8986
|
-
altText: product?.selectedVariant?.image?.altText || "",
|
8987
|
-
height: product?.selectedVariant?.image?.height || 100,
|
8988
|
-
id: product?.selectedVariant?.image?.id || "",
|
8989
|
-
url: product?.selectedVariant?.image?.url || "",
|
8990
|
-
width: product?.selectedVariant?.image?.width || 100
|
9113
|
+
altText: product?.selectedVariant?.image?.altText || product?.variants?.nodes[0]?.image?.altText || "",
|
9114
|
+
height: product?.selectedVariant?.image?.height || product?.variants?.nodes[0]?.image?.height || 100,
|
9115
|
+
id: product?.selectedVariant?.image?.id || product?.variants?.nodes[0]?.image?.id || "",
|
9116
|
+
url: product?.selectedVariant?.image?.url || product?.variants?.nodes[0]?.image?.url || "",
|
9117
|
+
width: product?.selectedVariant?.image?.width || product?.variants?.nodes[0]?.image?.width || 100
|
8991
9118
|
},
|
8992
9119
|
priceV2: {
|
8993
|
-
amount: product?.selectedVariant?.price.amount || "",
|
8994
|
-
currencyCode: product?.selectedVariant?.price.currencyCode || "USD"
|
9120
|
+
amount: product?.selectedVariant?.price.amount || product?.variants?.nodes[0]?.price.amount || "",
|
9121
|
+
currencyCode: product?.selectedVariant?.price.currencyCode || product?.variants?.nodes[0]?.price.currencyCode || "USD"
|
8995
9122
|
},
|
8996
9123
|
product: {
|
8997
9124
|
handle: product?.handle || "",
|
@@ -8999,9 +9126,9 @@ var convertToRebuyProduct = (isHydrogenReact, product) => {
|
|
8999
9126
|
title: product?.title || "",
|
9000
9127
|
vendor: product?.vendor || ""
|
9001
9128
|
},
|
9002
|
-
selectedOptions: product?.selectedVariant?.selectedOptions || [],
|
9003
|
-
sku: product?.selectedVariant?.sku || "",
|
9004
|
-
title: product?.selectedVariant?.title || ""
|
9129
|
+
selectedOptions: product?.selectedVariant?.selectedOptions || product?.variants?.nodes[0]?.selectedOptions || [],
|
9130
|
+
sku: product?.selectedVariant?.sku || product?.variants?.nodes[0]?.sku || "",
|
9131
|
+
title: product?.selectedVariant?.title || product?.variants?.nodes[0]?.title || ""
|
9005
9132
|
},
|
9006
9133
|
sellingPlanGroups: [],
|
9007
9134
|
seo: {
|
@@ -9128,19 +9255,18 @@ var convertToRebuyProduct = (isHydrogenReact, product) => {
|
|
9128
9255
|
// src/widgets/RebuyDynamicBundleProducts/BundleImages.tsx
|
9129
9256
|
import { Image as Image2 } from "@shopify/hydrogen";
|
9130
9257
|
import { Fragment as Fragment11 } from "react";
|
9131
|
-
import { Link as Link2 } from "react-router";
|
9132
9258
|
|
9133
9259
|
// src/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.module.css
|
9134
9260
|
var result24 = { "container": "RebuyDynamicBundleProducts_container", "addCartBtnContainer": "RebuyDynamicBundleProducts_addCartBtnContainer", "bundleContainer": "RebuyDynamicBundleProducts_bundleContainer", "select": "RebuyDynamicBundleProducts_select", "bundleItemRowContainer": "RebuyDynamicBundleProducts_bundleItemRowContainer", "unselected": "RebuyDynamicBundleProducts_unselected", "bundleItemRow": "RebuyDynamicBundleProducts_bundleItemRow", "bundleItemInput": "RebuyDynamicBundleProducts_bundleItemInput", "bundleItemLabel": "RebuyDynamicBundleProducts_bundleItemLabel", "bundleImages": "RebuyDynamicBundleProducts_bundleImages", "bundleImage": "RebuyDynamicBundleProducts_bundleImage", "bundleImageDelimiter": "RebuyDynamicBundleProducts_bundleImageDelimiter", "compareAtPrice": "RebuyDynamicBundleProducts_compareAtPrice" };
|
9135
9261
|
var RebuyDynamicBundleProducts_default = result24;
|
9136
9262
|
|
9137
9263
|
// src/widgets/RebuyDynamicBundleProducts/BundleImages.tsx
|
9138
|
-
import { Fragment as Fragment12, jsx as
|
9264
|
+
import { Fragment as Fragment12, jsx as jsx44, jsxs as jsxs26 } from "react/jsx-runtime";
|
9139
9265
|
var BundleImages = ({ products }) => {
|
9140
9266
|
const selected = products.filter((product) => product.selected);
|
9141
|
-
return /* @__PURE__ */
|
9267
|
+
return /* @__PURE__ */ jsx44("ul", { className: RebuyDynamicBundleProducts_default.bundleImages, children: products.map((product, index) => {
|
9142
9268
|
const image = product.selectedVariant?.image;
|
9143
|
-
const productImage = image ? /* @__PURE__ */
|
9269
|
+
const productImage = image ? /* @__PURE__ */ jsx44(
|
9144
9270
|
Image2,
|
9145
9271
|
{
|
9146
9272
|
alt: image.altText || `Picture of ${product.title}`,
|
@@ -9155,24 +9281,79 @@ var BundleImages = ({ products }) => {
|
|
9155
9281
|
product.title
|
9156
9282
|
);
|
9157
9283
|
const showDelimiter = selected[0]?.id !== product.id;
|
9158
|
-
return /* @__PURE__ */
|
9159
|
-
showDelimiter && /* @__PURE__ */
|
9160
|
-
/* @__PURE__ */
|
9284
|
+
return /* @__PURE__ */ jsx44(Fragment11, { children: product.selected && /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
9285
|
+
showDelimiter && /* @__PURE__ */ jsx44("li", { className: RebuyDynamicBundleProducts_default.bundleImageDelimiter, children: /* @__PURE__ */ jsx44("span", { children: "+" }) }),
|
9286
|
+
/* @__PURE__ */ jsx44("li", { className: "flex items-center", children: product.default ? (
|
9161
9287
|
// Already on product page
|
9162
9288
|
productImage
|
9163
9289
|
) : (
|
9164
9290
|
// Link to product
|
9165
|
-
/* @__PURE__ */
|
9291
|
+
/* @__PURE__ */ jsx44(
|
9292
|
+
RebuyLink,
|
9293
|
+
{
|
9294
|
+
ariaLabel: `View ${product.title}`,
|
9295
|
+
handle: `/products/${product.handle}`,
|
9296
|
+
children: productImage
|
9297
|
+
}
|
9298
|
+
)
|
9166
9299
|
) })
|
9167
9300
|
] }) }, product.id + "-BundleImages-" + index);
|
9168
9301
|
}) });
|
9169
9302
|
};
|
9170
9303
|
|
9304
|
+
// src/widgets/RebuyDynamicBundleProducts/BundlePrice.tsx
|
9305
|
+
import { Money as Money4 } from "@shopify/hydrogen";
|
9306
|
+
import { jsx as jsx45, jsxs as jsxs27 } from "react/jsx-runtime";
|
9307
|
+
var BundlePrice = ({ products }) => {
|
9308
|
+
const isDisabled = products.filter((product) => product.selected).length < 1;
|
9309
|
+
const totalBundlePrice = () => {
|
9310
|
+
let total = 0;
|
9311
|
+
let currencyCode = "USD";
|
9312
|
+
for (const product of products) {
|
9313
|
+
if (product.selected && product.selectedVariant) {
|
9314
|
+
const { priceV2: price2 } = product.selectedVariant;
|
9315
|
+
total += Number(price2?.amount);
|
9316
|
+
currencyCode = price2?.currencyCode || "USD";
|
9317
|
+
}
|
9318
|
+
}
|
9319
|
+
return {
|
9320
|
+
amount: String(total),
|
9321
|
+
currencyCode
|
9322
|
+
};
|
9323
|
+
};
|
9324
|
+
const totalBundleCompareAtPrice = () => {
|
9325
|
+
let compareAtTotal = 0;
|
9326
|
+
let currencyCode = "USD";
|
9327
|
+
for (const product of products) {
|
9328
|
+
if (product.selected && product.selectedVariant) {
|
9329
|
+
const { compareAtPriceV2: compareAtPrice2, priceV2: price2 } = product.selectedVariant;
|
9330
|
+
currencyCode = price2?.currencyCode || "USD";
|
9331
|
+
compareAtTotal += Number((compareAtPrice2 || price2)?.amount);
|
9332
|
+
}
|
9333
|
+
}
|
9334
|
+
return {
|
9335
|
+
amount: String(compareAtTotal),
|
9336
|
+
currencyCode
|
9337
|
+
};
|
9338
|
+
};
|
9339
|
+
const isDiscounted = (price2, compareAtPrice2) => Number(compareAtPrice2?.amount) > Number(price2?.amount);
|
9340
|
+
const price = totalBundlePrice();
|
9341
|
+
const compareAtPrice = totalBundleCompareAtPrice();
|
9342
|
+
const CompareAtPrice = ({ data: compareAtPrice2 }) => {
|
9343
|
+
return compareAtPrice2 && /* @__PURE__ */ jsx45(Money4, { as: "span", className: RebuyDynamicBundleProducts_default.compareAtPrice, data: compareAtPrice2, withoutTrailingZeros: true });
|
9344
|
+
};
|
9345
|
+
return products.length > 0 && /* @__PURE__ */ jsx45("div", { className: "flex items-center flex-col", children: !isDisabled && /* @__PURE__ */ jsxs27("p", { className: "flex items-center gap-2 mb-2", children: [
|
9346
|
+
/* @__PURE__ */ jsx45("span", { children: "Total Price:" }),
|
9347
|
+
/* @__PURE__ */ jsx45(Money4, { as: "span", data: price, withoutTrailingZeros: true }),
|
9348
|
+
isDiscounted(price, compareAtPrice) && /* @__PURE__ */ jsx45(CompareAtPrice, { data: compareAtPrice })
|
9349
|
+
] }) });
|
9350
|
+
};
|
9351
|
+
|
9171
9352
|
// src/widgets/RebuyDynamicBundleProducts/BundleSelection.tsx
|
9172
9353
|
import clsx14 from "clsx";
|
9173
9354
|
|
9174
9355
|
// src/widgets/RebuyDynamicBundleProducts/Select.tsx
|
9175
|
-
import { jsx as
|
9356
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
9176
9357
|
var Select = ({ onSelectVariant, product }) => {
|
9177
9358
|
const getOptionsLabel = (product2) => {
|
9178
9359
|
const options = product2.variants.nodes[0].selectedOptions;
|
@@ -9181,30 +9362,30 @@ var Select = ({ onSelectVariant, product }) => {
|
|
9181
9362
|
const useValues = optionsFromKeys.every((key) => ["name", "value"].includes(key));
|
9182
9363
|
return (useValues ? optionsFromValues : optionsFromKeys).join(" / ");
|
9183
9364
|
};
|
9184
|
-
return product && /* @__PURE__ */
|
9365
|
+
return product && /* @__PURE__ */ jsx46(
|
9185
9366
|
"select",
|
9186
9367
|
{
|
9187
9368
|
"aria-label": "select variant",
|
9188
9369
|
className: RebuyDynamicBundleProducts_default.select,
|
9189
9370
|
onChange: (e) => onSelectVariant(product, e.target.value),
|
9190
9371
|
value: product.selectedVariant.id,
|
9191
|
-
children: /* @__PURE__ */
|
9372
|
+
children: /* @__PURE__ */ jsx46("optgroup", { label: getOptionsLabel(product), children: product.variants.nodes.map(({ id, title }) => /* @__PURE__ */ jsx46("option", { value: id, children: title }, id + "-BundleVariant")) })
|
9192
9373
|
}
|
9193
9374
|
);
|
9194
9375
|
};
|
9195
9376
|
|
9196
9377
|
// src/widgets/RebuyDynamicBundleProducts/BundleSelection.tsx
|
9197
|
-
import { jsx as
|
9378
|
+
import { jsx as jsx47, jsxs as jsxs28 } from "react/jsx-runtime";
|
9198
9379
|
var BundleSelection = ({ onSelectVariant, onToggleBundleItem, products }) => {
|
9199
|
-
return /* @__PURE__ */
|
9380
|
+
return /* @__PURE__ */ jsx47("ul", { children: products.map((product, index) => {
|
9200
9381
|
const { availableForSale } = product.selectedVariant;
|
9201
9382
|
const isOutOfStock = !availableForSale;
|
9202
|
-
return /* @__PURE__ */
|
9383
|
+
return /* @__PURE__ */ jsx47(
|
9203
9384
|
"li",
|
9204
9385
|
{
|
9205
9386
|
className: clsx14(RebuyDynamicBundleProducts_default.bundleItemRowContainer, !product.selected && RebuyDynamicBundleProducts_default.unselected),
|
9206
|
-
children: /* @__PURE__ */
|
9207
|
-
/* @__PURE__ */
|
9387
|
+
children: /* @__PURE__ */ jsxs28("div", { className: RebuyDynamicBundleProducts_default.bundleItemRow, children: [
|
9388
|
+
/* @__PURE__ */ jsx47(
|
9208
9389
|
"input",
|
9209
9390
|
{
|
9210
9391
|
checked: product.selected && availableForSale,
|
@@ -9216,14 +9397,14 @@ var BundleSelection = ({ onSelectVariant, onToggleBundleItem, products }) => {
|
|
9216
9397
|
value: product.id
|
9217
9398
|
}
|
9218
9399
|
),
|
9219
|
-
/* @__PURE__ */
|
9220
|
-
/* @__PURE__ */
|
9221
|
-
isOutOfStock && /* @__PURE__ */
|
9222
|
-
product.default && /* @__PURE__ */
|
9400
|
+
/* @__PURE__ */ jsxs28("div", { className: RebuyDynamicBundleProducts_default.bundleItemInput, children: [
|
9401
|
+
/* @__PURE__ */ jsxs28("label", { className: RebuyDynamicBundleProducts_default.bundleItemLabel, htmlFor: `${product.id}-toggle`, children: [
|
9402
|
+
isOutOfStock && /* @__PURE__ */ jsx47("b", { children: "SOLD OUT" }),
|
9403
|
+
product.default && /* @__PURE__ */ jsx47("b", { children: "This item:" }),
|
9223
9404
|
product.title,
|
9224
|
-
/* @__PURE__ */
|
9405
|
+
/* @__PURE__ */ jsx47(RebuyProductPrice, { selectedVariant: product.selectedVariant })
|
9225
9406
|
] }),
|
9226
|
-
product.variants.nodes.length > 1 && /* @__PURE__ */
|
9407
|
+
product.variants.nodes.length > 1 && /* @__PURE__ */ jsx47(Select, { onSelectVariant, product })
|
9227
9408
|
] })
|
9228
9409
|
] })
|
9229
9410
|
},
|
@@ -9232,56 +9413,8 @@ var BundleSelection = ({ onSelectVariant, onToggleBundleItem, products }) => {
|
|
9232
9413
|
}) });
|
9233
9414
|
};
|
9234
9415
|
|
9235
|
-
// src/widgets/RebuyDynamicBundleProducts/BundlePrice.tsx
|
9236
|
-
import { Money as Money4 } from "@shopify/hydrogen";
|
9237
|
-
import { jsx as jsx46, jsxs as jsxs28 } from "react/jsx-runtime";
|
9238
|
-
var BundlePrice = ({ products }) => {
|
9239
|
-
const isDisabled = products.filter((product) => product.selected).length < 1;
|
9240
|
-
const totalBundlePrice = () => {
|
9241
|
-
let total = 0;
|
9242
|
-
let currencyCode = "USD";
|
9243
|
-
for (const product of products) {
|
9244
|
-
if (product.selected && product.selectedVariant) {
|
9245
|
-
const { priceV2: price2 } = product.selectedVariant;
|
9246
|
-
total += Number(price2?.amount);
|
9247
|
-
currencyCode = price2?.currencyCode || "USD";
|
9248
|
-
}
|
9249
|
-
}
|
9250
|
-
return {
|
9251
|
-
amount: String(total),
|
9252
|
-
currencyCode
|
9253
|
-
};
|
9254
|
-
};
|
9255
|
-
const totalBundleCompareAtPrice = () => {
|
9256
|
-
let compareAtTotal = 0;
|
9257
|
-
let currencyCode = "USD";
|
9258
|
-
for (const product of products) {
|
9259
|
-
if (product.selected && product.selectedVariant) {
|
9260
|
-
const { compareAtPriceV2: compareAtPrice2, priceV2: price2 } = product.selectedVariant;
|
9261
|
-
currencyCode = price2?.currencyCode || "USD";
|
9262
|
-
compareAtTotal += Number((compareAtPrice2 || price2)?.amount);
|
9263
|
-
}
|
9264
|
-
}
|
9265
|
-
return {
|
9266
|
-
amount: String(compareAtTotal),
|
9267
|
-
currencyCode
|
9268
|
-
};
|
9269
|
-
};
|
9270
|
-
const isDiscounted = (price2, compareAtPrice2) => Number(compareAtPrice2?.amount) > Number(price2?.amount);
|
9271
|
-
const price = totalBundlePrice();
|
9272
|
-
const compareAtPrice = totalBundleCompareAtPrice();
|
9273
|
-
const CompareAtPrice = ({ data: compareAtPrice2 }) => {
|
9274
|
-
return compareAtPrice2 && /* @__PURE__ */ jsx46(Money4, { as: "span", className: RebuyDynamicBundleProducts_default.compareAtPrice, data: compareAtPrice2, withoutTrailingZeros: true });
|
9275
|
-
};
|
9276
|
-
return products.length > 0 && /* @__PURE__ */ jsx46("div", { className: "flex items-center flex-col", children: !isDisabled && /* @__PURE__ */ jsxs28("p", { className: "flex items-center gap-2 mb-2", children: [
|
9277
|
-
/* @__PURE__ */ jsx46("span", { children: "Total Price:" }),
|
9278
|
-
/* @__PURE__ */ jsx46(Money4, { as: "span", data: price, withoutTrailingZeros: true }),
|
9279
|
-
isDiscounted(price, compareAtPrice) && /* @__PURE__ */ jsx46(CompareAtPrice, { data: compareAtPrice })
|
9280
|
-
] }) });
|
9281
|
-
};
|
9282
|
-
|
9283
9416
|
// src/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.tsx
|
9284
|
-
import { jsx as
|
9417
|
+
import { jsx as jsx48, jsxs as jsxs29 } from "react/jsx-runtime";
|
9285
9418
|
var RebuyDynamicBundleProducts = (props) => {
|
9286
9419
|
const {
|
9287
9420
|
addToCartBtnText = "Add to cart",
|
@@ -9328,11 +9461,11 @@ var RebuyDynamicBundleProducts = (props) => {
|
|
9328
9461
|
return null;
|
9329
9462
|
}
|
9330
9463
|
return /* @__PURE__ */ jsxs29("section", { className: RebuyDynamicBundleProducts_default.container, children: [
|
9331
|
-
/* @__PURE__ */
|
9464
|
+
/* @__PURE__ */ jsx48(Title, { level: getTitleLevel(customTitleLevel), style: customTitleStyle, text: customTitle }),
|
9332
9465
|
/* @__PURE__ */ jsxs29("div", { className: RebuyDynamicBundleProducts_default.bundleContainer, children: [
|
9333
|
-
/* @__PURE__ */
|
9334
|
-
/* @__PURE__ */
|
9335
|
-
/* @__PURE__ */
|
9466
|
+
/* @__PURE__ */ jsx48(BundleImages, { products: bundleProducts }),
|
9467
|
+
/* @__PURE__ */ jsx48(BundlePrice, { products: bundleProducts }),
|
9468
|
+
/* @__PURE__ */ jsx48("div", { className: RebuyDynamicBundleProducts_default.addCartBtnContainer, children: /* @__PURE__ */ jsx48(
|
9336
9469
|
AddToCartBtn,
|
9337
9470
|
{
|
9338
9471
|
addToCartBtnText,
|
@@ -9344,7 +9477,7 @@ var RebuyDynamicBundleProducts = (props) => {
|
|
9344
9477
|
})
|
9345
9478
|
}
|
9346
9479
|
) }),
|
9347
|
-
/* @__PURE__ */
|
9480
|
+
/* @__PURE__ */ jsx48(
|
9348
9481
|
BundleSelection,
|
9349
9482
|
{
|
9350
9483
|
onSelectVariant,
|
@@ -9362,14 +9495,13 @@ import { useCallback as useCallback16, useEffect as useEffect24, useState as use
|
|
9362
9495
|
|
9363
9496
|
// src/widgets/RebuyProductAddOns/RebuyProductAddOnCard.tsx
|
9364
9497
|
import { Image as Image3 } from "@shopify/hydrogen";
|
9365
|
-
import { Link as Link3 } from "react-router";
|
9366
9498
|
|
9367
9499
|
// src/widgets/RebuyProductAddOns/RebuyProductAddOns.module.css
|
9368
9500
|
var result25 = { "container": "RebuyProductAddOns_container", "productAddOnsList": "RebuyProductAddOns_productAddOnsList", "addOnCard": "RebuyProductAddOns_addOnCard", "addOnCardContent": "RebuyProductAddOns_addOnCardContent", "addOnCardInput": "RebuyProductAddOns_addOnCardInput", "addOnCardContentImage": "RebuyProductAddOns_addOnCardContentImage", "addOnCardOutOfStock": "RebuyProductAddOns_addOnCardOutOfStock", "addOnCardTextContent": "RebuyProductAddOns_addOnCardTextContent", "addOnCardLearnMore": "RebuyProductAddOns_addOnCardLearnMore", "addCartBtnContainer": "RebuyProductAddOns_addCartBtnContainer", "productAddOnsFooter": "RebuyProductAddOns_productAddOnsFooter", "moneyContainer": "RebuyProductAddOns_moneyContainer" };
|
9369
9501
|
var RebuyProductAddOns_default = result25;
|
9370
9502
|
|
9371
9503
|
// src/widgets/RebuyProductAddOns/RebuyProductAddOnCard.tsx
|
9372
|
-
import { jsx as
|
9504
|
+
import { jsx as jsx49, jsxs as jsxs30 } from "react/jsx-runtime";
|
9373
9505
|
var RebuyProductAddOnCard = ({
|
9374
9506
|
handleChange,
|
9375
9507
|
learnMoreText,
|
@@ -9378,8 +9510,8 @@ var RebuyProductAddOnCard = ({
|
|
9378
9510
|
titleLevel
|
9379
9511
|
}) => {
|
9380
9512
|
const { availableForSale, image } = product.selectedVariant || {};
|
9381
|
-
return /* @__PURE__ */
|
9382
|
-
/* @__PURE__ */
|
9513
|
+
return /* @__PURE__ */ jsx49("label", { className: RebuyProductAddOns_default.addOnCard, htmlFor: product.id, children: /* @__PURE__ */ jsxs30("div", { className: RebuyProductAddOns_default.addOnCardContent, children: [
|
9514
|
+
/* @__PURE__ */ jsx49(
|
9383
9515
|
"input",
|
9384
9516
|
{
|
9385
9517
|
checked: Boolean(product.selected),
|
@@ -9392,7 +9524,7 @@ var RebuyProductAddOnCard = ({
|
|
9392
9524
|
value: ""
|
9393
9525
|
}
|
9394
9526
|
),
|
9395
|
-
/* @__PURE__ */
|
9527
|
+
/* @__PURE__ */ jsx49("div", { className: RebuyProductAddOns_default.addOnCardContentImage, children: image && /* @__PURE__ */ jsx49(
|
9396
9528
|
Image3,
|
9397
9529
|
{
|
9398
9530
|
alt: image.altText || `Picture of ${product.title}`,
|
@@ -9402,16 +9534,24 @@ var RebuyProductAddOnCard = ({
|
|
9402
9534
|
}
|
9403
9535
|
) }),
|
9404
9536
|
/* @__PURE__ */ jsxs30("div", { className: RebuyProductAddOns_default.addOnCardTextContent, children: [
|
9405
|
-
!availableForSale && /* @__PURE__ */
|
9406
|
-
/* @__PURE__ */
|
9407
|
-
/* @__PURE__ */
|
9408
|
-
/* @__PURE__ */
|
9537
|
+
!availableForSale && /* @__PURE__ */ jsx49("p", { className: RebuyProductAddOns_default.addOnCardOutOfStock, children: outOfStockText }),
|
9538
|
+
/* @__PURE__ */ jsx49(Title, { level: titleLevel, text: product.title }),
|
9539
|
+
/* @__PURE__ */ jsx49(RebuyProductPrice, { selectedVariant: product.selectedVariant }),
|
9540
|
+
/* @__PURE__ */ jsx49(
|
9541
|
+
RebuyLink,
|
9542
|
+
{
|
9543
|
+
ariaLabel: `View ${product.title}`,
|
9544
|
+
className: RebuyProductAddOns_default.addOnCardLearnMore,
|
9545
|
+
handle: `/products/${product.handle}`,
|
9546
|
+
children: learnMoreText
|
9547
|
+
}
|
9548
|
+
)
|
9409
9549
|
] })
|
9410
9550
|
] }) });
|
9411
9551
|
};
|
9412
9552
|
|
9413
9553
|
// src/widgets/RebuyProductAddOns/RebuyProductAddOns.tsx
|
9414
|
-
import { jsx as
|
9554
|
+
import { jsx as jsx50, jsxs as jsxs31 } from "react/jsx-runtime";
|
9415
9555
|
var RebuyProductAddOns = (props) => {
|
9416
9556
|
const {
|
9417
9557
|
addToCartCallback,
|
@@ -9431,6 +9571,7 @@ var RebuyProductAddOns = (props) => {
|
|
9431
9571
|
const [addedItems, setAddedItems] = useState23(products);
|
9432
9572
|
const [subtotalWithProduct, setSubtotalWithProduct] = useState23();
|
9433
9573
|
const [subtotalWithOutProduct, setSubtotalWithOutProduct] = useState23();
|
9574
|
+
const convertedProduct = convertToRebuyProduct(isHydrogenReact || false, product);
|
9434
9575
|
useEffect24(() => {
|
9435
9576
|
let initialTotal = 0;
|
9436
9577
|
let currencyCode = "USD";
|
@@ -9449,14 +9590,14 @@ var RebuyProductAddOns = (props) => {
|
|
9449
9590
|
setSubtotalWithOutProduct({
|
9450
9591
|
amount: String(
|
9451
9592
|
initialTotal - Number(
|
9452
|
-
isHydrogenReact ?
|
9593
|
+
isHydrogenReact ? convertedProduct?.selectedVariant?.priceV2?.amount : product?.selectedOrFirstAvailableVariant?.price.amount
|
9453
9594
|
)
|
9454
9595
|
),
|
9455
9596
|
currencyCode
|
9456
9597
|
});
|
9457
9598
|
setAddedItems(products);
|
9458
9599
|
if (includeMainProduct) {
|
9459
|
-
setAddedItems([
|
9600
|
+
setAddedItems([convertedProduct, ...products]);
|
9460
9601
|
} else {
|
9461
9602
|
setAddedItems(products);
|
9462
9603
|
}
|
@@ -9496,7 +9637,7 @@ var RebuyProductAddOns = (props) => {
|
|
9496
9637
|
setSubtotalWithOutProduct({
|
9497
9638
|
amount: String(
|
9498
9639
|
total - Number(
|
9499
|
-
isHydrogenReact ?
|
9640
|
+
isHydrogenReact ? convertedProduct?.selectedVariant?.priceV2?.amount : product?.selectedOrFirstAvailableVariant?.price.amount
|
9500
9641
|
)
|
9501
9642
|
),
|
9502
9643
|
currencyCode
|
@@ -9507,8 +9648,8 @@ var RebuyProductAddOns = (props) => {
|
|
9507
9648
|
return null;
|
9508
9649
|
}
|
9509
9650
|
return /* @__PURE__ */ jsxs31("div", { className: RebuyProductAddOns_default.container, children: [
|
9510
|
-
/* @__PURE__ */
|
9511
|
-
/* @__PURE__ */
|
9651
|
+
/* @__PURE__ */ jsx50(Title, { level: getTitleLevel(customTitleLevel), style: customTitleStyle, text: customTitle }),
|
9652
|
+
/* @__PURE__ */ jsx50("ul", { className: RebuyProductAddOns_default.productAddOnsList, children: products.map((product2) => /* @__PURE__ */ jsx50("li", { children: /* @__PURE__ */ jsx50(
|
9512
9653
|
RebuyProductAddOnCard,
|
9513
9654
|
{
|
9514
9655
|
handleChange,
|
@@ -9521,13 +9662,13 @@ var RebuyProductAddOns = (props) => {
|
|
9521
9662
|
/* @__PURE__ */ jsxs31("div", { className: RebuyProductAddOns_default.productAddOnsFooter, children: [
|
9522
9663
|
/* @__PURE__ */ jsxs31("div", { className: RebuyProductAddOns_default.moneyContainer, children: [
|
9523
9664
|
subtotalText,
|
9524
|
-
subtotalWithOutProduct && /* @__PURE__ */
|
9665
|
+
subtotalWithOutProduct && /* @__PURE__ */ jsx50(Money5, { data: subtotalWithOutProduct, withoutTrailingZeros: true })
|
9525
9666
|
] }),
|
9526
9667
|
includeMainProduct && /* @__PURE__ */ jsxs31("div", { className: RebuyProductAddOns_default.moneyContainer, children: [
|
9527
9668
|
withProductText,
|
9528
|
-
subtotalWithProduct && /* @__PURE__ */
|
9669
|
+
subtotalWithProduct && /* @__PURE__ */ jsx50(Money5, { data: subtotalWithProduct, withoutTrailingZeros: true })
|
9529
9670
|
] }),
|
9530
|
-
/* @__PURE__ */
|
9671
|
+
/* @__PURE__ */ jsx50("div", { className: RebuyProductAddOns_default.addCartBtnContainer, children: includeMainProduct ? /* @__PURE__ */ jsx50(
|
9531
9672
|
AddToCartBtn,
|
9532
9673
|
{
|
9533
9674
|
addToCartBtnText,
|
@@ -9537,7 +9678,7 @@ var RebuyProductAddOns = (props) => {
|
|
9537
9678
|
moneyData: subtotalWithProduct,
|
9538
9679
|
selectedVariants: addedItems.map((item) => item.selectedVariant)
|
9539
9680
|
}
|
9540
|
-
) : /* @__PURE__ */
|
9681
|
+
) : /* @__PURE__ */ jsx50(
|
9541
9682
|
AddToCartBtn,
|
9542
9683
|
{
|
9543
9684
|
addToCartBtnText,
|
@@ -9557,7 +9698,7 @@ var result26 = { "container": "RebuyProductRecommendations_container", "productG
|
|
9557
9698
|
var RebuyProductRecommendations_default = result26;
|
9558
9699
|
|
9559
9700
|
// src/widgets/RebuyProductRecommendations/RebuyProductRecommendations.tsx
|
9560
|
-
import { jsx as
|
9701
|
+
import { jsx as jsx51, jsxs as jsxs32 } from "react/jsx-runtime";
|
9561
9702
|
var RebuyProductRecommendations = (props) => {
|
9562
9703
|
const {
|
9563
9704
|
addToCartBtnText = "Add to cart",
|
@@ -9572,8 +9713,8 @@ var RebuyProductRecommendations = (props) => {
|
|
9572
9713
|
return null;
|
9573
9714
|
}
|
9574
9715
|
return /* @__PURE__ */ jsxs32("section", { className: RebuyProductRecommendations_default.container, children: [
|
9575
|
-
/* @__PURE__ */
|
9576
|
-
/* @__PURE__ */
|
9716
|
+
/* @__PURE__ */ jsx51(Title, { level: getTitleLevel(customTitleLevel), style: customTitleStyle, text: customTitle }),
|
9717
|
+
/* @__PURE__ */ jsx51("ul", { className: RebuyProductRecommendations_default.productGrid, children: products.map((product) => /* @__PURE__ */ jsx51("li", { children: /* @__PURE__ */ jsx51(
|
9577
9718
|
ProductCard,
|
9578
9719
|
{
|
9579
9720
|
addToCartBtnText,
|
@@ -9666,7 +9807,7 @@ var result27 = { "rebuy-recently-viewed-products-container": "RebuyRecentlyViewe
|
|
9666
9807
|
var RebuyRecentlyViewedProducts_default = result27;
|
9667
9808
|
|
9668
9809
|
// src/widgets/RebuyRecentlyViewedProducts/RebuyRecentlyViewedProducts.tsx
|
9669
|
-
import { jsx as
|
9810
|
+
import { jsx as jsx52, jsxs as jsxs33 } from "react/jsx-runtime";
|
9670
9811
|
var RebuyRecentlyViewedProducts = (props) => {
|
9671
9812
|
const {
|
9672
9813
|
addToCartBtnText = "Add to cart",
|
@@ -9756,8 +9897,8 @@ var RebuyRecentlyViewedProducts = (props) => {
|
|
9756
9897
|
return null;
|
9757
9898
|
}
|
9758
9899
|
return /* @__PURE__ */ jsxs33("div", { className: RebuyRecentlyViewedProducts_default["rebuy-recently-viewed-products-container"], children: [
|
9759
|
-
/* @__PURE__ */
|
9760
|
-
/* @__PURE__ */
|
9900
|
+
/* @__PURE__ */ jsx52(Title, { level: getTitleLevel(customTitleLevel), style: customTitleStyle, text: customTitle }),
|
9901
|
+
/* @__PURE__ */ jsx52("ul", { className: RebuyRecentlyViewedProducts_default["product-grid"], children: products?.map((product) => /* @__PURE__ */ jsx52("li", { children: /* @__PURE__ */ jsx52(
|
9761
9902
|
ProductCard,
|
9762
9903
|
{
|
9763
9904
|
addToCartBtnText,
|