@best-bundles/bundle-ui 0.0.40 → 0.0.41
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/dist/index.js +282 -282
- package/dist/index.js.map +1 -1
- package/dist/liquid/bundle-ui.iife.js +13 -13
- package/dist/liquid/bundle-ui.iife.js.map +1 -1
- package/dist/utils/stock.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('._button_18rtl_1{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--bb-font-family, inherit);border:1px solid var(--bb-button-border, rgba(0, 0, 0, .12));background:var(--bb-button-bg, #111827);color:var(--bb-button-text, #ffffff);font:inherit;line-height:1;padding:10px 14px;border-radius:var(--bb-button-radius, 10px);cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease,opacity .12s ease}._button_18rtl_1:hover{background:var(--bb-button-bg-hover, #0b1220)}._button_18rtl_1:active{transform:translateY(1px)}._button_18rtl_1:disabled{opacity:.6;cursor:not-allowed}._button_18rtl_1:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._backdrop_ta0om_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 2147483647);display:flex;justify-content:flex-end;background:var(--bb-backdrop-bg, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(var(--bb-backdrop-blur, 2px));backdrop-filter:blur(var(--bb-backdrop-blur, 2px));padding:var(--bb-backdrop-padding, 12px);opacity:0;transition:opacity var(--bb-drawer-transition-duration, .22s) ease}._celebrationOverlay_ta0om_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_ta0om_23{font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.03em;font-size:18px;line-height:1;padding:12px 16px;border-radius:999px;color:var(--bb-celebration-text, #0b1b44);background:linear-gradient(180deg,var(--bb-celebration-bg-top, #ffffff),var(--bb-celebration-bg-bottom, #bae6fd));border:2px solid var(--bb-celebration-border, rgba(37, 99, 235, .28));box-shadow:0 18px 55px #0006,0 10px 28px #2563eb33,inset 0 1px #ffffffbf;transform-origin:50% 60%;will-change:transform,opacity,filter;animation:_bbCelebrationPop_ta0om_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_ta0om_1{0%{opacity:0;transform:translateY(10px) scale(.6);filter:blur(1px) saturate(1.1)}12%{opacity:1;transform:translateY(0) scale(1.12);filter:blur(0px) saturate(1.1)}22%{opacity:1;transform:translateY(0) scale(1)}80%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-10px) scale(.98)}}._backdropOpen_ta0om_74{opacity:1}._backdropClosed_ta0om_78{opacity:0}._panel_ta0om_82{width:440px;max-width:100%;min-width:0;height:100%;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);border-radius:var(--bb-panel-radius, 16px);box-shadow:0 20px 60px #00000059;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden;outline:none;position:relative;top:unset;right:unset;bottom:unset;left:unset}._panelOpen_ta0om_103{animation:_bbSlideInFromRight_ta0om_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_ta0om_107{animation:_bbSlideOutToRight_ta0om_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_ta0om_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_ta0om_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_ta0om_1{transition:none}._celebrationChip_ta0om_23,._panelOpen_ta0om_103,._panelClosed_ta0om_107{animation:none}}._header_ta0om_146{display:grid;grid-template-columns:36px 1fr 36px;align-items:center;column-gap:12px;padding:var(--bb-header-padding, 16px 16px 12px 16px);border-bottom:1px solid var(--bb-border-color, rgba(17, 24, 39, .08))}._headerCenter_ta0om_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_ta0om_163{font-size:24px;margin:0;line-height:1.2;font-family:var(--bb-font-family-title, "Bebas Neue", "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.02em;color:var(--bb-title-color, var(--bb-text-color, #111827))}._searchIconButton_ta0om_172{width:36px;height:36px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0}._searchIconButton_ta0om_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_ta0om_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_ta0om_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_ta0om_199{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;pointer-events:none;opacity:0;transform:translateY(-2px);transition:opacity .18s ease,transform .22s ease}._headerSearchOpen_ta0om_211 ._headerTitleWrap_ta0om_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_ta0om_211 ._headerSearchWrap_ta0om_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_ta0om_223{width:min(320px,100%);height:36px;display:flex;align-items:center;gap:8px;background:var(--bb-surface-bg, #ffffff);border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));border-radius:10px;padding:0 8px}._searchInput_ta0om_235{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_ta0om_235::-webkit-search-cancel-button,._searchInput_ta0om_235::-webkit-search-decoration,._searchInput_ta0om_235::-webkit-search-results-button,._searchInput_ta0om_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_ta0om_256{border:none;background:transparent;color:var(--bb-text-color, #111827);font:inherit;font-size:13px;font-weight:700;cursor:pointer;padding:6px;border-radius:10px;line-height:1}._searchClearButton_ta0om_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_ta0om_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_ta0om_278{border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);width:36px;height:36px;border-radius:10px;cursor:pointer;flex:0 0 auto;padding:0}._closeButton_ta0om_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_ta0om_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_ta0om_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_ta0om_195,._headerSearchWrap_ta0om_199{transition:none}}._body_ta0om_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_ta0om_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_ta0om_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_ta0om_327{margin-top:4px}._variantList_ta0om_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_ta0om_339{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_ta0om_347{opacity:.65}._variantLeft_ta0om_351{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_ta0om_358{height:100%;align-self:stretch;border-radius:12px;border:none;background:var(--bb-cta-bg, #91aae5);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:800;padding:0 16px;cursor:pointer;white-space:nowrap}._addToBundleButton_ta0om_358:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_ta0om_358:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_ta0om_358:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_ta0om_386{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._stockLimitContainer_ta0om_394{display:flex;align-items:center;justify-content:center;height:100%;max-width:120px;padding:0 12px}._soldOut_ta0om_386{align-self:center;text-align:center;color:var(--bb-muted-color, rgba(17, 24, 39));font-size:.9em;font-weight:600;pointer-events:none}._stockLimitNotice_ta0om_412{color:var(--bb-muted-color, rgba(17, 24, 39, .72));font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;text-align:center}._variantThumb_ta0om_421{width:60px;height:60px;border-radius:12px;overflow:hidden;border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));flex:0 0 auto}._variantThumbImg_ta0om_431{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_ta0om_438{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_ta0om_448{min-width:0}._variantName_ta0om_452{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_ta0om_461{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_ta0om_469{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_ta0om_476{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_ta0om_469{font-size:13px;font-weight:800}._qtyControls_ta0om_487{display:inline-flex;align-items:center;gap:6px}._qtyControlsWrap_ta0om_493{display:grid;justify-items:center;gap:4px}._qtyButton_ta0om_499{padding:0;width:34px;height:34px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);cursor:pointer;line-height:1;font-size:16px}._qtyButton_ta0om_499:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_ta0om_499:disabled{opacity:.6;cursor:not-allowed}._qtyButton_ta0om_499:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_ta0om_525{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_ta0om_532{padding:var(--bb-footer-padding, 12px 16px 16px 16px);border-top:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);position:relative;min-width:0}._poweredBy_ta0om_540{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_ta0om_540 a{color:inherit;text-decoration:none}._boxSummaryWindow_ta0om_552{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;min-width:0;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_ta0om_552::-webkit-scrollbar{display:none}._boxSummaryRow_ta0om_570{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_ta0om_578{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_ta0om_587{width:100%;aspect-ratio:1 / 1;border-radius:12px;position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;box-sizing:border-box}._boxItemClickable_ta0om_599{cursor:pointer}._boxItemClickable_ta0om_599:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_ta0om_608{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_ta0om_619{border:1px dashed var(--bb-border-strong-color, rgba(17, 24, 39, .18));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));color:var(--bb-muted-color, rgba(17, 24, 39, .6))}._boxItemFilled_ta0om_625{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_ta0om_631{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:var(--bb-tier-bg, rgba(37, 99, 235, .08));color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemDiscountText_ta0om_639{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_ta0om_647{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_ta0om_654{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_ta0om_661{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .04));color:var(--bb-text-color, #111827);font-weight:800}._ctaButtonGroup_ta0om_672{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_ta0om_679{gap:0}._cta_ta0om_672{width:100%;border:1px solid var(--bb-cta-border, rgba(0, 0, 0, .12));background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:700;padding:12px 14px;border-radius:12px;cursor:pointer}._ctaSecondary_ta0om_695{width:100%;border:2px solid var(--bb-cta-bg, #2563eb);background:transparent;color:var(--bb-cta-bg, #2563eb);font:inherit;font-weight:700;padding:10px 14px;border-radius:12px;cursor:pointer}._ctaDualLeft_ta0om_707{width:100%;border:2px solid var(--bb-cta-bg, #2563eb);background:transparent;color:var(--bb-cta-bg, #2563eb);font:inherit;font-weight:700;padding:10px 14px;border-radius:12px;cursor:pointer;transition:border-radius .3s cubic-bezier(.4,0,.2,1),background .3s cubic-bezier(.4,0,.2,1),color .3s cubic-bezier(.4,0,.2,1),border-right-width .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}._ctaDualLeftAnimating_ta0om_725{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0;background:var(--bb-cta-bg, #2563eb);opacity:.6;color:var(--bb-cta-text, #ffffff)}._ctaDualLeftAnimating_ta0om_725>span{opacity:0}._ctaDualRight_ta0om_738{width:100%;border:1px solid var(--bb-cta-border, rgba(0, 0, 0, .12));background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:700;padding:12px 14px;border-radius:12px;cursor:pointer;transition:border-radius .3s cubic-bezier(.4,0,.2,1),border-left-width .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}._ctaDualRightAnimating_ta0om_754{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_ta0om_754>span{opacity:0}._ctaTotals_ta0om_765{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_ta0om_773{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));color:var(--bb-tier-text, rgba(29, 78, 216, .95));white-space:nowrap}._ctaTotalsWrap_ta0om_787{overflow:hidden;max-height:0;opacity:0;transform:translateY(4px);margin-bottom:0;transition:max-height .22s ease,opacity .16s ease,transform .22s ease,margin-bottom .22s ease}._ctaTotalsWrapVisible_ta0om_800{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_ta0om_807{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_ta0om_814{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_ta0om_787{transition:none}}._cta_ta0om_672:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_ta0om_672:disabled{opacity:.6;cursor:not-allowed}._cta_ta0om_672:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_ta0om_695:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_ta0om_695:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_ta0om_695:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_ta0om_707:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_ta0om_707:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_ta0om_707:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_ta0om_738:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_ta0om_738:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_ta0om_738:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_ta0om_883{margin-top:8px;font-size:12px;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center}@media(max-width:767px){._backdrop_ta0om_1{padding:0;justify-content:stretch}._panel_ta0om_82{width:100%;height:100%;border-radius:0}}._panel_96rr4_2 button,._panel_96rr4_2 input,._panel_96rr4_2 [role=button]{box-sizing:border-box;margin:0}._panel_96rr4_2{background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));border-radius:var(--bb-panel-radius, 16px);padding:20px;display:grid;gap:14px}._header_96rr4_20{text-align:start}._title_96rr4_24{font-size:22px;margin:0;font-family:var(--bb-font-family-title, "Bebas Neue", "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.02em;color:var(--bb-title-color, var(--bb-text-color, #111827))}._status_96rr4_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_96rr4_37{font-size:13px;color:#b91c1c;font-weight:600}._inactive_96rr4_43{font-size:13px;color:#b45309;font-weight:600}._section_96rr4_49{display:grid;gap:6px}._sectionTitle_96rr4_54{text-align:left;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._rules_96rr4_63{display:flex;justify-content:center;gap:6px}._rulesList_96rr4_69{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_96rr4_80{display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px 10px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .25));background:var(--bb-tier-bg, rgba(37, 99, 235, .06));color:var(--bb-tier-text, #1f2937)}._ruleMin_96rr4_92{font-weight:600;font-size:13px}._ruleDiscount_96rr4_97{font-weight:700;font-size:13px}._ruleLabel_96rr4_102{font-size:12px;opacity:.7}._rulesVisual_96rr4_107{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_96rr4_114,._rulesLinesRow_96rr4_121{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_96rr4_128{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_96rr4_128:empty{display:flex!important}._rulesLineLabel_96rr4_128{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_96rr4_145{height:1em}._rulesLine_96rr4_121{display:block;width:100%;height:4px;border-radius:999px;background-color:var(--bb-tier-background, rgba(148, 163, 184, .22));transition:background-color .2s ease}._rulesLine_96rr4_121:empty{display:block!important}._rulesLineEmpty_96rr4_162{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_96rr4_166{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_96rr4_170{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_96rr4_178{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_96rr4_186{display:grid;grid-template-columns:76px minmax(0,1fr);gap:12px;align-items:start;padding:8px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-border-color, rgba(15, 23, 42, .08));background:#fff;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease}._variantRowInteractive_96rr4_198{cursor:pointer}._variantRowSelected_96rr4_202{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_96rr4_207{opacity:.65}._variantMedia_96rr4_211{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_96rr4_219{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_96rr4_227{display:flex;flex-direction:column;gap:4px}._variantTitle_96rr4_233{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_96rr4_239{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_96rr4_247{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_96rr4_255{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);background:linear-gradient(135deg,#94a3b84d,#94a3b80d);display:grid;place-items:center;color:#94a3b8cc;font-size:10px;text-transform:uppercase;letter-spacing:.08em}._variantMeta_96rr4_268{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_96rr4_273{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_96rr4_279{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_96rr4_286{display:grid;align-items:end;justify-items:end}._qtyActions_96rr4_292{display:inline-flex;align-items:center;gap:6px}._qtyActionsWrap_96rr4_298{display:grid;justify-items:end;gap:4px}._variantUnavailable_96rr4_304{display:none}._qtyControls_96rr4_308{display:inline-flex;align-items:center;gap:6px;padding:4px;border-radius:999px;border:1px solid var(--bb-border-strong-color, rgba(15, 23, 42, .12));background:#0f172a0a}._qtyButton_96rr4_318{width:30px;height:30px;padding:0;border-radius:999px;border:0;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-size:16px;cursor:pointer;display:grid;place-items:center}._qtyButton_96rr4_318:disabled{cursor:not-allowed;opacity:.4}._qtyButton_96rr4_318:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_96rr4_342{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_96rr4_349{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._stockLimitNotice_96rr4_357{color:var(--bb-muted-color, rgba(17, 24, 39, .72));font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;text-align:end}._qtyChip_96rr4_366{min-width:44px;height:30px;padding:0 2px;border-radius:var(--bb-border-radius, 12px);background:#0f172a14;color:#0f172a;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:3px}._qtyChipInteractive_96rr4_381{cursor:pointer}._qtyChipValue_96rr4_385{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_96rr4_391{margin-bottom:-3px;font-weight:500}._qtyChipClear_96rr4_396{width:22px;height:22px;border-radius:999px;border:1px solid rgba(15,23,42,.12);background:#fff;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0;transition:background .16s ease,color .16s ease}._qtyChip_96rr4_366:hover ._qtyChipClear_96rr4_396{background:#0f172a;color:#fff}._qtyChipClear_96rr4_396:disabled{cursor:not-allowed;opacity:.45}._qtyChip_96rr4_366:hover ._qtyChipClear_96rr4_396:disabled{background:#fff;color:#0f172a}._qtyTrash_96rr4_425{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_96rr4_437{display:grid;padding-top:6px}._boxSummaryWindow_96rr4_442{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_96rr4_442::-webkit-scrollbar{display:none}._boxSummaryRow_96rr4_456{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_96rr4_464{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_96rr4_473{width:100%;border-radius:var(--bb-border-radius, 12px);position:relative;display:block;-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden}._boxItem_96rr4_473:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_96rr4_490{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_96rr4_496{border:1px dashed var(--bb-border-strong-color, rgba(17, 24, 39, .18));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));color:var(--bb-muted-color, rgba(17, 24, 39, .6))}._boxItemThreshold_96rr4_502{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:var(--bb-tier-bg, rgba(37, 99, 235, .08));color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemClickable_96rr4_510{cursor:pointer}._boxItemClickable_96rr4_510:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_96rr4_519{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;display:block}._boxItemFallback_96rr4_530{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .04));color:var(--bb-text-color, #111827);font-weight:800}._boxItemPlus_96rr4_543{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemDiscountText_96rr4_555{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxThresholdLabel_96rr4_568{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._totalsReveal_96rr4_579{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_96rr4_587{max-height:80px;opacity:1}._ctaTotalsWrap_96rr4_592{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_96rr4_597{opacity:1}._ctaTotals_96rr4_592{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_96rr4_612{padding:4px 8px;border-radius:999px;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));color:var(--bb-tier-text, rgba(30, 64, 175, .9));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));font-size:11px;text-transform:uppercase;letter-spacing:.08em}._ctaTotalsStrike_96rr4_623{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_96rr4_629{font-weight:700;color:#0f172a}._cta_96rr4_592{border:0;border-radius:var(--bb-border-radius, 12px);padding:14px 18px;min-height:44px;font-weight:700;font-size:14px;background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff);cursor:pointer;letter-spacing:.02em;transition:transform .14s ease,box-shadow .14s ease,background .14s ease;box-shadow:0 10px 24px #0f172a40}._cta_96rr4_592:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_96rr4_592:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_96rr4_661{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_96rr4_667,._ctaDualRight_96rr4_668{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_96rr4_667{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_96rr4_668{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_96rr4_667:disabled,._ctaDualRight_96rr4_668:disabled{cursor:not-allowed;opacity:.6}._poweredBy_96rr4_695{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_96rr4_695 a{color:inherit;text-decoration:none;font-weight:700}@media(max-width:640px){._panel_96rr4_2{padding:16px}._variantRow_96rr4_186{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_96rr4_308{justify-self:start}._variantDetailsRow_96rr4_239{grid-template-columns:1fr}}')),document.head.appendChild(r)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as l, jsxs as N, Fragment as xe } from "react/jsx-runtime";
|
|
3
3
|
import fe, { useState as q, useRef as V, useCallback as K, useEffect as F, useMemo as T, createContext as qe, useContext as Ve, forwardRef as $e, createElement as Ce } from "react";
|
|
4
4
|
const ue = {
|
|
5
5
|
bundleId: "_bundle_id",
|
|
@@ -39,9 +39,9 @@ async function je(a) {
|
|
|
39
39
|
}
|
|
40
40
|
function pe(a) {
|
|
41
41
|
if (!a || a.availableForSale === !1) return 0;
|
|
42
|
-
if (a.inventoryPolicy === "CONTINUE") return Number.POSITIVE_INFINITY;
|
|
43
|
-
const t = Number(a.sellableOnlineQuantity
|
|
44
|
-
return Number.isFinite(t) ? Math.max(0, Math.floor(t))
|
|
42
|
+
if (a.inventoryPolicy === "CONTINUE" || a.sellableOnlineQuantity == null) return Number.POSITIVE_INFINITY;
|
|
43
|
+
const t = Number(a.sellableOnlineQuantity);
|
|
44
|
+
return !Number.isFinite(t) || t <= 0 && a.availableForSale === !0 ? Number.POSITIVE_INFINITY : Math.max(0, Math.floor(t));
|
|
45
45
|
}
|
|
46
46
|
const Te = "bb_anonymous_user_id";
|
|
47
47
|
function de() {
|
|
@@ -181,7 +181,7 @@ function ye(a, t) {
|
|
|
181
181
|
function Ye(a, t) {
|
|
182
182
|
return !a && !t;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function li(a) {
|
|
185
185
|
const {
|
|
186
186
|
apiBaseUrl: t,
|
|
187
187
|
shop: e,
|
|
@@ -191,12 +191,12 @@ function ci(a) {
|
|
|
191
191
|
configFetcher: m,
|
|
192
192
|
activeConfigsFetcher: d,
|
|
193
193
|
configStatusFetcher: S,
|
|
194
|
-
analyticsEndpoint:
|
|
194
|
+
analyticsEndpoint: ct,
|
|
195
195
|
allowDrawerWhenInactive: A = !1,
|
|
196
196
|
children: O
|
|
197
|
-
} = a, et = qt(i), C =
|
|
197
|
+
} = a, et = qt(i), C = ct ?? `${t}/api/public/bundle-analytics`, Y = Ye(A, r), [X, ot] = q(!1), [J, z] = q(!1), [yt, Z] = q(null), [gt, $t] = q(!1), [j, ut] = q({}), [U, dt] = q(et), [Tt, It] = q(() => r ? { [et]: r } : {}), [ht, zt] = q(Y), [kt, Ct] = q(
|
|
198
198
|
!Y && !r ? et : null
|
|
199
|
-
), [
|
|
199
|
+
), [Nt, Dt] = q(null), [Rt, Wt] = q(null), [Xt, wt] = q(
|
|
200
200
|
() => ({ selections: {}, order: [] })
|
|
201
201
|
), jt = V(null), Mt = V(null), Lt = V(null), ft = V(0), h = V(U), _ = V(Tt), w = V(ht), B = V(null), R = m ?? We, E = d ?? ze, $ = S ?? je, H = K(async () => {
|
|
202
202
|
if (typeof o.getLineQuantitiesByMerchandiseId != "function") return null;
|
|
@@ -265,11 +265,11 @@ function ci(a) {
|
|
|
265
265
|
}
|
|
266
266
|
return !0;
|
|
267
267
|
});
|
|
268
|
-
}, [C, e]), Ut = K((n, s) => !s.ok || s.config.isActive === !1 ? (
|
|
268
|
+
}, [C, e]), Ut = K((n, s) => !s.ok || s.config.isActive === !1 ? (It((u) => {
|
|
269
269
|
if (!u[n]) return u;
|
|
270
270
|
const p = { ...u };
|
|
271
271
|
return delete p[n], p;
|
|
272
|
-
}), !A && h.current === n && (Z(s.ok ? "Bundle is inactive." : s.error || "Failed to load bundle config."), ot(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(oe) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (
|
|
272
|
+
}), !A && h.current === n && (Z(s.ok ? "Bundle is inactive." : s.error || "Failed to load bundle config."), ot(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(oe) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (It((u) => ({
|
|
273
273
|
...u,
|
|
274
274
|
[n]: {
|
|
275
275
|
currencyCode: s.currencyCode ?? null,
|
|
@@ -364,7 +364,7 @@ function ci(a) {
|
|
|
364
364
|
(s = jt.current) == null || s.abort();
|
|
365
365
|
const n = new AbortController();
|
|
366
366
|
return jt.current = n, zt(!0), E({ apiBaseUrl: t, shop: e, signal: n.signal }).then((u) => {
|
|
367
|
-
n.signal.aborted || u.ok &&
|
|
367
|
+
n.signal.aborted || u.ok && It((p) => {
|
|
368
368
|
const y = { ...p };
|
|
369
369
|
for (const [g, x] of Object.entries(u.configs ?? {}))
|
|
370
370
|
y[qt(g)] = {
|
|
@@ -389,7 +389,7 @@ function ci(a) {
|
|
|
389
389
|
};
|
|
390
390
|
return n(), window.addEventListener("hashchange", n), () => window.removeEventListener("hashchange", n);
|
|
391
391
|
}, []);
|
|
392
|
-
const bt = Tt[U] ?? null, v = (bt == null ? void 0 : bt.config) ?? null, xt = (bt == null ? void 0 : bt.eligibleVariants) ?? Ue, Pt = (bt == null ? void 0 : bt.currencyCode) ?? null, st = !v && (kt === U ||
|
|
392
|
+
const bt = Tt[U] ?? null, v = (bt == null ? void 0 : bt.config) ?? null, xt = (bt == null ? void 0 : bt.eligibleVariants) ?? Ue, Pt = (bt == null ? void 0 : bt.currencyCode) ?? null, st = !v && (kt === U || Nt === U) || A && !v && kt != null;
|
|
393
393
|
F(() => {
|
|
394
394
|
const n = Le(v == null ? void 0 : v.styleSettings);
|
|
395
395
|
n && Me(n);
|
|
@@ -406,7 +406,7 @@ function ci(a) {
|
|
|
406
406
|
const u = n.__BUNDLE_PREVIEW_CONFIG__;
|
|
407
407
|
if (!u) return;
|
|
408
408
|
const p = n.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ ?? [];
|
|
409
|
-
|
|
409
|
+
It((y) => {
|
|
410
410
|
var g;
|
|
411
411
|
return {
|
|
412
412
|
...y,
|
|
@@ -420,7 +420,7 @@ function ci(a) {
|
|
|
420
420
|
};
|
|
421
421
|
return n.__BUNDLE_PREVIEW_CONFIG__ && s(), window.addEventListener("bundle-preview-config-updated", s), () => window.removeEventListener("bundle-preview-config-updated", s);
|
|
422
422
|
}, [Pt]);
|
|
423
|
-
const
|
|
423
|
+
const le = T(() => {
|
|
424
424
|
const n = Number((v == null ? void 0 : v.maxBundleSize) ?? Number.NaN), s = Number.isFinite(n) ? Math.floor(n) : 100;
|
|
425
425
|
return Math.max(2, Math.min(100, s));
|
|
426
426
|
}, [v == null ? void 0 : v.maxBundleSize]), Ft = T(() => new Map(
|
|
@@ -435,14 +435,14 @@ function ci(a) {
|
|
|
435
435
|
), [xt]), Ot = T(() => {
|
|
436
436
|
const n = (v == null ? void 0 : v.rules) ?? [], s = n.length ? Math.min(...n.map((g) => g.minBundleSize)) : 2, u = Number.isFinite(s) && s > 0 ? s : 2, p = Number((v == null ? void 0 : v.minBundleSize) ?? Number.NaN), y = Number.isFinite(p) && Number.isInteger(p) ? Math.max(2, Math.min(100, p)) : null;
|
|
437
437
|
return y == null ? u : Math.min(u, y);
|
|
438
|
-
}, [v == null ? void 0 : v.minBundleSize, v == null ? void 0 : v.rules]),
|
|
438
|
+
}, [v == null ? void 0 : v.minBundleSize, v == null ? void 0 : v.rules]), ce = K((n, s) => {
|
|
439
439
|
if (gt || !St.has(n) && !st)
|
|
440
440
|
return;
|
|
441
441
|
const u = Ft.get(n) ?? (st ? Number.POSITIVE_INFINITY : 0), p = ye(s, u);
|
|
442
442
|
wt((y) => {
|
|
443
443
|
const g = y.selections[n] ?? 0, x = p - g, k = Object.values(y.selections).reduce((it, tt) => it + (tt || 0), 0), D = Number.isFinite(u) ? Math.max(0, Math.floor(u) - g) : x, P = x > 0 ? Math.min(
|
|
444
444
|
x,
|
|
445
|
-
Math.max(0,
|
|
445
|
+
Math.max(0, le - k),
|
|
446
446
|
D
|
|
447
447
|
) : x, G = g + P;
|
|
448
448
|
let at;
|
|
@@ -457,12 +457,12 @@ function ci(a) {
|
|
|
457
457
|
let it = -P;
|
|
458
458
|
const tt = [];
|
|
459
459
|
for (let Zt = y.order.length - 1; Zt >= 0; Zt--) {
|
|
460
|
-
const
|
|
461
|
-
if (
|
|
460
|
+
const I = y.order[Zt];
|
|
461
|
+
if (I === n && it > 0) {
|
|
462
462
|
it--;
|
|
463
463
|
continue;
|
|
464
464
|
}
|
|
465
|
-
tt.push(
|
|
465
|
+
tt.push(I);
|
|
466
466
|
}
|
|
467
467
|
tt.reverse(), pt = tt;
|
|
468
468
|
}
|
|
@@ -489,7 +489,7 @@ function ci(a) {
|
|
|
489
489
|
}
|
|
490
490
|
return { selections: at, order: pt };
|
|
491
491
|
});
|
|
492
|
-
}, [C, gt, St, st,
|
|
492
|
+
}, [C, gt, St, st, le, Ot, e, Ft]);
|
|
493
493
|
F(() => {
|
|
494
494
|
st || wt((n) => {
|
|
495
495
|
const s = Object.entries(n.selections).map(([g, x]) => {
|
|
@@ -514,18 +514,18 @@ function ci(a) {
|
|
|
514
514
|
var tt, Zt;
|
|
515
515
|
if (!Ht || !v) return;
|
|
516
516
|
const s = Ge(), u = (v.title ?? "").trim().slice(0, 255), p = await M(), y = new Map(
|
|
517
|
-
xt.map((
|
|
518
|
-
const
|
|
519
|
-
if (!Number.isFinite(
|
|
520
|
-
const Kt = me((p ?? j)[
|
|
521
|
-
return [
|
|
517
|
+
xt.map((I) => {
|
|
518
|
+
const lt = pe(I);
|
|
519
|
+
if (!Number.isFinite(lt)) return [I.id, lt];
|
|
520
|
+
const Kt = me((p ?? j)[I.id] ?? 0);
|
|
521
|
+
return [I.id, Math.max(0, Math.floor(lt) - Kt)];
|
|
522
522
|
})
|
|
523
|
-
), g = Object.entries(Bt).map(([
|
|
524
|
-
merchandiseId:
|
|
525
|
-
quantity: ye(
|
|
526
|
-
})).filter((
|
|
527
|
-
merchandiseId:
|
|
528
|
-
quantity:
|
|
523
|
+
), g = Object.entries(Bt).map(([I, lt]) => ({
|
|
524
|
+
merchandiseId: I,
|
|
525
|
+
quantity: ye(lt, y.get(I) ?? 0)
|
|
526
|
+
})).filter((I) => I.quantity > 0).filter((I) => St.has(I.merchandiseId)).map((I) => ({
|
|
527
|
+
merchandiseId: I.merchandiseId,
|
|
528
|
+
quantity: I.quantity,
|
|
529
529
|
attributes: [
|
|
530
530
|
{ key: ue.bundleId, value: s },
|
|
531
531
|
{ key: ue.bundleConfig, value: U },
|
|
@@ -534,32 +534,32 @@ function ci(a) {
|
|
|
534
534
|
]
|
|
535
535
|
}));
|
|
536
536
|
if (!g.length) return;
|
|
537
|
-
const x = new Map(xt.map((
|
|
537
|
+
const x = new Map(xt.map((I) => [I.id, I]));
|
|
538
538
|
let k = 0;
|
|
539
|
-
for (const
|
|
540
|
-
const
|
|
541
|
-
if (
|
|
542
|
-
const Kt = x.get(
|
|
543
|
-
Number.isFinite(Be) && (k += Be *
|
|
539
|
+
for (const I of g) {
|
|
540
|
+
const lt = I.quantity ?? 0;
|
|
541
|
+
if (lt <= 0) continue;
|
|
542
|
+
const Kt = x.get(I.merchandiseId), Be = Number(Kt == null ? void 0 : Kt.price);
|
|
543
|
+
Number.isFinite(Be) && (k += Be * lt);
|
|
544
544
|
}
|
|
545
545
|
k = Math.round(k * 100) / 100;
|
|
546
|
-
const D = [...v.rules ?? []].sort((
|
|
546
|
+
const D = [...v.rules ?? []].sort((I, lt) => I.minBundleSize - lt.minBundleSize);
|
|
547
547
|
let P = null;
|
|
548
|
-
for (const
|
|
549
|
-
At >=
|
|
548
|
+
for (const I of D)
|
|
549
|
+
At >= I.minBundleSize && (P = I);
|
|
550
550
|
const G = P ? (() => {
|
|
551
|
-
const
|
|
552
|
-
return Number.isFinite(
|
|
553
|
-
})() : null, at = G ? Math.round(k * (1 - G / 100) * 100) / 100 : k, pt = k - at, Gt = g.map((
|
|
551
|
+
const I = Number.parseFloat(P.discountPercent);
|
|
552
|
+
return Number.isFinite(I) && I > 0 ? I : null;
|
|
553
|
+
})() : null, at = G ? Math.round(k * (1 - G / 100) * 100) / 100 : k, pt = k - at, Gt = g.map((I) => I.merchandiseId), Yt = (P == null ? void 0 : P.handle) ?? "", it = ((tt = P == null ? void 0 : P.label) == null ? void 0 : tt.trim()) || "";
|
|
554
554
|
z(!0);
|
|
555
555
|
try {
|
|
556
556
|
if (n != null && n.checkout ? await o.linesAddForCheckout(g) : await o.linesAdd(g), C)
|
|
557
557
|
try {
|
|
558
|
-
const
|
|
558
|
+
const I = de(), lt = !!(n != null && n.checkout);
|
|
559
559
|
te(C, e, {
|
|
560
560
|
eventType: "BUNDLE_ADDED_TO_BASKET",
|
|
561
561
|
shop: e,
|
|
562
|
-
anonymousUserId:
|
|
562
|
+
anonymousUserId: I,
|
|
563
563
|
bundleId: s,
|
|
564
564
|
productVariantIds: Gt,
|
|
565
565
|
grossPrice: k,
|
|
@@ -570,14 +570,14 @@ function ci(a) {
|
|
|
570
570
|
discountPercentage: G,
|
|
571
571
|
discountedAmount: pt,
|
|
572
572
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
573
|
-
checkout:
|
|
574
|
-
mixpanelEvent:
|
|
573
|
+
checkout: lt,
|
|
574
|
+
mixpanelEvent: lt ? "checkout_started_with_bundle" : "bundle_added_to_cart"
|
|
575
575
|
});
|
|
576
576
|
} catch {
|
|
577
577
|
}
|
|
578
578
|
Et(), Q(), M(), (Zt = n == null ? void 0 : n.onComplete) == null || Zt.call(n), Z(null);
|
|
579
|
-
} catch (
|
|
580
|
-
const
|
|
579
|
+
} catch (I) {
|
|
580
|
+
const lt = I instanceof Error ? I.message : "", Kt = /stock|sold out|inventory|insufficient|available|422/i.test(lt);
|
|
581
581
|
Z(
|
|
582
582
|
Kt ? "Some bundle items are no longer available in the requested quantity. Please review your selection." : "We couldn't add this bundle right now. Please try again."
|
|
583
583
|
), M();
|
|
@@ -615,7 +615,7 @@ function ci(a) {
|
|
|
615
615
|
(n = o.navigateToCheckout) == null || n.call(o);
|
|
616
616
|
}
|
|
617
617
|
});
|
|
618
|
-
}, [o, Qt]),
|
|
618
|
+
}, [o, Qt]), c = T(() => ({
|
|
619
619
|
isOpen: X,
|
|
620
620
|
open: nt,
|
|
621
621
|
openForHandle: vt,
|
|
@@ -634,7 +634,7 @@ function ci(a) {
|
|
|
634
634
|
selections: Bt,
|
|
635
635
|
selectionOrder: re,
|
|
636
636
|
getVariantMaxSelectableQuantity: ne,
|
|
637
|
-
setQuantity:
|
|
637
|
+
setQuantity: ce,
|
|
638
638
|
clearSelections: Et,
|
|
639
639
|
bundleSize: At,
|
|
640
640
|
minRequired: Ot,
|
|
@@ -662,13 +662,13 @@ function ci(a) {
|
|
|
662
662
|
Jt,
|
|
663
663
|
ee,
|
|
664
664
|
ne,
|
|
665
|
-
|
|
665
|
+
ce,
|
|
666
666
|
ae,
|
|
667
667
|
ie,
|
|
668
668
|
J,
|
|
669
669
|
rt
|
|
670
670
|
]);
|
|
671
|
-
return /* @__PURE__ */
|
|
671
|
+
return /* @__PURE__ */ l(De.Provider, { value: c, children: O });
|
|
672
672
|
}
|
|
673
673
|
function be() {
|
|
674
674
|
const a = Ve(De);
|
|
@@ -676,7 +676,7 @@ function be() {
|
|
|
676
676
|
throw new Error("useBundleBuilder must be used within <BundleProvider />");
|
|
677
677
|
return a;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function ci() {
|
|
680
680
|
const { isOpen: a, open: t, close: e, toggle: o } = be();
|
|
681
681
|
return { isOpen: a, open: t, close: e, toggle: o };
|
|
682
682
|
}
|
|
@@ -685,7 +685,7 @@ const Ke = "_button_18rtl_1", Xe = {
|
|
|
685
685
|
};
|
|
686
686
|
function ui(a) {
|
|
687
687
|
const { toggle: t } = be();
|
|
688
|
-
return /* @__PURE__ */
|
|
688
|
+
return /* @__PURE__ */ l(
|
|
689
689
|
"button",
|
|
690
690
|
{
|
|
691
691
|
type: "button",
|
|
@@ -884,8 +884,8 @@ class an {
|
|
|
884
884
|
const i = _t(this.x, this.w + this.x), r = _t(this.y, this.h + this.y);
|
|
885
885
|
return new rn(this.context, this.getOptions, i, r);
|
|
886
886
|
}, this.animate = (i) => {
|
|
887
|
-
const { canvas: r, context: m, particlesGenerated: d, lastNumberOfPieces: S } = this, { run:
|
|
888
|
-
if (!
|
|
887
|
+
const { canvas: r, context: m, particlesGenerated: d, lastNumberOfPieces: S } = this, { run: ct, recycle: A, numberOfPieces: O, debug: et, tweenFunction: C, tweenDuration: Y } = this.getOptions();
|
|
888
|
+
if (!ct)
|
|
889
889
|
return !1;
|
|
890
890
|
const X = this.particles.length, ot = A ? X : d;
|
|
891
891
|
if (ot < O) {
|
|
@@ -908,7 +908,7 @@ class an {
|
|
|
908
908
|
this.context = o, this.getOptions = e;
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
|
-
const
|
|
911
|
+
const Ie = {
|
|
912
912
|
width: typeof window < "u" ? window.innerWidth : 300,
|
|
913
913
|
height: typeof window < "u" ? window.innerHeight : 200,
|
|
914
914
|
numberOfPieces: 200,
|
|
@@ -956,16 +956,16 @@ class on {
|
|
|
956
956
|
};
|
|
957
957
|
this._options = {
|
|
958
958
|
...r,
|
|
959
|
-
...
|
|
959
|
+
...Ie,
|
|
960
960
|
...i
|
|
961
961
|
}, Object.assign(this, i.confettiSource);
|
|
962
962
|
}, this.update = (i = 0) => {
|
|
963
|
-
const { options: { run: r, onConfettiComplete: m, frameRate: d }, canvas: S, context:
|
|
963
|
+
const { options: { run: r, onConfettiComplete: m, frameRate: d }, canvas: S, context: ct } = this, A = Math.min(i - this.lastFrameTime, 50);
|
|
964
964
|
if (d && A < 1e3 / d) {
|
|
965
965
|
this.rafId = requestAnimationFrame(this.update);
|
|
966
966
|
return;
|
|
967
967
|
}
|
|
968
|
-
this.lastFrameTime = i - (d ? A % d : 0), r && (
|
|
968
|
+
this.lastFrameTime = i - (d ? A % d : 0), r && (ct.fillStyle = "white", ct.clearRect(0, 0, S.width, S.height)), this.generator.animate(A) ? this.rafId = requestAnimationFrame(this.update) : (m && typeof m == "function" && this.generator.particlesGenerated > 0 && m.call(this, this), this._options.run = !1);
|
|
969
969
|
}, this.reset = () => {
|
|
970
970
|
this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
|
|
971
971
|
}, this.stop = () => {
|
|
@@ -986,7 +986,7 @@ class on {
|
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
const sn = fe.createRef();
|
|
989
|
-
class
|
|
989
|
+
class Ne extends fe.Component {
|
|
990
990
|
constructor(t) {
|
|
991
991
|
super(t), this.canvas = fe.createRef(), this.canvas = t.canvasRef || sn;
|
|
992
992
|
}
|
|
@@ -1014,16 +1014,16 @@ class Ie extends fe.Component {
|
|
|
1014
1014
|
right: 0,
|
|
1015
1015
|
...e.style
|
|
1016
1016
|
};
|
|
1017
|
-
return
|
|
1017
|
+
return l("canvas", { width: t.width, height: t.height, ref: this.canvas, ...e, style: o });
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
|
|
1021
|
-
...
|
|
1020
|
+
Ne.defaultProps = {
|
|
1021
|
+
...Ie
|
|
1022
1022
|
};
|
|
1023
|
-
|
|
1023
|
+
Ne.displayName = "ReactConfetti";
|
|
1024
1024
|
function we(a) {
|
|
1025
1025
|
const t = {}, e = {}, o = {}, i = [
|
|
1026
|
-
...Object.keys(
|
|
1026
|
+
...Object.keys(Ie),
|
|
1027
1027
|
"confettiSource",
|
|
1028
1028
|
"drawShape",
|
|
1029
1029
|
"onConfettiComplete",
|
|
@@ -1035,14 +1035,14 @@ function we(a) {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
return [t, o, e];
|
|
1037
1037
|
}
|
|
1038
|
-
const
|
|
1038
|
+
const ln = fe.forwardRef((a, t) => l(Ne, { canvasRef: t, ...a }));
|
|
1039
1039
|
/**
|
|
1040
1040
|
* @license lucide-react v0.515.0 - ISC
|
|
1041
1041
|
*
|
|
1042
1042
|
* This source code is licensed under the ISC license.
|
|
1043
1043
|
* See the LICENSE file in the root directory of this source tree.
|
|
1044
1044
|
*/
|
|
1045
|
-
const
|
|
1045
|
+
const cn = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), un = (a) => a.replace(
|
|
1046
1046
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
1047
1047
|
(t, e, o) => o ? o.toUpperCase() : e.toLowerCase()
|
|
1048
1048
|
), Fe = (a) => {
|
|
@@ -1100,7 +1100,7 @@ const mn = $e(
|
|
|
1100
1100
|
...d
|
|
1101
1101
|
},
|
|
1102
1102
|
[
|
|
1103
|
-
...m.map(([
|
|
1103
|
+
...m.map(([ct, A]) => Ce(ct, A)),
|
|
1104
1104
|
...Array.isArray(r) ? r : [r]
|
|
1105
1105
|
]
|
|
1106
1106
|
)
|
|
@@ -1117,7 +1117,7 @@ const Se = (a, t) => {
|
|
|
1117
1117
|
ref: r,
|
|
1118
1118
|
iconNode: t,
|
|
1119
1119
|
className: Ee(
|
|
1120
|
-
`lucide-${
|
|
1120
|
+
`lucide-${cn(Fe(a))}`,
|
|
1121
1121
|
`lucide-${a}`,
|
|
1122
1122
|
o
|
|
1123
1123
|
),
|
|
@@ -1158,14 +1158,14 @@ const _n = [
|
|
|
1158
1158
|
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
|
|
1159
1159
|
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
|
|
1160
1160
|
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
1161
|
-
], yn = Se("trash-2", _n), gn = "_backdrop_ta0om_1", wn = "_celebrationOverlay_ta0om_14", vn = "_celebrationChip_ta0om_23", xn = "_backdropOpen_ta0om_74", Cn = "_backdropClosed_ta0om_78",
|
|
1161
|
+
], yn = Se("trash-2", _n), gn = "_backdrop_ta0om_1", wn = "_celebrationOverlay_ta0om_14", vn = "_celebrationChip_ta0om_23", xn = "_backdropOpen_ta0om_74", Cn = "_backdropClosed_ta0om_78", In = "_panel_ta0om_82", Nn = "_panelOpen_ta0om_103", Sn = "_panelClosed_ta0om_107", Bn = "_header_ta0om_146", Tn = "_headerCenter_ta0om_155", kn = "_title_ta0om_163", Rn = "_searchIconButton_ta0om_172", Mn = "_headerTitleWrap_ta0om_195", Ln = "_headerSearchWrap_ta0om_199", Pn = "_headerSearchOpen_ta0om_211", Fn = "_searchBar_ta0om_223", On = "_searchInput_ta0om_235", An = "_searchClearButton_ta0om_256", $n = "_closeButton_ta0om_278", Dn = "_body_ta0om_312", En = "_muted_ta0om_317", qn = "_error_ta0om_322", Vn = "_variants_ta0om_327", zn = "_variantList_ta0om_331", Wn = "_variantRow_ta0om_339", jn = "_variantRowSoldOut_ta0om_347", Un = "_variantLeft_ta0om_351", Hn = "_addToBundleButton_ta0om_358", Qn = "_soldOutContainer_ta0om_386", Gn = "_stockLimitContainer_ta0om_394", Yn = "_soldOut_ta0om_386", Kn = "_stockLimitNotice_ta0om_412", Xn = "_variantThumb_ta0om_421", Jn = "_variantThumbImg_ta0om_431", Zn = "_variantThumbFallback_ta0om_438", tr = "_variantInfo_ta0om_448", er = "_variantName_ta0om_452", nr = "_variantMeta_ta0om_461", rr = "_variantPriceRow_ta0om_469", ar = "_variantCompareAt_ta0om_476", ir = "_variantPrice_ta0om_469", or = "_qtyControls_ta0om_487", sr = "_qtyControlsWrap_ta0om_493", lr = "_qtyButton_ta0om_499", cr = "_qtyValue_ta0om_525", ur = "_footer_ta0om_532", dr = "_poweredBy_ta0om_540", hr = "_boxSummaryWindow_ta0om_552", mr = "_boxSummaryRow_ta0om_570", fr = "_boxSlot_ta0om_578", br = "_boxItem_ta0om_587", pr = "_boxItemClickable_ta0om_599", _r = "_boxThresholdLabel_ta0om_608", yr = "_boxItemPlaceholder_ta0om_619", gr = "_boxItemFilled_ta0om_625", wr = "_boxItemThreshold_ta0om_631", vr = "_boxItemDiscountText_ta0om_639", xr = "_boxItemPlus_ta0om_647", Cr = "_boxItemImage_ta0om_654", Ir = "_boxItemFallback_ta0om_661", Nr = "_ctaButtonGroup_ta0om_672", Sr = "_ctaButtonGroupAnimating_ta0om_679", Br = "_cta_ta0om_672", Tr = "_ctaDualLeft_ta0om_707", kr = "_ctaDualLeftAnimating_ta0om_725", Rr = "_ctaDualRight_ta0om_738", Mr = "_ctaDualRightAnimating_ta0om_754", Lr = "_ctaTotals_ta0om_765", Pr = "_ctaDiscountBadge_ta0om_773", Fr = "_ctaTotalsWrap_ta0om_787", Or = "_ctaTotalsWrapVisible_ta0om_800", Ar = "_ctaTotalsStrike_ta0om_807", $r = "_ctaTotalsPrice_ta0om_814", f = {
|
|
1162
1162
|
backdrop: gn,
|
|
1163
1163
|
celebrationOverlay: wn,
|
|
1164
1164
|
celebrationChip: vn,
|
|
1165
1165
|
backdropOpen: xn,
|
|
1166
1166
|
backdropClosed: Cn,
|
|
1167
|
-
panel:
|
|
1168
|
-
panelOpen:
|
|
1167
|
+
panel: In,
|
|
1168
|
+
panelOpen: Nn,
|
|
1169
1169
|
panelClosed: Sn,
|
|
1170
1170
|
header: Bn,
|
|
1171
1171
|
headerCenter: Tn,
|
|
@@ -1202,8 +1202,8 @@ const _n = [
|
|
|
1202
1202
|
variantPrice: ir,
|
|
1203
1203
|
qtyControls: or,
|
|
1204
1204
|
qtyControlsWrap: sr,
|
|
1205
|
-
qtyButton:
|
|
1206
|
-
qtyValue:
|
|
1205
|
+
qtyButton: lr,
|
|
1206
|
+
qtyValue: cr,
|
|
1207
1207
|
footer: ur,
|
|
1208
1208
|
poweredBy: dr,
|
|
1209
1209
|
boxSummaryWindow: hr,
|
|
@@ -1218,8 +1218,8 @@ const _n = [
|
|
|
1218
1218
|
boxItemDiscountText: vr,
|
|
1219
1219
|
boxItemPlus: xr,
|
|
1220
1220
|
boxItemImage: Cr,
|
|
1221
|
-
boxItemFallback:
|
|
1222
|
-
ctaButtonGroup:
|
|
1221
|
+
boxItemFallback: Ir,
|
|
1222
|
+
ctaButtonGroup: Nr,
|
|
1223
1223
|
ctaButtonGroupAnimating: Sr,
|
|
1224
1224
|
cta: Br,
|
|
1225
1225
|
ctaDualLeft: Tr,
|
|
@@ -1244,7 +1244,7 @@ function di(a) {
|
|
|
1244
1244
|
currencyCode: m,
|
|
1245
1245
|
config: d,
|
|
1246
1246
|
eligibleVariants: S,
|
|
1247
|
-
selections:
|
|
1247
|
+
selections: ct,
|
|
1248
1248
|
selectionOrder: A,
|
|
1249
1249
|
getVariantMaxSelectableQuantity: O,
|
|
1250
1250
|
setQuantity: et,
|
|
@@ -1253,7 +1253,7 @@ function di(a) {
|
|
|
1253
1253
|
canSubmit: X,
|
|
1254
1254
|
submit: ot,
|
|
1255
1255
|
submitAndCheckout: J
|
|
1256
|
-
} = be(), [z, yt] = q(!1), [Z, gt] = q(""), $t = V(null), j = V(null), ut = V(null), [U, dt] = q(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Tt,
|
|
1256
|
+
} = be(), [z, yt] = q(!1), [Z, gt] = q(""), $t = V(null), j = V(null), ut = V(null), [U, dt] = q(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Tt, It] = q(0), [ht, zt] = q(null), [kt, Ct] = q(!1), Nt = V(null), Dt = V(C), Rt = 7e3, [Wt, Xt] = q(0), [wt, jt] = q(null), [Mt, Lt] = q(!1), ft = V(null), h = 2800, _ = [
|
|
1257
1257
|
"#2563eb",
|
|
1258
1258
|
"#3b82f6",
|
|
1259
1259
|
"#60a5fa",
|
|
@@ -1262,29 +1262,29 @@ function di(a) {
|
|
|
1262
1262
|
"#e0f2fe"
|
|
1263
1263
|
], w = T(() => {
|
|
1264
1264
|
var n;
|
|
1265
|
-
const
|
|
1266
|
-
return Array.isArray(
|
|
1265
|
+
const c = (n = d == null ? void 0 : d.styleSettings) == null ? void 0 : n.confettiColors;
|
|
1266
|
+
return Array.isArray(c) && c.length >= 6 ? c.slice(0, 6).map(
|
|
1267
1267
|
(s, u) => typeof s == "string" && s.trim() ? s : _[u]
|
|
1268
1268
|
) : [..._];
|
|
1269
|
-
}, [(ae = d == null ? void 0 : d.styleSettings) == null ? void 0 : ae.confettiColors]), B = (
|
|
1270
|
-
const n = Number.parseFloat(
|
|
1271
|
-
return Number.isFinite(n) ? String(Math.round(n)) :
|
|
1272
|
-
}, R = (
|
|
1273
|
-
const n = (
|
|
1269
|
+
}, [(ae = d == null ? void 0 : d.styleSettings) == null ? void 0 : ae.confettiColors]), B = (c) => {
|
|
1270
|
+
const n = Number.parseFloat(c);
|
|
1271
|
+
return Number.isFinite(n) ? String(Math.round(n)) : c;
|
|
1272
|
+
}, R = (c) => {
|
|
1273
|
+
const n = (c ?? []).filter((s) => {
|
|
1274
1274
|
var y, g;
|
|
1275
1275
|
const u = (y = s == null ? void 0 : s.name) == null ? void 0 : y.trim(), p = (g = s == null ? void 0 : s.value) == null ? void 0 : g.trim();
|
|
1276
1276
|
return !(!u || !p || u.toLowerCase() === "title");
|
|
1277
1277
|
});
|
|
1278
1278
|
return n.length ? n.map((s) => `${s.name}: ${s.value}`).join(" · ") : null;
|
|
1279
|
-
}, E = (
|
|
1279
|
+
}, E = (c) => {
|
|
1280
1280
|
var n;
|
|
1281
|
-
return ((n =
|
|
1282
|
-
}, $ = (
|
|
1283
|
-
const n = E(
|
|
1281
|
+
return ((n = c.product) == null ? void 0 : n.title) ?? c.displayName ?? c.title;
|
|
1282
|
+
}, $ = (c) => {
|
|
1283
|
+
const n = E(c), s = R(c.selectedOptions);
|
|
1284
1284
|
return [n, s].filter(Boolean).join(" — ");
|
|
1285
|
-
}, [H, M] = q(t), W = V(null), Q = (
|
|
1286
|
-
const n = Number(
|
|
1287
|
-
if (!Number.isFinite(n)) return
|
|
1285
|
+
}, [H, M] = q(t), W = V(null), Q = (c) => {
|
|
1286
|
+
const n = Number(c);
|
|
1287
|
+
if (!Number.isFinite(n)) return c;
|
|
1288
1288
|
if (m)
|
|
1289
1289
|
try {
|
|
1290
1290
|
return new Intl.NumberFormat(void 0, { style: "currency", currency: m }).format(n);
|
|
@@ -1292,12 +1292,12 @@ function di(a) {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
return `$${n.toFixed(2)}`;
|
|
1294
1294
|
}, L = ((ie = d == null ? void 0 : d.title) == null ? void 0 : ie.trim()) || "Build your bundle", Ut = T(() => {
|
|
1295
|
-
const
|
|
1295
|
+
const c = Number((d == null ? void 0 : d.maxBundleSize) ?? NaN), n = Number.isFinite(c) ? Math.floor(c) : 100;
|
|
1296
1296
|
return Math.max(2, Math.min(100, n));
|
|
1297
|
-
}, [d == null ? void 0 : d.maxBundleSize]), mt = C >= Ut, Jt = T(() => [...S].sort((
|
|
1298
|
-
const
|
|
1299
|
-
if (!
|
|
1300
|
-
const n =
|
|
1297
|
+
}, [d == null ? void 0 : d.maxBundleSize]), mt = C >= Ut, Jt = T(() => [...S].sort((c, n) => c.displayName.localeCompare(n.displayName)), [S]), vt = T(() => {
|
|
1298
|
+
const c = Z.trim().toLowerCase();
|
|
1299
|
+
if (!c) return Jt;
|
|
1300
|
+
const n = c.split(/\s+/).filter(Boolean), s = (u) => {
|
|
1301
1301
|
var g;
|
|
1302
1302
|
const p = [];
|
|
1303
1303
|
p.push(u.displayName), (g = u.product) != null && g.title && p.push(u.product.title);
|
|
@@ -1307,45 +1307,45 @@ function di(a) {
|
|
|
1307
1307
|
return n.every((x) => y.includes(x));
|
|
1308
1308
|
};
|
|
1309
1309
|
return Jt.filter(s);
|
|
1310
|
-
}, [Z, Jt]), nt = T(() => [...(d == null ? void 0 : d.rules) ?? []].sort((
|
|
1311
|
-
let
|
|
1310
|
+
}, [Z, Jt]), nt = T(() => [...(d == null ? void 0 : d.rules) ?? []].sort((c, n) => c.minBundleSize - n.minBundleSize), [d == null ? void 0 : d.rules]), rt = T(() => Math.max(0, Y - C), [C, Y]), bt = T(() => {
|
|
1311
|
+
let c = null;
|
|
1312
1312
|
for (const n of nt)
|
|
1313
|
-
C >= n.minBundleSize && (
|
|
1314
|
-
return
|
|
1313
|
+
C >= n.minBundleSize && (c = n);
|
|
1314
|
+
return c;
|
|
1315
1315
|
}, [C, nt]), v = T(() => {
|
|
1316
1316
|
if (!bt) return null;
|
|
1317
|
-
const
|
|
1318
|
-
return !Number.isFinite(
|
|
1317
|
+
const c = Number.parseFloat(bt.discountPercent);
|
|
1318
|
+
return !Number.isFinite(c) || c <= 0 ? null : c;
|
|
1319
1319
|
}, [bt]), xt = nt[0], Pt = !!(xt && C >= xt.minBundleSize), st = T(() => {
|
|
1320
|
-
const
|
|
1320
|
+
const c = new Map(S.map((s) => [s.id, s]));
|
|
1321
1321
|
let n = 0;
|
|
1322
|
-
for (const [s, u] of Object.entries(
|
|
1322
|
+
for (const [s, u] of Object.entries(ct)) {
|
|
1323
1323
|
const p = u ?? 0;
|
|
1324
1324
|
if (p <= 0) continue;
|
|
1325
|
-
const y =
|
|
1325
|
+
const y = c.get(s), g = Number(y == null ? void 0 : y.price);
|
|
1326
1326
|
Number.isFinite(g) && (n += g * p);
|
|
1327
1327
|
}
|
|
1328
1328
|
return Math.round(n * 100) / 100;
|
|
1329
|
-
}, [S,
|
|
1329
|
+
}, [S, ct]), le = T(() => {
|
|
1330
1330
|
if (!v) return st;
|
|
1331
|
-
const
|
|
1332
|
-
return Math.round(
|
|
1333
|
-
}, [v, st]), Ft = T(() => nt.length ? Math.max(...nt.map((
|
|
1334
|
-
const
|
|
1335
|
-
return A.map((n) =>
|
|
1331
|
+
const c = st * (1 - v / 100);
|
|
1332
|
+
return Math.round(c * 100) / 100;
|
|
1333
|
+
}, [v, st]), Ft = T(() => nt.length ? Math.max(...nt.map((c) => c.minBundleSize)) : 0, [nt]), St = T(() => {
|
|
1334
|
+
const c = new Map(S.map((n) => [n.id, n]));
|
|
1335
|
+
return A.map((n) => c.get(n)).filter((n) => !!n);
|
|
1336
1336
|
}, [S, A]), Ot = T(() => {
|
|
1337
1337
|
var n;
|
|
1338
|
-
const
|
|
1338
|
+
const c = /* @__PURE__ */ new Map();
|
|
1339
1339
|
for (const s of nt) {
|
|
1340
1340
|
const u = Math.max(0, s.minBundleSize - 1);
|
|
1341
|
-
|
|
1341
|
+
c.set(u, {
|
|
1342
1342
|
discountPercent: s.discountPercent,
|
|
1343
1343
|
minBundleSize: s.minBundleSize,
|
|
1344
1344
|
label: ((n = s.label) == null ? void 0 : n.trim()) || `Buy ${s.minBundleSize}+`
|
|
1345
1345
|
});
|
|
1346
1346
|
}
|
|
1347
|
-
return
|
|
1348
|
-
}, [nt]),
|
|
1347
|
+
return c;
|
|
1348
|
+
}, [nt]), ce = T(() => Math.max(Ft || Y, St.length), [St.length, Ft, Y]), [Et, ee] = q(!0), ne = V(rt);
|
|
1349
1349
|
F(() => {
|
|
1350
1350
|
if (((d == null ? void 0 : d.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
|
|
1351
1351
|
const n = ne.current > 0;
|
|
@@ -1353,10 +1353,10 @@ function di(a) {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
ne.current = rt;
|
|
1355
1355
|
}, [rt, d == null ? void 0 : d.ctaButtonMode]);
|
|
1356
|
-
const Bt = V(null), re = V(null), At = V(null), Ht = V(C), Qt = (
|
|
1356
|
+
const Bt = V(null), re = V(null), At = V(null), Ht = V(C), Qt = (c) => {
|
|
1357
1357
|
const n = re.current;
|
|
1358
1358
|
if (!n) return;
|
|
1359
|
-
const s = n.querySelector(`[data-variant-row="${
|
|
1359
|
+
const s = n.querySelector(`[data-variant-row="${c}"]`);
|
|
1360
1360
|
if (!s) return;
|
|
1361
1361
|
const u = n.getBoundingClientRect(), p = s.getBoundingClientRect(), y = 8;
|
|
1362
1362
|
if (p.top >= u.top + y && p.bottom <= u.bottom - y) return;
|
|
@@ -1365,14 +1365,14 @@ function di(a) {
|
|
|
1365
1365
|
};
|
|
1366
1366
|
return F(() => {
|
|
1367
1367
|
if (!t) return;
|
|
1368
|
-
const
|
|
1368
|
+
const c = (n) => {
|
|
1369
1369
|
n.key === "Escape" && e();
|
|
1370
1370
|
};
|
|
1371
|
-
return window.addEventListener("keydown",
|
|
1371
|
+
return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
1372
1372
|
}, [e, t]), F(() => {
|
|
1373
1373
|
if (typeof window > "u") return;
|
|
1374
|
-
const
|
|
1375
|
-
return
|
|
1374
|
+
const c = () => dt({ width: window.innerWidth, height: window.innerHeight });
|
|
1375
|
+
return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
|
|
1376
1376
|
}, []), F(() => {
|
|
1377
1377
|
if (W.current != null && (window.clearTimeout(W.current), W.current = null), t) {
|
|
1378
1378
|
M(!0);
|
|
@@ -1384,19 +1384,19 @@ function di(a) {
|
|
|
1384
1384
|
}, [t]), F(() => () => {
|
|
1385
1385
|
W.current != null && window.clearTimeout(W.current);
|
|
1386
1386
|
}, []), F(() => () => {
|
|
1387
|
-
|
|
1387
|
+
Nt.current != null && window.clearTimeout(Nt.current);
|
|
1388
1388
|
}, []), F(() => () => {
|
|
1389
1389
|
ft.current != null && window.clearTimeout(ft.current);
|
|
1390
1390
|
}, []), F(() => {
|
|
1391
1391
|
if (!t || !z) return;
|
|
1392
|
-
const
|
|
1392
|
+
const c = requestAnimationFrame(() => {
|
|
1393
1393
|
var n;
|
|
1394
1394
|
return (n = $t.current) == null ? void 0 : n.focus();
|
|
1395
1395
|
});
|
|
1396
|
-
return () => cancelAnimationFrame(
|
|
1396
|
+
return () => cancelAnimationFrame(c);
|
|
1397
1397
|
}, [t, z]), F(() => {
|
|
1398
|
-
const
|
|
1399
|
-
if (Ht.current = C, C <=
|
|
1398
|
+
const c = Ht.current;
|
|
1399
|
+
if (Ht.current = C, C <= c) return;
|
|
1400
1400
|
const n = At.current;
|
|
1401
1401
|
if (!n) return;
|
|
1402
1402
|
const s = nt.some((g) => g.minBundleSize === C), u = nt.find((g) => g.minBundleSize > C), p = u && s ? u.minBundleSize - 1 : u ? null : C - 1;
|
|
@@ -1412,15 +1412,15 @@ function di(a) {
|
|
|
1412
1412
|
return () => cancelAnimationFrame(y);
|
|
1413
1413
|
}, [C, nt]), F(() => {
|
|
1414
1414
|
if (!t) return;
|
|
1415
|
-
const
|
|
1416
|
-
if (Dt.current = C, C <=
|
|
1415
|
+
const c = Dt.current;
|
|
1416
|
+
if (Dt.current = C, C <= c) return;
|
|
1417
1417
|
const n = nt.find((s) => s.minBundleSize === C);
|
|
1418
1418
|
n && (jt(`You received a ${B(n.discountPercent)}% discount!`), Xt((s) => s + 1), Lt(!0), ft.current != null && window.clearTimeout(ft.current), ft.current = window.setTimeout(() => {
|
|
1419
1419
|
Lt(!1), ft.current = null;
|
|
1420
1420
|
}, h));
|
|
1421
1421
|
}, [C, t, nt]), F(() => {
|
|
1422
1422
|
if (!t || !Mt || !wt) return;
|
|
1423
|
-
const
|
|
1423
|
+
const c = requestAnimationFrame(() => {
|
|
1424
1424
|
var x;
|
|
1425
1425
|
const n = ut.current, s = n == null ? void 0 : n.getBoundingClientRect(), u = (x = Bt.current) == null ? void 0 : x.getBoundingClientRect(), p = s ? s.left + s.width / 2 : u ? u.left + u.width / 2 : window.innerWidth / 2, y = s ? s.top + s.height / 2 : u ? u.top + u.height / 2 : window.innerHeight / 2, g = {
|
|
1426
1426
|
x: p - 2,
|
|
@@ -1428,27 +1428,27 @@ function di(a) {
|
|
|
1428
1428
|
w: 4,
|
|
1429
1429
|
h: 4
|
|
1430
1430
|
};
|
|
1431
|
-
zt(g),
|
|
1432
|
-
Ct(!1),
|
|
1431
|
+
zt(g), It((k) => k + 1), Ct(!0), Nt.current != null && window.clearTimeout(Nt.current), Nt.current = window.setTimeout(() => {
|
|
1432
|
+
Ct(!1), Nt.current = null;
|
|
1433
1433
|
}, Rt);
|
|
1434
1434
|
});
|
|
1435
|
-
return () => cancelAnimationFrame(
|
|
1435
|
+
return () => cancelAnimationFrame(c);
|
|
1436
1436
|
}, [Wt, wt, Rt, Mt, t]), F(() => {
|
|
1437
|
-
var
|
|
1438
|
-
t && ((
|
|
1439
|
-
}, [t]), H ? /* @__PURE__ */
|
|
1437
|
+
var c;
|
|
1438
|
+
t && ((c = Bt.current) == null || c.focus());
|
|
1439
|
+
}, [t]), H ? /* @__PURE__ */ N(
|
|
1440
1440
|
"div",
|
|
1441
1441
|
{
|
|
1442
1442
|
role: "dialog",
|
|
1443
1443
|
"aria-modal": "true",
|
|
1444
1444
|
"aria-label": "Bundle builder",
|
|
1445
1445
|
className: [f.backdrop, t ? f.backdropOpen : f.backdropClosed, a.className].filter(Boolean).join(" "),
|
|
1446
|
-
onMouseDown: (
|
|
1447
|
-
|
|
1446
|
+
onMouseDown: (c) => {
|
|
1447
|
+
c.target === c.currentTarget && e();
|
|
1448
1448
|
},
|
|
1449
1449
|
children: [
|
|
1450
|
-
kt && ht && U.width > 0 && U.height > 0 ? /* @__PURE__ */
|
|
1451
|
-
|
|
1450
|
+
kt && ht && U.width > 0 && U.height > 0 ? /* @__PURE__ */ l(
|
|
1451
|
+
ln,
|
|
1452
1452
|
{
|
|
1453
1453
|
width: U.width,
|
|
1454
1454
|
height: U.height,
|
|
@@ -1464,10 +1464,10 @@ function di(a) {
|
|
|
1464
1464
|
},
|
|
1465
1465
|
Tt
|
|
1466
1466
|
) : null,
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
Mt && wt ? /* @__PURE__ */
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ N("aside", { ref: Bt, className: [f.panel, t ? f.panelOpen : f.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
|
|
1468
|
+
Mt && wt ? /* @__PURE__ */ l("div", { className: f.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ l("div", { ref: ut, className: f.celebrationChip, children: wt }, Wt) }) : null,
|
|
1469
|
+
/* @__PURE__ */ N("header", { className: [f.header, z ? f.headerSearchOpen : null].filter(Boolean).join(" "), children: [
|
|
1470
|
+
/* @__PURE__ */ l(
|
|
1471
1471
|
"button",
|
|
1472
1472
|
{
|
|
1473
1473
|
type: "button",
|
|
@@ -1477,13 +1477,13 @@ function di(a) {
|
|
|
1477
1477
|
onClick: () => {
|
|
1478
1478
|
yt(!0);
|
|
1479
1479
|
},
|
|
1480
|
-
children: /* @__PURE__ */
|
|
1480
|
+
children: /* @__PURE__ */ l(pn, { size: 18, "aria-hidden": "true" })
|
|
1481
1481
|
}
|
|
1482
1482
|
),
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ N("div", { className: f.headerCenter, children: [
|
|
1484
|
+
/* @__PURE__ */ l("div", { className: f.headerTitleWrap, "aria-hidden": z, children: /* @__PURE__ */ l("h2", { className: f.title, children: L }) }),
|
|
1485
|
+
/* @__PURE__ */ l("div", { className: f.headerSearchWrap, "aria-hidden": !z, children: /* @__PURE__ */ N("div", { className: f.searchBar, children: [
|
|
1486
|
+
/* @__PURE__ */ l(
|
|
1487
1487
|
"input",
|
|
1488
1488
|
{
|
|
1489
1489
|
ref: $t,
|
|
@@ -1491,23 +1491,23 @@ function di(a) {
|
|
|
1491
1491
|
type: "search",
|
|
1492
1492
|
value: Z,
|
|
1493
1493
|
placeholder: "Search",
|
|
1494
|
-
onChange: (
|
|
1494
|
+
onChange: (c) => gt(c.target.value),
|
|
1495
1495
|
onBlur: () => {
|
|
1496
1496
|
Z.trim() === "" && yt(!1);
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
1499
|
),
|
|
1500
|
-
Z.trim() ? /* @__PURE__ */
|
|
1500
|
+
Z.trim() ? /* @__PURE__ */ l(
|
|
1501
1501
|
"button",
|
|
1502
1502
|
{
|
|
1503
1503
|
type: "button",
|
|
1504
1504
|
className: f.searchClearButton,
|
|
1505
|
-
onMouseDown: (
|
|
1506
|
-
|
|
1505
|
+
onMouseDown: (c) => {
|
|
1506
|
+
c.preventDefault();
|
|
1507
1507
|
},
|
|
1508
1508
|
onClick: () => {
|
|
1509
|
-
var
|
|
1510
|
-
gt(""), (
|
|
1509
|
+
var c;
|
|
1510
|
+
gt(""), (c = $t.current) == null || c.focus();
|
|
1511
1511
|
},
|
|
1512
1512
|
"aria-label": "Clear search",
|
|
1513
1513
|
children: "Clear"
|
|
@@ -1515,74 +1515,74 @@ function di(a) {
|
|
|
1515
1515
|
) : null
|
|
1516
1516
|
] }) })
|
|
1517
1517
|
] }),
|
|
1518
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ l("button", { type: "button", onClick: e, disabled: i, className: f.closeButton, "aria-label": "Close", children: "×" })
|
|
1519
1519
|
] }),
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
o ? /* @__PURE__ */
|
|
1522
|
-
r ? /* @__PURE__ */
|
|
1523
|
-
/* @__PURE__ */
|
|
1520
|
+
/* @__PURE__ */ N("div", { className: f.body, ref: re, children: [
|
|
1521
|
+
o ? /* @__PURE__ */ l("p", { className: f.muted, children: "Loading…" }) : null,
|
|
1522
|
+
r ? /* @__PURE__ */ l("p", { className: f.error, children: r }) : null,
|
|
1523
|
+
/* @__PURE__ */ l("div", { className: f.variants, children: /* @__PURE__ */ l("ul", { className: f.variantList, children: vt.map((c) => {
|
|
1524
1524
|
var Gt, Yt, it, tt;
|
|
1525
|
-
const n =
|
|
1526
|
-
return /* @__PURE__ */
|
|
1525
|
+
const n = ct[c.id] ?? 0, s = E(c), u = R(c.selectedOptions), p = $(c), y = O(c.id), g = y ?? Number.POSITIVE_INFINITY, x = n >= g, k = c.availableForSale !== !1 && !mt && !x, D = c.availableForSale === !1 ? null : x ? "Max Reached" : null, P = v, G = Number(c.price), at = P != null && Number.isFinite(P) && P > 0 && Number.isFinite(G), pt = at ? Math.round(G * (1 - P / 100) * 100) / 100 : null;
|
|
1526
|
+
return /* @__PURE__ */ N(
|
|
1527
1527
|
"li",
|
|
1528
1528
|
{
|
|
1529
|
-
className: [f.variantRow,
|
|
1530
|
-
"data-variant-row":
|
|
1529
|
+
className: [f.variantRow, c.availableForSale === !1 && f.variantRowSoldOut].filter(Boolean).join(" "),
|
|
1530
|
+
"data-variant-row": c.id,
|
|
1531
1531
|
children: [
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ N("div", { className: f.variantLeft, children: [
|
|
1533
|
+
/* @__PURE__ */ l("div", { className: f.variantThumb, "aria-hidden": "true", children: (Gt = c.image) != null && Gt.url ? /* @__PURE__ */ l(
|
|
1534
1534
|
"img",
|
|
1535
1535
|
{
|
|
1536
1536
|
className: f.variantThumbImg,
|
|
1537
|
-
src:
|
|
1538
|
-
alt:
|
|
1537
|
+
src: c.image.url,
|
|
1538
|
+
alt: c.image.altText ?? p,
|
|
1539
1539
|
loading: "lazy"
|
|
1540
1540
|
}
|
|
1541
|
-
) : /* @__PURE__ */
|
|
1542
|
-
/* @__PURE__ */
|
|
1543
|
-
/* @__PURE__ */
|
|
1544
|
-
u ? /* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
at ? /* @__PURE__ */
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
pt != null ? pt.toFixed(2) : Number.isFinite(G) ? G.toFixed(2) :
|
|
1541
|
+
) : /* @__PURE__ */ l("div", { className: f.variantThumbFallback, children: ((tt = (it = (Yt = c.product) == null ? void 0 : Yt.title) == null ? void 0 : it.slice(0, 1)) == null ? void 0 : tt.toUpperCase()) ?? "•" }) }),
|
|
1542
|
+
/* @__PURE__ */ N("div", { className: f.variantInfo, children: [
|
|
1543
|
+
/* @__PURE__ */ l("div", { className: f.variantName, children: s }),
|
|
1544
|
+
u ? /* @__PURE__ */ l("div", { className: f.variantMeta, children: u }) : null,
|
|
1545
|
+
/* @__PURE__ */ N("div", { className: f.variantPriceRow, children: [
|
|
1546
|
+
at ? /* @__PURE__ */ l("span", { className: f.variantCompareAt, children: Q(Number.isFinite(G) ? G.toFixed(2) : c.price) }) : null,
|
|
1547
|
+
/* @__PURE__ */ l("span", { className: f.variantPrice, children: Q(
|
|
1548
|
+
pt != null ? pt.toFixed(2) : Number.isFinite(G) ? G.toFixed(2) : c.price
|
|
1549
1549
|
) })
|
|
1550
1550
|
] })
|
|
1551
1551
|
] })
|
|
1552
1552
|
] }),
|
|
1553
|
-
|
|
1553
|
+
c.availableForSale === !1 ? /* @__PURE__ */ l("div", { className: f.soldOutContainer, children: /* @__PURE__ */ N("span", { className: f.soldOut, "aria-label": `${p} is sold out`, children: [
|
|
1554
1554
|
"Sold",
|
|
1555
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ l("br", {}),
|
|
1556
1556
|
"Out"
|
|
1557
|
-
] }) }) : n <= 0 && g <= 0 ? /* @__PURE__ */
|
|
1557
|
+
] }) }) : n <= 0 && g <= 0 ? /* @__PURE__ */ l("div", { className: f.stockLimitContainer, children: /* @__PURE__ */ l("span", { className: f.stockLimitNotice, "aria-label": `${p} max available selected`, children: "Max Added To Cart" }) }) : n <= 0 ? /* @__PURE__ */ l(
|
|
1558
1558
|
"button",
|
|
1559
1559
|
{
|
|
1560
1560
|
type: "button",
|
|
1561
|
-
onClick: () => et(
|
|
1561
|
+
onClick: () => et(c.id, 1),
|
|
1562
1562
|
disabled: i || !k,
|
|
1563
1563
|
className: f.addToBundleButton,
|
|
1564
1564
|
"aria-label": D ? `${p} ${D.toLowerCase()}` : `Add ${p} to bundle`,
|
|
1565
1565
|
children: "Add"
|
|
1566
1566
|
}
|
|
1567
|
-
) : /* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1567
|
+
) : /* @__PURE__ */ N("div", { className: f.qtyControlsWrap, children: [
|
|
1568
|
+
/* @__PURE__ */ N("div", { className: f.qtyControls, children: [
|
|
1569
|
+
/* @__PURE__ */ l(
|
|
1570
1570
|
"button",
|
|
1571
1571
|
{
|
|
1572
1572
|
type: "button",
|
|
1573
|
-
onClick: () => et(
|
|
1573
|
+
onClick: () => et(c.id, n - 1),
|
|
1574
1574
|
disabled: i || n <= 0,
|
|
1575
1575
|
className: f.qtyButton,
|
|
1576
1576
|
"aria-label": `Decrease ${p}`,
|
|
1577
1577
|
children: "−"
|
|
1578
1578
|
}
|
|
1579
1579
|
),
|
|
1580
|
-
/* @__PURE__ */
|
|
1581
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ l("span", { className: f.qtyValue, "aria-label": `Quantity ${n}`, children: n }),
|
|
1581
|
+
/* @__PURE__ */ l(
|
|
1582
1582
|
"button",
|
|
1583
1583
|
{
|
|
1584
1584
|
type: "button",
|
|
1585
|
-
onClick: () => et(
|
|
1585
|
+
onClick: () => et(c.id, n + 1),
|
|
1586
1586
|
disabled: i || !k,
|
|
1587
1587
|
className: f.qtyButton,
|
|
1588
1588
|
"aria-label": D ? `${p} ${D.toLowerCase()}` : `Increase ${p}`,
|
|
@@ -1590,20 +1590,20 @@ function di(a) {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
)
|
|
1592
1592
|
] }),
|
|
1593
|
-
D ? /* @__PURE__ */
|
|
1593
|
+
D ? /* @__PURE__ */ l("div", { className: f.stockLimitNotice, children: D }) : null
|
|
1594
1594
|
] })
|
|
1595
1595
|
]
|
|
1596
1596
|
},
|
|
1597
|
-
|
|
1597
|
+
c.id
|
|
1598
1598
|
);
|
|
1599
1599
|
}) }) })
|
|
1600
1600
|
] }),
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
/* @__PURE__ */
|
|
1601
|
+
/* @__PURE__ */ N("footer", { className: f.footer, ref: j, children: [
|
|
1602
|
+
/* @__PURE__ */ l("div", { className: f.boxSummaryWindow, ref: At, children: /* @__PURE__ */ l("div", { className: f.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ce }).map((c, n) => {
|
|
1603
1603
|
var D, P, G, at;
|
|
1604
1604
|
const s = St[n], u = Ot.get(n), p = !!s, y = !!u, g = y && !p, x = u ? `${u.discountPercent}% off` : null, k = p ? s.displayName : `Slot ${n + 1}`;
|
|
1605
|
-
return /* @__PURE__ */
|
|
1606
|
-
/* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ N("div", { "data-box-slot": n, className: f.boxSlot, children: [
|
|
1606
|
+
/* @__PURE__ */ l(
|
|
1607
1607
|
"div",
|
|
1608
1608
|
{
|
|
1609
1609
|
className: [
|
|
@@ -1620,7 +1620,7 @@ function di(a) {
|
|
|
1620
1620
|
} : void 0,
|
|
1621
1621
|
"aria-label": g && x ? `${k}. Unlocks ${x}.` : k,
|
|
1622
1622
|
title: g && x ? `${k} • Unlocks ${x}` : k,
|
|
1623
|
-
children: p ? (D = s.image) != null && D.url ? /* @__PURE__ */
|
|
1623
|
+
children: p ? (D = s.image) != null && D.url ? /* @__PURE__ */ l(
|
|
1624
1624
|
"img",
|
|
1625
1625
|
{
|
|
1626
1626
|
className: f.boxItemImage,
|
|
@@ -1628,58 +1628,58 @@ function di(a) {
|
|
|
1628
1628
|
alt: s.image.altText ?? s.displayName,
|
|
1629
1629
|
loading: "lazy"
|
|
1630
1630
|
}
|
|
1631
|
-
) : /* @__PURE__ */
|
|
1631
|
+
) : /* @__PURE__ */ l("div", { className: f.boxItemFallback, "aria-hidden": "true", children: ((at = (G = (P = s.product) == null ? void 0 : P.title) == null ? void 0 : G.slice(0, 1)) == null ? void 0 : at.toUpperCase()) ?? "•" }) : g && x ? /* @__PURE__ */ l("div", { className: f.boxItemDiscountText, children: x }) : /* @__PURE__ */ l("div", { className: f.boxItemPlus, "aria-hidden": "true", children: "+" })
|
|
1632
1632
|
}
|
|
1633
1633
|
),
|
|
1634
|
-
y ? /* @__PURE__ */
|
|
1634
|
+
y ? /* @__PURE__ */ l("div", { className: f.boxThresholdLabel, children: u.label }) : null
|
|
1635
1635
|
] }, n);
|
|
1636
1636
|
}) }) }),
|
|
1637
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ l(
|
|
1638
1638
|
"div",
|
|
1639
1639
|
{
|
|
1640
1640
|
className: [f.ctaTotalsWrap, Pt ? f.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
|
|
1641
1641
|
"aria-hidden": !Pt,
|
|
1642
|
-
children: /* @__PURE__ */
|
|
1643
|
-
v ? /* @__PURE__ */
|
|
1642
|
+
children: /* @__PURE__ */ N("div", { className: f.ctaTotals, "aria-label": "Totals", children: [
|
|
1643
|
+
v ? /* @__PURE__ */ N("span", { className: f.ctaDiscountBadge, children: [
|
|
1644
1644
|
v,
|
|
1645
1645
|
"% Discount"
|
|
1646
|
-
] }) : /* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
1648
|
-
/* @__PURE__ */
|
|
1646
|
+
] }) : /* @__PURE__ */ l("span", {}),
|
|
1647
|
+
/* @__PURE__ */ l("span", { children: v ? /* @__PURE__ */ N(xe, { children: [
|
|
1648
|
+
/* @__PURE__ */ l("span", { className: f.ctaTotalsStrike, children: Q(st.toFixed(2)) }),
|
|
1649
1649
|
" ",
|
|
1650
|
-
/* @__PURE__ */
|
|
1651
|
-
] }) : /* @__PURE__ */
|
|
1650
|
+
/* @__PURE__ */ l("span", { className: f.ctaTotalsPrice, children: Q(le.toFixed(2)) })
|
|
1651
|
+
] }) : /* @__PURE__ */ l("span", { className: f.ctaTotalsPrice, children: Q(st.toFixed(2)) }) })
|
|
1652
1652
|
] })
|
|
1653
1653
|
}
|
|
1654
1654
|
),
|
|
1655
1655
|
(() => {
|
|
1656
|
-
const
|
|
1657
|
-
return
|
|
1658
|
-
/* @__PURE__ */
|
|
1656
|
+
const c = (d == null ? void 0 : d.ctaButtonMode) || "add_to_cart";
|
|
1657
|
+
return c === "add_to_cart_checkout" ? rt > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: ot, disabled: !X, className: f.cta, children: i ? "Adding…" : `Add ${rt} more product${rt === 1 ? "" : "s"}` }) : /* @__PURE__ */ N("div", { className: `${f.ctaButtonGroup} ${Et ? f.ctaButtonGroupAnimating : ""}`, children: [
|
|
1658
|
+
/* @__PURE__ */ l(
|
|
1659
1659
|
"button",
|
|
1660
1660
|
{
|
|
1661
1661
|
type: "button",
|
|
1662
1662
|
onClick: ot,
|
|
1663
1663
|
disabled: !X,
|
|
1664
1664
|
className: `${f.ctaDualLeft} ${Et ? f.ctaDualLeftAnimating : ""}`,
|
|
1665
|
-
children: /* @__PURE__ */
|
|
1665
|
+
children: /* @__PURE__ */ l("span", { children: i ? "Adding…" : "Add to Basket" })
|
|
1666
1666
|
}
|
|
1667
1667
|
),
|
|
1668
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ l(
|
|
1669
1669
|
"button",
|
|
1670
1670
|
{
|
|
1671
1671
|
type: "button",
|
|
1672
1672
|
onClick: J,
|
|
1673
1673
|
disabled: !X,
|
|
1674
1674
|
className: `${f.ctaDualRight} ${Et ? f.ctaDualRightAnimating : ""}`,
|
|
1675
|
-
children: /* @__PURE__ */
|
|
1675
|
+
children: /* @__PURE__ */ l("span", { children: i ? "Processing…" : "Checkout" })
|
|
1676
1676
|
}
|
|
1677
1677
|
)
|
|
1678
|
-
] }) :
|
|
1678
|
+
] }) : c === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: J, disabled: !X, className: f.cta, children: i ? "Processing…" : rt > 0 ? `Add ${rt} more product${rt === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ l("button", { type: "button", onClick: ot, disabled: !X, className: f.cta, children: i ? "Adding…" : rt > 0 ? `Add ${rt} more product${rt === 1 ? "" : "s"}` : "Add to Basket" });
|
|
1679
1679
|
})(),
|
|
1680
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ N("div", { className: f.poweredBy, children: [
|
|
1681
1681
|
"powered by ",
|
|
1682
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
|
|
1683
1683
|
] })
|
|
1684
1684
|
] })
|
|
1685
1685
|
] })
|
|
@@ -1687,7 +1687,7 @@ function di(a) {
|
|
|
1687
1687
|
}
|
|
1688
1688
|
) : null;
|
|
1689
1689
|
}
|
|
1690
|
-
const Dr = "_panel_96rr4_2", Er = "_header_96rr4_20", qr = "_title_96rr4_24", Vr = "_status_96rr4_32", zr = "_error_96rr4_37", Wr = "_inactive_96rr4_43", jr = "_section_96rr4_49", Ur = "_sectionTitle_96rr4_54", Hr = "_rulesVisual_96rr4_107", Qr = "_rulesLabelsRow_96rr4_114", Gr = "_rulesLinesRow_96rr4_121", Yr = "_rulesLineLabelCell_96rr4_128", Kr = "_rulesLineLabel_96rr4_128", Xr = "_rulesLine_96rr4_121", Jr = "_rulesLineEmpty_96rr4_162", Zr = "_rulesLineFilled_96rr4_166", ta = "_variants_96rr4_170", ea = "_variantList_96rr4_178", na = "_variantRow_96rr4_186", ra = "_variantRowInteractive_96rr4_198", aa = "_variantRowSelected_96rr4_202", ia = "_variantRowSoldOut_96rr4_207", oa = "_variantMedia_96rr4_211", sa = "_variantContent_96rr4_219",
|
|
1690
|
+
const Dr = "_panel_96rr4_2", Er = "_header_96rr4_20", qr = "_title_96rr4_24", Vr = "_status_96rr4_32", zr = "_error_96rr4_37", Wr = "_inactive_96rr4_43", jr = "_section_96rr4_49", Ur = "_sectionTitle_96rr4_54", Hr = "_rulesVisual_96rr4_107", Qr = "_rulesLabelsRow_96rr4_114", Gr = "_rulesLinesRow_96rr4_121", Yr = "_rulesLineLabelCell_96rr4_128", Kr = "_rulesLineLabel_96rr4_128", Xr = "_rulesLine_96rr4_121", Jr = "_rulesLineEmpty_96rr4_162", Zr = "_rulesLineFilled_96rr4_166", ta = "_variants_96rr4_170", ea = "_variantList_96rr4_178", na = "_variantRow_96rr4_186", ra = "_variantRowInteractive_96rr4_198", aa = "_variantRowSelected_96rr4_202", ia = "_variantRowSoldOut_96rr4_207", oa = "_variantMedia_96rr4_211", sa = "_variantContent_96rr4_219", la = "_variantHeader_96rr4_227", ca = "_variantTitle_96rr4_233", ua = "_variantImage_96rr4_247", da = "_variantImageFallback_96rr4_255", ha = "_variantMeta_96rr4_268", ma = "_variantPrice_96rr4_273", fa = "_variantFooterRow_96rr4_279", ba = "_variantActions_96rr4_286", pa = "_qtyActions_96rr4_292", _a = "_qtyActionsWrap_96rr4_298", ya = "_soldOut_96rr4_349", ga = "_stockLimitNotice_96rr4_357", wa = "_qtyChip_96rr4_366", va = "_qtyChipInteractive_96rr4_381", xa = "_qtyChipValue_96rr4_385", Ca = "_qtyChipPlus_96rr4_391", Ia = "_qtyChipClear_96rr4_396", Na = "_qtyTrash_96rr4_425", Sa = "_footer_96rr4_437", Ba = "_boxSummaryWindow_96rr4_442", Ta = "_boxSummaryRow_96rr4_456", ka = "_boxSlot_96rr4_464", Ra = "_boxItem_96rr4_473", Ma = "_boxItemFilled_96rr4_490", La = "_boxItemPlaceholder_96rr4_496", Pa = "_boxItemThreshold_96rr4_502", Fa = "_boxItemClickable_96rr4_510", Oa = "_boxItemImage_96rr4_519", Aa = "_boxItemFallback_96rr4_530", $a = "_boxItemPlus_96rr4_543", Da = "_boxItemDiscountText_96rr4_555", Ea = "_boxThresholdLabel_96rr4_568", qa = "_totalsReveal_96rr4_579", Va = "_totalsRevealOpen_96rr4_587", za = "_ctaTotalsWrap_96rr4_592", Wa = "_ctaTotalsWrapVisible_96rr4_597", ja = "_ctaTotals_96rr4_592", Ua = "_ctaDiscountBadge_96rr4_612", Ha = "_ctaTotalsStrike_96rr4_623", Qa = "_ctaTotalsPrice_96rr4_629", Ga = "_cta_96rr4_592", Ya = "_ctaButtonGroup_96rr4_661", Ka = "_ctaDualLeft_96rr4_667", Xa = "_ctaDualRight_96rr4_668", Ja = "_poweredBy_96rr4_695", b = {
|
|
1691
1691
|
panel: Dr,
|
|
1692
1692
|
header: Er,
|
|
1693
1693
|
title: qr,
|
|
@@ -1712,8 +1712,8 @@ const Dr = "_panel_96rr4_2", Er = "_header_96rr4_20", qr = "_title_96rr4_24", Vr
|
|
|
1712
1712
|
variantRowSoldOut: ia,
|
|
1713
1713
|
variantMedia: oa,
|
|
1714
1714
|
variantContent: sa,
|
|
1715
|
-
variantHeader:
|
|
1716
|
-
variantTitle:
|
|
1715
|
+
variantHeader: la,
|
|
1716
|
+
variantTitle: ca,
|
|
1717
1717
|
variantImage: ua,
|
|
1718
1718
|
variantImageFallback: da,
|
|
1719
1719
|
variantMeta: ha,
|
|
@@ -1728,8 +1728,8 @@ const Dr = "_panel_96rr4_2", Er = "_header_96rr4_20", qr = "_title_96rr4_24", Vr
|
|
|
1728
1728
|
qtyChipInteractive: va,
|
|
1729
1729
|
qtyChipValue: xa,
|
|
1730
1730
|
qtyChipPlus: Ca,
|
|
1731
|
-
qtyChipClear:
|
|
1732
|
-
qtyTrash:
|
|
1731
|
+
qtyChipClear: Ia,
|
|
1732
|
+
qtyTrash: Na,
|
|
1733
1733
|
footer: Sa,
|
|
1734
1734
|
boxSummaryWindow: Ba,
|
|
1735
1735
|
boxSummaryRow: Ta,
|
|
@@ -1769,7 +1769,7 @@ function hi(a) {
|
|
|
1769
1769
|
eligibleVariants: m,
|
|
1770
1770
|
selections: d,
|
|
1771
1771
|
selectionOrder: S,
|
|
1772
|
-
getVariantMaxSelectableQuantity:
|
|
1772
|
+
getVariantMaxSelectableQuantity: ct,
|
|
1773
1773
|
setQuantity: A,
|
|
1774
1774
|
bundleSize: O,
|
|
1775
1775
|
minRequired: et,
|
|
@@ -1808,7 +1808,7 @@ function hi(a) {
|
|
|
1808
1808
|
if (!U) return null;
|
|
1809
1809
|
const h = Number.parseFloat(U.discountPercent);
|
|
1810
1810
|
return !Number.isFinite(h) || h <= 0 ? null : h;
|
|
1811
|
-
}, [U]), Tt = j[0],
|
|
1811
|
+
}, [U]), Tt = j[0], It = !!(Tt && O >= Tt.minBundleSize), ht = T(() => {
|
|
1812
1812
|
const h = new Map(m.map((w) => [w.id, w]));
|
|
1813
1813
|
let _ = 0;
|
|
1814
1814
|
for (const [w, B] of Object.entries(d)) {
|
|
@@ -1825,7 +1825,7 @@ function hi(a) {
|
|
|
1825
1825
|
}, [dt, ht]), kt = T(() => j.length ? Math.max(...j.map((h) => h.minBundleSize)) : 0, [j]), Ct = T(() => {
|
|
1826
1826
|
const h = new Map(m.map((_) => [_.id, _]));
|
|
1827
1827
|
return S.map((_) => h.get(_)).filter((_) => !!_);
|
|
1828
|
-
}, [m, S]),
|
|
1828
|
+
}, [m, S]), Nt = T(() => {
|
|
1829
1829
|
var _;
|
|
1830
1830
|
const h = /* @__PURE__ */ new Map();
|
|
1831
1831
|
for (const w of j) {
|
|
@@ -1864,19 +1864,19 @@ function hi(a) {
|
|
|
1864
1864
|
const w = _.querySelector(`[data-variant-row="${h}"]`);
|
|
1865
1865
|
w && w.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
1866
1866
|
};
|
|
1867
|
-
return /* @__PURE__ */
|
|
1868
|
-
/* @__PURE__ */
|
|
1869
|
-
t ? /* @__PURE__ */
|
|
1870
|
-
o ? /* @__PURE__ */
|
|
1871
|
-
!t && r && !r.isActive ? /* @__PURE__ */
|
|
1872
|
-
J && j.length ? /* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
1867
|
+
return /* @__PURE__ */ N("section", { className: [b.panel, ot].filter(Boolean).join(" "), "aria-busy": t, children: [
|
|
1868
|
+
/* @__PURE__ */ l("header", { className: b.header, children: /* @__PURE__ */ l("h2", { className: b.title, children: Rt }) }),
|
|
1869
|
+
t ? /* @__PURE__ */ l("div", { className: b.status, children: "Loading…" }) : null,
|
|
1870
|
+
o ? /* @__PURE__ */ l("div", { className: b.error, children: o }) : null,
|
|
1871
|
+
!t && r && !r.isActive ? /* @__PURE__ */ l("div", { className: b.inactive, children: "Bundles are not active." }) : null,
|
|
1872
|
+
J && j.length ? /* @__PURE__ */ l("div", { className: b.section, children: /* @__PURE__ */ N("div", { className: b.rulesVisual, children: [
|
|
1873
|
+
/* @__PURE__ */ l("div", { className: b.rulesLabelsRow, children: Array.from({ length: kt }).map((h, _) => {
|
|
1874
1874
|
const w = _ + 1, B = j.find((E) => E.minBundleSize === w), R = B ? `${yt(B.discountPercent)}% off` : null;
|
|
1875
|
-
return /* @__PURE__ */
|
|
1875
|
+
return /* @__PURE__ */ l("div", { className: b.rulesLineLabelCell, children: R ? /* @__PURE__ */ l("span", { className: b.rulesLineLabel, children: R }) : null }, w);
|
|
1876
1876
|
}) }),
|
|
1877
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ l("div", { className: b.rulesLinesRow, children: Array.from({ length: kt }).map((h, _) => {
|
|
1878
1878
|
const w = _ + 1, B = O >= w;
|
|
1879
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ l(
|
|
1880
1880
|
"div",
|
|
1881
1881
|
{
|
|
1882
1882
|
className: [
|
|
@@ -1888,12 +1888,12 @@ function hi(a) {
|
|
|
1888
1888
|
);
|
|
1889
1889
|
}) })
|
|
1890
1890
|
] }) }) : null,
|
|
1891
|
-
z ? /* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1891
|
+
z ? /* @__PURE__ */ N("div", { className: b.section, ref: wt, children: [
|
|
1892
|
+
/* @__PURE__ */ l("div", { className: b.sectionTitle, children: "Select items" }),
|
|
1893
|
+
/* @__PURE__ */ l("div", { className: b.variants, children: /* @__PURE__ */ l("ul", { className: b.variantList, children: $t.map((h) => {
|
|
1894
1894
|
var Q;
|
|
1895
|
-
const _ = d[h.id] ?? 0, w = Z(h.selectedOptions), B = h.availableForSale === !1, R =
|
|
1896
|
-
return /* @__PURE__ */
|
|
1895
|
+
const _ = d[h.id] ?? 0, w = Z(h.selectedOptions), B = h.availableForSale === !1, R = ct(h.id), E = R ?? Number.POSITIVE_INFINITY, $ = _ >= E, H = !B && !Xt && !$, M = H, W = !B && $ ? "Max Reached" : null;
|
|
1896
|
+
return /* @__PURE__ */ N(
|
|
1897
1897
|
"li",
|
|
1898
1898
|
{
|
|
1899
1899
|
className: [
|
|
@@ -1913,7 +1913,7 @@ function hi(a) {
|
|
|
1913
1913
|
} : void 0,
|
|
1914
1914
|
"aria-label": B ? `${h.displayName} is sold out` : W ? `${h.displayName} ${W.toLowerCase()}` : `Add ${h.displayName} to bundle`,
|
|
1915
1915
|
children: [
|
|
1916
|
-
/* @__PURE__ */
|
|
1916
|
+
/* @__PURE__ */ l("div", { className: b.variantMedia, children: (Q = h.image) != null && Q.url ? /* @__PURE__ */ l(
|
|
1917
1917
|
"img",
|
|
1918
1918
|
{
|
|
1919
1919
|
src: h.image.url,
|
|
@@ -1923,17 +1923,17 @@ function hi(a) {
|
|
|
1923
1923
|
className: b.variantImage,
|
|
1924
1924
|
loading: "lazy"
|
|
1925
1925
|
}
|
|
1926
|
-
) : /* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
/* @__PURE__ */
|
|
1929
|
-
/* @__PURE__ */
|
|
1930
|
-
w ? /* @__PURE__ */
|
|
1926
|
+
) : /* @__PURE__ */ l("div", { className: b.variantImageFallback, children: "Item" }) }),
|
|
1927
|
+
/* @__PURE__ */ N("div", { className: b.variantContent, children: [
|
|
1928
|
+
/* @__PURE__ */ N("div", { className: b.variantHeader, children: [
|
|
1929
|
+
/* @__PURE__ */ l("div", { className: b.variantTitle, children: h.displayName }),
|
|
1930
|
+
w ? /* @__PURE__ */ l("div", { className: b.variantMeta, children: w }) : null
|
|
1931
1931
|
] }),
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1934
|
-
/* @__PURE__ */
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
_ > 0 ? /* @__PURE__ */
|
|
1932
|
+
/* @__PURE__ */ N("div", { className: b.variantFooterRow, children: [
|
|
1933
|
+
/* @__PURE__ */ l("div", { className: b.variantPrice, children: gt(h.price) }),
|
|
1934
|
+
/* @__PURE__ */ l("div", { className: b.variantActions, children: B ? /* @__PURE__ */ l("div", { className: b.soldOut, "aria-label": `${h.displayName} is sold out`, children: "Sold Out" }) : _ <= 0 && E <= 0 ? /* @__PURE__ */ l("div", { className: b.stockLimitNotice, "aria-label": `${h.displayName} max available selected`, children: "Max Added To Cart" }) : /* @__PURE__ */ N("div", { className: b.qtyActionsWrap, children: [
|
|
1935
|
+
/* @__PURE__ */ N("div", { className: b.qtyActions, children: [
|
|
1936
|
+
_ > 0 ? /* @__PURE__ */ l(
|
|
1937
1937
|
"button",
|
|
1938
1938
|
{
|
|
1939
1939
|
type: "button",
|
|
@@ -1945,10 +1945,10 @@ function hi(a) {
|
|
|
1945
1945
|
onKeyDown: (L) => {
|
|
1946
1946
|
L.stopPropagation();
|
|
1947
1947
|
},
|
|
1948
|
-
children: /* @__PURE__ */
|
|
1948
|
+
children: /* @__PURE__ */ l(yn, { size: 14 })
|
|
1949
1949
|
}
|
|
1950
1950
|
) : null,
|
|
1951
|
-
/* @__PURE__ */
|
|
1951
|
+
/* @__PURE__ */ l(
|
|
1952
1952
|
"div",
|
|
1953
1953
|
{
|
|
1954
1954
|
className: [b.qtyChip, H ? b.qtyChipInteractive : null].filter(Boolean).join(" "),
|
|
@@ -1961,9 +1961,9 @@ function hi(a) {
|
|
|
1961
1961
|
},
|
|
1962
1962
|
role: H ? "button" : void 0,
|
|
1963
1963
|
tabIndex: H ? 0 : void 0,
|
|
1964
|
-
children: _ <= 0 ? /* @__PURE__ */
|
|
1965
|
-
/* @__PURE__ */
|
|
1966
|
-
/* @__PURE__ */
|
|
1964
|
+
children: _ <= 0 ? /* @__PURE__ */ l("span", { className: b.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ l(Oe, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ N(xe, { children: [
|
|
1965
|
+
/* @__PURE__ */ l("span", { className: b.qtyChipValue, children: _ }),
|
|
1966
|
+
/* @__PURE__ */ l(
|
|
1967
1967
|
"button",
|
|
1968
1968
|
{
|
|
1969
1969
|
type: "button",
|
|
@@ -1976,14 +1976,14 @@ function hi(a) {
|
|
|
1976
1976
|
L.stopPropagation();
|
|
1977
1977
|
},
|
|
1978
1978
|
disabled: !H,
|
|
1979
|
-
children: /* @__PURE__ */
|
|
1979
|
+
children: /* @__PURE__ */ l(Oe, { size: 12, strokeWidth: 2 })
|
|
1980
1980
|
}
|
|
1981
1981
|
)
|
|
1982
1982
|
] })
|
|
1983
1983
|
}
|
|
1984
1984
|
)
|
|
1985
1985
|
] }),
|
|
1986
|
-
W ? /* @__PURE__ */
|
|
1986
|
+
W ? /* @__PURE__ */ l("div", { className: b.stockLimitNotice, children: W }) : null
|
|
1987
1987
|
] }) })
|
|
1988
1988
|
] })
|
|
1989
1989
|
] })
|
|
@@ -1993,12 +1993,12 @@ function hi(a) {
|
|
|
1993
1993
|
);
|
|
1994
1994
|
}) }) })
|
|
1995
1995
|
] }) : null,
|
|
1996
|
-
/* @__PURE__ */
|
|
1997
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ N("footer", { className: b.footer, children: [
|
|
1997
|
+
/* @__PURE__ */ l("div", { className: b.boxSummaryWindow, ref: jt, children: /* @__PURE__ */ l("div", { className: b.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Wt }).map((h, _) => {
|
|
1998
1998
|
var W, Q, L, Ut;
|
|
1999
|
-
const w = Ct[_], B =
|
|
2000
|
-
return /* @__PURE__ */
|
|
2001
|
-
/* @__PURE__ */
|
|
1999
|
+
const w = Ct[_], B = Nt.get(_), R = !!w, E = !!B, $ = E && !R, H = B ? `${B.discountPercent}% off` : null, M = R ? w.displayName : `Slot ${_ + 1}`;
|
|
2000
|
+
return /* @__PURE__ */ N("div", { "data-box-slot": _, className: b.boxSlot, children: [
|
|
2001
|
+
/* @__PURE__ */ l(
|
|
2002
2002
|
"div",
|
|
2003
2003
|
{
|
|
2004
2004
|
className: [
|
|
@@ -2015,7 +2015,7 @@ function hi(a) {
|
|
|
2015
2015
|
} : void 0,
|
|
2016
2016
|
"aria-label": $ && H ? `${M}. Unlocks ${H}.` : M,
|
|
2017
2017
|
title: $ && H ? `${M} • Unlocks ${H}` : M,
|
|
2018
|
-
children: R ? (W = w.image) != null && W.url ? /* @__PURE__ */
|
|
2018
|
+
children: R ? (W = w.image) != null && W.url ? /* @__PURE__ */ l(
|
|
2019
2019
|
"img",
|
|
2020
2020
|
{
|
|
2021
2021
|
className: b.boxItemImage,
|
|
@@ -2025,41 +2025,41 @@ function hi(a) {
|
|
|
2025
2025
|
height: 1,
|
|
2026
2026
|
loading: "lazy"
|
|
2027
2027
|
}
|
|
2028
|
-
) : /* @__PURE__ */
|
|
2028
|
+
) : /* @__PURE__ */ l("div", { className: b.boxItemFallback, "aria-hidden": "true", children: ((Ut = (L = (Q = w.product) == null ? void 0 : Q.title) == null ? void 0 : L.slice(0, 1)) == null ? void 0 : Ut.toUpperCase()) ?? "•" }) : $ && H ? /* @__PURE__ */ l("div", { className: b.boxItemDiscountText, children: H }) : /* @__PURE__ */ l("div", { className: b.boxItemPlus, "aria-hidden": "true", children: "+" })
|
|
2029
2029
|
}
|
|
2030
2030
|
),
|
|
2031
|
-
E ? /* @__PURE__ */
|
|
2031
|
+
E ? /* @__PURE__ */ l("div", { className: b.boxThresholdLabel, children: B.label }) : null
|
|
2032
2032
|
] }, _);
|
|
2033
2033
|
}) }) }),
|
|
2034
|
-
/* @__PURE__ */
|
|
2034
|
+
/* @__PURE__ */ l("div", { className: [b.totalsReveal, It ? b.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ l(
|
|
2035
2035
|
"div",
|
|
2036
2036
|
{
|
|
2037
|
-
className: [b.ctaTotalsWrap,
|
|
2038
|
-
"aria-hidden": !
|
|
2039
|
-
children: /* @__PURE__ */
|
|
2040
|
-
dt ? /* @__PURE__ */
|
|
2037
|
+
className: [b.ctaTotalsWrap, It ? b.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
|
|
2038
|
+
"aria-hidden": !It,
|
|
2039
|
+
children: /* @__PURE__ */ N("div", { className: b.ctaTotals, "aria-label": "Totals", children: [
|
|
2040
|
+
dt ? /* @__PURE__ */ N("span", { className: b.ctaDiscountBadge, children: [
|
|
2041
2041
|
dt,
|
|
2042
2042
|
"% Discount"
|
|
2043
|
-
] }) : /* @__PURE__ */
|
|
2044
|
-
/* @__PURE__ */
|
|
2045
|
-
/* @__PURE__ */
|
|
2043
|
+
] }) : /* @__PURE__ */ l("span", {}),
|
|
2044
|
+
/* @__PURE__ */ l("span", { children: dt ? /* @__PURE__ */ N(xe, { children: [
|
|
2045
|
+
/* @__PURE__ */ l("span", { className: b.ctaTotalsStrike, children: gt(ht.toFixed(2)) }),
|
|
2046
2046
|
" ",
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
] }) : /* @__PURE__ */
|
|
2047
|
+
/* @__PURE__ */ l("span", { className: b.ctaTotalsPrice, children: gt(zt.toFixed(2)) })
|
|
2048
|
+
] }) : /* @__PURE__ */ l("span", { className: b.ctaTotalsPrice, children: gt(ht.toFixed(2)) }) })
|
|
2049
2049
|
] })
|
|
2050
2050
|
}
|
|
2051
2051
|
) }),
|
|
2052
2052
|
(() => {
|
|
2053
2053
|
const h = (r == null ? void 0 : r.ctaButtonMode) || "add_to_cart";
|
|
2054
|
-
return h === "add_to_cart_checkout" ? ut > 0 ? /* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
/* @__PURE__ */
|
|
2057
|
-
] }) : h === "checkout" ? /* @__PURE__ */
|
|
2054
|
+
return h === "add_to_cart_checkout" ? ut > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: Y, disabled: !C, className: b.cta, children: e ? "Adding…" : `Add ${ut} more product${ut === 1 ? "" : "s"}` }) : /* @__PURE__ */ N("div", { className: b.ctaButtonGroup, children: [
|
|
2055
|
+
/* @__PURE__ */ l("button", { type: "button", onClick: Y, disabled: !C, className: b.ctaDualLeft, children: /* @__PURE__ */ l("span", { children: e ? "Adding…" : "Add to Basket" }) }),
|
|
2056
|
+
/* @__PURE__ */ l("button", { type: "button", onClick: X, disabled: !C, className: b.ctaDualRight, children: /* @__PURE__ */ l("span", { children: e ? "Processing…" : "Checkout" }) })
|
|
2057
|
+
] }) : h === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: X, disabled: !C, className: b.cta, children: e ? "Processing…" : ut > 0 ? `Add ${ut} more product${ut === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ l("button", { type: "button", onClick: Y, disabled: !C, className: b.cta, children: e ? "Adding…" : ut > 0 ? `Add ${ut} more product${ut === 1 ? "" : "s"}` : "Add to Basket" });
|
|
2058
2058
|
})(),
|
|
2059
|
-
/* @__PURE__ */
|
|
2059
|
+
/* @__PURE__ */ N("div", { className: b.poweredBy, children: [
|
|
2060
2060
|
"powered by",
|
|
2061
2061
|
" ",
|
|
2062
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
|
|
2063
2063
|
] })
|
|
2064
2064
|
] })
|
|
2065
2065
|
] });
|
|
@@ -2178,9 +2178,9 @@ export {
|
|
|
2178
2178
|
hi as BundleBuilderPanel,
|
|
2179
2179
|
ui as BundleButton,
|
|
2180
2180
|
ue as BundleLineAttributeKeys,
|
|
2181
|
-
|
|
2181
|
+
li as BundleProvider,
|
|
2182
2182
|
mi as createLiquidCartAdapter,
|
|
2183
2183
|
be as useBundleBuilder,
|
|
2184
|
-
|
|
2184
|
+
ci as useBundleBuilderDrawer
|
|
2185
2185
|
};
|
|
2186
2186
|
//# sourceMappingURL=index.js.map
|